diff --git a/src/client/AbstractTexturePack.cpp b/src/client/AbstractTexturePack.cpp index 45514ccd..a54413de 100644 --- a/src/client/AbstractTexturePack.cpp +++ b/src/client/AbstractTexturePack.cpp @@ -4,7 +4,7 @@ #include "InputOutputStream.h" #include "StringHelpers.h" -AbstractTexturePack::AbstractTexturePack(DWORD id, File *file, const wstring &name, TexturePack *fallback) : id(id), name(name) +AbstractTexturePack::AbstractTexturePack(unsigned long id, File *file, const wstring &name, TexturePack *fallback) : id(id), name(name) { // 4J init textureId = -1; @@ -38,14 +38,14 @@ void AbstractTexturePack::loadIcon() { #ifdef _XBOX // 4J Stu - Temporary only - const DWORD LOCATOR_SIZE = 256; // Use this to allocate space to hold a ResourceLocator string - WCHAR szResourceLocator[ LOCATOR_SIZE ]; + const unsigned long LOCATOR_SIZE = 256; // Use this to allocate space to hold a ResourceLocator string + wchar_t szResourceLocator[ LOCATOR_SIZE ]; - const ULONG_PTR c_ModuleHandle = (ULONG_PTR)GetModuleHandle(NULL); + const uintptr_t c_ModuleHandle = (uintptr_t)GetModuleHandle(NULL); swprintf(szResourceLocator, LOCATOR_SIZE ,L"section://%X,%ls#%ls",c_ModuleHandle,L"media", L"media/Graphics/TexturePackIcon.png"); - UINT size = 0; - HRESULT hr = XuiResourceLoadAllNoLoc(szResourceLocator, &m_iconData, &size); + unsigned int size = 0; + int hr = XuiResourceLoadAllNoLoc(szResourceLocator, &m_iconData, &size); m_iconSize = size; #endif } @@ -54,14 +54,14 @@ void AbstractTexturePack::loadComparison() { #ifdef _XBOX // 4J Stu - Temporary only - const DWORD LOCATOR_SIZE = 256; // Use this to allocate space to hold a ResourceLocator string - WCHAR szResourceLocator[ LOCATOR_SIZE ]; + const unsigned long LOCATOR_SIZE = 256; // Use this to allocate space to hold a ResourceLocator string + wchar_t szResourceLocator[ LOCATOR_SIZE ]; - const ULONG_PTR c_ModuleHandle = (ULONG_PTR)GetModuleHandle(NULL); + const uintptr_t c_ModuleHandle = (uintptr_t)GetModuleHandle(NULL); swprintf(szResourceLocator, LOCATOR_SIZE ,L"section://%X,%ls#%ls",c_ModuleHandle,L"media", L"media/Graphics/DefaultPack_Comparison.png"); - UINT size = 0; - HRESULT hr = XuiResourceLoadAllNoLoc(szResourceLocator, &m_comparisonData, &size); + unsigned int size = 0; + int hr = XuiResourceLoadAllNoLoc(szResourceLocator, &m_comparisonData, &size); m_comparisonSize = size; #endif } @@ -152,7 +152,7 @@ bool AbstractTexturePack::hasFile(const wstring &name, bool allowFallback) return !hasFile && (allowFallback && fallback != NULL) ? fallback->hasFile(name, allowFallback) : hasFile; } -DWORD AbstractTexturePack::getId() +unsigned long AbstractTexturePack::getId() { return id; } @@ -227,11 +227,11 @@ void AbstractTexturePack::loadDefaultUI() { #ifdef _XBOX // load from the .xzp file - const ULONG_PTR c_ModuleHandle = (ULONG_PTR)GetModuleHandle(NULL); + const uintptr_t c_ModuleHandle = (uintptr_t)GetModuleHandle(NULL); // Load new skin - const DWORD LOCATOR_SIZE = 256; // Use this to allocate space to hold a ResourceLocator string - WCHAR szResourceLocator[ LOCATOR_SIZE ]; + const unsigned long LOCATOR_SIZE = 256; // Use this to allocate space to hold a ResourceLocator string + wchar_t szResourceLocator[ LOCATOR_SIZE ]; swprintf(szResourceLocator, LOCATOR_SIZE,L"section://%X,%ls#%ls",c_ModuleHandle,L"media", L"media/skin_Minecraft.xur"); @@ -257,7 +257,7 @@ void AbstractTexturePack::loadDefaultColourTable() if(coloursFile.exists()) { - DWORD dwLength = coloursFile.length(); + unsigned long dwLength = coloursFile.length(); byteArray data(dwLength); FileInputStream fis(coloursFile); @@ -279,15 +279,15 @@ void AbstractTexturePack::loadDefaultHTMLColourTable() { #ifdef _XBOX // load from the .xzp file - const ULONG_PTR c_ModuleHandle = (ULONG_PTR)GetModuleHandle(NULL); + const uintptr_t c_ModuleHandle = (uintptr_t)GetModuleHandle(NULL); - const DWORD LOCATOR_SIZE = 256; // Use this to allocate space to hold a ResourceLocator string - WCHAR szResourceLocator[ LOCATOR_SIZE ]; + const unsigned long LOCATOR_SIZE = 256; // Use this to allocate space to hold a ResourceLocator string + wchar_t szResourceLocator[ LOCATOR_SIZE ]; // Try and load the HTMLColours.col based off the common XML first, before the deprecated xuiscene_colourtable wsprintfW(szResourceLocator,L"section://%X,%s#%s",c_ModuleHandle,L"media", L"media/HTMLColours.col"); - BYTE *data; - UINT dataLength; + uint8_t *data; + unsigned int dataLength; if(XuiResourceLoadAll(szResourceLocator, &data, &dataLength) == S_OK) { m_colourTable->loadColoursFromData(data,dataLength); @@ -298,7 +298,7 @@ void AbstractTexturePack::loadDefaultHTMLColourTable() { wsprintfW(szResourceLocator,L"section://%X,%s#%s",c_ModuleHandle,L"media", L"media/"); HXUIOBJ hScene; - HRESULT hr = XuiSceneCreate(szResourceLocator,L"xuiscene_colourtable.xur", NULL, &hScene); + int hr = XuiSceneCreate(szResourceLocator,L"xuiscene_colourtable.xur", NULL, &hScene); if(HRESULT_SUCCEEDED(hr)) { @@ -320,11 +320,11 @@ void AbstractTexturePack::loadDefaultHTMLColourTable() void AbstractTexturePack::loadHTMLColourTableFromXuiScene(HXUIOBJ hObj) { HXUIOBJ child; - HRESULT hr = XuiElementGetFirstChild(hObj, &child); + int hr = XuiElementGetFirstChild(hObj, &child); while(HRESULT_SUCCEEDED(hr) && child != NULL) { - LPCWSTR childName; + const wchar_t* childName; XuiElementGetId(child,&childName); m_colourTable->setColour(childName,XuiTextElementGetText(child)); @@ -338,7 +338,7 @@ void AbstractTexturePack::loadHTMLColourTableFromXuiScene(HXUIOBJ hObj) // } //} - //LPCWSTR stringValue = XuiTextElementGetText(child); + //const wchar_t* stringValue = XuiTextElementGetText(child); //m_htmlColourTable[colourIndex] = XuiTextElementGetText(child); @@ -363,24 +363,24 @@ void AbstractTexturePack::unloadUI() wstring AbstractTexturePack::getXuiRootPath() { - const ULONG_PTR c_ModuleHandle = (ULONG_PTR)GetModuleHandle(NULL); + const uintptr_t c_ModuleHandle = (uintptr_t)GetModuleHandle(NULL); // Load new skin - const DWORD LOCATOR_SIZE = 256; // Use this to allocate space to hold a ResourceLocator string - WCHAR szResourceLocator[ LOCATOR_SIZE ]; + const unsigned long LOCATOR_SIZE = 256; // Use this to allocate space to hold a ResourceLocator string + wchar_t szResourceLocator[ LOCATOR_SIZE ]; swprintf(szResourceLocator, LOCATOR_SIZE,L"section://%X,%ls#%ls",c_ModuleHandle,L"media", L"media/"); return szResourceLocator; } -PBYTE AbstractTexturePack::getPackIcon(DWORD &dwImageBytes) +uint8_t* AbstractTexturePack::getPackIcon(unsigned long &dwImageBytes) { if(m_iconSize == 0 || m_iconData == NULL) loadIcon(); dwImageBytes = m_iconSize; return m_iconData; } -PBYTE AbstractTexturePack::getPackComparison(DWORD &dwImageBytes) +uint8_t* AbstractTexturePack::getPackComparison(unsigned long &dwImageBytes) { if(m_comparisonSize == 0 || m_comparisonData == NULL) loadComparison(); diff --git a/src/client/AbstractTexturePack.h b/src/client/AbstractTexturePack.h index e6410c19..175afea2 100644 --- a/src/client/AbstractTexturePack.h +++ b/src/client/AbstractTexturePack.h @@ -8,7 +8,7 @@ class BufferedImage; class AbstractTexturePack : public TexturePack { private: - const DWORD id; + const unsigned long id; const wstring name; protected: @@ -19,11 +19,11 @@ protected: wstring desc1; wstring desc2; - PBYTE m_iconData; - DWORD m_iconSize; + uint8_t* m_iconData; + unsigned long m_iconSize; - PBYTE m_comparisonData; - DWORD m_comparisonSize; + uint8_t* m_comparisonData; + unsigned long m_comparisonSize; TexturePack *fallback; @@ -36,7 +36,7 @@ private: int textureId; protected: - AbstractTexturePack(DWORD id, File *file, const wstring &name, TexturePack *fallback); + AbstractTexturePack(unsigned long id, File *file, const wstring &name, TexturePack *fallback); private: static wstring trim(wstring line); @@ -61,7 +61,7 @@ public: virtual void load(Textures *textures); virtual bool hasFile(const wstring &name, bool allowFallback); virtual bool hasFile(const wstring &name) = 0; - virtual DWORD getId(); + virtual unsigned long getId(); virtual wstring getName(); virtual wstring getDesc1(); virtual wstring getDesc2(); @@ -84,8 +84,8 @@ public: virtual void loadUI(); virtual void unloadUI(); virtual wstring getXuiRootPath(); - virtual PBYTE getPackIcon(DWORD &dwImageBytes); - virtual PBYTE getPackComparison(DWORD &dwImageBytes); + virtual uint8_t* getPackIcon(unsigned long &dwImageBytes); + virtual uint8_t* getPackComparison(unsigned long &dwImageBytes); virtual unsigned int getDLCParentPackId(); virtual unsigned char getDLCSubPackId(); virtual ColourTable *getColourTable() { return m_colourTable; } diff --git a/src/client/AchievementPopup.h b/src/client/AchievementPopup.h index 3085dc6e..4304a7e5 100644 --- a/src/client/AchievementPopup.h +++ b/src/client/AchievementPopup.h @@ -13,7 +13,7 @@ private: wstring title; wstring desc; Achievement *ach; - __int64 startTime; + int64_t startTime; ItemRenderer *ir; bool isHelper; diff --git a/src/client/ArchiveFile.cpp b/src/client/ArchiveFile.cpp index 8c236ca3..77c4a205 100644 --- a/src/client/ArchiveFile.cpp +++ b/src/client/ArchiveFile.cpp @@ -122,7 +122,7 @@ byteArray ArchiveFile::getFile(const wstring &filename) #else #ifdef _UNICODE - HANDLE hfile = CreateFile( m_sourcefile.getPath().c_str(), + void* hfile = CreateFile( m_sourcefile.getPath().c_str(), GENERIC_READ, 0, NULL, @@ -132,7 +132,7 @@ byteArray ArchiveFile::getFile(const wstring &filename) ); #else app.DebugPrintf("Createfile archive\n"); - HANDLE hfile = CreateFile( wstringtofilename(m_sourcefile.getPath()), + void* hfile = CreateFile( wstringtofilename(m_sourcefile.getPath()), GENERIC_READ, 0, NULL, @@ -145,7 +145,7 @@ byteArray ArchiveFile::getFile(const wstring &filename) if (hfile != INVALID_HANDLE_VALUE) { app.DebugPrintf("hfile ok\n"); - DWORD ok = SetFilePointer( hfile, + unsigned long ok = SetFilePointer( hfile, data->ptr, NULL, FILE_BEGIN @@ -153,11 +153,11 @@ byteArray ArchiveFile::getFile(const wstring &filename) if (ok != INVALID_SET_FILE_POINTER) { - PBYTE pbData = new BYTE[ data->filesize ]; + uint8_t* pbData = new uint8_t[ data->filesize ]; - DWORD bytesRead = -1; - BOOL bSuccess = ReadFile( hfile, - (LPVOID) pbData, + unsigned long bytesRead = -1; + bool bSuccess = ReadFile( hfile, + (void*) pbData, data->filesize, &bytesRead, NULL @@ -198,7 +198,7 @@ byteArray ArchiveFile::getFile(const wstring &filename) unsigned int decompressedSize = dis.readInt(); dis.close(); - PBYTE uncompressedBuffer = new BYTE[decompressedSize]; + uint8_t* uncompressedBuffer = new uint8_t[decompressedSize]; Compression::getCompression()->Decompress(uncompressedBuffer, &decompressedSize, out.data+4, out.length-4); delete [] out.data; diff --git a/src/client/ArchiveFile.h b/src/client/ArchiveFile.h index f1ff05d3..08e14298 100644 --- a/src/client/ArchiveFile.h +++ b/src/client/ArchiveFile.h @@ -12,7 +12,7 @@ class ArchiveFile { protected: File m_sourcefile; - BYTE *m_cachedData; + uint8_t *m_cachedData; typedef struct _MetaData { diff --git a/src/client/BufferedImage.cpp b/src/client/BufferedImage.cpp index a4d29a66..811632d6 100644 --- a/src/client/BufferedImage.cpp +++ b/src/client/BufferedImage.cpp @@ -49,7 +49,7 @@ void BufferedImage::ByteFlip4(unsigned int &data) // 24-bits used (ie no alpha channel) whereas method 0 is a full 32-bit image with a valid alpha channel. BufferedImage::BufferedImage(const wstring& File, bool filenameHasExtension /*=false*/, bool bTitleUpdateTexture /*=false*/, const wstring &drive /*=L""*/) { - HRESULT hr; + int hr; wstring wDrive; wstring filePath; filePath = File; @@ -191,10 +191,10 @@ BufferedImage::BufferedImage(const wstring& File, bool filenameHasExtension /*=f BufferedImage::BufferedImage(DLCPack *dlcPack, const wstring& File, bool filenameHasExtension /*= false*/ ) { - HRESULT hr; + int hr; wstring filePath = File; - BYTE *pbData = NULL; - DWORD dwBytes = 0; + uint8_t *pbData = NULL; + unsigned long dwBytes = 0; for( int l = 0 ; l < 10; l++ ) { @@ -264,7 +264,7 @@ BufferedImage::BufferedImage(DLCPack *dlcPack, const wstring& File, bool filenam } -BufferedImage::BufferedImage(BYTE *pbData, DWORD dwBytes) +BufferedImage::BufferedImage(uint8_t *pbData, unsigned long dwBytes) { int iCurrentByte=0; for( int l = 0 ; l < 10; l++ ) @@ -274,7 +274,7 @@ BufferedImage::BufferedImage(BYTE *pbData, DWORD dwBytes) D3DXIMAGE_INFO ImageInfo; ZeroMemory(&ImageInfo,sizeof(D3DXIMAGE_INFO)); - HRESULT hr=RenderManager.LoadTextureData(pbData,dwBytes,&ImageInfo,&data[0]); + int hr=RenderManager.LoadTextureData(pbData,dwBytes,&ImageInfo,&data[0]); if(hr==ERROR_SUCCESS) { diff --git a/src/client/BufferedImage.h b/src/client/BufferedImage.h index a0227fe2..72b1d1f6 100644 --- a/src/client/BufferedImage.h +++ b/src/client/BufferedImage.h @@ -17,7 +17,7 @@ public: BufferedImage(int width,int height,int type); BufferedImage(const wstring& File, bool filenameHasExtension = false, bool bTitleUpdateTexture=false, const wstring &drive =L""); // 4J added BufferedImage(DLCPack *dlcPack, const wstring& File, bool filenameHasExtension = false ); // 4J Added - BufferedImage(BYTE *pbData, DWORD dwBytes); // 4J added + BufferedImage(uint8_t *pbData, unsigned long dwBytes); // 4J added ~BufferedImage(); int getWidth(); diff --git a/src/client/Chunk.cpp b/src/client/Chunk.cpp index c3437bb6..78e2f40d 100644 --- a/src/client/Chunk.cpp +++ b/src/client/Chunk.cpp @@ -20,7 +20,7 @@ int Chunk::updates = 0; #ifdef _LARGE_WORLDS -DWORD Chunk::tlsIdx = TlsAlloc(); +unsigned long Chunk::tlsIdx = TlsAlloc(); void Chunk::CreateNewThreadStorage() { diff --git a/src/client/Chunk.h b/src/client/Chunk.h index 56d6a49d..497dd687 100644 --- a/src/client/Chunk.h +++ b/src/client/Chunk.h @@ -32,7 +32,7 @@ private: #ifndef _LARGE_WORLDS static Tesselator *t; #else - static DWORD tlsIdx; + static unsigned long tlsIdx; public: static void CreateNewThreadStorage(); static void ReleaseThreadStorage(); diff --git a/src/client/ClientConnection.cpp b/src/client/ClientConnection.cpp index 1f7cafad..9fd02127 100644 --- a/src/client/ClientConnection.cpp +++ b/src/client/ClientConnection.cpp @@ -43,9 +43,9 @@ #include "SoundTypes.h" #include "TexturePackRepository.h" #ifdef _XBOX -#include "Common/XUI\XUI_Scene_Trading.h" +#include "Common/XUI/XUI_Scene_Trading.h" #else -#include "Common/UI\UI.h" +#include "Common/UI/UI.h" #endif #ifdef __PS3__ #include "PS3/Network/SonyVoiceChat.h" @@ -197,8 +197,8 @@ void ClientConnection::handleLogin(shared_ptr packet) if(iUserID!=-1) { - BYTE *pBuffer=NULL; - DWORD dwSize=0; + uint8_t *pBuffer=NULL; + unsigned long dwSize=0; bool bRes; // if there's a special skin or cloak for this player, add it in @@ -305,7 +305,7 @@ void ClientConnection::handleLogin(shared_ptr packet) //minecraft->setScreen(new ReceivingLevelScreen(this)); minecraft->player->entityId = packet->clientVersion; - BYTE networkSmallId = getSocket()->getSmallId(); + uint8_t networkSmallId = getSocket()->getSmallId(); app.UpdatePlayerInfo(networkSmallId, packet->m_playerIndex, packet->m_uiGamePrivileges); minecraft->player->setPlayerGamePrivilege(Player::ePlayerGamePrivilege_All, packet->m_uiGamePrivileges); @@ -375,7 +375,7 @@ void ClientConnection::handleLogin(shared_ptr packet) player->setCustomCape( app.GetPlayerCapeId(m_userIndex) ); - BYTE networkSmallId = getSocket()->getSmallId(); + uint8_t networkSmallId = getSocket()->getSmallId(); app.UpdatePlayerInfo(networkSmallId, packet->m_playerIndex, packet->m_uiGamePrivileges); player->setPlayerGamePrivilege(Player::ePlayerGamePrivilege_All, packet->m_uiGamePrivileges); @@ -1163,7 +1163,7 @@ void ClientConnection::onDisconnect(DisconnectPacket::eDisconnectReason reason, m_userIndex == ProfileManager.GetPrimaryPad() && !MinecraftServer::saveOnExitAnswered() ) { - UINT uiIDA[1]; + unsigned int uiIDA[1]; uiIDA[0]=IDS_CONFIRM_OK; ui.RequestMessageBox(IDS_EXITING_GAME, IDS_GENERIC_ERROR, uiIDA, 1, ProfileManager.GetPrimaryPad(),&ClientConnection::HostDisconnectReturned,NULL, app.GetStringTable()); } @@ -1610,11 +1610,11 @@ void ClientConnection::handlePreLogin(shared_ptr packet) // printf("Client: handlePreLogin\n"); #if 1 // 4J - Check that we can play with all the players already in the game who have Friends-Only UGC set - BOOL canPlay = true; - BOOL canPlayLocal = true; - BOOL isAtLeastOneFriend = g_NetworkManager.IsHost(); - BOOL isFriendsWithHost = true; - BOOL cantPlayContentRestricted = false; + bool canPlay = true; + bool canPlayLocal = true; + bool isAtLeastOneFriend = g_NetworkManager.IsHost(); + bool isFriendsWithHost = true; + bool cantPlayContentRestricted = false; if(!g_NetworkManager.IsHost()) { @@ -1633,7 +1633,7 @@ void ClientConnection::handlePreLogin(shared_ptr packet) { if(m_userIndex == ProfileManager.GetPrimaryPad() ) { - for(DWORD idx = 0; idx < XUSER_MAX_COUNT; ++idx) + for(unsigned long idx = 0; idx < XUSER_MAX_COUNT; ++idx) { if(ProfileManager.IsSignedIn(m_userIndex) && ProfileManager.IsGuest(idx)) { @@ -1650,8 +1650,8 @@ void ClientConnection::handlePreLogin(shared_ptr packet) if( playerXuid != INVALID_XUID ) { // Is this user friends with the host player? - BOOL result; - DWORD error; + bool result; + unsigned long error; error = XUserAreUsersFriends(idx,&packet->m_playerXuids[packet->m_hostIndex],1,&result,NULL); if(error == ERROR_SUCCESS && result != true) { @@ -1680,8 +1680,8 @@ void ClientConnection::handlePreLogin(shared_ptr packet) if( playerXuid != INVALID_XUID ) { // Is this user friends with the host player? - BOOL result; - DWORD error; + bool result; + unsigned long error; error = XUserAreUsersFriends(m_userIndex,&packet->m_playerXuids[packet->m_hostIndex],1,&result,NULL); if(error == ERROR_SUCCESS && result != true) { @@ -1695,10 +1695,10 @@ void ClientConnection::handlePreLogin(shared_ptr packet) if( canPlay ) { - for(DWORD i = 0; i < packet->m_dwPlayerCount; ++i) + for(unsigned long i = 0; i < packet->m_dwPlayerCount; ++i) { bool localPlayer = false; - for(DWORD idx = 0; idx < XUSER_MAX_COUNT; ++idx) + for(unsigned long idx = 0; idx < XUSER_MAX_COUNT; ++idx) { if( ProfileManager.IsSignedInLive(idx) ) { @@ -1728,9 +1728,9 @@ void ClientConnection::handlePreLogin(shared_ptr packet) // Local players are implied friends if( isAtLeastOneFriend != true ) { - BOOL result; - DWORD error; - for(DWORD idx = 0; idx < XUSER_MAX_COUNT; ++idx) + bool result; + unsigned long error; + for(unsigned long idx = 0; idx < XUSER_MAX_COUNT; ++idx) { if( ProfileManager.IsSignedIn(idx) && !ProfileManager.IsGuest(idx) ) { @@ -1756,9 +1756,9 @@ void ClientConnection::handlePreLogin(shared_ptr packet) bool thisQuadrantOnly = true; if( m_userIndex == ProfileManager.GetPrimaryPad() ) thisQuadrantOnly = false; - BOOL result; - DWORD error; - for(DWORD idx = 0; idx < XUSER_MAX_COUNT; ++idx) + bool result; + unsigned long error; + for(unsigned long idx = 0; idx < XUSER_MAX_COUNT; ++idx) { if( (!thisQuadrantOnly || m_userIndex == idx) && ProfileManager.IsSignedIn(idx) && !ProfileManager.IsGuest(idx) ) { @@ -1978,7 +1978,7 @@ void ClientConnection::handlePreLogin(shared_ptr packet) else if(cantPlayContentRestricted) reason = DisconnectPacket::eDisconnect_ContentRestricted_Single_Local; app.DebugPrintf("Exiting player %d on handling Pre-Login packet due UGC privileges: %d\n", m_userIndex, reason); - UINT uiIDA[1]; + unsigned int uiIDA[1]; uiIDA[0]=IDS_CONFIRM_OK; if(!isFriendsWithHost) ui.RequestMessageBox( IDS_CANTJOIN_TITLE, IDS_NOTALLOWED_FRIENDSOFFRIENDS, uiIDA,1,m_userIndex,NULL,NULL, app.GetStringTable()); else ui.RequestMessageBox( IDS_CANTJOIN_TITLE, IDS_NO_USER_CREATED_CONTENT_PRIVILEGE_SINGLE_LOCAL, uiIDA,1,m_userIndex,NULL,NULL, app.GetStringTable()); @@ -2047,7 +2047,7 @@ void ClientConnection::handlePreLogin(shared_ptr packet) // All other players we use their offline XUID so that they can play the game offline ProfileManager.GetXUID(m_userIndex,&offlineXUID,false); } - BOOL allAllowed, friendsAllowed; + bool allAllowed, friendsAllowed; ProfileManager.AllowedPlayerCreatedContent(m_userIndex,true,&allAllowed,&friendsAllowed); send( shared_ptr( new LoginPacket(minecraft->user->name, SharedConstants::NETWORK_PROTOCOL_VERSION, offlineXUID, onlineXUID, (allAllowed!=true && friendsAllowed==true), packet->m_ugcPlayersVersion, app.GetPlayerSkinId(m_userIndex), app.GetPlayerCapeId(m_userIndex), ProfileManager.IsGuest( m_userIndex )))); @@ -2229,8 +2229,8 @@ void ClientConnection::handleTexture(shared_ptr packet) #ifndef _CONTENT_PACKAGE wprintf(L"Client received request for custom texture %ls\n",packet->textureName.c_str()); #endif - PBYTE pbData=NULL; - DWORD dwBytes=0; + uint8_t* pbData=NULL; + unsigned long dwBytes=0; app.GetMemFileDetails(packet->textureName,&pbData,&dwBytes); if(dwBytes!=0) @@ -2261,8 +2261,8 @@ void ClientConnection::handleTextureAndGeometry(shared_ptrtextureName.c_str()); #endif - PBYTE pbData=NULL; - DWORD dwBytes=0; + uint8_t* pbData=NULL; + unsigned long dwBytes=0; app.GetMemFileDetails(packet->textureName,&pbData,&dwBytes); DLCSkinFile *pDLCSkinFile = app.m_dlcManager.getSkinFile(packet->textureName); @@ -2871,7 +2871,7 @@ void ClientConnection::handleGameEvent(shared_ptr gameEventPack } else if (event == GameEventPacket::WIN_GAME) { - ui.SetWinUserIndex( (BYTE)gameEventPacket->param ); + ui.SetWinUserIndex( (uint8_t)gameEventPacket->param ); #ifdef _XBOX @@ -3166,7 +3166,7 @@ void ClientConnection::handleCustomPayload(shared_ptr custo if( XuiClassDerivesFrom( objClass, thisClass ) ) { CXuiSceneTrading *screen; - HRESULT hr = XuiObjectFromHandle(scene, (void **) &screen); + int hr = XuiObjectFromHandle(scene, (void **) &screen); if (FAILED(hr)) return; trader = screen->getMerchant(); } @@ -3231,7 +3231,7 @@ void ClientConnection::handleUpdateProgress(shared_ptr pac void ClientConnection::handleUpdateGameRuleProgressPacket(shared_ptr packet) { - LPCWSTR string = app.GetGameRulesString(packet->m_messageId); + const wchar_t* string = app.GetGameRulesString(packet->m_messageId); if(string != NULL) { wstring message(string); @@ -3279,7 +3279,7 @@ int ClientConnection::HostDisconnectReturned(void *pParam,int iPad,C4JStorage::E // we need to ask if they are sure they want to overwrite the existing game if(bSaveExists && StorageManager.GetSaveDisabled()) { - UINT uiIDA[2]; + unsigned int uiIDA[2]; uiIDA[0]=IDS_CONFIRM_CANCEL; uiIDA[1]=IDS_CONFIRM_OK; ui.RequestMessageBox(IDS_TITLE_SAVE_GAME, IDS_CONFIRM_SAVE_GAME, uiIDA, 2, ProfileManager.GetPrimaryPad(),&ClientConnection::ExitGameAndSaveReturned,NULL, app.GetStringTable()); @@ -3294,7 +3294,7 @@ int ClientConnection::HostDisconnectReturned(void *pParam,int iPad,C4JStorage::E // we need to ask if they are sure they want to overwrite the existing game if(bSaveExists) { - UINT uiIDA[2]; + unsigned int uiIDA[2]; uiIDA[0]=IDS_CONFIRM_CANCEL; uiIDA[1]=IDS_CONFIRM_OK; ui.RequestMessageBox(IDS_TITLE_SAVE_GAME, IDS_CONFIRM_SAVE_GAME, uiIDA, 2, ProfileManager.GetPrimaryPad(),&ClientConnection::ExitGameAndSaveReturned,NULL, app.GetStringTable()); @@ -3318,7 +3318,7 @@ int ClientConnection::ExitGameAndSaveReturned(void *pParam,int iPad,C4JStorage:: // results switched for this dialog if(result==C4JStorage::EMessage_ResultDecline) { - //INT saveOrCheckpointId = 0; + //int saveOrCheckpointId = 0; //bool validSave = StorageManager.GetSaveUniqueNumber(&saveOrCheckpointId); //SentientManager.RecordLevelSaveOrCheckpoint(ProfileManager.GetPrimaryPad(), saveOrCheckpointId); #if defined(_XBOX_ONE) || defined(__ORBIS__) diff --git a/src/client/ClientConnection.h b/src/client/ClientConnection.h index 6cad5ead..997517ef 100644 --- a/src/client/ClientConnection.h +++ b/src/client/ClientConnection.h @@ -41,7 +41,7 @@ public: Socket *getSocket() { return connection->getSocket(); } // 4J Added private: - DWORD m_userIndex; // 4J Added + unsigned long m_userIndex; // 4J Added public: SavedDataStorage *savedDataStorage; ClientConnection(Minecraft *minecraft, const wstring& ip, int port); diff --git a/src/client/Common/App_structs.h b/src/client/Common/App_structs.h index ed321b5f..974225dc 100644 --- a/src/client/Common/App_structs.h +++ b/src/client/Common/App_structs.h @@ -5,24 +5,24 @@ typedef struct wchar_t *wchFilename; eFileExtensionType eEXT; eTMSFileType eTMSType; - PBYTE pbData; - UINT uiSize; + uint8_t* pbData; + unsigned int uiSize; int iConfig; // used for texture pack data files } TMS_FILE; typedef struct { - PBYTE pbData; - DWORD dwBytes; - BYTE ucRefCount; + uint8_t* pbData; + unsigned long dwBytes; + uint8_t ucRefCount; } MEMDATA,*PMEMDATA; typedef struct { - DWORD dwNotification; - UINT uiParam; + unsigned long dwNotification; + unsigned int uiParam; } NOTIFICATION,*PNOTIFICATION; @@ -60,7 +60,7 @@ typedef struct // adding new flags for interim TU to 1.6.6 // A value that encodes the skin that the player has set as their default - DWORD dwSelectedSkin; + unsigned long dwSelectedSkin; // In-Menu sensitivity unsigned char ucMenuSensitivity; @@ -90,7 +90,7 @@ typedef struct unsigned int uiSpecialTutorialBitmask; // A value that encodes the cape that the player has set - DWORD dwSelectedCape; + unsigned long dwSelectedCape; unsigned int uiFavoriteSkinA[MAX_FAVORITE_SKINS]; unsigned char ucCurrentFavoriteSkinPos; @@ -102,7 +102,7 @@ typedef struct unsigned char ucLanguage; // 4J Stu - See comment for GAME_SETTINGS_PROFILE_DATA_BYTES below // was 192 - //unsigned char ucUnused[192-TUTORIAL_PROFILE_STORAGE_BYTES-sizeof(DWORD)-sizeof(char)-sizeof(char)-sizeof(char)-sizeof(char)-sizeof(LONG)-sizeof(LONG)-sizeof(DWORD)]; + //unsigned char ucUnused[192-TUTORIAL_PROFILE_STORAGE_BYTES-sizeof(unsigned long)-sizeof(char)-sizeof(char)-sizeof(char)-sizeof(char)-sizeof(int32_t)-sizeof(int32_t)-sizeof(unsigned long)]; // 4J-PB - don't need to define the padded space, the union with ucReservedSpace will make the sizeof GAME_SETTINGS correct }; @@ -116,7 +116,7 @@ GAME_SETTINGS; #ifdef _XBOX_ONE typedef struct { - WCHAR wchPlayerUID[64]; + wchar_t wchPlayerUID[64]; char pszLevelName[14]; } BANNEDLISTDATA,*PBANNEDLISTDATA; @@ -142,7 +142,7 @@ XuiActionParam; typedef struct { int iSortValue; - UINT uiStringID; + unsigned int uiStringID; } TIPSTRUCT; @@ -150,8 +150,8 @@ TIPSTRUCT; typedef struct { eXUID eXuid; - WCHAR wchCape[MAX_CAPENAME_SIZE]; - WCHAR wchSkin[MAX_CAPENAME_SIZE]; + wchar_t wchCape[MAX_CAPENAME_SIZE]; + wchar_t wchSkin[MAX_CAPENAME_SIZE]; } MOJANG_DATA; @@ -168,14 +168,14 @@ typedef struct wstring wsDisplayName; // add a store for the local DLC image - PBYTE pbImageData; - DWORD dwImageBytes; + uint8_t* pbImageData; + unsigned long dwImageBytes; #else - ULONGLONG ullOfferID_Full; - ULONGLONG ullOfferID_Trial; + uint64_t ullOfferID_Full; + uint64_t ullOfferID_Trial; #endif - WCHAR wchBanner[MAX_BANNERNAME_SIZE]; - WCHAR wchDataFile[MAX_BANNERNAME_SIZE]; + wchar_t wchBanner[MAX_BANNERNAME_SIZE]; + wchar_t wchDataFile[MAX_BANNERNAME_SIZE]; int iGender; #endif int iConfig; @@ -194,14 +194,14 @@ FEATURE_DATA; // banned list typedef struct { - BYTE *pBannedList; - DWORD dwBytes; + uint8_t *pBannedList; + unsigned long dwBytes; } BANNEDLIST; typedef struct _DLCRequest { - DWORD dwType; + unsigned long dwType; eDLCContentState eState; } DLCRequest; @@ -214,13 +214,13 @@ typedef struct _TMSPPRequest C4JStorage::eTMS_FILETYPEVAL eFileTypeVal; //char szFilename[MAX_TMSFILENAME_SIZE]; #ifdef _XBOX_ONE - int( *CallbackFunc)(LPVOID,int,int,LPVOID, WCHAR *); + int( *CallbackFunc)(void*,int,int,void*, wchar_t *); #else - int( *CallbackFunc)(LPVOID,int,int,C4JStorage::PTMSPP_FILEDATA, LPCSTR szFilename); + int( *CallbackFunc)(void*,int,int,C4JStorage::PTMSPP_FILEDATA, const char* szFilename); #endif - WCHAR wchFilename[MAX_TMSFILENAME_SIZE]; + wchar_t wchFilename[MAX_TMSFILENAME_SIZE]; - LPVOID lpCallbackParam; + void* lpCallbackParam; } TMSPPRequest; diff --git a/src/client/Common/Audio/Consoles_SoundEngine.h b/src/client/Common/Audio/Consoles_SoundEngine.h index 01de13db..a8805c27 100644 --- a/src/client/Common/Audio/Consoles_SoundEngine.h +++ b/src/client/Common/Audio/Consoles_SoundEngine.h @@ -66,8 +66,8 @@ public: virtual bool GetIsPlayingNetherMusic() ; virtual void SetIsPlayingEndMusic(bool bVal) ; virtual void SetIsPlayingNetherMusic(bool bVal) ; - static const WCHAR *wchSoundNames[eSoundType_MAX]; - static const WCHAR *wchUISoundNames[eSFX_MAX]; + static const wchar_t *wchSoundNames[eSoundType_MAX]; + static const wchar_t *wchUISoundNames[eSFX_MAX]; private: // platform specific functions diff --git a/src/client/Common/Audio/SoundEngine.h b/src/client/Common/Audio/SoundEngine.h index 2bf51cd7..20c007b5 100644 --- a/src/client/Common/Audio/SoundEngine.h +++ b/src/client/Common/Audio/SoundEngine.h @@ -146,7 +146,7 @@ private: int m_MusicType; AUDIO_INFO m_StreamingAudioInfo; wstring m_CDMusic; - BOOL m_bSystemMusicPlaying; + bool m_bSystemMusicPlaying; float m_MasterMusicVolume; float m_MasterEffectsVolume; diff --git a/src/client/Common/Audio/SoundNames.cpp b/src/client/Common/Audio/SoundNames.cpp index 170c87a0..be770fdf 100644 --- a/src/client/Common/Audio/SoundNames.cpp +++ b/src/client/Common/Audio/SoundNames.cpp @@ -4,7 +4,7 @@ -const WCHAR *ConsoleSoundEngine::wchSoundNames[eSoundType_MAX]= +const wchar_t *ConsoleSoundEngine::wchSoundNames[eSoundType_MAX]= { L"mob.chicken", // eSoundType_MOB_CHICKEN_AMBIENT L"mob.chickenhurt", // eSoundType_MOB_CHICKEN_HURT @@ -154,7 +154,7 @@ const WCHAR *ConsoleSoundEngine::wchSoundNames[eSoundType_MAX]= }; -const WCHAR *ConsoleSoundEngine::wchUISoundNames[eSFX_MAX]= +const wchar_t *ConsoleSoundEngine::wchUISoundNames[eSFX_MAX]= { L"back", L"craft", diff --git a/src/client/Common/Colours/ColourTable.cpp b/src/client/Common/Colours/ColourTable.cpp index 846946f3..cee543aa 100644 --- a/src/client/Common/Colours/ColourTable.cpp +++ b/src/client/Common/Colours/ColourTable.cpp @@ -314,18 +314,18 @@ void ColourTable::staticCtor() } } -ColourTable::ColourTable(PBYTE pbData, DWORD dwLength) +ColourTable::ColourTable(uint8_t* pbData, unsigned long dwLength) { loadColoursFromData(pbData, dwLength); } -ColourTable::ColourTable(ColourTable *defaultColours, PBYTE pbData, DWORD dwLength) +ColourTable::ColourTable(ColourTable *defaultColours, uint8_t* pbData, unsigned long dwLength) { // 4J Stu - Default the colours that of the table passed in XMemCpy( (void *)m_colourValues, (void *)defaultColours->m_colourValues, sizeof(int) * eMinecraftColour_COUNT); loadColoursFromData(pbData, dwLength); } -void ColourTable::loadColoursFromData(PBYTE pbData, DWORD dwLength) +void ColourTable::loadColoursFromData(uint8_t* pbData, unsigned long dwLength) { byteArray src(pbData, dwLength); diff --git a/src/client/Common/Colours/ColourTable.h b/src/client/Common/Colours/ColourTable.h index 8e0a348c..b1f84e91 100644 --- a/src/client/Common/Colours/ColourTable.h +++ b/src/client/Common/Colours/ColourTable.h @@ -11,13 +11,13 @@ private: public: static void staticCtor(); - ColourTable(PBYTE pbData, DWORD dwLength); - ColourTable(ColourTable *defaultColours, PBYTE pbData, DWORD dwLength); + ColourTable(uint8_t* pbData, unsigned long dwLength); + ColourTable(ColourTable *defaultColours, uint8_t* pbData, unsigned long dwLength); unsigned int getColour(eMinecraftColour id); unsigned int getColor(eMinecraftColour id) { return getColour(id); } - void loadColoursFromData(PBYTE pbData, DWORD dwLength); + void loadColoursFromData(uint8_t* pbData, unsigned long dwLength); void setColour(const wstring &colourName, int value); void setColour(const wstring &colourName, const wstring &value); }; \ No newline at end of file diff --git a/src/client/Common/Console_Utils.cpp b/src/client/Common/Console_Utils.cpp index cb0f1b58..d4a5d1ed 100644 --- a/src/client/Common/Console_Utils.cpp +++ b/src/client/Common/Console_Utils.cpp @@ -5,12 +5,12 @@ // Desc: Internal helper function //-------------------------------------------------------------------------------------- #ifndef _CONTENT_PACKAGE -static VOID DebugSpewV( const CHAR* strFormat, const va_list pArgList ) +static void DebugSpewV( const char* strFormat, const va_list pArgList ) { #if defined __PS3__ || defined __ORBIS__ || defined __PSVITA__ assert(0); #else - CHAR str[2048]; + char str[2048]; // Use the secure CRT to avoid buffer overruns. Specify a count of // _TRUNCATE so that too long strings will be silently truncated // rather than triggering an error. @@ -25,9 +25,9 @@ static VOID DebugSpewV( const CHAR* strFormat, const va_list pArgList ) // Desc: Prints formatted debug spew //-------------------------------------------------------------------------------------- #ifdef _Printf_format_string_ // VC++ 2008 and later support this annotation -VOID CDECL DebugSpew( _In_z_ _Printf_format_string_ const CHAR* strFormat, ... ) +void CDECL DebugSpew( _In_z_ _Printf_format_string_ const char* strFormat, ... ) #else -VOID CDECL DebugPrintf( const CHAR* strFormat, ... ) +void CDECL DebugPrintf( const char* strFormat, ... ) #endif { #ifndef _CONTENT_PACKAGE diff --git a/src/client/Common/Consoles_App.cpp b/src/client/Common/Consoles_App.cpp index 67141a15..0ad9c8d8 100644 --- a/src/client/Common/Consoles_App.cpp +++ b/src/client/Common/Consoles_App.cpp @@ -299,14 +299,14 @@ void CMinecraftApp::DebugPrintf(int user, const char *szFormat, ...) #endif } -LPCWSTR CMinecraftApp::GetString(int iID) +const wchar_t* CMinecraftApp::GetString(int iID) { //return L"DeÄŸiÅŸiklikler ve Yenilikler"; //return L"ÕÕÕÕÖÖÖÖ"; return app.m_stringTable->getString(iID); } -void CMinecraftApp::SetAction(int iPad, eXuiAction action, LPVOID param) +void CMinecraftApp::SetAction(int iPad, eXuiAction action, void* param) { if(m_eXuiAction[iPad] == eAppAction_ExitWorldCapturedThumbnail && action != eAppAction_Idle) { @@ -768,9 +768,9 @@ int CMinecraftApp::SetDefaultOptions(C_4JProfile::PROFILESETTINGS *pSettings,con } #if ( defined __PS3__ || defined __ORBIS__ || defined _DURANGO || defined __PSVITA__) -int CMinecraftApp::DefaultOptionsCallback(LPVOID pParam,C4JStorage::PROFILESETTINGS *pSettings, const int iPad) +int CMinecraftApp::DefaultOptionsCallback(void* pParam,C4JStorage::PROFILESETTINGS *pSettings, const int iPad) #else -int CMinecraftApp::DefaultOptionsCallback(LPVOID pParam,C_4JProfile::PROFILESETTINGS *pSettings, const int iPad) +int CMinecraftApp::DefaultOptionsCallback(void* pParam,C_4JProfile::PROFILESETTINGS *pSettings, const int iPad) #endif { CMinecraftApp *pApp=(CMinecraftApp *)pParam; @@ -778,7 +778,7 @@ int CMinecraftApp::DefaultOptionsCallback(LPVOID pParam,C_4JProfile::PROFILESETT // flag the default options to be set pApp->DebugPrintf("Setting default options for player %d", iPad); - pApp->SetAction(iPad,eAppAction_SetDefaultOptions, (LPVOID)pSettings); + pApp->SetAction(iPad,eAppAction_SetDefaultOptions, (void*)pSettings); //pApp->SetDefaultOptions(pSettings,iPad); // if the profile data has been changed, then force a profile write @@ -791,7 +791,7 @@ int CMinecraftApp::DefaultOptionsCallback(LPVOID pParam,C_4JProfile::PROFILESETT #if ( defined __PS3__ || defined __ORBIS__ || defined _DURANGO || defined __PSVITA__) #ifdef __ORBIS__ -int CMinecraftApp::OptionsDataCallback(LPVOID pParam,int iPad,unsigned short usVersion,C4JStorage::eOptionsCallback eStatus,int iBlocksRequired) +int CMinecraftApp::OptionsDataCallback(void* pParam,int iPad,unsigned short usVersion,C4JStorage::eOptionsCallback eStatus,int iBlocksRequired) { CMinecraftApp *pApp=(CMinecraftApp *)pParam; pApp->m_eOptionsStatusA[iPad]=eStatus; @@ -805,7 +805,7 @@ int CMinecraftApp::GetOptionsBlocksRequired(int iPad) } #else -int CMinecraftApp::OptionsDataCallback(LPVOID pParam,int iPad,unsigned short usVersion,C4JStorage::eOptionsCallback eStatus) +int CMinecraftApp::OptionsDataCallback(void* pParam,int iPad,unsigned short usVersion,C4JStorage::eOptionsCallback eStatus) { CMinecraftApp *pApp=(CMinecraftApp *)pParam; pApp->m_eOptionsStatusA[iPad]=eStatus; @@ -824,7 +824,7 @@ void CMinecraftApp::SetOptionsCallbackStatus(int iPad, C4JStorage::eOptionsCallb } #endif -int CMinecraftApp::OldProfileVersionCallback(LPVOID pParam,unsigned char *pucData, const unsigned short usVersion, const int iPad) +int CMinecraftApp::OldProfileVersionCallback(void* pParam,unsigned char *pucData, const unsigned short usVersion, const int iPad) { // check what needs to be done with this version to update to the current one @@ -1288,7 +1288,7 @@ void CMinecraftApp::ActionGameSettings(int iPad,eGameSetting eVal) break; case eGameSetting_DisplaySplitscreenGamertags: - for( BYTE idx = 0; idx < XUSER_MAX_COUNT; ++idx) + for( uint8_t idx = 0; idx < XUSER_MAX_COUNT; ++idx) { if(pMinecraft->localplayers[idx] != NULL) { @@ -1379,12 +1379,12 @@ void CMinecraftApp::ActionGameSettings(int iPad,eGameSetting eVal) void CMinecraftApp::SetPlayerSkin(int iPad,const wstring &name) { - DWORD skinId = app.getSkinIdFromPath(name); + unsigned long skinId = app.getSkinIdFromPath(name); SetPlayerSkin(iPad,skinId); } -void CMinecraftApp::SetPlayerSkin(int iPad,DWORD dwSkinId) +void CMinecraftApp::SetPlayerSkin(int iPad,unsigned long dwSkinId) { DebugPrintf("Setting skin for %d to %08X\n", iPad, dwSkinId); @@ -1402,12 +1402,12 @@ wstring CMinecraftApp::GetPlayerSkinName(int iPad) return app.getSkinPathFromId(GameSettingsA[iPad]->dwSelectedSkin); } -DWORD CMinecraftApp::GetPlayerSkinId(int iPad) +unsigned long CMinecraftApp::GetPlayerSkinId(int iPad) { // 4J-PB -check the user has rights to use this skin - they may have had at some point but the entitlement has been removed. DLCPack *Pack=NULL; DLCSkinFile *skinFile=NULL; - DWORD dwSkin=GameSettingsA[iPad]->dwSelectedSkin; + unsigned long dwSkin=GameSettingsA[iPad]->dwSelectedSkin; wchar_t chars[256]; if( GET_IS_DLC_SKIN_FROM_BITMASK(dwSkin) ) @@ -1439,7 +1439,7 @@ DWORD CMinecraftApp::GetPlayerSkinId(int iPad) return dwSkin; } - DWORD CMinecraftApp::GetAdditionalModelParts(int iPad) + unsigned long CMinecraftApp::GetAdditionalModelParts(int iPad) { return m_dwAdditionalModelParts[iPad]; } @@ -1447,12 +1447,12 @@ DWORD CMinecraftApp::GetPlayerSkinId(int iPad) void CMinecraftApp::SetPlayerCape(int iPad,const wstring &name) { - DWORD capeId = Player::getCapeIdFromPath(name); + unsigned long capeId = Player::getCapeIdFromPath(name); SetPlayerCape(iPad,capeId); } -void CMinecraftApp::SetPlayerCape(int iPad,DWORD dwCapeId) +void CMinecraftApp::SetPlayerCape(int iPad,unsigned long dwCapeId) { DebugPrintf("Setting cape for %d to %08X\n", iPad, dwCapeId); @@ -1469,7 +1469,7 @@ wstring CMinecraftApp::GetPlayerCapeName(int iPad) return Player::getCapePathFromId(GameSettingsA[iPad]->dwSelectedCape); } -DWORD CMinecraftApp::GetPlayerCapeId(int iPad) +unsigned long CMinecraftApp::GetPlayerCapeId(int iPad) { return GameSettingsA[iPad]->dwSelectedCape; } @@ -2414,7 +2414,7 @@ int CMinecraftApp::DisplaySavingMessage(void *pParam, C4JStorage::ESavingMessage return 0; } -void CMinecraftApp::SetActionConfirmed(LPVOID param) +void CMinecraftApp::SetActionConfirmed(void* param) { XuiActionParam *actionInfo = (XuiActionParam *)param; app.SetAction(actionInfo->iPad, actionInfo->action); @@ -2425,7 +2425,7 @@ void CMinecraftApp::HandleXuiActions(void) { eXuiAction eAction; eTMSAction eTMS; - LPVOID param; + void* param; Minecraft *pMinecraft=Minecraft::GetInstance(); shared_ptr player; @@ -2438,7 +2438,7 @@ void CMinecraftApp::HandleXuiActions(void) case eAppAction_DisplayLavaMessage: // Display a warning about placing lava in the spawn area { - UINT uiIDA[1]; + unsigned int uiIDA[1]; uiIDA[0]=IDS_CONFIRM_OK; C4JStorage::EMessageResult result = ui.RequestMessageBox( IDS_CANT_PLACE_NEAR_SPAWN_TITLE, IDS_CANT_PLACE_NEAR_SPAWN_TEXT, uiIDA,1,XUSER_INDEX_ANY,NULL,NULL, app.GetStringTable()); if(result != C4JStorage::EMessage_Busy) SetGlobalXuiAction(eAppAction_Idle); @@ -2524,7 +2524,7 @@ void CMinecraftApp::HandleXuiActions(void) { // ask the player if they would like to upgrade, or they'll lose the level - UINT uiIDA[2]; + unsigned int uiIDA[2]; uiIDA[0]=IDS_CONFIRM_OK; uiIDA[1]=IDS_CONFIRM_CANCEL; ui.RequestMessageBox(IDS_UNLOCK_TITLE, IDS_UNLOCK_TOSAVE_TEXT, uiIDA, 2,i,&CMinecraftApp::UnlockFullSaveReturned,this,app.GetStringTable()); @@ -2566,13 +2566,13 @@ void CMinecraftApp::HandleXuiActions(void) // Hide the other players scenes ui.ShowOtherPlayersBaseScene(ProfileManager.GetPrimaryPad(), false); - //INT saveOrCheckpointId = 0; + //int saveOrCheckpointId = 0; //bool validSave = StorageManager.GetSaveUniqueNumber(&saveOrCheckpointId); //SentientManager.RecordLevelSaveOrCheckpoint(ProfileManager.GetPrimaryPad(), saveOrCheckpointId); LoadingInputParams *loadingParams = new LoadingInputParams(); loadingParams->func = &UIScene_PauseMenu::SaveWorldThreadProc; - loadingParams->lpParam = (LPVOID)false; + loadingParams->lpParam = (void*)false; // 4J-JEV - PS4: Fix for #5708 - [ONLINE] - If the user pulls their network cable out while saving the title will hang. loadingParams->waitForThreadToDelete = true; @@ -2625,7 +2625,7 @@ void CMinecraftApp::HandleXuiActions(void) // This just allows it to be shown if(pMinecraft->localgameModes[ProfileManager.GetPrimaryPad()] != NULL) pMinecraft->localgameModes[ProfileManager.GetPrimaryPad()]->getTutorial()->showTutorialPopup(false); - //INT saveOrCheckpointId = 0; + //int saveOrCheckpointId = 0; //bool validSave = StorageManager.GetSaveUniqueNumber(&saveOrCheckpointId); //SentientManager.RecordLevelSaveOrCheckpoint(ProfileManager.GetPrimaryPad(), saveOrCheckpointId); @@ -2633,7 +2633,7 @@ void CMinecraftApp::HandleXuiActions(void) LoadingInputParams *loadingParams = new LoadingInputParams(); loadingParams->func = &UIScene_PauseMenu::SaveWorldThreadProc; - loadingParams->lpParam = (LPVOID)true; + loadingParams->lpParam = (void*)true; UIFullscreenProgressCompletionData *completionData = new UIFullscreenProgressCompletionData(); completionData->bShowBackground=true; @@ -2933,7 +2933,7 @@ void CMinecraftApp::HandleXuiActions(void) else { // ask the player if they would like to upgrade, or they'll lose the level - UINT uiIDA[2]; + unsigned int uiIDA[2]; uiIDA[0]=IDS_CONFIRM_OK; uiIDA[1]=IDS_CONFIRM_CANCEL; ui.RequestMessageBox(IDS_UNLOCK_TITLE, IDS_UNLOCK_TOSAVE_TEXT, uiIDA, 2, i,&CMinecraftApp::UnlockFullExitReturned,this,app.GetStringTable()); @@ -3095,7 +3095,7 @@ void CMinecraftApp::HandleXuiActions(void) //LoadingInputParams *loadingParams = new LoadingInputParams(); //loadingParams->func = &CScene_Death::RespawnThreadProc; - //loadingParams->lpParam = (LPVOID)i; + //loadingParams->lpParam = (void*)i; // Disable game & update thread whilst we do any of this //app.SetGameStarted(false); @@ -3173,7 +3173,7 @@ void CMinecraftApp::HandleXuiActions(void) pStats->clear(); // 4J-PB - the libs will display the Returned to Title screen -// UINT uiIDA[1]; +// unsigned int uiIDA[1]; // uiIDA[0]=IDS_CONFIRM_OK; // // ui.RequestMessageBox(IDS_RETURNEDTOMENU_TITLE, IDS_RETURNEDTOTITLESCREEN_TEXT, uiIDA, 1, i,&CMinecraftApp::PrimaryPlayerSignedOutReturned,this,app.GetStringTable()); @@ -3236,7 +3236,7 @@ void CMinecraftApp::HandleXuiActions(void) // need to clear the player stats - can't assume it'll be done in setlevel - we may not be in the game StatsCounter* pStats = Minecraft::GetInstance()->stats[ i ]; pStats->clear(); - UINT uiIDA[1]; + unsigned int uiIDA[1]; uiIDA[0]=IDS_CONFIRM_OK; ui.RequestMessageBox(g_NetworkManager.CorrectErrorIDS(IDS_CONNECTION_LOST), g_NetworkManager.CorrectErrorIDS(IDS_CONNECTION_LOST_LIVE), uiIDA, 1, i,&CMinecraftApp::EthernetDisconnectReturned,this, app.GetStringTable()); @@ -3254,7 +3254,7 @@ void CMinecraftApp::HandleXuiActions(void) // need to clear the player stats - can't assume it'll be done in setlevel - we may not be in the game StatsCounter* pStats = Minecraft::GetInstance()->stats[ i ]; pStats->clear(); - UINT uiIDA[1]; + unsigned int uiIDA[1]; uiIDA[0]=IDS_CONFIRM_OK; ui.RequestMessageBox(g_NetworkManager.CorrectErrorIDS(IDS_CONNECTION_LOST), g_NetworkManager.CorrectErrorIDS(IDS_CONNECTION_LOST_LIVE), uiIDA, 1, i,&CMinecraftApp::EthernetDisconnectReturned,this, app.GetStringTable()); @@ -3348,7 +3348,7 @@ void CMinecraftApp::HandleXuiActions(void) case eAppAction_TrialOver: { SetAction(i,eAppAction_Idle); - UINT uiIDA[2]; + unsigned int uiIDA[2]; uiIDA[0]=IDS_UNLOCK_TITLE; uiIDA[1]=IDS_EXIT_GAME; @@ -3362,7 +3362,7 @@ void CMinecraftApp::HandleXuiActions(void) TelemetryManager->RecordUpsellPresented(i, eSen_UpsellID_Full_Version_Of_Game, app.m_dwOfferID); SetAction(i,eAppAction_Idle); - UINT uiIDA[2]; + unsigned int uiIDA[2]; uiIDA[0]=IDS_CONFIRM_OK; uiIDA[1]=IDS_CONFIRM_CANCEL; @@ -3371,7 +3371,7 @@ void CMinecraftApp::HandleXuiActions(void) break; case eAppAction_ExitAndJoinFromInvite: { - UINT uiIDA[3]; + unsigned int uiIDA[3]; SetAction(i,eAppAction_Idle); // Check the player really wants to do this @@ -3482,9 +3482,9 @@ void CMinecraftApp::HandleXuiActions(void) } #endif #ifdef _DURANGO - DWORD result = StorageManager.UnmountInstalledDLC(L"TPACK"); + unsigned long result = StorageManager.UnmountInstalledDLC(L"TPACK"); #else - DWORD result = StorageManager.UnmountInstalledDLC("TPACK"); + unsigned long result = StorageManager.UnmountInstalledDLC("TPACK"); #endif app.DebugPrintf("Unmount result is %d\n",result); } @@ -3506,7 +3506,7 @@ void CMinecraftApp::HandleXuiActions(void) LoadingInputParams *loadingParams = new LoadingInputParams(); loadingParams->func = &CGameNetworkManager::ExitAndJoinFromInviteThreadProc; - loadingParams->lpParam = (LPVOID)&m_InviteData; + loadingParams->lpParam = (void*)&m_InviteData; UIFullscreenProgressCompletionData *completionData = new UIFullscreenProgressCompletionData(); completionData->bShowBackground=true; @@ -3565,7 +3565,7 @@ void CMinecraftApp::HandleXuiActions(void) //return hr; // 4J Stu - Copied this from XUI_FullScreenProgress to properly handle the fail case, as the thread will no longer be failing - UINT uiIDA[1]; + unsigned int uiIDA[1]; uiIDA[0]=IDS_CONFIRM_OK; ui.RequestMessageBox( IDS_CONNECTION_FAILED, IDS_CONNECTION_LOST_SERVER, uiIDA,1,ProfileManager.GetPrimaryPad(),NULL,NULL, app.GetStringTable()); @@ -3714,7 +3714,7 @@ void CMinecraftApp::HandleXuiActions(void) break; case eAppAction_FailedToJoinNoPrivileges: { - UINT uiIDA[1]; + unsigned int uiIDA[1]; uiIDA[0]=IDS_CONFIRM_OK; C4JStorage::EMessageResult result = ui.RequestMessageBox( IDS_NO_MULTIPLAYER_PRIVILEGE_TITLE, IDS_NO_MULTIPLAYER_PRIVILEGE_JOIN_TEXT, uiIDA,1,ProfileManager.GetPrimaryPad(),NULL,NULL, app.GetStringTable()); if(result != C4JStorage::EMessage_Busy) SetAction(i,eAppAction_Idle); @@ -3766,12 +3766,12 @@ void CMinecraftApp::HandleXuiActions(void) break; case eAppAction_LevelInBanLevelList: { - UINT uiIDA[2]; + unsigned int uiIDA[2]; uiIDA[0]=IDS_BUTTON_REMOVE_FROM_BAN_LIST; uiIDA[1]=IDS_EXIT_GAME; // pass in the gamertag format string - WCHAR wchFormat[40]; + wchar_t wchFormat[40]; INetworkPlayer *player = g_NetworkManager.GetLocalPlayerByUserIndex(i); // If not the primary player, but the primary player has banned this level and decided not to unban @@ -3795,7 +3795,7 @@ void CMinecraftApp::HandleXuiActions(void) #ifdef _XBOX CScene_TextEntry::XuiTextInputParams *pDebugTextParams= new CScene_TextEntry::XuiTextInputParams; pDebugTextParams->iPad=i; - pDebugTextParams->wch=(WCHAR)param; + pDebugTextParams->wch=(wchar_t)param; app.NavigateToScene(i,eUIScene_TextEntry,pDebugTextParams); #endif @@ -3839,12 +3839,12 @@ void CMinecraftApp::HandleXuiActions(void) case eAppAction_TexturePackRequired: { #ifdef _XBOX - ULONGLONG ullOfferID_Full; + uint64_t ullOfferID_Full; app.GetDLCFullOfferIDForPackID(app.GetRequiredTexturePackID(),&ullOfferID_Full); TelemetryManager->RecordUpsellPresented(ProfileManager.GetPrimaryPad(), eSet_UpsellID_Texture_DLC, ullOfferID_Full & 0xFFFFFFFF); #endif - UINT uiIDA[2]; + unsigned int uiIDA[2]; uiIDA[0]=IDS_TEXTUREPACK_FULLVERSION; uiIDA[1]=IDS_TEXTURE_PACK_TRIALVERSION; @@ -4101,7 +4101,7 @@ void CMinecraftApp::loadMediaArchive() } #if 0 string path = "Common\\media.arc"; - HANDLE hFile = CreateFile( path.c_str(), + void* hFile = CreateFile( path.c_str(), GENERIC_READ, FILE_SHARE_READ, NULL, @@ -4112,14 +4112,14 @@ void CMinecraftApp::loadMediaArchive() if( hFile != INVALID_HANDLE_VALUE ) { File fileHelper(convStringToWstring(path)); - DWORD dwFileSize = fileHelper.length(); + unsigned long dwFileSize = fileHelper.length(); // Initialize memory. - PBYTE m_fBody = new BYTE[ dwFileSize ]; + uint8_t* m_fBody = new uint8_t[ dwFileSize ]; ZeroMemory(m_fBody, dwFileSize); - DWORD m_fSize = 0; - BOOL hr = ReadFile( hFile, + unsigned long m_fSize = 0; + bool hr = ReadFile( hFile, m_fBody, dwFileSize, &m_fSize, @@ -4360,7 +4360,7 @@ int CMinecraftApp::UnlockFullInviteReturned(void *pParam,int iPad,C4JStorage::EM ProfileManager.GetChatAndContentRestrictions(ProfileManager.GetPrimaryPad(),true,NULL,&bContentRestricted,NULL); if(bContentRestricted) { - UINT uiIDA[1]; + unsigned int uiIDA[1]; uiIDA[0]=IDS_CONFIRM_OK; ui.RequestMessageBox(IDS_ONLINE_SERVICE_TITLE, IDS_CONTENT_RESTRICTION, uiIDA, 1, ProfileManager.GetPrimaryPad(),NULL,&app, app.GetStringTable()); } @@ -4374,7 +4374,7 @@ int CMinecraftApp::UnlockFullInviteReturned(void *pParam,int iPad,C4JStorage::EM else { // you're not signed in to PSN! - UINT uiIDA[2]; + unsigned int uiIDA[2]; uiIDA[0]=IDS_PRO_NOTONLINE_ACCEPT; uiIDA[1]=IDS_PRO_NOTONLINE_DECLINE; ui.RequestMessageBox(IDS_PRO_NOTONLINE_TITLE, IDS_PRO_NOTONLINE_TEXT, uiIDA, 2, ProfileManager.GetPrimaryPad(),&CMinecraftApp::MustSignInFullVersionPurchaseReturned,&app, app.GetStringTable()); @@ -4405,7 +4405,7 @@ int CMinecraftApp::UnlockFullSaveReturned(void *pParam,int iPad,C4JStorage::EMes ProfileManager.GetChatAndContentRestrictions(ProfileManager.GetPrimaryPad(),true,NULL,&bContentRestricted,NULL); if(bContentRestricted) { - UINT uiIDA[1]; + unsigned int uiIDA[1]; uiIDA[0]=IDS_CONFIRM_OK; ui.RequestMessageBox(IDS_ONLINE_SERVICE_TITLE, IDS_CONTENT_RESTRICTION, uiIDA, 1, ProfileManager.GetPrimaryPad(),NULL,&app, app.GetStringTable()); } @@ -4419,7 +4419,7 @@ int CMinecraftApp::UnlockFullSaveReturned(void *pParam,int iPad,C4JStorage::EMes else { // you're not signed in to PSN! - UINT uiIDA[2]; + unsigned int uiIDA[2]; uiIDA[0]=IDS_PRO_NOTONLINE_ACCEPT; uiIDA[1]=IDS_PRO_NOTONLINE_DECLINE; ui.RequestMessageBox(IDS_PRO_NOTONLINE_TITLE, IDS_PRO_NOTONLINE_TEXT, uiIDA, 2, ProfileManager.GetPrimaryPad(),&CMinecraftApp::MustSignInFullVersionPurchaseReturned,&app, app.GetStringTable()); @@ -4433,14 +4433,14 @@ int CMinecraftApp::UnlockFullSaveReturned(void *pParam,int iPad,C4JStorage::EMes // Signed in to PSN but not connected (no internet access) assert(!ProfileManager.isConnectedToPSN(iPad)); - UINT uiIDA[1]; + unsigned int uiIDA[1]; uiIDA[0] = IDS_OK; ui.RequestMessageBox( IDS_ERROR_NETWORK_TITLE, IDS_ERROR_NETWORK, uiIDA, 1, iPad, NULL, NULL, app.GetStringTable()); } else { // Not signed in to PSN - UINT uiIDA[1]; + unsigned int uiIDA[1]; uiIDA[0] = IDS_PRO_NOTONLINE_ACCEPT; ui.RequestMessageBox( IDS_PRO_NOTONLINE_TITLE, IDS_PRO_NOTONLINE_TEXT, uiIDA, 1, iPad, &CMinecraftApp::MustSignInFullVersionPurchaseReturned,&app, app.GetStringTable(), NULL, 0, false); } @@ -4470,7 +4470,7 @@ int CMinecraftApp::UnlockFullExitReturned(void *pParam,int iPad,C4JStorage::EMes ProfileManager.GetChatAndContentRestrictions(ProfileManager.GetPrimaryPad(),true,NULL,&bContentRestricted,NULL); if(bContentRestricted) { - UINT uiIDA[1]; + unsigned int uiIDA[1]; uiIDA[0]=IDS_CONFIRM_OK; ui.RequestMessageBox(IDS_ONLINE_SERVICE_TITLE, IDS_CONTENT_RESTRICTION, uiIDA, 1, ProfileManager.GetPrimaryPad(),NULL,&app, app.GetStringTable()); } @@ -4488,7 +4488,7 @@ int CMinecraftApp::UnlockFullExitReturned(void *pParam,int iPad,C4JStorage::EMes else { // you're not signed in to PSN! - UINT uiIDA[2]; + unsigned int uiIDA[2]; uiIDA[0]=IDS_PRO_NOTONLINE_ACCEPT; uiIDA[1]=IDS_PRO_NOTONLINE_DECLINE; ui.RequestMessageBox(IDS_PRO_NOTONLINE_TITLE, IDS_PRO_NOTONLINE_TEXT, uiIDA, 2, ProfileManager.GetPrimaryPad(),&CMinecraftApp::MustSignInFullVersionPurchaseReturnedExitTrial,&app, app.GetStringTable()); @@ -4502,7 +4502,7 @@ int CMinecraftApp::UnlockFullExitReturned(void *pParam,int iPad,C4JStorage::EMes // Signed in to PSN but not connected (no internet access) assert(!ProfileManager.isConnectedToPSN(iPad)); - UINT uiIDA[1]; + unsigned int uiIDA[1]; uiIDA[0] = IDS_OK; ui.RequestMessageBox( IDS_ERROR_NETWORK_TITLE, IDS_ERROR_NETWORK, uiIDA, 1, iPad, NULL, NULL, app.GetStringTable()); // still need to exit the trial or we'll be in the Pause menu with input ignored @@ -4511,7 +4511,7 @@ int CMinecraftApp::UnlockFullExitReturned(void *pParam,int iPad,C4JStorage::EMes else { // Not signed in to PSN - UINT uiIDA[1]; + unsigned int uiIDA[1]; uiIDA[0] = IDS_PRO_NOTONLINE_ACCEPT; ui.RequestMessageBox( IDS_PRO_NOTONLINE_TITLE, IDS_PRO_NOTONLINE_TEXT, uiIDA, 1, iPad, &CMinecraftApp::MustSignInFullVersionPurchaseReturnedExitTrial,&app, app.GetStringTable(), NULL, 0, false); } @@ -4543,7 +4543,7 @@ int CMinecraftApp::TrialOverReturned(void *pParam,int iPad,C4JStorage::EMessageR ProfileManager.GetChatAndContentRestrictions(ProfileManager.GetPrimaryPad(),true,NULL,&bContentRestricted,NULL); if(bContentRestricted) { - UINT uiIDA[1]; + unsigned int uiIDA[1]; uiIDA[0]=IDS_CONFIRM_OK; ui.RequestMessageBox(IDS_ONLINE_SERVICE_TITLE, IDS_CONTENT_RESTRICTION, uiIDA, 1, ProfileManager.GetPrimaryPad(),NULL,&app, app.GetStringTable()); } @@ -4558,7 +4558,7 @@ int CMinecraftApp::TrialOverReturned(void *pParam,int iPad,C4JStorage::EMessageR #if defined(__PS3__) // you're not signed in to PSN! - UINT uiIDA[2]; + unsigned int uiIDA[2]; uiIDA[0]=IDS_PRO_NOTONLINE_ACCEPT; uiIDA[1]=IDS_PRO_NOTONLINE_DECLINE; ui.RequestMessageBox(IDS_PRO_NOTONLINE_TITLE, IDS_PRO_NOTONLINE_TEXT, uiIDA, 2, ProfileManager.GetPrimaryPad(),&CMinecraftApp::MustSignInFullVersionPurchaseReturned,&app, app.GetStringTable()); @@ -4612,7 +4612,7 @@ void CMinecraftApp::ClearSignInChangeUsersMask() } } } -void CMinecraftApp::SignInChangeCallback(LPVOID pParam,bool bPrimaryPlayerChanged,unsigned int uiSignInData) +void CMinecraftApp::SignInChangeCallback(void* pParam,bool bPrimaryPlayerChanged,unsigned int uiSignInData) { #ifdef __PS3__ // this is normally set in the main menu, but we can go online in the create world screens, and the primary player name isn't updated @@ -4647,7 +4647,7 @@ void CMinecraftApp::SignInChangeCallback(LPVOID pParam,bool bPrimaryPlayerChange bool hasGuestIdChanged = false; for(unsigned int i = 0; i < XUSER_MAX_COUNT; ++i) { - DWORD guestNumber = 0; + unsigned long guestNumber = 0; if(ProfileManager.IsSignedIn(i)) { XUSER_SIGNIN_INFO info; @@ -4663,7 +4663,7 @@ void CMinecraftApp::SignInChangeCallback(LPVOID pParam,bool bPrimaryPlayerChange if( hasGuestIdChanged ) { - UINT uiIDA[1]; + unsigned int uiIDA[1]; uiIDA[0]=IDS_CONFIRM_OK; ui.RequestMessageBox(IDS_GUEST_ORDER_CHANGED_TITLE, IDS_GUEST_ORDER_CHANGED_TEXT, uiIDA, 1, ProfileManager.GetPrimaryPad(),NULL,NULL,app.GetStringTable()); } @@ -4785,7 +4785,7 @@ void CMinecraftApp::SignInChangeCallback(LPVOID pParam,bool bPrimaryPlayerChange } } -void CMinecraftApp::NotificationsCallback(LPVOID pParam,DWORD dwNotification, unsigned int uiParam) +void CMinecraftApp::NotificationsCallback(void* pParam,unsigned long dwNotification, unsigned int uiParam) { CMinecraftApp* pClass = (CMinecraftApp*)pParam; @@ -4854,7 +4854,7 @@ void CMinecraftApp::NotificationsCallback(LPVOID pParam,DWORD dwNotification, un { pDLCTexPack->m_pSoundBank->Destroy(); } - DWORD result = StorageManager.UnmountInstalledDLC("TPACK"); + unsigned long result = StorageManager.UnmountInstalledDLC("TPACK"); app.DebugPrintf("Unmount result is %d\n",result); } } @@ -4910,12 +4910,12 @@ int CMinecraftApp::NowDisplayFullVersionPurchase(void *pParam, bool bContinue, i return 0; } #endif -void CMinecraftApp::UpsellReturnedCallback(LPVOID pParam, eUpsellType type, eUpsellResponse result, int iUserData) +void CMinecraftApp::UpsellReturnedCallback(void* pParam, eUpsellType type, eUpsellResponse result, int iUserData) { ESen_UpsellID senType; ESen_UpsellOutcome senResponse; #ifdef __PS3__ - UINT uiIDA[2]; + unsigned int uiIDA[2]; #endif // Map the eUpsellResponse to the enum we use for sentient @@ -4967,7 +4967,7 @@ void CMinecraftApp::SetDebugSequence(const char *pchSeq) { InputManager.SetDebugSequence(pchSeq,&CMinecraftApp::DebugInputCallback,this); } -int CMinecraftApp::DebugInputCallback(LPVOID pParam) +int CMinecraftApp::DebugInputCallback(void* pParam) { CMinecraftApp* pClass = (CMinecraftApp*)pParam; //printf("sequence matched\n"); @@ -5004,7 +5004,7 @@ int CMinecraftApp::GetLocalPlayerCount(void) return iPlayerC; } -int CMinecraftApp::MarketplaceCountsCallback(LPVOID pParam,C4JStorage::DLC_TMS_DETAILS *pTMSDetails, int iPad) +int CMinecraftApp::MarketplaceCountsCallback(void* pParam,C4JStorage::DLC_TMS_DETAILS *pTMSDetails, int iPad) { app.DebugPrintf("Marketplace Counts= New - %d Total - %d\n",pTMSDetails->dwNewOffers,pTMSDetails->dwTotalOffers); @@ -5049,7 +5049,7 @@ bool CMinecraftApp::StartInstallDLCProcess(int iPad) } // Installed DLC callback -int CMinecraftApp::DLCInstalledCallback(LPVOID pParam,int iInstalledC,int iPad) +int CMinecraftApp::DLCInstalledCallback(void* pParam,int iInstalledC,int iPad) { app.DebugPrintf("--- CMinecraftApp::DLCInstalledCallback: totalDLC=%i, pad=%i.\n", iInstalledC, iPad); app.m_iTotalDLC = iInstalledC; @@ -5118,7 +5118,7 @@ void CMinecraftApp::MountNextDLC(int iPad) #define CONTENT_DATA_DISPLAY_NAME(a) (a.wszDisplayName) #endif -int CMinecraftApp::DLCMountedCallback(LPVOID pParam,int iPad,DWORD dwErr,DWORD dwLicenceMask) +int CMinecraftApp::DLCMountedCallback(void* pParam,int iPad,unsigned long dwErr,unsigned long dwLicenceMask) { #if defined(_XBOX) || defined(_DURANGO) || defined(__PS3__) || defined(__ORBIS__) || defined(_WINDOWS64) || defined (__PSVITA__) //Chris TODO app.DebugPrintf("--- CMinecraftApp::DLCMountedCallback\n"); @@ -5196,8 +5196,8 @@ int CMinecraftApp::DLCMountedCallback(LPVOID pParam,int iPad,DWORD dwErr,DWORD d // // if the file is not already in the memory textures, then read it from TMS // if(!bRes) // { -// BYTE *pBuffer=NULL; -// DWORD dwSize=0; +// uint8_t *pBuffer=NULL; +// unsigned long dwSize=0; // // 4J-PB - out for now for DaveK so he doesn't get the birthday cape // #ifdef _CONTENT_PACKAGE // C4JStorage::ETMSStatus eTMSStatus; @@ -5213,7 +5213,7 @@ int CMinecraftApp::DLCMountedCallback(LPVOID pParam,int iPad,DWORD dwErr,DWORD d void CMinecraftApp::HandleDLC(DLCPack *pack) { - DWORD dwFilesProcessed = 0; + unsigned long dwFilesProcessed = 0; #ifndef _XBOX #if defined(__PS3__) || defined(__ORBIS__) || defined(_WINDOWS64) || defined (__PSVITA__) std::vector dlcFilenames; @@ -5227,7 +5227,7 @@ int CMinecraftApp::DLCMountedCallback(LPVOID pParam,int iPad,DWORD dwErr,DWORD d } #else WIN32_FIND_DATA wfd; - HANDLE hFind; + void* hFind; char szPath[] = "DLCDrive:\\"; char szFullFilename[256]; @@ -5252,7 +5252,7 @@ int CMinecraftApp::DLCMountedCallback(LPVOID pParam,int iPad,DWORD dwErr,DWORD d if(( GetFileAttributes( szFullFilename ) & FILE_ATTRIBUTE_DIRECTORY) != FILE_ATTRIBUTE_DIRECTORY) { #ifdef _XBOX - DWORD dwPackID=m_dlcManager.retrievePackIDFromDLCDataFile(szFullFilename,pack); + unsigned long dwPackID=m_dlcManager.retrievePackIDFromDLCDataFile(szFullFilename,pack); // Do we need to override the TexturePack.pck with an updated version in a TU? wstring wsTemp=getFilePath(dwPackID, wstring(L"TexturePack.pck"),false ); @@ -5282,7 +5282,7 @@ int CMinecraftApp::DLCMountedCallback(LPVOID pParam,int iPad,DWORD dwErr,DWORD d if( dwFilesProcessed == 0 ) m_dlcManager.removePack(pack); } -// int CMinecraftApp::DLCReadCallback(LPVOID pParam,C4JStorage::DLC_FILE_DETAILS *pDLCData) +// int CMinecraftApp::DLCReadCallback(void* pParam,C4JStorage::DLC_FILE_DETAILS *pDLCData) // { // // @@ -5359,7 +5359,7 @@ bool CMinecraftApp::isXuidDeadmau5(PlayerUID xuid) return false; } -void CMinecraftApp::AddMemoryTextureFile(const wstring &wName,PBYTE pbData,DWORD dwBytes) +void CMinecraftApp::AddMemoryTextureFile(const wstring &wName,uint8_t* pbData,unsigned long dwBytes) { EnterCriticalSection(&csMemFilesLock); // check it's not already in @@ -5393,7 +5393,7 @@ void CMinecraftApp::AddMemoryTextureFile(const wstring &wName,PBYTE pbData,DWORD // 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)]; + pData = (PMEMDATA)new uint8_t[sizeof(MEMDATA)]; ZeroMemory( pData, sizeof(MEMDATA) ); pData->pbData=pbData; pData->dwBytes=dwBytes; @@ -5454,7 +5454,7 @@ bool CMinecraftApp::IsFileInMemoryTextures(const wstring &wName) return val; } -void CMinecraftApp::GetMemFileDetails(const wstring &wName,PBYTE *ppbData,DWORD *pdwBytes) +void CMinecraftApp::GetMemFileDetails(const wstring &wName,uint8_t* *ppbData,unsigned long *pdwBytes) { EnterCriticalSection(&csMemFilesLock); AUTO_VAR(it, m_MEM_Files.find(wName)); @@ -5467,7 +5467,7 @@ void CMinecraftApp::GetMemFileDetails(const wstring &wName,PBYTE *ppbData,DWORD LeaveCriticalSection(&csMemFilesLock); } -void CMinecraftApp::AddMemoryTPDFile(int iConfig,PBYTE pbData,DWORD dwBytes) +void CMinecraftApp::AddMemoryTPDFile(int iConfig,uint8_t* pbData,unsigned long dwBytes) { EnterCriticalSection(&csMemTPDLock); // check it's not already in @@ -5475,7 +5475,7 @@ void CMinecraftApp::AddMemoryTPDFile(int iConfig,PBYTE pbData,DWORD dwBytes) AUTO_VAR(it, m_MEM_TPD.find(iConfig)); if(it == m_MEM_TPD.end()) { - pData = (PMEMDATA)new BYTE[sizeof(MEMDATA)]; + pData = (PMEMDATA)new uint8_t[sizeof(MEMDATA)]; ZeroMemory( pData, sizeof(MEMDATA) ); pData->pbData=pbData; pData->dwBytes=dwBytes; @@ -5504,13 +5504,13 @@ void CMinecraftApp::RemoveMemoryTPDFile(int iConfig) } #ifdef _XBOX -int CMinecraftApp::GetTPConfigVal(WCHAR *pwchDataFile) +int CMinecraftApp::GetTPConfigVal(wchar_t *pwchDataFile) { DLC_INFO *pDLCInfo=NULL; // run through the DLC info to find the right texture pack/mash-up pack for(unsigned int i = 0; i < app.GetDLCInfoTexturesOffersCount(); ++i) { - ULONGLONG ull=app.GetDLCInfoTexturesFullOffer(i); + uint64_t ull=app.GetDLCInfoTexturesFullOffer(i); pDLCInfo=app.GetDLCInfoForFullOfferID(ull); if(wcscmp(pwchDataFile,pDLCInfo->wchDataFile)==0) @@ -5522,13 +5522,13 @@ int CMinecraftApp::GetTPConfigVal(WCHAR *pwchDataFile) return -1; } #elif defined _XBOX_ONE -int CMinecraftApp::GetTPConfigVal(WCHAR *pwchDataFile) +int CMinecraftApp::GetTPConfigVal(wchar_t *pwchDataFile) { DLC_INFO *pDLCInfo=NULL; // run through the DLC info to find the right texture pack/mash-up pack for(unsigned int i = 0; i < app.GetDLCInfoTexturesOffersCount(); ++i) { - pDLCInfo=app.GetDLCInfoForFullOfferID((WCHAR *)app.GetDLCInfoTexturesFullOffer(i).c_str()); + pDLCInfo=app.GetDLCInfoForFullOfferID((wchar_t *)app.GetDLCInfoTexturesFullOffer(i).c_str()); if(wcscmp(pwchDataFile,pDLCInfo->wchDataFile)==0) { @@ -5539,7 +5539,7 @@ int CMinecraftApp::GetTPConfigVal(WCHAR *pwchDataFile) return -1; } #elif defined _WINDOWS64 -int CMinecraftApp::GetTPConfigVal(WCHAR *pwchDataFile) +int CMinecraftApp::GetTPConfigVal(wchar_t *pwchDataFile) { return -1; } @@ -5556,7 +5556,7 @@ bool CMinecraftApp::IsFileInTPD(int iConfig) return val; } -void CMinecraftApp::GetTPD(int iConfig,PBYTE *ppbData,DWORD *pdwBytes) +void CMinecraftApp::GetTPD(int iConfig,uint8_t* *ppbData,unsigned long *pdwBytes) { EnterCriticalSection(&csMemTPDLock); AUTO_VAR(it, m_MEM_TPD.find(iConfig)); @@ -5577,7 +5577,7 @@ void CMinecraftApp::GetTPD(int iConfig,PBYTE *ppbData,DWORD *pdwBytes) // // read the local file // File gtsFile( wsFile->c_str() ); // -// __int64 fileSize = gtsFile.length(); +// int64_t fileSize = gtsFile.length(); // // if(fileSize!=0) // { @@ -5586,7 +5586,7 @@ void CMinecraftApp::GetTPD(int iConfig,PBYTE *ppbData,DWORD *pdwBytes) // fis.read(ba); // fis.close(); // -// bRes=StorageManager.WriteTMSFile(iQuadrant,eStorageFacility,(WCHAR *)wsFile->c_str(),ba.data, ba.length); +// bRes=StorageManager.WriteTMSFile(iQuadrant,eStorageFacility,(wchar_t *)wsFile->c_str(),ba.data, ba.length); // // } // #endif @@ -5609,7 +5609,7 @@ void CMinecraftApp::ExitGame() // Invites -void CMinecraftApp::ProcessInvite(DWORD dwUserIndex, DWORD dwLocalUsersMask, const INVITE_INFO * pInviteInfo) +void CMinecraftApp::ProcessInvite(unsigned long dwUserIndex, unsigned long dwLocalUsersMask, const INVITE_INFO * pInviteInfo) { m_InviteData.dwUserIndex=dwUserIndex; m_InviteData.dwLocalUsersMask=dwLocalUsersMask; @@ -5655,14 +5655,14 @@ int CMinecraftApp::ExitAndJoinFromInviteSaveDialogReturned(void *pParam,int iPad #ifdef _XBOX DLCTexturePack *pDLCTexPack=(DLCTexturePack *)tPack; - ULONGLONG ullOfferID_Full; + uint64_t ullOfferID_Full; app.GetDLCFullOfferIDForPackID(pDLCTexPack->getDLCParentPackId(),&ullOfferID_Full); // tell sentient about the upsell of the full version of the skin pack TelemetryManager->RecordUpsellPresented(iPad, eSet_UpsellID_Texture_DLC, ullOfferID_Full & 0xFFFFFFFF); #endif - UINT uiIDA[2]; + unsigned int uiIDA[2]; uiIDA[0]=IDS_CONFIRM_OK; uiIDA[1]=IDS_CONFIRM_CANCEL; @@ -5680,7 +5680,7 @@ int CMinecraftApp::ExitAndJoinFromInviteSaveDialogReturned(void *pParam,int iPad // we need to ask if they are sure they want to overwrite the existing game if(bSaveExists) { - UINT uiIDA[2]; + unsigned int uiIDA[2]; uiIDA[0]=IDS_CONFIRM_CANCEL; uiIDA[1]=IDS_CONFIRM_OK; ui.RequestMessageBox(IDS_TITLE_SAVE_GAME, IDS_CONFIRM_SAVE_GAME, uiIDA, 2, ProfileManager.GetPrimaryPad(),&CMinecraftApp::ExitAndJoinFromInviteAndSaveReturned,pClass, app.GetStringTable()); @@ -5698,7 +5698,7 @@ int CMinecraftApp::ExitAndJoinFromInviteSaveDialogReturned(void *pParam,int iPad else { // been a few requests for a confirm on exit without saving - UINT uiIDA[2]; + unsigned int uiIDA[2]; uiIDA[0]=IDS_CONFIRM_CANCEL; uiIDA[1]=IDS_CONFIRM_OK; ui.RequestMessageBox(IDS_TITLE_DECLINE_SAVE_GAME, IDS_CONFIRM_DECLINE_SAVE_GAME, uiIDA, 2, ProfileManager.GetPrimaryPad(),&CMinecraftApp::ExitAndJoinFromInviteDeclineSaveReturned,pClass, app.GetStringTable()); @@ -5719,7 +5719,7 @@ int CMinecraftApp::WarningTrialTexturePackReturned(void *pParam,int iPad,C4JStor TexturePack *tPack = Minecraft::GetInstance()->skins->getSelected(); // get the dlc texture pack DLCTexturePack *pDLCTexPack=(DLCTexturePack *)tPack; - ULONGLONG ullIndexA[1]; + uint64_t ullIndexA[1]; // Need to get the parent packs id, since this may be one of many child packs with their own ids app.GetDLCFullOfferIDForPackID(pDLCTexPack->getDLCParentPackId(),&ullIndexA[0]); @@ -5749,7 +5749,7 @@ int CMinecraftApp::ExitAndJoinFromInviteAndSaveReturned(void *pParam,int iPad,C4 // results switched for this dialog if(result==C4JStorage::EMessage_ResultDecline) { - INT saveOrCheckpointId = 0; + int saveOrCheckpointId = 0; // Check they have the full texture pack if they are using one // 4J-PB - Is the player trying to save but they are using a trial texturepack ? @@ -5765,14 +5765,14 @@ int CMinecraftApp::ExitAndJoinFromInviteAndSaveReturned(void *pParam,int iPad,C4 #ifdef _XBOX DLCTexturePack *pDLCTexPack=(DLCTexturePack *)tPack; - ULONGLONG ullOfferID_Full; + uint64_t ullOfferID_Full; app.GetDLCFullOfferIDForPackID(pDLCTexPack->getDLCParentPackId(),&ullOfferID_Full); // tell sentient about the upsell of the full version of the skin pack TelemetryManager->RecordUpsellPresented(iPad, eSet_UpsellID_Texture_DLC, ullOfferID_Full & 0xFFFFFFFF); #endif - UINT uiIDA[2]; + unsigned int uiIDA[2]; uiIDA[0]=IDS_CONFIRM_OK; uiIDA[1]=IDS_CONFIRM_CANCEL; @@ -5909,7 +5909,7 @@ void CMinecraftApp::InitialiseTips() { // We'll randomise the tips at start up based on their priority - ZeroMemory(m_TipIDA,sizeof(UINT)*MAX_TIPS_GAMETIP+MAX_TIPS_TRIVIATIP); + ZeroMemory(m_TipIDA,sizeof(unsigned int)*MAX_TIPS_GAMETIP+MAX_TIPS_TRIVIATIP); // Make the first tip tell you that you can play splitscreen in HD modes if you are in SD if(!RenderManager.IsHiDef()) @@ -5973,7 +5973,7 @@ void CMinecraftApp::InitialiseTips() m_uiCurrentTip=0; } -UINT CMinecraftApp::GetNextTip() +unsigned int CMinecraftApp::GetNextTip() { static bool bShowSkinDLCTip=true; // don't display the DLC tip in the trial game @@ -6125,7 +6125,7 @@ wstring CMinecraftApp::FormatHTMLString(int iPad, const wstring &desc, int shado #endif // _XBOX // Fix for #8903 - UI: Localization: KOR/JPN/CHT: Button Icons are rendered with padding space, which looks no good - DWORD dwLanguage = XGetLanguage( ); + unsigned long dwLanguage = XGetLanguage( ); switch(dwLanguage) { case XC_LANGUAGE_KOREAN: @@ -6420,26 +6420,26 @@ wstring CMinecraftApp::GetIconReplacement(unsigned int uiIcon) unordered_map CMinecraftApp::MojangData; unordered_map CMinecraftApp::DLCTextures_PackID; unordered_map CMinecraftApp::DLCInfo; -unordered_map CMinecraftApp::DLCInfo_SkinName; +unordered_map CMinecraftApp::DLCInfo_SkinName; #elif defined(_DURANGO) unordered_map CMinecraftApp::MojangData; unordered_map CMinecraftApp::DLCTextures_PackID; // for mash-up packs & texture packs -//unordered_map CMinecraftApp::DLCInfo_Trial; // full offerid, dlc_info +//unordered_map CMinecraftApp::DLCInfo_Trial; // full offerid, dlc_info unordered_map CMinecraftApp::DLCInfo_Full; // full offerid, dlc_info unordered_map CMinecraftApp::DLCInfo_SkinName; // skin name, full offer id #else unordered_map CMinecraftApp::MojangData; -unordered_map CMinecraftApp::DLCTextures_PackID; -unordered_map CMinecraftApp::DLCInfo_Trial; -unordered_map CMinecraftApp::DLCInfo_Full; -unordered_map CMinecraftApp::DLCInfo_SkinName; +unordered_map CMinecraftApp::DLCTextures_PackID; +unordered_map CMinecraftApp::DLCInfo_Trial; +unordered_map CMinecraftApp::DLCInfo_Full; +unordered_map CMinecraftApp::DLCInfo_SkinName; #endif -HRESULT CMinecraftApp::RegisterMojangData(WCHAR *pXuidName, PlayerUID xuid, WCHAR *pSkin, WCHAR *pCape) +int CMinecraftApp::RegisterMojangData(wchar_t *pXuidName, PlayerUID xuid, wchar_t *pSkin, wchar_t *pCape) { - HRESULT hr=S_OK; + int hr=S_OK; eXUID eTempXuid=eXUID_Undefined; MOJANG_DATA *pMojangData=NULL; @@ -6479,9 +6479,9 @@ MOJANG_DATA *CMinecraftApp::GetMojangDataForXuid(PlayerUID xuid) return MojangData[xuid]; } -HRESULT CMinecraftApp::RegisterConfigValues(WCHAR *pType, int iValue) +int CMinecraftApp::RegisterConfigValues(wchar_t *pType, int iValue) { - HRESULT hr=S_OK; + int hr=S_OK; // #ifdef _XBOX // if(pType!=NULL) @@ -6510,9 +6510,9 @@ HRESULT CMinecraftApp::RegisterConfigValues(WCHAR *pType, int iValue) } #if (defined _XBOX || defined _WINDOWS64) -HRESULT CMinecraftApp::RegisterDLCData(WCHAR *pType, WCHAR *pBannerName, int iGender, __uint64 ullOfferID_Full, __uint64 ullOfferID_Trial, WCHAR *pFirstSkin, unsigned int uiSortIndex, int iConfig, WCHAR *pDataFile) +int CMinecraftApp::RegisterDLCData(wchar_t *pType, wchar_t *pBannerName, int iGender, uint64_t ullOfferID_Full, uint64_t ullOfferID_Trial, wchar_t *pFirstSkin, unsigned int uiSortIndex, int iConfig, wchar_t *pDataFile) { - HRESULT hr=S_OK; + int hr=S_OK; DLC_INFO *pDLCData=new DLC_INFO; ZeroMemory(pDLCData,sizeof(DLC_INFO)); pDLCData->ullOfferID_Full=ullOfferID_Full; @@ -6580,11 +6580,11 @@ unordered_map *CMinecraftApp::GetDLCInfo() return &DLCInfo_Full; } -HRESULT CMinecraftApp::RegisterDLCData(eDLCContentType eType, WCHAR *pwchBannerName,WCHAR *pwchProductId, WCHAR *pwchProductName, WCHAR *pwchFirstSkin, int iConfig, unsigned int uiSortIndex) +int CMinecraftApp::RegisterDLCData(eDLCContentType eType, wchar_t *pwchBannerName,wchar_t *pwchProductId, wchar_t *pwchProductName, wchar_t *pwchFirstSkin, int iConfig, unsigned int uiSortIndex) { - HRESULT hr=S_OK; + int hr=S_OK; // 4J-PB - need to convert the product id to uppercase because the catalog calls come back with upper case - WCHAR wchUppercaseProductID[64]; + wchar_t wchUppercaseProductID[64]; if(pwchProductId[0]!=0) { for(int i=0;i<64;i++) @@ -6648,11 +6648,11 @@ HRESULT CMinecraftApp::RegisterDLCData(eDLCContentType eType, WCHAR *pwchBannerN } #else -HRESULT CMinecraftApp::RegisterDLCData(char *pchDLCName, unsigned int uiSortIndex,char *pchImageURL) +int CMinecraftApp::RegisterDLCData(char *pchDLCName, unsigned int uiSortIndex,char *pchImageURL) { // on PS3 we get all the required info from the name char chDLCType[3]; - HRESULT hr=S_OK; + int hr=S_OK; DLC_INFO *pDLCData=new DLC_INFO; ZeroMemory(pDLCData,sizeof(DLC_INFO)); @@ -6702,7 +6702,7 @@ HRESULT CMinecraftApp::RegisterDLCData(char *pchDLCName, unsigned int uiSortInde #if defined( __PS3__) || defined(__ORBIS__) || defined(__PSVITA__) -bool CMinecraftApp::GetDLCFullOfferIDForSkinID(const wstring &FirstSkin,ULONGLONG *pullVal) +bool CMinecraftApp::GetDLCFullOfferIDForSkinID(const wstring &FirstSkin,uint64_t *pullVal) { AUTO_VAR(it, DLCInfo_SkinName.find(FirstSkin)); if( it == DLCInfo_SkinName.end() ) @@ -6711,7 +6711,7 @@ bool CMinecraftApp::GetDLCFullOfferIDForSkinID(const wstring &FirstSkin,ULONGLON } else { - *pullVal=(ULONGLONG)it->second; + *pullVal=(uint64_t)it->second; return true; } } @@ -6848,7 +6848,7 @@ wstring CMinecraftApp::GetDLCInfoTexturesFullOffer(int iIndex) return it->second; } #else -bool CMinecraftApp::GetDLCFullOfferIDForSkinID(const wstring &FirstSkin,ULONGLONG *pullVal) +bool CMinecraftApp::GetDLCFullOfferIDForSkinID(const wstring &FirstSkin,uint64_t *pullVal) { AUTO_VAR(it, DLCInfo_SkinName.find(FirstSkin)); if( it == DLCInfo_SkinName.end() ) @@ -6857,25 +6857,25 @@ bool CMinecraftApp::GetDLCFullOfferIDForSkinID(const wstring &FirstSkin,ULONGLON } else { - *pullVal=(ULONGLONG)it->second; + *pullVal=(uint64_t)it->second; return true; } } -bool CMinecraftApp::GetDLCFullOfferIDForPackID(const int iPackID,ULONGLONG *pullVal) +bool CMinecraftApp::GetDLCFullOfferIDForPackID(const int iPackID,uint64_t *pullVal) { AUTO_VAR(it, DLCTextures_PackID.find(iPackID)); if( it == DLCTextures_PackID.end() ) { - *pullVal=(ULONGLONG)0; + *pullVal=(uint64_t)0; return false; } else { - *pullVal=(ULONGLONG)it->second; + *pullVal=(uint64_t)it->second; return true; } } -DLC_INFO *CMinecraftApp::GetDLCInfoForTrialOfferID(ULONGLONG ullOfferID_Trial) +DLC_INFO *CMinecraftApp::GetDLCInfoForTrialOfferID(uint64_t ullOfferID_Trial) { //DLC_INFO *pDLCInfo=NULL; if(DLCInfo_Trial.size()>0) @@ -6897,7 +6897,7 @@ DLC_INFO *CMinecraftApp::GetDLCInfoForTrialOfferID(ULONGLONG ullOfferID_Trial) DLC_INFO *CMinecraftApp::GetDLCInfoTrialOffer(int iIndex) { - unordered_map::iterator it= DLCInfo_Trial.begin(); + unordered_map::iterator it= DLCInfo_Trial.begin(); for(int i=0;i::iterator it= DLCInfo_Full.begin(); + unordered_map::iterator it= DLCInfo_Full.begin(); for(int i=0;isecond; } -ULONGLONG CMinecraftApp::GetDLCInfoTexturesFullOffer(int iIndex) +uint64_t CMinecraftApp::GetDLCInfoTexturesFullOffer(int iIndex) { - unordered_map::iterator it= DLCTextures_PackID.begin(); + unordered_map::iterator it= DLCTextures_PackID.begin(); for(int i=0;i0) @@ -6951,7 +6951,7 @@ DLC_INFO *CMinecraftApp::GetDLCInfoForFullOfferID(WCHAR *pwchProductID) } else return NULL; } -DLC_INFO *CMinecraftApp::GetDLCInfoForProductName(WCHAR *pwchProductName) +DLC_INFO *CMinecraftApp::GetDLCInfoForProductName(wchar_t *pwchProductName) { unordered_map::iterator it= DLCInfo_Full.begin(); wstring wsProductName=pwchProductName; @@ -6972,7 +6972,7 @@ DLC_INFO *CMinecraftApp::GetDLCInfoForProductName(WCHAR *pwchProductName) #elif defined(__PS3__) || defined(__ORBIS__) || defined (__PSVITA__) #else -DLC_INFO *CMinecraftApp::GetDLCInfoForFullOfferID(ULONGLONG ullOfferID_Full) +DLC_INFO *CMinecraftApp::GetDLCInfoForFullOfferID(uint64_t ullOfferID_Full) { if(DLCInfo_Full.size()>0) @@ -7066,11 +7066,11 @@ int CMinecraftApp::RemoteSaveThreadProc( void* lpParameter ) return S_OK; } -void CMinecraftApp::ExitGameFromRemoteSave( LPVOID lpParameter ) +void CMinecraftApp::ExitGameFromRemoteSave( void* lpParameter ) { int primaryPad = ProfileManager.GetPrimaryPad(); - UINT uiIDA[3]; + unsigned int uiIDA[3]; uiIDA[0]=IDS_CONFIRM_CANCEL; uiIDA[1]=IDS_CONFIRM_OK; @@ -7159,7 +7159,7 @@ void CMinecraftApp::AddLevelToBannedLevelList(int iPad, PlayerUID xuid, char *ps memset(pBannedListData,0,sizeof(BANNEDLISTDATA)); #ifdef _DURANGO - memcpy(&pBannedListData->wchPlayerUID, xuid.toString().c_str(), sizeof(WCHAR)*64); + memcpy(&pBannedListData->wchPlayerUID, xuid.toString().c_str(), sizeof(wchar_t)*64); #else memcpy(&pBannedListData->xuid, &xuid, sizeof(PlayerUID)); #endif @@ -7168,8 +7168,8 @@ void CMinecraftApp::AddLevelToBannedLevelList(int iPad, PlayerUID xuid, char *ps if(bWriteToTMS) { - DWORD dwDataBytes=(DWORD)(sizeof(BANNEDLISTDATA)*m_vBannedListA[iPad]->size()); - PBANNEDLISTDATA pBannedList = (BANNEDLISTDATA *)(new CHAR [dwDataBytes]); + unsigned long dwDataBytes=(unsigned long)(sizeof(BANNEDLISTDATA)*m_vBannedListA[iPad]->size()); + PBANNEDLISTDATA pBannedList = (BANNEDLISTDATA *)(new char [dwDataBytes]); int iCount=0; for(AUTO_VAR(it, m_vBannedListA[iPad]->begin()); it != m_vBannedListA[iPad]->end(); ++it) { @@ -7179,11 +7179,11 @@ void CMinecraftApp::AddLevelToBannedLevelList(int iPad, PlayerUID xuid, char *ps // 4J-PB - write to TMS++ now - //bool bRes=StorageManager.WriteTMSFile(iPad,C4JStorage::eGlobalStorage_TitleUser,L"BannedList",(PBYTE)pBannedList, dwDataBytes); + //bool bRes=StorageManager.WriteTMSFile(iPad,C4JStorage::eGlobalStorage_TitleUser,L"BannedList",(uint8_t*)pBannedList, dwDataBytes); #ifdef _XBOX StorageManager.TMSPP_WriteFile(iPad,C4JStorage::eGlobalStorage_TitleUser,C4JStorage::TMS_FILETYPE_BINARY,C4JStorage::TMS_UGCTYPE_NONE,"BannedList",(PCHAR) pBannedList, dwDataBytes,NULL,NULL, 0); #elif defined _XBOX_ONE - StorageManager.TMSPP_WriteFile(iPad,C4JStorage::eGlobalStorage_TitleUser,C4JStorage::TMS_FILETYPE_BINARY,L"BannedList",(PBYTE) pBannedList, dwDataBytes,NULL,NULL, 0); + StorageManager.TMSPP_WriteFile(iPad,C4JStorage::eGlobalStorage_TitleUser,C4JStorage::TMS_FILETYPE_BINARY,L"BannedList",(uint8_t*) pBannedList, dwDataBytes,NULL,NULL, 0); #endif } // update telemetry too @@ -7243,7 +7243,7 @@ void CMinecraftApp::RemoveLevelFromBannedLevelList(int iPad, PlayerUID xuid, cha } } - DWORD dwDataBytes=(DWORD)(sizeof(BANNEDLISTDATA)*m_vBannedListA[iPad]->size()); + unsigned long dwDataBytes=(unsigned long)(sizeof(BANNEDLISTDATA)*m_vBannedListA[iPad]->size()); if(dwDataBytes==0) { // wipe the file @@ -7255,7 +7255,7 @@ void CMinecraftApp::RemoveLevelFromBannedLevelList(int iPad, PlayerUID xuid, cha } else { - PBANNEDLISTDATA pBannedList = (BANNEDLISTDATA *)(new BYTE [dwDataBytes]); + PBANNEDLISTDATA pBannedList = (BANNEDLISTDATA *)(new uint8_t [dwDataBytes]); int iSize=(int)m_vBannedListA[iPad]->size(); for(int i=0;im_eType=eSmallText; pCreditStruct->m_iStringID[0]=NO_TRANSLATED_STRING; pCreditStruct->m_iStringID[1]=NO_TRANSLATED_STRING; - pCreditStruct->m_Text=new WCHAR [wcslen(lpStr)+1]; - wcscpy((WCHAR *)pCreditStruct->m_Text,lpStr); + pCreditStruct->m_Text=new wchar_t [wcslen(lpStr)+1]; + wcscpy((wchar_t *)pCreditStruct->m_Text,lpStr); vDLCCredits.push_back(pCreditStruct); } @@ -7305,7 +7305,7 @@ bool CMinecraftApp::AlreadySeenCreditText(const wstring &wstemp) } // add this text - m_vCreditText.push_back((WCHAR * )wstemp.c_str()); + m_vCreditText.push_back((wchar_t * )wstemp.c_str()); return false; } @@ -7641,7 +7641,7 @@ void CMinecraftApp::setLevelGenerationOptions(LevelGenerationOptions *levelGen) m_gameRules.setLevelGenerationOptions(levelGen); } -LPCWSTR CMinecraftApp::GetGameRulesString(const wstring &key) +const wchar_t* CMinecraftApp::GetGameRulesString(const wstring &key) { return m_gameRules.GetGameRulesString(key); } @@ -7667,7 +7667,7 @@ unsigned int CMinecraftApp::FromBigEndian(unsigned int uiValue) #endif } -void CMinecraftApp::GetImageTextData(PBYTE pbImageData, DWORD dwImageBytes,unsigned char *pszSeed,unsigned int &uiHostOptions,bool &bHostOptionsRead,DWORD &uiTexturePack) +void CMinecraftApp::GetImageTextData(uint8_t* pbImageData, unsigned long dwImageBytes,unsigned char *pszSeed,unsigned int &uiHostOptions,bool &bHostOptionsRead,unsigned long &uiTexturePack) { unsigned char *ucPtr=pbImageData; unsigned int uiCount=0; @@ -7763,7 +7763,7 @@ void CMinecraftApp::GetImageTextData(PBYTE pbImageData, DWORD dwImageBytes,unsig return; } -unsigned int CMinecraftApp::CreateImageTextData(PBYTE bTextMetadata, __int64 seed, bool hasSeed, unsigned int uiHostOptions, unsigned int uiTexturePackId) +unsigned int CMinecraftApp::CreateImageTextData(uint8_t* bTextMetadata, int64_t seed, bool hasSeed, unsigned int uiHostOptions, unsigned int uiTexturePackId) { int iTextMetadataBytes = 0; if(hasSeed) @@ -7853,7 +7853,7 @@ void CMinecraftApp::ClearTerrainFeaturePosition() } } -void CMinecraftApp::UpdatePlayerInfo(BYTE networkSmallId, SHORT playerColourIndex, unsigned int playerGamePrivileges) +void CMinecraftApp::UpdatePlayerInfo(uint8_t networkSmallId, int16_t playerColourIndex, unsigned int playerGamePrivileges) { for(unsigned int i = 0; i < MINECRAFT_NET_MAX_PLAYERS; ++i) { @@ -7870,7 +7870,7 @@ void CMinecraftApp::UpdatePlayerInfo(BYTE networkSmallId, SHORT playerColourInde } } -short CMinecraftApp::GetPlayerColour(BYTE networkSmallId) +short CMinecraftApp::GetPlayerColour(uint8_t networkSmallId) { short index = -1; for(unsigned int i = 0; i < MINECRAFT_NET_MAX_PLAYERS; ++i) @@ -7885,7 +7885,7 @@ short CMinecraftApp::GetPlayerColour(BYTE networkSmallId) } -unsigned int CMinecraftApp::GetPlayerPrivileges(BYTE networkSmallId) +unsigned int CMinecraftApp::GetPlayerPrivileges(uint8_t networkSmallId) { unsigned int privileges = 0; for(unsigned int i = 0; i < MINECRAFT_NET_MAX_PLAYERS; ++i) @@ -7942,7 +7942,7 @@ wstring CMinecraftApp::getEntityName(eINSTANCEOF type) return L""; } -DWORD CMinecraftApp::m_dwContentTypeA[e_Marketplace_MAX]= +unsigned long CMinecraftApp::m_dwContentTypeA[e_Marketplace_MAX]= { XMARKETPLACE_OFFERING_TYPE_CONTENT, // e_DLC_SkinPack, e_DLC_TexturePacks, e_DLC_MashupPacks #ifndef _XBOX_ONE @@ -8058,7 +8058,7 @@ unsigned int CMinecraftApp::AddTMSPPFileTypeRequest(eDLCContentType eType, bool // first check if the image is already in the memory textures, since we might be loading some from the Title Update partition if(pDLC->wchDataFile[0]!=0) { - //WCHAR *cString = pDLC->wchDataFile; + //wchar_t *cString = pDLC->wchDataFile; // 4J-PB - shouldn't check this here - let the TMS files override it, so if they are on TMS, we'll take them first //int iIndex = app.GetLocalTMSFileIndex(pDLC->wchDataFile,true); @@ -8090,7 +8090,7 @@ unsigned int CMinecraftApp::AddTMSPPFileTypeRequest(eDLCContentType eType, bool pTMSPPreq->lpCallbackParam=this; pTMSPPreq->eStorageFacility=C4JStorage::eGlobalStorage_Title; pTMSPPreq->eFileTypeVal=C4JStorage::TMS_FILETYPE_BINARY; - memcpy(pTMSPPreq->wchFilename,pDLC->wchDataFile,sizeof(WCHAR)*MAX_BANNERNAME_SIZE); + memcpy(pTMSPPreq->wchFilename,pDLC->wchDataFile,sizeof(wchar_t)*MAX_BANNERNAME_SIZE); pTMSPPreq->eType=e_DLC_TexturePackData; pTMSPPreq->eState=e_TMS_ContentState_Queued; m_bAllTMSContentRetrieved=false; @@ -8121,7 +8121,7 @@ unsigned int CMinecraftApp::AddTMSPPFileTypeRequest(eDLCContentType eType, bool if(pDLC->eDLCType==eType) { - WCHAR *cString = pDLC->wchBanner; + wchar_t *cString = pDLC->wchBanner; // 4J-PB - shouldn't check this here - let the TMS files override it, so if they are on TMS, we'll take them first // is the file in the TMS XZP? @@ -8154,7 +8154,7 @@ unsigned int CMinecraftApp::AddTMSPPFileTypeRequest(eDLCContentType eType, bool pTMSPPreq->eStorageFacility=C4JStorage::eGlobalStorage_Title; pTMSPPreq->eFileTypeVal=C4JStorage::TMS_FILETYPE_BINARY; //wcstombs(pTMSPPreq->szFilename,pDLC->wchBanner,MAX_TMSFILENAME_SIZE); - memcpy(pTMSPPreq->wchFilename,pDLC->wchBanner,sizeof(WCHAR)*MAX_BANNERNAME_SIZE); + memcpy(pTMSPPreq->wchFilename,pDLC->wchBanner,sizeof(wchar_t)*MAX_BANNERNAME_SIZE); pTMSPPreq->eType=eType; pTMSPPreq->eState=e_TMS_ContentState_Queued; @@ -8178,7 +8178,7 @@ unsigned int CMinecraftApp::AddTMSPPFileTypeRequest(eDLCContentType eType, bool { // first check if the image is already in the memory textures, since we might be loading some from the Title Update partition - WCHAR *cString = pDLC->wchBanner; + wchar_t *cString = pDLC->wchBanner; // 4J-PB - shouldn't check this here - let the TMS files override it, so if they are on TMS, we'll take them first //int iIndex = app.GetLocalTMSFileIndex(cString,true); @@ -8216,7 +8216,7 @@ unsigned int CMinecraftApp::AddTMSPPFileTypeRequest(eDLCContentType eType, bool pTMSPPreq->eFileTypeVal=C4JStorage::TMS_FILETYPE_BINARY; //wcstombs(pTMSPPreq->szFilename,pDLC->wchBanner,MAX_TMSFILENAME_SIZE); - memcpy(pTMSPPreq->wchFilename,pDLC->wchBanner,sizeof(WCHAR)*MAX_BANNERNAME_SIZE); + memcpy(pTMSPPreq->wchFilename,pDLC->wchBanner,sizeof(wchar_t)*MAX_BANNERNAME_SIZE); pTMSPPreq->eType=eType; pTMSPPreq->eState=e_TMS_ContentState_Queued; m_bAllTMSContentRetrieved=false; @@ -8311,11 +8311,11 @@ bool CMinecraftApp::RetrieveNextDLCContent() #if !defined(__PS3__) && !defined(__ORBIS__) && !defined(__PSVITA__) #ifdef _XBOX_ONE -int CMinecraftApp::TMSPPFileReturned(LPVOID pParam,int iPad,int iUserData,LPVOID lpvData, WCHAR* wchFilename) +int CMinecraftApp::TMSPPFileReturned(void* pParam,int iPad,int iUserData,void* lpvData, wchar_t* wchFilename) { C4JStorage::PTMSPP_FILEDATA pFileData=(C4JStorage::PTMSPP_FILEDATA)lpvData; #else -int CMinecraftApp::TMSPPFileReturned(LPVOID pParam,int iPad,int iUserData,C4JStorage::PTMSPP_FILEDATA pFileData, LPCSTR szFilename) +int CMinecraftApp::TMSPPFileReturned(void* pParam,int iPad,int iUserData,C4JStorage::PTMSPP_FILEDATA pFileData, const char* szFilename) { #endif @@ -8350,7 +8350,7 @@ int CMinecraftApp::TMSPPFileReturned(LPVOID pParam,int iPad,int iUserData,C4JSto 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 - PBYTE pbData = new BYTE [pFileData->dwSize]; + uint8_t* pbData = new uint8_t [pFileData->dwSize]; memcpy(pbData,pFileData->pbData,pFileData->dwSize); pClass->m_vTMSPPData.push_back(pbData); @@ -8365,7 +8365,7 @@ int CMinecraftApp::TMSPPFileReturned(LPVOID pParam,int iPad,int iUserData,C4JSto 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 - PBYTE pbData = new BYTE [pFileData->dwSize]; + uint8_t* pbData = new uint8_t [pFileData->dwSize]; memcpy(pbData,pFileData->pbData,pFileData->dwSize); pClass->m_vTMSPPData.push_back(pbData); @@ -8582,7 +8582,7 @@ void CMinecraftApp::ClearTMSPPFilesRetrieved() LeaveCriticalSection(&csTMSPPDownloadQueue); } -int CMinecraftApp::DLCOffersReturned(void *pParam, int iOfferC, DWORD dwType, int iPad) +int CMinecraftApp::DLCOffersReturned(void *pParam, int iOfferC, unsigned long dwType, int iPad) { CMinecraftApp* pClass = (CMinecraftApp *) pParam; @@ -8605,7 +8605,7 @@ int CMinecraftApp::DLCOffersReturned(void *pParam, int iOfferC, DWORD dwType, in return 0; } -eDLCContentType CMinecraftApp::Find_eDLCContentType(DWORD dwType) +eDLCContentType CMinecraftApp::Find_eDLCContentType(unsigned long dwType) { for(int i=0;igetRenderer(eTYPE_PLAYER); Model *pModel = renderer->getModel(); @@ -8659,15 +8659,15 @@ void CMinecraftApp::SetAdditionalSkinBoxes(DWORD dwSkinID, SKIN_BOX *SkinBoxA, D } - m_AdditionalModelParts.insert( std::pair *>(dwSkinID, pvModelPart) ); - m_AdditionalSkinBoxes.insert( std::pair *>(dwSkinID, pvSkinBoxes) ); + m_AdditionalModelParts.insert( std::pair *>(dwSkinID, pvModelPart) ); + m_AdditionalSkinBoxes.insert( std::pair *>(dwSkinID, pvSkinBoxes) ); LeaveCriticalSection( &csAdditionalSkinBoxes ); LeaveCriticalSection( &csAdditionalModelParts ); } -vector * CMinecraftApp::SetAdditionalSkinBoxes(DWORD dwSkinID, vector *pvSkinBoxA) +vector * CMinecraftApp::SetAdditionalSkinBoxes(unsigned long dwSkinID, vector *pvSkinBoxA) { EntityRenderer *renderer = EntityRenderDispatcher::instance->getRenderer(eTYPE_PLAYER); Model *pModel = renderer->getModel(); @@ -8687,8 +8687,8 @@ vector * CMinecraftApp::SetAdditionalSkinBoxes(DWORD dwSkinID, vect } } - m_AdditionalModelParts.insert( std::pair *>(dwSkinID, pvModelPart) ); - m_AdditionalSkinBoxes.insert( std::pair *>(dwSkinID, pvSkinBoxA) ); + m_AdditionalModelParts.insert( std::pair *>(dwSkinID, pvModelPart) ); + m_AdditionalSkinBoxes.insert( std::pair *>(dwSkinID, pvSkinBoxA) ); LeaveCriticalSection( &csAdditionalSkinBoxes ); LeaveCriticalSection( &csAdditionalModelParts ); @@ -8696,7 +8696,7 @@ vector * CMinecraftApp::SetAdditionalSkinBoxes(DWORD dwSkinID, vect } -vector *CMinecraftApp::GetAdditionalModelParts(DWORD dwSkinID) +vector *CMinecraftApp::GetAdditionalModelParts(unsigned long dwSkinID) { EnterCriticalSection( &csAdditionalModelParts ); vector *pvModelParts=NULL; @@ -8713,7 +8713,7 @@ vector *CMinecraftApp::GetAdditionalModelParts(DWORD dwSkinID) return pvModelParts; } -vector *CMinecraftApp::GetAdditionalSkinBoxes(DWORD dwSkinID) +vector *CMinecraftApp::GetAdditionalSkinBoxes(unsigned long dwSkinID) { EnterCriticalSection( &csAdditionalSkinBoxes ); vector *pvSkinBoxes=NULL; @@ -8730,7 +8730,7 @@ vector *CMinecraftApp::GetAdditionalSkinBoxes(DWORD dwSkinID) return pvSkinBoxes; } -unsigned int CMinecraftApp::GetAnimOverrideBitmask(DWORD dwSkinID) +unsigned int CMinecraftApp::GetAnimOverrideBitmask(unsigned long dwSkinID) { EnterCriticalSection( &csAnimOverrideBitmask ); unsigned int uiAnimOverrideBitmask=0L; @@ -8748,7 +8748,7 @@ unsigned int CMinecraftApp::GetAnimOverrideBitmask(DWORD dwSkinID) return uiAnimOverrideBitmask; } -void CMinecraftApp::SetAnimOverrideBitmask(DWORD dwSkinID,unsigned int uiAnimOverrideBitmask) +void CMinecraftApp::SetAnimOverrideBitmask(unsigned long dwSkinID,unsigned int uiAnimOverrideBitmask) { // Make thread safe EnterCriticalSection( &csAnimOverrideBitmask ); @@ -8762,11 +8762,11 @@ void CMinecraftApp::SetAnimOverrideBitmask(DWORD dwSkinID,unsigned int uiAnimOve return; // already in here } } - m_AnimOverrides.insert( std::pair(dwSkinID, uiAnimOverrideBitmask) ); + m_AnimOverrides.insert( std::pair(dwSkinID, uiAnimOverrideBitmask) ); LeaveCriticalSection( &csAnimOverrideBitmask ); } -DWORD CMinecraftApp::getSkinIdFromPath(const wstring &skin) +unsigned long CMinecraftApp::getSkinIdFromPath(const wstring &skin) { bool dlcSkin = false; unsigned int skinId = 0; @@ -8792,9 +8792,9 @@ DWORD CMinecraftApp::getSkinIdFromPath(const wstring &skin) return skinId; } -wstring CMinecraftApp::getSkinPathFromId(DWORD skinId) +wstring CMinecraftApp::getSkinPathFromId(unsigned long skinId) { - // 4J Stu - This function maps the encoded DWORD we store in the player profile + // 4J Stu - This function maps the encoded unsigned long we store in the player profile // to a filename that is stored as a memory texture and shared between systems in game wchar_t chars[256]; if( GET_IS_DLC_SKIN_FROM_BITMASK(skinId) ) @@ -8805,8 +8805,8 @@ wstring CMinecraftApp::getSkinPathFromId(DWORD skinId) } else { - DWORD ugcSkinIndex = GET_UGC_SKIN_ID_FROM_BITMASK(skinId); - DWORD defaultSkinIndex = GET_DEFAULT_SKIN_ID_FROM_BITMASK(skinId); + unsigned long ugcSkinIndex = GET_UGC_SKIN_ID_FROM_BITMASK(skinId); + unsigned long defaultSkinIndex = GET_DEFAULT_SKIN_ID_FROM_BITMASK(skinId); if( ugcSkinIndex == 0 ) { swprintf(chars, 256, L"defskin%08X.png",defaultSkinIndex); @@ -8830,8 +8830,8 @@ int CMinecraftApp::TexturePackDialogReturned(void *pParam,int iPad,C4JStorage::E // we need to enable background downloading for the DLC XBackgroundDownloadSetMode(XBACKGROUND_DOWNLOAD_MODE_ALWAYS_ALLOW); - ULONGLONG ullOfferID_Full; - ULONGLONG ullIndexA[1]; + uint64_t ullOfferID_Full; + uint64_t ullIndexA[1]; app.GetDLCFullOfferIDForPackID(app.GetRequiredTexturePackID(),&ullOfferID_Full); if( result==C4JStorage::EMessage_ResultAccept ) // Full version @@ -8950,7 +8950,7 @@ float CMinecraftApp::getTrialTimer(void) bool CMinecraftApp::IsLocalMultiplayerAvailable() { - DWORD connectedControllers = 0; + unsigned long connectedControllers = 0; for(unsigned int i = 0; i < XUSER_MAX_COUNT; ++i) { if( InputManager.IsPadConnected(i) || ProfileManager.IsSignedIn(i) ) ++connectedControllers; @@ -8990,7 +8990,7 @@ void CMinecraftApp::getLocale(vector &vecWstrLocales) { vector locales; - DWORD dwSystemLanguage = XGetLanguage( ); + unsigned long dwSystemLanguage = XGetLanguage( ); // 4J-PB - restrict the 360 language until we're ready to have them in @@ -9220,13 +9220,13 @@ void CMinecraftApp::getLocale(vector &vecWstrLocales) } } -DWORD CMinecraftApp::get_eMCLang(WCHAR *pwchLocale) +unsigned long CMinecraftApp::get_eMCLang(wchar_t *pwchLocale) { return m_eMCLangA[pwchLocale]; } -DWORD CMinecraftApp::get_xcLang(WCHAR *pwchLocale) +unsigned long CMinecraftApp::get_xcLang(wchar_t *pwchLocale) { return m_xcLangA[pwchLocale]; } @@ -9432,7 +9432,7 @@ void CMinecraftApp::SetTickTMSDLCFiles(bool bVal) m_bTickTMSDLCFiles=bVal; } -wstring CMinecraftApp::getFilePath(DWORD packId, wstring filename, bool bAddDataFolder) +wstring CMinecraftApp::getFilePath(unsigned long packId, wstring filename, bool bAddDataFolder) { #ifdef _XBOX wstring path = getRootPath(packId, true, bAddDataFolder) + filename; @@ -9468,7 +9468,7 @@ wstring titleUpdateTexturePackRoot = L"GAME:\\res\\TitleUpdate\\DLC\\"; #endif #endif -wstring CMinecraftApp::getRootPath(DWORD packId, bool allowOverride, bool bAddDataFolder) +wstring CMinecraftApp::getRootPath(unsigned long packId, bool allowOverride, bool bAddDataFolder) { wstring path = L"TPACK:"; #ifdef _XBOX diff --git a/src/client/Common/Consoles_App.h b/src/client/Common/Consoles_App.h index 7d76b27e..aea1eb75 100644 --- a/src/client/Common/Consoles_App.h +++ b/src/client/Common/Consoles_App.h @@ -25,8 +25,8 @@ using namespace std; typedef struct _JoinFromInviteData { - DWORD dwUserIndex; // dwUserIndex - DWORD dwLocalUsersMask; // dwUserMask + unsigned long dwUserIndex; // dwUserIndex + unsigned long dwLocalUsersMask; // dwUserMask const INVITE_INFO *pInviteInfo; // pInviteInfo } JoinFromInviteData; @@ -121,7 +121,7 @@ public: bool IsAppPaused(); void SetAppPaused(bool val); - static int DisplaySavingMessage(LPVOID pParam,const C4JStorage::ESavingMessage eMsg, int iPad); + static int DisplaySavingMessage(void* pParam,const C4JStorage::ESavingMessage eMsg, int iPad); bool GetGameStarted() {return m_bGameStarted;} void SetGameStarted(bool bVal) { if(bVal) DebugPrintf("SetGameStarted - true\n"); else DebugPrintf("SetGameStarted - false\n"); m_bGameStarted = bVal; m_bIsAppPaused = !bVal;} int GetLocalPlayerCount(void); @@ -143,7 +143,7 @@ public: void SetSpecialTutorialCompletionFlag(int iPad, int index); - static LPCWSTR GetString(int iID); + static const wchar_t* GetString(int iID); eGameMode GetGameMode() { return m_eGameMode;} void SetGameMode(eGameMode eMode) { m_eGameMode=eMode;} @@ -151,12 +151,12 @@ public: eXuiAction GetGlobalXuiAction() {return m_eGlobalXuiAction;} void SetGlobalXuiAction(eXuiAction action) {m_eGlobalXuiAction=action;} eXuiAction GetXuiAction(int iPad) {return m_eXuiAction[iPad];} - void SetAction(int iPad, eXuiAction action, LPVOID param = NULL); + void SetAction(int iPad, eXuiAction action, void* param = NULL); void SetTMSAction(int iPad, eTMSAction action) {m_eTMSAction[iPad]=action; } eTMSAction GetTMSAction(int iPad) {return m_eTMSAction[iPad];} eXuiServerAction GetXuiServerAction(int iPad) {return m_eXuiServerAction[iPad];} - LPVOID GetXuiServerActionParam(int iPad) {return m_eXuiServerActionParam[iPad];} - void SetXuiServerAction(int iPad, eXuiServerAction action, LPVOID param = NULL) {m_eXuiServerAction[iPad]=action; m_eXuiServerActionParam[iPad] = param;} + void* GetXuiServerActionParam(int iPad) {return m_eXuiServerActionParam[iPad];} + void SetXuiServerAction(int iPad, eXuiServerAction action, void* param = NULL) {m_eXuiServerAction[iPad]=action; m_eXuiServerActionParam[iPad] = param;} eXuiServerAction GetGlobalXuiServerAction() {return m_eGlobalXuiServerAction;} void SetGlobalXuiServerAction(eXuiServerAction action) {m_eGlobalXuiServerAction=action;} @@ -171,7 +171,7 @@ public: // 4J Stu - Added so that we can call this when a confirmation box is selected - static void SetActionConfirmed(LPVOID param); + static void SetActionConfirmed(void* param); void HandleXuiActions(void); // 4J Stu - Functions used for Minecon and other promo work @@ -192,7 +192,7 @@ public: void SetFreezePlayers(bool bVal) { m_bFreezePlayers = bVal; } // debug -0 show safe area - void ShowSafeArea(BOOL bShow) + void ShowSafeArea(bool bShow) { #ifdef _XBOX CXuiSceneBase::ShowSafeArea( bShow ); @@ -203,23 +203,23 @@ public: //void GetPreviewImage(int iPad,XSOCIAL_PREVIEWIMAGE *preview); void InitGameSettings(); - static int OldProfileVersionCallback(LPVOID pParam,unsigned char *pucData, const unsigned short usVersion, const int iPad); + static int OldProfileVersionCallback(void* pParam,unsigned char *pucData, const unsigned short usVersion, const int iPad); #if ( defined __PS3__ || defined __ORBIS__ || defined _DURANGO || defined __PSVITA__ ) - static int DefaultOptionsCallback(LPVOID pParam,C4JStorage::PROFILESETTINGS *pSettings, const int iPad); + static int DefaultOptionsCallback(void* pParam,C4JStorage::PROFILESETTINGS *pSettings, const int iPad); int SetDefaultOptions(C4JStorage::PROFILESETTINGS *pSettings,const int iPad,bool bWriteProfile=true); #ifdef __ORBIS__ - static int OptionsDataCallback(LPVOID pParam,int iPad,unsigned short usVersion,C4JStorage::eOptionsCallback eStatus,int iBlocksRequired); + static int OptionsDataCallback(void* pParam,int iPad,unsigned short usVersion,C4JStorage::eOptionsCallback eStatus,int iBlocksRequired); int GetOptionsBlocksRequired(int iPad); #else - static int OptionsDataCallback(LPVOID pParam,int iPad,unsigned short usVersion,C4JStorage::eOptionsCallback eStatus); + static int OptionsDataCallback(void* pParam,int iPad,unsigned short usVersion,C4JStorage::eOptionsCallback eStatus); #endif C4JStorage::eOptionsCallback GetOptionsCallbackStatus(int iPad); void SetOptionsCallbackStatus(int iPad, C4JStorage::eOptionsCallback eStatus); #else - static int DefaultOptionsCallback(LPVOID pParam,C_4JProfile::PROFILESETTINGS *pSettings, const int iPad); + static int DefaultOptionsCallback(void* pParam,C_4JProfile::PROFILESETTINGS *pSettings, const int iPad); int SetDefaultOptions(C_4JProfile::PROFILESETTINGS *pSettings,const int iPad); #endif virtual void SetRichPresenceContext(int iPad, int contextId) = 0; @@ -229,9 +229,9 @@ public: unsigned char GetGameSettings(int iPad,eGameSetting eVal); unsigned char GetGameSettings(eGameSetting eVal); // for the primary pad void SetPlayerSkin(int iPad,const wstring &name); - void SetPlayerSkin(int iPad,DWORD dwSkinId); + void SetPlayerSkin(int iPad,unsigned long dwSkinId); void SetPlayerCape(int iPad,const wstring &name); - void SetPlayerCape(int iPad,DWORD dwCapeId); + void SetPlayerCape(int iPad,unsigned long dwCapeId); void SetPlayerFavoriteSkin(int iPad, int iIndex,unsigned int uiSkinID); unsigned int GetPlayerFavoriteSkin(int iPad,int iIndex); unsigned char GetPlayerFavoriteSkinsPos(int iPad); @@ -256,10 +256,10 @@ public: public: wstring GetPlayerSkinName(int iPad); - DWORD GetPlayerSkinId(int iPad); + unsigned long GetPlayerSkinId(int iPad); wstring GetPlayerCapeName(int iPad); - DWORD GetPlayerCapeId(int iPad); - DWORD GetAdditionalModelParts(int iPad); + unsigned long GetPlayerCapeId(int iPad); + unsigned long GetAdditionalModelParts(int iPad); void CheckGameSettingsChanged(bool bOverride5MinuteTimer=false, int iPad=XUSER_INDEX_ANY); void ApplyGameSettingsChanged(int iPad); void ClearGameSettingsChangedFlag(int iPad); @@ -272,7 +272,7 @@ public: bool IsLocalMultiplayerAvailable(); // for sign in change monitoring - static void SignInChangeCallback(LPVOID pParam, bool bVal, unsigned int uiSignInData); + static void SignInChangeCallback(void* pParam, bool bVal, unsigned int uiSignInData); static void ClearSignInChangeUsersMask(); static int SignoutExitWorldThreadProc( void* lpParameter ); static int PrimaryPlayerSignedOutReturned(void *pParam, int iPad, const C4JStorage::EMessageResult); @@ -283,14 +283,14 @@ public: virtual void FatalLoadError(); // Notifications from the game listener to be passed to the qnet listener - static void NotificationsCallback(LPVOID pParam,DWORD dwNotification, unsigned int uiParam); + static void NotificationsCallback(void* pParam,unsigned long dwNotification, unsigned int uiParam); // for the ethernet being disconnected - static void LiveLinkChangeCallback(LPVOID pParam,BOOL bConnected); + static void LiveLinkChangeCallback(void* pParam,bool bConnected); bool GetLiveLinkRequired() {return m_bLiveLinkRequired;} void SetLiveLinkRequired(bool required) {m_bLiveLinkRequired=required;} - static void UpsellReturnedCallback(LPVOID pParam, eUpsellType type, eUpsellResponse result, int iUserData); + static void UpsellReturnedCallback(void* pParam, eUpsellType type, eUpsellResponse result, int iUserData); #if defined __PS3__ || defined __PSVITA__ || defined __ORBIS__ static int NowDisplayFullVersionPurchase(void *pParam, bool bContinue, int iPad); @@ -306,21 +306,21 @@ public: bool DebugSettingsOn() { return false;} #endif void SetDebugSequence(const char *pchSeq); - static int DebugInputCallback(LPVOID pParam); + static int DebugInputCallback(void* pParam); //bool UploadFileToGlobalStorage(int iQuadrant, C4JStorage::eGlobalStorage eStorageFacility, wstring *wsFile ); // Installed DLC bool StartInstallDLCProcess(int iPad); - static int DLCInstalledCallback(LPVOID pParam,int iOfferC,int iPad); + static int DLCInstalledCallback(void* pParam,int iOfferC,int iPad); void HandleDLCLicenseChange(); - static int DLCMountedCallback(LPVOID pParam,int iPad,DWORD dwErr,DWORD dwLicenceMask); + static int DLCMountedCallback(void* pParam,int iPad,unsigned long dwErr,unsigned long dwLicenceMask); void MountNextDLC(int iPad); - //static int DLCReadCallback(LPVOID pParam,C4JStorage::DLC_FILE_DETAILS *pDLCData); + //static int DLCReadCallback(void* pParam,C4JStorage::DLC_FILE_DETAILS *pDLCData); void HandleDLC(DLCPack *pack); bool DLCInstallPending() {return m_bDLCInstallPending;} bool DLCInstallProcessCompleted() {return m_bDLCInstallProcessCompleted;} void ClearDLCInstalled() { m_bDLCInstallProcessCompleted=false;} - static int MarketplaceCountsCallback(LPVOID pParam,C4JStorage::DLC_TMS_DETAILS *,int iPad); + static int MarketplaceCountsCallback(void* pParam,C4JStorage::DLC_TMS_DETAILS *,int iPad); bool AlreadySeenCreditText(const wstring &wstemp); @@ -336,19 +336,19 @@ public: bool isXuidNotch(PlayerUID xuid); bool isXuidDeadmau5(PlayerUID xuid); - void AddMemoryTextureFile(const wstring &wName, PBYTE pbData, DWORD dwBytes); + void AddMemoryTextureFile(const wstring &wName, uint8_t* pbData, unsigned long dwBytes); void RemoveMemoryTextureFile(const wstring &wName); - void GetMemFileDetails(const wstring &wName,PBYTE *ppbData,DWORD *pdwBytes); + void GetMemFileDetails(const wstring &wName,uint8_t* *ppbData,unsigned long *pdwBytes); bool IsFileInMemoryTextures(const wstring &wName); // Texture Pack Data files (icon, banner, comparison shot & text) - void AddMemoryTPDFile(int iConfig,PBYTE pbData,DWORD dwBytes); + void AddMemoryTPDFile(int iConfig,uint8_t* pbData,unsigned long dwBytes); void RemoveMemoryTPDFile(int iConfig); bool IsFileInTPD(int iConfig); - void GetTPD(int iConfig,PBYTE *ppbData,DWORD *pdwBytes); + void GetTPD(int iConfig,uint8_t* *ppbData,unsigned long *pdwBytes); int GetTPDSize() {return m_MEM_TPD.size();} #ifndef __PS3__ - int GetTPConfigVal(WCHAR *pwchDataFile); + int GetTPConfigVal(wchar_t *pwchDataFile); #endif bool DefaultCapeExists(); @@ -356,17 +356,17 @@ public: // invites //void ProcessInvite(JoinFromInviteData *pJoinData); - void ProcessInvite(DWORD dwUserIndex, DWORD dwLocalUsersMask, const INVITE_INFO * pInviteInfo); + void ProcessInvite(unsigned long dwUserIndex, unsigned long dwLocalUsersMask, const INVITE_INFO * pInviteInfo); // Add credits for DLC installed - void AddCreditText(LPCWSTR lpStr); + void AddCreditText(const wchar_t* lpStr); private: PlayerUID m_xuidNotch; #ifdef _DURANGO - unordered_map m_GTS_Files; + unordered_map m_GTS_Files; #else - unordered_map m_GTS_Files; + unordered_map m_GTS_Files; #endif // for storing memory textures - player skin @@ -380,8 +380,8 @@ private: public: // launch data - BYTE* m_pLaunchData; - DWORD m_dwLaunchDataSize; + uint8_t* m_pLaunchData; + unsigned long m_dwLaunchDataSize; public: // BAN LIST @@ -480,7 +480,7 @@ public: - static const DWORD m_dwOfferID = 0x00000001; + static const unsigned long m_dwOfferID = 0x00000001; // timer void InitTime(); @@ -500,10 +500,10 @@ private: // we'll action these at the end of the game loop eXuiAction m_eXuiAction[XUSER_MAX_COUNT]; eTMSAction m_eTMSAction[XUSER_MAX_COUNT]; - LPVOID m_eXuiActionParam[XUSER_MAX_COUNT]; + void* m_eXuiActionParam[XUSER_MAX_COUNT]; eXuiAction m_eGlobalXuiAction; eXuiServerAction m_eXuiServerAction[XUSER_MAX_COUNT]; - LPVOID m_eXuiServerActionParam[XUSER_MAX_COUNT]; + void* m_eXuiServerActionParam[XUSER_MAX_COUNT]; eXuiServerAction m_eGlobalXuiServerAction; bool m_bLiveLinkRequired; @@ -544,7 +544,7 @@ protected: static Random *TipRandom; public: void InitialiseTips(); - UINT GetNextTip(); + unsigned int GetNextTip(); int GetHTMLColour(eMinecraftColour colour); int GetHTMLColor(eMinecraftColour colour) { return GetHTMLColour(colour); } int GetHTMLFontSize(EHTMLFontSize size); @@ -557,11 +557,11 @@ public: void UpdateTrialPausedTimer() { mfTrialPausedTime+= m_Time.fElapsedTime;} static int RemoteSaveThreadProc( void* lpParameter ); - static void ExitGameFromRemoteSave( LPVOID lpParameter ); + static void ExitGameFromRemoteSave( void* lpParameter ); static int ExitGameFromRemoteSaveDialogReturned(void *pParam,int iPad,C4JStorage::EMessageResult result); private: - UINT m_TipIDA[MAX_TIPS_GAMETIP+MAX_TIPS_TRIVIATIP]; - UINT m_uiCurrentTip; + unsigned int m_TipIDA[MAX_TIPS_GAMETIP+MAX_TIPS_TRIVIATIP]; + unsigned int m_uiCurrentTip; static int TipsSortFunction(const void* a, const void* b); // XML @@ -574,26 +574,26 @@ public: bool GetTerrainFeaturePosition(_eTerrainFeatureType eType, int *pX, int *pZ); std::vector m_vTerrainFeatures; - static HRESULT RegisterMojangData(WCHAR *, PlayerUID, WCHAR *, WCHAR *); + static int RegisterMojangData(wchar_t *, PlayerUID, wchar_t *, wchar_t *); MOJANG_DATA *GetMojangDataForXuid(PlayerUID xuid); - static HRESULT RegisterConfigValues(WCHAR *pType, int iValue); + static int RegisterConfigValues(wchar_t *pType, int iValue); #if defined(__PS3__) || defined(__ORBIS__) || defined(__PSVITA__) - HRESULT RegisterDLCData(char *pchDLCName, unsigned int uiSortIndex, char *pchImageURL); - bool GetDLCFullOfferIDForSkinID(const wstring &FirstSkin,ULONGLONG *pullVal); - DLC_INFO *GetDLCInfoForTrialOfferID(ULONGLONG ullOfferID_Trial); - DLC_INFO *GetDLCInfoForFullOfferID(ULONGLONG ullOfferID_Full); + int RegisterDLCData(char *pchDLCName, unsigned int uiSortIndex, char *pchImageURL); + bool GetDLCFullOfferIDForSkinID(const wstring &FirstSkin,uint64_t *pullVal); + DLC_INFO *GetDLCInfoForTrialOfferID(uint64_t ullOfferID_Trial); + DLC_INFO *GetDLCInfoForFullOfferID(uint64_t ullOfferID_Full); #elif defined(_XBOX_ONE) - static HRESULT RegisterDLCData(eDLCContentType, WCHAR *, WCHAR *, WCHAR *, WCHAR *, int, unsigned int); - //bool GetDLCFullOfferIDForSkinID(const wstring &FirstSkin,WCHAR *pwchProductId); + static int RegisterDLCData(eDLCContentType, wchar_t *, wchar_t *, wchar_t *, wchar_t *, int, unsigned int); + //bool GetDLCFullOfferIDForSkinID(const wstring &FirstSkin,wchar_t *pwchProductId); bool GetDLCFullOfferIDForSkinID(const wstring &FirstSkin,wstring &wsProductId); - DLC_INFO *GetDLCInfoForFullOfferID(WCHAR *pwchProductId); - DLC_INFO *GetDLCInfoForProductName(WCHAR *pwchProductName); + DLC_INFO *GetDLCInfoForFullOfferID(wchar_t *pwchProductId); + DLC_INFO *GetDLCInfoForProductName(wchar_t *pwchProductName); #else - static HRESULT RegisterDLCData(WCHAR *, WCHAR *, int, __uint64, __uint64, WCHAR *, unsigned int, int, WCHAR *pDataFile); - bool GetDLCFullOfferIDForSkinID(const wstring &FirstSkin,ULONGLONG *pullVal); - DLC_INFO *GetDLCInfoForTrialOfferID(ULONGLONG ullOfferID_Trial); - DLC_INFO *GetDLCInfoForFullOfferID(ULONGLONG ullOfferID_Full); + static int RegisterDLCData(wchar_t *, wchar_t *, int, uint64_t, uint64_t, wchar_t *, unsigned int, int, wchar_t *pDataFile); + bool GetDLCFullOfferIDForSkinID(const wstring &FirstSkin,uint64_t *pullVal); + DLC_INFO *GetDLCInfoForTrialOfferID(uint64_t ullOfferID_Trial); + DLC_INFO *GetDLCInfoForFullOfferID(uint64_t ullOfferID_Full); #endif unsigned int GetDLCCreditsCount(); @@ -605,9 +605,9 @@ public: // images for save thumbnail/social post virtual void CaptureSaveThumbnail() =0; - virtual void GetSaveThumbnail(PBYTE*,DWORD*)=0; + virtual void GetSaveThumbnail(uint8_t**,unsigned long*)=0; virtual void ReleaseSaveThumbnail()=0; - virtual void GetScreenshot(int iPad,PBYTE *pbData,DWORD *pdwSize)=0; + virtual void GetScreenshot(int iPad,uint8_t* *pbData,unsigned long *pdwSize)=0; virtual void ReadBannedList(int iPad, eTMSAction action=(eTMSAction)0, bool bCallback=false)=0; @@ -619,7 +619,7 @@ private: static unordered_map MojangData; static unordered_map DLCTextures_PackID; // for mash-up packs & texture packs static unordered_map DLCInfo; - static unordered_map DLCInfo_SkinName; // skin name, full offer id + static unordered_map DLCInfo_SkinName; // skin name, full offer id #elif defined(_DURANGO) static unordered_map MojangData; static unordered_map DLCTextures_PackID; // for mash-up packs & texture packs @@ -628,10 +628,10 @@ private: static unordered_map DLCInfo_SkinName; // skin name, full offer id #else static unordered_map MojangData; - static unordered_map DLCTextures_PackID; // for mash-up packs & texture packs - static unordered_map DLCInfo_Trial; // full offerid, dlc_info - static unordered_map DLCInfo_Full; // full offerid, dlc_info - static unordered_map DLCInfo_SkinName; // skin name, full offer id + static unordered_map DLCTextures_PackID; // for mash-up packs & texture packs + static unordered_map DLCInfo_Trial; // full offerid, dlc_info + static unordered_map DLCInfo_Full; // full offerid, dlc_info + static unordered_map DLCInfo_SkinName; // skin name, full offer id #endif // bool m_bRead_TMS_XUIDS_XML; // track whether we have already read the TMS xuids.xml file // bool m_bRead_TMS_DLCINFO_XML; // track whether we have already read the TMS DLC.xml file @@ -700,8 +700,8 @@ public: bool CanRecordStatsAndAchievements(); // World seed from png image - void GetImageTextData(PBYTE pbImageData, DWORD dwImageBytes,unsigned char *pszSeed,unsigned int &uiHostOptions,bool &bHostOptionsRead,DWORD &uiTexturePack); - unsigned int CreateImageTextData(PBYTE bTextMetadata, __int64 seed, bool hasSeed, unsigned int uiHostOptions, unsigned int uiTexturePackId); + void GetImageTextData(uint8_t* pbImageData, unsigned long dwImageBytes,unsigned char *pszSeed,unsigned int &uiHostOptions,bool &bHostOptionsRead,unsigned long &uiTexturePack); + unsigned int CreateImageTextData(uint8_t* bTextMetadata, int64_t seed, bool hasSeed, unsigned int uiHostOptions, unsigned int uiTexturePackId); // Game rules GameRuleManager m_gameRules; @@ -714,16 +714,16 @@ public: void setLevelGenerationOptions(LevelGenerationOptions *levelGen); LevelRuleset *getGameRuleDefinitions() { return m_gameRules.getGameRuleDefinitions(); } LevelGenerationOptions *getLevelGenerationOptions() { return m_gameRules.getLevelGenerationOptions(); } - LPCWSTR GetGameRulesString(const wstring &key); + const wchar_t* GetGameRulesString(const wstring &key); private: - BYTE m_playerColours[MINECRAFT_NET_MAX_PLAYERS]; // An array of QNet small-id's + uint8_t m_playerColours[MINECRAFT_NET_MAX_PLAYERS]; // An array of QNet small-id's unsigned int m_playerGamePrivileges[MINECRAFT_NET_MAX_PLAYERS]; public: - void UpdatePlayerInfo(BYTE networkSmallId, SHORT playerColourIndex, unsigned int playerGamePrivileges); - short GetPlayerColour(BYTE networkSmallId); - unsigned int GetPlayerPrivileges(BYTE networkSmallId); + void UpdatePlayerInfo(uint8_t networkSmallId, int16_t playerColourIndex, unsigned int playerGamePrivileges); + short GetPlayerColour(uint8_t networkSmallId); + unsigned int GetPlayerPrivileges(uint8_t networkSmallId); wstring getEntityName(eINSTANCEOF type); @@ -732,9 +732,9 @@ public: unsigned int AddDLCRequest(eDLCMarketplaceType eContentType, bool bPromote=false); bool RetrieveNextDLCContent(); bool CheckTMSDLCCanStop(); - static int DLCOffersReturned(void *pParam, int iOfferC, DWORD dwType, int iPad); - DWORD GetDLCContentType(eDLCContentType eType) { return m_dwContentTypeA[eType];} - eDLCContentType Find_eDLCContentType(DWORD dwType); + static int DLCOffersReturned(void *pParam, int iOfferC, unsigned long dwType, int iPad); + unsigned long GetDLCContentType(eDLCContentType eType) { return m_dwContentTypeA[eType];} + eDLCContentType Find_eDLCContentType(unsigned long dwType); int GetDLCOffersCount() { return m_iDLCOfferC;} bool DLCContentRetrieved(eDLCMarketplaceType eType); void TickDLCOffersRetrieved(); @@ -754,10 +754,10 @@ public: #else #ifdef _XBOX_ONE - static int TMSPPFileReturned(LPVOID pParam,int iPad,int iUserData,LPVOID, WCHAR *wchFilename); + static int TMSPPFileReturned(void* pParam,int iPad,int iUserData,void*, wchar_t *wchFilename); unordered_map *GetDLCInfo(); #else - static int TMSPPFileReturned(LPVOID pParam,int iPad,int iUserData,C4JStorage::PTMSPP_FILEDATA pFileData, LPCSTR szFilename); + static int TMSPPFileReturned(void* pParam,int iPad,int iUserData,C4JStorage::PTMSPP_FILEDATA pFileData, const char* szFilename); #endif DLC_INFO *GetDLCInfoTrialOffer(int iIndex); DLC_INFO *GetDLCInfoFullOffer(int iIndex); @@ -769,8 +769,8 @@ public: wstring GetDLCInfoTexturesFullOffer(int iIndex); #else - bool GetDLCFullOfferIDForPackID(const int iPackID,ULONGLONG *pullVal); - ULONGLONG GetDLCInfoTexturesFullOffer(int iIndex); + bool GetDLCFullOfferIDForPackID(const int iPackID,uint64_t *pullVal); + uint64_t GetDLCInfoTexturesFullOffer(int iIndex); #endif #endif @@ -787,7 +787,7 @@ private: //Request current_download; vector m_DLCDownloadQueue; vector m_TMSPPDownloadQueue; - static DWORD m_dwContentTypeA[e_Marketplace_MAX]; + static unsigned long m_dwContentTypeA[e_Marketplace_MAX]; int m_iDLCOfferC; bool m_bAllDLCContentRetrieved; bool m_bAllTMSContentRetrieved; @@ -799,34 +799,34 @@ private: CRITICAL_SECTION csAnimOverrideBitmask; bool m_bCorruptSaveDeleted; - DWORD m_dwAdditionalModelParts[XUSER_MAX_COUNT]; + unsigned long m_dwAdditionalModelParts[XUSER_MAX_COUNT]; - BYTE *m_pBannedListFileBuffer; - DWORD m_dwBannedListFileSize; + uint8_t *m_pBannedListFileBuffer; + unsigned long m_dwBannedListFileSize; public: - DWORD m_dwDLCFileSize; - BYTE *m_pDLCFileBuffer; + unsigned long m_dwDLCFileSize; + uint8_t *m_pDLCFileBuffer; -// static int CallbackReadXuidsFileFromTMS(LPVOID lpParam, WCHAR *wchFilename, int iPad, bool bResult, int iAction); -// static int CallbackDLCFileFromTMS(LPVOID lpParam, WCHAR *wchFilename, int iPad, bool bResult, int iAction); -// static int CallbackBannedListFileFromTMS(LPVOID lpParam, WCHAR *wchFilename, int iPad, bool bResult, int iAction); +// static int CallbackReadXuidsFileFromTMS(void* lpParam, wchar_t *wchFilename, int iPad, bool bResult, int iAction); +// static int CallbackDLCFileFromTMS(void* lpParam, wchar_t *wchFilename, int iPad, bool bResult, int iAction); +// static int CallbackBannedListFileFromTMS(void* lpParam, wchar_t *wchFilename, int iPad, bool bResult, int iAction); // Storing additional model parts per skin texture - void SetAdditionalSkinBoxes(DWORD dwSkinID, SKIN_BOX *SkinBoxA, DWORD dwSkinBoxC); - vector * SetAdditionalSkinBoxes(DWORD dwSkinID, vector *pvSkinBoxA); - vector *GetAdditionalModelParts(DWORD dwSkinID); - vector *GetAdditionalSkinBoxes(DWORD dwSkinID); - void SetAnimOverrideBitmask(DWORD dwSkinID,unsigned int uiAnimOverrideBitmask); - unsigned int GetAnimOverrideBitmask(DWORD dwSkinID); + void SetAdditionalSkinBoxes(unsigned long dwSkinID, SKIN_BOX *SkinBoxA, unsigned long dwSkinBoxC); + vector * SetAdditionalSkinBoxes(unsigned long dwSkinID, vector *pvSkinBoxA); + vector *GetAdditionalModelParts(unsigned long dwSkinID); + vector *GetAdditionalSkinBoxes(unsigned long dwSkinID); + void SetAnimOverrideBitmask(unsigned long dwSkinID,unsigned int uiAnimOverrideBitmask); + unsigned int GetAnimOverrideBitmask(unsigned long dwSkinID); - static DWORD getSkinIdFromPath(const wstring &skin); - static wstring getSkinPathFromId(DWORD skinId); + static unsigned long getSkinIdFromPath(const wstring &skin); + static wstring getSkinPathFromId(unsigned long skinId); - virtual int LoadLocalTMSFile(WCHAR *wchTMSFile)=0; - virtual int LoadLocalTMSFile(WCHAR *wchTMSFile, eFileExtensionType eExt)=0; + virtual int LoadLocalTMSFile(wchar_t *wchTMSFile)=0; + virtual int LoadLocalTMSFile(wchar_t *wchTMSFile, eFileExtensionType eExt)=0; virtual void FreeLocalTMSFiles(eTMSFileType eType)=0; - virtual int GetLocalTMSFileIndex(WCHAR *wchTMSFile,bool bFilenameIncludesExtension,eFileExtensionType eEXT)=0; + virtual int GetLocalTMSFileIndex(wchar_t *wchTMSFile,bool bFilenameIncludesExtension,eFileExtensionType eEXT)=0; virtual bool GetTMSGlobalFileListRead() { return true;} virtual bool GetTMSDLCInfoRead() { return true;} @@ -836,24 +836,24 @@ public: void SetBanListRead(int iPad,bool bVal) { m_bRead_BannedListA[iPad]=bVal;} void ClearBanList(int iPad) { BannedListA[iPad].pBannedList=NULL;BannedListA[iPad].dwBytes=0;} - DWORD GetRequiredTexturePackID() {return m_dwRequiredTexturePackID;} - void SetRequiredTexturePackID(DWORD dwID) {m_dwRequiredTexturePackID=dwID;} + unsigned long GetRequiredTexturePackID() {return m_dwRequiredTexturePackID;} + void SetRequiredTexturePackID(unsigned long dwID) {m_dwRequiredTexturePackID=dwID;} - virtual void GetFileFromTPD(eTPDFileType eType,PBYTE pbData,DWORD dwBytes,PBYTE *ppbData,DWORD *pdwBytes ) {*ppbData = NULL; *pdwBytes = 0;} + virtual void GetFileFromTPD(eTPDFileType eType,uint8_t* pbData,unsigned long dwBytes,uint8_t* *ppbData,unsigned long *pdwBytes ) {*ppbData = NULL; *pdwBytes = 0;} //XTITLE_DEPLOYMENT_TYPE getDeploymentType() { return m_titleDeploymentType; } private: // vector of additional skin model parts, indexed by the skin texture id - unordered_map *> m_AdditionalModelParts; - unordered_map *> m_AdditionalSkinBoxes; - unordered_map m_AnimOverrides; + unordered_map *> m_AdditionalModelParts; + unordered_map *> m_AdditionalSkinBoxes; + unordered_map m_AnimOverrides; bool m_bResetNether; - DWORD m_dwRequiredTexturePackID; + unsigned long m_dwRequiredTexturePackID; #ifdef _XBOX_ONE - vector m_vTMSPPData; + vector m_vTMSPPData; #endif #if ( defined __PS3__ || defined __ORBIS__ || defined _DURANGO || defined __PSVITA__) @@ -870,18 +870,18 @@ public: void LocaleAndLanguageInit(); void getLocale(vector &vecWstrLocales); - DWORD get_eMCLang(WCHAR *pwchLocale); - DWORD get_xcLang(WCHAR *pwchLocale); + unsigned long get_eMCLang(wchar_t *pwchLocale); + unsigned long get_xcLang(wchar_t *pwchLocale); void SetTickTMSDLCFiles(bool bVal); - wstring getFilePath(DWORD packId, wstring filename, bool bAddDataFolder); + wstring getFilePath(unsigned long packId, wstring filename, bool bAddDataFolder); private: unordered_mapm_localeA; unordered_mapm_eMCLangA; unordered_mapm_xcLangA; - wstring getRootPath(DWORD packId, bool allowOverride, bool bAddDataFolder); + wstring getRootPath(unsigned long packId, bool allowOverride, bool bAddDataFolder); public: #ifdef _XBOX @@ -908,4 +908,4 @@ private: }; //singleton -//extern CMinecraftApp app; +extern CMinecraftApp app; diff --git a/src/client/Common/DLC/DLCAudioFile.cpp b/src/client/Common/DLC/DLCAudioFile.cpp index f3a8c18b..3be72f56 100644 --- a/src/client/Common/DLC/DLCAudioFile.cpp +++ b/src/client/Common/DLC/DLCAudioFile.cpp @@ -12,7 +12,7 @@ DLCAudioFile::DLCAudioFile(const wstring &path) : DLCFile(DLCManager::e_DLCType_ m_dwBytes = 0; } -void DLCAudioFile::addData(PBYTE pbData, DWORD dwBytes) +void DLCAudioFile::addData(uint8_t* pbData, unsigned long dwBytes) { m_pbData = pbData; m_dwBytes = dwBytes; @@ -20,13 +20,13 @@ void DLCAudioFile::addData(PBYTE pbData, DWORD dwBytes) processDLCDataFile(pbData,dwBytes); } -PBYTE DLCAudioFile::getData(DWORD &dwBytes) +uint8_t* DLCAudioFile::getData(unsigned long &dwBytes) { dwBytes = m_dwBytes; return m_pbData; } -WCHAR *DLCAudioFile::wchTypeNamesA[]= +wchar_t *DLCAudioFile::wchTypeNamesA[]= { L"CUENAME", L"CREDIT", @@ -36,7 +36,7 @@ DLCAudioFile::EAudioParameterType DLCAudioFile::getParameterType(const wstring & { EAudioParameterType type = e_AudioParamType_Invalid; - for(DWORD i = 0; i < e_AudioParamType_Max; ++i) + for(unsigned long i = 0; i < e_AudioParamType_Max; ++i) { if(paramName.compare(wchTypeNamesA[i]) == 0) { @@ -120,7 +120,7 @@ void DLCAudioFile::addParameter(EAudioType type, EAudioParameterType ptype, cons } } -bool DLCAudioFile::processDLCDataFile(PBYTE pbData, DWORD dwLength) +bool DLCAudioFile::processDLCDataFile(uint8_t* pbData, unsigned long dwLength) { unordered_map parameterMapping; unsigned int uiCurrentByte=0; @@ -145,26 +145,26 @@ bool DLCAudioFile::processDLCDataFile(PBYTE pbData, DWORD dwLength) for(unsigned int i=0;iwchData); + wstring parameterName((wchar_t *)pParams->wchData); EAudioParameterType type = getParameterType(parameterName); if( type != e_AudioParamType_Invalid ) { parameterMapping[pParams->dwType] = type; } - uiCurrentByte+= sizeof(C4JStorage::DLC_FILE_PARAM)+(pParams->dwWchCount*sizeof(WCHAR)); + uiCurrentByte+= sizeof(C4JStorage::DLC_FILE_PARAM)+(pParams->dwWchCount*sizeof(wchar_t)); pParams = (C4JStorage::DLC_FILE_PARAM *)&pbData[uiCurrentByte]; } unsigned int uiFileCount=*(unsigned int *)&pbData[uiCurrentByte]; uiCurrentByte+=sizeof(int); C4JStorage::DLC_FILE_DETAILS *pFile = (C4JStorage::DLC_FILE_DETAILS *)&pbData[uiCurrentByte]; - DWORD dwTemp=uiCurrentByte; + unsigned long dwTemp=uiCurrentByte; for(unsigned int i=0;idwWchCount*sizeof(WCHAR); + dwTemp+=sizeof(C4JStorage::DLC_FILE_DETAILS)+pFile->dwWchCount*sizeof(wchar_t); pFile = (C4JStorage::DLC_FILE_DETAILS *)&pbData[dwTemp]; } - PBYTE pbTemp=((PBYTE )pFile); + uint8_t* pbTemp=((uint8_t* )pFile); pFile = (C4JStorage::DLC_FILE_DETAILS *)&pbData[uiCurrentByte]; for(unsigned int i=0;idwType,(WCHAR *)pParams->wchData); + addParameter(type,(EAudioParameterType)pParams->dwType,(wchar_t *)pParams->wchData); } - pbTemp+=sizeof(C4JStorage::DLC_FILE_PARAM)+(sizeof(WCHAR)*pParams->dwWchCount); + pbTemp+=sizeof(C4JStorage::DLC_FILE_PARAM)+(sizeof(wchar_t)*pParams->dwWchCount); pParams = (C4JStorage::DLC_FILE_PARAM *)pbTemp; } // Move the pointer to the start of the next files data; pbTemp+=pFile->uiFileSize; - uiCurrentByte+=sizeof(C4JStorage::DLC_FILE_DETAILS)+pFile->dwWchCount*sizeof(WCHAR); + uiCurrentByte+=sizeof(C4JStorage::DLC_FILE_DETAILS)+pFile->dwWchCount*sizeof(wchar_t); pFile=(C4JStorage::DLC_FILE_DETAILS *)&pbData[uiCurrentByte]; diff --git a/src/client/Common/DLC/DLCAudioFile.h b/src/client/Common/DLC/DLCAudioFile.h index 728512d7..cbd42693 100644 --- a/src/client/Common/DLC/DLCAudioFile.h +++ b/src/client/Common/DLC/DLCAudioFile.h @@ -28,22 +28,22 @@ public: e_AudioParamType_Max, }; - static WCHAR *wchTypeNamesA[e_AudioParamType_Max]; + static wchar_t *wchTypeNamesA[e_AudioParamType_Max]; DLCAudioFile(const wstring &path); - virtual void addData(PBYTE pbData, DWORD dwBytes); - virtual PBYTE getData(DWORD &dwBytes); + virtual void addData(uint8_t* pbData, unsigned long dwBytes); + virtual uint8_t* getData(unsigned long &dwBytes); - bool processDLCDataFile(PBYTE pbData, DWORD dwLength); + bool processDLCDataFile(uint8_t* pbData, unsigned long dwLength); int GetCountofType(DLCAudioFile::EAudioType ptype); wstring &GetSoundName(int iIndex); private: using DLCFile::addParameter; - PBYTE m_pbData; - DWORD m_dwBytes; + uint8_t* m_pbData; + unsigned long m_dwBytes; static const int CURRENT_AUDIO_VERSION_NUM=1; //unordered_map m_parameters; vector m_parameters[e_AudioType_Max]; diff --git a/src/client/Common/DLC/DLCCapeFile.cpp b/src/client/Common/DLC/DLCCapeFile.cpp index 29a50ad4..7741b7ae 100644 --- a/src/client/Common/DLC/DLCCapeFile.cpp +++ b/src/client/Common/DLC/DLCCapeFile.cpp @@ -6,7 +6,7 @@ DLCCapeFile::DLCCapeFile(const wstring &path) : DLCFile(DLCManager::e_DLCType_Ca { } -void DLCCapeFile::addData(PBYTE pbData, DWORD dwBytes) +void DLCCapeFile::addData(uint8_t* pbData, unsigned long dwBytes) { app.AddMemoryTextureFile(m_path,pbData,dwBytes); } \ No newline at end of file diff --git a/src/client/Common/DLC/DLCCapeFile.h b/src/client/Common/DLC/DLCCapeFile.h index 8373d340..06473498 100644 --- a/src/client/Common/DLC/DLCCapeFile.h +++ b/src/client/Common/DLC/DLCCapeFile.h @@ -6,5 +6,5 @@ class DLCCapeFile : public DLCFile public: DLCCapeFile(const wstring &path); - virtual void addData(PBYTE pbData, DWORD dwBytes); + virtual void addData(uint8_t* pbData, unsigned long dwBytes); }; \ No newline at end of file diff --git a/src/client/Common/DLC/DLCColourTableFile.cpp b/src/client/Common/DLC/DLCColourTableFile.cpp index 2d22d7fd..2fc9aa45 100644 --- a/src/client/Common/DLC/DLCColourTableFile.cpp +++ b/src/client/Common/DLC/DLCColourTableFile.cpp @@ -19,7 +19,7 @@ DLCColourTableFile::~DLCColourTableFile() } } -void DLCColourTableFile::addData(PBYTE pbData, DWORD dwBytes) +void DLCColourTableFile::addData(uint8_t* pbData, unsigned long dwBytes) { ColourTable *defaultColourTable = Minecraft::GetInstance()->skins->getDefault()->getColourTable(); m_colourTable = new ColourTable(defaultColourTable, pbData, dwBytes); diff --git a/src/client/Common/DLC/DLCColourTableFile.h b/src/client/Common/DLC/DLCColourTableFile.h index 84269739..db16f59d 100644 --- a/src/client/Common/DLC/DLCColourTableFile.h +++ b/src/client/Common/DLC/DLCColourTableFile.h @@ -12,7 +12,7 @@ public: DLCColourTableFile(const wstring &path); ~DLCColourTableFile(); - virtual void addData(PBYTE pbData, DWORD dwBytes); + virtual void addData(uint8_t* pbData, unsigned long dwBytes); ColourTable *getColourTable() { return m_colourTable; } }; \ No newline at end of file diff --git a/src/client/Common/DLC/DLCFile.h b/src/client/Common/DLC/DLCFile.h index 3a40dbc7..6d1c66ad 100644 --- a/src/client/Common/DLC/DLCFile.h +++ b/src/client/Common/DLC/DLCFile.h @@ -6,7 +6,7 @@ class DLCFile protected: DLCManager::EDLCType m_type; wstring m_path; - DWORD m_dwSkinId; + unsigned long m_dwSkinId; public: DLCFile(DLCManager::EDLCType type, const wstring &path); @@ -14,10 +14,10 @@ public: DLCManager::EDLCType getType() { return m_type; } wstring getPath() { return m_path; } - DWORD getSkinID() { return m_dwSkinId; } + unsigned long getSkinID() { return m_dwSkinId; } - virtual void addData(PBYTE pbData, DWORD dwBytes) {} - virtual PBYTE getData(DWORD &dwBytes) { dwBytes = 0; return NULL; } + virtual void addData(uint8_t* pbData, unsigned long dwBytes) {} + virtual uint8_t* getData(unsigned long &dwBytes) { dwBytes = 0; return NULL; } virtual void addParameter(DLCManager::EDLCParameterType type, const wstring &value) {} virtual wstring getParameterAsString(DLCManager::EDLCParameterType type) { return L""; } diff --git a/src/client/Common/DLC/DLCGameRulesFile.cpp b/src/client/Common/DLC/DLCGameRulesFile.cpp index 8ca520d6..f22b2b28 100644 --- a/src/client/Common/DLC/DLCGameRulesFile.cpp +++ b/src/client/Common/DLC/DLCGameRulesFile.cpp @@ -8,13 +8,13 @@ DLCGameRulesFile::DLCGameRulesFile(const wstring &path) : DLCGameRules(DLCManage m_dwBytes = 0; } -void DLCGameRulesFile::addData(PBYTE pbData, DWORD dwBytes) +void DLCGameRulesFile::addData(uint8_t* pbData, unsigned long dwBytes) { m_pbData = pbData; m_dwBytes = dwBytes; } -PBYTE DLCGameRulesFile::getData(DWORD &dwBytes) +uint8_t* DLCGameRulesFile::getData(unsigned long &dwBytes) { dwBytes = m_dwBytes; return m_pbData; diff --git a/src/client/Common/DLC/DLCGameRulesFile.h b/src/client/Common/DLC/DLCGameRulesFile.h index e6456d73..7c9dc66e 100644 --- a/src/client/Common/DLC/DLCGameRulesFile.h +++ b/src/client/Common/DLC/DLCGameRulesFile.h @@ -4,12 +4,12 @@ class DLCGameRulesFile : public DLCGameRules { private: - PBYTE m_pbData; - DWORD m_dwBytes; + uint8_t* m_pbData; + unsigned long m_dwBytes; public: DLCGameRulesFile(const wstring &path); - virtual void addData(PBYTE pbData, DWORD dwBytes); - virtual PBYTE getData(DWORD &dwBytes); + virtual void addData(uint8_t* pbData, unsigned long dwBytes); + virtual uint8_t* getData(unsigned long &dwBytes); }; \ No newline at end of file diff --git a/src/client/Common/DLC/DLCGameRulesHeader.cpp b/src/client/Common/DLC/DLCGameRulesHeader.cpp index 4c041147..231215ea 100644 --- a/src/client/Common/DLC/DLCGameRulesHeader.cpp +++ b/src/client/Common/DLC/DLCGameRulesHeader.cpp @@ -21,7 +21,7 @@ DLCGameRulesHeader::DLCGameRulesHeader(const wstring &path) : DLCGameRules(DLCMa lgo = NULL; } -void DLCGameRulesHeader::addData(PBYTE pbData, DWORD dwBytes) +void DLCGameRulesHeader::addData(uint8_t* pbData, unsigned long dwBytes) { m_pbData = pbData; m_dwBytes = dwBytes; @@ -73,13 +73,13 @@ void DLCGameRulesHeader::addData(PBYTE pbData, DWORD dwBytes) #endif } -PBYTE DLCGameRulesHeader::getData(DWORD &dwBytes) +uint8_t* DLCGameRulesHeader::getData(unsigned long &dwBytes) { dwBytes = m_dwBytes; return m_pbData; } -void DLCGameRulesHeader::setGrfData(PBYTE fData, DWORD fSize, StringTable *st) +void DLCGameRulesHeader::setGrfData(uint8_t* fData, unsigned long fSize, StringTable *st) { if (!m_hasData) { diff --git a/src/client/Common/DLC/DLCGameRulesHeader.h b/src/client/Common/DLC/DLCGameRulesHeader.h index 2100560c..6122c156 100644 --- a/src/client/Common/DLC/DLCGameRulesHeader.h +++ b/src/client/Common/DLC/DLCGameRulesHeader.h @@ -8,21 +8,21 @@ class DLCGameRulesHeader : public DLCGameRules, public JustGrSource private: // GR-Header - PBYTE m_pbData; - DWORD m_dwBytes; + uint8_t* m_pbData; + unsigned long m_dwBytes; bool m_hasData; public: virtual bool requiresTexturePack() {return m_bRequiresTexturePack;} - virtual UINT getRequiredTexturePackId() {return m_requiredTexturePackId;} + virtual unsigned int getRequiredTexturePackId() {return m_requiredTexturePackId;} virtual wstring getDefaultSaveName() {return m_defaultSaveName;} - virtual LPCWSTR getWorldName() {return m_worldName.c_str();} - virtual LPCWSTR getDisplayName() {return m_displayName.c_str();} + virtual const wchar_t* getWorldName() {return m_worldName.c_str();} + virtual const wchar_t* getDisplayName() {return m_displayName.c_str();} virtual wstring getGrfPath() {return L"GameRules.grf";} virtual void setRequiresTexturePack(bool x) {m_bRequiresTexturePack = x;} - virtual void setRequiredTexturePackId(UINT x) {m_requiredTexturePackId = x;} + virtual void setRequiredTexturePackId(unsigned int x) {m_requiredTexturePackId = x;} virtual void setDefaultSaveName(const wstring &x) {m_defaultSaveName = x;} virtual void setWorldName(const wstring & x) {m_worldName = x;} virtual void setDisplayName(const wstring & x) {m_displayName = x;} @@ -33,10 +33,10 @@ public: public: DLCGameRulesHeader(const wstring &path); - virtual void addData(PBYTE pbData, DWORD dwBytes); - virtual PBYTE getData(DWORD &dwBytes); + virtual void addData(uint8_t* pbData, unsigned long dwBytes); + virtual uint8_t* getData(unsigned long &dwBytes); - void setGrfData(PBYTE fData, DWORD fSize, StringTable *); + void setGrfData(uint8_t* fData, unsigned long fSize, StringTable *); virtual bool ready() { return m_hasData; } }; \ No newline at end of file diff --git a/src/client/Common/DLC/DLCLocalisationFile.cpp b/src/client/Common/DLC/DLCLocalisationFile.cpp index 20f0ad10..a0e78dea 100644 --- a/src/client/Common/DLC/DLCLocalisationFile.cpp +++ b/src/client/Common/DLC/DLCLocalisationFile.cpp @@ -8,7 +8,7 @@ DLCLocalisationFile::DLCLocalisationFile(const wstring &path) : DLCFile(DLCManag m_strings = NULL; } -void DLCLocalisationFile::addData(PBYTE pbData, DWORD dwBytes) +void DLCLocalisationFile::addData(uint8_t* pbData, unsigned long dwBytes) { m_strings = new StringTable(pbData, dwBytes); } \ No newline at end of file diff --git a/src/client/Common/DLC/DLCLocalisationFile.h b/src/client/Common/DLC/DLCLocalisationFile.h index 083e60d8..8eab3a42 100644 --- a/src/client/Common/DLC/DLCLocalisationFile.h +++ b/src/client/Common/DLC/DLCLocalisationFile.h @@ -10,9 +10,9 @@ private: public: DLCLocalisationFile(const wstring &path); - DLCLocalisationFile(PBYTE pbData, DWORD dwBytes); // when we load in a texture pack details file from TMS++ + DLCLocalisationFile(uint8_t* pbData, unsigned long dwBytes); // when we load in a texture pack details file from TMS++ - virtual void addData(PBYTE pbData, DWORD dwBytes); + virtual void addData(uint8_t* pbData, unsigned long dwBytes); StringTable *getStringTable() { return m_strings; } }; \ No newline at end of file diff --git a/src/client/Common/DLC/DLCManager.cpp b/src/client/Common/DLC/DLCManager.cpp index af54e9f8..cb08abaa 100644 --- a/src/client/Common/DLC/DLCManager.cpp +++ b/src/client/Common/DLC/DLCManager.cpp @@ -7,7 +7,7 @@ #include "Minecraft.h" #include "TexturePackRepository.h" -WCHAR *DLCManager::wchTypeNamesA[]= +wchar_t *DLCManager::wchTypeNamesA[]= { L"DISPLAYNAME", L"THEMENAME", @@ -43,7 +43,7 @@ DLCManager::EDLCParameterType DLCManager::getParameterType(const wstring ¶mN { EDLCParameterType type = e_DLCParamType_Invalid; - for(DWORD i = 0; i < e_DLCParamType_Max; ++i) + for(unsigned long i = 0; i < e_DLCParamType_Max; ++i) { if(paramName.compare(wchTypeNamesA[i]) == 0) { @@ -55,9 +55,9 @@ DLCManager::EDLCParameterType DLCManager::getParameterType(const wstring ¶mN return type; } -DWORD DLCManager::getPackCount(EDLCType type /*= e_DLCType_All*/) +unsigned long DLCManager::getPackCount(EDLCType type /*= e_DLCType_All*/) { - DWORD packCount = 0; + unsigned long packCount = 0; if( type != e_DLCType_All ) { for(AUTO_VAR(it, m_packs.begin()); it != m_packs.end(); ++it) @@ -71,7 +71,7 @@ DWORD DLCManager::getPackCount(EDLCType type /*= e_DLCType_All*/) } else { - packCount = (DWORD)m_packs.size(); + packCount = (unsigned long)m_packs.size(); } return packCount; } @@ -94,7 +94,7 @@ void DLCManager::removePack(DLCPack *pack) DLCPack *DLCManager::getPack(const wstring &name) { DLCPack *pack = NULL; - //DWORD currentIndex = 0; + //unsigned long currentIndex = 0; DLCPack *currentPack = NULL; for(AUTO_VAR(it, m_packs.begin()); it != m_packs.end(); ++it) { @@ -114,7 +114,7 @@ DLCPack *DLCManager::getPack(const wstring &name) DLCPack *DLCManager::getPackFromProductID(const wstring &productID) { DLCPack *pack = NULL; - //DWORD currentIndex = 0; + //unsigned long currentIndex = 0; DLCPack *currentPack = NULL; for(AUTO_VAR(it, m_packs.begin()); it != m_packs.end(); ++it) { @@ -131,12 +131,12 @@ DLCPack *DLCManager::getPackFromProductID(const wstring &productID) } #endif -DLCPack *DLCManager::getPack(DWORD index, EDLCType type /*= e_DLCType_All*/) +DLCPack *DLCManager::getPack(unsigned long index, EDLCType type /*= e_DLCType_All*/) { DLCPack *pack = NULL; if( type != e_DLCType_All ) { - DWORD currentIndex = 0; + unsigned long currentIndex = 0; DLCPack *currentPack = NULL; for(AUTO_VAR(it, m_packs.begin()); it != m_packs.end(); ++it) { @@ -165,9 +165,9 @@ DLCPack *DLCManager::getPack(DWORD index, EDLCType type /*= e_DLCType_All*/) return pack; } -DWORD DLCManager::getPackIndex(DLCPack *pack, bool &found, EDLCType type /*= e_DLCType_All*/) +unsigned long DLCManager::getPackIndex(DLCPack *pack, bool &found, EDLCType type /*= e_DLCType_All*/) { - DWORD foundIndex = 0; + unsigned long foundIndex = 0; found = false; if(pack == NULL) { @@ -177,7 +177,7 @@ DWORD DLCManager::getPackIndex(DLCPack *pack, bool &found, EDLCType type /*= e_D } if( type != e_DLCType_All ) { - DWORD index = 0; + unsigned long index = 0; for(AUTO_VAR(it, m_packs.begin()); it != m_packs.end(); ++it) { DLCPack *thisPack = *it; @@ -195,7 +195,7 @@ DWORD DLCManager::getPackIndex(DLCPack *pack, bool &found, EDLCType type /*= e_D } else { - DWORD index = 0; + unsigned long index = 0; for(AUTO_VAR(it, m_packs.begin()); it != m_packs.end(); ++it) { DLCPack *thisPack = *it; @@ -211,11 +211,11 @@ DWORD DLCManager::getPackIndex(DLCPack *pack, bool &found, EDLCType type /*= e_D return foundIndex; } -DWORD DLCManager::getPackIndexContainingSkin(const wstring &path, bool &found) +unsigned long DLCManager::getPackIndexContainingSkin(const wstring &path, bool &found) { - DWORD foundIndex = 0; + unsigned long foundIndex = 0; found = false; - DWORD index = 0; + unsigned long index = 0; for(AUTO_VAR(it, m_packs.begin()); it != m_packs.end(); ++it) { DLCPack *pack = *it; @@ -266,9 +266,9 @@ DLCSkinFile *DLCManager::getSkinFile(const wstring &path) return foundSkinfile; } -DWORD DLCManager::checkForCorruptDLCAndAlert(bool showMessage /*= true*/) +unsigned long DLCManager::checkForCorruptDLCAndAlert(bool showMessage /*= true*/) { - DWORD corruptDLCCount = m_dwUnnamedCorruptDLCCount; + unsigned long corruptDLCCount = m_dwUnnamedCorruptDLCCount; DLCPack *pack = NULL; DLCPack *firstCorruptPack = NULL; @@ -284,12 +284,12 @@ DWORD DLCManager::checkForCorruptDLCAndAlert(bool showMessage /*= true*/) if(corruptDLCCount > 0 && showMessage) { - UINT uiIDA[1]; + unsigned int uiIDA[1]; uiIDA[0]=IDS_CONFIRM_OK; if(corruptDLCCount == 1 && firstCorruptPack != NULL) { // pass in the pack format string - WCHAR wchFormat[132]; + wchar_t wchFormat[132]; swprintf(wchFormat, 132, L"%ls\n\n%%ls", firstCorruptPack->getName().c_str()); C4JStorage::EMessageResult result = ui.RequestMessageBox( IDS_CORRUPT_DLC_TITLE, IDS_CORRUPT_DLC, uiIDA,1,ProfileManager.GetPrimaryPad(),NULL,NULL, app.GetStringTable(),wchFormat); @@ -306,13 +306,13 @@ DWORD DLCManager::checkForCorruptDLCAndAlert(bool showMessage /*= true*/) return corruptDLCCount; } -bool DLCManager::readDLCDataFile(DWORD &dwFilesProcessed, const wstring &path, DLCPack *pack, bool fromArchive) +bool DLCManager::readDLCDataFile(unsigned long &dwFilesProcessed, const wstring &path, DLCPack *pack, bool fromArchive) { return readDLCDataFile( dwFilesProcessed, wstringtofilename(path), pack, fromArchive); } -bool DLCManager::readDLCDataFile(DWORD &dwFilesProcessed, const string &path, DLCPack *pack, bool fromArchive) +bool DLCManager::readDLCDataFile(unsigned long &dwFilesProcessed, const string &path, DLCPack *pack, bool fromArchive) { wstring wPath = convStringToWstring(path); if (fromArchive && app.getArchiveFileSize(wPath) >= 0) @@ -325,26 +325,26 @@ bool DLCManager::readDLCDataFile(DWORD &dwFilesProcessed, const string &path, DL #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); + void* 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()); if(finalPath.size() == 0) finalPath = wPath; - HANDLE file = CreateFile(finalPath.c_str(), GENERIC_READ, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); + void* file = CreateFile(finalPath.c_str(), GENERIC_READ, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); #else - HANDLE file = CreateFile(path.c_str(), GENERIC_READ, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); + void* file = CreateFile(path.c_str(), GENERIC_READ, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); #endif if( file == INVALID_HANDLE_VALUE ) { - DWORD error = GetLastError(); + unsigned long error = GetLastError(); app.DebugPrintf("Failed to open DLC data file with error code %d (%x)\n", error, error); if( dwFilesProcessed == 0 ) removePack(pack); assert(false); return false; } - DWORD bytesRead,dwFileSize = GetFileSize(file,NULL); - PBYTE pbData = (PBYTE) new BYTE[dwFileSize]; - BOOL bSuccess = ReadFile(file,pbData,dwFileSize,&bytesRead,NULL); + unsigned long bytesRead,dwFileSize = GetFileSize(file,NULL); + uint8_t* pbData = (uint8_t*) new uint8_t[dwFileSize]; + bool bSuccess = ReadFile(file,pbData,dwFileSize,&bytesRead,NULL); if(bSuccess==false) { // need to treat the file as corrupt, and flag it, so can't call fatal error @@ -365,7 +365,7 @@ bool DLCManager::readDLCDataFile(DWORD &dwFilesProcessed, const string &path, DL return processDLCDataFile(dwFilesProcessed, pbData, bytesRead, pack); } -bool DLCManager::processDLCDataFile(DWORD &dwFilesProcessed, PBYTE pbData, DWORD dwLength, DLCPack *pack) +bool DLCManager::processDLCDataFile(unsigned long &dwFilesProcessed, uint8_t* pbData, unsigned long dwLength, DLCPack *pack) { unordered_map parameterMapping; unsigned int uiCurrentByte=0; @@ -394,17 +394,17 @@ bool DLCManager::processDLCDataFile(DWORD &dwFilesProcessed, PBYTE pbData, DWORD unsigned int uiParameterCount=*(unsigned int *)&pbData[uiCurrentByte]; uiCurrentByte+=sizeof(int); C4JStorage::DLC_FILE_PARAM *pParams = (C4JStorage::DLC_FILE_PARAM *)&pbData[uiCurrentByte]; - //DWORD dwwchCount=0; + //unsigned long dwwchCount=0; for(unsigned int i=0;iwchData); + wstring parameterName((wchar_t *)pParams->wchData); DLCManager::EDLCParameterType type = DLCManager::getParameterType(parameterName); if( type != DLCManager::e_DLCParamType_Invalid ) { parameterMapping[pParams->dwType] = type; } - uiCurrentByte+= sizeof(C4JStorage::DLC_FILE_PARAM)+(pParams->dwWchCount*sizeof(WCHAR)); + uiCurrentByte+= sizeof(C4JStorage::DLC_FILE_PARAM)+(pParams->dwWchCount*sizeof(wchar_t)); pParams = (C4JStorage::DLC_FILE_PARAM *)&pbData[uiCurrentByte]; } //ulCurrentByte+=ulParameterCount * sizeof(C4JStorage::DLC_FILE_PARAM); @@ -413,13 +413,13 @@ bool DLCManager::processDLCDataFile(DWORD &dwFilesProcessed, PBYTE pbData, DWORD uiCurrentByte+=sizeof(int); C4JStorage::DLC_FILE_DETAILS *pFile = (C4JStorage::DLC_FILE_DETAILS *)&pbData[uiCurrentByte]; - DWORD dwTemp=uiCurrentByte; + unsigned long dwTemp=uiCurrentByte; for(unsigned int i=0;idwWchCount*sizeof(WCHAR); + dwTemp+=sizeof(C4JStorage::DLC_FILE_DETAILS)+pFile->dwWchCount*sizeof(wchar_t); pFile = (C4JStorage::DLC_FILE_DETAILS *)&pbData[dwTemp]; } - PBYTE pbTemp=((PBYTE )pFile);//+ sizeof(C4JStorage::DLC_FILE_DETAILS)*ulFileCount; + uint8_t* pbTemp=((uint8_t* )pFile);//+ sizeof(C4JStorage::DLC_FILE_DETAILS)*ulFileCount; pFile = (C4JStorage::DLC_FILE_DETAILS *)&pbData[uiCurrentByte]; for(unsigned int i=0;iaddFile(type,(WCHAR *)pFile->wchFile); + dlcFile = pack->addFile(type,(wchar_t *)pFile->wchFile); } // Params @@ -452,22 +452,22 @@ bool DLCManager::processDLCDataFile(DWORD &dwFilesProcessed, PBYTE pbData, DWORD { if(type == e_DLCType_PackConfig) { - pack->addParameter(it->second,(WCHAR *)pParams->wchData); + pack->addParameter(it->second,(wchar_t *)pParams->wchData); } else { - if(dlcFile != NULL) dlcFile->addParameter(it->second,(WCHAR *)pParams->wchData); - else if(dlcTexturePack != NULL) dlcTexturePack->addParameter(it->second, (WCHAR *)pParams->wchData); + if(dlcFile != NULL) dlcFile->addParameter(it->second,(wchar_t *)pParams->wchData); + else if(dlcTexturePack != NULL) dlcTexturePack->addParameter(it->second, (wchar_t *)pParams->wchData); } } - pbTemp+=sizeof(C4JStorage::DLC_FILE_PARAM)+(sizeof(WCHAR)*pParams->dwWchCount); + pbTemp+=sizeof(C4JStorage::DLC_FILE_PARAM)+(sizeof(wchar_t)*pParams->dwWchCount); pParams = (C4JStorage::DLC_FILE_PARAM *)pbTemp; } //pbTemp+=ulParameterCount * sizeof(C4JStorage::DLC_FILE_PARAM); if(dlcTexturePack != NULL) { - DWORD texturePackFilesProcessed = 0; + unsigned long texturePackFilesProcessed = 0; bool validPack = processDLCDataFile(texturePackFilesProcessed,pbTemp,pFile->uiFileSize,dlcTexturePack); pack->SetDataPointer(NULL); // If it's a child pack, it doesn't own the data if(!validPack || texturePackFilesProcessed == 0) @@ -495,7 +495,7 @@ bool DLCManager::processDLCDataFile(DWORD &dwFilesProcessed, PBYTE pbData, DWORD switch(pFile->dwType) { case DLCManager::e_DLCType_Skin: - app.vSkinNames.push_back((WCHAR *)pFile->wchFile); + app.vSkinNames.push_back((wchar_t *)pFile->wchFile); break; } @@ -504,7 +504,7 @@ bool DLCManager::processDLCDataFile(DWORD &dwFilesProcessed, PBYTE pbData, DWORD // Move the pointer to the start of the next files data; pbTemp+=pFile->uiFileSize; - uiCurrentByte+=sizeof(C4JStorage::DLC_FILE_DETAILS)+pFile->dwWchCount*sizeof(WCHAR); + uiCurrentByte+=sizeof(C4JStorage::DLC_FILE_DETAILS)+pFile->dwWchCount*sizeof(wchar_t); pFile=(C4JStorage::DLC_FILE_DETAILS *)&pbData[uiCurrentByte]; } @@ -524,30 +524,30 @@ bool DLCManager::processDLCDataFile(DWORD &dwFilesProcessed, PBYTE pbData, DWORD return true; } -DWORD DLCManager::retrievePackIDFromDLCDataFile(const string &path, DLCPack *pack) +unsigned long DLCManager::retrievePackIDFromDLCDataFile(const string &path, DLCPack *pack) { - DWORD packId = 0; + unsigned long packId = 0; 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); + void* 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()); if(finalPath.size() == 0) finalPath = wPath; - HANDLE file = CreateFile(finalPath.c_str(), GENERIC_READ, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); + void* file = CreateFile(finalPath.c_str(), GENERIC_READ, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); #else - HANDLE file = CreateFile(path.c_str(), GENERIC_READ, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); + void* file = CreateFile(path.c_str(), GENERIC_READ, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); #endif if( file == INVALID_HANDLE_VALUE ) { return 0; } - DWORD bytesRead,dwFileSize = GetFileSize(file,NULL); - PBYTE pbData = (PBYTE) new BYTE[dwFileSize]; - BOOL bSuccess = ReadFile(file,pbData,dwFileSize,&bytesRead,NULL); + unsigned long bytesRead,dwFileSize = GetFileSize(file,NULL); + uint8_t* pbData = (uint8_t*) new uint8_t[dwFileSize]; + bool bSuccess = ReadFile(file,pbData,dwFileSize,&bytesRead,NULL); if(bSuccess==false) { // need to treat the file as corrupt, and flag it, so can't call fatal error @@ -570,9 +570,9 @@ DWORD DLCManager::retrievePackIDFromDLCDataFile(const string &path, DLCPack *pac return packId; } -DWORD DLCManager::retrievePackID(PBYTE pbData, DWORD dwLength, DLCPack *pack) +unsigned long DLCManager::retrievePackID(uint8_t* pbData, unsigned long dwLength, DLCPack *pack) { - DWORD packId=0; + unsigned long packId=0; bool bPackIDSet=false; unordered_map parameterMapping; unsigned int uiCurrentByte=0; @@ -603,13 +603,13 @@ DWORD DLCManager::retrievePackID(PBYTE pbData, DWORD dwLength, DLCPack *pack) for(unsigned int i=0;iwchData); + wstring parameterName((wchar_t *)pParams->wchData); DLCManager::EDLCParameterType type = DLCManager::getParameterType(parameterName); if( type != DLCManager::e_DLCParamType_Invalid ) { parameterMapping[pParams->dwType] = type; } - uiCurrentByte+= sizeof(C4JStorage::DLC_FILE_PARAM)+(pParams->dwWchCount*sizeof(WCHAR)); + uiCurrentByte+= sizeof(C4JStorage::DLC_FILE_PARAM)+(pParams->dwWchCount*sizeof(wchar_t)); pParams = (C4JStorage::DLC_FILE_PARAM *)&pbData[uiCurrentByte]; } @@ -617,13 +617,13 @@ DWORD DLCManager::retrievePackID(PBYTE pbData, DWORD dwLength, DLCPack *pack) uiCurrentByte+=sizeof(int); C4JStorage::DLC_FILE_DETAILS *pFile = (C4JStorage::DLC_FILE_DETAILS *)&pbData[uiCurrentByte]; - DWORD dwTemp=uiCurrentByte; + unsigned long dwTemp=uiCurrentByte; for(unsigned int i=0;idwWchCount*sizeof(WCHAR); + dwTemp+=sizeof(C4JStorage::DLC_FILE_DETAILS)+pFile->dwWchCount*sizeof(wchar_t); pFile = (C4JStorage::DLC_FILE_DETAILS *)&pbData[dwTemp]; } - PBYTE pbTemp=((PBYTE )pFile); + uint8_t* pbTemp=((uint8_t* )pFile); pFile = (C4JStorage::DLC_FILE_DETAILS *)&pbData[uiCurrentByte]; for(unsigned int i=0;isecond==e_DLCParamType_PackId) { - wstring wsTemp=(WCHAR *)pParams->wchData; + wstring wsTemp=(wchar_t *)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(); @@ -654,14 +654,14 @@ DWORD DLCManager::retrievePackID(PBYTE pbData, DWORD dwLength, DLCPack *pack) } } } - pbTemp+=sizeof(C4JStorage::DLC_FILE_PARAM)+(sizeof(WCHAR)*pParams->dwWchCount); + pbTemp+=sizeof(C4JStorage::DLC_FILE_PARAM)+(sizeof(wchar_t)*pParams->dwWchCount); pParams = (C4JStorage::DLC_FILE_PARAM *)pbTemp; } if(bPackIDSet) break; // Move the pointer to the start of the next files data; pbTemp+=pFile->uiFileSize; - uiCurrentByte+=sizeof(C4JStorage::DLC_FILE_DETAILS)+pFile->dwWchCount*sizeof(WCHAR); + uiCurrentByte+=sizeof(C4JStorage::DLC_FILE_DETAILS)+pFile->dwWchCount*sizeof(wchar_t); pFile=(C4JStorage::DLC_FILE_DETAILS *)&pbData[uiCurrentByte]; } diff --git a/src/client/Common/DLC/DLCManager.h b/src/client/Common/DLC/DLCManager.h index 55a62312..68d7540a 100644 --- a/src/client/Common/DLC/DLCManager.h +++ b/src/client/Common/DLC/DLCManager.h @@ -48,20 +48,20 @@ public: e_DLCParamType_Max, }; - static WCHAR *wchTypeNamesA[e_DLCParamType_Max]; + static wchar_t *wchTypeNamesA[e_DLCParamType_Max]; private: vector m_packs; //bool m_bNeedsUpdated; bool m_bNeedsCorruptCheck; - DWORD m_dwUnnamedCorruptDLCCount; + unsigned long m_dwUnnamedCorruptDLCCount; public: DLCManager(); ~DLCManager(); static EDLCParameterType getParameterType(const wstring ¶mName); - DWORD getPackCount(EDLCType type = e_DLCType_All); + unsigned long getPackCount(EDLCType type = e_DLCType_All); //bool NeedsUpdated() { return m_bNeedsUpdated; } //void SetNeedsUpdated(bool val) { m_bNeedsUpdated = val; } @@ -79,21 +79,21 @@ public: #ifdef _XBOX_ONE DLCPack *DLCManager::getPackFromProductID(const wstring &productID); #endif - DLCPack *getPack(DWORD index, EDLCType type = e_DLCType_All); - DWORD getPackIndex(DLCPack *pack, bool &found, EDLCType type = e_DLCType_All); + DLCPack *getPack(unsigned long index, EDLCType type = e_DLCType_All); + unsigned long getPackIndex(DLCPack *pack, bool &found, EDLCType type = e_DLCType_All); DLCSkinFile *getSkinFile(const wstring &path); // Will hunt all packs of type skin to find the right skinfile DLCPack *getPackContainingSkin(const wstring &path); - DWORD getPackIndexContainingSkin(const wstring &path, bool &found); + unsigned long getPackIndexContainingSkin(const wstring &path, bool &found); - DWORD checkForCorruptDLCAndAlert(bool showMessage = true); + unsigned long checkForCorruptDLCAndAlert(bool showMessage = true); - bool readDLCDataFile(DWORD &dwFilesProcessed, const wstring &path, DLCPack *pack, bool fromArchive = false); - bool readDLCDataFile(DWORD &dwFilesProcessed, const string &path, DLCPack *pack, bool fromArchive = false); - DWORD retrievePackIDFromDLCDataFile(const string &path, DLCPack *pack); + bool readDLCDataFile(unsigned long &dwFilesProcessed, const wstring &path, DLCPack *pack, bool fromArchive = false); + bool readDLCDataFile(unsigned long &dwFilesProcessed, const string &path, DLCPack *pack, bool fromArchive = false); + unsigned long retrievePackIDFromDLCDataFile(const string &path, DLCPack *pack); private: - bool processDLCDataFile(DWORD &dwFilesProcessed, PBYTE pbData, DWORD dwLength, DLCPack *pack); + bool processDLCDataFile(unsigned long &dwFilesProcessed, uint8_t* pbData, unsigned long dwLength, DLCPack *pack); - DWORD retrievePackID(PBYTE pbData, DWORD dwLength, DLCPack *pack); + unsigned long retrievePackID(uint8_t* pbData, unsigned long dwLength, DLCPack *pack); }; diff --git a/src/client/Common/DLC/DLCPack.cpp b/src/client/Common/DLC/DLCPack.cpp index a0fb63aa..217f4eb5 100644 --- a/src/client/Common/DLC/DLCPack.cpp +++ b/src/client/Common/DLC/DLCPack.cpp @@ -11,7 +11,7 @@ #include "DLCColourTableFile.h" #include "StringHelpers.h" -DLCPack::DLCPack(const wstring &name,DWORD dwLicenseMask) +DLCPack::DLCPack(const wstring &name,unsigned long dwLicenseMask) { m_dataPath = L""; m_packName = name; @@ -35,7 +35,7 @@ DLCPack::DLCPack(const wstring &name,DWORD dwLicenseMask) } #ifdef _XBOX_ONE -DLCPack::DLCPack(const wstring &name,const wstring &productID,DWORD dwLicenseMask) +DLCPack::DLCPack(const wstring &name,const wstring &productID,unsigned long dwLicenseMask) { m_dataPath = L""; m_packName = name; @@ -81,7 +81,7 @@ DLCPack::~DLCPack() } } -DWORD DLCPack::GetDLCMountIndex() +unsigned long DLCPack::GetDLCMountIndex() { if(m_parentPack != NULL) { @@ -125,7 +125,7 @@ void DLCPack::addParameter(DLCManager::EDLCParameterType type, const wstring &va { case DLCManager::e_DLCParamType_PackId: { - DWORD packId = 0; + unsigned long packId = 0; std::wstringstream ss; // 4J Stu - numbered using decimal to make it easier for artists/people to number manually @@ -137,7 +137,7 @@ void DLCPack::addParameter(DLCManager::EDLCParameterType type, const wstring &va break; case DLCManager::e_DLCParamType_PackVersion: { - DWORD version = 0; + unsigned long version = 0; std::wstringstream ss; // 4J Stu - numbered using decimal to make it easier for artists/people to number manually @@ -200,7 +200,7 @@ DLCFile *DLCPack::addFile(DLCManager::EDLCType type, const wstring &path) #ifdef _XBOX_ONE app.GetDLCFullOfferIDForSkinID(strippedPath,m_wsProductId); #else - ULONGLONG ullVal=0LL; + uint64_t ullVal=0LL; if(app.GetDLCFullOfferIDForSkinID(strippedPath,&ullVal)) { @@ -278,7 +278,7 @@ bool DLCPack::doesPackContainFile(DLCManager::EDLCType type, const wstring &path return hasFile; } -DLCFile *DLCPack::getFile(DLCManager::EDLCType type, DWORD index) +DLCFile *DLCPack::getFile(DLCManager::EDLCType type, unsigned long index) { DLCFile *file = NULL; if(type == DLCManager::e_DLCType_All) @@ -333,9 +333,9 @@ DLCFile *DLCPack::getFile(DLCManager::EDLCType type, const wstring &path) return file; } -DWORD DLCPack::getDLCItemsCount(DLCManager::EDLCType type /*= DLCManager::e_DLCType_All*/) +unsigned long DLCPack::getDLCItemsCount(DLCManager::EDLCType type /*= DLCManager::e_DLCType_All*/) { - DWORD count = 0; + unsigned long count = 0; switch(type) { @@ -346,13 +346,13 @@ DWORD DLCPack::getDLCItemsCount(DLCManager::EDLCType type /*= DLCManager::e_DLCT } break; default: - count = (DWORD)m_files[(int)type].size(); + count = (unsigned long)m_files[(int)type].size(); break; }; return count; }; -DWORD DLCPack::getFileIndexAt(DLCManager::EDLCType type, const wstring &path, bool &found) +unsigned long DLCPack::getFileIndexAt(DLCManager::EDLCType type, const wstring &path, bool &found) { if(type == DLCManager::e_DLCType_All) { @@ -363,9 +363,9 @@ DWORD DLCPack::getFileIndexAt(DLCManager::EDLCType type, const wstring &path, bo return 0; } - DWORD foundIndex = 0; + unsigned long foundIndex = 0; found = false; - DWORD index = 0; + unsigned long index = 0; for(AUTO_VAR(it, m_files[type].begin()); it != m_files[type].end(); ++it) { if(path.compare((*it)->getPath()) == 0) diff --git a/src/client/Common/DLC/DLCPack.h b/src/client/Common/DLC/DLCPack.h index 856744c2..cb060e45 100644 --- a/src/client/Common/DLC/DLCPack.h +++ b/src/client/Common/DLC/DLCPack.h @@ -16,45 +16,45 @@ private: wstring m_packName; wstring m_dataPath; - DWORD m_dwLicenseMask; + unsigned long m_dwLicenseMask; int m_dlcMountIndex; XCONTENTDEVICEID m_dlcDeviceID; #ifdef _XBOX_ONE wstring m_wsProductId; #else - ULONGLONG m_ullFullOfferId; + uint64_t m_ullFullOfferId; #endif bool m_isCorrupt; - DWORD m_packId; - DWORD m_packVersion; + unsigned long m_packId; + unsigned long m_packVersion; - PBYTE m_data; // This pointer is for all the data used for this pack, so deleting it invalidates ALL of it's children. + uint8_t* m_data; // This pointer is for all the data used for this pack, so deleting it invalidates ALL of it's children. public: - DLCPack(const wstring &name,DWORD dwLicenseMask); + DLCPack(const wstring &name,unsigned long dwLicenseMask); #ifdef _XBOX_ONE - DLCPack(const wstring &name,const wstring &productID,DWORD dwLicenseMask); + DLCPack(const wstring &name,const wstring &productID,unsigned long dwLicenseMask); #endif ~DLCPack(); wstring getFullDataPath() { return m_dataPath; } - void SetDataPointer(PBYTE pbData) { m_data = pbData; } + void SetDataPointer(uint8_t* pbData) { m_data = pbData; } bool IsCorrupt() { return m_isCorrupt; } void SetIsCorrupt(bool val) { m_isCorrupt = val; } - void SetPackId(DWORD id) { m_packId = id; } - DWORD GetPackId() { return m_packId; } + void SetPackId(unsigned long id) { m_packId = id; } + unsigned long GetPackId() { return m_packId; } - void SetPackVersion(DWORD version) { m_packVersion = version; } - DWORD GetPackVersion() { return m_packVersion; } + void SetPackVersion(unsigned long version) { m_packVersion = version; } + unsigned long GetPackVersion() { return m_packVersion; } DLCPack * GetParentPack() { return m_parentPack; } - DWORD GetParentPackId() { return m_parentPack->m_packId; } + unsigned long GetParentPackId() { return m_parentPack->m_packId; } - void SetDLCMountIndex(DWORD id) { m_dlcMountIndex = id; } - DWORD GetDLCMountIndex(); + void SetDLCMountIndex(unsigned long id) { m_dlcMountIndex = id; } + unsigned long GetDLCMountIndex(); void SetDLCDeviceID(XCONTENTDEVICEID deviceId) { m_dlcDeviceID = deviceId; } XCONTENTDEVICEID GetDLCDeviceID(); @@ -64,29 +64,29 @@ public: void addParameter(DLCManager::EDLCParameterType type, const wstring &value); bool getParameterAsUInt(DLCManager::EDLCParameterType type, unsigned int ¶m); - void updateLicenseMask( DWORD dwLicenseMask ) { m_dwLicenseMask = dwLicenseMask; } - DWORD getLicenseMask( ) { return m_dwLicenseMask; } + void updateLicenseMask( unsigned long dwLicenseMask ) { m_dwLicenseMask = dwLicenseMask; } + unsigned long getLicenseMask( ) { return m_dwLicenseMask; } wstring getName() { return m_packName; } #ifdef _XBOX_ONE wstring getPurchaseOfferId() { return m_wsProductId; } #else - ULONGLONG getPurchaseOfferId() { return m_ullFullOfferId; } + uint64_t getPurchaseOfferId() { return m_ullFullOfferId; } #endif DLCFile *addFile(DLCManager::EDLCType type, const wstring &path); - DLCFile *getFile(DLCManager::EDLCType type, DWORD index); + DLCFile *getFile(DLCManager::EDLCType type, unsigned long index); DLCFile *getFile(DLCManager::EDLCType type, const wstring &path); - DWORD getDLCItemsCount(DLCManager::EDLCType type = DLCManager::e_DLCType_All); - DWORD getFileIndexAt(DLCManager::EDLCType type, const wstring &path, bool &found); + unsigned long getDLCItemsCount(DLCManager::EDLCType type = DLCManager::e_DLCType_All); + unsigned long getFileIndexAt(DLCManager::EDLCType type, const wstring &path, bool &found); bool doesPackContainFile(DLCManager::EDLCType type, const wstring &path); - DWORD GetPackID() {return m_packId;} + unsigned long GetPackID() {return m_packId;} - DWORD getSkinCount() { return getDLCItemsCount(DLCManager::e_DLCType_Skin); } - DWORD getSkinIndexAt(const wstring &path, bool &found) { return getFileIndexAt(DLCManager::e_DLCType_Skin, path, found); } + unsigned long getSkinCount() { return getDLCItemsCount(DLCManager::e_DLCType_Skin); } + unsigned long getSkinIndexAt(const wstring &path, bool &found) { return getFileIndexAt(DLCManager::e_DLCType_Skin, path, found); } DLCSkinFile *getSkinFile(const wstring &path) { return (DLCSkinFile *)getFile(DLCManager::e_DLCType_Skin, path); } - DLCSkinFile *getSkinFile(DWORD index) { return (DLCSkinFile *)getFile(DLCManager::e_DLCType_Skin, index); } + DLCSkinFile *getSkinFile(unsigned long index) { return (DLCSkinFile *)getFile(DLCManager::e_DLCType_Skin, index); } bool doesPackContainSkin(const wstring &path) { return doesPackContainFile(DLCManager::e_DLCType_Skin, path); } bool hasPurchasedFile(DLCManager::EDLCType type, const wstring &path); diff --git a/src/client/Common/DLC/DLCSkinFile.cpp b/src/client/Common/DLC/DLCSkinFile.cpp index b4146444..58b05e48 100644 --- a/src/client/Common/DLC/DLCSkinFile.cpp +++ b/src/client/Common/DLC/DLCSkinFile.cpp @@ -16,7 +16,7 @@ DLCSkinFile::DLCSkinFile(const wstring &path) : DLCFile(DLCManager::e_DLCType_Sk m_uiAnimOverrideBitmask=0L; } -void DLCSkinFile::addData(PBYTE pbData, DWORD dwBytes) +void DLCSkinFile::addData(uint8_t* pbData, unsigned long dwBytes) { app.AddMemoryTextureFile(m_path,pbData,dwBytes); } @@ -110,7 +110,7 @@ void DLCSkinFile::addParameter(DLCManager::EDLCParameterType type, const wstring break; case DLCManager::e_DLCParamType_Box: { - WCHAR wchBodyPart[10]; + wchar_t wchBodyPart[10]; SKIN_BOX *pSkinBox = new SKIN_BOX; ZeroMemory(pSkinBox,sizeof(SKIN_BOX)); @@ -165,7 +165,7 @@ void DLCSkinFile::addParameter(DLCManager::EDLCParameterType type, const wstring #else swscanf_s(value.c_str(), L"%X", &m_uiAnimOverrideBitmask,sizeof(unsigned int)); #endif - DWORD skinId = app.getSkinIdFromPath(m_path); + unsigned long skinId = app.getSkinIdFromPath(m_path); app.SetAnimOverrideBitmask(skinId, m_uiAnimOverrideBitmask); break; } diff --git a/src/client/Common/DLC/DLCSkinFile.h b/src/client/Common/DLC/DLCSkinFile.h index 5f95669e..a81e277e 100644 --- a/src/client/Common/DLC/DLCSkinFile.h +++ b/src/client/Common/DLC/DLCSkinFile.h @@ -17,7 +17,7 @@ public: DLCSkinFile(const wstring &path); - virtual void addData(PBYTE pbData, DWORD dwBytes); + virtual void addData(uint8_t* pbData, unsigned long dwBytes); virtual void addParameter(DLCManager::EDLCParameterType type, const wstring &value); virtual wstring getParameterAsString(DLCManager::EDLCParameterType type); diff --git a/src/client/Common/DLC/DLCTextureFile.cpp b/src/client/Common/DLC/DLCTextureFile.cpp index cf99465a..f7b54732 100644 --- a/src/client/Common/DLC/DLCTextureFile.cpp +++ b/src/client/Common/DLC/DLCTextureFile.cpp @@ -11,14 +11,14 @@ DLCTextureFile::DLCTextureFile(const wstring &path) : DLCFile(DLCManager::e_DLCT m_dwBytes = 0; } -void DLCTextureFile::addData(PBYTE pbData, DWORD dwBytes) +void DLCTextureFile::addData(uint8_t* pbData, unsigned long dwBytes) { //app.AddMemoryTextureFile(m_path,pbData,dwBytes); m_pbData = pbData; m_dwBytes = dwBytes; } -PBYTE DLCTextureFile::getData(DWORD &dwBytes) +uint8_t* DLCTextureFile::getData(unsigned long &dwBytes) { dwBytes = m_dwBytes; return m_pbData; diff --git a/src/client/Common/DLC/DLCTextureFile.h b/src/client/Common/DLC/DLCTextureFile.h index bc791686..29fd71ab 100644 --- a/src/client/Common/DLC/DLCTextureFile.h +++ b/src/client/Common/DLC/DLCTextureFile.h @@ -8,14 +8,14 @@ private: bool m_bIsAnim; wstring m_animString; - PBYTE m_pbData; - DWORD m_dwBytes; + uint8_t* m_pbData; + unsigned long m_dwBytes; public: DLCTextureFile(const wstring &path); - virtual void addData(PBYTE pbData, DWORD dwBytes); - virtual PBYTE getData(DWORD &dwBytes); + virtual void addData(uint8_t* pbData, unsigned long dwBytes); + virtual uint8_t* getData(unsigned long &dwBytes); virtual void addParameter(DLCManager::EDLCParameterType type, const wstring &value); diff --git a/src/client/Common/DLC/DLCUIDataFile.cpp b/src/client/Common/DLC/DLCUIDataFile.cpp index a2a56bca..4aa98e97 100644 --- a/src/client/Common/DLC/DLCUIDataFile.cpp +++ b/src/client/Common/DLC/DLCUIDataFile.cpp @@ -18,14 +18,14 @@ DLCUIDataFile::~DLCUIDataFile() } } -void DLCUIDataFile::addData(PBYTE pbData, DWORD dwBytes,bool canDeleteData) +void DLCUIDataFile::addData(uint8_t* pbData, unsigned long dwBytes,bool canDeleteData) { m_pbData = pbData; m_dwBytes = dwBytes; m_canDeleteData = canDeleteData; } -PBYTE DLCUIDataFile::getData(DWORD &dwBytes) +uint8_t* DLCUIDataFile::getData(unsigned long &dwBytes) { dwBytes = m_dwBytes; return m_pbData; diff --git a/src/client/Common/DLC/DLCUIDataFile.h b/src/client/Common/DLC/DLCUIDataFile.h index 105ad0df..6bb31673 100644 --- a/src/client/Common/DLC/DLCUIDataFile.h +++ b/src/client/Common/DLC/DLCUIDataFile.h @@ -4,8 +4,8 @@ class DLCUIDataFile : public DLCFile { private: - PBYTE m_pbData; - DWORD m_dwBytes; + uint8_t* m_pbData; + unsigned long m_dwBytes; bool m_canDeleteData; public: @@ -15,6 +15,6 @@ public: using DLCFile::addData; using DLCFile::addParameter; - virtual void addData(PBYTE pbData, DWORD dwBytes,bool canDeleteData = false); - virtual PBYTE getData(DWORD &dwBytes); + virtual void addData(uint8_t* pbData, unsigned long dwBytes,bool canDeleteData = false); + virtual uint8_t* getData(unsigned long &dwBytes); }; diff --git a/src/client/Common/GameRules/AddEnchantmentRuleDefinition.cpp b/src/client/Common/GameRules/AddEnchantmentRuleDefinition.cpp index fce36860..6a2b1e29 100644 --- a/src/client/Common/GameRules/AddEnchantmentRuleDefinition.cpp +++ b/src/client/Common/GameRules/AddEnchantmentRuleDefinition.cpp @@ -9,7 +9,7 @@ AddEnchantmentRuleDefinition::AddEnchantmentRuleDefinition() m_enchantmentId = m_enchantmentLevel = 0; } -void AddEnchantmentRuleDefinition::writeAttributes(DataOutputStream *dos, UINT numAttributes) +void AddEnchantmentRuleDefinition::writeAttributes(DataOutputStream *dos, unsigned int numAttributes) { GameRuleDefinition::writeAttributes(dos, numAttributes + 2); diff --git a/src/client/Common/GameRules/AddEnchantmentRuleDefinition.h b/src/client/Common/GameRules/AddEnchantmentRuleDefinition.h index 3beece10..ff449cff 100644 --- a/src/client/Common/GameRules/AddEnchantmentRuleDefinition.h +++ b/src/client/Common/GameRules/AddEnchantmentRuleDefinition.h @@ -15,7 +15,7 @@ public: virtual ConsoleGameRules::EGameRuleType getActionType() { return ConsoleGameRules::eGameRuleType_AddEnchantment; } - virtual void writeAttributes(DataOutputStream *, UINT numAttrs); + virtual void writeAttributes(DataOutputStream *, unsigned int numAttrs); virtual void addAttribute(const wstring &attributeName, const wstring &attributeValue); diff --git a/src/client/Common/GameRules/AddItemRuleDefinition.cpp b/src/client/Common/GameRules/AddItemRuleDefinition.cpp index cdc59276..95608e0f 100644 --- a/src/client/Common/GameRules/AddItemRuleDefinition.cpp +++ b/src/client/Common/GameRules/AddItemRuleDefinition.cpp @@ -12,7 +12,7 @@ AddItemRuleDefinition::AddItemRuleDefinition() m_slot = -1; } -void AddItemRuleDefinition::writeAttributes(DataOutputStream *dos, UINT numAttrs) +void AddItemRuleDefinition::writeAttributes(DataOutputStream *dos, unsigned int numAttrs) { GameRuleDefinition::writeAttributes(dos, numAttrs + 5); diff --git a/src/client/Common/GameRules/AddItemRuleDefinition.h b/src/client/Common/GameRules/AddItemRuleDefinition.h index 602f2d82..897ca381 100644 --- a/src/client/Common/GameRules/AddItemRuleDefinition.h +++ b/src/client/Common/GameRules/AddItemRuleDefinition.h @@ -18,7 +18,7 @@ private: public: AddItemRuleDefinition(); - virtual void writeAttributes(DataOutputStream *, UINT numAttributes); + virtual void writeAttributes(DataOutputStream *, unsigned int numAttributes); virtual void getChildren(vector *children); virtual ConsoleGameRules::EGameRuleType getActionType() { return ConsoleGameRules::eGameRuleType_AddItem; } diff --git a/src/client/Common/GameRules/ApplySchematicRuleDefinition.cpp b/src/client/Common/GameRules/ApplySchematicRuleDefinition.cpp index 686206f3..ccfb43b4 100644 --- a/src/client/Common/GameRules/ApplySchematicRuleDefinition.cpp +++ b/src/client/Common/GameRules/ApplySchematicRuleDefinition.cpp @@ -30,7 +30,7 @@ ApplySchematicRuleDefinition::~ApplySchematicRuleDefinition() delete m_location; } -void ApplySchematicRuleDefinition::writeAttributes(DataOutputStream *dos, UINT numAttrs) +void ApplySchematicRuleDefinition::writeAttributes(DataOutputStream *dos, unsigned int numAttrs) { GameRuleDefinition::writeAttributes(dos, numAttrs + 5); diff --git a/src/client/Common/GameRules/ApplySchematicRuleDefinition.h b/src/client/Common/GameRules/ApplySchematicRuleDefinition.h index 21c42dea..cd0d2a35 100644 --- a/src/client/Common/GameRules/ApplySchematicRuleDefinition.h +++ b/src/client/Common/GameRules/ApplySchematicRuleDefinition.h @@ -19,8 +19,8 @@ private: ConsoleSchematicFile::ESchematicRotation m_rotation; int m_dimension; - __int64 m_totalBlocksChanged; - __int64 m_totalBlocksChangedLighting; + int64_t m_totalBlocksChanged; + int64_t m_totalBlocksChangedLighting; bool m_completed; void updateLocationBox(); @@ -30,7 +30,7 @@ public: virtual ConsoleGameRules::EGameRuleType getActionType() { return ConsoleGameRules::eGameRuleType_ApplySchematic; } - virtual void writeAttributes(DataOutputStream *dos, UINT numAttrs); + virtual void writeAttributes(DataOutputStream *dos, unsigned int numAttrs); virtual void addAttribute(const wstring &attributeName, const wstring &attributeValue); void processSchematic(AABB *chunkBox, LevelChunk *chunk); diff --git a/src/client/Common/GameRules/BiomeOverride.cpp b/src/client/Common/GameRules/BiomeOverride.cpp index 598b7740..6c2555a2 100644 --- a/src/client/Common/GameRules/BiomeOverride.cpp +++ b/src/client/Common/GameRules/BiomeOverride.cpp @@ -9,7 +9,7 @@ BiomeOverride::BiomeOverride() m_biomeId = 0; } -void BiomeOverride::writeAttributes(DataOutputStream *dos, UINT numAttrs) +void BiomeOverride::writeAttributes(DataOutputStream *dos, unsigned int numAttrs) { GameRuleDefinition::writeAttributes(dos, numAttrs + 3); @@ -52,8 +52,8 @@ bool BiomeOverride::isBiome(int id) return m_biomeId == id; } -void BiomeOverride::getTileValues(BYTE &tile, BYTE &topTile) +void BiomeOverride::getTileValues(uint8_t &tile, uint8_t &topTile) { - if(m_tile != 0) tile = (BYTE)m_tile; - if(m_topTile != 0) topTile = (BYTE)m_topTile; + if(m_tile != 0) tile = (uint8_t)m_tile; + if(m_topTile != 0) topTile = (uint8_t)m_topTile; } \ No newline at end of file diff --git a/src/client/Common/GameRules/BiomeOverride.h b/src/client/Common/GameRules/BiomeOverride.h index 5ad9263c..3dae4071 100644 --- a/src/client/Common/GameRules/BiomeOverride.h +++ b/src/client/Common/GameRules/BiomeOverride.h @@ -6,8 +6,8 @@ using namespace std; class BiomeOverride : public GameRuleDefinition { private: - BYTE m_topTile; - BYTE m_tile; + uint8_t m_topTile; + uint8_t m_tile; int m_biomeId; public: @@ -15,9 +15,9 @@ public: virtual ConsoleGameRules::EGameRuleType getActionType() { return ConsoleGameRules::eGameRuleType_BiomeOverride; } - virtual void writeAttributes(DataOutputStream *dos, UINT numAttrs); + virtual void writeAttributes(DataOutputStream *dos, unsigned int numAttrs); virtual void addAttribute(const wstring &attributeName, const wstring &attributeValue); bool isBiome(int id); - void getTileValues(BYTE &tile, BYTE &topTile); + void getTileValues(uint8_t &tile, uint8_t &topTile); }; \ No newline at end of file diff --git a/src/client/Common/GameRules/CollectItemRuleDefinition.cpp b/src/client/Common/GameRules/CollectItemRuleDefinition.cpp index 2ead5055..03ec69cf 100644 --- a/src/client/Common/GameRules/CollectItemRuleDefinition.cpp +++ b/src/client/Common/GameRules/CollectItemRuleDefinition.cpp @@ -17,7 +17,7 @@ CollectItemRuleDefinition::~CollectItemRuleDefinition() { } -void CollectItemRuleDefinition::writeAttributes(DataOutputStream *dos, UINT numAttributes) +void CollectItemRuleDefinition::writeAttributes(DataOutputStream *dos, unsigned int numAttributes) { GameRuleDefinition::writeAttributes(dos, numAttributes + 3); diff --git a/src/client/Common/GameRules/CollectItemRuleDefinition.h b/src/client/Common/GameRules/CollectItemRuleDefinition.h index 5ee6f4c5..4f74f503 100644 --- a/src/client/Common/GameRules/CollectItemRuleDefinition.h +++ b/src/client/Common/GameRules/CollectItemRuleDefinition.h @@ -20,7 +20,7 @@ public: ConsoleGameRules::EGameRuleType getActionType() { return ConsoleGameRules::eGameRuleType_CollectItemRule; } - virtual void writeAttributes(DataOutputStream *, UINT numAttributes); + virtual void writeAttributes(DataOutputStream *, unsigned int numAttributes); virtual void addAttribute(const wstring &attributeName, const wstring &attributeValue); virtual int getGoal(); diff --git a/src/client/Common/GameRules/ConsoleGenerateStructure.cpp b/src/client/Common/GameRules/ConsoleGenerateStructure.cpp index a4f76a0f..8cc3d172 100644 --- a/src/client/Common/GameRules/ConsoleGenerateStructure.cpp +++ b/src/client/Common/GameRules/ConsoleGenerateStructure.cpp @@ -55,7 +55,7 @@ GameRuleDefinition *ConsoleGenerateStructure::addChild(ConsoleGameRules::EGameRu return rule; } -void ConsoleGenerateStructure::writeAttributes(DataOutputStream *dos, UINT numAttrs) +void ConsoleGenerateStructure::writeAttributes(DataOutputStream *dos, unsigned int numAttrs) { GameRuleDefinition::writeAttributes(dos, numAttrs + 5); diff --git a/src/client/Common/GameRules/ConsoleGenerateStructure.h b/src/client/Common/GameRules/ConsoleGenerateStructure.h index 74cb6b78..fe124d3e 100644 --- a/src/client/Common/GameRules/ConsoleGenerateStructure.h +++ b/src/client/Common/GameRules/ConsoleGenerateStructure.h @@ -23,7 +23,7 @@ public: virtual void getChildren(vector *children); virtual GameRuleDefinition *addChild(ConsoleGameRules::EGameRuleType ruleType); - virtual void writeAttributes(DataOutputStream *dos, UINT numAttrs); + virtual void writeAttributes(DataOutputStream *dos, unsigned int numAttrs); virtual void addAttribute(const wstring &attributeName, const wstring &attributeValue); // StructurePiece diff --git a/src/client/Common/GameRules/ConsoleSchematicFile.cpp b/src/client/Common/GameRules/ConsoleSchematicFile.cpp index 8139de9a..99045429 100644 --- a/src/client/Common/GameRules/ConsoleSchematicFile.cpp +++ b/src/client/Common/GameRules/ConsoleSchematicFile.cpp @@ -37,7 +37,7 @@ void ConsoleSchematicFile::save(DataOutputStream *dos) dos->writeInt(m_ySize); dos->writeInt(m_zSize); - byteArray ba(new BYTE[ m_data.length ], m_data.length); + byteArray ba(new uint8_t[ m_data.length ], m_data.length); Compression::getCompression()->CompressLZXRLE( ba.data, &ba.length, m_data.data, m_data.length); @@ -184,7 +184,7 @@ void ConsoleSchematicFile::save_tags(DataOutputStream *dos) delete tag; } -__int64 ConsoleSchematicFile::applyBlocksAndData(LevelChunk *chunk, AABB *chunkBox, AABB *destinationBox, ESchematicRotation rot) +int64_t ConsoleSchematicFile::applyBlocksAndData(LevelChunk *chunk, AABB *chunkBox, AABB *destinationBox, ESchematicRotation rot) { int xStart = max(destinationBox->x0, (double)chunk->x*16); int xEnd = min(destinationBox->x1, (double)((xStart>>4)<<4) + 16); @@ -323,7 +323,7 @@ __int64 ConsoleSchematicFile::applyBlocksAndData(LevelChunk *chunk, AABB *chunkB // At the point that this is called, we have all the neighbouring chunks loaded in (and generally post-processed, apart from this lighting pass), so // we can do the sort of lighting that might propagate out of the chunk. -__int64 ConsoleSchematicFile::applyLighting(LevelChunk *chunk, AABB *chunkBox, AABB *destinationBox, ESchematicRotation rot) +int64_t ConsoleSchematicFile::applyLighting(LevelChunk *chunk, AABB *chunkBox, AABB *destinationBox, ESchematicRotation rot) { int xStart = max(destinationBox->x0, (double)chunk->x*16); int xEnd = min(destinationBox->x1, (double)((xStart>>4)<<4) + 16); diff --git a/src/client/Common/GameRules/ConsoleSchematicFile.h b/src/client/Common/GameRules/ConsoleSchematicFile.h index 5b435699..c314d6f8 100644 --- a/src/client/Common/GameRules/ConsoleSchematicFile.h +++ b/src/client/Common/GameRules/ConsoleSchematicFile.h @@ -72,8 +72,8 @@ public: void save(DataOutputStream *dos); void load(DataInputStream *dis); - __int64 applyBlocksAndData(LevelChunk *chunk, AABB *chunkBox, AABB *destinationBox, ESchematicRotation rot); - __int64 applyLighting(LevelChunk *chunk, AABB *chunkBox, AABB *destinationBox, ESchematicRotation rot); + int64_t applyBlocksAndData(LevelChunk *chunk, AABB *chunkBox, AABB *destinationBox, ESchematicRotation rot); + int64_t applyLighting(LevelChunk *chunk, AABB *chunkBox, AABB *destinationBox, ESchematicRotation rot); void applyTileEntities(LevelChunk *chunk, AABB *chunkBox, AABB *destinationBox, ESchematicRotation rot); static void generateSchematicFile(DataOutputStream *dos, Level *level, int xStart, int yStart, int zStart, int xEnd, int yEnd, int zEnd, bool bSaveMobs, Compression::ECompressionTypes); diff --git a/src/client/Common/GameRules/GameRule.h b/src/client/Common/GameRules/GameRule.h index bdc2ceff..ff20ec34 100644 --- a/src/client/Common/GameRules/GameRule.h +++ b/src/client/Common/GameRules/GameRule.h @@ -14,7 +14,7 @@ public: typedef struct _ValueType { union{ - __int64 i64; + int64_t i64; int i; char c; bool b; diff --git a/src/client/Common/GameRules/GameRuleDefinition.cpp b/src/client/Common/GameRules/GameRuleDefinition.cpp index 8f36d88c..81e42879 100644 --- a/src/client/Common/GameRules/GameRuleDefinition.cpp +++ b/src/client/Common/GameRules/GameRuleDefinition.cpp @@ -29,7 +29,7 @@ void GameRuleDefinition::write(DataOutputStream *dos) (*it)->write(dos); } -void GameRuleDefinition::writeAttributes(DataOutputStream *dos, UINT numAttributes) +void GameRuleDefinition::writeAttributes(DataOutputStream *dos, unsigned int numAttributes) { dos->writeInt(numAttributes + 3); diff --git a/src/client/Common/GameRules/GameRuleDefinition.h b/src/client/Common/GameRules/GameRuleDefinition.h index fc0b7195..9c6a75e5 100644 --- a/src/client/Common/GameRules/GameRuleDefinition.h +++ b/src/client/Common/GameRules/GameRuleDefinition.h @@ -34,7 +34,7 @@ public: virtual void write(DataOutputStream *); - virtual void writeAttributes(DataOutputStream *dos, UINT numAttributes); + virtual void writeAttributes(DataOutputStream *dos, unsigned int numAttributes); virtual void getChildren(vector *); virtual GameRuleDefinition *addChild(ConsoleGameRules::EGameRuleType ruleType); diff --git a/src/client/Common/GameRules/GameRuleManager.cpp b/src/client/Common/GameRules/GameRuleManager.cpp index de42293c..000f134e 100644 --- a/src/client/Common/GameRules/GameRuleManager.cpp +++ b/src/client/Common/GameRules/GameRuleManager.cpp @@ -12,7 +12,7 @@ #include "ConsoleGameRules.h" #include "GameRuleManager.h" -WCHAR *GameRuleManager::wchTagNameA[] = +wchar_t *GameRuleManager::wchTagNameA[] = { L"", // eGameRuleType_Root L"MapOptions", // eGameRuleType_LevelGenerationOptions @@ -34,7 +34,7 @@ WCHAR *GameRuleManager::wchTagNameA[] = L"UpdatePlayer", // eGameRuleType_UpdatePlayerRule }; -WCHAR *GameRuleManager::wchAttrNameA[] = +wchar_t *GameRuleManager::wchAttrNameA[] = { L"descriptionName", // eGameRuleAttr_descriptionName L"promptName", // eGameRuleAttr_promptName @@ -103,7 +103,7 @@ void GameRuleManager::loadGameRules(DLCPack *pack) for(int i = 0; i < gameRulesCount; ++i) { DLCGameRulesHeader *dlcHeader = (DLCGameRulesHeader *)pack->getFile(DLCManager::e_DLCType_GameRulesHeader, i); - DWORD dSize; + unsigned long dSize; byte *dData = dlcHeader->getData(dSize); LevelGenerationOptions *createdLevelGenerationOptions = new LevelGenerationOptions(); @@ -125,7 +125,7 @@ void GameRuleManager::loadGameRules(DLCPack *pack) { DLCGameRulesFile *dlcFile = (DLCGameRulesFile *)pack->getFile(DLCManager::e_DLCType_GameRules, i); - DWORD dSize; + unsigned long dSize; byte *dData = dlcFile->getData(dSize); LevelGenerationOptions *createdLevelGenerationOptions = new LevelGenerationOptions(); @@ -142,7 +142,7 @@ void GameRuleManager::loadGameRules(DLCPack *pack) } } -LevelGenerationOptions *GameRuleManager::loadGameRules(byte *dIn, UINT dSize) +LevelGenerationOptions *GameRuleManager::loadGameRules(byte *dIn, unsigned int dSize) { LevelGenerationOptions *lgo = new LevelGenerationOptions(); lgo->setGrSource( new JustGrSource() ); @@ -153,7 +153,7 @@ LevelGenerationOptions *GameRuleManager::loadGameRules(byte *dIn, UINT dSize) } // 4J-JEV: Reverse of saveGameRules. -void GameRuleManager::loadGameRules(LevelGenerationOptions *lgo, byte *dIn, UINT dSize) +void GameRuleManager::loadGameRules(LevelGenerationOptions *lgo, byte *dIn, unsigned int dSize) { app.DebugPrintf("GameRuleManager::LoadingGameRules:\n"); @@ -170,11 +170,11 @@ void GameRuleManager::loadGameRules(LevelGenerationOptions *lgo, byte *dIn, UINT for (int i = 0; i < 8; i++) dis.readByte(); - BYTE compression_type = dis.readByte(); + uint8_t compression_type = dis.readByte(); app.DebugPrintf("\tcompressionType=%d.\n", compression_type); - UINT compr_len, decomp_len; + unsigned int compr_len, decomp_len; compr_len = dis.readInt(); decomp_len = dis.readInt(); @@ -183,8 +183,8 @@ void GameRuleManager::loadGameRules(LevelGenerationOptions *lgo, byte *dIn, UINT // Decompress File Body - byteArray content(new BYTE[decomp_len], decomp_len), - compr_content(new BYTE[compr_len], compr_len); + byteArray content(new uint8_t[decomp_len], decomp_len), + compr_content(new uint8_t[compr_len], compr_len); dis.read(compr_content); Compression::getCompression()->SetDecompressionType( (Compression::ECompressionTypes)compression_type ); @@ -203,14 +203,14 @@ void GameRuleManager::loadGameRules(LevelGenerationOptions *lgo, byte *dIn, UINT // Read StringTable. byteArray bStringTable; bStringTable.length = dis2.readInt(); - bStringTable.data = new BYTE[ bStringTable.length ]; + bStringTable.data = new uint8_t[ bStringTable.length ]; dis2.read(bStringTable); StringTable *strings = new StringTable(bStringTable.data, bStringTable.length); // Read RuleFile. byteArray bRuleFile; bRuleFile.length = content.length - bStringTable.length; - bRuleFile.data = new BYTE[ bRuleFile.length ]; + bRuleFile.data = new uint8_t[ bRuleFile.length ]; dis2.read(bRuleFile); // 4J-JEV: I don't believe that the path-name is ever used. @@ -240,7 +240,7 @@ void GameRuleManager::loadGameRules(LevelGenerationOptions *lgo, byte *dIn, UINT } // 4J-JEV: Reverse of loadGameRules. -void GameRuleManager::saveGameRules(byte **dOut, UINT *dSize) +void GameRuleManager::saveGameRules(byte **dOut, unsigned int *dSize) { if (m_currentGameRuleDefinitions == NULL && m_currentLevelGenerationOptions == NULL) @@ -264,7 +264,7 @@ void GameRuleManager::saveGameRules(byte **dOut, UINT *dSize) // Write 8 bytes of empty space in case we need them later. // Mainly useful for the ones we save embedded in game saves. - for (UINT i = 0; i < 8; i++) + for (unsigned int i = 0; i < 8; i++) dos.writeByte(0x0); dos.writeByte(APPROPRIATE_COMPRESSION_TYPE); // m_compressionType @@ -306,7 +306,7 @@ void GameRuleManager::saveGameRules(byte **dOut, UINT *dSize) } // Compress compr_dos and write to dos. - byteArray compr_ba(new BYTE[ compr_baos.buf.length ], compr_baos.buf.length); + byteArray compr_ba(new uint8_t[ compr_baos.buf.length ], compr_baos.buf.length); Compression::getCompression()->CompressLZXRLE( compr_ba.data, &compr_ba.length, compr_baos.buf.data, compr_baos.buf.length ); @@ -373,15 +373,15 @@ void GameRuleManager::writeRuleFile(DataOutputStream *dos) m_currentGameRuleDefinitions->write(dos); } -bool GameRuleManager::readRuleFile(LevelGenerationOptions *lgo, byte *dIn, UINT dSize, StringTable *strings) //(DLCGameRulesFile *dlcFile, StringTable *strings) +bool GameRuleManager::readRuleFile(LevelGenerationOptions *lgo, byte *dIn, unsigned int dSize, StringTable *strings) //(DLCGameRulesFile *dlcFile, StringTable *strings) { bool levelGenAdded = false; bool gameRulesAdded = false; LevelGenerationOptions *levelGenerator = lgo;//new LevelGenerationOptions(); LevelRuleset *gameRules = new LevelRuleset(); - //DWORD dwLen = 0; - //PBYTE pbData = dlcFile->getData(dwLen); + //unsigned long dwLen = 0; + //uint8_t* pbData = dlcFile->getData(dwLen); //byteArray data(pbData,dwLen); byteArray data(dIn, dSize); @@ -391,7 +391,7 @@ bool GameRuleManager::readRuleFile(LevelGenerationOptions *lgo, byte *dIn, UINT // Read File. // version_number - __int64 version = dis.readShort(); + int64_t version = dis.readShort(); unsigned char compressionType = 0; if(version == 0) { @@ -469,15 +469,15 @@ bool GameRuleManager::readRuleFile(LevelGenerationOptions *lgo, byte *dIn, UINT } // string lookup. - UINT numStrings = contentDis->readInt(); + unsigned int numStrings = contentDis->readInt(); vector tagsAndAtts; - for (UINT i = 0; i < numStrings; i++) + for (unsigned int i = 0; i < numStrings; i++) tagsAndAtts.push_back( contentDis->readUTF() ); unordered_map tagIdMap; for(int type = (int)ConsoleGameRules::eGameRuleType_Root; type < (int)ConsoleGameRules::eGameRuleType_Count; ++type) { - for(UINT i = 0; i < numStrings; ++i) + for(unsigned int i = 0; i < numStrings; ++i) { if(tagsAndAtts[i].compare(wchTagNameA[type]) == 0) { @@ -492,7 +492,7 @@ bool GameRuleManager::readRuleFile(LevelGenerationOptions *lgo, byte *dIn, UINT unordered_map attrIdMap; for(int attr = (int)ConsoleGameRules::eGameRuleAttr_descriptionName; attr < (int)ConsoleGameRules::eGameRuleAttr_Count; ++attr) { - for (UINT i = 0; i < numStrings; i++) + for (unsigned int i = 0; i < numStrings; i++) { if (tagsAndAtts[i].compare(wchAttrNameA[attr]) == 0) { @@ -503,8 +503,8 @@ bool GameRuleManager::readRuleFile(LevelGenerationOptions *lgo, byte *dIn, UINT }*/ // subfile - UINT numFiles = contentDis->readInt(); - for (UINT i = 0; i < numFiles; i++) + unsigned int numFiles = contentDis->readInt(); + for (unsigned int i = 0; i < numFiles; i++) { wstring sFilename = contentDis->readUTF(); int length = contentDis->readInt(); @@ -519,8 +519,8 @@ bool GameRuleManager::readRuleFile(LevelGenerationOptions *lgo, byte *dIn, UINT LEVEL_GEN_ID lgoID = LEVEL_GEN_ID_NULL; // xml objects - UINT numObjects = contentDis->readInt(); - for(UINT i = 0; i < numObjects; ++i) + unsigned int numObjects = contentDis->readInt(); + for(unsigned int i = 0; i < numObjects; ++i) { int tagId = contentDis->readInt(); ConsoleGameRules::EGameRuleType tagVal = ConsoleGameRules::eGameRuleType_Invalid; @@ -584,7 +584,7 @@ LevelGenerationOptions *GameRuleManager::readHeader(DLCGameRulesHeader *grh) void GameRuleManager::readAttributes(DataInputStream *dis, vector *tagsAndAtts, GameRuleDefinition *rule) { int numAttrs = dis->readInt(); - for (UINT att = 0; att < numAttrs; ++att) + for (unsigned int att = 0; att < numAttrs; ++att) { int attID = dis->readInt(); wstring value = dis->readUTF(); @@ -596,7 +596,7 @@ void GameRuleManager::readAttributes(DataInputStream *dis, vector *tags void GameRuleManager::readChildren(DataInputStream *dis, vector *tagsAndAtts, unordered_map *tagIdMap, GameRuleDefinition *rule) { int numChildren = dis->readInt(); - for(UINT child = 0; child < numChildren; ++child) + for(unsigned int child = 0; child < numChildren; ++child) { int tagId = dis->readInt(); ConsoleGameRules::EGameRuleType tagVal = ConsoleGameRules::eGameRuleType_Invalid; @@ -663,7 +663,7 @@ void GameRuleManager::loadDefaultGameRules() if(app.getArchiveFileSize(fpTutorial) >= 0) { DLCPack *pack = new DLCPack(L"",0xffffffff); - DWORD dwFilesProcessed = 0; + unsigned long dwFilesProcessed = 0; if ( app.m_dlcManager.readDLCDataFile(dwFilesProcessed,fpTutorial,pack,true) ) { app.m_dlcManager.addPack(pack); @@ -689,7 +689,7 @@ bool GameRuleManager::loadGameRulesPack(File *path) if(path->exists()) { DLCPack *pack = new DLCPack(L"",0xffffffff); - DWORD dwFilesProcessed = 0; + unsigned long dwFilesProcessed = 0; if( app.m_dlcManager.readDLCDataFile(dwFilesProcessed, path->getPath(),pack)) { app.m_dlcManager.addPack(pack); @@ -718,7 +718,7 @@ void GameRuleManager::setLevelGenerationOptions(LevelGenerationOptions *levelGen m_currentLevelGenerationOptions->reset_start(); } -LPCWSTR GameRuleManager::GetGameRulesString(const wstring &key) +const wchar_t* GameRuleManager::GetGameRulesString(const wstring &key) { if(m_currentGameRuleDefinitions != NULL && !key.empty() ) { diff --git a/src/client/Common/GameRules/GameRuleManager.h b/src/client/Common/GameRules/GameRuleManager.h index e9e983b8..40db1a8e 100644 --- a/src/client/Common/GameRules/GameRuleManager.h +++ b/src/client/Common/GameRules/GameRuleManager.h @@ -24,8 +24,8 @@ class WstringLookup; class GameRuleManager { public: - static WCHAR *wchTagNameA[ConsoleGameRules::eGameRuleType_Count]; - static WCHAR *wchAttrNameA[ConsoleGameRules::eGameRuleAttr_Count]; + static wchar_t *wchTagNameA[ConsoleGameRules::eGameRuleType_Count]; + static wchar_t *wchAttrNameA[ConsoleGameRules::eGameRuleAttr_Count]; static const short version_number = 2; @@ -40,10 +40,10 @@ public: void loadGameRules(DLCPack *); - LevelGenerationOptions *loadGameRules(byte *dIn, UINT dSize); - void loadGameRules(LevelGenerationOptions *lgo, byte *dIn, UINT dSize); + LevelGenerationOptions *loadGameRules(byte *dIn, unsigned int dSize); + void loadGameRules(LevelGenerationOptions *lgo, byte *dIn, unsigned int dSize); - void saveGameRules(byte **dOut, UINT *dSize); + void saveGameRules(byte **dOut, unsigned int *dSize); private: LevelGenerationOptions *readHeader(DLCGameRulesHeader *grh); @@ -51,7 +51,7 @@ private: void writeRuleFile(DataOutputStream *dos); public: - bool readRuleFile(LevelGenerationOptions *lgo, byte *dIn, UINT dSize, StringTable *strings); //(DLCGameRulesFile *dlcFile, StringTable *strings); + bool readRuleFile(LevelGenerationOptions *lgo, byte *dIn, unsigned int dSize, StringTable *strings); //(DLCGameRulesFile *dlcFile, StringTable *strings); private: void readAttributes(DataInputStream *dis, vector *tagsAndAtts, GameRuleDefinition *rule); @@ -72,7 +72,7 @@ public: void setLevelGenerationOptions(LevelGenerationOptions *levelGen); LevelRuleset *getGameRuleDefinitions() { return m_currentGameRuleDefinitions; } LevelGenerationOptions *getLevelGenerationOptions() { return m_currentLevelGenerationOptions; } - LPCWSTR GetGameRulesString(const wstring &key); + const wchar_t* GetGameRulesString(const wstring &key); // 4J-JEV: // Properly cleans-up and unloads the current set of gameRules. diff --git a/src/client/Common/GameRules/LevelGenerationOptions.cpp b/src/client/Common/GameRules/LevelGenerationOptions.cpp index bb9b1269..ecadc41b 100644 --- a/src/client/Common/GameRules/LevelGenerationOptions.cpp +++ b/src/client/Common/GameRules/LevelGenerationOptions.cpp @@ -23,16 +23,16 @@ JustGrSource::JustGrSource() } bool JustGrSource::requiresTexturePack() {return m_bRequiresTexturePack;} -UINT JustGrSource::getRequiredTexturePackId() {return m_requiredTexturePackId;} +unsigned int JustGrSource::getRequiredTexturePackId() {return m_requiredTexturePackId;} wstring JustGrSource::getDefaultSaveName() {return m_defaultSaveName;} -LPCWSTR JustGrSource::getWorldName() {return m_worldName.c_str();} -LPCWSTR JustGrSource::getDisplayName() {return m_displayName.c_str();} +const wchar_t* JustGrSource::getWorldName() {return m_worldName.c_str();} +const wchar_t* JustGrSource::getDisplayName() {return m_displayName.c_str();} wstring JustGrSource::getGrfPath() {return m_grfPath;} bool JustGrSource::requiresBaseSave() { return m_bRequiresBaseSave; }; wstring JustGrSource::getBaseSavePath() { return m_baseSavePath; }; void JustGrSource::setRequiresTexturePack(bool x) {m_bRequiresTexturePack = x;} -void JustGrSource::setRequiredTexturePackId(UINT x) {m_requiredTexturePackId = x;} +void JustGrSource::setRequiredTexturePackId(unsigned int x) {m_requiredTexturePackId = x;} void JustGrSource::setDefaultSaveName(const wstring &x) {m_defaultSaveName = x;} void JustGrSource::setWorldName(const wstring &x) {m_worldName = x;} void JustGrSource::setDisplayName(const wstring &x) {m_displayName = x;} @@ -90,7 +90,7 @@ LevelGenerationOptions::~LevelGenerationOptions() ConsoleGameRules::EGameRuleType LevelGenerationOptions::getActionType() { return ConsoleGameRules::eGameRuleType_LevelGenerationOptions; } -void LevelGenerationOptions::writeAttributes(DataOutputStream *dos, UINT numAttrs) +void LevelGenerationOptions::writeAttributes(DataOutputStream *dos, unsigned int numAttrs) { GameRuleDefinition::writeAttributes(dos, numAttrs + 5); @@ -162,7 +162,7 @@ void LevelGenerationOptions::addAttribute(const wstring &attributeName, const ws { if(attributeName.compare(L"seed") == 0) { - m_seed = _fromString<__int64>(attributeValue); + m_seed = _fromString(attributeValue); app.DebugPrintf("LevelGenerationOptions: Adding parameter m_seed=%I64d\n",m_seed); } else if(attributeName.compare(L"spawnX") == 0) @@ -331,7 +331,7 @@ void LevelGenerationOptions::clearSchematics() m_schematics.clear(); } -ConsoleSchematicFile *LevelGenerationOptions::loadSchematicFile(const wstring &filename, PBYTE pbData, DWORD dwLen) +ConsoleSchematicFile *LevelGenerationOptions::loadSchematicFile(const wstring &filename, uint8_t* pbData, unsigned long dwLen) { // If we have already loaded this, just return AUTO_VAR(it, m_schematics.find(filename)); @@ -388,7 +388,7 @@ void LevelGenerationOptions::loadStringTable(StringTable *table) m_stringTable = table; } -LPCWSTR LevelGenerationOptions::getString(const wstring &key) +const wchar_t* LevelGenerationOptions::getString(const wstring &key) { if(m_stringTable == NULL) { @@ -400,7 +400,7 @@ LPCWSTR LevelGenerationOptions::getString(const wstring &key) } } -void LevelGenerationOptions::getBiomeOverride(int biomeId, BYTE &tile, BYTE &topTile) +void LevelGenerationOptions::getBiomeOverride(int biomeId, uint8_t &tile, uint8_t &topTile) { for(AUTO_VAR(it, m_biomeOverrides.begin()); it != m_biomeOverrides.end(); ++it) { @@ -477,10 +477,10 @@ bool LevelGenerationOptions::isFromSave() { return getSrc() == eSrc_fromSave; } bool LevelGenerationOptions::isFromDLC() { return getSrc() == eSrc_fromDLC; } bool LevelGenerationOptions::requiresTexturePack() { return info()->requiresTexturePack(); } -UINT LevelGenerationOptions::getRequiredTexturePackId() { return info()->getRequiredTexturePackId(); } +unsigned int LevelGenerationOptions::getRequiredTexturePackId() { return info()->getRequiredTexturePackId(); } wstring LevelGenerationOptions::getDefaultSaveName() { return info()->getDefaultSaveName(); } -LPCWSTR LevelGenerationOptions::getWorldName() { return info()->getWorldName(); } -LPCWSTR LevelGenerationOptions::getDisplayName() { return info()->getDisplayName(); } +const wchar_t* LevelGenerationOptions::getWorldName() { return info()->getWorldName(); } +const wchar_t* LevelGenerationOptions::getDisplayName() { return info()->getDisplayName(); } wstring LevelGenerationOptions::getGrfPath() { return info()->getGrfPath(); } bool LevelGenerationOptions::requiresBaseSave() { return info()->requiresBaseSave(); } wstring LevelGenerationOptions::getBaseSavePath() { return info()->getBaseSavePath(); } @@ -488,7 +488,7 @@ wstring LevelGenerationOptions::getBaseSavePath() { return info()->getBaseSavePa void LevelGenerationOptions::setGrSource(GrSource *grs) { m_pSrc = grs; } void LevelGenerationOptions::setRequiresTexturePack(bool x) { info()->setRequiresTexturePack(x); } -void LevelGenerationOptions::setRequiredTexturePackId(UINT x) { info()->setRequiredTexturePackId(x); } +void LevelGenerationOptions::setRequiredTexturePackId(unsigned int x) { info()->setRequiredTexturePackId(x); } void LevelGenerationOptions::setDefaultSaveName(const wstring &x) { info()->setDefaultSaveName(x); } void LevelGenerationOptions::setWorldName(const wstring &x) { info()->setWorldName(x); } void LevelGenerationOptions::setDisplayName(const wstring &x) { info()->setDisplayName(x); } @@ -497,15 +497,15 @@ void LevelGenerationOptions::setBaseSavePath(const wstring &x) { info()->setBase bool LevelGenerationOptions::ready() { return info()->ready(); } -void LevelGenerationOptions::setBaseSaveData(PBYTE pbData, DWORD dwSize) { m_pbBaseSaveData = pbData; m_dwBaseSaveSize = dwSize; } -PBYTE LevelGenerationOptions::getBaseSaveData(DWORD &size) { size = m_dwBaseSaveSize; return m_pbBaseSaveData; } +void LevelGenerationOptions::setBaseSaveData(uint8_t* pbData, unsigned long dwSize) { m_pbBaseSaveData = pbData; m_dwBaseSaveSize = dwSize; } +uint8_t* LevelGenerationOptions::getBaseSaveData(unsigned long &size) { size = m_dwBaseSaveSize; return m_pbBaseSaveData; } bool LevelGenerationOptions::hasBaseSaveData() { return m_dwBaseSaveSize > 0 && m_pbBaseSaveData != NULL; } void LevelGenerationOptions::deleteBaseSaveData() { if(m_pbBaseSaveData) delete m_pbBaseSaveData; m_pbBaseSaveData = NULL; m_dwBaseSaveSize = 0; } bool LevelGenerationOptions::hasLoadedData() { return m_hasLoadedData; } void LevelGenerationOptions::setLoadedData() { m_hasLoadedData = true; } -__int64 LevelGenerationOptions::getLevelSeed() { return m_seed; } +int64_t LevelGenerationOptions::getLevelSeed() { return m_seed; } Pos *LevelGenerationOptions::getSpawnPos() { return m_spawnPos; } bool LevelGenerationOptions::getuseFlatWorld() { return m_useFlatWorld; } diff --git a/src/client/Common/GameRules/LevelGenerationOptions.h b/src/client/Common/GameRules/LevelGenerationOptions.h index adafadb9..63a7d168 100644 --- a/src/client/Common/GameRules/LevelGenerationOptions.h +++ b/src/client/Common/GameRules/LevelGenerationOptions.h @@ -23,16 +23,16 @@ public: // completely different lifespans. virtual bool requiresTexturePack()=0; - virtual UINT getRequiredTexturePackId()=0; + virtual unsigned int getRequiredTexturePackId()=0; virtual wstring getDefaultSaveName()=0; - virtual LPCWSTR getWorldName()=0; - virtual LPCWSTR getDisplayName()=0; + virtual const wchar_t* getWorldName()=0; + virtual const wchar_t* getDisplayName()=0; virtual wstring getGrfPath()=0; virtual bool requiresBaseSave() = 0; virtual wstring getBaseSavePath() = 0; virtual void setRequiresTexturePack(bool)=0; - virtual void setRequiredTexturePackId(UINT)=0; + virtual void setRequiredTexturePackId(unsigned int)=0; virtual void setDefaultSaveName(const wstring &)=0; virtual void setWorldName(const wstring &)=0; virtual void setDisplayName(const wstring &)=0; @@ -41,7 +41,7 @@ public: virtual bool ready()=0; - //virtual void getGrfData(PBYTE &pData, DWORD &pSize)=0; + //virtual void getGrfData(uint8_t* &pData, unsigned long &pSize)=0; }; class JustGrSource : public GrSource @@ -58,16 +58,16 @@ protected: public: virtual bool requiresTexturePack(); - virtual UINT getRequiredTexturePackId(); + virtual unsigned int getRequiredTexturePackId(); virtual wstring getDefaultSaveName(); - virtual LPCWSTR getWorldName(); - virtual LPCWSTR getDisplayName(); + virtual const wchar_t* getWorldName(); + virtual const wchar_t* getDisplayName(); virtual wstring getGrfPath(); virtual bool requiresBaseSave(); virtual wstring getBaseSavePath(); virtual void setRequiresTexturePack(bool x); - virtual void setRequiredTexturePackId(UINT x); + virtual void setRequiredTexturePackId(unsigned int x); virtual void setDefaultSaveName(const wstring &x); virtual void setWorldName(const wstring &x); virtual void setDisplayName(const wstring &x); @@ -103,8 +103,8 @@ private: bool m_hasLoadedData; - PBYTE m_pbBaseSaveData; - DWORD m_dwBaseSaveSize; + uint8_t* m_pbBaseSaveData; + unsigned long m_dwBaseSaveSize; public: @@ -116,10 +116,10 @@ public: bool isFromDLC(); bool requiresTexturePack(); - UINT getRequiredTexturePackId(); + unsigned int getRequiredTexturePackId(); wstring getDefaultSaveName(); - LPCWSTR getWorldName(); - LPCWSTR getDisplayName(); + const wchar_t* getWorldName(); + const wchar_t* getDisplayName(); wstring getGrfPath(); bool requiresBaseSave(); wstring getBaseSavePath(); @@ -127,7 +127,7 @@ public: void setGrSource(GrSource *grs); void setRequiresTexturePack(bool x); - void setRequiredTexturePackId(UINT x); + void setRequiredTexturePackId(unsigned int x); void setDefaultSaveName(const wstring &x); void setWorldName(const wstring &x); void setDisplayName(const wstring &x); @@ -136,8 +136,8 @@ public: bool ready(); - void setBaseSaveData(PBYTE pbData, DWORD dwSize); - PBYTE getBaseSaveData(DWORD &size); + void setBaseSaveData(uint8_t* pbData, unsigned long dwSize); + uint8_t* getBaseSaveData(unsigned long &size); bool hasBaseSaveData(); void deleteBaseSaveData(); @@ -146,7 +146,7 @@ public: private: // This should match the "MapOptionsRule" definition in the XML schema - __int64 m_seed; + int64_t m_seed; bool m_useFlatWorld; Pos *m_spawnPos; vector m_schematicRules; @@ -168,12 +168,12 @@ public: virtual ConsoleGameRules::EGameRuleType getActionType(); - virtual void writeAttributes(DataOutputStream *dos, UINT numAttributes); + virtual void writeAttributes(DataOutputStream *dos, unsigned int numAttributes); virtual void getChildren(vector *children); virtual GameRuleDefinition *addChild(ConsoleGameRules::EGameRuleType ruleType); virtual void addAttribute(const wstring &attributeName, const wstring &attributeValue); - __int64 getLevelSeed(); + int64_t getLevelSeed(); Pos *getSpawnPos(); bool getuseFlatWorld(); @@ -186,7 +186,7 @@ private: void clearSchematics(); public: - ConsoleSchematicFile *loadSchematicFile(const wstring &filename, PBYTE pbData, DWORD dwLen); + ConsoleSchematicFile *loadSchematicFile(const wstring &filename, uint8_t* pbData, unsigned long dwLen); public: ConsoleSchematicFile *getSchematicFile(const wstring &filename); @@ -196,11 +196,11 @@ public: void setRequiredGameRules(LevelRuleset *rules); LevelRuleset *getRequiredGameRules(); - void getBiomeOverride(int biomeId, BYTE &tile, BYTE &topTile); + void getBiomeOverride(int biomeId, uint8_t &tile, uint8_t &topTile); bool isFeatureChunk(int chunkX, int chunkZ, StructureFeature::EFeatureTypes feature); void loadStringTable(StringTable *table); - LPCWSTR getString(const wstring &key); + const wchar_t* getString(const wstring &key); unordered_map *getUnfinishedSchematicFiles(); diff --git a/src/client/Common/GameRules/LevelRules.cpp b/src/client/Common/GameRules/LevelRules.cpp index b7c8a8a5..d9ec7100 100644 --- a/src/client/Common/GameRules/LevelRules.cpp +++ b/src/client/Common/GameRules/LevelRules.cpp @@ -6,7 +6,7 @@ LevelRules::LevelRules() { } -void LevelRules::addLevelRule(const wstring &displayName, PBYTE pbData, DWORD dwLen) +void LevelRules::addLevelRule(const wstring &displayName, uint8_t* pbData, unsigned long dwLen) { } diff --git a/src/client/Common/GameRules/LevelRules.h b/src/client/Common/GameRules/LevelRules.h index a94a2123..d16b1cbd 100644 --- a/src/client/Common/GameRules/LevelRules.h +++ b/src/client/Common/GameRules/LevelRules.h @@ -7,7 +7,7 @@ class LevelRules public: LevelRules(); - void addLevelRule(const wstring &displayName, PBYTE pbData, DWORD dwLen); + void addLevelRule(const wstring &displayName, uint8_t* pbData, unsigned long dwLen); void addLevelRule(const wstring &displayName, LevelRuleset *rootRule); void removeLevelRule(LevelRuleset *removing); diff --git a/src/client/Common/GameRules/LevelRuleset.cpp b/src/client/Common/GameRules/LevelRuleset.cpp index 402f8d0f..2478debc 100644 --- a/src/client/Common/GameRules/LevelRuleset.cpp +++ b/src/client/Common/GameRules/LevelRuleset.cpp @@ -44,7 +44,7 @@ void LevelRuleset::loadStringTable(StringTable *table) m_stringTable = table; } -LPCWSTR LevelRuleset::getString(const wstring &key) +const wchar_t* LevelRuleset::getString(const wstring &key) { if(m_stringTable == NULL) { diff --git a/src/client/Common/GameRules/LevelRuleset.h b/src/client/Common/GameRules/LevelRuleset.h index bbb17c43..594bc653 100644 --- a/src/client/Common/GameRules/LevelRuleset.h +++ b/src/client/Common/GameRules/LevelRuleset.h @@ -19,7 +19,7 @@ public: virtual ConsoleGameRules::EGameRuleType getActionType() { return ConsoleGameRules::eGameRuleType_LevelRules; } void loadStringTable(StringTable *table); - LPCWSTR getString(const wstring &key); + const wchar_t* getString(const wstring &key); AABB *getNamedArea(const wstring &areaName); diff --git a/src/client/Common/GameRules/NamedAreaRuleDefinition.cpp b/src/client/Common/GameRules/NamedAreaRuleDefinition.cpp index 311d3739..ec002265 100644 --- a/src/client/Common/GameRules/NamedAreaRuleDefinition.cpp +++ b/src/client/Common/GameRules/NamedAreaRuleDefinition.cpp @@ -14,7 +14,7 @@ NamedAreaRuleDefinition::~NamedAreaRuleDefinition() delete m_area; } -void NamedAreaRuleDefinition::writeAttributes(DataOutputStream *dos, UINT numAttributes) +void NamedAreaRuleDefinition::writeAttributes(DataOutputStream *dos, unsigned int numAttributes) { GameRuleDefinition::writeAttributes(dos, numAttributes + 7); diff --git a/src/client/Common/GameRules/NamedAreaRuleDefinition.h b/src/client/Common/GameRules/NamedAreaRuleDefinition.h index 7cf7db19..5dd83bea 100644 --- a/src/client/Common/GameRules/NamedAreaRuleDefinition.h +++ b/src/client/Common/GameRules/NamedAreaRuleDefinition.h @@ -12,7 +12,7 @@ public: NamedAreaRuleDefinition(); ~NamedAreaRuleDefinition(); - virtual void writeAttributes(DataOutputStream *dos, UINT numAttributes); + virtual void writeAttributes(DataOutputStream *dos, unsigned int numAttributes); virtual ConsoleGameRules::EGameRuleType getActionType() { return ConsoleGameRules::eGameRuleType_NamedArea; } diff --git a/src/client/Common/GameRules/StartFeature.cpp b/src/client/Common/GameRules/StartFeature.cpp index bde8cbb1..aa0f29b2 100644 --- a/src/client/Common/GameRules/StartFeature.cpp +++ b/src/client/Common/GameRules/StartFeature.cpp @@ -9,7 +9,7 @@ StartFeature::StartFeature() m_feature = StructureFeature::eFeature_Temples; } -void StartFeature::writeAttributes(DataOutputStream *dos, UINT numAttrs) +void StartFeature::writeAttributes(DataOutputStream *dos, unsigned int numAttrs) { GameRuleDefinition::writeAttributes(dos, numAttrs + 3); diff --git a/src/client/Common/GameRules/StartFeature.h b/src/client/Common/GameRules/StartFeature.h index 6312da60..1caae2c9 100644 --- a/src/client/Common/GameRules/StartFeature.h +++ b/src/client/Common/GameRules/StartFeature.h @@ -15,7 +15,7 @@ public: virtual ConsoleGameRules::EGameRuleType getActionType() { return ConsoleGameRules::eGameRuleType_StartFeature; } - virtual void writeAttributes(DataOutputStream *dos, UINT numAttrs); + virtual void writeAttributes(DataOutputStream *dos, unsigned int numAttrs); virtual void addAttribute(const wstring &attributeName, const wstring &attributeValue); bool isFeatureChunk(int chunkX, int chunkZ, StructureFeature::EFeatureTypes feature); diff --git a/src/client/Common/GameRules/UpdatePlayerRuleDefinition.cpp b/src/client/Common/GameRules/UpdatePlayerRuleDefinition.cpp index 4f220023..59bbfe4c 100644 --- a/src/client/Common/GameRules/UpdatePlayerRuleDefinition.cpp +++ b/src/client/Common/GameRules/UpdatePlayerRuleDefinition.cpp @@ -24,7 +24,7 @@ UpdatePlayerRuleDefinition::~UpdatePlayerRuleDefinition() } } -void UpdatePlayerRuleDefinition::writeAttributes(DataOutputStream *dos, UINT numAttributes) +void UpdatePlayerRuleDefinition::writeAttributes(DataOutputStream *dos, unsigned int numAttributes) { int attrCount = 3; if(m_bUpdateHealth) ++attrCount; diff --git a/src/client/Common/GameRules/UpdatePlayerRuleDefinition.h b/src/client/Common/GameRules/UpdatePlayerRuleDefinition.h index 538aefa1..63d52b7a 100644 --- a/src/client/Common/GameRules/UpdatePlayerRuleDefinition.h +++ b/src/client/Common/GameRules/UpdatePlayerRuleDefinition.h @@ -26,7 +26,7 @@ public: virtual void getChildren(vector *children); virtual GameRuleDefinition *addChild(ConsoleGameRules::EGameRuleType ruleType); - virtual void writeAttributes(DataOutputStream *dos, UINT numAttributes); + virtual void writeAttributes(DataOutputStream *dos, unsigned int numAttributes); virtual void addAttribute(const wstring &attributeName, const wstring &attributeValue); virtual void postProcessPlayer(shared_ptr player); diff --git a/src/client/Common/GameRules/UseTileRuleDefinition.cpp b/src/client/Common/GameRules/UseTileRuleDefinition.cpp index 50819c34..d2c7a2bd 100644 --- a/src/client/Common/GameRules/UseTileRuleDefinition.cpp +++ b/src/client/Common/GameRules/UseTileRuleDefinition.cpp @@ -8,7 +8,7 @@ UseTileRuleDefinition::UseTileRuleDefinition() m_useCoords = false; } -void UseTileRuleDefinition::writeAttributes(DataOutputStream *dos, UINT numAttributes) +void UseTileRuleDefinition::writeAttributes(DataOutputStream *dos, unsigned int numAttributes) { GameRuleDefinition::writeAttributes(dos, numAttributes + 5); diff --git a/src/client/Common/GameRules/UseTileRuleDefinition.h b/src/client/Common/GameRules/UseTileRuleDefinition.h index 8e34e7bc..798cb0d0 100644 --- a/src/client/Common/GameRules/UseTileRuleDefinition.h +++ b/src/client/Common/GameRules/UseTileRuleDefinition.h @@ -17,7 +17,7 @@ public: ConsoleGameRules::EGameRuleType getActionType() { return ConsoleGameRules::eGameRuleType_UseTileRule; } - virtual void writeAttributes(DataOutputStream *dos, UINT numAttributes); + virtual void writeAttributes(DataOutputStream *dos, unsigned int numAttributes); virtual void addAttribute(const wstring &attributeName, const wstring &attributeValue); virtual bool onUseTile(GameRule *rule, int tileId, int x, int y, int z); diff --git a/src/client/Common/GameRules/XboxStructureActionGenerateBox.cpp b/src/client/Common/GameRules/XboxStructureActionGenerateBox.cpp index e7c7da9c..80b3b6c5 100644 --- a/src/client/Common/GameRules/XboxStructureActionGenerateBox.cpp +++ b/src/client/Common/GameRules/XboxStructureActionGenerateBox.cpp @@ -9,7 +9,7 @@ XboxStructureActionGenerateBox::XboxStructureActionGenerateBox() m_skipAir = false; } -void XboxStructureActionGenerateBox::writeAttributes(DataOutputStream *dos, UINT numAttrs) +void XboxStructureActionGenerateBox::writeAttributes(DataOutputStream *dos, unsigned int numAttrs) { ConsoleGenerateStructureAction::writeAttributes(dos, numAttrs + 9); diff --git a/src/client/Common/GameRules/XboxStructureActionGenerateBox.h b/src/client/Common/GameRules/XboxStructureActionGenerateBox.h index 78664d42..ae9c1da8 100644 --- a/src/client/Common/GameRules/XboxStructureActionGenerateBox.h +++ b/src/client/Common/GameRules/XboxStructureActionGenerateBox.h @@ -19,7 +19,7 @@ public: virtual int getEndY() { return m_y1; } virtual int getEndZ() { return m_z1; } - virtual void writeAttributes(DataOutputStream *dos, UINT numAttrs); + virtual void writeAttributes(DataOutputStream *dos, unsigned int numAttrs); virtual void addAttribute(const wstring &attributeName, const wstring &attributeValue); bool generateBoxInLevel(StructurePiece *structure, Level *level, BoundingBox *chunkBB); diff --git a/src/client/Common/GameRules/XboxStructureActionPlaceBlock.cpp b/src/client/Common/GameRules/XboxStructureActionPlaceBlock.cpp index c43b8e97..2f4f9f27 100644 --- a/src/client/Common/GameRules/XboxStructureActionPlaceBlock.cpp +++ b/src/client/Common/GameRules/XboxStructureActionPlaceBlock.cpp @@ -8,7 +8,7 @@ XboxStructureActionPlaceBlock::XboxStructureActionPlaceBlock() m_x = m_y = m_z = m_tile = m_data = 0; } -void XboxStructureActionPlaceBlock::writeAttributes(DataOutputStream *dos, UINT numAttrs) +void XboxStructureActionPlaceBlock::writeAttributes(DataOutputStream *dos, unsigned int numAttrs) { ConsoleGenerateStructureAction::writeAttributes(dos, numAttrs + 5); diff --git a/src/client/Common/GameRules/XboxStructureActionPlaceBlock.h b/src/client/Common/GameRules/XboxStructureActionPlaceBlock.h index 3ee377b9..ee63468a 100644 --- a/src/client/Common/GameRules/XboxStructureActionPlaceBlock.h +++ b/src/client/Common/GameRules/XboxStructureActionPlaceBlock.h @@ -18,7 +18,7 @@ public: virtual int getEndY() { return m_y; } virtual int getEndZ() { return m_z; } - virtual void writeAttributes(DataOutputStream *dos, UINT numAttrs); + virtual void writeAttributes(DataOutputStream *dos, unsigned int numAttrs); virtual void addAttribute(const wstring &attributeName, const wstring &attributeValue); bool placeBlockInLevel(StructurePiece *structure, Level *level, BoundingBox *chunkBB); diff --git a/src/client/Common/GameRules/XboxStructureActionPlaceContainer.cpp b/src/client/Common/GameRules/XboxStructureActionPlaceContainer.cpp index d619ac52..37dcbf3e 100644 --- a/src/client/Common/GameRules/XboxStructureActionPlaceContainer.cpp +++ b/src/client/Common/GameRules/XboxStructureActionPlaceContainer.cpp @@ -21,7 +21,7 @@ XboxStructureActionPlaceContainer::~XboxStructureActionPlaceContainer() } // 4J-JEV: Super class handles attr-facing fine. -//void XboxStructureActionPlaceContainer::writeAttributes(DataOutputStream *dos, UINT numAttrs) +//void XboxStructureActionPlaceContainer::writeAttributes(DataOutputStream *dos, unsigned int numAttrs) void XboxStructureActionPlaceContainer::getChildren(vector *children) diff --git a/src/client/Common/GameRules/XboxStructureActionPlaceContainer.h b/src/client/Common/GameRules/XboxStructureActionPlaceContainer.h index 6355ca11..e1970b23 100644 --- a/src/client/Common/GameRules/XboxStructureActionPlaceContainer.h +++ b/src/client/Common/GameRules/XboxStructureActionPlaceContainer.h @@ -21,7 +21,7 @@ public: virtual GameRuleDefinition *addChild(ConsoleGameRules::EGameRuleType ruleType); // 4J-JEV: Super class handles attr-facing fine. - //virtual void writeAttributes(DataOutputStream *dos, UINT numAttributes); + //virtual void writeAttributes(DataOutputStream *dos, unsigned int numAttributes); virtual void addAttribute(const wstring &attributeName, const wstring &attributeValue); diff --git a/src/client/Common/GameRules/XboxStructureActionPlaceSpawner.cpp b/src/client/Common/GameRules/XboxStructureActionPlaceSpawner.cpp index d3aa4cfb..f47abe61 100644 --- a/src/client/Common/GameRules/XboxStructureActionPlaceSpawner.cpp +++ b/src/client/Common/GameRules/XboxStructureActionPlaceSpawner.cpp @@ -15,7 +15,7 @@ XboxStructureActionPlaceSpawner::~XboxStructureActionPlaceSpawner() { } -void XboxStructureActionPlaceSpawner::writeAttributes(DataOutputStream *dos, UINT numAttrs) +void XboxStructureActionPlaceSpawner::writeAttributes(DataOutputStream *dos, unsigned int numAttrs) { XboxStructureActionPlaceBlock::writeAttributes(dos, numAttrs + 1); diff --git a/src/client/Common/GameRules/XboxStructureActionPlaceSpawner.h b/src/client/Common/GameRules/XboxStructureActionPlaceSpawner.h index 16000980..7e21da78 100644 --- a/src/client/Common/GameRules/XboxStructureActionPlaceSpawner.h +++ b/src/client/Common/GameRules/XboxStructureActionPlaceSpawner.h @@ -17,7 +17,7 @@ public: virtual ConsoleGameRules::EGameRuleType getActionType() { return ConsoleGameRules::eGameRuleType_PlaceSpawner; } - virtual void writeAttributes(DataOutputStream *dos, UINT numAttrs); + virtual void writeAttributes(DataOutputStream *dos, unsigned int numAttrs); virtual void addAttribute(const wstring &attributeName, const wstring &attributeValue); bool placeSpawnerInLevel(StructurePiece *structure, Level *level, BoundingBox *chunkBB); diff --git a/src/client/Common/Minecraft_Macros.h b/src/client/Common/Minecraft_Macros.h index 4f1f096a..347d9fa4 100644 --- a/src/client/Common/Minecraft_Macros.h +++ b/src/client/Common/Minecraft_Macros.h @@ -35,8 +35,8 @@ #define MAKE_SKIN_BITMASK(bDlcSkin, dwSkinId) ( (bDlcSkin?0x80000000:0) | (dwSkinId & 0x7FFFFFFF) ) #define IS_SKIN_ID_IN_RANGE(dwSkinId) (dwSkinId <= 0x7FFFFFFF) -#define GET_DLC_SKIN_ID_FROM_BITMASK(uiBitmask) (((DWORD)uiBitmask)&0x7FFFFFFF) -#define GET_UGC_SKIN_ID_FROM_BITMASK(uiBitmask) (((DWORD)uiBitmask)&0x7FFFFFE0) -#define GET_DEFAULT_SKIN_ID_FROM_BITMASK(uiBitmask) (((DWORD)uiBitmask)&0x0000001F) -#define GET_IS_DLC_SKIN_FROM_BITMASK(uiBitmask) ((((DWORD)uiBitmask)&0x80000000)?true:false) +#define GET_DLC_SKIN_ID_FROM_BITMASK(uiBitmask) (((unsigned long)uiBitmask)&0x7FFFFFFF) +#define GET_UGC_SKIN_ID_FROM_BITMASK(uiBitmask) (((unsigned long)uiBitmask)&0x7FFFFFE0) +#define GET_DEFAULT_SKIN_ID_FROM_BITMASK(uiBitmask) (((unsigned long)uiBitmask)&0x0000001F) +#define GET_IS_DLC_SKIN_FROM_BITMASK(uiBitmask) ((((unsigned long)uiBitmask)&0x80000000)?true:false) diff --git a/src/client/Common/Network/GameNetworkManager.cpp b/src/client/Common/Network/GameNetworkManager.cpp index f6a70a61..0fba8c0e 100644 --- a/src/client/Common/Network/GameNetworkManager.cpp +++ b/src/client/Common/Network/GameNetworkManager.cpp @@ -44,8 +44,8 @@ CGameNetworkManager g_NetworkManager; CPlatformNetworkManager *CGameNetworkManager::s_pPlatformNetworkManager; -__int64 CGameNetworkManager::messageQueue[512]; -__int64 CGameNetworkManager::byteQueue[512]; +int64_t CGameNetworkManager::messageQueue[512]; +int64_t CGameNetworkManager::byteQueue[512]; int CGameNetworkManager::messageQueuePos = 0; CGameNetworkManager::CGameNetworkManager() @@ -144,7 +144,7 @@ void CGameNetworkManager::DoWork() #endif } -bool CGameNetworkManager::_RunNetworkGame(LPVOID lpParameter) +bool CGameNetworkManager::_RunNetworkGame(void* lpParameter) { bool success = true; @@ -182,13 +182,13 @@ bool CGameNetworkManager::_RunNetworkGame(LPVOID lpParameter) return success; } -bool CGameNetworkManager::StartNetworkGame(Minecraft *minecraft, LPVOID lpParameter) +bool CGameNetworkManager::StartNetworkGame(Minecraft *minecraft, void* lpParameter) { #ifdef _DURANGO ProfileManager.SetDeferredSignoutEnabled(true); #endif - __int64 seed = 0; + int64_t seed = 0; if(lpParameter != NULL) { NetworkGameInitData *param = (NetworkGameInitData *)lpParameter; @@ -209,7 +209,7 @@ bool CGameNetworkManager::StartNetworkGame(Minecraft *minecraft, LPVOID lpParame } } - static __int64 sseed = seed; // Create static version so this will be valid until next call to this function & whilst thread is running + static int64_t sseed = seed; // Create static version so this will be valid until next call to this function & whilst thread is running ServerStoppedCreate(false); if( g_NetworkManager.IsHost() ) { @@ -329,7 +329,7 @@ bool CGameNetworkManager::StartNetworkGame(Minecraft *minecraft, LPVOID lpParame else { // 4J Stu - Host needs to generate a unique multiplayer id for sentient telemetry reporting - INT multiplayerInstanceId = TelemetryManager->GenerateMultiplayerInstanceId(); + int multiplayerInstanceId = TelemetryManager->GenerateMultiplayerInstanceId(); TelemetryManager->SetMultiplayerInstanceId(multiplayerInstanceId); } TexturePack *tPack = Minecraft::GetInstance()->skins->getSelected(); @@ -632,7 +632,7 @@ bool CGameNetworkManager::GetGameSessionInfo(int iPad, SessionID sessionId,Frien return s_pPlatformNetworkManager->GetGameSessionInfo( iPad, sessionId, foundSession ); } -void CGameNetworkManager::SetSessionsUpdatedCallback( void (*SessionsUpdatedCallback)(LPVOID pParam), LPVOID pSearchParam ) +void CGameNetworkManager::SetSessionsUpdatedCallback( void (*SessionsUpdatedCallback)(void* pParam), void* pSearchParam ) { s_pPlatformNetworkManager->SetSessionsUpdatedCallback( SessionsUpdatedCallback, pSearchParam ); } @@ -668,7 +668,7 @@ CGameNetworkManager::eJoinGameResult CGameNetworkManager::JoinGame(FriendSession return (eJoinGameResult)(s_pPlatformNetworkManager->JoinGame( searchResult, localUsersMask, primaryUserIndex )); } -void CGameNetworkManager::CancelJoinGame(LPVOID lpParam) +void CGameNetworkManager::CancelJoinGame(void* lpParam) { #ifdef _XBOX_ONE s_pPlatformNetworkManager->CancelJoinGame(); @@ -692,7 +692,7 @@ int CGameNetworkManager::JoinFromInvite_SignInReturned(void *pParam,bool bContin int npAvailability = ProfileManager.getNPAvailability(iPad); if (npAvailability == SCE_NP_ERROR_AGE_RESTRICTION) { - UINT uiIDA[1]; + unsigned int uiIDA[1]; uiIDA[0] = IDS_OK; ui.RequestMessageBox(IDS_ONLINE_SERVICE_TITLE, IDS_CONTENT_RESTRICTION, uiIDA, 1, iPad, NULL, NULL, app.GetStringTable()); @@ -736,7 +736,7 @@ int CGameNetworkManager::JoinFromInvite_SignInReturned(void *pParam,bool bContin } else if(noPrivileges) { - UINT uiIDA[1]; + unsigned int uiIDA[1]; uiIDA[0]=IDS_CONFIRM_OK; ui.RequestMessageBox( IDS_NO_MULTIPLAYER_PRIVILEGE_TITLE, IDS_NO_MULTIPLAYER_PRIVILEGE_JOIN_TEXT, uiIDA,1,ProfileManager.GetPrimaryPad(),NULL,NULL, app.GetStringTable()); } @@ -850,7 +850,7 @@ int CGameNetworkManager::RunNetworkGameThreadProc( void* lpParameter ) int CGameNetworkManager::ServerThreadProc( void* lpParameter ) { - __int64 seed = 0; + int64_t seed = 0; if(lpParameter != NULL) { NetworkGameInitData *param = (NetworkGameInitData *)lpParameter; @@ -911,7 +911,7 @@ int CGameNetworkManager::ExitAndJoinFromInviteThreadProc( void* lpParam ) } else { - UINT uiIDA[2]; + unsigned int uiIDA[2]; uiIDA[0]=IDS_PRO_NOTONLINE_ACCEPT; uiIDA[1]=IDS_PRO_NOTONLINE_DECLINE; ui.RequestMessageBox(IDS_PRO_NOTONLINE_TITLE, IDS_PRO_NOTONLINE_TEXT, uiIDA, 2, ProfileManager.GetPrimaryPad(),&CGameNetworkManager::MustSignInReturned_0,lpParam, app.GetStringTable()); @@ -1047,7 +1047,7 @@ int CGameNetworkManager::ChangeSessionTypeThreadProc( void* lpParam ) MinecraftServer *pServer = MinecraftServer::getInstance(); #if defined(__PS3__) || defined(__ORBIS__) || defined __PSVITA__ - UINT uiIDA[1]; + unsigned int uiIDA[1]; uiIDA[0]=IDS_CONFIRM_OK; if( g_NetworkManager.m_bLastDisconnectWasLostRoomOnly ) { @@ -1071,7 +1071,7 @@ int CGameNetworkManager::ChangeSessionTypeThreadProc( void* lpParam ) #elif defined(_XBOX_ONE) if( g_NetworkManager.m_bFullSessionMessageOnNextSessionChange ) { - UINT uiIDA[1]; + unsigned int uiIDA[1]; uiIDA[0]=IDS_CONFIRM_OK; C4JStorage::EMessageResult result = ui.RequestMessageBox( IDS_PROGRESS_CONVERTING_TO_OFFLINE_GAME, IDS_IN_PARTY_SESSION_FULL, uiIDA,1,ProfileManager.GetPrimaryPad()); pMinecraft->progressRenderer->progressStartNoAbort( IDS_PROGRESS_CONVERTING_TO_OFFLINE_GAME ); @@ -1570,7 +1570,7 @@ void CGameNetworkManager::GameInviteReceived( int userIndex, const INVITE_INFO * if (npAvailability == SCE_NP_ERROR_AGE_RESTRICTION) { // 4J Stu - This is a bit messy and is due to the library incorrectly returning false for IsSignedInLive if the npAvailability isn't SCE_OK - UINT uiIDA[1]; + unsigned int uiIDA[1]; uiIDA[0]=IDS_OK; ui.RequestMessageBox(IDS_ONLINE_SERVICE_TITLE, IDS_CONTENT_RESTRICTION, uiIDA, 1, iPadNotSignedInLive, NULL, NULL, app.GetStringTable()); } @@ -1579,14 +1579,14 @@ void CGameNetworkManager::GameInviteReceived( int userIndex, const INVITE_INFO * // Signed in to PSN but not connected (no internet access) assert(!ProfileManager.isConnectedToPSN(iPadNotSignedInLive)); - UINT uiIDA[1]; + unsigned int uiIDA[1]; uiIDA[0] = IDS_OK; ui.RequestMessageBox( IDS_ERROR_NETWORK_TITLE, IDS_ERROR_NETWORK, uiIDA, 1, iPadNotSignedInLive, NULL, NULL, app.GetStringTable()); } else { // Not signed in to PSN - UINT uiIDA[1]; + unsigned int uiIDA[1]; uiIDA[0] = IDS_PRO_NOTONLINE_ACCEPT; ui.RequestMessageBox( IDS_PRO_NOTONLINE_TITLE, IDS_PRO_NOTONLINE_TEXT, uiIDA, 1, iPadNotSignedInLive, &CGameNetworkManager::MustSignInReturned_1, (void *)pInviteInfo, app.GetStringTable(), NULL, 0, false); } @@ -1620,14 +1620,14 @@ void CGameNetworkManager::GameInviteReceived( int userIndex, const INVITE_INFO * // if (ProfileManager.IsSignedInPSN(ProfileManager.GetPrimaryPad())) // { // // Signed in to PSN but not connected (no internet access) -// UINT uiIDA[1]; +// unsigned int uiIDA[1]; // uiIDA[0] = IDS_OK; // ui.RequestMessageBox( IDS_ERROR_NETWORK_TITLE, IDS_ERROR_NETWORK, uiIDA, 1, ProfileManager.GetPrimaryPad(), NULL, NULL, app.GetStringTable()); // } // else { // Not signed in to PSN - UINT uiIDA[1]; + unsigned int uiIDA[1]; uiIDA[0] = IDS_PRO_NOTONLINE_ACCEPT; ui.RequestMessageBox( IDS_PRO_NOTONLINE_TITLE, IDS_PRO_NOTONLINE_TEXT, uiIDA, 1, ProfileManager.GetPrimaryPad(), &CGameNetworkManager::MustSignInReturned_1, (void *)pInviteInfo, app.GetStringTable(), NULL, 0, false); } @@ -1659,8 +1659,8 @@ void CGameNetworkManager::GameInviteReceived( int userIndex, const INVITE_INFO * // Check if user-created content is allowed, as we cannot play multiplayer if it's not bool noUGC = false; bool bContentRestricted=false; - BOOL pccAllowed = true; - BOOL pccFriendsAllowed = true; + bool pccAllowed = true; + bool pccFriendsAllowed = true; #if defined(__PS3__) || defined(__PSVITA__) ProfileManager.GetChatAndContentRestrictions(userIndex,false,&noUGC,&bContentRestricted,NULL); #else @@ -1671,7 +1671,7 @@ void CGameNetworkManager::GameInviteReceived( int userIndex, const INVITE_INFO * #if defined(_XBOX) || defined(__PS3__) if(joiningUsers > 1 && !RenderManager.IsHiDef() && userIndex != ProfileManager.GetPrimaryPad()) { - UINT uiIDA[1]; + unsigned int uiIDA[1]; uiIDA[0]=IDS_CONFIRM_OK; // 4J-PB - it's possible there is no primary pad here, when accepting an invite from the dashboard @@ -1698,7 +1698,7 @@ void CGameNetworkManager::GameInviteReceived( int userIndex, const INVITE_INFO * #endif else if(noPrivileges) { - UINT uiIDA[1]; + unsigned int uiIDA[1]; uiIDA[0]=IDS_CONFIRM_OK; // 4J-PB - it's possible there is no primary pad here, when accepting an invite from the dashboard @@ -1727,7 +1727,7 @@ void CGameNetworkManager::GameInviteReceived( int userIndex, const INVITE_INFO * } else { - UINT uiIDA[2]; + unsigned int uiIDA[2]; uiIDA[0]=IDS_PRO_NOTONLINE_ACCEPT; uiIDA[1]=IDS_PRO_NOTONLINE_DECLINE; ui.RequestMessageBox(IDS_PRO_NOTONLINE_TITLE, IDS_PRO_NOTONLINE_TEXT, uiIDA, 2, ProfileManager.GetPrimaryPad(),&CGameNetworkManager::MustSignInReturned_1,(void *)pInviteInfo, app.GetStringTable()); @@ -1793,7 +1793,7 @@ void CGameNetworkManager::HandleInviteWhenInMenus( int userIndex, const INVITE_I if(noPrivileges) { - UINT uiIDA[1]; + unsigned int uiIDA[1]; uiIDA[0]=IDS_CONFIRM_OK; ui.RequestMessageBox( IDS_NO_MULTIPLAYER_PRIVILEGE_TITLE, IDS_NO_MULTIPLAYER_PRIVILEGE_JOIN_TEXT, uiIDA,1,ProfileManager.GetPrimaryPad(),NULL,NULL, app.GetStringTable()); } @@ -1827,11 +1827,11 @@ void CGameNetworkManager::HandleInviteWhenInMenus( int userIndex, const INVITE_I { // the FromInvite will make the lib decide how many panes to display based on connected pads/signed in players #ifdef _XBOX - ProfileManager.RequestSignInUI(true, false, false, false, false,&CGameNetworkManager::JoinFromInvite_SignInReturned, (LPVOID)pInviteInfo,userIndex); + ProfileManager.RequestSignInUI(true, false, false, false, false,&CGameNetworkManager::JoinFromInvite_SignInReturned, (void*)pInviteInfo,userIndex); #else SignInInfo info; info.Func = &CGameNetworkManager::JoinFromInvite_SignInReturned; - info.lpParam = (LPVOID)pInviteInfo; + info.lpParam = (void*)pInviteInfo; info.requireOnline = true; app.DebugPrintf("Using fullscreen layer\n"); ui.NavigateToScene(ProfileManager.GetPrimaryPad(),eUIScene_QuadrantSignin,&info,eUILayer_Alert,eUIGroup_Fullscreen); diff --git a/src/client/Common/Network/GameNetworkManager.h b/src/client/Common/Network/GameNetworkManager.h index fe0b15b8..eae88eb4 100644 --- a/src/client/Common/Network/GameNetworkManager.h +++ b/src/client/Common/Network/GameNetworkManager.h @@ -52,8 +52,8 @@ public: void Initialise(); void Terminate(); void DoWork(); - bool _RunNetworkGame(LPVOID lpParameter); - bool StartNetworkGame(Minecraft *minecraft, LPVOID lpParameter); + bool _RunNetworkGame(void* lpParameter); + bool StartNetworkGame(Minecraft *minecraft, void* lpParameter); int CorrectErrorIDS(int IDS); // Player management @@ -96,7 +96,7 @@ public: bool SessionHasSpace(unsigned int spaceRequired = 1); vector *GetSessionList(int iPad, int localPlayers, bool partyOnly); bool GetGameSessionInfo(int iPad, SessionID sessionId,FriendSessionInfo *foundSession); - void SetSessionsUpdatedCallback( void (*SessionsUpdatedCallback)(LPVOID pParam), LPVOID pSearchParam ); + void SetSessionsUpdatedCallback( void (*SessionsUpdatedCallback)(void* pParam), void* pSearchParam ); void GetFullFriendSessionInfo( FriendSessionInfo *foundSession, void (* FriendSessionUpdatedFn)(bool success, void *pParam), void *pParam ); void ForceFriendsSessionRefresh(); @@ -104,7 +104,7 @@ public: bool JoinGameFromInviteInfo( int userIndex, int userMask, const INVITE_INFO *pInviteInfo); eJoinGameResult JoinGame(FriendSessionInfo *searchResult, int localUsersMask); - static void CancelJoinGame(LPVOID lpParam); // Not part of the shared interface + static void CancelJoinGame(void* lpParam); // Not part of the shared interface bool LeaveGame(bool bMigrateHost); static int JoinFromInvite_SignInReturned(void *pParam,bool bContinue, int iPad); void UpdateAndSetGameSessionData(INetworkPlayer *pNetworkPlayerLeaving = NULL); @@ -163,9 +163,9 @@ public: // Used for debugging output static const int messageQueue_length = 512; - static __int64 messageQueue[messageQueue_length]; + static int64_t messageQueue[messageQueue_length]; static const int byteQueue_length = 512; - static __int64 byteQueue[byteQueue_length]; + static int64_t byteQueue[byteQueue_length]; static int messageQueuePos; // Methods called from PlatformNetworkManager diff --git a/src/client/Common/Network/PlatformNetworkManagerInterface.h b/src/client/Common/Network/PlatformNetworkManagerInterface.h index 8cc4d044..b9c65b8d 100644 --- a/src/client/Common/Network/PlatformNetworkManagerInterface.h +++ b/src/client/Common/Network/PlatformNetworkManagerInterface.h @@ -19,7 +19,7 @@ class CGameNetworkManager; typedef struct _SearchForGamesData { - DWORD sessionIDCount; + unsigned long sessionIDCount; XSESSION_SEARCHRESULT_HEADER *searchBuffer; XNQOS **ppQos; SessionID *sessionIDList; @@ -107,12 +107,12 @@ public: private: virtual void SetSessionTexturePackParentId( int id ) = 0; virtual void SetSessionSubTexturePackId( int id ) = 0; - virtual void Notify(int ID, ULONG_PTR Param) = 0; + virtual void Notify(int ID, uintptr_t Param) = 0; public: virtual vector *GetSessionList(int iPad, int localPlayers, bool partyOnly) = 0; virtual bool GetGameSessionInfo(int iPad, SessionID sessionId,FriendSessionInfo *foundSession) = 0; - virtual void SetSessionsUpdatedCallback( void (*SessionsUpdatedCallback)(LPVOID pParam), LPVOID pSearchParam ) = 0; + virtual void SetSessionsUpdatedCallback( void (*SessionsUpdatedCallback)(void* pParam), void* pSearchParam ) = 0; virtual void GetFullFriendSessionInfo( FriendSessionInfo *foundSession, void (* FriendSessionUpdatedFn)(bool success, void *pParam), void *pParam ) = 0; virtual void ForceFriendsSessionRefresh() = 0; diff --git a/src/client/Common/Network/PlatformNetworkManagerStub.cpp b/src/client/Common/Network/PlatformNetworkManagerStub.cpp index 151087a2..7aaead29 100644 --- a/src/client/Common/Network/PlatformNetworkManagerStub.cpp +++ b/src/client/Common/Network/PlatformNetworkManagerStub.cpp @@ -320,7 +320,7 @@ bool CPlatformNetworkManagerStub::_RunNetworkGame() void CPlatformNetworkManagerStub::UpdateAndSetGameSessionData(INetworkPlayer *pNetworkPlayerLeaving /*= NULL*/) { -// DWORD playerCount = m_pIQNet->GetPlayerCount(); +// unsigned long playerCount = m_pIQNet->GetPlayerCount(); // // if( this->m_bLeavingGame ) // return; @@ -493,7 +493,7 @@ wstring CPlatformNetworkManagerStub::GatherRTTStats() if(!pQNetPlayer->IsLocal()) { - ZeroMemory(stat,32*sizeof(WCHAR)); + ZeroMemory(stat,32*sizeof(wchar_t)); swprintf(stat, 32, L"%d: %d/", i, pQNetPlayer->GetCurrentRtt() ); stats.append(stat); } @@ -531,7 +531,7 @@ bool CPlatformNetworkManagerStub::GetGameSessionInfo(int iPad, SessionID session return false; } -void CPlatformNetworkManagerStub::SetSessionsUpdatedCallback( void (*SessionsUpdatedCallback)(LPVOID pParam), LPVOID pSearchParam ) +void CPlatformNetworkManagerStub::SetSessionsUpdatedCallback( void (*SessionsUpdatedCallback)(void* pParam), void* pSearchParam ) { m_SessionsUpdatedCallback = SessionsUpdatedCallback; m_pSearchParam = pSearchParam; } @@ -557,7 +557,7 @@ void CPlatformNetworkManagerStub::ForceFriendsSessionRefresh() INetworkPlayer *CPlatformNetworkManagerStub::addNetworkPlayer(IQNetPlayer *pQNetPlayer) { NetworkPlayerXbox *pNetworkPlayer = new NetworkPlayerXbox(pQNetPlayer); - pQNetPlayer->SetCustomDataValue((ULONG_PTR)pNetworkPlayer); + pQNetPlayer->SetCustomDataValue((uintptr_t)pNetworkPlayer); currentNetworkPlayers.push_back( pNetworkPlayer ); return pNetworkPlayer; } @@ -626,7 +626,7 @@ void CPlatformNetworkManagerStub::SetSessionSubTexturePackId( int id ) m_hostGameSessionData.subTexturePackId = id; } -void CPlatformNetworkManagerStub::Notify(int ID, ULONG_PTR Param) +void CPlatformNetworkManagerStub::Notify(int ID, uintptr_t Param) { } diff --git a/src/client/Common/Network/PlatformNetworkManagerStub.h b/src/client/Common/Network/PlatformNetworkManagerStub.h index 30cdbae8..9948e2b6 100644 --- a/src/client/Common/Network/PlatformNetworkManagerStub.h +++ b/src/client/Common/Network/PlatformNetworkManagerStub.h @@ -64,7 +64,7 @@ private: IQNet * m_pIQNet; // pointer to QNet interface - HANDLE m_notificationListener; + void* m_notificationListener; vector m_machineQNetPrimaryPlayers; // collection of players that we deem to be the main one for that system @@ -134,8 +134,8 @@ private: int m_lastSearchPad; bool m_bSearchResultsReady; bool m_bSearchPending; - LPVOID m_pSearchParam; - void (*m_SessionsUpdatedCallback)(LPVOID pParam); + void* m_pSearchParam; + void (*m_SessionsUpdatedCallback)(void* pParam); C4JThread* m_SearchingThread; @@ -152,12 +152,12 @@ private: virtual void SetSessionTexturePackParentId( int id ); virtual void SetSessionSubTexturePackId( int id ); - virtual void Notify(int ID, ULONG_PTR Param); + virtual void Notify(int ID, uintptr_t Param); public: virtual vector *GetSessionList(int iPad, int localPlayers, bool partyOnly); virtual bool GetGameSessionInfo(int iPad, SessionID sessionId,FriendSessionInfo *foundSession); - virtual void SetSessionsUpdatedCallback( void (*SessionsUpdatedCallback)(LPVOID pParam), LPVOID pSearchParam ); + virtual void SetSessionsUpdatedCallback( void (*SessionsUpdatedCallback)(void* pParam), void* pSearchParam ); virtual void GetFullFriendSessionInfo( FriendSessionInfo *foundSession, void (* FriendSessionUpdatedFn)(bool success, void *pParam), void *pParam ); virtual void ForceFriendsSessionRefresh(); diff --git a/src/client/Common/Network/Sony/PlatformNetworkManagerSony.cpp b/src/client/Common/Network/Sony/PlatformNetworkManagerSony.cpp index 6475d3f8..5b634d70 100644 --- a/src/client/Common/Network/Sony/PlatformNetworkManagerSony.cpp +++ b/src/client/Common/Network/Sony/PlatformNetworkManagerSony.cpp @@ -546,8 +546,8 @@ bool CPlatformNetworkManagerSony::isSystemPrimaryPlayer(SQRNetworkPlayer *pSQRPl void CPlatformNetworkManagerSony::DoWork() { #if 0 - DWORD dwNotifyId; - ULONG_PTR ulpNotifyParam; + unsigned long dwNotifyId; + uintptr_t ulpNotifyParam; while( XNotifyGetNext( m_notificationListener, @@ -648,7 +648,7 @@ bool CPlatformNetworkManagerSony::RemoveLocalPlayerByUserIndex( int userIndex ) bool CPlatformNetworkManagerSony::IsInStatsEnabledSession() { #if 0 - DWORD dataSize = sizeof(QNET_LIVE_STATS_MODE); + unsigned long dataSize = sizeof(QNET_LIVE_STATS_MODE); QNET_LIVE_STATS_MODE statsMode; m_pIQNet->GetOpt(QNET_OPTION_LIVE_STATS_MODE, &statsMode , &dataSize ); @@ -665,18 +665,18 @@ bool CPlatformNetworkManagerSony::SessionHasSpace(unsigned int spaceRequired /*= #if 0 // This function is used while a session is running, so all players trying to join // should use public slots, - DWORD publicSlots = 0; - DWORD filledPublicSlots = 0; - DWORD privateSlots = 0; - DWORD filledPrivateSlots = 0; + unsigned long publicSlots = 0; + unsigned long filledPublicSlots = 0; + unsigned long privateSlots = 0; + unsigned long filledPrivateSlots = 0; - DWORD dataSize = sizeof(DWORD); + unsigned long dataSize = sizeof(unsigned long); m_pIQNet->GetOpt(QNET_OPTION_TOTAL_PUBLIC_SLOTS, &publicSlots, &dataSize ); m_pIQNet->GetOpt(QNET_OPTION_FILLED_PUBLIC_SLOTS, &filledPublicSlots, &dataSize ); m_pIQNet->GetOpt(QNET_OPTION_TOTAL_PRIVATE_SLOTS, &privateSlots, &dataSize ); m_pIQNet->GetOpt(QNET_OPTION_FILLED_PRIVATE_SLOTS, &filledPrivateSlots, &dataSize ); - DWORD spaceLeft = (publicSlots - filledPublicSlots) + (privateSlots - filledPrivateSlots); + unsigned long spaceLeft = (publicSlots - filledPublicSlots) + (privateSlots - filledPrivateSlots); return spaceLeft >= spaceRequired; #else @@ -712,7 +712,7 @@ bool CPlatformNetworkManagerSony::LeaveGame(bool bMigrateHost) if( socket != NULL ) { //printf("Waiting for socket closed event\n"); - DWORD result = socket->m_socketClosedEvent->WaitForSignal(INFINITE); + unsigned long result = socket->m_socketClosedEvent->WaitForSignal(INFINITE); // The session might be gone once the socket releases if( IsInSession() ) @@ -794,12 +794,12 @@ bool CPlatformNetworkManagerSony::_StartGame() { #if 0 // Set the options that now allow players to join this game - BOOL enableJip = true; // Must always be true othewise nobody can join the game while in the PLAY state - m_pIQNet->SetOpt( QNET_OPTION_JOIN_IN_PROGRESS_ALLOWED, &enableJip, sizeof BOOL ); - BOOL enableInv = !IsLocalGame(); - m_pIQNet->SetOpt( QNET_OPTION_INVITES_ALLOWED, &enableInv, sizeof BOOL ); - BOOL enablePres = !IsPrivateGame() && !IsLocalGame(); - m_pIQNet->SetOpt( QNET_OPTION_PRESENCE_JOIN_MODE, &enablePres, sizeof BOOL ); + bool enableJip = true; // Must always be true othewise nobody can join the game while in the PLAY state + m_pIQNet->SetOpt( QNET_OPTION_JOIN_IN_PROGRESS_ALLOWED, &enableJip, sizeof bool ); + bool enableInv = !IsLocalGame(); + m_pIQNet->SetOpt( QNET_OPTION_INVITES_ALLOWED, &enableInv, sizeof bool ); + bool enablePres = !IsPrivateGame() && !IsLocalGame(); + m_pIQNet->SetOpt( QNET_OPTION_PRESENCE_JOIN_MODE, &enablePres, sizeof bool ); return ( m_pIQNet->StartGame() == S_OK ); #else @@ -896,16 +896,16 @@ bool CPlatformNetworkManagerSony::_RunNetworkGame() #if 0 // We delay actually starting the session so that we know the game server is running by the time the clients try to join // This does result in a host advantage - HRESULT hr = m_pIQNet->StartGame(); + int hr = m_pIQNet->StartGame(); if(FAILED(hr)) return false; // Set the options that now allow players to join this game - BOOL enableJip = true; // Must always be true othewise nobody can join the game while in the PLAY state - m_pIQNet->SetOpt( QNET_OPTION_JOIN_IN_PROGRESS_ALLOWED, &enableJip, sizeof BOOL ); - BOOL enableInv = !IsLocalGame(); - m_pIQNet->SetOpt( QNET_OPTION_INVITES_ALLOWED, &enableInv, sizeof BOOL ); - BOOL enablePres = !IsPrivateGame() && !IsLocalGame(); - m_pIQNet->SetOpt( QNET_OPTION_PRESENCE_JOIN_MODE, &enablePres, sizeof BOOL ); + bool enableJip = true; // Must always be true othewise nobody can join the game while in the PLAY state + m_pIQNet->SetOpt( QNET_OPTION_JOIN_IN_PROGRESS_ALLOWED, &enableJip, sizeof bool ); + bool enableInv = !IsLocalGame(); + m_pIQNet->SetOpt( QNET_OPTION_INVITES_ALLOWED, &enableInv, sizeof bool ); + bool enablePres = !IsPrivateGame() && !IsLocalGame(); + m_pIQNet->SetOpt( QNET_OPTION_PRESENCE_JOIN_MODE, &enablePres, sizeof bool ); #endif if( IsHost() ) { @@ -1177,7 +1177,7 @@ vector *CPlatformNetworkManagerSony::GetSessionList(int iPa bool CPlatformNetworkManagerSony::GetGameSessionInfo(int iPad, SessionID sessionId, FriendSessionInfo *foundSessionInfo) { #if 0 - HRESULT hr = E_FAIL; + int hr = E_FAIL; const XSESSION_SEARCHRESULT *pSearchResult; const XNQOSINFO * pxnqi; @@ -1185,7 +1185,7 @@ bool CPlatformNetworkManagerSony::GetGameSessionInfo(int iPad, SessionID session if( m_currentSearchResultsCount[iPad] > 0 ) { // Loop through all the results. - for( DWORD dwResult = 0; dwResult < m_currentSearchResultsCount[iPad]; dwResult++ ) + for( unsigned long dwResult = 0; dwResult < m_currentSearchResultsCount[iPad]; dwResult++ ) { pSearchResult = &m_pCurrentSearchResults[iPad]->pResults[dwResult]; @@ -1254,7 +1254,7 @@ bool CPlatformNetworkManagerSony::GetGameSessionInfo(int iPad, SessionID session #endif } -void CPlatformNetworkManagerSony::SetSessionsUpdatedCallback( void (*SessionsUpdatedCallback)(LPVOID pParam), LPVOID pSearchParam ) +void CPlatformNetworkManagerSony::SetSessionsUpdatedCallback( void (*SessionsUpdatedCallback)(void* pParam), void* pSearchParam ) { m_SessionsUpdatedCallback = SessionsUpdatedCallback; m_pSearchParam = pSearchParam; } @@ -1276,7 +1276,7 @@ void CPlatformNetworkManagerSony::ForceFriendsSessionRefresh() INetworkPlayer *CPlatformNetworkManagerSony::addNetworkPlayer(SQRNetworkPlayer *pSQRPlayer) { NetworkPlayerSony *pNetworkPlayer = new NetworkPlayerSony(pSQRPlayer); - pSQRPlayer->SetCustomDataValue((ULONG_PTR)pNetworkPlayer); + pSQRPlayer->SetCustomDataValue((uintptr_t)pNetworkPlayer); currentNetworkPlayers.push_back( pNetworkPlayer ); return pNetworkPlayer; } @@ -1345,7 +1345,7 @@ void CPlatformNetworkManagerSony::SetSessionSubTexturePackId( int id ) m_hostGameSessionData.subTexturePackId = id; } -void CPlatformNetworkManagerSony::Notify(int ID, ULONG_PTR Param) +void CPlatformNetworkManagerSony::Notify(int ID, uintptr_t Param) { #if 0 m_pSQRNet->Notify( ID, Param ); diff --git a/src/client/Common/Network/Sony/PlatformNetworkManagerSony.h b/src/client/Common/Network/Sony/PlatformNetworkManagerSony.h index 09c7fb52..bed7f85d 100644 --- a/src/client/Common/Network/Sony/PlatformNetworkManagerSony.h +++ b/src/client/Common/Network/Sony/PlatformNetworkManagerSony.h @@ -84,7 +84,7 @@ private: #endif SQRNetworkManager * m_pSQRNet; // pointer to SQRNetworkManager interface - HANDLE m_notificationListener; + void* m_notificationListener; vector m_machineSQRPrimaryPlayers; // collection of players that we deem to be the main one for that system @@ -149,8 +149,8 @@ private: int m_lastSearchPad; bool m_bSearchPending; - LPVOID m_pSearchParam; - void (*m_SessionsUpdatedCallback)(LPVOID pParam); + void* m_pSearchParam; + void (*m_SessionsUpdatedCallback)(void* pParam); C4JThread* m_SearchingThread; @@ -163,12 +163,12 @@ private: virtual void SetSessionTexturePackParentId( int id ); virtual void SetSessionSubTexturePackId( int id ); - virtual void Notify(int ID, ULONG_PTR Param); + virtual void Notify(int ID, uintptr_t Param); public: virtual vector *GetSessionList(int iPad, int localPlayers, bool partyOnly); virtual bool GetGameSessionInfo(int iPad, SessionID sessionId,FriendSessionInfo *foundSession); - virtual void SetSessionsUpdatedCallback( void (*SessionsUpdatedCallback)(LPVOID pParam), LPVOID pSearchParam ); + virtual void SetSessionsUpdatedCallback( void (*SessionsUpdatedCallback)(void* pParam), void* pSearchParam ); virtual void GetFullFriendSessionInfo( FriendSessionInfo *foundSession, void (* FriendSessionUpdatedFn)(bool success, void *pParam), void *pParam ); virtual void ForceFriendsSessionRefresh(); diff --git a/src/client/Common/Network/Sony/SonyCommerce.cpp b/src/client/Common/Network/Sony/SonyCommerce.cpp index 27e4eaf1..c6b76c7c 100644 --- a/src/client/Common/Network/Sony/SonyCommerce.cpp +++ b/src/client/Common/Network/Sony/SonyCommerce.cpp @@ -9,7 +9,7 @@ bool SonyCommerce::m_bCommerceInitialised = false; SceNpCommerce2SessionInfo SonyCommerce::m_sessionInfo; SonyCommerce::State SonyCommerce::m_state = e_state_noSession; int SonyCommerce::m_errorCode = 0; -LPVOID SonyCommerce::m_callbackParam = NULL; +void* SonyCommerce::m_callbackParam = NULL; void* SonyCommerce::m_receiveBuffer = NULL; SonyCommerce::Event SonyCommerce::m_event; @@ -29,7 +29,7 @@ sys_memory_container_t SonyCommerce::m_memContainer = SYS_MEMORY_CONTAINER_I bool SonyCommerce::m_bUpgradingTrial = false; SonyCommerce::CallbackFunc SonyCommerce::m_trialUpgradeCallbackFunc; -LPVOID SonyCommerce::m_trialUpgradeCallbackParam; +void* SonyCommerce::m_trialUpgradeCallbackParam; CRITICAL_SECTION SonyCommerce::m_queueLock; @@ -81,7 +81,7 @@ void SonyCommerce::Init() -void SonyCommerce::CheckForTrialUpgradeKey_Callback(LPVOID param, bool bFullVersion) +void SonyCommerce::CheckForTrialUpgradeKey_Callback(void* param, bool bFullVersion) { ProfileManager.SetFullVersion(bFullVersion); if(ProfileManager.IsFullVersion()) @@ -798,20 +798,20 @@ int SonyCommerce::downloadList(DownloadListInputParams ¶ms) return CELL_OK; } -void SonyCommerce::UpgradeTrialCallback2(LPVOID lpParam,int err) +void SonyCommerce::UpgradeTrialCallback2(void* lpParam,int err) { app.DebugPrintf(4,"SonyCommerce_UpgradeTrialCallback2 : err : 0x%08x\n", err); SonyCommerce::CheckForTrialUpgradeKey(); if(err != CELL_OK) { - UINT uiIDA[1]; + unsigned int uiIDA[1]; uiIDA[0]=IDS_CONFIRM_OK; C4JStorage::EMessageResult result = ui.RequestMessageBox( IDS_PRO_UNLOCKGAME_TITLE, IDS_NO_DLCOFFERS, uiIDA,1,ProfileManager.GetPrimaryPad()); } m_trialUpgradeCallbackFunc(m_trialUpgradeCallbackParam, m_errorCode); } -void SonyCommerce::UpgradeTrialCallback1(LPVOID lpParam,int err) +void SonyCommerce::UpgradeTrialCallback1(void* lpParam,int err) { app.DebugPrintf(4,"SonyCommerce_UpgradeTrialCallback1 : err : 0x%08x\n", err); @@ -831,7 +831,7 @@ void SonyCommerce::UpgradeTrialCallback1(LPVOID lpParam,int err) } else { - UINT uiIDA[1]; + unsigned int uiIDA[1]; uiIDA[0]=IDS_CONFIRM_OK; C4JStorage::EMessageResult result = ui.RequestMessageBox( IDS_PRO_UNLOCKGAME_TITLE, IDS_NO_DLCOFFERS, uiIDA,1,ProfileManager.GetPrimaryPad()); m_trialUpgradeCallbackFunc(m_trialUpgradeCallbackParam, m_errorCode); @@ -847,7 +847,7 @@ void SonyCommerce_UpgradeTrial() app.UpgradeTrial(); } -void SonyCommerce::UpgradeTrial(CallbackFunc cb, LPVOID lpParam) +void SonyCommerce::UpgradeTrial(CallbackFunc cb, void* lpParam) { m_trialUpgradeCallbackFunc = cb; m_trialUpgradeCallbackParam = lpParam; @@ -1383,7 +1383,7 @@ int SonyCommerce::commerceEnd() return ret; } -void SonyCommerce::CreateSession( CallbackFunc cb, LPVOID lpParam ) +void SonyCommerce::CreateSession( CallbackFunc cb, void* lpParam ) { Init(); EnterCriticalSection(&m_queueLock); @@ -1406,7 +1406,7 @@ void SonyCommerce::CloseSession() Shutdown(); } -void SonyCommerce::GetProductList( CallbackFunc cb, LPVOID lpParam, std::vector* productList, const char *categoryId) +void SonyCommerce::GetProductList( CallbackFunc cb, void* lpParam, std::vector* productList, const char *categoryId) { EnterCriticalSection(&m_queueLock); setCallback(cb,lpParam); @@ -1416,7 +1416,7 @@ void SonyCommerce::GetProductList( CallbackFunc cb, LPVOID lpParam, std::vector< LeaveCriticalSection(&m_queueLock); } -void SonyCommerce::GetDetailedProductInfo( CallbackFunc cb, LPVOID lpParam, ProductInfoDetailed* productInfo, const char *productId, const char *categoryId ) +void SonyCommerce::GetDetailedProductInfo( CallbackFunc cb, void* lpParam, ProductInfoDetailed* productInfo, const char *productId, const char *categoryId ) { EnterCriticalSection(&m_queueLock); setCallback(cb,lpParam); @@ -1428,7 +1428,7 @@ void SonyCommerce::GetDetailedProductInfo( CallbackFunc cb, LPVOID lpParam, Prod } // 4J-PB - fill out the long description and the price for the product -void SonyCommerce::AddDetailedProductInfo( CallbackFunc cb, LPVOID lpParam, ProductInfo* productInfo, const char *productId, const char *categoryId ) +void SonyCommerce::AddDetailedProductInfo( CallbackFunc cb, void* lpParam, ProductInfo* productInfo, const char *productId, const char *categoryId ) { EnterCriticalSection(&m_queueLock); setCallback(cb,lpParam); @@ -1438,7 +1438,7 @@ void SonyCommerce::AddDetailedProductInfo( CallbackFunc cb, LPVOID lpParam, Prod m_messageQueue.push(e_message_commerceAddDetailedProductInfo); LeaveCriticalSection(&m_queueLock); } -void SonyCommerce::GetCategoryInfo( CallbackFunc cb, LPVOID lpParam, CategoryInfo *info, const char *categoryId ) +void SonyCommerce::GetCategoryInfo( CallbackFunc cb, void* lpParam, CategoryInfo *info, const char *categoryId ) { EnterCriticalSection(&m_queueLock); setCallback(cb,lpParam); @@ -1448,7 +1448,7 @@ void SonyCommerce::GetCategoryInfo( CallbackFunc cb, LPVOID lpParam, CategoryInf LeaveCriticalSection(&m_queueLock); } -void SonyCommerce::Checkout( CallbackFunc cb, LPVOID lpParam, const char* skuID ) +void SonyCommerce::Checkout( CallbackFunc cb, void* lpParam, const char* skuID ) { if(m_memContainer != SYS_MEMORY_CONTAINER_ID_INVALID) { @@ -1469,7 +1469,7 @@ void SonyCommerce::Checkout( CallbackFunc cb, LPVOID lpParam, const char* skuID LeaveCriticalSection(&m_queueLock); } -void SonyCommerce::DownloadAlreadyPurchased( CallbackFunc cb, LPVOID lpParam, const char* skuID ) +void SonyCommerce::DownloadAlreadyPurchased( CallbackFunc cb, void* lpParam, const char* skuID ) { if(m_memContainer != SYS_MEMORY_CONTAINER_ID_INVALID) return; diff --git a/src/client/Common/Network/Sony/SonyCommerce.h b/src/client/Common/Network/Sony/SonyCommerce.h index 6df04947..8b0e2e4d 100644 --- a/src/client/Common/Network/Sony/SonyCommerce.h +++ b/src/client/Common/Network/Sony/SonyCommerce.h @@ -43,7 +43,7 @@ class SonyCommerce { public: - typedef void (*CallbackFunc)(LPVOID lpParam, int error_code); + typedef void (*CallbackFunc)(void* lpParam, int error_code); /// @brief @@ -153,20 +153,20 @@ public: public: - virtual void CreateSession(CallbackFunc cb, LPVOID lpParam) = 0; + virtual void CreateSession(CallbackFunc cb, void* lpParam) = 0; virtual void CloseSession() = 0; - virtual void GetCategoryInfo(CallbackFunc cb, LPVOID lpParam, CategoryInfo *info, const char *categoryId) = 0; - virtual void GetProductList(CallbackFunc cb, LPVOID lpParam, std::vector* productList, const char *categoryId) = 0; - virtual void GetDetailedProductInfo(CallbackFunc cb, LPVOID lpParam, ProductInfoDetailed* productInfoDetailed, const char *productId, const char *categoryId) = 0; - virtual void AddDetailedProductInfo( CallbackFunc cb, LPVOID lpParam, ProductInfo* productInfo, const char *productId, const char *categoryId ) = 0; - virtual void Checkout(CallbackFunc cb, LPVOID lpParam, const char* skuID) = 0; - virtual void DownloadAlreadyPurchased(CallbackFunc cb, LPVOID lpParam, const char* skuID) = 0; + virtual void GetCategoryInfo(CallbackFunc cb, void* lpParam, CategoryInfo *info, const char *categoryId) = 0; + virtual void GetProductList(CallbackFunc cb, void* lpParam, std::vector* productList, const char *categoryId) = 0; + virtual void GetDetailedProductInfo(CallbackFunc cb, void* lpParam, ProductInfoDetailed* productInfoDetailed, const char *productId, const char *categoryId) = 0; + virtual void AddDetailedProductInfo( CallbackFunc cb, void* lpParam, ProductInfo* productInfo, const char *productId, const char *categoryId ) = 0; + virtual void Checkout(CallbackFunc cb, void* lpParam, const char* skuID) = 0; + virtual void DownloadAlreadyPurchased(CallbackFunc cb, void* lpParam, const char* skuID) = 0; #if defined(__ORBIS__) || defined( __PSVITA__) - virtual void Checkout_Game(CallbackFunc cb, LPVOID lpParam, const char* skuID) = 0; - virtual void DownloadAlreadyPurchased_Game(CallbackFunc cb, LPVOID lpParam, const char* skuID) = 0; + virtual void Checkout_Game(CallbackFunc cb, void* lpParam, const char* skuID) = 0; + virtual void DownloadAlreadyPurchased_Game(CallbackFunc cb, void* lpParam, const char* skuID) = 0; #endif - virtual void UpgradeTrial(CallbackFunc cb, LPVOID lpParam) = 0; + virtual void UpgradeTrial(CallbackFunc cb, void* lpParam) = 0; virtual void CheckForTrialUpgradeKey() = 0; virtual bool LicenseChecked() = 0; diff --git a/src/client/Common/Network/Sony/SonyRemoteStorage.cpp b/src/client/Common/Network/Sony/SonyRemoteStorage.cpp index ccb1957d..303cf3b4 100644 --- a/src/client/Common/Network/Sony/SonyRemoteStorage.cpp +++ b/src/client/Common/Network/Sony/SonyRemoteStorage.cpp @@ -21,12 +21,12 @@ static SceRemoteStorageStatus statParams; -// void remoteStorageGetCallback(LPVOID lpParam, SonyRemoteStorage::Status s, int error_code) +// void remoteStorageGetCallback(void* lpParam, SonyRemoteStorage::Status s, int error_code) // { // app.DebugPrintf("remoteStorageGetCallback err : 0x%08x\n"); // } // -// void remoteStorageCallback(LPVOID lpParam, SonyRemoteStorage::Status s, int error_code) +// void remoteStorageCallback(void* lpParam, SonyRemoteStorage::Status s, int error_code) // { // app.DebugPrintf("remoteStorageCallback err : 0x%08x\n"); // @@ -40,7 +40,7 @@ static SceRemoteStorageStatus statParams; -void getSaveInfoReturnCallback(LPVOID lpParam, SonyRemoteStorage::Status s, int error_code) +void getSaveInfoReturnCallback(void* lpParam, SonyRemoteStorage::Status s, int error_code) { SonyRemoteStorage* pRemoteStorage = (SonyRemoteStorage*)lpParam; app.DebugPrintf("remoteStorageGetInfoCallback err : 0x%08x\n", error_code); @@ -65,7 +65,7 @@ void getSaveInfoReturnCallback(LPVOID lpParam, SonyRemoteStorage::Status s, int -static void getSaveInfoInitCallback(LPVOID lpParam, SonyRemoteStorage::Status s, int error_code) +static void getSaveInfoInitCallback(void* lpParam, SonyRemoteStorage::Status s, int error_code) { SonyRemoteStorage* pRemoteStorage = (SonyRemoteStorage*)lpParam; if(error_code != 0) @@ -101,7 +101,7 @@ void SonyRemoteStorage::getSaveInfo() m_getInfoStatus = e_noInfoFound; } -bool SonyRemoteStorage::getSaveData( const char* localDirname, CallbackFunc cb, LPVOID lpParam ) +bool SonyRemoteStorage::getSaveData( const char* localDirname, CallbackFunc cb, void* lpParam ) { m_startTime = System::currentTimeMillis(); m_dataProgress = 0; @@ -109,7 +109,7 @@ bool SonyRemoteStorage::getSaveData( const char* localDirname, CallbackFunc cb, } -static void setSaveDataInitCallback(LPVOID lpParam, SonyRemoteStorage::Status s, int error_code) +static void setSaveDataInitCallback(void* lpParam, SonyRemoteStorage::Status s, int error_code) { SonyRemoteStorage* pRemoteStorage = (SonyRemoteStorage*)lpParam; if(error_code != 0) @@ -161,7 +161,7 @@ ESavePlatform SonyRemoteStorage::getSavePlatform() } -__int64 SonyRemoteStorage::getSaveSeed() +int64_t SonyRemoteStorage::getSaveSeed() { if(m_getInfoStatus != e_infoFound) return 0; @@ -171,7 +171,7 @@ __int64 SonyRemoteStorage::getSaveSeed() ZeroMemory(seedString,17); memcpy(seedString, pDescData->m_seed,16); - __uint64 seed = 0; + uint64_t seed = 0; std::stringstream ss; ss << seedString; ss >> std::hex >> seed; @@ -227,7 +227,7 @@ int SonyRemoteStorage::getSaveFilesize() } -bool SonyRemoteStorage::setData( PSAVE_INFO info, CallbackFunc cb, LPVOID lpParam ) +bool SonyRemoteStorage::setData( PSAVE_INFO info, CallbackFunc cb, void* lpParam ) { m_setDataSaveInfo = info; m_callbackFunc = cb; @@ -238,7 +238,7 @@ bool SonyRemoteStorage::setData( PSAVE_INFO info, CallbackFunc cb, LPVOID lpPara return true; } -int SonyRemoteStorage::LoadSaveDataThumbnailReturned(LPVOID lpParam,PBYTE pbThumbnail,DWORD dwThumbnailBytes) +int SonyRemoteStorage::LoadSaveDataThumbnailReturned(void* lpParam,uint8_t* pbThumbnail,unsigned long dwThumbnailBytes) { SonyRemoteStorage *pClass= (SonyRemoteStorage *)lpParam; @@ -294,7 +294,7 @@ bool SonyRemoteStorage::saveIsAvailable() int SonyRemoteStorage::getDataProgress() { - __int64 time = System::currentTimeMillis(); + int64_t time = System::currentTimeMillis(); int elapsedSecs = (time - m_startTime) / 1000; int progVal = m_dataProgress + (elapsedSecs/3); if(progVal > 95) diff --git a/src/client/Common/Network/Sony/SonyRemoteStorage.h b/src/client/Common/Network/Sony/SonyRemoteStorage.h index 5d92a0b5..52891847 100644 --- a/src/client/Common/Network/Sony/SonyRemoteStorage.h +++ b/src/client/Common/Network/Sony/SonyRemoteStorage.h @@ -20,7 +20,7 @@ public: e_getStatusInProgress, e_getStatusSucceeded }; - typedef void (*CallbackFunc)(LPVOID lpParam, Status s, int error_code); + typedef void (*CallbackFunc)(void* lpParam, Status s, int error_code); enum GetInfoStatus { @@ -64,7 +64,7 @@ public: bool saveIsAvailable(); int getSaveFilesize(); - bool getSaveData(const char* localDirname, CallbackFunc cb, LPVOID lpParam); + bool getSaveData(const char* localDirname, CallbackFunc cb, void* lpParam); bool setSaveData(PSAVE_INFO info, CallbackFunc cb, void* lpParam); bool waitingForSetData() { return (m_setDataStatus == e_settingData); } @@ -72,15 +72,15 @@ public: const char* getLocalFilename(); const char* getSaveNameUTF8(); ESavePlatform getSavePlatform(); - __int64 getSaveSeed(); + int64_t getSaveSeed(); unsigned int getSaveHostOptions(); unsigned int getSaveTexturePack(); void SetServiceID(char *pchServiceID) { m_pchServiceID=pchServiceID; } - virtual bool init(CallbackFunc cb, LPVOID lpParam) = 0; - virtual bool getRemoteFileInfo(SceRemoteStorageStatus* pInfo, CallbackFunc cb, LPVOID lpParam) = 0; - virtual bool getData(const char* remotePath, const char* localPath, CallbackFunc cb, LPVOID lpParam) = 0; + virtual bool init(CallbackFunc cb, void* lpParam) = 0; + virtual bool getRemoteFileInfo(SceRemoteStorageStatus* pInfo, CallbackFunc cb, void* lpParam) = 0; + virtual bool getData(const char* remotePath, const char* localPath, CallbackFunc cb, void* lpParam) = 0; virtual void abort() = 0; virtual bool shutdown(); virtual bool setDataInternal() = 0; @@ -93,8 +93,8 @@ public: - bool setData( PSAVE_INFO info, CallbackFunc cb, LPVOID lpParam ); - static int LoadSaveDataThumbnailReturned(LPVOID lpParam,PBYTE pbThumbnail,DWORD dwThumbnailBytes); + bool setData( PSAVE_INFO info, CallbackFunc cb, void* lpParam ); + static int LoadSaveDataThumbnailReturned(void* lpParam,uint8_t* pbThumbnail,unsigned long dwThumbnailBytes); static int setDataThread(void* lpParam); SonyRemoteStorage() : m_memPoolBuffer(NULL), m_bInitialised(false),m_getInfoStatus(e_noInfoFound) {} @@ -107,11 +107,11 @@ protected: int m_dataProgress; char *m_pchServiceID; - PBYTE m_thumbnailData; + uint8_t* m_thumbnailData; unsigned int m_thumbnailDataSize; C4JThread* m_SetDataThread; PSAVE_INFO m_setDataSaveInfo; - __int64 m_startTime; + int64_t m_startTime; bool m_bAborting; bool m_bTransferStarted; diff --git a/src/client/Common/Telemetry/TelemetryManager.cpp b/src/client/Common/Telemetry/TelemetryManager.cpp index 8d30af0d..29bc0486 100644 --- a/src/client/Common/Telemetry/TelemetryManager.cpp +++ b/src/client/Common/Telemetry/TelemetryManager.cpp @@ -14,17 +14,17 @@ CTelemetryManager *TelemetryManager = new CTelemetryManager(); #endif -HRESULT CTelemetryManager::Init() +int CTelemetryManager::Init() { return S_OK; } -HRESULT CTelemetryManager::Tick() +int CTelemetryManager::Tick() { return S_OK; } -HRESULT CTelemetryManager::Flush() +int CTelemetryManager::Flush() { return S_OK; } @@ -146,9 +146,9 @@ Title needs to track this and report it as a property. These times will be used to create timelines and understand durations. This should be tracked independently of saved games (restoring a save should not reset the seconds since initialize) */ -INT CTelemetryManager::GetSecondsSinceInitialize() +int CTelemetryManager::GetSecondsSinceInitialize() { - return (INT)(app.getAppTime() - m_initialiseTime); + return (int)(app.getAppTime() - m_initialiseTime); } /* @@ -159,9 +159,9 @@ The intent is to allow teams to capture data on the highest level categories of For example, a game mode could be the name of the specific mini game (eg: golf vs darts) or a specific multiplayer mode (eg: hoard vs beast.) ModeID = 0 means undefined or unknown. The intent is to answer the question "How are players playing your game?" */ -INT CTelemetryManager::GetMode(DWORD dwUserId) +int CTelemetryManager::GetMode(unsigned long dwUserId) { - INT mode = (INT)eTelem_ModeId_Undefined; + int mode = (int)eTelem_ModeId_Undefined; Minecraft *pMinecraft = Minecraft::GetInstance(); @@ -171,15 +171,15 @@ INT CTelemetryManager::GetMode(DWORD dwUserId) if (gameType->isSurvival()) { - mode = (INT)eTelem_ModeId_Survival; + mode = (int)eTelem_ModeId_Survival; } else if (gameType->isCreative()) { - mode = (INT)eTelem_ModeId_Creative; + mode = (int)eTelem_ModeId_Creative; } else { - mode = (INT)eTelem_ModeId_Undefined; + mode = (int)eTelem_ModeId_Undefined; } } return mode; @@ -192,17 +192,17 @@ For titles that have sub-modes (Sports/Football). Mode is always an indicator of "How is the player choosing to play my game?" so these do not have to be consecutive. LevelIDs and SubLevelIDs can be reused as they will always be paired with a Mode/SubModeID, Mode should be unique - SubMode can be shared between modes. */ -INT CTelemetryManager::GetSubMode(DWORD dwUserId) +int CTelemetryManager::GetSubMode(unsigned long dwUserId) { - INT subMode = (INT)eTelem_SubModeId_Undefined; + int subMode = (int)eTelem_SubModeId_Undefined; if(Minecraft::GetInstance()->isTutorial()) { - subMode = (INT)eTelem_SubModeId_Tutorial; + subMode = (int)eTelem_SubModeId_Tutorial; } else { - subMode = (INT)eTelem_SubModeId_Normal; + subMode = (int)eTelem_SubModeId_Normal; } return subMode; @@ -216,11 +216,11 @@ The intent is that level start and ends do not occur more than every 2 minutes o Levels are unique only within a given modeID - so you can have a ModeID =1, LevelID =1 and a different ModeID=2, LevelID = 1 indicate two completely different levels. LevelID = 0 means undefined or unknown. */ -INT CTelemetryManager::GetLevelId(DWORD dwUserId) +int CTelemetryManager::GetLevelId(unsigned long dwUserId) { - INT levelId = (INT)eTelem_LevelId_Undefined; + int levelId = (int)eTelem_LevelId_Undefined; - levelId = (INT)eTelem_LevelId_PlayerGeneratedLevel; + levelId = (int)eTelem_LevelId_PlayerGeneratedLevel; return levelId; } @@ -231,9 +231,9 @@ For titles that have sub-levels. Level is always an indicator of "How far has the player progressed." so when possible these should be consecutive or at least monotonically increasing. LevelIDs and SubLevelIDs can be reused as they will always be paired with a Mode/SubModeID */ -INT CTelemetryManager::GetSubLevelId(DWORD dwUserId) +int CTelemetryManager::GetSubLevelId(unsigned long dwUserId) { - INT subLevelId = (INT)eTelem_SubLevelId_Undefined; + int subLevelId = (int)eTelem_SubLevelId_Undefined; Minecraft *pMinecraft = Minecraft::GetInstance(); @@ -242,13 +242,13 @@ INT CTelemetryManager::GetSubLevelId(DWORD dwUserId) switch(pMinecraft->localplayers[dwUserId]->dimension) { case 0: - subLevelId = (INT)eTelem_SubLevelId_Overworld; + subLevelId = (int)eTelem_SubLevelId_Overworld; break; case -1: - subLevelId = (INT)eTelem_SubLevelId_Nether; + subLevelId = (int)eTelem_SubLevelId_Nether; break; case 1: - subLevelId = (INT)eTelem_SubLevelId_End; + subLevelId = (int)eTelem_SubLevelId_End; break; }; } @@ -260,9 +260,9 @@ INT CTelemetryManager::GetSubLevelId(DWORD dwUserId) Build version of the title, used to track changes in development as well as patches/title updates Allows developer to separate out stats from different builds */ -INT CTelemetryManager::GetTitleBuildId() +int CTelemetryManager::GetTitleBuildId() { - return (INT)VER_PRODUCTBUILD; + return (int)VER_PRODUCTBUILD; } /* @@ -270,32 +270,32 @@ Generated by the game every time LevelStart or LevelResume is called. This should be a unique ID (can be sequential) within a session. Helps differentiate level attempts when a play plays the same mode/level - especially with aggregated stats */ -INT CTelemetryManager::GetLevelInstanceID() +int CTelemetryManager::GetLevelInstanceID() { - return (INT)m_levelInstanceID; + return (int)m_levelInstanceID; } /* MultiplayerinstanceID is a title-generated value that is the same for all players in the same multiplayer session. Link up players into a single multiplayer session ID. */ -INT CTelemetryManager::GetMultiplayerInstanceID() +int CTelemetryManager::GetMultiplayerInstanceID() { return m_multiplayerInstanceID; } -INT CTelemetryManager::GenerateMultiplayerInstanceId() +int CTelemetryManager::GenerateMultiplayerInstanceId() { #if defined(_DURANGO) || defined(_XBOX) FILETIME SystemTimeAsFileTime; GetSystemTimeAsFileTime( &SystemTimeAsFileTime ); - return *((INT *)&SystemTimeAsFileTime.dwLowDateTime); + return *((int *)&SystemTimeAsFileTime.dwLowDateTime); #else return 0; #endif } -void CTelemetryManager::SetMultiplayerInstanceId(INT value) +void CTelemetryManager::SetMultiplayerInstanceId(int value) { m_multiplayerInstanceID = value; } @@ -304,9 +304,9 @@ void CTelemetryManager::SetMultiplayerInstanceId(INT value) Indicates whether the game is being played in single or multiplayer mode and whether multiplayer is being played locally or over live. How social is your game? How do people play it? */ -INT CTelemetryManager::GetSingleOrMultiplayer() +int CTelemetryManager::GetSingleOrMultiplayer() { - INT singleOrMultiplayer = (INT)eSen_SingleOrMultiplayer_Undefined; + int singleOrMultiplayer = (int)eSen_SingleOrMultiplayer_Undefined; // Unused //eSen_SingleOrMultiplayer_Single_Player @@ -314,19 +314,19 @@ INT CTelemetryManager::GetSingleOrMultiplayer() if(app.GetLocalPlayerCount() == 1 && g_NetworkManager.GetOnlinePlayerCount() == 0) { - singleOrMultiplayer = (INT)eSen_SingleOrMultiplayer_Single_Player; + singleOrMultiplayer = (int)eSen_SingleOrMultiplayer_Single_Player; } else if(app.GetLocalPlayerCount() > 1 && g_NetworkManager.GetOnlinePlayerCount() == 0) { - singleOrMultiplayer = (INT)eSen_SingleOrMultiplayer_Multiplayer_Local; + singleOrMultiplayer = (int)eSen_SingleOrMultiplayer_Multiplayer_Local; } else if(app.GetLocalPlayerCount() == 1 && g_NetworkManager.GetOnlinePlayerCount() > 0) { - singleOrMultiplayer = (INT)eSen_SingleOrMultiplayer_Multiplayer_Live; + singleOrMultiplayer = (int)eSen_SingleOrMultiplayer_Multiplayer_Live; } else if(app.GetLocalPlayerCount() > 1 && g_NetworkManager.GetOnlinePlayerCount() > 0) { - singleOrMultiplayer = (INT)eSen_SingleOrMultiplayer_Multiplayer_Both_Local_and_Live; + singleOrMultiplayer = (int)eSen_SingleOrMultiplayer_Multiplayer_Both_Local_and_Live; } return singleOrMultiplayer; @@ -336,23 +336,23 @@ INT CTelemetryManager::GetSingleOrMultiplayer() An in-game setting that differentiates the challenge imposed on the user. Normalized to a standard 5-point scale. Are players changing the difficulty? */ -INT CTelemetryManager::GetDifficultyLevel(INT diff) +int CTelemetryManager::GetDifficultyLevel(int diff) { - INT difficultyLevel = (INT)eSen_DifficultyLevel_Undefined; + int difficultyLevel = (int)eSen_DifficultyLevel_Undefined; switch(diff) { case 0: - difficultyLevel = (INT)eSen_DifficultyLevel_Easiest; + difficultyLevel = (int)eSen_DifficultyLevel_Easiest; break; case 1: - difficultyLevel = (INT)eSen_DifficultyLevel_Easier; + difficultyLevel = (int)eSen_DifficultyLevel_Easier; break; case 2: - difficultyLevel = (INT)eSen_DifficultyLevel_Normal; + difficultyLevel = (int)eSen_DifficultyLevel_Normal; break; case 3: - difficultyLevel = (INT)eSen_DifficultyLevel_Harder; + difficultyLevel = (int)eSen_DifficultyLevel_Harder; break; } @@ -366,17 +366,17 @@ INT CTelemetryManager::GetDifficultyLevel(INT diff) Differentiates trial/demo from full purchased titles Is this a full title or demo? */ -INT CTelemetryManager::GetLicense() +int CTelemetryManager::GetLicense() { - INT license = eSen_License_Undefined; + int license = eSen_License_Undefined; if(ProfileManager.IsFullVersion()) { - license = (INT)eSen_License_Full_Purchased_Title; + license = (int)eSen_License_Full_Purchased_Title; } else { - license = (INT)eSen_License_Trial_or_Demo; + license = (int)eSen_License_Trial_or_Demo; } return license; } @@ -385,9 +385,9 @@ INT CTelemetryManager::GetLicense() This is intended to capture whether players played using default control scheme or customized the control scheme. Are players customizing your controls? */ -INT CTelemetryManager::GetDefaultGameControls() +int CTelemetryManager::GetDefaultGameControls() { - INT defaultGameControls = eSen_DefaultGameControls_Undefined; + int defaultGameControls = eSen_DefaultGameControls_Undefined; // Unused //eSen_DefaultGameControls_Custom_controls @@ -401,25 +401,25 @@ INT CTelemetryManager::GetDefaultGameControls() Are players changing default audio settings? This is intended to capture whether players are playing with or without volume and whether they make changes from the default audio settings. */ -INT CTelemetryManager::GetAudioSettings(DWORD dwUserId) +int CTelemetryManager::GetAudioSettings(unsigned long dwUserId) { - INT audioSettings = (INT)eSen_AudioSettings_Undefined; + int audioSettings = (int)eSen_AudioSettings_Undefined; if(dwUserId == ProfileManager.GetPrimaryPad()) { - BYTE volume = app.GetGameSettings(dwUserId,eGameSetting_SoundFXVolume); + uint8_t volume = app.GetGameSettings(dwUserId,eGameSetting_SoundFXVolume); if(volume == 0) { - audioSettings = (INT)eSen_AudioSettings_Off; + audioSettings = (int)eSen_AudioSettings_Off; } else if(volume == DEFAULT_VOLUME_LEVEL) { - audioSettings = (INT)eSen_AudioSettings_On_Default; + audioSettings = (int)eSen_AudioSettings_On_Default; } else { - audioSettings = (INT)eSen_AudioSettings_On_CustomSetting; + audioSettings = (int)eSen_AudioSettings_On_CustomSetting; } } return audioSettings; @@ -431,7 +431,7 @@ For example, a performance metric could points earned, race time, total kills, e This is entirely up to you and will help us understand how well the player performed, or how far the player progressed �in the level before exiting. How far did users progress before failing/exiting the level? */ -INT CTelemetryManager::GetLevelExitProgressStat1() +int CTelemetryManager::GetLevelExitProgressStat1() { // 4J Stu - Unused return 0; @@ -443,7 +443,7 @@ For example, a performance metric could points earned, race time, total kills, e This is entirely up to you and will help us understand how well the player performed, or how far the player progressed �in the level before exiting. How far did users progress before failing/exiting the level? */ -INT CTelemetryManager::GetLevelExitProgressStat2() +int CTelemetryManager::GetLevelExitProgressStat2() { // 4J Stu - Unused return 0; diff --git a/src/client/Common/Telemetry/TelemetryManager.h b/src/client/Common/Telemetry/TelemetryManager.h index 853b9d36..ec47db5d 100644 --- a/src/client/Common/Telemetry/TelemetryManager.h +++ b/src/client/Common/Telemetry/TelemetryManager.h @@ -5,9 +5,9 @@ class CTelemetryManager { public: - virtual HRESULT Init(); - virtual HRESULT Tick(); - virtual HRESULT Flush(); + virtual int Init(); + virtual int Tick(); + virtual int Flush(); virtual bool RecordPlayerSessionStart(int iPad); virtual bool RecordPlayerSessionExit(int iPad, int exitStatus); @@ -42,24 +42,24 @@ protected: float m_fLevelStartTime[XUSER_MAX_COUNT]; - INT m_multiplayerInstanceID; - DWORD m_levelInstanceID; + int m_multiplayerInstanceID; + unsigned long m_levelInstanceID; // Helper functions to get the various common settings - INT GetSecondsSinceInitialize(); - INT GetMode(DWORD dwUserId); - INT GetSubMode(DWORD dwUserId); - INT GetLevelId(DWORD dwUserId); - INT GetSubLevelId(DWORD dwUserId); - INT GetTitleBuildId(); - INT GetLevelInstanceID(); - INT GetSingleOrMultiplayer(); - INT GetDifficultyLevel(INT diff); - INT GetLicense(); - INT GetDefaultGameControls(); - INT GetAudioSettings(DWORD dwUserId); - INT GetLevelExitProgressStat1(); - INT GetLevelExitProgressStat2(); + int GetSecondsSinceInitialize(); + int GetMode(unsigned long dwUserId); + int GetSubMode(unsigned long dwUserId); + int GetLevelId(unsigned long dwUserId); + int GetSubLevelId(unsigned long dwUserId); + int GetTitleBuildId(); + int GetLevelInstanceID(); + int GetSingleOrMultiplayer(); + int GetDifficultyLevel(int diff); + int GetLicense(); + int GetDefaultGameControls(); + int GetAudioSettings(unsigned long dwUserId); + int GetLevelExitProgressStat1(); + int GetLevelExitProgressStat2(); }; extern CTelemetryManager *TelemetryManager; \ No newline at end of file diff --git a/src/client/Common/Tutorial/ChangeStateConstraint.cpp b/src/client/Common/Tutorial/ChangeStateConstraint.cpp index 9f6d916e..6844b21d 100644 --- a/src/client/Common/Tutorial/ChangeStateConstraint.cpp +++ b/src/client/Common/Tutorial/ChangeStateConstraint.cpp @@ -9,7 +9,7 @@ #include "ClientConnection.h" #include "net.minecraft.network.packet.h" -ChangeStateConstraint::ChangeStateConstraint( Tutorial *tutorial, eTutorial_State targetState, eTutorial_State sourceStates[], DWORD sourceStatesCount, +ChangeStateConstraint::ChangeStateConstraint( Tutorial *tutorial, eTutorial_State targetState, eTutorial_State sourceStates[], unsigned long sourceStatesCount, double x0, double y0, double z0, double x1, double y1, double z1, bool contains /*= true*/, bool changeGameMode /*= false*/, GameType *targetGameMode /*= 0*/ ) : TutorialConstraint( -1 ) { @@ -73,7 +73,7 @@ void ChangeStateConstraint::tick(int iPad) bool inASourceState = false; Minecraft *minecraft = Minecraft::GetInstance(); - for(DWORD i = 0; i < m_sourceStatesCount; ++i) + for(unsigned long i = 0; i < m_sourceStatesCount; ++i) { if(m_sourceStates[i] == m_tutorial->getCurrentState()) { diff --git a/src/client/Common/Tutorial/ChangeStateConstraint.h b/src/client/Common/Tutorial/ChangeStateConstraint.h index 2156870d..58ab02c0 100644 --- a/src/client/Common/Tutorial/ChangeStateConstraint.h +++ b/src/client/Common/Tutorial/ChangeStateConstraint.h @@ -18,7 +18,7 @@ private: eTutorial_State m_targetState; eTutorial_State *m_sourceStates; - DWORD m_sourceStatesCount; + unsigned long m_sourceStatesCount; bool m_bHasChanged; eTutorial_State m_changedFromState; @@ -30,7 +30,7 @@ private: public: virtual ConstraintType getType() { return e_ConstraintChangeState; } - ChangeStateConstraint( Tutorial *tutorial, eTutorial_State targetState, eTutorial_State sourceStates[], DWORD sourceStatesCount, double x0, double y0, double z0, double x1, double y1, double z1, bool contains = true, bool changeGameMode = false, GameType *targetGameMode = NULL ); + ChangeStateConstraint( Tutorial *tutorial, eTutorial_State targetState, eTutorial_State sourceStates[], unsigned long sourceStatesCount, double x0, double y0, double z0, double x1, double y1, double z1, bool contains = true, bool changeGameMode = false, GameType *targetGameMode = NULL ); ~ChangeStateConstraint(); virtual void tick(int iPad); diff --git a/src/client/Common/Tutorial/Tutorial.cpp b/src/client/Common/Tutorial/Tutorial.cpp index aa5f2100..4897f1bd 100644 --- a/src/client/Common/Tutorial/Tutorial.cpp +++ b/src/client/Common/Tutorial/Tutorial.cpp @@ -1208,7 +1208,7 @@ void Tutorial::tick() } else if(m_freezeTime && m_timeFrozen && m_fullTutorialComplete) { - __int64 currentTime = pMinecraft->level->getTime(); + int64_t currentTime = pMinecraft->level->getTime(); int currentDayTime = (currentTime % Level::TICKS_PER_DAY); int timeToAdd = 0; if(currentDayTime > m_iTutorialFreezeTimeValue) @@ -1219,7 +1219,7 @@ void Tutorial::tick() { timeToAdd = m_iTutorialFreezeTimeValue - currentDayTime; } - __int64 targetTime = currentTime + timeToAdd; + int64_t targetTime = currentTime + timeToAdd; MinecraftServer::SetTimeOfDay(-1); MinecraftServer::SetTime(targetTime); pMinecraft->level->setOverrideTimeOfDay(-1); @@ -1634,7 +1634,7 @@ bool Tutorial::setMessage(TutorialHint *hint, PopupMessageDetails *message) bool hintsOn = m_isFullTutorial || (app.GetGameSettings(m_iPad,eGameSetting_Hints) && app.GetGameSettings(m_iPad,eGameSetting_DisplayHUD)); bool messageShown = false; - DWORD time = GetTickCount(); + unsigned long time = GetTickCount(); if(message != NULL && (message->m_forceDisplay || hintsOn) && (!message->m_delay || ( diff --git a/src/client/Common/Tutorial/Tutorial.h b/src/client/Common/Tutorial/Tutorial.h index aaaaba0a..1f09e604 100644 --- a/src/client/Common/Tutorial/Tutorial.h +++ b/src/client/Common/Tutorial/Tutorial.h @@ -93,8 +93,8 @@ protected: //D3DXVECTOR3 m_OriginalPosition; public: - DWORD lastMessageTime; - DWORD m_lastHintDisplayedTime; + unsigned long lastMessageTime; + unsigned long m_lastHintDisplayedTime; private: PopupMessageDetails *m_lastMessage; diff --git a/src/client/Common/Tutorial/TutorialEnum.h b/src/client/Common/Tutorial/TutorialEnum.h index 33f2e67d..4fb46033 100644 --- a/src/client/Common/Tutorial/TutorialEnum.h +++ b/src/client/Common/Tutorial/TutorialEnum.h @@ -1,14 +1,14 @@ #pragma once typedef struct { - WORD index; - DWORD diffsSize; - BYTE *diffs; - DWORD lastByteChanged; + uint16_t index; + unsigned long diffsSize; + uint8_t *diffs; + unsigned long lastByteChanged; } TutorialDiff_Chunk; typedef struct { - DWORD diffCount; + unsigned long diffCount; TutorialDiff_Chunk *diffs; } TutorialDiff_File; diff --git a/src/client/Common/Tutorial/TutorialMessage.cpp b/src/client/Common/Tutorial/TutorialMessage.cpp index 1f007035..706f43b9 100644 --- a/src/client/Common/Tutorial/TutorialMessage.cpp +++ b/src/client/Common/Tutorial/TutorialMessage.cpp @@ -11,7 +11,7 @@ bool TutorialMessage::canDisplay() return !limitRepeats || (timesShown < numRepeats); } -LPCWSTR TutorialMessage::getMessageForDisplay() +const wchar_t* TutorialMessage::getMessageForDisplay() { if(!canDisplay()) return L""; diff --git a/src/client/Common/Tutorial/TutorialMessage.h b/src/client/Common/Tutorial/TutorialMessage.h index 6a0b4d46..6afdccbf 100644 --- a/src/client/Common/Tutorial/TutorialMessage.h +++ b/src/client/Common/Tutorial/TutorialMessage.h @@ -10,11 +10,11 @@ private: bool limitRepeats; unsigned char numRepeats; unsigned char timesShown; - DWORD lastDisplayed; + unsigned long lastDisplayed; public: TutorialMessage(int messageId, bool limitRepeats = false, unsigned char numRepeats = TUTORIAL_MESSAGE_DEFAULT_SHOW); bool canDisplay(); - LPCWSTR getMessageForDisplay(); + const wchar_t* getMessageForDisplay(); }; \ No newline at end of file diff --git a/src/client/Common/UI/IUIController.h b/src/client/Common/UI/IUIController.h index 319185d8..c23585ba 100644 --- a/src/client/Common/UI/IUIController.h +++ b/src/client/Common/UI/IUIController.h @@ -27,7 +27,7 @@ public: virtual void CheckMenuDisplayed() = 0; virtual void SetTooltipText( unsigned int iPad, unsigned int tooltip, int iTextID ) = 0; - virtual void SetEnableTooltips( unsigned int iPad, BOOL bVal ) = 0; + virtual void SetEnableTooltips( unsigned int iPad, bool bVal ) = 0; virtual void ShowTooltip( unsigned int iPad, unsigned int tooltip, bool show ) = 0; virtual void SetTooltips( unsigned int iPad, int iA, int iB=-1, int iX=-1, int iY=-1 , int iLT=-1, int iRT=-1, int iLB=-1, int iRB=-1, int iLS=-1, bool forceUpdate = false) = 0; virtual void EnableTooltip( unsigned int iPad, unsigned int tooltip, bool enable ) = 0; diff --git a/src/client/Common/UI/IUIScene_AbstractContainerMenu.cpp b/src/client/Common/UI/IUIScene_AbstractContainerMenu.cpp index 9df85faf..1b594e96 100644 --- a/src/client/Common/UI/IUIScene_AbstractContainerMenu.cpp +++ b/src/client/Common/UI/IUIScene_AbstractContainerMenu.cpp @@ -205,7 +205,7 @@ void IUIScene_AbstractContainerMenu::SetToolTip( EToolTipButton eButton, EToolTi void IUIScene_AbstractContainerMenu::UpdateTooltips() { // Table gives us text id for tooltip. - static const DWORD kaToolTipextIds[ eNumToolTips ] = + static const unsigned long kaToolTipextIds[ eNumToolTips ] = { IDS_TOOLTIPS_PICKUPPLACE, //eToolTipPickupPlace_OLD IDS_TOOLTIPS_EXIT, // eToolTipExit @@ -232,7 +232,7 @@ void IUIScene_AbstractContainerMenu::UpdateTooltips() IDS_TOOLTIPS_REPAIR, // eToolTipRepair }; - BYTE focusUser = getPad(); + uint8_t focusUser = getPad(); for ( int i = 0; i < eToolTipNumButtons; ++i ) { @@ -1275,10 +1275,10 @@ bool IUIScene_AbstractContainerMenu::handleKeyDown(int iPad, int iAction, bool b #endif int buttonNum=0; // 0 = LeftMouse, 1 = RightMouse - BOOL quickKeyHeld=false; // Represents shift key on PC + bool quickKeyHeld=false; // Represents shift key on PC - BOOL validKeyPress = false; - //BOOL itemEditorKeyPress = false; + bool validKeyPress = false; + //bool itemEditorKeyPress = false; // Ignore input from other players //if(pMinecraft->player->GetXboxPad()!=pInputData->UserIndex) return S_OK; @@ -1483,7 +1483,7 @@ bool IUIScene_AbstractContainerMenu::handleKeyDown(int iPad, int iAction, bool b if( XuiIsInstanceOf( hFocusObjectParent, hClassCXuiCtrlSlotList ) ) { CXuiCtrlSlotList* slotList; - VOID *pObj; + void *pObj; XuiObjectFromHandle( hFocusObjectParent, &pObj ); slotList = (CXuiCtrlSlotList *)pObj; @@ -1500,7 +1500,7 @@ bool IUIScene_AbstractContainerMenu::handleKeyDown(int iPad, int iAction, bool b initData->menu = m_menu; // Add timer to poll controller stick input at 60Hz - HRESULT timerResult = KillTimer( POINTER_INPUT_TIMER_ID ); + int timerResult = KillTimer( POINTER_INPUT_TIMER_ID ); assert( timerResult == S_OK ); app.NavigateToScene(m_iPad,eUIScene_DebugItemEditor,(void *)initData,false,true); @@ -1518,12 +1518,12 @@ bool IUIScene_AbstractContainerMenu::handleKeyDown(int iPad, int iAction, bool b return bHandled; } -bool IUIScene_AbstractContainerMenu::handleValidKeyPress(int iUserIndex, int buttonNum, BOOL quickKeyHeld) +bool IUIScene_AbstractContainerMenu::handleValidKeyPress(int iUserIndex, int buttonNum, bool quickKeyHeld) { return false; } -void IUIScene_AbstractContainerMenu::handleOutsideClicked(int iPad, int buttonNum, BOOL quickKeyHeld) +void IUIScene_AbstractContainerMenu::handleOutsideClicked(int iPad, int buttonNum, bool quickKeyHeld) { // Drop items. @@ -1541,7 +1541,7 @@ void IUIScene_AbstractContainerMenu::handleAdditionalKeyPress(int iAction) // Do nothing } -void IUIScene_AbstractContainerMenu::handleSlotListClicked(ESceneSection eSection, int buttonNum, BOOL quickKeyHeld) +void IUIScene_AbstractContainerMenu::handleSlotListClicked(ESceneSection eSection, int buttonNum, bool quickKeyHeld) { int currentIndex = getCurrentIndex(eSection); diff --git a/src/client/Common/UI/IUIScene_AbstractContainerMenu.h b/src/client/Common/UI/IUIScene_AbstractContainerMenu.h index 9319b5d3..a72a64ec 100644 --- a/src/client/Common/UI/IUIScene_AbstractContainerMenu.h +++ b/src/client/Common/UI/IUIScene_AbstractContainerMenu.h @@ -187,11 +187,11 @@ protected: void onMouseTick(); bool handleKeyDown(int iPad, int iAction, bool bRepeat); - virtual bool handleValidKeyPress(int iUserIndex, int buttonNum, BOOL quickKeyHeld); - virtual void handleOutsideClicked(int iPad, int buttonNum, BOOL quickKeyHeld); + virtual bool handleValidKeyPress(int iUserIndex, int buttonNum, bool quickKeyHeld); + virtual void handleOutsideClicked(int iPad, int buttonNum, bool quickKeyHeld); virtual void handleOtherClicked(int iPad, ESceneSection eSection, int buttonNum, bool quickKey); virtual void handleAdditionalKeyPress(int iAction); - virtual void handleSlotListClicked(ESceneSection eSection, int buttonNum, BOOL quickKeyHeld); + virtual void handleSlotListClicked(ESceneSection eSection, int buttonNum, bool quickKeyHeld); virtual void handleSectionClick(ESceneSection eSection) = 0; void slotClicked(int slotId, int buttonNum, bool quickKey); int getCurrentIndex(ESceneSection eSection); diff --git a/src/client/Common/UI/IUIScene_AnvilMenu.cpp b/src/client/Common/UI/IUIScene_AnvilMenu.cpp index cb62cbd8..69ccbe3d 100644 --- a/src/client/Common/UI/IUIScene_AnvilMenu.cpp +++ b/src/client/Common/UI/IUIScene_AnvilMenu.cpp @@ -212,7 +212,7 @@ void IUIScene_AnvilMenu::handleTick() } else { - LPCWSTR costString = app.GetString(IDS_REPAIR_COST); + const wchar_t* costString = app.GetString(IDS_REPAIR_COST); wchar_t temp[256]; swprintf(temp, 256, costString, m_repairMenu->cost); m_costString = temp; diff --git a/src/client/Common/UI/IUIScene_CraftingMenu.cpp b/src/client/Common/UI/IUIScene_CraftingMenu.cpp index 90153220..72725847 100644 --- a/src/client/Common/UI/IUIScene_CraftingMenu.cpp +++ b/src/client/Common/UI/IUIScene_CraftingMenu.cpp @@ -28,7 +28,7 @@ Recipy::_eGroupType IUIScene_CraftingMenu::m_GroupTypeMapping9GridA[IUIScene_Cra }; -LPCWSTR IUIScene_CraftingMenu::m_GroupIconNameA[m_iMaxGroup3x3]= +const wchar_t* IUIScene_CraftingMenu::m_GroupIconNameA[m_iMaxGroup3x3]= { L"Structures",//Recipy::eGroupType_Structure, L"Tools",//Recipy::eGroupType_Tool, @@ -118,7 +118,7 @@ IUIScene_CraftingMenu::IUIScene_CraftingMenu() m_iIngredientsC=0; } -LPCWSTR IUIScene_CraftingMenu::GetGroupNameText(int iGroupType) +const wchar_t* IUIScene_CraftingMenu::GetGroupNameText(int iGroupType) { switch(iGroupType) { @@ -907,7 +907,7 @@ void IUIScene_CraftingMenu::UpdateHighlight() // special case for the torch coal/charcoal int id=pTempItemInstAdditional->getDescriptionId(); - LPCWSTR itemstring; + const wchar_t* itemstring; switch(id) { diff --git a/src/client/Common/UI/IUIScene_CraftingMenu.h b/src/client/Common/UI/IUIScene_CraftingMenu.h index 3a0d95cf..b1219db5 100644 --- a/src/client/Common/UI/IUIScene_CraftingMenu.h +++ b/src/client/Common/UI/IUIScene_CraftingMenu.h @@ -54,12 +54,12 @@ protected: int iVSlotIndexA[3]; // index of the v slots currently displayed - static LPCWSTR m_GroupIconNameA[m_iMaxGroup3x3]; + static const wchar_t* m_GroupIconNameA[m_iMaxGroup3x3]; static Recipy::_eGroupType m_GroupTypeMapping4GridA[m_iMaxGroup2x2]; static Recipy::_eGroupType m_GroupTypeMapping9GridA[m_iMaxGroup3x3]; Recipy::_eGroupType *m_pGroupA; - static LPCWSTR m_GroupTabNameA[3]; + static const wchar_t* m_GroupTabNameA[3]; static _eGroupTab m_GroupTabBkgMapping2x2A[m_iMaxGroup2x2]; static _eGroupTab m_GroupTabBkgMapping3x3A[m_iMaxGroup3x3]; _eGroupTab *m_pGroupTabA; @@ -78,7 +78,7 @@ public: IUIScene_CraftingMenu(); protected: - LPCWSTR GetGroupNameText(int iGroupType); + const wchar_t* GetGroupNameText(int iGroupType); void CheckRecipesAvailable(); void UpdateHighlight(); @@ -104,12 +104,12 @@ protected: virtual void setIngredientSlotRedBox(int index, bool show) = 0; virtual void setIngredientDescriptionItem(int iPad, int index, shared_ptr item) = 0; virtual void setIngredientDescriptionRedBox(int index, bool show) = 0; - virtual void setIngredientDescriptionText(int index, LPCWSTR text) = 0; + virtual void setIngredientDescriptionText(int index, const wchar_t* text) = 0; virtual void setShowCraftHSlot(int iIndex, bool show) = 0; virtual void showTabHighlight(int iIndex, bool show) = 0; - virtual void setGroupText(LPCWSTR text) = 0; - virtual void setDescriptionText(LPCWSTR text) = 0; - virtual void setItemText(LPCWSTR text) = 0; + virtual void setGroupText(const wchar_t* text) = 0; + virtual void setDescriptionText(const wchar_t* text) = 0; + virtual void setItemText(const wchar_t* text) = 0; virtual void scrollDescriptionUp() = 0; virtual void scrollDescriptionDown() = 0; virtual void updateHighlightAndScrollPositions() = 0; diff --git a/src/client/Common/UI/IUIScene_CreativeMenu.cpp b/src/client/Common/UI/IUIScene_CreativeMenu.cpp index e2b8a826..f3b4a7d7 100644 --- a/src/client/Common/UI/IUIScene_CreativeMenu.cpp +++ b/src/client/Common/UI/IUIScene_CreativeMenu.cpp @@ -602,7 +602,7 @@ void IUIScene_CreativeMenu::switchTab(ECreativeInventoryTabs tab) // 4J JEV - Tab Spec Struct -IUIScene_CreativeMenu::TabSpec::TabSpec(LPCWSTR icon, int descriptionId, int staticGroupsCount, ECreative_Inventory_Groups *staticGroups, int dynamicGroupsCount, ECreative_Inventory_Groups *dynamicGroups) +IUIScene_CreativeMenu::TabSpec::TabSpec(const wchar_t* icon, int descriptionId, int staticGroupsCount, ECreative_Inventory_Groups *staticGroups, int dynamicGroupsCount, ECreative_Inventory_Groups *dynamicGroups) : m_icon(icon), m_descriptionId(descriptionId), m_staticGroupsCount(staticGroupsCount), m_dynamicGroupsCount(dynamicGroupsCount) { @@ -786,7 +786,7 @@ IUIScene_AbstractContainerMenu::ESceneSection IUIScene_CreativeMenu::GetSectionA return newSection; } -bool IUIScene_CreativeMenu::handleValidKeyPress(int iPad, int buttonNum, BOOL quickKeyHeld) +bool IUIScene_CreativeMenu::handleValidKeyPress(int iPad, int buttonNum, bool quickKeyHeld) { // 4J Added - Make pressing the X button clear the hotbar if(buttonNum == 1) @@ -808,7 +808,7 @@ bool IUIScene_CreativeMenu::handleValidKeyPress(int iPad, int buttonNum, BOOL qu return false; } -void IUIScene_CreativeMenu::handleOutsideClicked(int iPad, int buttonNum, BOOL quickKeyHeld) +void IUIScene_CreativeMenu::handleOutsideClicked(int iPad, int buttonNum, bool quickKeyHeld) { // Drop items. Minecraft *pMinecraft = Minecraft::GetInstance(); @@ -882,7 +882,7 @@ void IUIScene_CreativeMenu::handleAdditionalKeyPress(int iAction) } } -void IUIScene_CreativeMenu::handleSlotListClicked(ESceneSection eSection, int buttonNum, BOOL quickKeyHeld) +void IUIScene_CreativeMenu::handleSlotListClicked(ESceneSection eSection, int buttonNum, bool quickKeyHeld) { int currentIndex = getCurrentIndex(eSection); diff --git a/src/client/Common/UI/IUIScene_CreativeMenu.h b/src/client/Common/UI/IUIScene_CreativeMenu.h index b9f9f235..d44f4e08 100644 --- a/src/client/Common/UI/IUIScene_CreativeMenu.h +++ b/src/client/Common/UI/IUIScene_CreativeMenu.h @@ -51,7 +51,7 @@ public: static const int MAX_SIZE = rows * columns; // 4J JEV - Images - const LPCWSTR m_icon; + const const wchar_t* m_icon; const int m_descriptionId; const int m_staticGroupsCount; ECreative_Inventory_Groups *m_staticGroupsA; @@ -64,7 +64,7 @@ public: unsigned int m_staticItems; public: - TabSpec( LPCWSTR icon, int descriptionId, int staticGroupsCount, ECreative_Inventory_Groups *staticGroups, int dynamicGroupsCount, ECreative_Inventory_Groups *dynamicGroups ); + TabSpec( const wchar_t* icon, int descriptionId, int staticGroupsCount, ECreative_Inventory_Groups *staticGroups, int dynamicGroupsCount, ECreative_Inventory_Groups *dynamicGroups ); ~TabSpec(); void populateMenu(AbstractContainerMenu *menu, int dynamicIndex, unsigned int page); @@ -108,10 +108,10 @@ protected: virtual void updateTabHighlightAndText(ECreativeInventoryTabs tab) = 0; virtual void updateScrollCurrentPage(int currentPage, int pageCount) = 0; virtual ESceneSection GetSectionAndSlotInDirection( ESceneSection eSection, ETapState eTapDirection, int *piTargetX, int *piTargetY ); - virtual bool handleValidKeyPress(int iUserIndex, int buttonNum, BOOL quickKeyHeld); - virtual void handleOutsideClicked(int iPad, int buttonNum, BOOL quickKeyHeld); + virtual bool handleValidKeyPress(int iUserIndex, int buttonNum, bool quickKeyHeld); + virtual void handleOutsideClicked(int iPad, int buttonNum, bool quickKeyHeld); virtual void handleAdditionalKeyPress(int iAction); - virtual void handleSlotListClicked(ESceneSection eSection, int buttonNum, BOOL quickKeyHeld); + virtual void handleSlotListClicked(ESceneSection eSection, int buttonNum, bool quickKeyHeld); bool getEmptyInventorySlot(shared_ptr item, int &slotX); int getSectionStartOffset(ESceneSection eSection); virtual bool IsSectionSlotList( ESceneSection eSection ); diff --git a/src/client/Common/UI/IUIScene_PauseMenu.cpp b/src/client/Common/UI/IUIScene_PauseMenu.cpp index 708243fc..c9822331 100644 --- a/src/client/Common/UI/IUIScene_PauseMenu.cpp +++ b/src/client/Common/UI/IUIScene_PauseMenu.cpp @@ -47,7 +47,7 @@ int IUIScene_PauseMenu::ExitGameSaveDialogReturned(void *pParam,int iPad,C4JStor { #ifdef _XBOX // upsell - ULONGLONG ullOfferID_Full; + uint64_t ullOfferID_Full; // get the dlc texture pack DLCTexturePack *pDLCTexPack=(DLCTexturePack *)tPack; @@ -57,7 +57,7 @@ int IUIScene_PauseMenu::ExitGameSaveDialogReturned(void *pParam,int iPad,C4JStor TelemetryManager->RecordUpsellPresented(iPad, eSet_UpsellID_Texture_DLC, ullOfferID_Full & 0xFFFFFFFF); #endif - UINT uiIDA[2]; + unsigned int uiIDA[2]; uiIDA[0]=IDS_CONFIRM_OK; uiIDA[1]=IDS_CONFIRM_CANCEL; @@ -75,7 +75,7 @@ int IUIScene_PauseMenu::ExitGameSaveDialogReturned(void *pParam,int iPad,C4JStor // we need to ask if they are sure they want to overwrite the existing game if(bSaveExists) { - UINT uiIDA[2]; + unsigned int uiIDA[2]; uiIDA[0]=IDS_CONFIRM_CANCEL; uiIDA[1]=IDS_CONFIRM_OK; ui.RequestMessageBox(IDS_TITLE_SAVE_GAME, IDS_CONFIRM_SAVE_GAME, uiIDA, 2, ProfileManager.GetPrimaryPad(), &IUIScene_PauseMenu::ExitGameAndSaveReturned, scene, app.GetStringTable(), NULL, 0, false); @@ -92,7 +92,7 @@ int IUIScene_PauseMenu::ExitGameSaveDialogReturned(void *pParam,int iPad,C4JStor else { // been a few requests for a confirm on exit without saving - UINT uiIDA[2]; + unsigned int uiIDA[2]; uiIDA[0]=IDS_CONFIRM_CANCEL; uiIDA[1]=IDS_CONFIRM_OK; ui.RequestMessageBox(IDS_TITLE_DECLINE_SAVE_GAME, IDS_CONFIRM_DECLINE_SAVE_GAME, uiIDA, 2, ProfileManager.GetPrimaryPad(), &IUIScene_PauseMenu::ExitGameDeclineSaveReturned, scene, app.GetStringTable(), NULL, 0, false); @@ -115,7 +115,7 @@ int IUIScene_PauseMenu::ExitGameAndSaveReturned(void *pParam,int iPad,C4JStorage // results switched for this dialog if(result==C4JStorage::EMessage_ResultDecline) { - //INT saveOrCheckpointId = 0; + //int saveOrCheckpointId = 0; //bool validSave = StorageManager.GetSaveUniqueNumber(&saveOrCheckpointId); //SentientManager.RecordLevelSaveOrCheckpoint(ProfileManager.GetPrimaryPad(), saveOrCheckpointId); #if defined(_XBOX_ONE) || defined(__ORBIS__) @@ -131,7 +131,7 @@ int IUIScene_PauseMenu::ExitGameAndSaveReturned(void *pParam,int iPad,C4JStorage // has someone disconnected the ethernet here, causing the pause menu to shut? if(ui.IsPauseMenuDisplayed(ProfileManager.GetPrimaryPad())) { - UINT uiIDA[3]; + unsigned int uiIDA[3]; // you cancelled the save on exit after choosing exit and save? You go back to the Exit choices then. uiIDA[0]=IDS_CONFIRM_CANCEL; uiIDA[1]=IDS_EXIT_GAME_SAVE; @@ -173,7 +173,7 @@ int IUIScene_PauseMenu::ExitGameDeclineSaveReturned(void *pParam,int iPad,C4JSto // has someone disconnected the ethernet here, causing the pause menu to shut? if(ui.IsPauseMenuDisplayed(ProfileManager.GetPrimaryPad())) { - UINT uiIDA[3]; + unsigned int uiIDA[3]; // you cancelled the save on exit after choosing exit and save? You go back to the Exit choices then. uiIDA[0]=IDS_CONFIRM_CANCEL; uiIDA[1]=IDS_EXIT_GAME_SAVE; @@ -212,7 +212,7 @@ int IUIScene_PauseMenu::WarningTrialTexturePackReturned(void *pParam,int iPad,C4 ProfileManager.GetChatAndContentRestrictions(iPad,true,NULL,&bContentRestricted,NULL); if(bContentRestricted) { - UINT uiIDA[1]; + unsigned int uiIDA[1]; uiIDA[0]=IDS_CONFIRM_OK; ui.RequestMessageBox(IDS_ONLINE_SERVICE_TITLE, IDS_CONTENT_RESTRICTION, uiIDA, 1, iPad,NULL,&app, app.GetStringTable(), NULL, 0, false); } @@ -278,16 +278,16 @@ int IUIScene_PauseMenu::WarningTrialTexturePackReturned(void *pParam,int iPad,C4 DLCPack *pDLCPack=pDLCTexPack->getDLCInfoParentPack(); - DLC_INFO *pDLCInfo=app.GetDLCInfoForProductName((WCHAR *)pDLCPack->getName().c_str()); + DLC_INFO *pDLCInfo=app.GetDLCInfoForProductName((wchar_t *)pDLCPack->getName().c_str()); - StorageManager.InstallOffer(1,(WCHAR *)pDLCInfo->wsProductId.c_str(),NULL,NULL); + StorageManager.InstallOffer(1,(wchar_t *)pDLCInfo->wsProductId.c_str(),NULL,NULL); // the license change coming in when the offer has been installed will cause this scene to refresh } else { // 4J-JEV: Fix for XB1: #165863 - XR-074: Compliance: With no active network connection user is unable to convert from Trial to Full texture pack and is not messaged why. - UINT uiIDA[1] = { IDS_CONFIRM_OK }; + unsigned int uiIDA[1] = { IDS_CONFIRM_OK }; ui.RequestMessageBox(IDS_PRO_NOTONLINE_TITLE, IDS_PRO_XBOXLIVE_NOTIFICATION, uiIDA, 1, iPad, NULL, NULL, app.GetStringTable()); } } @@ -304,7 +304,7 @@ int IUIScene_PauseMenu::WarningTrialTexturePackReturned(void *pParam,int iPad,C4 { if(ProfileManager.IsSignedIn(iPad)) { - ULONGLONG ullIndexA[1]; + uint64_t ullIndexA[1]; TexturePack *tPack = Minecraft::GetInstance()->skins->getSelected(); // get the dlc texture pack @@ -330,7 +330,7 @@ int IUIScene_PauseMenu::WarningTrialTexturePackReturned(void *pParam,int iPad,C4 } -int IUIScene_PauseMenu::SaveWorldThreadProc( LPVOID lpParameter ) +int IUIScene_PauseMenu::SaveWorldThreadProc( void* lpParameter ) { bool bAutosave=(bool)lpParameter; if(bAutosave) @@ -367,7 +367,7 @@ int IUIScene_PauseMenu::SaveWorldThreadProc( LPVOID lpParameter ) #endif } - HRESULT hr = S_OK; + int hr = S_OK; if(app.GetChangingSessionType()) { // 4J Stu - This causes the fullscreenprogress scene to ignore the action it was given @@ -391,7 +391,7 @@ int IUIScene_PauseMenu::ExitWorldThreadProc( void* lpParameter ) } // This function performs the meat of exiting from a level. It should be called from a thread other than the main thread. -void IUIScene_PauseMenu::_ExitWorld(LPVOID lpParameter) +void IUIScene_PauseMenu::_ExitWorld(void* lpParameter) { Minecraft *pMinecraft=Minecraft::GetInstance(); @@ -494,7 +494,7 @@ void IUIScene_PauseMenu::_ExitWorld(LPVOID lpParameter) } //pMinecraft->progressRenderer->progressStartNoAbort( exitReasonStringId ); - UINT uiIDA[1]; + unsigned int uiIDA[1]; uiIDA[0]=IDS_CONFIRM_OK; // 4J Stu - Fix for #48669 - TU5: Code: Compliance: TCR #15: Incorrect/misleading messages after signing out a profile during online game session. // If the primary player is signed out, then that is most likely the cause of the disconnection so don't display a message box. This will allow the message box requested by the libraries to be brought up @@ -594,7 +594,7 @@ void IUIScene_PauseMenu::_ExitWorld(LPVOID lpParameter) } //pMinecraft->progressRenderer->progressStartNoAbort( exitReasonStringId ); - UINT uiIDA[1]; + unsigned int uiIDA[1]; uiIDA[0]=IDS_CONFIRM_OK; ui.RequestMessageBox( exitReasonTitleId, exitReasonStringId, uiIDA,1,ProfileManager.GetPrimaryPad(),NULL,NULL, app.GetStringTable()); exitReasonStringId = -1; @@ -641,7 +641,7 @@ int IUIScene_PauseMenu::SaveGameDialogReturned(void *pParam,int iPad,C4JStorage: if(result==C4JStorage::EMessage_ResultDecline) { #if defined(_XBOX_ONE) || defined(__ORBIS__) - UINT uiIDA[2]; + unsigned int uiIDA[2]; uiIDA[0]=IDS_CONFIRM_CANCEL; uiIDA[1]=IDS_CONFIRM_OK; ui.RequestMessageBox(IDS_TITLE_ENABLE_AUTOSAVE, IDS_CONFIRM_ENABLE_AUTOSAVE, uiIDA, 2, iPad,&IUIScene_PauseMenu::EnableAutosaveDialogReturned,pParam, app.GetStringTable(), NULL, 0, false); diff --git a/src/client/Common/UI/IUIScene_PauseMenu.h b/src/client/Common/UI/IUIScene_PauseMenu.h index 7233df3a..b384d777 100644 --- a/src/client/Common/UI/IUIScene_PauseMenu.h +++ b/src/client/Common/UI/IUIScene_PauseMenu.h @@ -17,7 +17,7 @@ public: static int SaveWorldThreadProc( void* lpParameter ); static int ExitWorldThreadProc( void* lpParameter ); - static void _ExitWorld(LPVOID lpParameter); // Call only from a thread + static void _ExitWorld(void* lpParameter); // Call only from a thread protected: virtual void ShowScene(bool show) = 0; diff --git a/src/client/Common/UI/IUIScene_StartGame.cpp b/src/client/Common/UI/IUIScene_StartGame.cpp index be611778..92945224 100644 --- a/src/client/Common/UI/IUIScene_StartGame.cpp +++ b/src/client/Common/UI/IUIScene_StartGame.cpp @@ -29,8 +29,8 @@ void IUIScene_StartGame::HandleDLCMountingComplete() { TexturePack *tp = pMinecraft->skins->getTexturePackByIndex(i); - DWORD dwImageBytes; - PBYTE pbImageData = tp->getPackIcon(dwImageBytes); + unsigned long dwImageBytes; + uint8_t* pbImageData = tp->getPackIcon(dwImageBytes); if(dwImageBytes > 0 && pbImageData) { @@ -58,9 +58,9 @@ void IUIScene_StartGame::HandleDLCMountingComplete() char *pchName=app.GetDLCInfoTextures(i); pDLCInfo=app.GetDLCInfo(pchName); #elif defined _XBOX_ONE - pDLCInfo=app.GetDLCInfoForFullOfferID((WCHAR *)app.GetDLCInfoTexturesFullOffer(i).c_str()); + pDLCInfo=app.GetDLCInfoForFullOfferID((wchar_t *)app.GetDLCInfoTexturesFullOffer(i).c_str()); #else - ULONGLONG ull=app.GetDLCInfoTexturesFullOffer(i); + uint64_t ull=app.GetDLCInfoTexturesFullOffer(i); pDLCInfo=app.GetDLCInfoForFullOfferID(ull); #endif for(unsigned int i = 0; i < texturePacksCount; ++i) @@ -96,7 +96,7 @@ void IUIScene_StartGame::HandleDLCMountingComplete() for(unsigned int i = 0; i < app.GetDLCInfoTexturesOffersCount(); ++i) { bTexturePackAlreadyListed=false; - ULONGLONG ull=app.GetDLCInfoTexturesFullOffer(i); + uint64_t ull=app.GetDLCInfoTexturesFullOffer(i); pDLCInfo=app.GetDLCInfoForFullOfferID(ull); for(unsigned int i = 0; i < texturePacksCount; ++i) { @@ -140,8 +140,8 @@ void IUIScene_StartGame::UpdateTexturePackDescription(int index) #if TO_BE_IMPLEMENTED // this is probably a texture pack icon added from TMS - DWORD dwBytes=0,dwFileBytes=0; - PBYTE pbData=NULL,pbFileData=NULL; + unsigned long dwBytes=0,dwFileBytes=0; + uint8_t* pbData=NULL,pbFileData=NULL; CXuiCtrl4JList::LIST_ITEM_INFO ListItem; // get the current index of the list, and then get the data @@ -180,8 +180,8 @@ void IUIScene_StartGame::UpdateTexturePackDescription(int index) m_labelTexturePackName.setLabel(tp->getName()); m_labelTexturePackDescription.setLabel(tp->getDesc1()); - DWORD dwImageBytes; - PBYTE pbImageData = tp->getPackIcon(dwImageBytes); + unsigned long dwImageBytes; + uint8_t* pbImageData = tp->getPackIcon(dwImageBytes); //if(dwImageBytes > 0 && pbImageData) //{ @@ -226,12 +226,12 @@ void IUIScene_StartGame::UpdateCurrentTexturePack(int iSlot) // upsell the texture pack // tell sentient about the upsell of the full version of the skin pack - ULONGLONG ullOfferID_Full; + uint64_t ullOfferID_Full; app.GetDLCFullOfferIDForPackID(ListItem.iData,&ullOfferID_Full); TelemetryManager->RecordUpsellPresented(ProfileManager.GetPrimaryPad(), eSet_UpsellID_Texture_DLC, ullOfferID_Full & 0xFFFFFFFF); - UINT uiIDA[3]; + unsigned int uiIDA[3]; uiIDA[0]=IDS_TEXTUREPACK_FULLVERSION; uiIDA[1]=IDS_TEXTURE_PACK_TRIALVERSION; @@ -276,7 +276,7 @@ int IUIScene_StartGame::UnlockTexturePackReturned(void *pParam,int iPad,C4JStora if(ProfileManager.IsSignedIn(iPad)) { #if defined _XBOX //|| defined _XBOX_ONE - ULONGLONG ullIndexA[1]; + uint64_t ullIndexA[1]; DLC_INFO *pDLCInfo = app.GetDLCInfoForTrialOfferID(pScene->m_pDLCPack->getPurchaseOfferId()); if(pDLCInfo!=NULL) @@ -322,8 +322,8 @@ int IUIScene_StartGame::TexturePackDialogReturned(void *pParam,int iPad,C4JStora // we need to enable background downloading for the DLC XBackgroundDownloadSetMode(XBACKGROUND_DOWNLOAD_MODE_ALWAYS_ALLOW); - ULONGLONG ullOfferID_Full; - ULONGLONG ullIndexA[1]; + uint64_t ullOfferID_Full; + uint64_t ullIndexA[1]; CXuiCtrl4JList::LIST_ITEM_INFO ListItem; // get the current index of the list, and then get the data ListItem=pClass->m_pTexturePacksList->GetData(pClass->m_currentTexturePackIndex); @@ -360,14 +360,14 @@ int IUIScene_StartGame::TexturePackDialogReturned(void *pParam,int iPad,C4JStora app.GetDLCFullOfferIDForPackID(pClass->m_MoreOptionsParams.dwTexturePack,ProductId); - StorageManager.InstallOffer(1,(WCHAR *)ProductId.c_str(),NULL,NULL); + StorageManager.InstallOffer(1,(wchar_t *)ProductId.c_str(),NULL,NULL); // the license change coming in when the offer has been installed will cause this scene to refresh } else { // 4J-JEV: Fix for XB1: #165863 - XR-074: Compliance: With no active network connection user is unable to convert from Trial to Full texture pack and is not messaged why. - UINT uiIDA[1] = { IDS_CONFIRM_OK }; + unsigned int uiIDA[1] = { IDS_CONFIRM_OK }; ui.RequestMessageBox(IDS_PRO_NOTONLINE_TITLE, IDS_PRO_XBOXLIVE_NOTIFICATION, uiIDA, 1, iPad, NULL, NULL, app.GetStringTable()); } } diff --git a/src/client/Common/UI/UIComponent_Chat.cpp b/src/client/Common/UI/UIComponent_Chat.cpp index a98fd651..e8352012 100644 --- a/src/client/Common/UI/UIComponent_Chat.cpp +++ b/src/client/Common/UI/UIComponent_Chat.cpp @@ -49,7 +49,7 @@ void UIComponent_Chat::handleTimerComplete(int id) if(pMinecraft->localplayers[m_iPad]!= NULL) { Gui *pGui = pMinecraft->gui; - //DWORD messagesToDisplay = min( CHAT_LINES_COUNT, pGui->getMessagesCount(m_iPad) ); + //unsigned long messagesToDisplay = min( CHAT_LINES_COUNT, pGui->getMessagesCount(m_iPad) ); for( unsigned int i = 0; i < CHAT_LINES_COUNT; ++i ) { float opacity = pGui->getOpacity(m_iPad, i); diff --git a/src/client/Common/UI/UIComponent_Panorama.cpp b/src/client/Common/UI/UIComponent_Panorama.cpp index 0a22a3f2..3459ed43 100644 --- a/src/client/Common/UI/UIComponent_Panorama.cpp +++ b/src/client/Common/UI/UIComponent_Panorama.cpp @@ -47,7 +47,7 @@ void UIComponent_Panorama::tick() EnterCriticalSection(&pMinecraft->m_setLevelCS); if(pMinecraft->level!=NULL) { - __int64 i64TimeOfDay =0; + int64_t i64TimeOfDay =0; // are we in the Nether? - Leave the time as 0 if we are, so we show daylight if(pMinecraft->level->dimension->id==0) { diff --git a/src/client/Common/UI/UIComponent_TutorialPopup.cpp b/src/client/Common/UI/UIComponent_TutorialPopup.cpp index ffd46bc4..6a878b22 100644 --- a/src/client/Common/UI/UIComponent_TutorialPopup.cpp +++ b/src/client/Common/UI/UIComponent_TutorialPopup.cpp @@ -199,7 +199,7 @@ void UIComponent_TutorialPopup::_SetDescription(UIScene *interactScene, const ws } } -wstring UIComponent_TutorialPopup::_SetIcon(int icon, int iAuxVal, bool isFoil, LPCWSTR desc) +wstring UIComponent_TutorialPopup::_SetIcon(int icon, int iAuxVal, bool isFoil, const wchar_t* desc) { wstring temp(desc); @@ -334,7 +334,7 @@ wstring UIComponent_TutorialPopup::_SetImage(wstring &desc) { // 4J Stu - Unused #if 0 - BOOL imageShowAtStart = m_image.IsShown(); + bool imageShowAtStart = m_image.IsShown(); wstring openTag(L"{*IMAGE*}"); wstring closeTag(L"{*/IMAGE*}"); @@ -359,7 +359,7 @@ wstring UIComponent_TutorialPopup::_SetImage(wstring &desc) m_image.SetShow( false ); } - BOOL imageShowAtEnd = m_image.IsShown(); + bool imageShowAtEnd = m_image.IsShown(); if(imageShowAtStart != imageShowAtEnd) { float fHeight, fWidth, fIconHeight, fDescHeight, fDescWidth; diff --git a/src/client/Common/UI/UIComponent_TutorialPopup.h b/src/client/Common/UI/UIComponent_TutorialPopup.h index 36f78300..a06f1c94 100644 --- a/src/client/Common/UI/UIComponent_TutorialPopup.h +++ b/src/client/Common/UI/UIComponent_TutorialPopup.h @@ -92,7 +92,7 @@ protected: private: void _SetDescription(UIScene *interactScene, const wstring &desc, const wstring &title, bool allowFade, bool isReminder); - wstring _SetIcon(int icon, int iAuxVal, bool isFoil, LPCWSTR desc); + wstring _SetIcon(int icon, int iAuxVal, bool isFoil, const wchar_t* desc); wstring _SetImage(wstring &desc); wstring ParseDescription(int iPad, wstring &text); void UpdateInteractScenePosition(bool visible); diff --git a/src/client/Common/UI/UIControl_EnchantmentBook.h b/src/client/Common/UI/UIControl_EnchantmentBook.h index cbe2cf2b..5e088879 100644 --- a/src/client/Common/UI/UIControl_EnchantmentBook.h +++ b/src/client/Common/UI/UIControl_EnchantmentBook.h @@ -16,7 +16,7 @@ private: float flip, oFlip, flipT, flipA; float open, oOpen; - //BOOL m_bDirty; + //bool m_bDirty; //float m_fScale,m_fAlpha; //int m_iPad; shared_ptr last; diff --git a/src/client/Common/UI/UIControl_PlayerSkinPreview.h b/src/client/Common/UI/UIControl_PlayerSkinPreview.h index 52fbe87b..188cb1cc 100644 --- a/src/client/Common/UI/UIControl_PlayerSkinPreview.h +++ b/src/client/Common/UI/UIControl_PlayerSkinPreview.h @@ -23,7 +23,7 @@ private: e_SkinPreviewAnimation_Count, }; - BOOL m_bDirty; + bool m_bDirty; float m_fScale,m_fAlpha; wstring m_customTextureUrl; @@ -43,7 +43,7 @@ private: float m_walkAnimPos; bool m_bAutoRotate, m_bRotatingLeft; - BYTE m_rotateTick; + uint8_t m_rotateTick; float m_fTargetRotation, m_fOriginalRotation; int m_framesAnimatingRotation; bool m_bAnimatingToFacing; diff --git a/src/client/Common/UI/UIControl_SpaceIndicatorBar.cpp b/src/client/Common/UI/UIControl_SpaceIndicatorBar.cpp index dfdea93e..d6f81a60 100644 --- a/src/client/Common/UI/UIControl_SpaceIndicatorBar.cpp +++ b/src/client/Common/UI/UIControl_SpaceIndicatorBar.cpp @@ -24,7 +24,7 @@ bool UIControl_SpaceIndicatorBar::setupControl(UIScene *scene, IggyValuePath *pa return success; } -void UIControl_SpaceIndicatorBar::init(const wstring &label, int id, __int64 min, __int64 max) +void UIControl_SpaceIndicatorBar::init(const wstring &label, int id, int64_t min, int64_t max) { m_label = label; m_id = id; @@ -61,11 +61,11 @@ void UIControl_SpaceIndicatorBar::reset() setSaveGameOffset(0.0f); } -void UIControl_SpaceIndicatorBar::addSave(__int64 size) +void UIControl_SpaceIndicatorBar::addSave(int64_t size) { float startPercent = (float)((m_currentTotal-m_min))/(m_max-m_min); - m_sizeAndOffsets.push_back( pair<__int64, float>(size, startPercent) ); + m_sizeAndOffsets.push_back( pair(size, startPercent) ); m_currentTotal += size; setTotalSize(m_currentTotal); @@ -75,7 +75,7 @@ void UIControl_SpaceIndicatorBar::selectSave(int index) { if(index >= 0 && index < m_sizeAndOffsets.size()) { - pair<__int64,float> values = m_sizeAndOffsets[index]; + pair values = m_sizeAndOffsets[index]; setSaveSize(values.first); setSaveGameOffset(values.second); } @@ -86,7 +86,7 @@ void UIControl_SpaceIndicatorBar::selectSave(int index) } } -void UIControl_SpaceIndicatorBar::setSaveSize(__int64 size) +void UIControl_SpaceIndicatorBar::setSaveSize(int64_t size) { m_currentSave = size; @@ -99,7 +99,7 @@ void UIControl_SpaceIndicatorBar::setSaveSize(__int64 size) IggyResult out = IggyPlayerCallMethodRS ( m_parentScene->getMovie() , &result, getIggyValuePath() , m_setSaveSizeFunc , 1 , value ); } -void UIControl_SpaceIndicatorBar::setTotalSize(__int64 size) +void UIControl_SpaceIndicatorBar::setTotalSize(int64_t size) { float percent = (float)((m_currentTotal-m_min))/(m_max-m_min); diff --git a/src/client/Common/UI/UIControl_SpaceIndicatorBar.h b/src/client/Common/UI/UIControl_SpaceIndicatorBar.h index 39f9a746..08e00da9 100644 --- a/src/client/Common/UI/UIControl_SpaceIndicatorBar.h +++ b/src/client/Common/UI/UIControl_SpaceIndicatorBar.h @@ -6,28 +6,28 @@ class UIControl_SpaceIndicatorBar : public UIControl_Base { private: IggyName m_setSaveSizeFunc, m_setTotalSizeFunc, m_setSaveGameOffsetFunc; - __int64 m_min; - __int64 m_max; - __int64 m_currentSave, m_currentTotal; + int64_t m_min; + int64_t m_max; + int64_t m_currentSave, m_currentTotal; float m_currentOffset; - vector > m_sizeAndOffsets; + vector > m_sizeAndOffsets; public: UIControl_SpaceIndicatorBar(); virtual bool setupControl(UIScene *scene, IggyValuePath *parent, const string &controlName); - void init(const wstring &label, int id, __int64 min, __int64 max); + void init(const wstring &label, int id, int64_t min, int64_t max); virtual void ReInit(); void reset(); - void addSave(__int64 size); + void addSave(int64_t size); void selectSave(int index); private: - void setSaveSize(__int64 size); - void setTotalSize(__int64 totalSize); + void setSaveSize(int64_t size); + void setTotalSize(int64_t totalSize); void setSaveGameOffset(float offset); }; \ No newline at end of file diff --git a/src/client/Common/UI/UIController.cpp b/src/client/Common/UI/UIController.cpp index d956857a..c0a303ec 100644 --- a/src/client/Common/UI/UIController.cpp +++ b/src/client/Common/UI/UIController.cpp @@ -50,7 +50,7 @@ CRITICAL_SECTION UIController::ms_reloadSkinCS; bool UIController::ms_bReloadSkinCSInitialised = false; -DWORD UIController::m_dwTrialTimerLimitSecs=DYNAMIC_CONFIG_DEFAULT_TRIAL_TIME; +unsigned long UIController::m_dwTrialTimerLimitSecs=DYNAMIC_CONFIG_DEFAULT_TRIAL_TIME; static void RADLINK WarningCallback(void *user_callback_data, Iggy *player, IggyResult code, const char *message) { @@ -124,7 +124,7 @@ extern "C" void *__real_malloc(size_t t); extern "C" void __real_free(void *t); #endif -__int64 UIController::iggyAllocCount = 0; +int64_t UIController::iggyAllocCount = 0; static unordered_map allocations; static void * RADLINK AllocateFunction ( void * alloc_callback_user_data , size_t size_requested , size_t * size_returned ) { @@ -235,7 +235,7 @@ void UIController::SetSysUIShowing(bool bVal) m_bSystemUIShowing=bVal; } -void UIController::SetSystemUIShowing(LPVOID lpParam,bool bVal) +void UIController::SetSystemUIShowing(void* lpParam,bool bVal) { UIController *pClass=(UIController *)lpParam; pClass->SetSysUIShowing(bVal); @@ -402,7 +402,7 @@ void UIController::tick() EnderDragonRenderer::bossInstance = nullptr; // Clear out the cached movie file data - __int64 currentTime = System::currentTimeMillis(); + int64_t currentTime = System::currentTimeMillis(); for(AUTO_VAR(it, m_cachedMovieData.begin()); it != m_cachedMovieData.end();) { if(it->second.m_expiry < currentTime) @@ -522,7 +522,7 @@ IggyLibrary UIController::loadSkin(const wstring &skinPath, const wstring &skinN IggyMemoryUseInfo memoryInfo; rrbool res; int iteration = 0; - __int64 totalStatic = 0; + int64_t totalStatic = 0; while(res = IggyDebugGetMemoryUseInfo ( NULL , lib , "" , @@ -633,9 +633,9 @@ void UIController::CleanUpSkinReload() if(!Minecraft::GetInstance()->skins->getSelected()->hasAudio()) { #ifdef _DURANGO - DWORD result = StorageManager.UnmountInstalledDLC(L"TPACK"); + unsigned long result = StorageManager.UnmountInstalledDLC(L"TPACK"); #else - DWORD result = StorageManager.UnmountInstalledDLC("TPACK"); + unsigned long result = StorageManager.UnmountInstalledDLC("TPACK"); #endif } } @@ -653,7 +653,7 @@ void UIController::CleanUpSkinReload() byteArray UIController::getMovieData(const wstring &filename) { // Cache everything we load in the current tick - __int64 targetTime = System::currentTimeMillis() + (1000LL * 60); + int64_t targetTime = System::currentTimeMillis() + (1000LL * 60); AUTO_VAR(it,m_cachedMovieData.find(filename)); if(it == m_cachedMovieData.end() ) { @@ -898,7 +898,7 @@ void UIController::handleKeyPress(unsigned int iPad, unsigned int key) else if (down) { // Check is enough time has elapsed to be a repeat key - DWORD currentTime = GetTickCount(); + unsigned long currentTime = GetTickCount(); if(m_actionRepeatTimer[iPad][key] > 0 && currentTime > m_actionRepeatTimer[iPad][key]) { repeat = true; @@ -935,7 +935,7 @@ void UIController::handleKeyPress(unsigned int iPad, unsigned int key) else if (down) { // Check is enough time has elapsed to be a repeat key - DWORD currentTime = GetTickCount(); + unsigned long currentTime = GetTickCount(); if(m_actionRepeatTimer[iPad][key] > 0 && currentTime > m_actionRepeatTimer[iPad][key]) { repeat = true; @@ -981,8 +981,8 @@ void UIController::handleKeyPress(unsigned int iPad, unsigned int key) //!(app.GetGameSettingsDebugMask(ProfileManager.GetPrimaryPad())&(1L<getRenderWidth(); float sceneHeight = (float)scene->getRenderHeight(); - LONG left, right, top, bottom; + int32_t left, right, top, bottom; #ifdef __PS3__ if(!RenderManager.IsHiDef() && !RenderManager.IsWidescreen()) { @@ -1374,7 +1374,7 @@ GDrawTexture * RADLINK UIController::TextureSubstitutionCreateCallback ( void * void RADLINK UIController::TextureSubstitutionDestroyCallback ( void * user_callback_data , void * destroy_callback_data , GDrawTexture * handle ) { // Orbis complains about casting a pointer to an int - LONGLONG llVal=(LONGLONG)destroy_callback_data; + int64_t llVal=(int64_t)destroy_callback_data; int id=(int)llVal; app.DebugPrintf("Destroying iggy texture %d\n", id); @@ -1384,7 +1384,7 @@ void RADLINK UIController::TextureSubstitutionDestroyCallback ( void * user_call t->releaseTexture( id ); } -void UIController::registerSubstitutionTexture(const wstring &textureName, PBYTE pbData, DWORD dwLength) +void UIController::registerSubstitutionTexture(const wstring &textureName, uint8_t* pbData, unsigned long dwLength) { // Remove it if it already exists unregisterSubstitutionTexture(textureName,false); @@ -1569,9 +1569,9 @@ void UIController::NavigateToHomeMenu() // pDLCTexPack->m_pSoundBank->Destroy(); // } #ifdef _XBOX_ONE - DWORD result = StorageManager.UnmountInstalledDLC(L"TPACK"); + unsigned long result = StorageManager.UnmountInstalledDLC(L"TPACK"); #else - DWORD result = StorageManager.UnmountInstalledDLC("TPACK"); + unsigned long result = StorageManager.UnmountInstalledDLC("TPACK"); #endif app.DebugPrintf("Unmount result is %d\n",result); @@ -1884,7 +1884,7 @@ void UIController::SetTooltipText( unsigned int iPad, unsigned int tooltip, int if(m_groups[(int)group]->getTooltips()) m_groups[(int)group]->getTooltips()->SetTooltipText(tooltip, iTextID); } -void UIController::SetEnableTooltips( unsigned int iPad, BOOL bVal ) +void UIController::SetEnableTooltips( unsigned int iPad, bool bVal ) { EUIGroup group; if( app.GetGameStarted() ) @@ -2200,7 +2200,7 @@ void UIController::UpdatePlayerBasePositions() { Minecraft *pMinecraft = Minecraft::GetInstance(); - for( BYTE idx = 0; idx < XUSER_MAX_COUNT; ++idx) + for( uint8_t idx = 0; idx < XUSER_MAX_COUNT; ++idx) { if(pMinecraft->localplayers[idx] != NULL) { @@ -2255,9 +2255,9 @@ void UIController::SetTrialTimerLimitSecs(unsigned int uiSeconds) void UIController::UpdateTrialTimer(unsigned int iPad) { - WCHAR wcTime[20]; + wchar_t wcTime[20]; - DWORD dwTimeTicks=(DWORD)app.getTrialTimer(); + unsigned long dwTimeTicks=(unsigned long)app.getTrialTimer(); if(dwTimeTicks>m_dwTrialTimerLimitSecs) { @@ -2299,7 +2299,7 @@ void UIController::UpdateTrialTimer(unsigned int iPad) void UIController::ReduceTrialTimerValue() { - DWORD dwTimeTicks=(int)app.getTrialTimer(); + unsigned long dwTimeTicks=(int)app.getTrialTimer(); if(dwTimeTicks>m_dwTrialTimerLimitSecs) { @@ -2317,7 +2317,7 @@ void UIController::ShowAutosaveCountdownTimer(bool show) void UIController::UpdateAutosaveCountdownTimer(unsigned int uiSeconds) { #if !(defined(_XBOX_ONE) || defined(__ORBIS__)) - WCHAR wcAutosaveCountdown[100]; + wchar_t wcAutosaveCountdown[100]; swprintf( wcAutosaveCountdown, 100, app.GetString(IDS_AUTOSAVE_COUNTDOWN),uiSeconds); if(m_groups[(int)eUIGroup_Fullscreen]->getPressStartToPlay()) m_groups[(int)eUIGroup_Fullscreen]->getPressStartToPlay()->setTrialTimer(wcAutosaveCountdown); #endif @@ -2415,11 +2415,11 @@ void UIController::ClearPressStart() // 4J Stu - For the different StringTable classes. Should really fix the libraries. #ifndef __PS3__ -C4JStorage::EMessageResult UIController::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, bool bIsError) +C4JStorage::EMessageResult UIController::RequestMessageBox(unsigned int uiTitle, unsigned int uiText, unsigned int *uiOptionA,unsigned int uiOptionC, unsigned long dwPad, + int( *Func)(void*,int,const C4JStorage::EMessageResult),void* lpParam, C4JStringTable *pStringTable, wchar_t *pwchFormatString,unsigned long dwFocusButton, bool bIsError) #else -C4JStorage::EMessageResult UIController::RequestMessageBox(UINT uiTitle, UINT uiText, UINT *uiOptionA,UINT uiOptionC, DWORD dwPad, - int( *Func)(LPVOID,int,const C4JStorage::EMessageResult),LPVOID lpParam, StringTable *pStringTable, WCHAR *pwchFormatString,DWORD dwFocusButton, bool bIsError) +C4JStorage::EMessageResult UIController::RequestMessageBox(unsigned int uiTitle, unsigned int uiText, unsigned int *uiOptionA,unsigned int uiOptionC, unsigned long dwPad, + int( *Func)(void*,int,const C4JStorage::EMessageResult),void* lpParam, StringTable *pStringTable, wchar_t *pwchFormatString,unsigned long dwFocusButton, bool bIsError) #endif { MessageBoxInfo param; @@ -2441,8 +2441,8 @@ C4JStorage::EMessageResult UIController::RequestMessageBox(UINT uiTitle, UINT ui // Queue this message box QueuedMessageBoxData *queuedData = new QueuedMessageBoxData(); queuedData->info = param; - queuedData->info.uiOptionA = new UINT[param.uiOptionC]; - memcpy(queuedData->info.uiOptionA, param.uiOptionA, param.uiOptionC * sizeof(UINT)); + queuedData->info.uiOptionA = new unsigned int[param.uiOptionC]; + memcpy(queuedData->info.uiOptionA, param.uiOptionA, param.uiOptionC * sizeof(unsigned int)); queuedData->iPad = dwPad; queuedData->layer = eUILayer_Error; // Ensures that these don't get wiped out by a CloseAllScenes call m_queuedMessageBoxData.push_back(queuedData); @@ -2463,7 +2463,7 @@ C4JStorage::EMessageResult UIController::RequestMessageBox(UINT uiTitle, UINT ui } } -C4JStorage::EMessageResult UIController::RequestUGCMessageBox(UINT title/* = -1 */, UINT message/* = -1 */, int iPad/* = -1*/, int( *Func)(LPVOID,int,const C4JStorage::EMessageResult)/* = NULL*/, LPVOID lpParam/* = NULL*/) +C4JStorage::EMessageResult UIController::RequestUGCMessageBox(unsigned int title/* = -1 */, unsigned int message/* = -1 */, int iPad/* = -1*/, int( *Func)(void*,int,const C4JStorage::EMessageResult)/* = NULL*/, void* lpParam/* = NULL*/) { // Default title / messages if (title == -1) @@ -2485,17 +2485,17 @@ C4JStorage::EMessageResult UIController::RequestUGCMessageBox(UINT title/* = -1 return C4JStorage::EMessage_ResultAccept; #elif defined(__PSVITA__) ProfileManager.ShowSystemMessage( SCE_MSG_DIALOG_SYSMSG_TYPE_TRC_PSN_CHAT_RESTRICTION, iPad ); - UINT uiIDA[1]; + unsigned int uiIDA[1]; uiIDA[0]=IDS_CONFIRM_OK; return ui.RequestMessageBox( title, IDS_CHAT_RESTRICTION_UGC, uiIDA, 1, iPad, Func, lpParam, app.GetStringTable(), NULL, 0, false); #else - UINT uiIDA[1]; + unsigned int uiIDA[1]; uiIDA[0]=IDS_CONFIRM_OK; return ui.RequestMessageBox( title, message, uiIDA, 1, iPad, Func, lpParam, app.GetStringTable(), NULL, 0, false); #endif } -C4JStorage::EMessageResult UIController::RequestContentRestrictedMessageBox(UINT title/* = -1 */, UINT message/* = -1 */, int iPad/* = -1*/, int( *Func)(LPVOID,int,const C4JStorage::EMessageResult)/* = NULL*/, LPVOID lpParam/* = NULL*/) +C4JStorage::EMessageResult UIController::RequestContentRestrictedMessageBox(unsigned int title/* = -1 */, unsigned int message/* = -1 */, int iPad/* = -1*/, int( *Func)(void*,int,const C4JStorage::EMessageResult)/* = NULL*/, void* lpParam/* = NULL*/) { // Default title / messages if (title == -1) @@ -2524,7 +2524,7 @@ C4JStorage::EMessageResult UIController::RequestContentRestrictedMessageBox(UINT ProfileManager.ShowSystemMessage( SCE_MSG_DIALOG_SYSMSG_TYPE_TRC_PSN_AGE_RESTRICTION, iPad ); return C4JStorage::EMessage_ResultAccept; #else - UINT uiIDA[1]; + unsigned int uiIDA[1]; uiIDA[0]=IDS_CONFIRM_OK; return ui.RequestMessageBox( title, message, uiIDA, 1, iPad, Func, lpParam, app.GetStringTable(), NULL, 0, false); #endif diff --git a/src/client/Common/UI/UIController.h b/src/client/Common/UI/UIController.h index ef064f80..75ddd17b 100644 --- a/src/client/Common/UI/UIController.h +++ b/src/client/Common/UI/UIController.h @@ -15,7 +15,7 @@ class UIControl; class UIController : public IUIController { public: - static __int64 iggyAllocCount; + static int64_t iggyAllocCount; // MGH - added to prevent crash loading Iggy movies while the skins were being reloaded static CRITICAL_SECTION ms_reloadSkinCS; @@ -30,7 +30,7 @@ private: static const int UI_REPEAT_KEY_DELAY_MS = 300; // How long from press until the first repeat static const int UI_REPEAT_KEY_REPEAT_RATE_MS = 100; // How long in between repeats - DWORD m_actionRepeatTimer[XUSER_MAX_COUNT][ACTION_MAX_MENU+1]; + unsigned long m_actionRepeatTimer[XUSER_MAX_COUNT][ACTION_MAX_MENU+1]; float m_fScreenWidth; float m_fScreenHeight; @@ -111,14 +111,14 @@ private: C4JRender::eViewportType m_currentRenderViewport; bool m_bCustomRenderPosition; - static DWORD m_dwTrialTimerLimitSecs; + static unsigned long m_dwTrialTimerLimitSecs; unordered_map m_substitutionTextures; typedef struct _CachedMovieData { byteArray m_ba; - __int64 m_expiry; + int64_t m_expiry; } CachedMovieData; unordered_map m_cachedMovieData; @@ -223,7 +223,7 @@ public: void setupRenderPosition(S32 xOrigin, S32 yOrigin); void SetSysUIShowing(bool bVal); - static void SetSystemUIShowing(LPVOID lpParam,bool bVal); + static void SetSystemUIShowing(void* lpParam,bool bVal); protected: virtual void setTileOrigin(S32 xPos, S32 yPos) = 0; @@ -256,7 +256,7 @@ protected: virtual void destroySubstitutionTexture(void *destroyCallBackData, GDrawTexture *handle) {} public: - void registerSubstitutionTexture(const wstring &textureName, PBYTE pbData, DWORD dwLength); + void registerSubstitutionTexture(const wstring &textureName, uint8_t* pbData, unsigned long dwLength); void unregisterSubstitutionTexture(const wstring &textureName, bool deleteData); public: @@ -293,7 +293,7 @@ public: // TOOLTIPS virtual void SetTooltipText( unsigned int iPad, unsigned int tooltip, int iTextID ); - virtual void SetEnableTooltips( unsigned int iPad, BOOL bVal ); + virtual void SetEnableTooltips( unsigned int iPad, bool bVal ); virtual void ShowTooltip( unsigned int iPad, unsigned int tooltip, bool show ); virtual void SetTooltips( unsigned int iPad, int iA, int iB=-1, int iX=-1, int iY=-1 , int iLT=-1, int iRT=-1, int iLB=-1, int iRB=-1, int iLS=-1, bool forceUpdate = false); virtual void EnableTooltip( unsigned int iPad, unsigned int tooltip, bool enable ); @@ -343,15 +343,15 @@ public: // 4J Stu - Only because of the different StringTable type, should really fix the libraries #ifndef __PS3__ - virtual C4JStorage::EMessageResult RequestMessageBox(UINT uiTitle, UINT uiText, UINT *uiOptionA,UINT uiOptionC, DWORD dwPad=XUSER_INDEX_ANY, - int( *Func)(LPVOID,int,const C4JStorage::EMessageResult)=NULL,LPVOID lpParam=NULL, C4JStringTable *pStringTable=NULL, WCHAR *pwchFormatString=NULL,DWORD dwFocusButton=0, bool bIsError = true); + virtual C4JStorage::EMessageResult RequestMessageBox(unsigned int uiTitle, unsigned int uiText, unsigned int *uiOptionA,unsigned int uiOptionC, unsigned long dwPad=XUSER_INDEX_ANY, + int( *Func)(void*,int,const C4JStorage::EMessageResult)=NULL,void* lpParam=NULL, C4JStringTable *pStringTable=NULL, wchar_t *pwchFormatString=NULL,unsigned long dwFocusButton=0, bool bIsError = true); #else - virtual C4JStorage::EMessageResult RequestMessageBox(UINT uiTitle, UINT uiText, UINT *uiOptionA,UINT uiOptionC, DWORD dwPad=XUSER_INDEX_ANY, - int( *Func)(LPVOID,int,const C4JStorage::EMessageResult)=NULL,LPVOID lpParam=NULL, StringTable *pStringTable=NULL, WCHAR *pwchFormatString=NULL,DWORD dwFocusButton=0, bool bIsError = true); + virtual C4JStorage::EMessageResult RequestMessageBox(unsigned int uiTitle, unsigned int uiText, unsigned int *uiOptionA,unsigned int uiOptionC, unsigned long dwPad=XUSER_INDEX_ANY, + int( *Func)(void*,int,const C4JStorage::EMessageResult)=NULL,void* lpParam=NULL, StringTable *pStringTable=NULL, wchar_t *pwchFormatString=NULL,unsigned long dwFocusButton=0, bool bIsError = true); #endif - C4JStorage::EMessageResult RequestUGCMessageBox(UINT title = -1, UINT message = -1, int iPad = -1, int( *Func)(LPVOID,int,const C4JStorage::EMessageResult) = NULL, LPVOID lpParam = NULL); - C4JStorage::EMessageResult RequestContentRestrictedMessageBox(UINT title = -1, UINT message = -1, int iPad = -1, int( *Func)(LPVOID,int,const C4JStorage::EMessageResult) = NULL, LPVOID lpParam = NULL); + C4JStorage::EMessageResult RequestUGCMessageBox(unsigned int title = -1, unsigned int message = -1, int iPad = -1, int( *Func)(void*,int,const C4JStorage::EMessageResult) = NULL, void* lpParam = NULL); + C4JStorage::EMessageResult RequestContentRestrictedMessageBox(unsigned int title = -1, unsigned int message = -1, int iPad = -1, int( *Func)(void*,int,const C4JStorage::EMessageResult) = NULL, void* lpParam = NULL); virtual void SetWinUserIndex(unsigned int iPad); unsigned int GetWinUserIndex(); diff --git a/src/client/Common/UI/UIGroup.cpp b/src/client/Common/UI/UIGroup.cpp index 1899d05b..00839b8c 100644 --- a/src/client/Common/UI/UIGroup.cpp +++ b/src/client/Common/UI/UIGroup.cpp @@ -380,10 +380,10 @@ unsigned int UIGroup::GetLayerIndex(UILayer* layerPtr) return 0; } -void UIGroup::PrintTotalMemoryUsage(__int64 &totalStatic, __int64 &totalDynamic) +void UIGroup::PrintTotalMemoryUsage(int64_t &totalStatic, int64_t &totalDynamic) { - __int64 groupStatic = 0; - __int64 groupDynamic = 0; + int64_t groupStatic = 0; + int64_t groupDynamic = 0; app.DebugPrintf(app.USER_SR, "-- BEGIN GROUP %d\n",m_group); for(unsigned int i = 0; i < eUILayer_COUNT; ++i) { diff --git a/src/client/Common/UI/UIGroup.h b/src/client/Common/UI/UIGroup.h index e20fbb02..c26962e3 100644 --- a/src/client/Common/UI/UIGroup.h +++ b/src/client/Common/UI/UIGroup.h @@ -100,7 +100,7 @@ public: void handleUnlockFullVersion(); - void PrintTotalMemoryUsage(__int64 &totalStatic, __int64 &totalDynamic); + void PrintTotalMemoryUsage(int64_t &totalStatic, int64_t &totalDynamic); unsigned int GetLayerIndex(UILayer* layerPtr); diff --git a/src/client/Common/UI/UILayer.cpp b/src/client/Common/UI/UILayer.cpp index e6f87f81..6a972d2e 100644 --- a/src/client/Common/UI/UILayer.cpp +++ b/src/client/Common/UI/UILayer.cpp @@ -838,10 +838,10 @@ void UILayer::handleUnlockFullVersion() } } -void UILayer::PrintTotalMemoryUsage(__int64 &totalStatic, __int64 &totalDynamic) +void UILayer::PrintTotalMemoryUsage(int64_t &totalStatic, int64_t &totalDynamic) { - __int64 layerStatic = 0; - __int64 layerDynamic = 0; + int64_t layerStatic = 0; + int64_t layerDynamic = 0; for(AUTO_VAR(it,m_components.begin()); it != m_components.end(); ++it) { (*it)->PrintTotalMemoryUsage(layerStatic, layerDynamic); diff --git a/src/client/Common/UI/UILayer.h b/src/client/Common/UI/UILayer.h index 2840f23f..f5ef9c45 100644 --- a/src/client/Common/UI/UILayer.h +++ b/src/client/Common/UI/UILayer.h @@ -86,6 +86,6 @@ public: void handleUnlockFullVersion(); UIScene *FindScene(EUIScene sceneType); - void PrintTotalMemoryUsage(__int64 &totalStatic, __int64 &totalDynamic); + void PrintTotalMemoryUsage(int64_t &totalStatic, int64_t &totalDynamic); }; diff --git a/src/client/Common/UI/UIScene.cpp b/src/client/Common/UI/UIScene.cpp index d084af6d..6c37c50b 100644 --- a/src/client/Common/UI/UIScene.cpp +++ b/src/client/Common/UI/UIScene.cpp @@ -328,11 +328,11 @@ void UIScene::loadMovie() } byteArray baFile = ui.getMovieData(moviePath.c_str()); - __int64 beforeLoad = ui.iggyAllocCount; + int64_t beforeLoad = ui.iggyAllocCount; swf = IggyPlayerCreateFromMemory ( baFile.data , baFile.length, NULL); - __int64 afterLoad = ui.iggyAllocCount; + int64_t afterLoad = ui.iggyAllocCount; IggyPlayerInitializeAndTickRS ( swf ); - __int64 afterTick = ui.iggyAllocCount; + int64_t afterTick = ui.iggyAllocCount; if(!swf) { @@ -361,8 +361,8 @@ void UIScene::loadMovie() IggyMemoryUseInfo memoryInfo; rrbool res; int iteration = 0; - __int64 totalStatic = 0; - __int64 totalDynamic = 0; + int64_t totalStatic = 0; + int64_t totalDynamic = 0; while(res = IggyDebugGetMemoryUseInfo ( swf , NULL , 0 , @@ -405,15 +405,15 @@ void UIScene::getDebugMemoryUseRecursive(const wstring &moviePath, IggyMemoryUse } } -void UIScene::PrintTotalMemoryUsage(__int64 &totalStatic, __int64 &totalDynamic) +void UIScene::PrintTotalMemoryUsage(int64_t &totalStatic, int64_t &totalDynamic) { if(!swf) return; IggyMemoryUseInfo memoryInfo; rrbool res; int iteration = 0; - __int64 sceneStatic = 0; - __int64 sceneDynamic = 0; + int64_t sceneStatic = 0; + int64_t sceneDynamic = 0; while(res = IggyDebugGetMemoryUseInfo ( swf , NULL , "" , @@ -1161,7 +1161,7 @@ void UIScene::externalCallback(IggyExternalFunctionCallUTF16 * call) } } -void UIScene::registerSubstitutionTexture(const wstring &textureName, PBYTE pbData, DWORD dwLength, bool deleteData) +void UIScene::registerSubstitutionTexture(const wstring &textureName, uint8_t* pbData, unsigned long dwLength, bool deleteData) { m_registeredTextures[textureName] = deleteData;; ui.registerSubstitutionTexture(textureName, pbData, dwLength); diff --git a/src/client/Common/UI/UIScene.h b/src/client/Common/UI/UIScene.h index 823c510c..353e5120 100644 --- a/src/client/Common/UI/UIScene.h +++ b/src/client/Common/UI/UIScene.h @@ -127,7 +127,7 @@ private: void getDebugMemoryUseRecursive(const wstring &moviePath, IggyMemoryUseInfo &memoryInfo); public: - void PrintTotalMemoryUsage(__int64 &totalStatic, __int64 &totalDynamic); + void PrintTotalMemoryUsage(int64_t &totalStatic, int64_t &totalDynamic); public: UIScene(int iPad, UILayer *parentLayer); @@ -251,7 +251,7 @@ public: #ifdef _XBOX_ONE virtual void HandleDLCLicenseChange() {} #endif - void registerSubstitutionTexture(const wstring &textureName, PBYTE pbData, DWORD dwLength, bool deleteData = false); + void registerSubstitutionTexture(const wstring &textureName, uint8_t* pbData, unsigned long dwLength, bool deleteData = false); bool hasRegisteredSubstitutionTexture(const wstring &textureName); virtual void handleUnlockFullVersion() {} diff --git a/src/client/Common/UI/UIScene_AnvilMenu.cpp b/src/client/Common/UI/UIScene_AnvilMenu.cpp index b6a1c541..90386df5 100644 --- a/src/client/Common/UI/UIScene_AnvilMenu.cpp +++ b/src/client/Common/UI/UIScene_AnvilMenu.cpp @@ -52,7 +52,7 @@ UIScene_AnvilMenu::UIScene_AnvilMenu(int iPad, void *_initData, UILayer *parentL } else { - LPCWSTR costString = app.GetString(IDS_REPAIR_COST); + const wchar_t* costString = app.GetString(IDS_REPAIR_COST); wchar_t temp[256]; swprintf(temp, 256, costString, m_repairMenu->cost); m_costString = temp; @@ -306,7 +306,7 @@ UIControl *UIScene_AnvilMenu::getSection(ESceneSection eSection) return control; } -int UIScene_AnvilMenu::KeyboardCompleteCallback(LPVOID lpParam,bool bRes) +int UIScene_AnvilMenu::KeyboardCompleteCallback(void* lpParam,bool bRes) { // 4J HEG - No reason to set value if keyboard was cancelled UIScene_AnvilMenu *pClass=(UIScene_AnvilMenu *)lpParam; @@ -334,15 +334,15 @@ void UIScene_AnvilMenu::handleEditNamePressed() case XC_LANGUAGE_JAPANESE: case XC_LANGUAGE_KOREAN: case XC_LANGUAGE_TCHINESE: - InputManager.RequestKeyboard(app.GetString(IDS_TITLE_RENAME),m_textInputAnvil.getLabel(),(DWORD)m_iPad,30,&UIScene_AnvilMenu::KeyboardCompleteCallback,this,C_4JInput::EKeyboardMode_Default); + InputManager.RequestKeyboard(app.GetString(IDS_TITLE_RENAME),m_textInputAnvil.getLabel(),(unsigned long)m_iPad,30,&UIScene_AnvilMenu::KeyboardCompleteCallback,this,C_4JInput::EKeyboardMode_Default); break; default: // 4J Stu - Use a different keyboard for non-asian languages so we don't have prediction on - InputManager.RequestKeyboard(app.GetString(IDS_TITLE_RENAME),m_textInputAnvil.getLabel(),(DWORD)m_iPad,30,&UIScene_AnvilMenu::KeyboardCompleteCallback,this,C_4JInput::EKeyboardMode_Alphabet_Extended); + InputManager.RequestKeyboard(app.GetString(IDS_TITLE_RENAME),m_textInputAnvil.getLabel(),(unsigned long)m_iPad,30,&UIScene_AnvilMenu::KeyboardCompleteCallback,this,C_4JInput::EKeyboardMode_Alphabet_Extended); break; } #else - InputManager.RequestKeyboard(app.GetString(IDS_TITLE_RENAME),m_textInputAnvil.getLabel(),(DWORD)m_iPad,30,&UIScene_AnvilMenu::KeyboardCompleteCallback,this,C_4JInput::EKeyboardMode_Default); + InputManager.RequestKeyboard(app.GetString(IDS_TITLE_RENAME),m_textInputAnvil.getLabel(),(unsigned long)m_iPad,30,&UIScene_AnvilMenu::KeyboardCompleteCallback,this,C_4JInput::EKeyboardMode_Default); #endif } diff --git a/src/client/Common/UI/UIScene_AnvilMenu.h b/src/client/Common/UI/UIScene_AnvilMenu.h index 4ed7c4e3..423a3e3e 100644 --- a/src/client/Common/UI/UIScene_AnvilMenu.h +++ b/src/client/Common/UI/UIScene_AnvilMenu.h @@ -55,7 +55,7 @@ protected: virtual UIControl *getSection(ESceneSection eSection); - static int KeyboardCompleteCallback(LPVOID lpParam,bool bRes); + static int KeyboardCompleteCallback(void* lpParam,bool bRes); virtual void handleEditNamePressed(); virtual void setEditNameValue(const wstring &name); virtual void setEditNameEditable(bool enabled); diff --git a/src/client/Common/UI/UIScene_ConnectingProgress.cpp b/src/client/Common/UI/UIScene_ConnectingProgress.cpp index 80e059a6..424e9fb9 100644 --- a/src/client/Common/UI/UIScene_ConnectingProgress.cpp +++ b/src/client/Common/UI/UIScene_ConnectingProgress.cpp @@ -186,7 +186,7 @@ void UIScene_ConnectingProgress::handleTimerComplete(int id) } else { - UINT uiIDA[1]; + unsigned int uiIDA[1]; uiIDA[0]=IDS_CONFIRM_OK; ui.RequestMessageBox( IDS_CONNECTION_FAILED, exitReasonStringId, uiIDA,1,ProfileManager.GetPrimaryPad(),NULL,NULL, app.GetStringTable()); exitReasonStringId = -1; diff --git a/src/client/Common/UI/UIScene_ConnectingProgress.h b/src/client/Common/UI/UIScene_ConnectingProgress.h index 2c52284c..e0a0ac6e 100644 --- a/src/client/Common/UI/UIScene_ConnectingProgress.h +++ b/src/client/Common/UI/UIScene_ConnectingProgress.h @@ -10,8 +10,8 @@ private: bool m_showTooltips; bool m_removeLocalPlayer; bool m_showingButton; - void (*m_cancelFunc)(LPVOID param); - LPVOID m_cancelFuncParam; + void (*m_cancelFunc)(void* param); + void* m_cancelFuncParam; enum EControls { diff --git a/src/client/Common/UI/UIScene_ControlsMenu.cpp b/src/client/Common/UI/UIScene_ControlsMenu.cpp index b26317e7..70ef32b9 100644 --- a/src/client/Common/UI/UIScene_ControlsMenu.cpp +++ b/src/client/Common/UI/UIScene_ControlsMenu.cpp @@ -29,7 +29,7 @@ UIScene_ControlsMenu::UIScene_ControlsMenu(int iPad, void *initData, UILayer *pa if(bNotInGame) { - LPWSTR layoutString = new wchar_t[ 128 ]; + wchar_t* layoutString = new wchar_t[ 128 ]; swprintf( layoutString, 128, L"%ls", VER_PRODUCTVERSION_STR_W); m_labelVersion.init(layoutString); delete [] layoutString; @@ -63,7 +63,7 @@ UIScene_ControlsMenu::UIScene_ControlsMenu(int iPad, void *initData, UILayer *pa int iSelected=app.GetGameSettings(m_iPad,eGameSetting_ControlScheme); #ifndef __PSVITA__ - LPWSTR layoutString = new wchar_t[ 128 ]; + wchar_t* layoutString = new wchar_t[ 128 ]; swprintf( layoutString, 128, L"%ls : %ls", app.GetString( IDS_CURRENT_LAYOUT ),app.GetString(m_iSchemeTextA[iSelected])); #ifdef __ORBIS__ if (!InputManager.UsingRemoteVita()) @@ -201,7 +201,7 @@ void UIScene_ControlsMenu::handlePress(F64 controlId, F64 childId) case eControl_Button1: case eControl_Button2: app.SetGameSettings(m_iPad,eGameSetting_ControlScheme,(unsigned char)control); - LPWSTR layoutString = new wchar_t[ 128 ]; + wchar_t* layoutString = new wchar_t[ 128 ]; swprintf( layoutString, 128, L"%ls : %ls", app.GetString( IDS_CURRENT_LAYOUT ),app.GetString(m_iSchemeTextA[control])); #ifdef __ORBIS__ if (!InputManager.UsingRemoteVita()) @@ -329,7 +329,7 @@ void UIScene_ControlsMenu::PositionText(int iPad,int iTextID, unsigned char ucAc void UIScene_ControlsMenu::PositionTextDirect(int iPad,int iTextID, int iControlDetailsIndex, bool bShow) { - LPCWSTR text = app.GetString(iTextID); + const wchar_t* text = app.GetString(iTextID); m_labelsPad[iControlDetailsIndex].setLabel(text); m_controlLines[iControlDetailsIndex].setVisible(bShow); diff --git a/src/client/Common/UI/UIScene_CraftingMenu.cpp b/src/client/Common/UI/UIScene_CraftingMenu.cpp index 047e0575..29ab6c75 100644 --- a/src/client/Common/UI/UIScene_CraftingMenu.cpp +++ b/src/client/Common/UI/UIScene_CraftingMenu.cpp @@ -666,7 +666,7 @@ void UIScene_CraftingMenu::setIngredientDescriptionRedBox(int index, bool show) m_slotListIngredients[index].showSlotRedBox(0,show); } -void UIScene_CraftingMenu::setIngredientDescriptionText(int index, LPCWSTR text) +void UIScene_CraftingMenu::setIngredientDescriptionText(int index, const wchar_t* text) { m_labelIngredientsDesc[index].setLabel(text); } @@ -690,17 +690,17 @@ void UIScene_CraftingMenu::showTabHighlight(int iIndex, bool show) } } -void UIScene_CraftingMenu::setGroupText(LPCWSTR text) +void UIScene_CraftingMenu::setGroupText(const wchar_t* text) { m_labelGroupName.setLabel(text); } -void UIScene_CraftingMenu::setDescriptionText(LPCWSTR text) +void UIScene_CraftingMenu::setDescriptionText(const wchar_t* text) { m_labelDescription.setLabel(text); } -void UIScene_CraftingMenu::setItemText(LPCWSTR text) +void UIScene_CraftingMenu::setItemText(const wchar_t* text) { m_labelItemName.setLabel(text); } diff --git a/src/client/Common/UI/UIScene_CraftingMenu.h b/src/client/Common/UI/UIScene_CraftingMenu.h index 44a39d61..1348d4b0 100644 --- a/src/client/Common/UI/UIScene_CraftingMenu.h +++ b/src/client/Common/UI/UIScene_CraftingMenu.h @@ -190,12 +190,12 @@ protected: virtual void setIngredientSlotRedBox(int index, bool show); virtual void setIngredientDescriptionItem(int iPad, int index, shared_ptr item); virtual void setIngredientDescriptionRedBox(int index, bool show); - virtual void setIngredientDescriptionText(int index, LPCWSTR text); + virtual void setIngredientDescriptionText(int index, const wchar_t* text); virtual void setShowCraftHSlot(int iIndex, bool show); virtual void showTabHighlight(int iIndex, bool show); - virtual void setGroupText(LPCWSTR text); - virtual void setDescriptionText(LPCWSTR text); - virtual void setItemText(LPCWSTR text); + virtual void setGroupText(const wchar_t* text); + virtual void setDescriptionText(const wchar_t* text); + virtual void setItemText(const wchar_t* text); virtual void scrollDescriptionUp(); virtual void scrollDescriptionDown(); virtual void updateHighlightAndScrollPositions(); diff --git a/src/client/Common/UI/UIScene_CreateWorldMenu.cpp b/src/client/Common/UI/UIScene_CreateWorldMenu.cpp index 86ec5729..0cd79bb7 100644 --- a/src/client/Common/UI/UIScene_CreateWorldMenu.cpp +++ b/src/client/Common/UI/UIScene_CreateWorldMenu.cpp @@ -60,8 +60,8 @@ UIScene_CreateWorldMenu::UIScene_CreateWorldMenu(int iPad, void *initData, UILay m_labelTexturePackName.init(L""); m_labelTexturePackDescription.init(L""); - WCHAR TempString[256]; - swprintf( (WCHAR *)TempString, 256, L"%ls: %ls", app.GetString( IDS_SLIDER_DIFFICULTY ),app.GetString(m_iDifficultyTitleSettingA[app.GetGameSettings(m_iPad,eGameSetting_Difficulty)])); + wchar_t TempString[256]; + swprintf( (wchar_t *)TempString, 256, L"%ls: %ls", app.GetString( IDS_SLIDER_DIFFICULTY ),app.GetString(m_iDifficultyTitleSettingA[app.GetGameSettings(m_iPad,eGameSetting_Difficulty)])); m_sliderDifficulty.init(TempString,eControl_Difficulty,0,3,app.GetGameSettings(m_iPad,eGameSetting_Difficulty)); m_MoreOptionsParams.bGenerateOptions=true; @@ -167,8 +167,8 @@ UIScene_CreateWorldMenu::UIScene_CreateWorldMenu(int iPad, void *initData, UILay { TexturePack *tp = pMinecraft->skins->getTexturePackByIndex(i); - DWORD dwImageBytes; - PBYTE pbImageData = tp->getPackIcon(dwImageBytes); + unsigned long dwImageBytes; + uint8_t* pbImageData = tp->getPackIcon(dwImageBytes); if(dwImageBytes > 0 && pbImageData) { @@ -191,7 +191,7 @@ UIScene_CreateWorldMenu::UIScene_CreateWorldMenu(int iPad, void *initData, UILay for(unsigned int i = 0; i < app.GetDLCInfoTexturesOffersCount(); ++i) { bTexturePackAlreadyListed=false; - ULONGLONG ull=app.GetDLCInfoTexturesFullOffer(i); + uint64_t ull=app.GetDLCInfoTexturesFullOffer(i); pDLCInfo=app.GetDLCInfoForFullOfferID(ull); for(unsigned int i = 0; i < texturePacksCount; ++i) { @@ -221,7 +221,7 @@ UIScene_CreateWorldMenu::UIScene_CreateWorldMenu(int iPad, void *initData, UILay for(unsigned int i = 0; i < app.GetDLCInfoTexturesOffersCount(); ++i) { bTexturePackAlreadyListed=false; - ULONGLONG ull=app.GetDLCInfoTexturesFullOffer(i); + uint64_t ull=app.GetDLCInfoTexturesFullOffer(i); pDLCInfo=app.GetDLCInfoForFullOfferID(ull); for(unsigned int i = 0; i < texturePacksCount; ++i) { @@ -319,7 +319,7 @@ void UIScene_CreateWorldMenu::tick() else { // continue offline? - UINT uiIDA[1]; + unsigned int uiIDA[1]; uiIDA[0]=IDS_PRO_NOTONLINE_DECLINE; // Give the player a warning about the texture pack missing @@ -373,7 +373,7 @@ void UIScene_CreateWorldMenu::handleInput(int iPad, int key, bool repeat, bool p #if defined _XBOX_ONE if ( pressed && controlHasFocus(m_checkboxOnline.getId()) && !m_checkboxOnline.IsEnabled() ) { - UINT uiIDA[1] = { IDS_CONFIRM_OK }; + unsigned int uiIDA[1] = { IDS_CONFIRM_OK }; ui.RequestMessageBox(IDS_PRO_NOTONLINE_TITLE, IDS_PRO_XBOXLIVE_NOTIFICATION, uiIDA, 1, iPad, NULL, NULL, app.GetStringTable()); } #endif @@ -420,7 +420,7 @@ void UIScene_CreateWorldMenu::handlePress(F64 controlId, F64 childId) case eControl_EditWorldName: { m_bIgnoreInput=true; - InputManager.RequestKeyboard(app.GetString(IDS_CREATE_NEW_WORLD),m_editWorldName.getLabel(),(DWORD)0,25,&UIScene_CreateWorldMenu::KeyboardCompleteWorldNameCallback,this,C_4JInput::EKeyboardMode_Default); + InputManager.RequestKeyboard(app.GetString(IDS_CREATE_NEW_WORLD),m_editWorldName.getLabel(),(unsigned long)0,25,&UIScene_CreateWorldMenu::KeyboardCompleteWorldNameCallback,this,C_4JInput::EKeyboardMode_Default); } break; case eControl_EditSeed: @@ -433,15 +433,15 @@ void UIScene_CreateWorldMenu::handlePress(F64 controlId, F64 childId) case XC_LANGUAGE_JAPANESE: case XC_LANGUAGE_KOREAN: case XC_LANGUAGE_TCHINESE: - InputManager.RequestKeyboard(app.GetString(IDS_CREATE_NEW_WORLD_SEED),m_editSeed.getLabel(),(DWORD)0,60,&UIScene_CreateWorldMenu::KeyboardCompleteSeedCallback,this,C_4JInput::EKeyboardMode_Default); + InputManager.RequestKeyboard(app.GetString(IDS_CREATE_NEW_WORLD_SEED),m_editSeed.getLabel(),(unsigned long)0,60,&UIScene_CreateWorldMenu::KeyboardCompleteSeedCallback,this,C_4JInput::EKeyboardMode_Default); break; default: // 4J Stu - Use a different keyboard for non-asian languages so we don't have prediction on - InputManager.RequestKeyboard(app.GetString(IDS_CREATE_NEW_WORLD_SEED),m_editSeed.getLabel(),(DWORD)0,60,&UIScene_CreateWorldMenu::KeyboardCompleteSeedCallback,this,C_4JInput::EKeyboardMode_Alphabet_Extended); + InputManager.RequestKeyboard(app.GetString(IDS_CREATE_NEW_WORLD_SEED),m_editSeed.getLabel(),(unsigned long)0,60,&UIScene_CreateWorldMenu::KeyboardCompleteSeedCallback,this,C_4JInput::EKeyboardMode_Alphabet_Extended); break; } #else - InputManager.RequestKeyboard(app.GetString(IDS_CREATE_NEW_WORLD_SEED),m_editSeed.getLabel(),(DWORD)0,60,&UIScene_CreateWorldMenu::KeyboardCompleteSeedCallback,this,C_4JInput::EKeyboardMode_Default); + InputManager.RequestKeyboard(app.GetString(IDS_CREATE_NEW_WORLD_SEED),m_editSeed.getLabel(),(unsigned long)0,60,&UIScene_CreateWorldMenu::KeyboardCompleteSeedCallback,this,C_4JInput::EKeyboardMode_Default); #endif } break; @@ -484,7 +484,7 @@ void UIScene_CreateWorldMenu::handlePress(F64 controlId, F64 childId) } #ifdef _DURANGO -void UIScene_CreateWorldMenu::checkPrivilegeCallback(LPVOID lpParam, bool hasPrivilege, int iPad) +void UIScene_CreateWorldMenu::checkPrivilegeCallback(void* lpParam, bool hasPrivilege, int iPad) { UIScene_CreateWorldMenu* pClass = (UIScene_CreateWorldMenu*)lpParam; @@ -520,13 +520,13 @@ void UIScene_CreateWorldMenu::StartSharedLaunchFlow() // upsell the texture pack // tell sentient about the upsell of the full version of the skin pack - ULONGLONG ullOfferID_Full; + uint64_t ullOfferID_Full; app.GetDLCFullOfferIDForPackID(m_MoreOptionsParams.dwTexturePack,&ullOfferID_Full); TelemetryManager->RecordUpsellPresented(ProfileManager.GetPrimaryPad(), eSet_UpsellID_Texture_DLC, ullOfferID_Full & 0xFFFFFFFF); #endif - UINT uiIDA[2]; + unsigned int uiIDA[2]; uiIDA[0]=IDS_TEXTUREPACK_FULLVERSION; //uiIDA[1]=IDS_TEXTURE_PACK_TRIALVERSION; @@ -569,7 +569,7 @@ void UIScene_CreateWorldMenu::StartSharedLaunchFlow() // We need to allow people to use a trial texture pack if they are offline - we only need them online if they want to buy it. /* - UINT uiIDA[1]; + unsigned int uiIDA[1]; uiIDA[0]=IDS_OK; if(!ProfileManager.IsSignedInLive(m_iPad)) @@ -584,7 +584,7 @@ void UIScene_CreateWorldMenu::StartSharedLaunchFlow() // upsell #ifdef _XBOX DLC_INFO *pDLCInfo = app.GetDLCInfoForTrialOfferID(m_pDLCPack->getPurchaseOfferId()); - ULONGLONG ullOfferID_Full; + uint64_t ullOfferID_Full; if(pDLCInfo!=NULL) { @@ -601,12 +601,12 @@ void UIScene_CreateWorldMenu::StartSharedLaunchFlow() #if defined(_DURANGO) || defined(_WINDOWS64) // trial pack warning - UINT uiIDA[1]; + unsigned int uiIDA[1]; uiIDA[0]=IDS_CONFIRM_OK; ui.RequestMessageBox(IDS_WARNING_DLC_TRIALTEXTUREPACK_TITLE, IDS_USING_TRIAL_TEXUREPACK_WARNING, uiIDA, 1, m_iPad,&TrialTexturePackWarningReturned,this,app.GetStringTable(),NULL,0,false); #elif defined __PS3__ || defined __ORBIS__ || defined(__PSVITA__) // trial pack warning - UINT uiIDA[2]; + unsigned int uiIDA[2]; uiIDA[0]=IDS_CONFIRM_OK; uiIDA[1]=IDS_CONFIRM_CANCEL; ui.RequestMessageBox(IDS_WARNING_DLC_TRIALTEXTUREPACK_TITLE, IDS_USING_TRIAL_TEXUREPACK_WARNING, uiIDA, 2, m_iPad,&TrialTexturePackWarningReturned,this,app.GetStringTable(),NULL,0,false); @@ -628,7 +628,7 @@ void UIScene_CreateWorldMenu::StartSharedLaunchFlow() void UIScene_CreateWorldMenu::handleSliderMove(F64 sliderId, F64 currentValue) { - WCHAR TempString[256]; + wchar_t TempString[256]; int value = (int)currentValue; switch((int)sliderId) { @@ -636,7 +636,7 @@ void UIScene_CreateWorldMenu::handleSliderMove(F64 sliderId, F64 currentValue) m_sliderDifficulty.handleSliderMove(value); app.SetGameSettings(m_iPad,eGameSetting_Difficulty,value); - swprintf( (WCHAR *)TempString, 256, L"%ls: %ls", app.GetString( IDS_SLIDER_DIFFICULTY ),app.GetString(m_iDifficultyTitleSettingA[value])); + swprintf( (wchar_t *)TempString, 256, L"%ls: %ls", app.GetString( IDS_SLIDER_DIFFICULTY ),app.GetString(m_iDifficultyTitleSettingA[value])); m_sliderDifficulty.setLabel(TempString); break; } @@ -708,8 +708,8 @@ void UIScene_CreateWorldMenu::handleTimerComplete(int id) { if(m_iConfigA[i]!=-1) { - DWORD dwBytes=0; - PBYTE pbData=NULL; + unsigned long dwBytes=0; + uint8_t* pbData=NULL; //app.DebugPrintf("Retrieving iConfig %d from TPD\n",m_iConfigA[i]); app.GetTPD(m_iConfigA[i],&pbData,&dwBytes); @@ -717,13 +717,13 @@ void UIScene_CreateWorldMenu::handleTimerComplete(int id) ZeroMemory(&ListInfo,sizeof(CXuiCtrl4JList::LIST_ITEM_INFO)); if(dwBytes > 0 && pbData) { - DWORD dwImageBytes=0; - PBYTE pbImageData=NULL; + unsigned long dwImageBytes=0; + uint8_t* pbImageData=NULL; app.GetFileFromTPD(eTPDFileType_Icon,pbData,dwBytes,&pbImageData,&dwImageBytes ); ListInfo.fEnabled = true; ListInfo.iData = m_iConfigA[i]; - HRESULT hr=XuiCreateTextureBrushFromMemory(pbImageData,dwImageBytes,&ListInfo.hXuiBrush); + int hr=XuiCreateTextureBrushFromMemory(pbImageData,dwImageBytes,&ListInfo.hXuiBrush); app.DebugPrintf("Adding texturepack %d from TPD\n",m_iConfigA[i]); m_pTexturePacksList->AddData(ListInfo); @@ -752,7 +752,7 @@ void UIScene_CreateWorldMenu::handleGainFocus(bool navBack) } } -int UIScene_CreateWorldMenu::KeyboardCompleteWorldNameCallback(LPVOID lpParam,bool bRes) +int UIScene_CreateWorldMenu::KeyboardCompleteWorldNameCallback(void* lpParam,bool bRes) { UIScene_CreateWorldMenu *pClass=(UIScene_CreateWorldMenu *)lpParam; pClass->m_bIgnoreInput=false; @@ -774,7 +774,7 @@ int UIScene_CreateWorldMenu::KeyboardCompleteWorldNameCallback(LPVOID lpParam,bo return 0; } -int UIScene_CreateWorldMenu::KeyboardCompleteSeedCallback(LPVOID lpParam,bool bRes) +int UIScene_CreateWorldMenu::KeyboardCompleteSeedCallback(void* lpParam,bool bRes) { UIScene_CreateWorldMenu *pClass=(UIScene_CreateWorldMenu *)lpParam; pClass->m_bIgnoreInput=false; @@ -830,14 +830,14 @@ void UIScene_CreateWorldMenu::checkStateAndStartGame() { m_bIgnoreInput = false; // 4J Stu - This is a bit messy and is due to the library incorrectly returning false for IsSignedInLive if the npAvailability isn't SCE_OK - UINT uiIDA[1]; + unsigned int uiIDA[1]; uiIDA[0]=IDS_OK; ui.RequestMessageBox(IDS_ONLINE_SERVICE_TITLE, IDS_CONTENT_RESTRICTION, uiIDA, 1, iPadNotSignedInLive, NULL, NULL, app.GetStringTable()); } else { m_bIgnoreInput = true; - UINT uiIDA[2]; + unsigned int uiIDA[2]; uiIDA[0] = IDS_PRO_NOTONLINE_ACCEPT; uiIDA[1] = IDS_CANCEL; ui.RequestMessageBox( IDS_PRO_NOTONLINE_TITLE, IDS_PRO_NOTONLINE_TEXT, uiIDA, 2, iPadNotSignedInLive, &UIScene_CreateWorldMenu::MustSignInReturnedPSN, this, app.GetStringTable(), NULL, 0, false); @@ -850,21 +850,21 @@ void UIScene_CreateWorldMenu::checkStateAndStartGame() if (ProfileManager.IsSignedInPSN(ProfileManager.GetPrimaryPad())) { // Signed in to PSN but not connected (no internet access) - UINT uiIDA[1]; + unsigned int uiIDA[1]; uiIDA[0] = IDS_CONFIRM_OK; ui.RequestMessageBox(IDS_PRO_CURRENTLY_NOT_ONLINE_TITLE, IDS_PRO_PSNOFFLINE_TEXT, uiIDA, 1, ProfileManager.GetPrimaryPad(), NULL,NULL, app.GetStringTable()); } else { // Not signed in to PSN - UINT uiIDA[1]; + unsigned int uiIDA[1]; uiIDA[0] = IDS_CONFIRM_OK; ui.RequestMessageBox(IDS_PRO_NOTONLINE_TITLE, IDS_PRO_NOTONLINE_TEXT, uiIDA, 1, ProfileManager.GetPrimaryPad(), NULL,NULL, app.GetStringTable()); return; }*/ #else m_bIgnoreInput=false; - UINT uiIDA[1]; + unsigned int uiIDA[1]; uiIDA[0]=IDS_CONFIRM_OK; ui.RequestMessageBox( IDS_PRO_NOTONLINE_TITLE, IDS_PRO_NOTONLINE_TEXT, uiIDA,1,ProfileManager.GetPrimaryPad(),NULL,NULL, app.GetStringTable(),NULL,0,false); return; @@ -906,7 +906,7 @@ void UIScene_CreateWorldMenu::checkStateAndStartGame() iResult=sceNpCommerceDialogOpen(¶m); -// UINT uiIDA[2]; +// unsigned int uiIDA[2]; // uiIDA[0]=IDS_PLAY_OFFLINE; // uiIDA[1]=IDS_PLAYSTATIONPLUS_SIGNUP; // ui.RequestMessageBox( IDS_FAILED_TO_CREATE_GAME_TITLE, IDS_NO_PLAYSTATIONPLUS, uiIDA,2,ProfileManager.GetPrimaryPad(),&UIScene_CreateWorldMenu::PSPlusReturned,this, app.GetStringTable(),NULL,0,false); @@ -917,7 +917,7 @@ void UIScene_CreateWorldMenu::checkStateAndStartGame() if(m_bGameModeSurvival != true || m_MoreOptionsParams.bHostPrivileges == true) { - UINT uiIDA[2]; + unsigned int uiIDA[2]; uiIDA[0]=IDS_CONFIRM_OK; uiIDA[1]=IDS_CONFIRM_CANCEL; if(m_bGameModeSurvival != true) @@ -932,7 +932,7 @@ void UIScene_CreateWorldMenu::checkStateAndStartGame() else { // 4J Stu - If we only have one controller connected, then don't show the sign-in UI again - DWORD connectedControllers = 0; + unsigned long connectedControllers = 0; for(unsigned int i = 0; i < XUSER_MAX_COUNT; ++i) { if( InputManager.IsPadConnected(i) || ProfileManager.IsSignedIn(i) ) ++connectedControllers; @@ -941,8 +941,8 @@ void UIScene_CreateWorldMenu::checkStateAndStartGame() // Check if user-created content is allowed, as we cannot play multiplayer if it's not //bool isClientSide = ProfileManager.IsSignedInLive(ProfileManager.GetPrimaryPad()) && m_MoreOptionsParams.bOnlineGame; bool noUGC = false; - BOOL pccAllowed = true; - BOOL pccFriendsAllowed = true; + bool pccAllowed = true; + bool pccFriendsAllowed = true; bool bContentRestricted = false; ProfileManager.AllowedPlayerCreatedContent(ProfileManager.GetPrimaryPad(),false,&pccAllowed,&pccFriendsAllowed); @@ -984,7 +984,7 @@ void UIScene_CreateWorldMenu::checkStateAndStartGame() param.userId = ProfileManager.getUserID(iPadWithNoPlaystationPlus); iResult=sceNpCommerceDialogOpen(¶m); -// UINT uiIDA[2]; +// unsigned int uiIDA[2]; // uiIDA[0]=IDS_PLAY_OFFLINE; // uiIDA[1]=IDS_PLAYSTATIONPLUS_SIGNUP; // ui.RequestMessageBox( IDS_FAILED_TO_CREATE_GAME_TITLE, IDS_NO_PLAYSTATIONPLUS, uiIDA,2,ProfileManager.GetPrimaryPad(),&UIScene_CreateWorldMenu::PSPlusReturned,this, app.GetStringTable(),NULL,0,false); @@ -1033,7 +1033,7 @@ void UIScene_CreateWorldMenu::checkStateAndStartGame() iResult=sceNpCommerceDialogOpen(¶m); -// UINT uiIDA[2]; +// unsigned int uiIDA[2]; // uiIDA[0]=IDS_PLAY_OFFLINE; // uiIDA[1]=IDS_PLAYSTATIONPLUS_SIGNUP; // ui.RequestMessageBox( IDS_FAILED_TO_CREATE_GAME_TITLE, IDS_NO_PLAYSTATIONPLUS, uiIDA,2,ProfileManager.GetPrimaryPad(),&UIScene_CreateWorldMenu::PSPlusReturned,this, app.GetStringTable(),NULL,0,false); @@ -1061,7 +1061,7 @@ void UIScene_CreateWorldMenu::checkStateAndStartGame() } // 4J Stu - Shared functionality that is the same whether we needed a quadrant sign-in or not -void UIScene_CreateWorldMenu::CreateGame(UIScene_CreateWorldMenu* pClass, DWORD dwLocalUsersMask) +void UIScene_CreateWorldMenu::CreateGame(UIScene_CreateWorldMenu* pClass, unsigned long dwLocalUsersMask) { #if TO_BE_IMPLEMENTED // stop the timer running that causes a check for new texture packs in TMS but not installed, since this will run all through the create game, and will crash if it tries to create an hbrush @@ -1102,13 +1102,13 @@ void UIScene_CreateWorldMenu::CreateGame(UIScene_CreateWorldMenu* pClass, DWORD // start the game bool isFlat = (pClass->m_MoreOptionsParams.bFlatWorld==true); - __int64 seedValue = 0; + int64_t seedValue = 0; NetworkGameInitData *param = new NetworkGameInitData(); if (wSeed.length() != 0) { - __int64 value = 0; + int64_t value = 0; unsigned int len = (unsigned int)wSeed.length(); //Check if the input string contains a numerical value @@ -1127,7 +1127,7 @@ void UIScene_CreateWorldMenu::CreateGame(UIScene_CreateWorldMenu* pClass, DWORD //If the input string is a numerical value, convert it to a number if( isNumber ) - value = _fromString<__int64>(wSeed); + value = _fromString(wSeed); //If the value is not 0 use it, otherwise use the algorithm from the java String.hashCode() function to hash it if( value != 0 ) @@ -1214,7 +1214,7 @@ void UIScene_CreateWorldMenu::CreateGame(UIScene_CreateWorldMenu* pClass, DWORD LoadingInputParams *loadingParams = new LoadingInputParams(); loadingParams->func = &CGameNetworkManager::RunNetworkGameThreadProc; - loadingParams->lpParam = (LPVOID)param; + loadingParams->lpParam = (void*)param; // Reset the autosave time app.SetAutosaveTimerTime(); @@ -1243,7 +1243,7 @@ int UIScene_CreateWorldMenu::StartGame_SignInReturned(void *pParam,bool bContinu // bool isOnlineGame = pClass->m_MoreOptionsParams.bOnlineGame; int primaryPad = ProfileManager.GetPrimaryPad(); bool noPrivileges = false; - DWORD dwLocalUsersMask = 0; + unsigned long dwLocalUsersMask = 0; bool isSignedInLive = ProfileManager.IsSignedInLive(primaryPad); int iPadNotSignedInLive = -1; bool isLocalMultiplayerAvailable = app.IsLocalMultiplayerAvailable(); @@ -1276,14 +1276,14 @@ int UIScene_CreateWorldMenu::StartGame_SignInReturned(void *pParam,bool bContinu { pClass->m_bIgnoreInput = false; // 4J Stu - This is a bit messy and is due to the library incorrectly returning false for IsSignedInLive if the npAvailability isn't SCE_OK - UINT uiIDA[1]; + unsigned int uiIDA[1]; uiIDA[0]=IDS_OK; ui.RequestMessageBox(IDS_ONLINE_SERVICE_TITLE, IDS_CONTENT_RESTRICTION, uiIDA, 1, iPadNotSignedInLive, NULL, NULL, app.GetStringTable()); } else { pClass->m_bIgnoreInput=true; - UINT uiIDA[2]; + unsigned int uiIDA[2]; uiIDA[0] = IDS_PRO_NOTONLINE_ACCEPT; uiIDA[1] = IDS_CANCEL; ui.RequestMessageBox( IDS_PRO_NOTONLINE_TITLE, IDS_PRO_NOTONLINE_TEXT, uiIDA, 2, iPadNotSignedInLive, &UIScene_CreateWorldMenu::MustSignInReturnedPSN, pClass, app.GetStringTable(), NULL, 0, false); @@ -1291,7 +1291,7 @@ int UIScene_CreateWorldMenu::StartGame_SignInReturned(void *pParam,bool bContinu return 0; #else pClass->m_bIgnoreInput=false; - UINT uiIDA[1]; + unsigned int uiIDA[1]; uiIDA[0]=IDS_CONFIRM_OK; ui.RequestMessageBox( IDS_PRO_NOTONLINE_TITLE, IDS_PRO_NOTONLINE_TEXT, uiIDA,1,ProfileManager.GetPrimaryPad(),NULL,NULL, app.GetStringTable(),NULL,0,false); return 0; @@ -1300,8 +1300,8 @@ int UIScene_CreateWorldMenu::StartGame_SignInReturned(void *pParam,bool bContinu // Check if user-created content is allowed, as we cannot play multiplayer if it's not bool noUGC = false; - BOOL pccAllowed = true; - BOOL pccFriendsAllowed = true; + bool pccAllowed = true; + bool pccFriendsAllowed = true; ProfileManager.AllowedPlayerCreatedContent(ProfileManager.GetPrimaryPad(),false,&pccAllowed,&pccFriendsAllowed); if(!pccAllowed && !pccFriendsAllowed) noUGC = true; @@ -1311,14 +1311,14 @@ int UIScene_CreateWorldMenu::StartGame_SignInReturned(void *pParam,bool bContinu if( noUGC ) { pClass->m_bIgnoreInput = false; - UINT uiIDA[1]; + unsigned int uiIDA[1]; uiIDA[0]=IDS_CONFIRM_OK; ui.RequestMessageBox( IDS_FAILED_TO_CREATE_GAME_TITLE, IDS_NO_USER_CREATED_CONTENT_PRIVILEGE_CREATE, uiIDA,1,ProfileManager.GetPrimaryPad(),NULL,NULL, app.GetStringTable(),NULL,0,false); } else { pClass->m_bIgnoreInput = false; - UINT uiIDA[1]; + unsigned int uiIDA[1]; uiIDA[0]=IDS_CONFIRM_OK; ui.RequestMessageBox( IDS_NO_MULTIPLAYER_PRIVILEGE_TITLE, IDS_NO_MULTIPLAYER_PRIVILEGE_HOST_TEXT, uiIDA,1,ProfileManager.GetPrimaryPad(),NULL,NULL, app.GetStringTable(),NULL,0,false); } @@ -1347,7 +1347,7 @@ int UIScene_CreateWorldMenu::ConfirmCreateReturned(void *pParam,int iPad,C4JStor bool isClientSide = ProfileManager.IsSignedInLive(ProfileManager.GetPrimaryPad()) && pClass->m_MoreOptionsParams.bOnlineGame; // 4J Stu - If we only have one controller connected, then don't show the sign-in UI again - DWORD connectedControllers = 0; + unsigned long connectedControllers = 0; for(unsigned int i = 0; i < XUSER_MAX_COUNT; ++i) { if( InputManager.IsPadConnected(i) || ProfileManager.IsSignedIn(i) ) ++connectedControllers; @@ -1367,8 +1367,8 @@ int UIScene_CreateWorldMenu::ConfirmCreateReturned(void *pParam,int iPad,C4JStor // Check if user-created content is allowed, as we cannot play multiplayer if it's not bool isClientSide = ProfileManager.IsSignedInLive(ProfileManager.GetPrimaryPad()) && pClass->m_MoreOptionsParams.bOnlineGame; bool noUGC = false; - BOOL pccAllowed = true; - BOOL pccFriendsAllowed = true; + bool pccAllowed = true; + bool pccFriendsAllowed = true; ProfileManager.AllowedPlayerCreatedContent(ProfileManager.GetPrimaryPad(),false,&pccAllowed,&pccFriendsAllowed); if(!pccAllowed && !pccFriendsAllowed) noUGC = true; @@ -1376,7 +1376,7 @@ int UIScene_CreateWorldMenu::ConfirmCreateReturned(void *pParam,int iPad,C4JStor if(isClientSide && noUGC ) { pClass->m_bIgnoreInput = false; - UINT uiIDA[1]; + unsigned int uiIDA[1]; uiIDA[0]=IDS_CONFIRM_OK; ui.RequestMessageBox( IDS_FAILED_TO_CREATE_GAME_TITLE, IDS_NO_USER_CREATED_CONTENT_PRIVILEGE_CREATE, uiIDA,1,ProfileManager.GetPrimaryPad(),NULL,NULL, app.GetStringTable(),NULL,0,false); } diff --git a/src/client/Common/UI/UIScene_CreateWorldMenu.h b/src/client/Common/UI/UIScene_CreateWorldMenu.h index ebb383e8..cfa536ed 100644 --- a/src/client/Common/UI/UIScene_CreateWorldMenu.h +++ b/src/client/Common/UI/UIScene_CreateWorldMenu.h @@ -92,16 +92,16 @@ private: bool IsLocalMultiplayerAvailable(); #ifdef _DURANGO - static void checkPrivilegeCallback(LPVOID lpParam, bool hasPrivilege, int iPad); + static void checkPrivilegeCallback(void* lpParam, bool hasPrivilege, int iPad); #endif protected: - static int KeyboardCompleteWorldNameCallback(LPVOID lpParam,const bool bRes); - static int KeyboardCompleteSeedCallback(LPVOID lpParam,const bool bRes); + static int KeyboardCompleteWorldNameCallback(void* lpParam,const bool bRes); + static int KeyboardCompleteSeedCallback(void* lpParam,const bool bRes); void handlePress(F64 controlId, F64 childId); void handleSliderMove(F64 sliderId, F64 currentValue); - static void CreateGame(UIScene_CreateWorldMenu* pClass, DWORD dwLocalUsersMask); + static void CreateGame(UIScene_CreateWorldMenu* pClass, unsigned long dwLocalUsersMask); static int ConfirmCreateReturned(void *pParam,int iPad,C4JStorage::EMessageResult result); static int StartGame_SignInReturned(void *pParam,bool bContinue, int iPad); static int MustSignInReturnedPSN(void *pParam,int iPad,C4JStorage::EMessageResult result); diff --git a/src/client/Common/UI/UIScene_Credits.cpp b/src/client/Common/UI/UIScene_Credits.cpp index 9ca1806f..4e2a5ff9 100644 --- a/src/client/Common/UI/UIScene_Credits.cpp +++ b/src/client/Common/UI/UIScene_Credits.cpp @@ -515,7 +515,7 @@ UIScene_Credits::UIScene_Credits(int iPad, void *initData, UILayer *parentLayer) } else // using additional translated string. { - LPWSTR creditsString = new wchar_t[ 128 ]; + wchar_t* creditsString = new wchar_t[ 128 ]; if(gs_aCreditDefs[i].m_iStringID[1]!=NO_TRANSLATED_STRING) { swprintf( creditsString, 128, gs_aCreditDefs[i].m_Text, app.GetString( gs_aCreditDefs[i].m_iStringID[0] ), app.GetString( gs_aCreditDefs[i].m_iStringID[1] ) ); @@ -596,7 +596,7 @@ void UIScene_Credits::tick() } else // using additional translated string. { - LPWSTR creditsString = new wchar_t[ 128 ]; + wchar_t* creditsString = new wchar_t[ 128 ]; if(pDef->m_iStringID[1]!=NO_TRANSLATED_STRING) { swprintf( creditsString, 128, pDef->m_Text, app.GetString( pDef->m_iStringID[0] ), app.GetString( pDef->m_iStringID[1] ) ); diff --git a/src/client/Common/UI/UIScene_DLCOffersMenu.cpp b/src/client/Common/UI/UIScene_DLCOffersMenu.cpp index ffd8d47b..1fe8fb58 100644 --- a/src/client/Common/UI/UIScene_DLCOffersMenu.cpp +++ b/src/client/Common/UI/UIScene_DLCOffersMenu.cpp @@ -267,7 +267,7 @@ void UIScene_DLCOffersMenu::handlePress(F64 controlId, F64 childId) #else int iIndex = (int)childId; - ULONGLONG ullIndexA[1]; + uint64_t ullIndexA[1]; ullIndexA[0]=StorageManager.GetOffer(iIndex).qwOfferID; StorageManager.InstallOffer(1,ullIndexA,NULL,NULL); #endif @@ -438,7 +438,7 @@ void UIScene_DLCOffersMenu::tick() if(hasRegisteredSubstitutionTexture(textureName)==false) { - PBYTE pbImageData; + uint8_t* pbImageData; int iImageDataBytes=0; bool bDeleteData; #ifdef __ORBIS__ @@ -570,7 +570,7 @@ void UIScene_DLCOffersMenu::tick() if(hasRegisteredSubstitutionTexture(textureName)==false) { - PBYTE pbImageData; + uint8_t* pbImageData; int iImageDataBytes=0; bool bDeleteData; #ifdef __ORBIS__ @@ -738,7 +738,7 @@ void UIScene_DLCOffersMenu::GetDLCInfo( int iOfferC, bool bUpdateOnly ) if(wcsncmp(L"Minecraft ",wstrTemp.c_str(),10)==0) { app.DebugPrintf("Removing Minecraft from name\n"); - WCHAR *pwchNewName=(WCHAR *)wstrTemp.c_str(); + wchar_t *pwchNewName=(wchar_t *)wstrTemp.c_str(); wstrTemp=&pwchNewName[10]; } @@ -822,7 +822,7 @@ bool UIScene_DLCOffersMenu::UpdateDisplay(MARKETPLACE_CONTENTOFFER_INFO& xOffer) if (dlc != NULL) { - WCHAR *cString = dlc->wchBanner; + wchar_t *cString = dlc->wchBanner; // is the file in the local DLC images? @@ -855,8 +855,8 @@ bool UIScene_DLCOffersMenu::UpdateDisplay(MARKETPLACE_CONTENTOFFER_INFO& xOffer) { if(hasRegisteredSubstitutionTexture(cString)==false) { - BYTE *pData=NULL; - DWORD dwSize=0; + uint8_t *pData=NULL; + unsigned long dwSize=0; app.GetMemFileDetails(cString,&pData,&dwSize); // set the image #ifdef _XBOX_ONE diff --git a/src/client/Common/UI/UIScene_DeathMenu.cpp b/src/client/Common/UI/UIScene_DeathMenu.cpp index 8bd35f73..65efe132 100644 --- a/src/client/Common/UI/UIScene_DeathMenu.cpp +++ b/src/client/Common/UI/UIScene_DeathMenu.cpp @@ -102,7 +102,7 @@ void UIScene_DeathMenu::handlePress(F64 controlId, F64 childId) // is it the primary player exiting? if(m_iPad==ProfileManager.GetPrimaryPad()) { - UINT uiIDA[3]; + unsigned int uiIDA[3]; int playTime = -1; if( pMinecraft->localplayers[m_iPad] != NULL ) { @@ -172,7 +172,7 @@ void UIScene_DeathMenu::handlePress(F64 controlId, F64 childId) ui.ReduceTrialTimerValue(); // exit the level - UINT uiIDA[2]; + unsigned int uiIDA[2]; uiIDA[0]=IDS_CONFIRM_CANCEL; uiIDA[1]=IDS_CONFIRM_OK; ui.RequestMessageBox(IDS_EXIT_GAME, IDS_CONFIRM_EXIT_GAME_PROGRESS_LOST, uiIDA, 2, m_iPad,&IUIScene_PauseMenu::ExitGameDialogReturned,this, app.GetStringTable(), 0, 0, false); diff --git a/src/client/Common/UI/UIScene_DebugCreateSchematic.cpp b/src/client/Common/UI/UIScene_DebugCreateSchematic.cpp index e6199ea8..92bf1a8a 100644 --- a/src/client/Common/UI/UIScene_DebugCreateSchematic.cpp +++ b/src/client/Common/UI/UIScene_DebugCreateSchematic.cpp @@ -113,7 +113,7 @@ void UIScene_DebugCreateSchematic::handlePress(F64 controlId, F64 childId) case eControl_EndY: case eControl_EndZ: m_keyboardCallbackControl = (eControls)((int)controlId); - InputManager.RequestKeyboard(L"Enter something",L"",(DWORD)0,25,&UIScene_DebugCreateSchematic::KeyboardCompleteCallback,this,C_4JInput::EKeyboardMode_Default); + InputManager.RequestKeyboard(L"Enter something",L"",(unsigned long)0,25,&UIScene_DebugCreateSchematic::KeyboardCompleteCallback,this,C_4JInput::EKeyboardMode_Default); break; }; } @@ -134,7 +134,7 @@ void UIScene_DebugCreateSchematic::handleCheckboxToggled(F64 controlId, bool sel } } -int UIScene_DebugCreateSchematic::KeyboardCompleteCallback(LPVOID lpParam,bool bRes) +int UIScene_DebugCreateSchematic::KeyboardCompleteCallback(void* lpParam,bool bRes) { UIScene_DebugCreateSchematic *pClass=(UIScene_DebugCreateSchematic *)lpParam; diff --git a/src/client/Common/UI/UIScene_DebugCreateSchematic.h b/src/client/Common/UI/UIScene_DebugCreateSchematic.h index 65c302ec..812909ba 100644 --- a/src/client/Common/UI/UIScene_DebugCreateSchematic.h +++ b/src/client/Common/UI/UIScene_DebugCreateSchematic.h @@ -68,6 +68,6 @@ protected: virtual void handleCheckboxToggled(F64 controlId, bool selected); private: - static int KeyboardCompleteCallback(LPVOID lpParam,const bool bRes); + static int KeyboardCompleteCallback(void* lpParam,const bool bRes); }; #endif \ No newline at end of file diff --git a/src/client/Common/UI/UIScene_DebugOptions.cpp b/src/client/Common/UI/UIScene_DebugOptions.cpp index 389fb5cc..4929e71b 100644 --- a/src/client/Common/UI/UIScene_DebugOptions.cpp +++ b/src/client/Common/UI/UIScene_DebugOptions.cpp @@ -2,7 +2,7 @@ #include "UI.h" #include "UIScene_DebugOptions.h" -LPCWSTR UIScene_DebugOptionsMenu::m_DebugCheckboxTextA[eDebugSetting_Max+1]= +const wchar_t* UIScene_DebugOptionsMenu::m_DebugCheckboxTextA[eDebugSetting_Max+1]= { L"Load Saves From Local Folder Mode", L"Write Saves To Local Folder Mode", diff --git a/src/client/Common/UI/UIScene_DebugOptions.h b/src/client/Common/UI/UIScene_DebugOptions.h index bb85bda0..36b5efc7 100644 --- a/src/client/Common/UI/UIScene_DebugOptions.h +++ b/src/client/Common/UI/UIScene_DebugOptions.h @@ -6,7 +6,7 @@ class UIScene_DebugOptionsMenu : public UIScene { private: - static LPCWSTR m_DebugCheckboxTextA[eDebugSetting_Max+1]; + static const wchar_t* m_DebugCheckboxTextA[eDebugSetting_Max+1]; int m_iTotalCheckboxElements; diff --git a/src/client/Common/UI/UIScene_DebugOverlay.cpp b/src/client/Common/UI/UIScene_DebugOverlay.cpp index 9e2847c8..4ada3dd5 100644 --- a/src/client/Common/UI/UIScene_DebugOverlay.cpp +++ b/src/client/Common/UI/UIScene_DebugOverlay.cpp @@ -22,12 +22,12 @@ UIScene_DebugOverlay::UIScene_DebugOverlay(int iPad, void *initData, UILayer *pa initialiseMovie(); Minecraft *pMinecraft = Minecraft::GetInstance(); - WCHAR TempString[256]; - swprintf( (WCHAR *)TempString, 256, L"Set fov (%d)", (int)pMinecraft->gameRenderer->GetFovVal()); + wchar_t TempString[256]; + swprintf( (wchar_t *)TempString, 256, L"Set fov (%d)", (int)pMinecraft->gameRenderer->GetFovVal()); m_sliderFov.init(TempString,eControl_FOV,0,100,(int)pMinecraft->gameRenderer->GetFovVal()); float currentTime = pMinecraft->level->getLevelData()->getTime() % 24000; - swprintf( (WCHAR *)TempString, 256, L"Set time (unsafe) (%d)", (int)currentTime); + swprintf( (wchar_t *)TempString, 256, L"Set time (unsafe) (%d)", (int)currentTime); m_sliderTime.init(TempString,eControl_Time,0,240,currentTime/100); m_buttonRain.init(L"Toggle Rain",eControl_Rain); @@ -244,9 +244,9 @@ void UIScene_DebugOverlay::handleSliderMove(F64 sliderId, F64 currentValue) MinecraftServer::SetTime(currentValue * 100); pMinecraft->level->getLevelData()->setTime(currentValue * 100); - WCHAR TempString[256]; + wchar_t TempString[256]; float currentTime = currentValue * 100; - swprintf( (WCHAR *)TempString, 256, L"Set time (unsafe) (%d)", (int)currentTime); + swprintf( (wchar_t *)TempString, 256, L"Set time (unsafe) (%d)", (int)currentTime); m_sliderTime.setLabel(TempString); } break; @@ -255,8 +255,8 @@ void UIScene_DebugOverlay::handleSliderMove(F64 sliderId, F64 currentValue) Minecraft *pMinecraft = Minecraft::GetInstance(); pMinecraft->gameRenderer->SetFovVal((float)currentValue); - WCHAR TempString[256]; - swprintf( (WCHAR *)TempString, 256, L"Set fov (%d)", (int)currentValue); + wchar_t TempString[256]; + swprintf( (wchar_t *)TempString, 256, L"Set fov (%d)", (int)currentValue); m_sliderFov.setLabel(TempString); } break; diff --git a/src/client/Common/UI/UIScene_DebugSetCamera.cpp b/src/client/Common/UI/UIScene_DebugSetCamera.cpp index 3f956eab..13e8c7f2 100644 --- a/src/client/Common/UI/UIScene_DebugSetCamera.cpp +++ b/src/client/Common/UI/UIScene_DebugSetCamera.cpp @@ -29,21 +29,21 @@ UIScene_DebugSetCamera::UIScene_DebugSetCamera(int iPad, void *initData, UILayer currentPosition->m_elev = pMinecraft->localplayers[playerNo]->xRot; } - WCHAR TempString[256]; + wchar_t TempString[256]; - swprintf( (WCHAR *)TempString, 256, L"%f", currentPosition->m_camX); + swprintf( (wchar_t *)TempString, 256, L"%f", currentPosition->m_camX); m_textInputX.init(TempString, eControl_CamX); - swprintf( (WCHAR *)TempString, 256, L"%f", currentPosition->m_camY); + swprintf( (wchar_t *)TempString, 256, L"%f", currentPosition->m_camY); m_textInputY.init(TempString, eControl_CamY); - swprintf( (WCHAR *)TempString, 256, L"%f", currentPosition->m_camZ); + swprintf( (wchar_t *)TempString, 256, L"%f", currentPosition->m_camZ); m_textInputZ.init(TempString, eControl_CamZ); - swprintf( (WCHAR *)TempString, 256, L"%f", currentPosition->m_yRot); + swprintf( (wchar_t *)TempString, 256, L"%f", currentPosition->m_yRot); m_textInputYRot.init(TempString, eControl_YRot); - swprintf( (WCHAR *)TempString, 256, L"%f", currentPosition->m_elev); + swprintf( (wchar_t *)TempString, 256, L"%f", currentPosition->m_elev); m_textInputElevation.init(TempString, eControl_Elevation); m_checkboxLockPlayer.init(L"Lock Player", eControl_LockPlayer, app.GetFreezePlayers()); @@ -101,7 +101,7 @@ void UIScene_DebugSetCamera::handlePress(F64 controlId, F64 childId) case eControl_YRot: case eControl_Elevation: m_keyboardCallbackControl = (eControls)((int)controlId); - InputManager.RequestKeyboard(L"Enter something",L"",(DWORD)0,25,&UIScene_DebugSetCamera::KeyboardCompleteCallback,this,C_4JInput::EKeyboardMode_Default); + InputManager.RequestKeyboard(L"Enter something",L"",(unsigned long)0,25,&UIScene_DebugSetCamera::KeyboardCompleteCallback,this,C_4JInput::EKeyboardMode_Default); break; }; } @@ -116,7 +116,7 @@ void UIScene_DebugSetCamera::handleCheckboxToggled(F64 controlId, bool selected) } } -int UIScene_DebugSetCamera::KeyboardCompleteCallback(LPVOID lpParam,bool bRes) +int UIScene_DebugSetCamera::KeyboardCompleteCallback(void* lpParam,bool bRes) { UIScene_DebugSetCamera *pClass=(UIScene_DebugSetCamera *)lpParam; uint16_t pchText[2048];//[128]; diff --git a/src/client/Common/UI/UIScene_DebugSetCamera.h b/src/client/Common/UI/UIScene_DebugSetCamera.h index 38db1258..c97639f4 100644 --- a/src/client/Common/UI/UIScene_DebugSetCamera.h +++ b/src/client/Common/UI/UIScene_DebugSetCamera.h @@ -64,6 +64,6 @@ protected: virtual void handleCheckboxToggled(F64 controlId, bool selected); private: - static int KeyboardCompleteCallback(LPVOID lpParam,const bool bRes); + static int KeyboardCompleteCallback(void* lpParam,const bool bRes); }; #endif \ No newline at end of file diff --git a/src/client/Common/UI/UIScene_EndPoem.cpp b/src/client/Common/UI/UIScene_EndPoem.cpp index a3cedc1e..7e7c03e9 100644 --- a/src/client/Common/UI/UIScene_EndPoem.cpp +++ b/src/client/Common/UI/UIScene_EndPoem.cpp @@ -96,7 +96,7 @@ UIScene_EndPoem::UIScene_EndPoem(int iPad, void *initData, UILayer *parentLayer) #if TO_BE_IMPLEMENTED m_scrollDir = 1; - HRESULT hr = XuiHtmlControlSetSmoothScroll(m_htmlControl.m_hObj, XUI_SMOOTHSCROLL_VERTICAL,true,AUTO_SCROLL_SPEED,1.0f,AUTO_SCROLL_SPEED); + int hr = XuiHtmlControlSetSmoothScroll(m_htmlControl.m_hObj, XUI_SMOOTHSCROLL_VERTICAL,true,AUTO_SCROLL_SPEED,1.0f,AUTO_SCROLL_SPEED); XuiHtmlControlVScrollBy(m_htmlControl.m_hObj,m_scrollDir * 1000); SetTimer(0,200); diff --git a/src/client/Common/UI/UIScene_FullscreenProgress.cpp b/src/client/Common/UI/UIScene_FullscreenProgress.cpp index fc323f77..324a720b 100644 --- a/src/client/Common/UI/UIScene_FullscreenProgress.cpp +++ b/src/client/Common/UI/UIScene_FullscreenProgress.cpp @@ -99,7 +99,7 @@ void UIScene_FullscreenProgress::updateTooltips() void UIScene_FullscreenProgress::handleDestroy() { int code = thread->GetExitCode(); - DWORD exitcode = *((DWORD *)&code); + unsigned long exitcode = *((unsigned long *)&code); // If we're active, have a cancel func, and haven't already cancelled, call cancel func if( exitcode == STILL_ACTIVE && m_cancelFunc != NULL && !m_bWasCancelled) @@ -152,7 +152,7 @@ void UIScene_FullscreenProgress::tick() int code = thread->GetExitCode(); - DWORD exitcode = *((DWORD *)&code); + unsigned long exitcode = *((unsigned long *)&code); //app.DebugPrintf("CScene_FullscreenProgress Timer %d\n",pTimer->nId); @@ -185,7 +185,7 @@ void UIScene_FullscreenProgress::tick() pMinecraft->progressRenderer->progressStartNoAbort( exitReasonStringId );*/ //app.NavigateBack(m_CompletionData->iPad); - UINT uiIDA[1]; + unsigned int uiIDA[1]; uiIDA[0]=IDS_CONFIRM_OK; ui.RequestMessageBox( g_NetworkManager.CorrectErrorIDS(IDS_CONNECTION_FAILED), g_NetworkManager.CorrectErrorIDS(IDS_CONNECTION_LOST_SERVER), uiIDA,1, XUSER_INDEX_ANY,NULL,NULL, app.GetStringTable()); diff --git a/src/client/Common/UI/UIScene_FullscreenProgress.h b/src/client/Common/UI/UIScene_FullscreenProgress.h index aeb428c3..1907359c 100644 --- a/src/client/Common/UI/UIScene_FullscreenProgress.h +++ b/src/client/Common/UI/UIScene_FullscreenProgress.h @@ -18,10 +18,10 @@ private: UIFullscreenProgressCompletionData *m_CompletionData; bool m_threadCompleted; int m_iPad; - void (*m_cancelFunc)(LPVOID param); - void (*m_completeFunc)(LPVOID param); - LPVOID m_cancelFuncParam; - LPVOID m_completeFuncParam; + void (*m_cancelFunc)(void* param); + void (*m_completeFunc)(void* param); + void* m_cancelFuncParam; + void* m_completeFuncParam; bool m_bWaitForThreadToDelete; wstring m_titleText, m_statusText; diff --git a/src/client/Common/UI/UIScene_HUD.cpp b/src/client/Common/UI/UIScene_HUD.cpp index 3e59c743..09981149 100644 --- a/src/client/Common/UI/UIScene_HUD.cpp +++ b/src/client/Common/UI/UIScene_HUD.cpp @@ -656,7 +656,7 @@ void UIScene_HUD::handleTimerComplete(int id) if(pMinecraft->localplayers[m_iPad]!= NULL) { Gui *pGui = pMinecraft->gui; - //DWORD messagesToDisplay = min( CHAT_LINES_COUNT, pGui->getMessagesCount(m_iPad) ); + //unsigned long messagesToDisplay = min( CHAT_LINES_COUNT, pGui->getMessagesCount(m_iPad) ); for( unsigned int i = 0; i < CHAT_LINES_COUNT; ++i ) { float opacity = pGui->getOpacity(m_iPad, i); diff --git a/src/client/Common/UI/UIScene_InGameInfoMenu.cpp b/src/client/Common/UI/UIScene_InGameInfoMenu.cpp index c451dc49..6d879802 100644 --- a/src/client/Common/UI/UIScene_InGameInfoMenu.cpp +++ b/src/client/Common/UI/UIScene_InGameInfoMenu.cpp @@ -20,10 +20,10 @@ UIScene_InGameInfoMenu::UIScene_InGameInfoMenu(int iPad, void *initData, UILayer m_playerNames[i] = L""; } - DWORD playerCount = g_NetworkManager.GetPlayerCount(); + unsigned long playerCount = g_NetworkManager.GetPlayerCount(); m_playersCount = 0; - for(DWORD i = 0; i < playerCount; ++i) + for(unsigned long i = 0; i < playerCount; ++i) { INetworkPlayer *player = g_NetworkManager.GetPlayerByIndex( i ); @@ -196,10 +196,10 @@ void UIScene_InGameInfoMenu::handleGainFocus(bool navBack) void UIScene_InGameInfoMenu::handleReload() { - DWORD playerCount = g_NetworkManager.GetPlayerCount(); + unsigned long playerCount = g_NetworkManager.GetPlayerCount(); m_playersCount = 0; - for(DWORD i = 0; i < playerCount; ++i) + for(unsigned long i = 0; i < playerCount; ++i) { INetworkPlayer *player = g_NetworkManager.GetPlayerByIndex( i ); @@ -270,7 +270,7 @@ void UIScene_InGameInfoMenu::tick() { UIScene::tick(); - for(DWORD i = 0; i < m_playersCount; ++i) + for(unsigned long i = 0; i < m_playersCount; ++i) { INetworkPlayer *player = g_NetworkManager.GetPlayerByIndex( i ); @@ -354,7 +354,7 @@ void UIScene_InGameInfoMenu::handleInput(int iPad, int key, bool repeat, bool pr if(!ProfileManager.IsSignedInLive(iPad)) { // get them to sign in to online - UINT uiIDA[2]; + unsigned int uiIDA[2]; uiIDA[0]=IDS_PRO_NOTONLINE_ACCEPT; uiIDA[1]=IDS_PRO_NOTONLINE_DECLINE; ui.RequestMessageBox(IDS_PRO_NOTONLINE_TITLE, IDS_PRO_NOTONLINE_TEXT, uiIDA, 2, ProfileManager.GetPrimaryPad(),&UIScene_InGameInfoMenu::MustSignInReturnedPSN,this, app.GetStringTable()); @@ -455,9 +455,9 @@ void UIScene_InGameInfoMenu::handlePress(F64 controlId, F64 childId) else if(selectedPlayer->IsLocal() != true && selectedPlayer->IsSameSystem(g_NetworkManager.GetHostPlayer()) != true) { // Only ops will hit this, can kick anyone not local and not local to the host - BYTE *smallId = new BYTE(); + uint8_t *smallId = new uint8_t(); *smallId = m_players[currentSelection]; - UINT uiIDA[2]; + unsigned int uiIDA[2]; uiIDA[0]=IDS_CONFIRM_OK; uiIDA[1]=IDS_CONFIRM_CANCEL; @@ -550,7 +550,7 @@ void UIScene_InGameInfoMenu::OnPlayerChanged(void *callbackParam, INetworkPlayer int UIScene_InGameInfoMenu::KickPlayerReturned(void *pParam,int iPad,C4JStorage::EMessageResult result) { - BYTE smallId = *(BYTE *)pParam; + uint8_t smallId = *(uint8_t *)pParam; delete pParam; if(result==C4JStorage::EMessage_ResultAccept) diff --git a/src/client/Common/UI/UIScene_InGameInfoMenu.h b/src/client/Common/UI/UIScene_InGameInfoMenu.h index 94966fa3..bb78bd5f 100644 --- a/src/client/Common/UI/UIScene_InGameInfoMenu.h +++ b/src/client/Common/UI/UIScene_InGameInfoMenu.h @@ -13,7 +13,7 @@ private: bool m_isHostPlayer; int m_playersCount; - BYTE m_players[MINECRAFT_NET_MAX_PLAYERS]; // An array of QNet small-id's + uint8_t m_players[MINECRAFT_NET_MAX_PLAYERS]; // An array of QNet small-id's char m_playersVoiceState[MINECRAFT_NET_MAX_PLAYERS]; short m_playersColourState[MINECRAFT_NET_MAX_PLAYERS]; wstring m_playerNames[MINECRAFT_NET_MAX_PLAYERS]; diff --git a/src/client/Common/UI/UIScene_InGamePlayerOptionsMenu.cpp b/src/client/Common/UI/UIScene_InGamePlayerOptionsMenu.cpp index ed68e7eb..079a7ee3 100644 --- a/src/client/Common/UI/UIScene_InGamePlayerOptionsMenu.cpp +++ b/src/client/Common/UI/UIScene_InGamePlayerOptionsMenu.cpp @@ -346,9 +346,9 @@ void UIScene_InGamePlayerOptionsMenu::handlePress(F64 controlId, F64 childId) { case eControl_Kick: { - BYTE *smallId = new BYTE(); + uint8_t *smallId = new uint8_t(); *smallId = m_networkSmallId; - UINT uiIDA[2]; + unsigned int uiIDA[2]; uiIDA[0]=IDS_CONFIRM_OK; uiIDA[1]=IDS_CONFIRM_CANCEL; @@ -360,7 +360,7 @@ void UIScene_InGamePlayerOptionsMenu::handlePress(F64 controlId, F64 childId) int UIScene_InGamePlayerOptionsMenu::KickPlayerReturned(void *pParam,int iPad,C4JStorage::EMessageResult result) { - BYTE smallId = *(BYTE *)pParam; + uint8_t smallId = *(uint8_t *)pParam; delete pParam; if(result==C4JStorage::EMessage_ResultAccept) diff --git a/src/client/Common/UI/UIScene_InGamePlayerOptionsMenu.h b/src/client/Common/UI/UIScene_InGamePlayerOptionsMenu.h index 78e30f6e..5ff94248 100644 --- a/src/client/Common/UI/UIScene_InGamePlayerOptionsMenu.h +++ b/src/client/Common/UI/UIScene_InGamePlayerOptionsMenu.h @@ -27,7 +27,7 @@ private: bool m_bShouldNavBack; bool m_editingSelf; - BYTE m_networkSmallId; + uint8_t m_networkSmallId; unsigned int m_playerPrivileges; UIControl_Label m_labelGamertag; diff --git a/src/client/Common/UI/UIScene_InGameSaveManagementMenu.cpp b/src/client/Common/UI/UIScene_InGameSaveManagementMenu.cpp index b0dbc59f..dfadb5ef 100644 --- a/src/client/Common/UI/UIScene_InGameSaveManagementMenu.cpp +++ b/src/client/Common/UI/UIScene_InGameSaveManagementMenu.cpp @@ -6,7 +6,7 @@ #include #endif -int UIScene_InGameSaveManagementMenu::LoadSaveDataThumbnailReturned(LPVOID lpParam,PBYTE pbThumbnail,DWORD dwThumbnailBytes) +int UIScene_InGameSaveManagementMenu::LoadSaveDataThumbnailReturned(void* lpParam,uint8_t* pbThumbnail,unsigned long dwThumbnailBytes) { UIScene_InGameSaveManagementMenu *pClass= (UIScene_InGameSaveManagementMenu *)lpParam; @@ -14,7 +14,7 @@ int UIScene_InGameSaveManagementMenu::LoadSaveDataThumbnailReturned(LPVOID lpPar if(pbThumbnail && dwThumbnailBytes) { - pClass->m_saveDetails[pClass->m_iRequestingThumbnailId].pbThumbnailData = new BYTE[dwThumbnailBytes]; + pClass->m_saveDetails[pClass->m_iRequestingThumbnailId].pbThumbnailData = new uint8_t[dwThumbnailBytes]; memcpy(pClass->m_saveDetails[pClass->m_iRequestingThumbnailId].pbThumbnailData, pbThumbnail, dwThumbnailBytes); pClass->m_saveDetails[pClass->m_iRequestingThumbnailId].dwThumbnailSize = dwThumbnailBytes; } @@ -282,9 +282,9 @@ void UIScene_InGameSaveManagementMenu::tick() MB_ERR_INVALID_CHARS, // error on invalid chars m_saveDetails[m_iRequestingThumbnailId].UTF8SaveFilename, // source UTF-8 string MAX_SAVEFILENAME_LENGTH, // total length of source UTF-8 string, - // in CHAR's (= bytes), including end-of-string \0 + // in char's (= bytes), including end-of-string \0 (wchar_t *)u16Message, // destination buffer - MAX_SAVEFILENAME_LENGTH // size of destination buffer, in WCHAR's + MAX_SAVEFILENAME_LENGTH // size of destination buffer, in wchar_t's ); #else #ifdef __PS3 @@ -439,7 +439,7 @@ void UIScene_InGameSaveManagementMenu::handlePress(F64 controlId, F64 childId) // delete the save game // Have to ask the player if they are sure they want to delete this game - UINT uiIDA[2]; + unsigned int uiIDA[2]; uiIDA[0]=IDS_CONFIRM_CANCEL; uiIDA[1]=IDS_CONFIRM_OK; ui.RequestMessageBox(IDS_TOOLTIPS_DELETESAVE, IDS_TEXT_DELETE_SAVE, uiIDA, 2,m_iPad,&UIScene_InGameSaveManagementMenu::DeleteSaveDialogReturned,this, app.GetStringTable(),NULL,0,true); @@ -475,7 +475,7 @@ int UIScene_InGameSaveManagementMenu::DeleteSaveDialogReturned(void *pParam,int return 0; } -int UIScene_InGameSaveManagementMenu::DeleteSaveDataReturned(LPVOID lpParam,bool bRes) +int UIScene_InGameSaveManagementMenu::DeleteSaveDataReturned(void* lpParam,bool bRes) { UIScene_InGameSaveManagementMenu* pClass = (UIScene_InGameSaveManagementMenu*)lpParam; diff --git a/src/client/Common/UI/UIScene_InGameSaveManagementMenu.h b/src/client/Common/UI/UIScene_InGameSaveManagementMenu.h index 3f9ace3a..2737a76f 100644 --- a/src/client/Common/UI/UIScene_InGameSaveManagementMenu.h +++ b/src/client/Common/UI/UIScene_InGameSaveManagementMenu.h @@ -96,9 +96,9 @@ protected: public: - static int LoadSaveDataThumbnailReturned(LPVOID lpParam,PBYTE pbThumbnail,DWORD dwThumbnailBytes); + static int LoadSaveDataThumbnailReturned(void* lpParam,uint8_t* pbThumbnail,unsigned long dwThumbnailBytes); static int DeleteSaveDialogReturned(void *pParam,int iPad,C4JStorage::EMessageResult result); - static int DeleteSaveDataReturned(LPVOID lpParam,bool bRes); + static int DeleteSaveDataReturned(void* lpParam,bool bRes); protected: void handlePress(F64 controlId, F64 childId); }; diff --git a/src/client/Common/UI/UIScene_JoinMenu.cpp b/src/client/Common/UI/UIScene_JoinMenu.cpp index ee92371d..426fb20d 100644 --- a/src/client/Common/UI/UIScene_JoinMenu.cpp +++ b/src/client/Common/UI/UIScene_JoinMenu.cpp @@ -206,7 +206,7 @@ void UIScene_JoinMenu::tick() // Show a generic network error message, not always safe to assume the error was host quitting // without bubbling more info up from the network manager so this is the best we can do - UINT uiIDA[1]; + unsigned int uiIDA[1]; uiIDA[0] = IDS_CONFIRM_OK; #ifdef _XBOX_ONE ui.RequestMessageBox( IDS_CONNECTION_FAILED, IDS_DISCONNECTED_SERVER_QUIT, uiIDA,1,m_iPad,ErrorDialogReturned,this, app.GetStringTable()); @@ -329,7 +329,7 @@ void UIScene_JoinMenu::handleFocusChange(F64 controlId, F64 childId) } #ifdef _DURANGO -void UIScene_JoinMenu::checkPrivilegeCallback(LPVOID lpParam, bool hasPrivilege, int iPad) +void UIScene_JoinMenu::checkPrivilegeCallback(void* lpParam, bool hasPrivilege, int iPad) { UIScene_JoinMenu* pClass = (UIScene_JoinMenu*)lpParam; @@ -387,9 +387,9 @@ int UIScene_JoinMenu::StartGame_SignInReturned(void *pParam,bool bContinue, int // Shared function to join the game that is the same whether we used the sign-in UI or not void UIScene_JoinMenu::JoinGame(UIScene_JoinMenu* pClass) { - DWORD dwSignedInUsers = 0; + unsigned long dwSignedInUsers = 0; bool noPrivileges = false; - DWORD dwLocalUsersMask = 0; + unsigned long dwLocalUsersMask = 0; bool isSignedInLive = true; int iPadNotSignedInLive = -1; @@ -440,7 +440,7 @@ void UIScene_JoinMenu::JoinGame(UIScene_JoinMenu* pClass) { pClass->m_bIgnoreInput = false; // 4J Stu - This is a bit messy and is due to the library incorrectly returning false for IsSignedInLive if the npAvailability isn't SCE_OK - UINT uiIDA[1]; + unsigned int uiIDA[1]; uiIDA[0]=IDS_OK; ui.RequestMessageBox(IDS_ONLINE_SERVICE_TITLE, IDS_CONTENT_RESTRICTION, uiIDA, 1, iPadNotSignedInLive, NULL, NULL, app.GetStringTable()); } @@ -448,7 +448,7 @@ void UIScene_JoinMenu::JoinGame(UIScene_JoinMenu* pClass) #endif { pClass->m_bIgnoreInput=false; - UINT uiIDA[1]; + unsigned int uiIDA[1]; uiIDA[0]=IDS_CONFIRM_OK; ui.RequestMessageBox( IDS_PRO_NOTONLINE_TITLE, IDS_PRO_NOTONLINE_TEXT, uiIDA,1,ProfileManager.GetPrimaryPad(),NULL,NULL, app.GetStringTable()); } @@ -457,8 +457,8 @@ void UIScene_JoinMenu::JoinGame(UIScene_JoinMenu* pClass) // Check if user-created content is allowed, as we cannot play multiplayer if it's not bool noUGC = false; - BOOL pccAllowed = true; - BOOL pccFriendsAllowed = true; + bool pccAllowed = true; + bool pccFriendsAllowed = true; #if defined(__PS3__) || defined(__PSVITA__) if(isSignedInLive) @@ -493,7 +493,7 @@ void UIScene_JoinMenu::JoinGame(UIScene_JoinMenu* pClass) { pClass->setVisible( true ); pClass->m_bIgnoreInput=false; - UINT uiIDA[1]; + unsigned int uiIDA[1]; uiIDA[0]=IDS_CONFIRM_OK; ui.RequestMessageBox( IDS_NO_MULTIPLAYER_PRIVILEGE_TITLE, IDS_NO_MULTIPLAYER_PRIVILEGE_JOIN_TEXT, uiIDA,1,ProfileManager.GetPrimaryPad(),NULL,NULL, app.GetStringTable()); } @@ -528,7 +528,7 @@ void UIScene_JoinMenu::JoinGame(UIScene_JoinMenu* pClass) } else { - UINT uiIDA[1]; + unsigned int uiIDA[1]; uiIDA[0]=IDS_CONFIRM_OK; ui.RequestMessageBox( IDS_CONNECTION_FAILED, exitReasonStringId, uiIDA,1,ProfileManager.GetPrimaryPad(),NULL,NULL, app.GetStringTable()); exitReasonStringId = -1; diff --git a/src/client/Common/UI/UIScene_JoinMenu.h b/src/client/Common/UI/UIScene_JoinMenu.h index 817360ef..ce198c95 100644 --- a/src/client/Common/UI/UIScene_JoinMenu.h +++ b/src/client/Common/UI/UIScene_JoinMenu.h @@ -90,7 +90,7 @@ protected: void StartSharedLaunchFlow(); #ifdef _DURANGO - static void checkPrivilegeCallback(LPVOID lpParam, bool hasPrivilege, int iPad); + static void checkPrivilegeCallback(void* lpParam, bool hasPrivilege, int iPad); #endif static int StartGame_SignInReturned(void *pParam, bool, int); diff --git a/src/client/Common/UI/UIScene_LaunchMoreOptionsMenu.cpp b/src/client/Common/UI/UIScene_LaunchMoreOptionsMenu.cpp index c3f248fb..f84f55db 100644 --- a/src/client/Common/UI/UIScene_LaunchMoreOptionsMenu.cpp +++ b/src/client/Common/UI/UIScene_LaunchMoreOptionsMenu.cpp @@ -226,7 +226,7 @@ void UIScene_LaunchMoreOptionsMenu::handleInput(int iPad, int key, bool repeat, UIControl_CheckBox *checkboxOnline = &m_checkboxes[eLaunchCheckbox_Online]; if ( pressed && controlHasFocus( checkboxOnline->getId()) && !checkboxOnline->IsEnabled() ) { - UINT uiIDA[1] = { IDS_CONFIRM_OK }; + unsigned int uiIDA[1] = { IDS_CONFIRM_OK }; ui.RequestMessageBox(IDS_PRO_NOTONLINE_TITLE, IDS_PRO_XBOXLIVE_NOTIFICATION, uiIDA, 1, iPad, NULL, NULL, app.GetStringTable()); } } @@ -398,7 +398,7 @@ void UIScene_LaunchMoreOptionsMenu::handleTimerComplete(int id) };*/ } -int UIScene_LaunchMoreOptionsMenu::KeyboardCompleteSeedCallback(LPVOID lpParam,bool bRes) +int UIScene_LaunchMoreOptionsMenu::KeyboardCompleteSeedCallback(void* lpParam,bool bRes) { UIScene_LaunchMoreOptionsMenu *pClass=(UIScene_LaunchMoreOptionsMenu *)lpParam; pClass->m_bIgnoreInput=false; @@ -430,15 +430,15 @@ void UIScene_LaunchMoreOptionsMenu::handlePress(F64 controlId, F64 childId) case XC_LANGUAGE_JAPANESE: case XC_LANGUAGE_KOREAN: case XC_LANGUAGE_TCHINESE: - InputManager.RequestKeyboard(app.GetString(IDS_CREATE_NEW_WORLD_SEED),m_editSeed.getLabel(),(DWORD)0,60,&UIScene_LaunchMoreOptionsMenu::KeyboardCompleteSeedCallback,this,C_4JInput::EKeyboardMode_Default); + InputManager.RequestKeyboard(app.GetString(IDS_CREATE_NEW_WORLD_SEED),m_editSeed.getLabel(),(unsigned long)0,60,&UIScene_LaunchMoreOptionsMenu::KeyboardCompleteSeedCallback,this,C_4JInput::EKeyboardMode_Default); break; default: // 4J Stu - Use a different keyboard for non-asian languages so we don't have prediction on - InputManager.RequestKeyboard(app.GetString(IDS_CREATE_NEW_WORLD_SEED),m_editSeed.getLabel(),(DWORD)0,60,&UIScene_LaunchMoreOptionsMenu::KeyboardCompleteSeedCallback,this,C_4JInput::EKeyboardMode_Alphabet_Extended); + InputManager.RequestKeyboard(app.GetString(IDS_CREATE_NEW_WORLD_SEED),m_editSeed.getLabel(),(unsigned long)0,60,&UIScene_LaunchMoreOptionsMenu::KeyboardCompleteSeedCallback,this,C_4JInput::EKeyboardMode_Alphabet_Extended); break; } #else - InputManager.RequestKeyboard(app.GetString(IDS_CREATE_NEW_WORLD_SEED),m_editSeed.getLabel(),(DWORD)0,60,&UIScene_LaunchMoreOptionsMenu::KeyboardCompleteSeedCallback,this,C_4JInput::EKeyboardMode_Default); + InputManager.RequestKeyboard(app.GetString(IDS_CREATE_NEW_WORLD_SEED),m_editSeed.getLabel(),(unsigned long)0,60,&UIScene_LaunchMoreOptionsMenu::KeyboardCompleteSeedCallback,this,C_4JInput::EKeyboardMode_Default); #endif } break; diff --git a/src/client/Common/UI/UIScene_LaunchMoreOptionsMenu.h b/src/client/Common/UI/UIScene_LaunchMoreOptionsMenu.h index 62d75115..38f4e490 100644 --- a/src/client/Common/UI/UIScene_LaunchMoreOptionsMenu.h +++ b/src/client/Common/UI/UIScene_LaunchMoreOptionsMenu.h @@ -116,7 +116,7 @@ public: virtual void handleInput(int iPad, int key, bool repeat, bool pressed, bool released, bool &handled); virtual void handleFocusChange(F64 controlId, F64 childId); virtual void handleTimerComplete(int id); - static int KeyboardCompleteSeedCallback(LPVOID lpParam,const bool bRes); + static int KeyboardCompleteSeedCallback(void* lpParam,const bool bRes); virtual void handlePress(F64 controlId, F64 childId); virtual void handleSliderMove(F64 sliderId, F64 currentValue); diff --git a/src/client/Common/UI/UIScene_LeaderboardsMenu.cpp b/src/client/Common/UI/UIScene_LeaderboardsMenu.cpp index d42faf28..d621c257 100644 --- a/src/client/Common/UI/UIScene_LeaderboardsMenu.cpp +++ b/src/client/Common/UI/UIScene_LeaderboardsMenu.cpp @@ -702,7 +702,7 @@ void UIScene_LeaderboardsMenu::CopyLeaderboardEntry(LeaderboardManager::ReadScor // Copy the rank leaderboardEntry->m_rank = statsRow->m_rank; - DWORD displayRank = leaderboardEntry->m_rank; + unsigned long displayRank = leaderboardEntry->m_rank; if(displayRank > 9999999) displayRank = 9999999; swprintf(leaderboardEntry->m_wcRank, 12, L"%u", displayRank); @@ -741,10 +741,10 @@ void UIScene_LeaderboardsMenu::CopyLeaderboardEntry(LeaderboardManager::ReadScor for( unsigned int i=0 ; im_statsSize ; i++ ) { leaderboardEntry->m_columns[i] = statsRow->m_statsData[i]; - ZeroMemory(leaderboardEntry->m_wcColumns[i],12*sizeof(WCHAR)); + ZeroMemory(leaderboardEntry->m_wcColumns[i],12*sizeof(wchar_t)); if( !isDistanceLeaderboard ) { - DWORD displayValue = leaderboardEntry->m_columns[i]; + unsigned long displayValue = leaderboardEntry->m_columns[i]; if(displayValue > 99999) displayValue = 99999; swprintf(leaderboardEntry->m_wcColumns[i], 12, L"%u",displayValue); #ifdef _DEBUG @@ -869,7 +869,7 @@ void UIScene_LeaderboardsMenu::PopulateLeaderboard(LeaderboardManager::eStatsRet int startIndex = m_newEntryIndex; int entryCount = m_newEntriesCount; - for(DWORD i = startIndex; i < (startIndex + entryCount); ++i) + for(unsigned long i = startIndex; i < (startIndex + entryCount); ++i) { bool isLast = i == ((startIndex + entryCount) - 1); diff --git a/src/client/Common/UI/UIScene_LeaderboardsMenu.h b/src/client/Common/UI/UIScene_LeaderboardsMenu.h index 3bf35a39..d53ba168 100644 --- a/src/client/Common/UI/UIScene_LeaderboardsMenu.h +++ b/src/client/Common/UI/UIScene_LeaderboardsMenu.h @@ -35,12 +35,12 @@ private: struct LeaderboardEntry { PlayerUID m_xuid; unsigned int m_row; // Row identifier for passing to Iggy as a unique identifier - DWORD m_rank; - WCHAR m_wcRank[12]; - WCHAR m_gamerTag[XUSER_NAME_SIZE+1]; + unsigned long m_rank; + wchar_t m_wcRank[12]; + wchar_t m_gamerTag[XUSER_NAME_SIZE+1]; //int m_locale; unsigned int m_columns[7]; - WCHAR m_wcColumns[7][12]; + wchar_t m_wcColumns[7][12]; bool m_bPlayer; //Is the player bool m_bOnline; //Is online bool m_bFriend; //Is friend @@ -49,9 +49,9 @@ private: }; struct Leaderboard { - DWORD m_totalEntryCount; //Either total number of entries in leaderboard, or total number of results for a friends query + unsigned long m_totalEntryCount; //Either total number of entries in leaderboard, or total number of results for a friends query vector m_entries; - DWORD m_numColumns; + unsigned long m_numColumns; }; Leaderboard m_leaderboard; //All leaderboard data for the currently selected filter diff --git a/src/client/Common/UI/UIScene_LoadMenu.cpp b/src/client/Common/UI/UIScene_LoadMenu.cpp index 49d8c943..2918444b 100644 --- a/src/client/Common/UI/UIScene_LoadMenu.cpp +++ b/src/client/Common/UI/UIScene_LoadMenu.cpp @@ -31,7 +31,7 @@ int UIScene_LoadMenu::m_iDifficultyTitleSettingA[4]= IDS_DIFFICULTY_TITLE_HARD }; -int UIScene_LoadMenu::LoadSaveDataThumbnailReturned(LPVOID lpParam,PBYTE pbThumbnail,DWORD dwThumbnailBytes) +int UIScene_LoadMenu::LoadSaveDataThumbnailReturned(void* lpParam,uint8_t* pbThumbnail,unsigned long dwThumbnailBytes) { UIScene_LoadMenu *pClass= (UIScene_LoadMenu *)lpParam; @@ -75,8 +75,8 @@ UIScene_LoadMenu::UIScene_LoadMenu(int iPad, void *initData, UILayer *parentLaye m_labelTexturePackDescription.init(L""); m_CurrentDifficulty=app.GetGameSettings(m_iPad,eGameSetting_Difficulty); - WCHAR TempString[256]; - swprintf( (WCHAR *)TempString, 256, L"%ls: %ls", app.GetString( IDS_SLIDER_DIFFICULTY ),app.GetString(m_iDifficultyTitleSettingA[app.GetGameSettings(m_iPad,eGameSetting_Difficulty)])); + wchar_t TempString[256]; + swprintf( (wchar_t *)TempString, 256, L"%ls: %ls", app.GetString( IDS_SLIDER_DIFFICULTY ),app.GetString(m_iDifficultyTitleSettingA[app.GetGameSettings(m_iPad,eGameSetting_Difficulty)])); m_sliderDifficulty.init(TempString,eControl_Difficulty,0,3,app.GetGameSettings(m_iPad,eGameSetting_Difficulty)); m_MoreOptionsParams.bGenerateOptions=false; @@ -173,8 +173,8 @@ UIScene_LoadMenu::UIScene_LoadMenu(int iPad, void *initData, UILayer *parentLaye // retrieve the save icon from the texture pack, if there is one TexturePack *tp = Minecraft::GetInstance()->skins->getTexturePackById(m_MoreOptionsParams.dwTexturePack); - DWORD dwImageBytes; - PBYTE pbImageData = tp->getPackIcon(dwImageBytes); + unsigned long dwImageBytes; + uint8_t* pbImageData = tp->getPackIcon(dwImageBytes); if(dwImageBytes > 0 && pbImageData) { @@ -259,8 +259,8 @@ UIScene_LoadMenu::UIScene_LoadMenu(int iPad, void *initData, UILayer *parentLaye { TexturePack *tp = pMinecraft->skins->getTexturePackByIndex(i); - DWORD dwImageBytes; - PBYTE pbImageData = tp->getPackIcon(dwImageBytes); + unsigned long dwImageBytes; + uint8_t* pbImageData = tp->getPackIcon(dwImageBytes); if(dwImageBytes > 0 && pbImageData) { @@ -298,7 +298,7 @@ UIScene_LoadMenu::UIScene_LoadMenu(int iPad, void *initData, UILayer *parentLaye char *pchName=app.GetDLCInfoTextures(i); pDLCInfo=app.GetDLCInfo(pchName); #else - ULONGLONG ull=app.GetDLCInfoTexturesFullOffer(i); + uint64_t ull=app.GetDLCInfoTexturesFullOffer(i); pDLCInfo=app.GetDLCInfoForFullOfferID(ull); #endif @@ -334,7 +334,7 @@ UIScene_LoadMenu::UIScene_LoadMenu(int iPad, void *initData, UILayer *parentLaye char *pchName=app.GetDLCInfoTextures(i); pDLCInfo=app.GetDLCInfo(pchName); #else - ULONGLONG ull=app.GetDLCInfoTexturesFullOffer(i); + uint64_t ull=app.GetDLCInfoTexturesFullOffer(i); pDLCInfo=app.GetDLCInfoForFullOfferID(ull); #endif @@ -431,16 +431,16 @@ void UIScene_LoadMenu::tick() // #ifdef _DEBUG // // dump out the thumbnail - // HANDLE hThumbnail = CreateFile("GAME:\\thumbnail.png", GENERIC_WRITE, 0, NULL, OPEN_ALWAYS, FILE_FLAG_RANDOM_ACCESS, NULL); - // DWORD dwBytes; + // void* hThumbnail = CreateFile("GAME:\\thumbnail.png", GENERIC_WRITE, 0, NULL, OPEN_ALWAYS, FILE_FLAG_RANDOM_ACCESS, NULL); + // unsigned long dwBytes; // WriteFile(hThumbnail,pbImageData,dwImageBytes,&dwBytes,NULL); // XCloseHandle(hThumbnail); // #endif if(szSeed[0]!=0) { - WCHAR TempString[256]; - swprintf( (WCHAR *)TempString, 256, L"%ls: %hs", app.GetString( IDS_SEED ),szSeed); + wchar_t TempString[256]; + swprintf( (wchar_t *)TempString, 256, L"%ls: %hs", app.GetString( IDS_SEED ),szSeed); m_labelSeed.setLabel(TempString); } else @@ -541,7 +541,7 @@ void UIScene_LoadMenu::tick() else { // continue offline? - UINT uiIDA[1]; + unsigned int uiIDA[1]; uiIDA[0]=IDS_PRO_NOTONLINE_DECLINE; // Give the player a warning about the texture pack missing @@ -598,7 +598,7 @@ void UIScene_LoadMenu::handleInput(int iPad, int key, bool repeat, bool pressed, #if defined _XBOX_ONE if ( pressed && controlHasFocus(m_checkboxOnline.getId()) && !m_checkboxOnline.IsEnabled() ) { - UINT uiIDA[1] = { IDS_CONFIRM_OK }; + unsigned int uiIDA[1] = { IDS_CONFIRM_OK }; ui.RequestMessageBox(IDS_PRO_NOTONLINE_TITLE, IDS_PRO_XBOXLIVE_NOTIFICATION, uiIDA, 1, iPad, NULL, NULL, app.GetStringTable()); } #endif @@ -680,7 +680,7 @@ void UIScene_LoadMenu::handlePress(F64 controlId, F64 childId) } #ifdef _DURANGO -void UIScene_LoadMenu::checkPrivilegeCallback(LPVOID lpParam, bool hasPrivilege, int iPad) +void UIScene_LoadMenu::checkPrivilegeCallback(void* lpParam, bool hasPrivilege, int iPad) { UIScene_LoadMenu* pClass = (UIScene_LoadMenu*)lpParam; @@ -716,13 +716,13 @@ void UIScene_LoadMenu::StartSharedLaunchFlow() // upsell the texture pack // tell sentient about the upsell of the full version of the skin pack - ULONGLONG ullOfferID_Full; + uint64_t ullOfferID_Full; app.GetDLCFullOfferIDForPackID(m_MoreOptionsParams.dwTexturePack,&ullOfferID_Full); TelemetryManager->RecordUpsellPresented(ProfileManager.GetPrimaryPad(), eSet_UpsellID_Texture_DLC, ullOfferID_Full & 0xFFFFFFFF); #endif - UINT uiIDA[2]; + unsigned int uiIDA[2]; uiIDA[0]=IDS_TEXTUREPACK_FULLVERSION; //uiIDA[1]=IDS_TEXTURE_PACK_TRIALVERSION; @@ -765,7 +765,7 @@ void UIScene_LoadMenu::StartSharedLaunchFlow() // We need to allow people to use a trial texture pack if they are offline - we only need them online if they want to buy it. /* - UINT uiIDA[1]; + unsigned int uiIDA[1]; uiIDA[0]=IDS_OK; if(!ProfileManager.IsSignedInLive(m_iPad)) @@ -780,7 +780,7 @@ void UIScene_LoadMenu::StartSharedLaunchFlow() // upsell #ifdef _XBOX DLC_INFO *pDLCInfo = app.GetDLCInfoForTrialOfferID(m_pDLCPack->getPurchaseOfferId()); - ULONGLONG ullOfferID_Full; + uint64_t ullOfferID_Full; if(pDLCInfo!=NULL) { @@ -797,12 +797,12 @@ void UIScene_LoadMenu::StartSharedLaunchFlow() #if defined(_WINDOWS64) || defined(_DURANGO) // trial pack warning - UINT uiIDA[1]; + unsigned int uiIDA[1]; uiIDA[0]=IDS_CONFIRM_OK; ui.RequestMessageBox(IDS_WARNING_DLC_TRIALTEXTUREPACK_TITLE, IDS_USING_TRIAL_TEXUREPACK_WARNING, uiIDA, 1, m_iPad,&TrialTexturePackWarningReturned,this,app.GetStringTable(),NULL,0,false); #elif defined(__PS3__) || defined(__ORBIS__) || defined(__PSVITA__) // trial pack warning - UINT uiIDA[2]; + unsigned int uiIDA[2]; uiIDA[0]=IDS_CONFIRM_OK; uiIDA[1]=IDS_CONFIRM_CANCEL; ui.RequestMessageBox(IDS_WARNING_DLC_TRIALTEXTUREPACK_TITLE, IDS_USING_TRIAL_TEXUREPACK_WARNING, uiIDA, 2, m_iPad,&TrialTexturePackWarningReturned,this,app.GetStringTable(),NULL,0,false); @@ -830,7 +830,7 @@ void UIScene_LoadMenu::StartSharedLaunchFlow() // Check if they have the Reset Nether flag set, and confirm they want to do this if(m_MoreOptionsParams.bResetNether==true) { - UINT uiIDA[2]; + unsigned int uiIDA[2]; uiIDA[0]=IDS_DONT_RESET_NETHER; uiIDA[1]=IDS_RESET_NETHER; @@ -844,7 +844,7 @@ void UIScene_LoadMenu::StartSharedLaunchFlow() void UIScene_LoadMenu::handleSliderMove(F64 sliderId, F64 currentValue) { - WCHAR TempString[256]; + wchar_t TempString[256]; int value = (int)currentValue; switch((int)sliderId) { @@ -852,7 +852,7 @@ void UIScene_LoadMenu::handleSliderMove(F64 sliderId, F64 currentValue) m_sliderDifficulty.handleSliderMove(value); app.SetGameSettings(m_iPad,eGameSetting_Difficulty,value); - swprintf( (WCHAR *)TempString, 256, L"%ls: %ls", app.GetString( IDS_SLIDER_DIFFICULTY ),app.GetString(m_iDifficultyTitleSettingA[value])); + swprintf( (wchar_t *)TempString, 256, L"%ls: %ls", app.GetString( IDS_SLIDER_DIFFICULTY ),app.GetString(m_iDifficultyTitleSettingA[value])); m_sliderDifficulty.setLabel(TempString); break; } @@ -936,7 +936,7 @@ void UIScene_LoadMenu::handleTimerComplete(int id) if(hasRegisteredSubstitutionTexture(textureName)==false) { - PBYTE pbImageData; + uint8_t* pbImageData; int iImageDataBytes=0; SonyHttp::getDataFromURL(pDLCInfo->chImageURL,(void **)&pbImageData,&iImageDataBytes); @@ -990,7 +990,7 @@ void UIScene_LoadMenu::LaunchGame(void) if( (m_bGameModeSurvival != true || m_bHasBeenInCreative) || m_MoreOptionsParams.bHostPrivileges == true) { - UINT uiIDA[2]; + unsigned int uiIDA[2]; uiIDA[0]=IDS_CONFIRM_OK; uiIDA[1]=IDS_CONFIRM_CANCEL; if(m_bGameModeSurvival != true || m_bHasBeenInCreative) @@ -1030,7 +1030,7 @@ void UIScene_LoadMenu::LaunchGame(void) // disable saving StorageManager.SetSaveDisabled(true); StorageManager.SetSaveDeviceSelected(m_iPad,false); - UINT uiIDA[1]; + unsigned int uiIDA[1]; uiIDA[0]=IDS_OK; ui.RequestMessageBox(IDS_STORAGEDEVICEPROBLEM_TITLE, IDS_FAILED_TO_LOADSAVE_TEXT, uiIDA, 1, m_iPad,&CScene_LoadGameSettings::DeviceRemovedDialogReturned,this); @@ -1071,7 +1071,7 @@ void UIScene_LoadMenu::LaunchGame(void) // disable saving StorageManager.SetSaveDisabled(true); StorageManager.SetSaveDeviceSelected(m_iPad,false); - UINT uiIDA[1]; + unsigned int uiIDA[1]; uiIDA[0]=IDS_OK; ui.RequestMessageBox(IDS_STORAGEDEVICEPROBLEM_TITLE, IDS_FAILED_TO_LOADSAVE_TEXT, uiIDA, 1, m_iPad,&CScene_LoadGameSettings::DeviceRemovedDialogReturned,this); } @@ -1130,7 +1130,7 @@ int UIScene_LoadMenu::ConfirmLoadReturned(void *pParam,int iPad,C4JStorage::EMes // disable saving StorageManager.SetSaveDisabled(true); StorageManager.SetSaveDeviceSelected(m_iPad,false); - UINT uiIDA[1]; + unsigned int uiIDA[1]; uiIDA[0]=IDS_OK; ui.RequestMessageBox(IDS_STORAGEDEVICEPROBLEM_TITLE, IDS_FAILED_TO_LOADSAVE_TEXT, uiIDA, 1, m_iPad,&CScene_LoadGameSettings::DeviceRemovedDialogReturned,this); } @@ -1181,14 +1181,14 @@ int UIScene_LoadMenu::LoadDataComplete(void *pParam) { pClass->m_bIgnoreInput = false; // 4J Stu - This is a bit messy and is due to the library incorrectly returning false for IsSignedInLive if the npAvailability isn't SCE_OK - UINT uiIDA[1]; + unsigned int uiIDA[1]; uiIDA[0]=IDS_OK; ui.RequestMessageBox(IDS_ONLINE_SERVICE_TITLE, IDS_CONTENT_RESTRICTION, uiIDA, 1, iPadNotSignedInLive, NULL, NULL, app.GetStringTable()); } else { pClass->m_bIgnoreInput=true; - UINT uiIDA[2]; + unsigned int uiIDA[2]; uiIDA[0] = IDS_PRO_NOTONLINE_ACCEPT; uiIDA[1] = IDS_CANCEL; ui.RequestMessageBox( IDS_PRO_NOTONLINE_TITLE, IDS_PRO_NOTONLINE_TEXT, uiIDA, 2, iPadNotSignedInLive, &UIScene_LoadMenu::MustSignInReturnedPSN, pClass, app.GetStringTable(), NULL, 0, false); @@ -1196,7 +1196,7 @@ int UIScene_LoadMenu::LoadDataComplete(void *pParam) return 0; #else pClass->m_bIgnoreInput=false; - UINT uiIDA[1]; + unsigned int uiIDA[1]; uiIDA[0]=IDS_CONFIRM_OK; ui.RequestMessageBox( IDS_PRO_NOTONLINE_TITLE, IDS_PRO_NOTONLINE_TEXT, uiIDA,1,ProfileManager.GetPrimaryPad(),NULL,NULL, app.GetStringTable(),NULL,0,false); return 0; @@ -1205,8 +1205,8 @@ int UIScene_LoadMenu::LoadDataComplete(void *pParam) // Check if user-created content is allowed, as we cannot play multiplayer if it's not bool noUGC = false; - BOOL pccAllowed = true; - BOOL pccFriendsAllowed = true; + bool pccAllowed = true; + bool pccFriendsAllowed = true; bool bContentRestricted = false; ProfileManager.AllowedPlayerCreatedContent(ProfileManager.GetPrimaryPad(),false,&pccAllowed,&pccFriendsAllowed); #if defined(__PS3__) || defined(__PSVITA__) @@ -1269,7 +1269,7 @@ int UIScene_LoadMenu::LoadDataComplete(void *pParam) iResult=sceNpCommerceDialogOpen(¶m); -// UINT uiIDA[2]; +// unsigned int uiIDA[2]; // uiIDA[0]=IDS_PLAY_OFFLINE; // uiIDA[1]=IDS_PLAYSTATIONPLUS_SIGNUP; // ui.RequestMessageBox( IDS_FAILED_TO_CREATE_GAME_TITLE, IDS_NO_PLAYSTATIONPLUS, uiIDA,2,ProfileManager.GetPrimaryPad(),&UIScene_LoadMenu::PSPlusReturned,pClass, app.GetStringTable(),NULL,0,false); @@ -1290,7 +1290,7 @@ int UIScene_LoadMenu::LoadDataComplete(void *pParam) } } #endif - DWORD dwLocalUsersMask = CGameNetworkManager::GetLocalPlayerMask(ProfileManager.GetPrimaryPad()); + unsigned long dwLocalUsersMask = CGameNetworkManager::GetLocalPlayerMask(ProfileManager.GetPrimaryPad()); // No guest problems so we don't need to force a sign-in of players here StartGameFromSave(pClass, dwLocalUsersMask); @@ -1329,7 +1329,7 @@ int UIScene_LoadMenu::LoadDataComplete(void *pParam) iResult=sceNpCommerceDialogOpen(¶m); -// UINT uiIDA[2]; +// unsigned int uiIDA[2]; // uiIDA[0]=IDS_PLAY_OFFLINE; // uiIDA[1]=IDS_PLAYSTATIONPLUS_SIGNUP; // ui.RequestMessageBox( IDS_FAILED_TO_CREATE_GAME_TITLE, IDS_NO_PLAYSTATIONPLUS, uiIDA,2,ProfileManager.GetPrimaryPad(),&UIScene_LoadMenu::PSPlusReturned,pClass, app.GetStringTable(),NULL,0,false); @@ -1347,7 +1347,7 @@ int UIScene_LoadMenu::LoadDataComplete(void *pParam) pClass->m_bIgnoreInput=false; // give the option to delete the save - UINT uiIDA[2]; + unsigned int uiIDA[2]; uiIDA[0]=IDS_CONFIRM_CANCEL; uiIDA[1]=IDS_CONFIRM_OK; ui.RequestMessageBox(IDS_CORRUPT_OR_DAMAGED_SAVE_TITLE, IDS_CORRUPT_OR_DAMAGED_SAVE_TEXT, uiIDA, 2, pClass->m_iPad,&UIScene_LoadMenu::DeleteSaveDialogReturned,pClass, app.GetStringTable(),NULL,0,false); @@ -1373,7 +1373,7 @@ int UIScene_LoadMenu::LoadSaveDataReturned(void *pParam,bool bIsCorrupt, bool bI #if defined(__PS3__) || defined(__ORBIS__) || defined (__PSVITA__) // show the message that trophies are disabled - UINT uiIDA[1]; + unsigned int uiIDA[1]; uiIDA[0]=IDS_CONFIRM_OK; ui.RequestMessageBox(IDS_SAVEDATA_COPIED_TITLE, IDS_SAVEDATA_COPIED_TEXT, uiIDA, 1, pClass->m_iPad,&UIScene_LoadMenu::TrophyDialogReturned,pClass, app.GetStringTable()); @@ -1418,9 +1418,9 @@ int UIScene_LoadMenu::DeleteSaveDataReturned(void *pParam,bool bSuccess) } // 4J Stu - Shared functionality that is the same whether we needed a quadrant sign-in or not -void UIScene_LoadMenu::StartGameFromSave(UIScene_LoadMenu* pClass, DWORD dwLocalUsersMask) +void UIScene_LoadMenu::StartGameFromSave(UIScene_LoadMenu* pClass, unsigned long dwLocalUsersMask) { - INT saveOrCheckpointId = 0; + int saveOrCheckpointId = 0; bool validSave = StorageManager.GetSaveUniqueNumber(&saveOrCheckpointId); TelemetryManager->RecordLevelResume(pClass->m_iPad, eSen_FriendOrMatch_Playing_With_Invited_Friends, eSen_CompeteOrCoop_Coop_and_Competitive, app.GetGameSettings(pClass->m_iPad,eGameSetting_Difficulty), app.GetLocalPlayerCount(), g_NetworkManager.GetOnlinePlayerCount(), saveOrCheckpointId); @@ -1477,7 +1477,7 @@ void UIScene_LoadMenu::StartGameFromSave(UIScene_LoadMenu* pClass, DWORD dwLocal LoadingInputParams *loadingParams = new LoadingInputParams(); loadingParams->func = &CGameNetworkManager::RunNetworkGameThreadProc; - loadingParams->lpParam = (LPVOID)param; + loadingParams->lpParam = (void*)param; // Reset the autosave time app.SetAutosaveTimerTime(); @@ -1497,7 +1497,7 @@ void UIScene_LoadMenu::checkStateAndStartGame() // Check if they have the Reset Nether flag set, and confirm they want to do this if(m_MoreOptionsParams.bResetNether==true) { - UINT uiIDA[2]; + unsigned int uiIDA[2]; uiIDA[0]=IDS_DONT_RESET_NETHER; uiIDA[1]=IDS_RESET_NETHER; @@ -1514,7 +1514,7 @@ void UIScene_LoadMenu::LoadLevelGen(LevelGenerationOptions *levelGen) bool isClientSide = ProfileManager.IsSignedInLive(ProfileManager.GetPrimaryPad()) && m_MoreOptionsParams.bOnlineGame; // 4J Stu - If we only have one controller connected, then don't show the sign-in UI again - DWORD connectedControllers = 0; + unsigned long connectedControllers = 0; for(unsigned int i = 0; i < XUSER_MAX_COUNT; ++i) { if( InputManager.IsPadConnected(i) || ProfileManager.IsSignedIn(i) ) ++connectedControllers; @@ -1525,8 +1525,8 @@ void UIScene_LoadMenu::LoadLevelGen(LevelGenerationOptions *levelGen) // Check if user-created content is allowed, as we cannot play multiplayer if it's not bool noUGC = false; - BOOL pccAllowed = true; - BOOL pccFriendsAllowed = true; + bool pccAllowed = true; + bool pccFriendsAllowed = true; ProfileManager.AllowedPlayerCreatedContent(ProfileManager.GetPrimaryPad(),false,&pccAllowed,&pccFriendsAllowed); if(!pccAllowed && !pccFriendsAllowed) noUGC = true; @@ -1534,7 +1534,7 @@ void UIScene_LoadMenu::LoadLevelGen(LevelGenerationOptions *levelGen) if(isClientSide && noUGC ) { m_bIgnoreInput=false; - UINT uiIDA[1]; + unsigned int uiIDA[1]; uiIDA[0]=IDS_CONFIRM_OK; ui.RequestMessageBox( IDS_FAILED_TO_CREATE_GAME_TITLE, IDS_NO_USER_CREATED_CONTENT_PRIVILEGE_CREATE, uiIDA,1,ProfileManager.GetPrimaryPad(),NULL,NULL, app.GetStringTable(),NULL,0,false); return; @@ -1542,7 +1542,7 @@ void UIScene_LoadMenu::LoadLevelGen(LevelGenerationOptions *levelGen) } - DWORD dwLocalUsersMask = 0; + unsigned long dwLocalUsersMask = 0; dwLocalUsersMask |= CGameNetworkManager::GetLocalPlayerMask(ProfileManager.GetPrimaryPad()); // Load data from disc @@ -1601,7 +1601,7 @@ void UIScene_LoadMenu::LoadLevelGen(LevelGenerationOptions *levelGen) LoadingInputParams *loadingParams = new LoadingInputParams(); loadingParams->func = &CGameNetworkManager::RunNetworkGameThreadProc; - loadingParams->lpParam = (LPVOID)param; + loadingParams->lpParam = (void*)param; // Reset the autosave time app.SetAutosaveTimerTime(); @@ -1627,7 +1627,7 @@ int UIScene_LoadMenu::StartGame_SignInReturned(void *pParam,bool bContinue, int { int primaryPad = ProfileManager.GetPrimaryPad(); bool noPrivileges = false; - DWORD dwLocalUsersMask = 0; + unsigned long dwLocalUsersMask = 0; bool isSignedInLive = ProfileManager.IsSignedInLive(primaryPad); bool isOnlineGame = pClass->m_MoreOptionsParams.bOnlineGame; int iPadNotSignedInLive = -1; @@ -1661,14 +1661,14 @@ int UIScene_LoadMenu::StartGame_SignInReturned(void *pParam,bool bContinue, int { pClass->m_bIgnoreInput = false; // 4J Stu - This is a bit messy and is due to the library incorrectly returning false for IsSignedInLive if the npAvailability isn't SCE_OK - UINT uiIDA[1]; + unsigned int uiIDA[1]; uiIDA[0]=IDS_OK; ui.RequestMessageBox(IDS_ONLINE_SERVICE_TITLE, IDS_CONTENT_RESTRICTION, uiIDA, 1, iPadNotSignedInLive, NULL, NULL, app.GetStringTable()); } else { pClass->m_bIgnoreInput=true; - UINT uiIDA[2]; + unsigned int uiIDA[2]; uiIDA[0] = IDS_PRO_NOTONLINE_ACCEPT; uiIDA[1] = IDS_CANCEL; ui.RequestMessageBox( IDS_PRO_NOTONLINE_TITLE, IDS_PRO_NOTONLINE_TEXT, uiIDA, 2, iPadNotSignedInLive, &UIScene_LoadMenu::MustSignInReturnedPSN, pClass, app.GetStringTable(), NULL, 0, false); @@ -1676,7 +1676,7 @@ int UIScene_LoadMenu::StartGame_SignInReturned(void *pParam,bool bContinue, int return 0; #else pClass->m_bIgnoreInput=false; - UINT uiIDA[1]; + unsigned int uiIDA[1]; uiIDA[0]=IDS_CONFIRM_OK; ui.RequestMessageBox( IDS_PRO_NOTONLINE_TITLE, IDS_PRO_NOTONLINE_TEXT, uiIDA,1,ProfileManager.GetPrimaryPad(),NULL,NULL, app.GetStringTable(),NULL,0,false); return 0; @@ -1685,8 +1685,8 @@ int UIScene_LoadMenu::StartGame_SignInReturned(void *pParam,bool bContinue, int // Check if user-created content is allowed, as we cannot play multiplayer if it's not bool noUGC = false; - BOOL pccAllowed = true; - BOOL pccFriendsAllowed = true; + bool pccAllowed = true; + bool pccFriendsAllowed = true; ProfileManager.AllowedPlayerCreatedContent(ProfileManager.GetPrimaryPad(),false,&pccAllowed,&pccFriendsAllowed); if(!pccAllowed && !pccFriendsAllowed) noUGC = true; @@ -1697,7 +1697,7 @@ int UIScene_LoadMenu::StartGame_SignInReturned(void *pParam,bool bContinue, int { pClass->m_bIgnoreInput = false; pClass->setVisible( true ); - UINT uiIDA[1]; + unsigned int uiIDA[1]; uiIDA[0]=IDS_CONFIRM_OK; ui.RequestMessageBox( IDS_FAILED_TO_CREATE_GAME_TITLE, IDS_NO_USER_CREATED_CONTENT_PRIVILEGE_CREATE, uiIDA,1,ProfileManager.GetPrimaryPad(),NULL,NULL, app.GetStringTable(),NULL,0,false); } @@ -1705,7 +1705,7 @@ int UIScene_LoadMenu::StartGame_SignInReturned(void *pParam,bool bContinue, int { pClass->m_bIgnoreInput = false; pClass->setVisible( true ); - UINT uiIDA[1]; + unsigned int uiIDA[1]; uiIDA[0]=IDS_CONFIRM_OK; ui.RequestMessageBox( IDS_NO_MULTIPLAYER_PRIVILEGE_TITLE, IDS_NO_MULTIPLAYER_PRIVILEGE_HOST_TEXT, uiIDA,1,ProfileManager.GetPrimaryPad(),NULL,NULL, app.GetStringTable(),NULL,0,false); } diff --git a/src/client/Common/UI/UIScene_LoadMenu.h b/src/client/Common/UI/UIScene_LoadMenu.h index e45fa09c..12a893a1 100644 --- a/src/client/Common/UI/UIScene_LoadMenu.h +++ b/src/client/Common/UI/UIScene_LoadMenu.h @@ -61,14 +61,14 @@ private: bool m_bRequestQuadrantSignin; bool m_bIsCorrupt; bool m_bThumbnailGetFailed; - __int64 m_seed; + int64_t m_seed; #ifdef __PS3__ std::vector*m_pvProductInfo; #endif //int *m_iConfigA; // track the texture packs that we don't have installed - PBYTE m_pbThumbnailData; + uint8_t* m_pbThumbnailData; unsigned int m_uiThumbnailSize; wstring m_thumbnailName; @@ -108,15 +108,15 @@ private: void LaunchGame(void); #ifdef _DURANGO - static void checkPrivilegeCallback(LPVOID lpParam, bool hasPrivilege, int iPad); + static void checkPrivilegeCallback(void* lpParam, bool hasPrivilege, int iPad); #endif static int ConfirmLoadReturned(void *pParam,int iPad,C4JStorage::EMessageResult result); - static void StartGameFromSave(UIScene_LoadMenu* pClass, DWORD dwLocalUsersMask); + static void StartGameFromSave(UIScene_LoadMenu* pClass, unsigned long dwLocalUsersMask); static int LoadSaveDataReturned(void *pParam,bool bIsCorrupt, bool bIsOwner); static int TrophyDialogReturned(void *pParam,int iPad,C4JStorage::EMessageResult result); static int LoadDataComplete(void *pParam); - static int LoadSaveDataThumbnailReturned(LPVOID lpParam,PBYTE pbThumbnail,DWORD dwThumbnailBytes); + static int LoadSaveDataThumbnailReturned(void* lpParam,uint8_t* pbThumbnail,unsigned long dwThumbnailBytes); static int CheckResetNetherReturned(void *pParam,int iPad,C4JStorage::EMessageResult result); static int DeleteSaveDialogReturned(void *pParam,int iPad,C4JStorage::EMessageResult result); static int DeleteSaveDataReturned(void *pParam,bool bSuccess); @@ -127,5 +127,5 @@ private: #endif public: - static int StartGame_SignInReturned(LPVOID pParam, bool, int); + static int StartGame_SignInReturned(void* pParam, bool, int); }; \ No newline at end of file diff --git a/src/client/Common/UI/UIScene_LoadOrJoinMenu.cpp b/src/client/Common/UI/UIScene_LoadOrJoinMenu.cpp index 10e82ee6..d975ed52 100644 --- a/src/client/Common/UI/UIScene_LoadOrJoinMenu.cpp +++ b/src/client/Common/UI/UIScene_LoadOrJoinMenu.cpp @@ -51,7 +51,7 @@ C4JStorage::SAVETRANSFER_FILE_DETAILS UIScene_LoadOrJoinMenu::m_debugTransferDet #endif #endif -int UIScene_LoadOrJoinMenu::LoadSaveDataThumbnailReturned(LPVOID lpParam,PBYTE pbThumbnail,DWORD dwThumbnailBytes) +int UIScene_LoadOrJoinMenu::LoadSaveDataThumbnailReturned(void* lpParam,uint8_t* pbThumbnail,unsigned long dwThumbnailBytes) { UIScene_LoadOrJoinMenu *pClass= (UIScene_LoadOrJoinMenu *)lpParam; @@ -59,7 +59,7 @@ int UIScene_LoadOrJoinMenu::LoadSaveDataThumbnailReturned(LPVOID lpParam,PBYTE p if(pbThumbnail && dwThumbnailBytes) { - pClass->m_saveDetails[pClass->m_iRequestingThumbnailId].pbThumbnailData = new BYTE[dwThumbnailBytes]; + pClass->m_saveDetails[pClass->m_iRequestingThumbnailId].pbThumbnailData = new uint8_t[dwThumbnailBytes]; memcpy(pClass->m_saveDetails[pClass->m_iRequestingThumbnailId].pbThumbnailData, pbThumbnail, dwThumbnailBytes); pClass->m_saveDetails[pClass->m_iRequestingThumbnailId].dwThumbnailSize = dwThumbnailBytes; } @@ -74,7 +74,7 @@ int UIScene_LoadOrJoinMenu::LoadSaveDataThumbnailReturned(LPVOID lpParam,PBYTE p return 0; } -int UIScene_LoadOrJoinMenu::LoadSaveCallback(LPVOID lpParam,bool bRes) +int UIScene_LoadOrJoinMenu::LoadSaveCallback(void* lpParam,bool bRes) { //UIScene_LoadOrJoinMenu *pClass= (UIScene_LoadOrJoinMenu *)lpParam; // Get the save data now @@ -216,7 +216,7 @@ UIScene_LoadOrJoinMenu::UIScene_LoadOrJoinMenu(int iPad, void *initData, UILayer char *pchDLCName=app.GetDLCInfoTextures(i); pDLCInfo=app.GetDLCInfo(pchDLCName); #else - ULONGLONG ull=app.GetDLCInfoTexturesFullOffer(i); + uint64_t ull=app.GetDLCInfoTexturesFullOffer(i); pDLCInfo=app.GetDLCInfoForFullOfferID(ull); #endif for(unsigned int i = 0; i < texturePacksCount; ++i) @@ -251,7 +251,7 @@ UIScene_LoadOrJoinMenu::UIScene_LoadOrJoinMenu(int iPad, void *initData, UILayer char *pchDLCName=app.GetDLCInfoTextures(i); pDLCInfo=app.GetDLCInfo(pchDLCName); #else - ULONGLONG ull=app.GetDLCInfoTexturesFullOffer(i); + uint64_t ull=app.GetDLCInfoTexturesFullOffer(i); pDLCInfo=app.GetDLCInfoForFullOfferID(ull); #endif for(unsigned int i = 0; i < texturePacksCount; ++i) @@ -667,9 +667,9 @@ void UIScene_LoadOrJoinMenu::tick() MB_ERR_INVALID_CHARS, // error on invalid chars m_saveDetails[m_iRequestingThumbnailId].UTF8SaveFilename, // source UTF-8 string MAX_SAVEFILENAME_LENGTH, // total length of source UTF-8 string, - // in CHAR's (= bytes), including end-of-string \0 + // in char's (= bytes), including end-of-string \0 (wchar_t *)u16Message, // destination buffer - MAX_SAVEFILENAME_LENGTH // size of destination buffer, in WCHAR's + MAX_SAVEFILENAME_LENGTH // size of destination buffer, in wchar_t's ); #else #ifdef __PS3 @@ -773,7 +773,7 @@ void UIScene_LoadOrJoinMenu::tick() #ifdef _XBOX_ONE if(g_NetworkManager.ShouldMessageForFullSession()) { - UINT uiIDA[1]; + unsigned int uiIDA[1]; uiIDA[0]=IDS_CONFIRM_OK; ui.RequestMessageBox( IDS_CONNECTION_FAILED, IDS_IN_PARTY_SESSION_FULL, uiIDA,1,ProfileManager.GetPrimaryPad(),NULL,NULL, app.GetStringTable()); } @@ -927,8 +927,8 @@ void UIScene_LoadOrJoinMenu::AddDefaultButtons() // increment the count of the mash-up pack worlds in the save list m_iMashUpButtonsC++; TexturePack *tp = Minecraft::GetInstance()->skins->getTexturePackById(levelGen->getRequiredTexturePackId()); - DWORD dwImageBytes; - PBYTE pbImageData = tp->getPackIcon(dwImageBytes); + unsigned long dwImageBytes; + uint8_t* pbImageData = tp->getPackIcon(dwImageBytes); if(dwImageBytes > 0 && pbImageData) { @@ -1003,7 +1003,7 @@ void UIScene_LoadOrJoinMenu::handleInput(int iPad, int key, bool repeat, bool pr int npAvailability = ProfileManager.getNPAvailability(iPad); if (npAvailability == SCE_NP_ERROR_AGE_RESTRICTION) { - UINT uiIDA[1]; + unsigned int uiIDA[1]; uiIDA[0] = IDS_OK; ui.RequestMessageBox(IDS_ONLINE_SERVICE_TITLE, IDS_CONTENT_RESTRICTION, uiIDA, 1, iPad, NULL, NULL, app.GetStringTable()); @@ -1015,7 +1015,7 @@ void UIScene_LoadOrJoinMenu::handleInput(int iPad, int key, bool repeat, bool pr if(!ProfileManager.IsSignedInLive(iPad)) { // get them to sign in to online - UINT uiIDA[2]; + unsigned int uiIDA[2]; uiIDA[0]=IDS_PRO_NOTONLINE_ACCEPT; uiIDA[1]=IDS_PRO_NOTONLINE_DECLINE; ui.RequestMessageBox(IDS_PRO_NOTONLINE_TITLE, IDS_PRO_NOTONLINE_TEXT, uiIDA, 2, ProfileManager.GetPrimaryPad(), &UIScene_LoadOrJoinMenu::MustSignInReturnedPSN, this, app.GetStringTable(),NULL,0,false); @@ -1035,7 +1035,7 @@ void UIScene_LoadOrJoinMenu::handleInput(int iPad, int key, bool repeat, bool pr #elif defined(_DURANGO) if(getControlFocus() == eControl_GamesList && m_buttonListGames.getItemCount() > 0) { - DWORD nIndex = m_buttonListGames.getCurrentSelection(); + unsigned long nIndex = m_buttonListGames.getCurrentSelection(); FriendSessionInfo *pSelectedSession = m_currentSessions->at( nIndex ); PlayerUID uid = pSelectedSession->searchResult.m_playerXuids[0]; @@ -1058,7 +1058,7 @@ void UIScene_LoadOrJoinMenu::handleInput(int iPad, int key, bool repeat, bool pr { // delete the save game // Have to ask the player if they are sure they want to delete this game - UINT uiIDA[2]; + unsigned int uiIDA[2]; uiIDA[0]=IDS_CONFIRM_CANCEL; uiIDA[1]=IDS_CONFIRM_OK; ui.RequestMessageBox(IDS_TOOLTIPS_DELETESAVE, IDS_TEXT_DELETE_SAVE, uiIDA, 2, iPad,&UIScene_LoadOrJoinMenu::DeleteSaveDialogReturned,this, app.GetStringTable(),NULL,0,false); @@ -1067,7 +1067,7 @@ void UIScene_LoadOrJoinMenu::handleInput(int iPad, int key, bool repeat, bool pr { if(StorageManager.EnoughSpaceForAMinSaveGame()) { - UINT uiIDA[4]; + unsigned int uiIDA[4]; uiIDA[0]=IDS_CONFIRM_CANCEL; uiIDA[1]=IDS_TITLE_RENAMESAVE; uiIDA[2]=IDS_TOOLTIPS_DELETESAVE; @@ -1089,7 +1089,7 @@ void UIScene_LoadOrJoinMenu::handleInput(int iPad, int key, bool repeat, bool pr { // delete the save game // Have to ask the player if they are sure they want to delete this game - UINT uiIDA[2]; + unsigned int uiIDA[2]; uiIDA[0]=IDS_CONFIRM_CANCEL; uiIDA[1]=IDS_CONFIRM_OK; ui.RequestMessageBox(IDS_TOOLTIPS_DELETESAVE, IDS_TEXT_DELETE_SAVE, uiIDA, 2,iPad,&UIScene_LoadOrJoinMenu::DeleteSaveDialogReturned,this, app.GetStringTable(),NULL,0,false); @@ -1165,7 +1165,7 @@ void UIScene_LoadOrJoinMenu::handleInput(int iPad, int key, bool repeat, bool pr } } -int UIScene_LoadOrJoinMenu::KeyboardCompleteWorldNameCallback(LPVOID lpParam,bool bRes) +int UIScene_LoadOrJoinMenu::KeyboardCompleteWorldNameCallback(void* lpParam,bool bRes) { // 4J HEG - No reason to set value if keyboard was cancelled UIScene_LoadOrJoinMenu *pClass=(UIScene_LoadOrJoinMenu *)lpParam; @@ -1224,7 +1224,7 @@ void UIScene_LoadOrJoinMenu::handleFocusChange(F64 controlId, F64 childId) #ifdef SONY_REMOTE_STORAGE_DOWNLOAD -void UIScene_LoadOrJoinMenu::remoteStorageGetSaveCallback(LPVOID lpParam, SonyRemoteStorage::Status s, int error_code) +void UIScene_LoadOrJoinMenu::remoteStorageGetSaveCallback(void* lpParam, SonyRemoteStorage::Status s, int error_code) { app.DebugPrintf("remoteStorageGetCallback err : 0x%08x\n", error_code); assert(error_code == 0); @@ -1290,7 +1290,7 @@ void UIScene_LoadOrJoinMenu::handlePress(F64 controlId, F64 childId) if(pSaveInfo->thumbnailData == NULL && pSaveInfo->modifiedTime == 0) // no thumbnail data and time of zero and zero blocks useset for corrupt files { // give the option to delete the save - UINT uiIDA[2]; + unsigned int uiIDA[2]; uiIDA[0]=IDS_CONFIRM_CANCEL; uiIDA[1]=IDS_CONFIRM_OK; ui.RequestMessageBox(IDS_CORRUPT_OR_DAMAGED_SAVE_TITLE, IDS_CORRUPT_OR_DAMAGED_SAVE_TEXT, uiIDA, 2, ProfileManager.GetPrimaryPad(),&UIScene_LoadOrJoinMenu::DeleteSaveDialogReturned,this, app.GetStringTable(),NULL,0,false); @@ -1408,7 +1408,7 @@ void UIScene_LoadOrJoinMenu::CheckAndJoinGame(int gameIndex) { // not allowed to join #ifndef __PSVITA__ - UINT uiIDA[1]; + unsigned int uiIDA[1]; uiIDA[0]=IDS_CONFIRM_OK; // Not allowed to play online ui.RequestMessageBox(IDS_ONLINE_GAME, IDS_CHAT_RESTRICTION_UGC, uiIDA, 1, m_iPad,NULL,this,app.GetStringTable(),NULL,0,false); @@ -1431,7 +1431,7 @@ void UIScene_LoadOrJoinMenu::CheckAndJoinGame(int gameIndex) // If this is an online game but not all players are signed in to Live, stop! else if (!isSignedInLive) { - UINT uiIDA[1]; + unsigned int uiIDA[1]; uiIDA[0]=IDS_CONFIRM_OK; // Check if PSN is unavailable because of age restriction @@ -1463,7 +1463,7 @@ void UIScene_LoadOrJoinMenu::CheckAndJoinGame(int gameIndex) iResult=sceNpCommerceDialogOpen(¶m); - // UINT uiIDA[2]; + // unsigned int uiIDA[2]; // uiIDA[0]=IDS_CONFIRM_OK; // uiIDA[1]=IDS_PLAYSTATIONPLUS_SIGNUP; // ui.RequestMessageBox( IDS_FAILED_TO_CREATE_GAME_TITLE, IDS_NO_PLAYSTATIONPLUS, uiIDA,2,ProfileManager.GetPrimaryPad(),&UIScene_LoadOrJoinMenu::PSPlusReturned,this, app.GetStringTable(),NULL,0,false); @@ -1501,12 +1501,12 @@ void UIScene_LoadOrJoinMenu::CheckAndJoinGame(int gameIndex) // upsell the texture pack // tell sentient about the upsell of the full version of the skin pack #ifdef _XBOX - ULONGLONG ullOfferID_Full; + uint64_t ullOfferID_Full; app.GetDLCFullOfferIDForPackID(m_initData->selectedSession->data.texturePackParentId,&ullOfferID_Full); TelemetryManager->RecordUpsellPresented(m_iPad, eSet_UpsellID_Texture_DLC, ullOfferID_Full & 0xFFFFFFFF); #endif - UINT uiIDA[2]; + unsigned int uiIDA[2]; uiIDA[0]=IDS_TEXTUREPACK_FULLVERSION; //uiIDA[1]=IDS_TEXTURE_PACK_TRIALVERSION; @@ -1578,7 +1578,7 @@ void UIScene_LoadOrJoinMenu::LoadLevelGen(LevelGenerationOptions *levelGen) LoadingInputParams *loadingParams = new LoadingInputParams(); loadingParams->func = &CGameNetworkManager::RunNetworkGameThreadProc; - loadingParams->lpParam = (LPVOID)param; + loadingParams->lpParam = (void*)param; UIFullscreenProgressCompletionData *completionData = new UIFullscreenProgressCompletionData(); completionData->bShowBackground=true; @@ -1590,7 +1590,7 @@ void UIScene_LoadOrJoinMenu::LoadLevelGen(LevelGenerationOptions *levelGen) ui.NavigateToScene(ProfileManager.GetPrimaryPad(),eUIScene_FullscreenProgress, loadingParams); } -void UIScene_LoadOrJoinMenu::UpdateGamesListCallback(LPVOID pParam) +void UIScene_LoadOrJoinMenu::UpdateGamesListCallback(void* pParam) { if(pParam != NULL) { @@ -1641,7 +1641,7 @@ void UIScene_LoadOrJoinMenu::UpdateGamesList() unsigned int xuiListSize = m_buttonListGames.getItemCount(); unsigned int filteredListSize = (unsigned int)m_currentSessions->size(); - BOOL gamesListHasFocus = DoesGamesListHaveFocus(); + bool gamesListHasFocus = DoesGamesListHaveFocus(); if(filteredListSize > 0) { @@ -1689,15 +1689,15 @@ void UIScene_LoadOrJoinMenu::UpdateGamesList() // Do we have the texture pack Minecraft *pMinecraft = Minecraft::GetInstance(); TexturePack *tp = pMinecraft->skins->getTexturePackById(sessionInfo->data.texturePackParentId); - HRESULT hr; + int hr; - DWORD dwImageBytes=0; - PBYTE pbImageData=NULL; + unsigned long dwImageBytes=0; + uint8_t* pbImageData=NULL; if(tp==NULL) { - DWORD dwBytes=0; - PBYTE pbData=NULL; + unsigned long dwBytes=0; + uint8_t* pbData=NULL; app.GetTPD(sessionInfo->data.texturePackParentId,&pbData,&dwBytes); // is it in the tpd data ? @@ -1724,8 +1724,8 @@ void UIScene_LoadOrJoinMenu::UpdateGamesList() Minecraft *pMinecraft = Minecraft::GetInstance(); TexturePack *tp = pMinecraft->skins->getTexturePackByIndex(0); - DWORD dwImageBytes; - PBYTE pbImageData = tp->getPackIcon(dwImageBytes); + unsigned long dwImageBytes; + uint8_t* pbImageData = tp->getPackIcon(dwImageBytes); if(dwImageBytes > 0 && pbImageData) { @@ -1848,7 +1848,7 @@ void UIScene_LoadOrJoinMenu::handleTimerComplete(int id) if(hasRegisteredSubstitutionTexture(textureName)==false) { - PBYTE pbImageData; + uint8_t* pbImageData; int iImageDataBytes=0; SonyHttp::getDataFromURL(pDLCInfo->chImageURL,(void **)&pbImageData,&iImageDataBytes); @@ -1896,7 +1896,7 @@ void UIScene_LoadOrJoinMenu::LoadSaveFromDisk(File *saveFile, ESavePlatform save // Make our next save default to the name of the level StorageManager.SetSaveTitle(saveFile->getName().c_str()); - __int64 fileSize = saveFile->length(); + int64_t fileSize = saveFile->length(); FileInputStream fis(*saveFile); byteArray ba(fileSize); fis.read(ba); @@ -1932,7 +1932,7 @@ void UIScene_LoadOrJoinMenu::LoadSaveFromDisk(File *saveFile, ESavePlatform save LoadingInputParams *loadingParams = new LoadingInputParams(); loadingParams->func = &CGameNetworkManager::RunNetworkGameThreadProc; - loadingParams->lpParam = (LPVOID)param; + loadingParams->lpParam = (void*)param; UIFullscreenProgressCompletionData *completionData = new UIFullscreenProgressCompletionData(); completionData->bShowBackground=true; @@ -1960,7 +1960,7 @@ void UIScene_LoadOrJoinMenu::LoadSaveFromCloud() mbstowcs(wSaveName, app.getRemoteStorage()->getSaveNameUTF8(), strlen(app.getRemoteStorage()->getSaveNameUTF8())+1); // plus null StorageManager.SetSaveTitle(wSaveName); - __int64 fileSize = cloudFile.length(); + int64_t fileSize = cloudFile.length(); FileInputStream fis(cloudFile); byteArray ba(fileSize); fis.read(ba); @@ -1997,7 +1997,7 @@ void UIScene_LoadOrJoinMenu::LoadSaveFromCloud() LoadingInputParams *loadingParams = new LoadingInputParams(); loadingParams->func = &CGameNetworkManager::RunNetworkGameThreadProc; - loadingParams->lpParam = (LPVOID)param; + loadingParams->lpParam = (void*)param; UIFullscreenProgressCompletionData *completionData = new UIFullscreenProgressCompletionData(); completionData->bShowBackground=true; @@ -2027,7 +2027,7 @@ int UIScene_LoadOrJoinMenu::DeleteSaveDialogReturned(void *pParam,int iPad,C4JSt } else { - StorageManager.DeleteSaveData(&pClass->m_pSaveDetails->SaveInfoA[pClass->m_iSaveListIndex - pClass->m_iDefaultButtonsC], UIScene_LoadOrJoinMenu::DeleteSaveDataReturned, (LPVOID)pClass->GetCallbackUniqueId()); + StorageManager.DeleteSaveData(&pClass->m_pSaveDetails->SaveInfoA[pClass->m_iSaveListIndex - pClass->m_iDefaultButtonsC], UIScene_LoadOrJoinMenu::DeleteSaveDataReturned, (void*)pClass->GetCallbackUniqueId()); pClass->m_controlSavesTimer.setVisible( true ); } } @@ -2039,7 +2039,7 @@ int UIScene_LoadOrJoinMenu::DeleteSaveDialogReturned(void *pParam,int iPad,C4JSt return 0; } -int UIScene_LoadOrJoinMenu::DeleteSaveDataReturned(LPVOID lpParam,bool bRes) +int UIScene_LoadOrJoinMenu::DeleteSaveDataReturned(void* lpParam,bool bRes) { ui.EnterCallbackIdCriticalSection(); UIScene_LoadOrJoinMenu* pClass = (UIScene_LoadOrJoinMenu*)ui.GetSceneFromCallbackId((size_t)lpParam); @@ -2060,7 +2060,7 @@ int UIScene_LoadOrJoinMenu::DeleteSaveDataReturned(LPVOID lpParam,bool bRes) } -int UIScene_LoadOrJoinMenu::RenameSaveDataReturned(LPVOID lpParam,bool bRes) +int UIScene_LoadOrJoinMenu::RenameSaveDataReturned(void* lpParam,bool bRes) { UIScene_LoadOrJoinMenu* pClass = (UIScene_LoadOrJoinMenu*)lpParam; @@ -2105,15 +2105,15 @@ int UIScene_LoadOrJoinMenu::SaveOptionsDialogReturned(void *pParam,int iPad,C4JS pClass->m_bIgnoreInput=true; #ifdef _DURANGO // bring up a keyboard - InputManager.RequestKeyboard(app.GetString(IDS_RENAME_WORLD_TITLE), (pClass->m_saveDetails[pClass->m_iSaveListIndex-pClass->m_iDefaultButtonsC]).UTF16SaveName,(DWORD)0,25,&UIScene_LoadOrJoinMenu::KeyboardCompleteWorldNameCallback,pClass,C_4JInput::EKeyboardMode_Default); + InputManager.RequestKeyboard(app.GetString(IDS_RENAME_WORLD_TITLE), (pClass->m_saveDetails[pClass->m_iSaveListIndex-pClass->m_iDefaultButtonsC]).UTF16SaveName,(unsigned long)0,25,&UIScene_LoadOrJoinMenu::KeyboardCompleteWorldNameCallback,pClass,C_4JInput::EKeyboardMode_Default); #else // bring up a keyboard wchar_t wSaveName[128]; //CD - Fix - We must memset the SaveName ZeroMemory(wSaveName, 128 * sizeof(wchar_t) ); mbstowcs(wSaveName, pClass->m_saveDetails[pClass->m_iSaveListIndex - pClass->m_iDefaultButtonsC].UTF8SaveName, strlen(pClass->m_saveDetails->UTF8SaveName)+1); // plus null - LPWSTR ptr = wSaveName; - InputManager.RequestKeyboard(app.GetString(IDS_RENAME_WORLD_TITLE),wSaveName,(DWORD)0,25,&UIScene_LoadOrJoinMenu::KeyboardCompleteWorldNameCallback,pClass,C_4JInput::EKeyboardMode_Default); + wchar_t* ptr = wSaveName; + InputManager.RequestKeyboard(app.GetString(IDS_RENAME_WORLD_TITLE),wSaveName,(unsigned long)0,25,&UIScene_LoadOrJoinMenu::KeyboardCompleteWorldNameCallback,pClass,C_4JInput::EKeyboardMode_Default); #endif } break; @@ -2122,7 +2122,7 @@ int UIScene_LoadOrJoinMenu::SaveOptionsDialogReturned(void *pParam,int iPad,C4JS { // delete the save game // Have to ask the player if they are sure they want to delete this game - UINT uiIDA[2]; + unsigned int uiIDA[2]; uiIDA[0]=IDS_CONFIRM_CANCEL; uiIDA[1]=IDS_CONFIRM_OK; ui.RequestMessageBox(IDS_TOOLTIPS_DELETESAVE, IDS_TEXT_DELETE_SAVE, uiIDA, 2, iPad,&UIScene_LoadOrJoinMenu::DeleteSaveDialogReturned,pClass, app.GetStringTable(),NULL,0,false); @@ -2132,7 +2132,7 @@ int UIScene_LoadOrJoinMenu::SaveOptionsDialogReturned(void *pParam,int iPad,C4JS #ifdef SONY_REMOTE_STORAGE_UPLOAD case C4JStorage::EMessage_ResultFourthOption: // upload to cloud { - UINT uiIDA[2]; + unsigned int uiIDA[2]; uiIDA[0]=IDS_CONFIRM_OK; uiIDA[1]=IDS_CONFIRM_CANCEL; @@ -2143,7 +2143,7 @@ int UIScene_LoadOrJoinMenu::SaveOptionsDialogReturned(void *pParam,int iPad,C4JS #if defined _XBOX_ONE || defined __ORBIS__ case C4JStorage::EMessage_ResultFourthOption: // copy save { - UINT uiIDA[2]; + unsigned int uiIDA[2]; uiIDA[0]=IDS_CONFIRM_OK; uiIDA[1]=IDS_CONFIRM_CANCEL; @@ -2174,8 +2174,8 @@ int UIScene_LoadOrJoinMenu::TexturePackDialogReturned(void *pParam,int iPad,C4JS // we need to enable background downloading for the DLC XBackgroundDownloadSetMode(XBACKGROUND_DOWNLOAD_MODE_ALWAYS_ALLOW); #if TO_BE_IMPLEMENTED - ULONGLONG ullOfferID_Full; - ULONGLONG ullIndexA[1]; + uint64_t ullOfferID_Full; + uint64_t ullIndexA[1]; app.GetDLCFullOfferIDForPackID(pClass->m_initData->selectedSession->data.texturePackParentId,&ullOfferID_Full); @@ -2202,12 +2202,12 @@ int UIScene_LoadOrJoinMenu::TexturePackDialogReturned(void *pParam,int iPad,C4JS wstring ProductId; app.GetDLCFullOfferIDForPackID(pClass->m_initData->selectedSession->data.texturePackParentId,ProductId); - StorageManager.InstallOffer(1,(WCHAR *)ProductId.c_str(),NULL,NULL); + StorageManager.InstallOffer(1,(wchar_t *)ProductId.c_str(),NULL,NULL); } else { // 4J-JEV: Fix for XB1: #165863 - XR-074: Compliance: With no active network connection user is unable to convert from Trial to Full texture pack and is not messaged why. - UINT uiIDA[1] = { IDS_CONFIRM_OK }; + unsigned int uiIDA[1] = { IDS_CONFIRM_OK }; ui.RequestMessageBox(IDS_PRO_NOTONLINE_TITLE, IDS_PRO_XBOXLIVE_NOTIFICATION, uiIDA, 1, iPad, NULL, NULL, app.GetStringTable()); } } @@ -2282,7 +2282,7 @@ void UIScene_LoadOrJoinMenu::LaunchSaveTransfer() { LoadingInputParams *loadingParams = new LoadingInputParams(); loadingParams->func = &UIScene_LoadOrJoinMenu::DownloadSonyCrossSaveThreadProc; - loadingParams->lpParam = (LPVOID)this; + loadingParams->lpParam = (void*)this; UIFullscreenProgressCompletionData *completionData = new UIFullscreenProgressCompletionData(); completionData->bShowBackground=true; @@ -2301,7 +2301,7 @@ void UIScene_LoadOrJoinMenu::LaunchSaveTransfer() -int UIScene_LoadOrJoinMenu::CreateDummySaveDataCallback(LPVOID lpParam,bool bRes) +int UIScene_LoadOrJoinMenu::CreateDummySaveDataCallback(void* lpParam,bool bRes) { UIScene_LoadOrJoinMenu* pClass = (UIScene_LoadOrJoinMenu *) lpParam; if(bRes) @@ -2317,7 +2317,7 @@ int UIScene_LoadOrJoinMenu::CreateDummySaveDataCallback(LPVOID lpParam,bool bRes return 0; } -int UIScene_LoadOrJoinMenu::CrossSaveGetSavesInfoCallback(LPVOID lpParam, SAVE_DETAILS *pSaveDetails, bool bRes) +int UIScene_LoadOrJoinMenu::CrossSaveGetSavesInfoCallback(void* lpParam, SAVE_DETAILS *pSaveDetails, bool bRes) { UIScene_LoadOrJoinMenu* pClass = (UIScene_LoadOrJoinMenu *) lpParam; if(bRes) @@ -2356,7 +2356,7 @@ int UIScene_LoadOrJoinMenu::CrossSaveFinishedCallback(void *pParam,int iPad,C4JS } -int UIScene_LoadOrJoinMenu::CrossSaveDeleteOnErrorReturned(LPVOID lpParam,bool bRes) +int UIScene_LoadOrJoinMenu::CrossSaveDeleteOnErrorReturned(void* lpParam,bool bRes) { UIScene_LoadOrJoinMenu* pClass = (UIScene_LoadOrJoinMenu *) lpParam; pClass->m_eSaveTransferState = eSaveTransfer_ErrorMesssage; @@ -2375,7 +2375,7 @@ int UIScene_LoadOrJoinMenu::RemoteSaveNotFoundCallback(void *pParam,int iPad,C4J bool g_bForceVitaSaveWipe = false; -int UIScene_LoadOrJoinMenu::DownloadSonyCrossSaveThreadProc( LPVOID lpParameter ) +int UIScene_LoadOrJoinMenu::DownloadSonyCrossSaveThreadProc( void* lpParameter ) { Compression::UseDefaultThreadStorage(); UIScene_LoadOrJoinMenu* pClass = (UIScene_LoadOrJoinMenu *) lpParameter; @@ -2421,7 +2421,7 @@ int UIScene_LoadOrJoinMenu::DownloadSonyCrossSaveThreadProc( LPVOID lpParameter else { // no save available, inform the user about the functionality - UINT uiIDA[1]; + unsigned int uiIDA[1]; uiIDA[0]=IDS_CONFIRM_OK; ui.RequestMessageBox(IDS_TOOLTIPS_SAVETRANSFER_DOWNLOAD, IDS_SAVE_TRANSFER_NOT_AVAILABLE_TEXT, uiIDA, 1, ProfileManager.GetPrimaryPad(),RemoteSaveNotFoundCallback,pClass, app.GetStringTable(),NULL,0,false); } @@ -2435,16 +2435,16 @@ int UIScene_LoadOrJoinMenu::DownloadSonyCrossSaveThreadProc( LPVOID lpParameter const char* pNameUTF8 = app.getRemoteStorage()->getSaveNameUTF8(); mbstowcs(wSaveName, pNameUTF8, strlen(pNameUTF8)+1); // plus null StorageManager.SetSaveTitle(wSaveName); - PBYTE pbThumbnailData=NULL; - DWORD dwThumbnailDataSize=0; + uint8_t* pbThumbnailData=NULL; + unsigned long dwThumbnailDataSize=0; - PBYTE pbDataSaveImage=NULL; - DWORD dwDataSizeSaveImage=0; + uint8_t* pbDataSaveImage=NULL; + unsigned long dwDataSizeSaveImage=0; StorageManager.GetDefaultSaveImage(&pbDataSaveImage, &dwDataSizeSaveImage); // Get the default save thumbnail (as set by SetDefaultImages) for use on saving games t StorageManager.GetDefaultSaveThumbnail(&pbThumbnailData,&dwThumbnailDataSize); // Get the default save image (as set by SetDefaultImages) for use on saving games that - BYTE bTextMetadata[88]; + uint8_t bTextMetadata[88]; ZeroMemory(bTextMetadata,88); int iTextMetadataBytes = app.CreateImageTextData(bTextMetadata, app.getRemoteStorage()->getSaveSeed(), true, app.getRemoteStorage()->getSaveHostOptions(), app.getRemoteStorage()->getSaveTexturePack() ); @@ -2471,7 +2471,7 @@ int UIScene_LoadOrJoinMenu::DownloadSonyCrossSaveThreadProc( LPVOID lpParameter // we can't cancel here, we need the saves info so we can delete the file if(pClass->m_saveTransferDownloadCancelled) { - WCHAR wcTemp[256]; + wchar_t wcTemp[256]; swprintf(wcTemp,256, app.GetString(IDS_CANCEL)); // MGH - should change this string to "cancelling download" m_wstrStageText=wcTemp; pMinecraft->progressRenderer->progressStage( m_wstrStageText ); @@ -2486,7 +2486,7 @@ int UIScene_LoadOrJoinMenu::DownloadSonyCrossSaveThreadProc( LPVOID lpParameter case eSaveTransfer_GettingSavesInfo: if(pClass->m_saveTransferDownloadCancelled) { - WCHAR wcTemp[256]; + wchar_t wcTemp[256]; swprintf(wcTemp,256, app.GetString(IDS_CANCEL)); // MGH - should change this string to "cancelling download" m_wstrStageText=wcTemp; pMinecraft->progressRenderer->progressStage( m_wstrStageText ); @@ -2521,7 +2521,7 @@ int UIScene_LoadOrJoinMenu::DownloadSonyCrossSaveThreadProc( LPVOID lpParameter case eSaveTransfer_GettingFileData: { - WCHAR wcTemp[256]; + wchar_t wcTemp[256]; int dataProgress = app.getRemoteStorage()->getDataProgress(); pMinecraft->progressRenderer->progressStagePercentage(dataProgress); @@ -2595,16 +2595,16 @@ int UIScene_LoadOrJoinMenu::DownloadSonyCrossSaveThreadProc( LPVOID lpParameter StorageManager.ResetSaveData(); { - PBYTE pbThumbnailData=NULL; - DWORD dwThumbnailDataSize=0; + uint8_t* pbThumbnailData=NULL; + unsigned long dwThumbnailDataSize=0; - PBYTE pbDataSaveImage=NULL; - DWORD dwDataSizeSaveImage=0; + uint8_t* pbDataSaveImage=NULL; + unsigned long dwDataSizeSaveImage=0; StorageManager.GetDefaultSaveImage(&pbDataSaveImage, &dwDataSizeSaveImage); // Get the default save thumbnail (as set by SetDefaultImages) for use on saving games t StorageManager.GetDefaultSaveThumbnail(&pbThumbnailData,&dwThumbnailDataSize); // Get the default save image (as set by SetDefaultImages) for use on saving games that - BYTE bTextMetadata[88]; + uint8_t bTextMetadata[88]; ZeroMemory(bTextMetadata,88); int iTextMetadataBytes = app.CreateImageTextData(bTextMetadata, app.getRemoteStorage()->getSaveSeed(), true, app.getRemoteStorage()->getSaveHostOptions(), app.getRemoteStorage()->getSaveTexturePack() ); @@ -2665,7 +2665,7 @@ int UIScene_LoadOrJoinMenu::DownloadSonyCrossSaveThreadProc( LPVOID lpParameter // if we've arrived here, the save has been created successfully pClass->m_iState=e_SavesRepopulate; pClass->updateTooltips(); - UINT uiIDA[1]; + unsigned int uiIDA[1]; uiIDA[0]=IDS_CONFIRM_OK; app.getRemoteStorage()->waitForStorageManagerIdle(); // wait for everything to complete before we hand control back to the player ui.RequestMessageBox( IDS_TOOLTIPS_SAVETRANSFER_DOWNLOAD, IDS_SAVE_TRANSFER_DOWNLOADCOMPLETE, uiIDA,1,ProfileManager.GetPrimaryPad(),CrossSaveFinishedCallback,pClass, app.GetStringTable()); @@ -2684,7 +2684,7 @@ int UIScene_LoadOrJoinMenu::DownloadSonyCrossSaveThreadProc( LPVOID lpParameter { if(pClass->m_saveTransferDownloadCancelled) { - WCHAR wcTemp[256]; + wchar_t wcTemp[256]; swprintf(wcTemp,256, app.GetString(IDS_CANCEL)); // MGH - should change this string to "cancelling download" m_wstrStageText=wcTemp; pMinecraft->progressRenderer->progressStage( m_wstrStageText ); @@ -2741,7 +2741,7 @@ int UIScene_LoadOrJoinMenu::DownloadSonyCrossSaveThreadProc( LPVOID lpParameter } else { - UINT uiIDA[1]; + unsigned int uiIDA[1]; uiIDA[0]=IDS_CONFIRM_OK; ui.RequestMessageBox( IDS_TOOLTIPS_SAVETRANSFER_DOWNLOAD, IDS_SAVE_TRANSFER_DOWNLOADFAILED, uiIDA,1,ProfileManager.GetPrimaryPad(),CrossSaveFinishedCallback,pClass, app.GetStringTable()); pClass->m_eSaveTransferState = eSaveTransfer_Finished; @@ -2767,7 +2767,7 @@ int UIScene_LoadOrJoinMenu::DownloadSonyCrossSaveThreadProc( LPVOID lpParameter } -void UIScene_LoadOrJoinMenu::SaveTransferReturned(LPVOID lpParam, SonyRemoteStorage::Status s, int error_code) +void UIScene_LoadOrJoinMenu::SaveTransferReturned(void* lpParam, SonyRemoteStorage::Status s, int error_code) { UIScene_LoadOrJoinMenu* pClass = (UIScene_LoadOrJoinMenu *) lpParam; @@ -2787,7 +2787,7 @@ ConsoleSaveFile* UIScene_LoadOrJoinMenu::SonyCrossSaveConvert() return NULL; } -void UIScene_LoadOrJoinMenu::CancelSaveTransferCallback(LPVOID lpParam) +void UIScene_LoadOrJoinMenu::CancelSaveTransferCallback(void* lpParam) { UIScene_LoadOrJoinMenu* pClass = (UIScene_LoadOrJoinMenu *) lpParam; pClass->m_saveTransferDownloadCancelled = true; @@ -2804,7 +2804,7 @@ void UIScene_LoadOrJoinMenu::LaunchSaveUpload() { LoadingInputParams *loadingParams = new LoadingInputParams(); loadingParams->func = &UIScene_LoadOrJoinMenu::UploadSonyCrossSaveThreadProc; - loadingParams->lpParam = (LPVOID)this; + loadingParams->lpParam = (void*)this; UIFullscreenProgressCompletionData *completionData = new UIFullscreenProgressCompletionData(); completionData->bShowBackground=true; @@ -2831,7 +2831,7 @@ int UIScene_LoadOrJoinMenu::CrossSaveUploadFinishedCallback(void *pParam,int iPa } -int UIScene_LoadOrJoinMenu::UploadSonyCrossSaveThreadProc( LPVOID lpParameter ) +int UIScene_LoadOrJoinMenu::UploadSonyCrossSaveThreadProc( void* lpParameter ) { UIScene_LoadOrJoinMenu* pClass = (UIScene_LoadOrJoinMenu *) lpParameter; pClass->m_saveTransferUploadCancelled = false; @@ -2865,7 +2865,7 @@ int UIScene_LoadOrJoinMenu::UploadSonyCrossSaveThreadProc( LPVOID lpParameter ) break; case eSaveUpload_UploadingFileData: { - WCHAR wcTemp[256]; + wchar_t wcTemp[256]; int dataProgress = app.getRemoteStorage()->getDataProgress(); pMinecraft->progressRenderer->progressStagePercentage(dataProgress); @@ -2885,7 +2885,7 @@ int UIScene_LoadOrJoinMenu::UploadSonyCrossSaveThreadProc( LPVOID lpParameter ) break; case eSaveUpload_FileDataUploaded: { - UINT uiIDA[1]; + unsigned int uiIDA[1]; uiIDA[0]=IDS_CONFIRM_OK; ui.RequestMessageBox( IDS_TOOLTIPS_SAVETRANSFER_UPLOAD, IDS_SAVE_TRANSFER_UPLOADCOMPLETE, uiIDA,1,ProfileManager.GetPrimaryPad(),CrossSaveUploadFinishedCallback,pClass, app.GetStringTable()); pClass->m_eSaveUploadState = esaveUpload_Finished; @@ -2902,7 +2902,7 @@ int UIScene_LoadOrJoinMenu::UploadSonyCrossSaveThreadProc( LPVOID lpParameter ) } else { - UINT uiIDA[1]; + unsigned int uiIDA[1]; uiIDA[0]=IDS_CONFIRM_OK; ui.RequestMessageBox( IDS_TOOLTIPS_SAVETRANSFER_UPLOAD, IDS_SAVE_TRANSFER_UPLOADFAILED, uiIDA,1,ProfileManager.GetPrimaryPad(),CrossSaveUploadFinishedCallback,pClass, app.GetStringTable()); pClass->m_eSaveUploadState = esaveUpload_Finished; @@ -2920,13 +2920,13 @@ int UIScene_LoadOrJoinMenu::UploadSonyCrossSaveThreadProc( LPVOID lpParameter ) } -void UIScene_LoadOrJoinMenu::SaveUploadReturned(LPVOID lpParam, SonyRemoteStorage::Status s, int error_code) +void UIScene_LoadOrJoinMenu::SaveUploadReturned(void* lpParam, SonyRemoteStorage::Status s, int error_code) { UIScene_LoadOrJoinMenu* pClass = (UIScene_LoadOrJoinMenu *) lpParam; if(pClass->m_saveTransferUploadCancelled) { - UINT uiIDA[1] = { IDS_CONFIRM_OK }; + unsigned int uiIDA[1] = { IDS_CONFIRM_OK }; ui.RequestMessageBox( IDS_CANCEL_UPLOAD_TITLE, IDS_CANCEL_UPLOAD_TEXT, uiIDA, 1, ProfileManager.GetPrimaryPad(), CrossSaveUploadFinishedCallback, pClass, app.GetStringTable() ); pClass->m_eSaveUploadState=esaveUpload_Finished; } @@ -2939,7 +2939,7 @@ void UIScene_LoadOrJoinMenu::SaveUploadReturned(LPVOID lpParam, SonyRemoteStorag } } -void UIScene_LoadOrJoinMenu::CancelSaveUploadCallback(LPVOID lpParam) +void UIScene_LoadOrJoinMenu::CancelSaveUploadCallback(void* lpParam) { UIScene_LoadOrJoinMenu* pClass = (UIScene_LoadOrJoinMenu *) lpParam; pClass->m_saveTransferUploadCancelled = true; @@ -2982,7 +2982,7 @@ void UIScene_LoadOrJoinMenu::LaunchSaveTransfer() LoadingInputParams *loadingParams = new LoadingInputParams(); loadingParams->func = &UIScene_LoadOrJoinMenu::DownloadXbox360SaveThreadProc; - loadingParams->lpParam = (LPVOID)stateContainer; + loadingParams->lpParam = (void*)stateContainer; UIFullscreenProgressCompletionData *completionData = new UIFullscreenProgressCompletionData(); completionData->bShowBackground=true; @@ -3001,7 +3001,7 @@ void UIScene_LoadOrJoinMenu::LaunchSaveTransfer() -int UIScene_LoadOrJoinMenu::DownloadXbox360SaveThreadProc( LPVOID lpParameter ) +int UIScene_LoadOrJoinMenu::DownloadXbox360SaveThreadProc( void* lpParameter ) { Compression::UseDefaultThreadStorage(); @@ -3174,7 +3174,7 @@ int UIScene_LoadOrJoinMenu::DownloadXbox360SaveThreadProc( LPVOID lpParameter ) if(pStateContainer->m_bSaveTransferCancelled) { - WCHAR wcTemp[256]; + wchar_t wcTemp[256]; pStateContainer->m_bSaveTransferCancelled=false; swprintf(wcTemp,app.GetString(IDS_SAVE_TRANSFER_DOWNLOAD_CANCELLED)); @@ -3226,7 +3226,7 @@ void UIScene_LoadOrJoinMenu::RequestFileSize( SaveTransferStateContainer *pClass void UIScene_LoadOrJoinMenu::RequestFileData( SaveTransferStateContainer *pClass, wchar_t *filename ) { Minecraft *pMinecraft=Minecraft::GetInstance(); - WCHAR wcTemp[256]; + wchar_t wcTemp[256]; pMinecraft->progressRenderer->progressStagePercentage(0); @@ -3241,11 +3241,11 @@ void UIScene_LoadOrJoinMenu::RequestFileData( SaveTransferStateContainer *pClass File targetFile( wstring(L"FakeTMSPP\\").append(filename) ); if(targetFile.exists()) { - HANDLE hSaveFile = CreateFile( targetFile.getPath().c_str(), GENERIC_READ, 0, NULL, OPEN_EXISTING, FILE_FLAG_RANDOM_ACCESS, NULL); + void* hSaveFile = CreateFile( targetFile.getPath().c_str(), GENERIC_READ, 0, NULL, OPEN_EXISTING, FILE_FLAG_RANDOM_ACCESS, NULL); - m_debugTransferDetails.pbData = new BYTE[m_debugTransferDetails.ulFileLen]; + m_debugTransferDetails.pbData = new uint8_t[m_debugTransferDetails.ulFileLen]; - DWORD numberOfBytesRead = 0; + unsigned long numberOfBytesRead = 0; ReadFile( hSaveFile,m_debugTransferDetails.pbData,m_debugTransferDetails.ulFileLen,&numberOfBytesRead,NULL); assert(numberOfBytesRead == m_debugTransferDetails.ulFileLen); @@ -3268,7 +3268,7 @@ void UIScene_LoadOrJoinMenu::RequestFileData( SaveTransferStateContainer *pClass } } -int UIScene_LoadOrJoinMenu::SaveTransferReturned(LPVOID lpParam,C4JStorage::SAVETRANSFER_FILE_DETAILS *pSaveTransferDetails) +int UIScene_LoadOrJoinMenu::SaveTransferReturned(void* lpParam,C4JStorage::SAVETRANSFER_FILE_DETAILS *pSaveTransferDetails) { SaveTransferStateContainer* pClass = (SaveTransferStateContainer *) lpParam; app.DebugPrintf("Save Transfer - size is %d\n",pSaveTransferDetails->ulFileLen); @@ -3289,9 +3289,9 @@ int UIScene_LoadOrJoinMenu::SaveTransferReturned(LPVOID lpParam,C4JStorage::SAVE return 0; } -int UIScene_LoadOrJoinMenu::SaveTransferUpdateProgress(LPVOID lpParam,unsigned long ulBytesReceived) +int UIScene_LoadOrJoinMenu::SaveTransferUpdateProgress(void* lpParam,unsigned long ulBytesReceived) { - WCHAR wcTemp[256]; + wchar_t wcTemp[256]; SaveTransferStateContainer* pClass = (SaveTransferStateContainer *) lpParam; Minecraft *pMinecraft=Minecraft::GetInstance(); @@ -3316,7 +3316,7 @@ int UIScene_LoadOrJoinMenu::SaveTransferUpdateProgress(LPVOID lpParam,unsigned l return 0; } -void UIScene_LoadOrJoinMenu::CancelSaveTransferCallback(LPVOID lpParam) +void UIScene_LoadOrJoinMenu::CancelSaveTransferCallback(void* lpParam) { SaveTransferStateContainer* pClass = (SaveTransferStateContainer *) lpParam; @@ -3329,7 +3329,7 @@ void UIScene_LoadOrJoinMenu::CancelSaveTransferCallback(LPVOID lpParam) //pClass->m_bSaveTransferInProgress=false; } -int UIScene_LoadOrJoinMenu::CancelSaveTransferCompleteCallback(LPVOID lpParam) +int UIScene_LoadOrJoinMenu::CancelSaveTransferCompleteCallback(void* lpParam) { SaveTransferStateContainer* pClass = (SaveTransferStateContainer *) lpParam; // change the state to idle to get the download thread to terminate @@ -3377,7 +3377,7 @@ int UIScene_LoadOrJoinMenu::CopySaveDialogReturned(void *pParam,int iPad,C4JStor { LoadingInputParams *loadingParams = new LoadingInputParams(); - void *uniqueId = (LPVOID)pClass->GetCallbackUniqueId(); + void *uniqueId = (void*)pClass->GetCallbackUniqueId(); loadingParams->func = &UIScene_LoadOrJoinMenu::CopySaveThreadProc; loadingParams->lpParam = uniqueId; loadingParams->waitForThreadToDelete = true; @@ -3403,7 +3403,7 @@ int UIScene_LoadOrJoinMenu::CopySaveDialogReturned(void *pParam,int iPad,C4JStor return 0; } -int UIScene_LoadOrJoinMenu::CopySaveThreadProc( LPVOID lpParameter ) +int UIScene_LoadOrJoinMenu::CopySaveThreadProc( void* lpParameter ) { Minecraft *pMinecraft=Minecraft::GetInstance(); pMinecraft->progressRenderer->progressStart(IDS_PROGRESS_COPYING_SAVE); @@ -3444,7 +3444,7 @@ int UIScene_LoadOrJoinMenu::CopySaveThreadProc( LPVOID lpParameter ) return 0; } -int UIScene_LoadOrJoinMenu::CopySaveDataReturned(LPVOID lpParam, bool success, C4JStorage::ESaveGameState stat) +int UIScene_LoadOrJoinMenu::CopySaveDataReturned(void* lpParam, bool success, C4JStorage::ESaveGameState stat) { ui.EnterCallbackIdCriticalSection(); UIScene_LoadOrJoinMenu* pClass = (UIScene_LoadOrJoinMenu*)ui.GetSceneFromCallbackId((size_t)lpParam); @@ -3461,7 +3461,7 @@ int UIScene_LoadOrJoinMenu::CopySaveDataReturned(LPVOID lpParam, bool success, C else { #ifdef __ORBIS__ - UINT uiIDA[1]; + unsigned int uiIDA[1]; // you cancelled the save on exit after choosing exit and save? You go back to the Exit choices then. uiIDA[0]=IDS_OK; @@ -3493,7 +3493,7 @@ int UIScene_LoadOrJoinMenu::CopySaveDataReturned(LPVOID lpParam, bool success, C return 0; } -bool UIScene_LoadOrJoinMenu::CopySaveDataProgress(LPVOID lpParam, int percent) +bool UIScene_LoadOrJoinMenu::CopySaveDataProgress(void* lpParam, int percent) { bool bContinue = false; ui.EnterCallbackIdCriticalSection(); @@ -3509,7 +3509,7 @@ bool UIScene_LoadOrJoinMenu::CopySaveDataProgress(LPVOID lpParam, int percent) return bContinue; } -void UIScene_LoadOrJoinMenu::CancelCopySaveCallback(LPVOID lpParam) +void UIScene_LoadOrJoinMenu::CancelCopySaveCallback(void* lpParam) { ui.EnterCallbackIdCriticalSection(); UIScene_LoadOrJoinMenu* pClass = (UIScene_LoadOrJoinMenu*)ui.GetSceneFromCallbackId((size_t)lpParam); diff --git a/src/client/Common/UI/UIScene_LoadOrJoinMenu.h b/src/client/Common/UI/UIScene_LoadOrJoinMenu.h index 01d94b05..c9b02e1d 100644 --- a/src/client/Common/UI/UIScene_LoadOrJoinMenu.h +++ b/src/client/Common/UI/UIScene_LoadOrJoinMenu.h @@ -124,7 +124,7 @@ public: virtual EUIScene getSceneType() { return eUIScene_LoadOrJoinMenu;} - static void UpdateGamesListCallback(LPVOID pParam); + static void UpdateGamesListCallback(void* pParam); #ifdef _XBOX_ONE void HandleDLCLicenseChange(); #endif @@ -145,14 +145,14 @@ protected: public: - static int LoadSaveDataThumbnailReturned(LPVOID lpParam,PBYTE pbThumbnail,DWORD dwThumbnailBytes); - static int LoadSaveCallback(LPVOID lpParam,bool bRes); + static int LoadSaveDataThumbnailReturned(void* lpParam,uint8_t* pbThumbnail,unsigned long dwThumbnailBytes); + static int LoadSaveCallback(void* lpParam,bool bRes); static int DeleteSaveDialogReturned(void *pParam,int iPad,C4JStorage::EMessageResult result); static int SaveOptionsDialogReturned(void *pParam,int iPad,C4JStorage::EMessageResult result); static int TexturePackDialogReturned(void *pParam,int iPad,C4JStorage::EMessageResult result); - static int DeleteSaveDataReturned(LPVOID lpParam,bool bRes); - static int RenameSaveDataReturned(LPVOID lpParam,bool bRes); - static int KeyboardCompleteWorldNameCallback(LPVOID lpParam,bool bRes); + static int DeleteSaveDataReturned(void* lpParam,bool bRes); + static int RenameSaveDataReturned(void* lpParam,bool bRes); + static int KeyboardCompleteWorldNameCallback(void* lpParam,bool bRes); protected: void handlePress(F64 controlId, F64 childId); void LoadLevelGen(LevelGenerationOptions *levelGen); @@ -172,7 +172,7 @@ private: #if defined(__PS3__) || defined(__PSVITA__) || defined(__ORBIS__) static int MustSignInReturnedPSN(void *pParam,int iPad,C4JStorage::EMessageResult result); static int PSN_SignInReturned(void *pParam,bool bContinue, int iPad); - static void remoteStorageGetSaveCallback(LPVOID lpParam, SonyRemoteStorage::Status s, int error_code); + static void remoteStorageGetSaveCallback(void* lpParam, SonyRemoteStorage::Status s, int error_code); #endif #ifdef __ORBIS__ @@ -205,14 +205,14 @@ private: #endif void LaunchSaveTransfer(); - static int DownloadXbox360SaveThreadProc( LPVOID lpParameter ); + static int DownloadXbox360SaveThreadProc( void* lpParameter ); static void RequestFileSize( SaveTransferStateContainer *pClass, wchar_t *filename ); static void RequestFileData( SaveTransferStateContainer *pClass, wchar_t *filename ); - static int SaveTransferReturned(LPVOID lpParam,C4JStorage::SAVETRANSFER_FILE_DETAILS *pSaveTransferDetails); - static int SaveTransferUpdateProgress(LPVOID lpParam,unsigned long ulBytesReceived); - static void CancelSaveTransferCallback(LPVOID lpParam); + static int SaveTransferReturned(void* lpParam,C4JStorage::SAVETRANSFER_FILE_DETAILS *pSaveTransferDetails); + static int SaveTransferUpdateProgress(void* lpParam,unsigned long ulBytesReceived); + static void CancelSaveTransferCallback(void* lpParam); static int NeedSyncMessageReturned(void *pParam,int iPad,C4JStorage::EMessageResult result); - static int CancelSaveTransferCompleteCallback(LPVOID lpParam); + static int CancelSaveTransferCompleteCallback(void* lpParam); #endif @@ -254,17 +254,17 @@ private: char m_downloadedUniqueFilename[64];//SCE_SAVE_DATA_DIRNAME_DATA_MAXSIZE]; bool m_saveTransferDownloadCancelled; void LaunchSaveTransfer(); - static int CreateDummySaveDataCallback(LPVOID lpParam,bool bRes); - static int CrossSaveGetSavesInfoCallback(LPVOID lpParam, SAVE_DETAILS *pSaveDetails,bool bRes); + static int CreateDummySaveDataCallback(void* lpParam,bool bRes); + static int CrossSaveGetSavesInfoCallback(void* lpParam, SAVE_DETAILS *pSaveDetails,bool bRes); static int LoadCrossSaveDataCallback(void *pParam,bool bIsCorrupt, bool bIsOwner); static int CrossSaveFinishedCallback(void *pParam,int iPad,C4JStorage::EMessageResult result); - static int CrossSaveDeleteOnErrorReturned(LPVOID lpParam,bool bRes); + static int CrossSaveDeleteOnErrorReturned(void* lpParam,bool bRes); static int RemoteSaveNotFoundCallback(void *pParam,int iPad,C4JStorage::EMessageResult result); - static int DownloadSonyCrossSaveThreadProc( LPVOID lpParameter ); - static void SaveTransferReturned(LPVOID lpParam, SonyRemoteStorage::Status s, int error_code); + static int DownloadSonyCrossSaveThreadProc( void* lpParameter ); + static void SaveTransferReturned(void* lpParam, SonyRemoteStorage::Status s, int error_code); static ConsoleSaveFile* SonyCrossSaveConvert(); - static void CancelSaveTransferCallback(LPVOID lpParam); + static void CancelSaveTransferCallback(void* lpParam); #endif #ifdef SONY_REMOTE_STORAGE_UPLOAD @@ -282,19 +282,19 @@ private: bool m_saveTransferUploadCancelled; void LaunchSaveUpload(); - static int UploadSonyCrossSaveThreadProc( LPVOID lpParameter ); - static void SaveUploadReturned(LPVOID lpParam, SonyRemoteStorage::Status s, int error_code); - static void CancelSaveUploadCallback(LPVOID lpParam); + static int UploadSonyCrossSaveThreadProc( void* lpParameter ); + static void SaveUploadReturned(void* lpParam, SonyRemoteStorage::Status s, int error_code); + static void CancelSaveUploadCallback(void* lpParam); static int SaveTransferDialogReturned(void *pParam,int iPad,C4JStorage::EMessageResult result); static int CrossSaveUploadFinishedCallback(void *pParam,int iPad,C4JStorage::EMessageResult result); #endif #if defined _XBOX_ONE || defined __ORBIS__ static int CopySaveDialogReturned(void *pParam,int iPad,C4JStorage::EMessageResult result); - static int CopySaveThreadProc( LPVOID lpParameter ); - static int CopySaveDataReturned( LPVOID lpParameter, bool success, C4JStorage::ESaveGameState state ); - static bool CopySaveDataProgress(LPVOID lpParam, int percent); - static void CancelCopySaveCallback(LPVOID lpParam); + static int CopySaveThreadProc( void* lpParameter ); + static int CopySaveDataReturned( void* lpParameter, bool success, C4JStorage::ESaveGameState state ); + static bool CopySaveDataProgress(void* lpParam, int percent); + static void CancelCopySaveCallback(void* lpParam); static int CopySaveErrorDialogFinishedCallback(void *pParam,int iPad,C4JStorage::EMessageResult result); #endif }; diff --git a/src/client/Common/UI/UIScene_MainMenu.cpp b/src/client/Common/UI/UIScene_MainMenu.cpp index 5c099fc2..919f5e9c 100644 --- a/src/client/Common/UI/UIScene_MainMenu.cpp +++ b/src/client/Common/UI/UIScene_MainMenu.cpp @@ -262,7 +262,7 @@ void UIScene_MainMenu::handleInput(int iPad, int key, bool repeat, bool pressed, case ACTION_MENU_X: if(pressed && ProfileManager.IsFullVersion()) { - UINT uiIDA[2]; + unsigned int uiIDA[2]; uiIDA[0]=IDS__NETWORK_PSN; uiIDA[1]=IDS_NETWORK_ADHOC; ui.RequestMessageBox(IDS_SELECT_NETWORK_MODE_TITLE, IDS_SELECT_NETWORK_MODE_TEXT, uiIDA, 2, XUSER_INDEX_ANY, &UIScene_MainMenu::SelectNetworkModeReturned,this); @@ -281,7 +281,7 @@ void UIScene_MainMenu::handlePress(F64 controlId, F64 childId) { int primaryPad = ProfileManager.GetPrimaryPad(); - int (*signInReturnedFunc) (LPVOID,const bool, const int iPad) = NULL; + int (*signInReturnedFunc) (void*,const bool, const int iPad) = NULL; switch((int)controlId) { @@ -338,7 +338,7 @@ void UIScene_MainMenu::handlePress(F64 controlId, F64 childId) case eControl_Exit: if( ProfileManager.IsFullVersion() ) { - UINT uiIDA[2]; + unsigned int uiIDA[2]; uiIDA[0]=IDS_CANCEL; uiIDA[1]=IDS_OK; ui.RequestMessageBox(IDS_WARNING_ARCADE_TITLE, IDS_WARNING_ARCADE_TEXT, uiIDA, 2, XUSER_INDEX_ANY,&UIScene_MainMenu::ExitGameReturned,this); @@ -384,7 +384,7 @@ void UIScene_MainMenu::handlePress(F64 controlId, F64 childId) else { // Ask user to sign in - UINT uiIDA[2]; + unsigned int uiIDA[2]; uiIDA[0]=IDS_CONFIRM_OK; uiIDA[1]=IDS_CONFIRM_CANCEL; ui.RequestMessageBox(IDS_MUST_SIGN_IN_TITLE, IDS_MUST_SIGN_IN_TEXT, uiIDA, 2, primaryPad, &UIScene_MainMenu::MustSignInReturned, this, app.GetStringTable()); @@ -677,7 +677,7 @@ int UIScene_MainMenu::CreateLoad_SignInReturned(void *pParam, bool bContinue, in // 4J-JEV: We only need to update rich-presence if the sign-in status changes. ProfileManager.SetCurrentGameActivity(iPad, CONTEXT_PRESENCE_MENUS, false); - UINT uiIDA[1] = { IDS_OK }; + unsigned int uiIDA[1] = { IDS_OK }; if(ProfileManager.IsGuest(ProfileManager.GetPrimaryPad())) { @@ -875,7 +875,7 @@ int UIScene_MainMenu::Leaderboards_SignInReturned(void *pParam,bool bContinue,in // 4J-JEV: We only need to update rich-presence if the sign-in status changes. ProfileManager.SetCurrentGameActivity(iPad, CONTEXT_PRESENCE_MENUS, false); - UINT uiIDA[1] = { IDS_OK }; + unsigned int uiIDA[1] = { IDS_OK }; // guests can't look at leaderboards if(ProfileManager.IsGuest(ProfileManager.GetPrimaryPad())) @@ -899,7 +899,7 @@ int UIScene_MainMenu::Leaderboards_SignInReturned(void *pParam,bool bContinue,in pClass->m_bIgnorePress=false; #if !(defined(_XBOX) || defined(_WIN64)) // 4J Stu - Temp to get the win build running, but so we check this for other platforms // you can't see leaderboards - UINT uiIDA[1]; + unsigned int uiIDA[1]; uiIDA[0]=IDS_CONFIRM_OK; ui.RequestMessageBox(IDS_ONLINE_SERVICE_TITLE, IDS_CONTENT_RESTRICTION, uiIDA, 1, ProfileManager.GetPrimaryPad(),NULL,NULL, app.GetStringTable()); #endif @@ -1042,7 +1042,7 @@ void UIScene_MainMenu::RefreshChatAndContentRestrictionsReturned_PlayGame(void * UIScene_MainMenu* pClass = (UIScene_MainMenu*)pParam; - int (*signInReturnedFunc) (LPVOID,const bool, const int iPad) = NULL; + int (*signInReturnedFunc) (void*,const bool, const int iPad) = NULL; // 4J-PB - Check if there is a patch for the game pClass->m_errorCode = ProfileManager.getNPAvailability(ProfileManager.GetPrimaryPad()); @@ -1083,7 +1083,7 @@ void UIScene_MainMenu::RefreshChatAndContentRestrictionsReturned_PlayGame(void * return; } -// UINT uiIDA[1]; +// unsigned int uiIDA[1]; // uiIDA[0]=IDS_OK; // ui.RequestMessageBox(IDS_PATCH_AVAILABLE_TITLE, IDS_PATCH_AVAILABLE_TEXT, uiIDA, 1, XUSER_INDEX_ANY,NULL,pClass); } @@ -1091,7 +1091,7 @@ void UIScene_MainMenu::RefreshChatAndContentRestrictionsReturned_PlayGame(void * // Check if PSN is unavailable because of age restriction if (pClass->m_errorCode == SCE_NP_ERROR_AGE_RESTRICTION) { - UINT uiIDA[1]; + unsigned int uiIDA[1]; uiIDA[0]=IDS_PRO_NOTONLINE_DECLINE; ui.RequestMessageBox(IDS_ONLINE_SERVICE_TITLE, IDS_CONTENT_RESTRICTION, uiIDA, 1, ProfileManager.GetPrimaryPad(), &UIScene_MainMenu::PlayOfflineReturned, pClass, app.GetStringTable()); @@ -1117,7 +1117,7 @@ void UIScene_MainMenu::RefreshChatAndContentRestrictionsReturned_PlayGame(void * else { // Ask user to sign in - UINT uiIDA[2]; + unsigned int uiIDA[2]; uiIDA[0]=IDS_CONFIRM_OK; uiIDA[1]=IDS_CONFIRM_CANCEL; ui.RequestMessageBox(IDS_MUST_SIGN_IN_TITLE, IDS_MUST_SIGN_IN_TEXT, uiIDA, 2, primaryPad, &UIScene_MainMenu::MustSignInReturned, pClass, app.GetStringTable()); @@ -1131,7 +1131,7 @@ void UIScene_MainMenu::RefreshChatAndContentRestrictionsReturned_Leaderboards(vo UIScene_MainMenu* pClass = (UIScene_MainMenu*)pParam; - int (*signInReturnedFunc) (LPVOID,const bool, const int iPad) = NULL; + int (*signInReturnedFunc) (void*,const bool, const int iPad) = NULL; // 4J-PB - Check if there is a patch for the game pClass->m_errorCode = ProfileManager.getNPAvailability(ProfileManager.GetPrimaryPad()); @@ -1170,7 +1170,7 @@ void UIScene_MainMenu::RefreshChatAndContentRestrictionsReturned_Leaderboards(vo } } -// UINT uiIDA[1]; +// unsigned int uiIDA[1]; // uiIDA[0]=IDS_OK; // ui.RequestMessageBox(IDS_PATCH_AVAILABLE_TITLE, IDS_PATCH_AVAILABLE_TEXT, uiIDA, 1, XUSER_INDEX_ANY,NULL,pClass); } @@ -1183,7 +1183,7 @@ void UIScene_MainMenu::RefreshChatAndContentRestrictionsReturned_Leaderboards(vo // Check if PSN is unavailable because of age restriction if (pClass->m_errorCode == SCE_NP_ERROR_AGE_RESTRICTION) { - UINT uiIDA[1]; + unsigned int uiIDA[1]; uiIDA[0] = IDS_CONFIRM_OK; ui.RequestMessageBox(IDS_ONLINE_SERVICE_TITLE, IDS_CONTENT_RESTRICTION, uiIDA, 1, ProfileManager.GetPrimaryPad(), nullptr, pClass, app.GetStringTable()); @@ -1207,7 +1207,7 @@ void UIScene_MainMenu::RefreshChatAndContentRestrictionsReturned_Leaderboards(vo else { // Ask user to sign in - UINT uiIDA[2]; + unsigned int uiIDA[2]; uiIDA[0]=IDS_CONFIRM_OK; uiIDA[1]=IDS_CONFIRM_CANCEL; ui.RequestMessageBox(IDS_MUST_SIGN_IN_TITLE, IDS_MUST_SIGN_IN_TEXT, uiIDA, 2, primaryPad, &UIScene_MainMenu::MustSignInReturned, pClass, app.GetStringTable()); @@ -1250,7 +1250,7 @@ void UIScene_MainMenu::RunPlayGame(int iPad) if(ProfileManager.IsGuest(iPad)) { - UINT uiIDA[1]; + unsigned int uiIDA[1]; uiIDA[0]=IDS_OK; m_bIgnorePress=false; @@ -1296,7 +1296,7 @@ void UIScene_MainMenu::RunPlayGame(int iPad) m_eAction=eAction_RunGamePSN; // get them to sign in to online - UINT uiIDA[2]; + unsigned int uiIDA[2]; uiIDA[0]=IDS_PRO_NOTONLINE_ACCEPT; uiIDA[1]=IDS_PRO_NOTONLINE_DECLINE; @@ -1316,7 +1316,7 @@ void UIScene_MainMenu::RunPlayGame(int iPad) m_eAction=eAction_RunGame; // Signed in to PSN but not connected (no internet access) - UINT uiIDA[1]; + unsigned int uiIDA[1]; uiIDA[0] = IDS_PRO_NOTONLINE_DECLINE; ui.RequestMessageBox( IDS_ERROR_NETWORK_TITLE, IDS_ERROR_NETWORK, uiIDA, 1, iPad, UIScene_MainMenu::PlayOfflineReturned, this, app.GetStringTable()); } @@ -1344,7 +1344,7 @@ void UIScene_MainMenu::RunPlayGame(int iPad) // Signed in to PSN but not connected (no internet access) assert(!ProfileManager.isConnectedToPSN(iPad)); - UINT uiIDA[1]; + unsigned int uiIDA[1]; uiIDA[0] = IDS_PRO_NOTONLINE_DECLINE; ui.RequestMessageBox( IDS_ERROR_NETWORK_TITLE, IDS_ERROR_NETWORK, uiIDA, 1, iPad, UIScene_MainMenu::PlayOfflineReturned, this, app.GetStringTable()); } @@ -1352,7 +1352,7 @@ void UIScene_MainMenu::RunPlayGame(int iPad) { m_eAction=eAction_RunGamePSN; // Not signed in to PSN - UINT uiIDA[2]; + unsigned int uiIDA[2]; uiIDA[0] = IDS_PRO_NOTONLINE_ACCEPT; uiIDA[1] = IDS_PRO_NOTONLINE_DECLINE; ui.RequestMessageBox( IDS_PRO_NOTONLINE_TITLE, IDS_PRO_NOTONLINE_TEXT, uiIDA, 2, iPad, &UIScene_MainMenu::MustSignInReturnedPSN, this, app.GetStringTable(), NULL, 0, false); @@ -1473,7 +1473,7 @@ void UIScene_MainMenu::RunPlayGame(int iPad) void UIScene_MainMenu::RunLeaderboards(int iPad) { - UINT uiIDA[1]; + unsigned int uiIDA[1]; uiIDA[0]=IDS_OK; // guests can't look at leaderboards @@ -1486,7 +1486,7 @@ void UIScene_MainMenu::RunLeaderboards(int iPad) #if defined __PS3__ || defined __PSVITA__ m_eAction=eAction_RunLeaderboardsPSN; // get them to sign in to online - UINT uiIDA[1]; + unsigned int uiIDA[1]; uiIDA[0]=IDS_PRO_NOTONLINE_ACCEPT; ui.RequestMessageBox(IDS_PRO_NOTONLINE_TITLE, IDS_PRO_NOTONLINE_TEXT, uiIDA, 1, ProfileManager.GetPrimaryPad(),&UIScene_MainMenu::MustSignInReturnedPSN,this, app.GetStringTable()); @@ -1497,14 +1497,14 @@ void UIScene_MainMenu::RunLeaderboards(int iPad) if (ProfileManager.IsSignedInPSN(iPad)) { // Signed in to PSN but not connected (no internet access) - UINT uiIDA[1]; + unsigned int uiIDA[1]; uiIDA[0] = IDS_PRO_NOTONLINE_ACCEPT; ui.RequestMessageBox(IDS_PRO_CURRENTLY_NOT_ONLINE_TITLE, IDS_PRO_PSNOFFLINE_TEXT, uiIDA, 1, ProfileManager.GetPrimaryPad(), &UIScene_MainMenu::MustSignInReturnedPSN, this, app.GetStringTable()); } else { // Not signed in to PSN - UINT uiIDA[1]; + unsigned int uiIDA[1]; uiIDA[0] = IDS_PRO_NOTONLINE_ACCEPT; ui.RequestMessageBox(IDS_PRO_NOTONLINE_TITLE, IDS_PRO_NOTONLINE_TEXT, uiIDA, 1, ProfileManager.GetPrimaryPad(), &UIScene_MainMenu::MustSignInReturnedPSN, this, app.GetStringTable()); return; @@ -1517,14 +1517,14 @@ void UIScene_MainMenu::RunLeaderboards(int iPad) // Signed in to PSN but not connected (no internet access) assert(!ProfileManager.isConnectedToPSN(iPad)); - UINT uiIDA[1]; + unsigned int uiIDA[1]; uiIDA[0] = IDS_OK; ui.RequestMessageBox( IDS_ERROR_NETWORK_TITLE, IDS_ERROR_NETWORK, uiIDA, 1, iPad, NULL, NULL, app.GetStringTable()); } else { // Not signed in to PSN - UINT uiIDA[1]; + unsigned int uiIDA[1]; uiIDA[0] = IDS_PRO_NOTONLINE_ACCEPT; ui.RequestMessageBox(IDS_PRO_NOTONLINE_TITLE, IDS_PRO_NOTONLINE_TEXT, uiIDA, 1, ProfileManager.GetPrimaryPad(), &UIScene_MainMenu::MustSignInReturnedPSN, this, app.GetStringTable()); return; @@ -1550,7 +1550,7 @@ void UIScene_MainMenu::RunLeaderboards(int iPad) { #if !(defined(_XBOX) || defined(_WIN64)) // 4J Stu - Temp to get the win build running, but so we check this for other platforms // you can't see leaderboards - UINT uiIDA[1]; + unsigned int uiIDA[1]; uiIDA[0]=IDS_CONFIRM_OK; ui.RequestMessageBox(IDS_ONLINE_SERVICE_TITLE, IDS_CONTENT_RESTRICTION, uiIDA, 1, ProfileManager.GetPrimaryPad(),NULL,this, app.GetStringTable()); #endif @@ -1570,7 +1570,7 @@ void UIScene_MainMenu::RunLeaderboards(int iPad) } void UIScene_MainMenu::RunUnlockOrDLC(int iPad) { - UINT uiIDA[1]; + unsigned int uiIDA[1]; uiIDA[0]=IDS_OK; // Check if this means downloadable content @@ -1611,7 +1611,7 @@ void UIScene_MainMenu::RunUnlockOrDLC(int iPad) } } -// UINT uiIDA[1]; +// unsigned int uiIDA[1]; // uiIDA[0]=IDS_OK; // ui.RequestMessageBox(IDS_PATCH_AVAILABLE_TITLE, IDS_PATCH_AVAILABLE_TEXT, uiIDA, 1, XUSER_INDEX_ANY,NULL,this); return; @@ -1621,7 +1621,7 @@ void UIScene_MainMenu::RunUnlockOrDLC(int iPad) if (m_errorCode == SCE_NP_ERROR_AGE_RESTRICTION) { m_bIgnorePress=false; - UINT uiIDA[1]; + unsigned int uiIDA[1]; uiIDA[0] = IDS_OK; ui.RequestMessageBox(IDS_ONLINE_SERVICE_TITLE, IDS_CONTENT_RESTRICTION, uiIDA, 1, ProfileManager.GetPrimaryPad(), nullptr, this, app.GetStringTable()); @@ -1655,7 +1655,7 @@ void UIScene_MainMenu::RunUnlockOrDLC(int iPad) m_bIgnorePress=false; #if !(defined(_XBOX) || defined(_WIN64)) // 4J Stu - Temp to get the win build running, but so we check this for other platforms // you can't see the store - UINT uiIDA[1]; + unsigned int uiIDA[1]; uiIDA[0]=IDS_CONFIRM_OK; ui.RequestMessageBox(IDS_ONLINE_SERVICE_TITLE, IDS_CONTENT_RESTRICTION, uiIDA, 1, ProfileManager.GetPrimaryPad(),NULL,this, app.GetStringTable()); #endif @@ -1704,7 +1704,7 @@ void UIScene_MainMenu::RunUnlockOrDLC(int iPad) #if defined(__PS3__) || defined(__PSVITA__) m_eAction=eAction_RunUnlockOrDLCPSN; // get them to sign in to online - UINT uiIDA[1]; + unsigned int uiIDA[1]; uiIDA[0]=IDS_PRO_NOTONLINE_ACCEPT; //uiIDA[1]=IDS_PRO_NOTONLINE_DECLINE; ui.RequestMessageBox(IDS_PRO_NOTONLINE_TITLE, IDS_PRO_NOTONLINE_TEXT, uiIDA, 1, ProfileManager.GetPrimaryPad(),&UIScene_MainMenu::MustSignInReturnedPSN,this, app.GetStringTable()); @@ -1717,20 +1717,20 @@ void UIScene_MainMenu::RunUnlockOrDLC(int iPad) // Signed in to PSN but not connected (no internet access) assert(!ProfileManager.isConnectedToPSN(iPad)); - UINT uiIDA[1]; + unsigned int uiIDA[1]; uiIDA[0] = IDS_OK; ui.RequestMessageBox( IDS_ERROR_NETWORK_TITLE, IDS_ERROR_NETWORK, uiIDA, 1, iPad, NULL, NULL, app.GetStringTable()); } else { // Not signed in to PSN - UINT uiIDA[1]; + unsigned int uiIDA[1]; uiIDA[0] = IDS_PRO_NOTONLINE_ACCEPT; ui.RequestMessageBox(IDS_PRO_NOTONLINE_TITLE, IDS_PRO_NOTONLINE_TEXT, uiIDA, 1, ProfileManager.GetPrimaryPad(), &UIScene_MainMenu::MustSignInReturnedPSN, this, app.GetStringTable()); return; } #else - UINT uiIDA[1]; + unsigned int uiIDA[1]; uiIDA[0]=IDS_OK; ui.RequestMessageBox(IDS_PRO_NOTONLINE_TITLE, IDS_PRO_XBOXLIVE_NOTIFICATION, uiIDA, 1); #endif @@ -1749,7 +1749,7 @@ void UIScene_MainMenu::RunUnlockOrDLC(int iPad) #if defined(__PS3__) || defined(__PSVITA__) m_eAction=eAction_RunUnlockOrDLCPSN; // get them to sign in to online - UINT uiIDA[1]; + unsigned int uiIDA[1]; uiIDA[0] = IDS_PRO_NOTONLINE_ACCEPT; ui.RequestMessageBox(IDS_PRO_NOTONLINE_TITLE, IDS_PRO_NOTONLINE_TEXT, uiIDA, 1, ProfileManager.GetPrimaryPad(),&UIScene_MainMenu::MustSignInReturnedPSN,this, app.GetStringTable()); #elif defined __ORBIS__ @@ -1761,20 +1761,20 @@ void UIScene_MainMenu::RunUnlockOrDLC(int iPad) // Signed in to PSN but not connected (no internet access) assert(!ProfileManager.isConnectedToPSN(iPad)); - UINT uiIDA[1]; + unsigned int uiIDA[1]; uiIDA[0] = IDS_OK; ui.RequestMessageBox( IDS_ERROR_NETWORK_TITLE, IDS_ERROR_NETWORK, uiIDA, 1, iPad, NULL, NULL, app.GetStringTable()); } else { // Not signed in to PSN - UINT uiIDA[1]; + unsigned int uiIDA[1]; uiIDA[0] = IDS_PRO_NOTONLINE_ACCEPT; ui.RequestMessageBox(IDS_PRO_NOTONLINE_TITLE, IDS_PRO_NOTONLINE_TEXT, uiIDA, 1, ProfileManager.GetPrimaryPad(), &UIScene_MainMenu::MustSignInReturnedPSN, this, app.GetStringTable()); return; } #else - UINT uiIDA[1]; + unsigned int uiIDA[1]; uiIDA[0]=IDS_OK; ui.RequestMessageBox(IDS_PRO_NOTONLINE_TITLE, IDS_PRO_XBOXLIVE_NOTIFICATION, uiIDA, 1); #endif @@ -1818,7 +1818,7 @@ void UIScene_MainMenu::tick() ProfileManager.GetChatAndContentRestrictions(ProfileManager.GetPrimaryPad(),true,NULL,&bContentRestricted,NULL); if(bContentRestricted) { - UINT uiIDA[1]; + unsigned int uiIDA[1]; uiIDA[0]=IDS_CONFIRM_OK; ui.RequestMessageBox(IDS_ONLINE_SERVICE_TITLE, IDS_CONTENT_RESTRICTION, uiIDA, 1, ProfileManager.GetPrimaryPad(),NULL,this, app.GetStringTable()); } @@ -1854,7 +1854,7 @@ void UIScene_MainMenu::tick() if(g_NetworkManager.ShouldMessageForFullSession()) { - UINT uiIDA[1]; + unsigned int uiIDA[1]; uiIDA[0]=IDS_CONFIRM_OK; ui.RequestMessageBox( IDS_CONNECTION_FAILED, IDS_IN_PARTY_SESSION_FULL, uiIDA,1,ProfileManager.GetPrimaryPad(),NULL,NULL, app.GetStringTable()); } @@ -1877,7 +1877,7 @@ void UIScene_MainMenu::tick() m_eAction = eAction_RunGame; // give the option of continuing offline - UINT uiIDA[1]; + unsigned int uiIDA[1]; uiIDA[0]=IDS_PRO_NOTONLINE_DECLINE; ui.RequestMessageBox(IDS_ONLINE_SERVICE_TITLE, IDS_CONTENT_RESTRICTION_PATCH_AVAILABLE, uiIDA, 1, ProfileManager.GetPrimaryPad(), &UIScene_MainMenu::PlayOfflineReturned, this, app.GetStringTable()); @@ -1898,7 +1898,7 @@ void UIScene_MainMenu::tick() void UIScene_MainMenu::RunAchievements(int iPad) { #if TO_BE_IMPLEMENTED - UINT uiIDA[1]; + unsigned int uiIDA[1]; uiIDA[0]=IDS_OK; // guests can't look at achievements @@ -1917,7 +1917,7 @@ void UIScene_MainMenu::RunHelpAndOptions(int iPad) { if(ProfileManager.IsGuest(iPad)) { - UINT uiIDA[1]; + unsigned int uiIDA[1]; uiIDA[0]=IDS_OK; ui.RequestMessageBox(IDS_PRO_GUESTPROFILE_TITLE, IDS_PRO_GUESTPROFILE_TEXT, uiIDA, 1); } @@ -1999,7 +1999,7 @@ void UIScene_MainMenu::LoadTrial(void) LoadingInputParams *loadingParams = new LoadingInputParams(); loadingParams->func = &CGameNetworkManager::RunNetworkGameThreadProc; - loadingParams->lpParam = (LPVOID)param; + loadingParams->lpParam = (void*)param; UIFullscreenProgressCompletionData *completionData = new UIFullscreenProgressCompletionData(); completionData->bShowBackground=true; diff --git a/src/client/Common/UI/UIScene_MessageBox.h b/src/client/Common/UI/UIScene_MessageBox.h index 3c349dea..d712b5d7 100644 --- a/src/client/Common/UI/UIScene_MessageBox.h +++ b/src/client/Common/UI/UIScene_MessageBox.h @@ -15,8 +15,8 @@ private: eControl_COUNT }; - int( *m_Func)(LPVOID,int,const C4JStorage::EMessageResult); - LPVOID m_lpParam; + int( *m_Func)(void*,int,const C4JStorage::EMessageResult); + void* m_lpParam; int m_buttonCount; UIControl_Button m_buttonButtons[eControl_COUNT]; diff --git a/src/client/Common/UI/UIScene_PauseMenu.cpp b/src/client/Common/UI/UIScene_PauseMenu.cpp index d250f791..35249594 100644 --- a/src/client/Common/UI/UIScene_PauseMenu.cpp +++ b/src/client/Common/UI/UIScene_PauseMenu.cpp @@ -426,7 +426,7 @@ void UIScene_PauseMenu::handleInput(int iPad, int key, bool repeat, bool pressed if (npAvailability == SCE_NP_ERROR_AGE_RESTRICTION) { // 4J Stu - This is a bit messy and is due to the library incorrectly returning false for IsSignedInLive is the npAvailability isn't SCE_OK - UINT uiIDA[1]; + unsigned int uiIDA[1]; uiIDA[0]=IDS_OK; ui.RequestMessageBox(IDS_ONLINE_SERVICE_TITLE, IDS_CONTENT_RESTRICTION, uiIDA, 1, iPad, NULL, NULL, app.GetStringTable()); } @@ -437,20 +437,20 @@ void UIScene_PauseMenu::handleInput(int iPad, int key, bool repeat, bool pressed // Signed in to PSN but not connected (no internet access) assert(!ProfileManager.isConnectedToPSN(iPad)); - UINT uiIDA[1]; + unsigned int uiIDA[1]; uiIDA[0] = IDS_OK; ui.RequestMessageBox( IDS_ERROR_NETWORK_TITLE, IDS_ERROR_NETWORK, uiIDA, 1, iPad, NULL, NULL, app.GetStringTable()); } else { // Not signed in to PSN - UINT uiIDA[1]; + unsigned int uiIDA[1]; uiIDA[0] = IDS_PRO_NOTONLINE_ACCEPT; ui.RequestMessageBox( IDS_PRO_NOTONLINE_TITLE, IDS_PRO_NOTONLINE_TEXT, uiIDA, 1, iPad, &UIScene_PauseMenu::MustSignInReturnedPSN, this, app.GetStringTable(), NULL, 0, false); } #else // __PS3__ // get them to sign in to online - UINT uiIDA[1]; + unsigned int uiIDA[1]; uiIDA[0]=IDS_PRO_NOTONLINE_ACCEPT; ui.RequestMessageBox(IDS_PRO_NOTONLINE_TITLE, IDS_PRO_NOTONLINE_TEXT, uiIDA, 1, iPad, &UIScene_PauseMenu::MustSignInReturnedPSN, this, app.GetStringTable(), NULL, 0, false); #endif @@ -490,7 +490,7 @@ void UIScene_PauseMenu::handleInput(int iPad, int key, bool repeat, bool pressed case ACTION_MENU_RIGHT_SCROLL: if( bDisplayBanTip ) { - UINT uiIDA[2]; + unsigned int uiIDA[2]; uiIDA[0]=IDS_CONFIRM_CANCEL; uiIDA[1]=IDS_CONFIRM_OK; ui.RequestMessageBox(IDS_ACTION_BAN_LEVEL_TITLE, IDS_ACTION_BAN_LEVEL_DESCRIPTION, uiIDA, 2, iPad,&UIScene_PauseMenu::BanGameDialogReturned,this, app.GetStringTable(), NULL, 0, false); @@ -517,7 +517,7 @@ void UIScene_PauseMenu::handlePress(F64 controlId, F64 childId) break; case BUTTON_PAUSE_LEADERBOARDS: { - UINT uiIDA[1]; + unsigned int uiIDA[1]; uiIDA[0]=IDS_OK; //4J Gordon: Being used for the leaderboards proper now @@ -539,7 +539,7 @@ void UIScene_PauseMenu::handlePress(F64 controlId, F64 childId) // Check if PSN is unavailable because of age restriction if (errorCode == SCE_NP_ERROR_AGE_RESTRICTION) { - UINT uiIDA[1]; + unsigned int uiIDA[1]; uiIDA[0] = IDS_CONFIRM_OK; ui.RequestMessageBox(IDS_ONLINE_SERVICE_TITLE, IDS_CONTENT_RESTRICTION, uiIDA, 1, m_iPad, NULL, NULL, app.GetStringTable()); @@ -551,7 +551,7 @@ void UIScene_PauseMenu::handlePress(F64 controlId, F64 childId) #if defined __PS3__ || __PSVITA__ // get them to sign in to online m_eAction=eAction_ViewLeaderboardsPSN; - UINT uiIDA[1]; + unsigned int uiIDA[1]; uiIDA[0]=IDS_PRO_NOTONLINE_ACCEPT; ui.RequestMessageBox(IDS_PRO_NOTONLINE_TITLE, IDS_PRO_XBOXLIVE_NOTIFICATION, uiIDA, 1, ProfileManager.GetPrimaryPad(),&UIScene_PauseMenu::MustSignInReturnedPSN,this, app.GetStringTable(), NULL, 0, false); #elif defined(__ORBIS__) @@ -560,7 +560,7 @@ void UIScene_PauseMenu::handlePress(F64 controlId, F64 childId) if (npAvailability == SCE_NP_ERROR_AGE_RESTRICTION) { // 4J Stu - This is a bit messy and is due to the library incorrectly returning false for IsSignedInLive is the npAvailability isn't SCE_OK - UINT uiIDA[1]; + unsigned int uiIDA[1]; uiIDA[0]=IDS_OK; ui.RequestMessageBox(IDS_ONLINE_SERVICE_TITLE, IDS_CONTENT_RESTRICTION, uiIDA, 1, m_iPad, NULL, NULL, app.GetStringTable()); } @@ -573,19 +573,19 @@ void UIScene_PauseMenu::handlePress(F64 controlId, F64 childId) // Id assert(!ProfileManager.isConnectedToPSN(m_iPad)); - UINT uiIDA[1]; + unsigned int uiIDA[1]; uiIDA[0] = IDS_OK; ui.RequestMessageBox( IDS_ERROR_NETWORK_TITLE, IDS_ERROR_NETWORK, uiIDA, 1, m_iPad, NULL, NULL, app.GetStringTable()); } else { // Not signed in to PSN - UINT uiIDA[1]; + unsigned int uiIDA[1]; uiIDA[0] = IDS_PRO_NOTONLINE_ACCEPT; ui.RequestMessageBox( IDS_PRO_NOTONLINE_TITLE, IDS_PRO_NOTONLINE_TEXT, uiIDA, 1, m_iPad, &UIScene_PauseMenu::MustSignInReturnedPSN, this, app.GetStringTable(), NULL, 0, false); } #else - UINT uiIDA[1] = { IDS_OK }; + unsigned int uiIDA[1] = { IDS_OK }; ui.RequestMessageBox(IDS_PRO_NOTONLINE_TITLE, IDS_PRO_XBOXLIVE_NOTIFICATION, uiIDA, 1, m_iPad); #endif } @@ -599,7 +599,7 @@ void UIScene_PauseMenu::handlePress(F64 controlId, F64 childId) { #if !(defined(_XBOX) || defined(_WIN64)) // 4J Stu - Temp to get the win build running, but so we check this for other platforms // you can't see leaderboards - UINT uiIDA[1]; + unsigned int uiIDA[1]; uiIDA[0]=IDS_CONFIRM_OK; ui.RequestMessageBox(IDS_ONLINE_SERVICE_TITLE, IDS_CONTENT_RESTRICTION, uiIDA, 1, m_iPad,NULL,this, app.GetStringTable(), NULL, 0, false); #endif @@ -625,7 +625,7 @@ void UIScene_PauseMenu::handlePress(F64 controlId, F64 childId) // guests can't look at achievements if(ProfileManager.IsGuest(pNotifyPressData->UserIndex)) { - UINT uiIDA[1]; + unsigned int uiIDA[1]; uiIDA[0]=IDS_OK; ui.RequestMessageBox(IDS_PRO_GUESTPROFILE_TITLE, IDS_PRO_GUESTPROFILE_TEXT, uiIDA, 1, ProfileManager.GetPrimaryPad(),NULL,NULL, app.GetStringTable(), NULL, 0, false); } @@ -648,7 +648,7 @@ void UIScene_PauseMenu::handlePress(F64 controlId, F64 childId) // Check if it's the trial version if(ProfileManager.IsFullVersion()) { - UINT uiIDA[3]; + unsigned int uiIDA[3]; // is it the primary player exiting? if(m_iPad==ProfileManager.GetPrimaryPad()) @@ -750,7 +750,7 @@ void UIScene_PauseMenu::handlePress(F64 controlId, F64 childId) ui.ReduceTrialTimerValue(); // exit the level - UINT uiIDA[2]; + unsigned int uiIDA[2]; uiIDA[0]=IDS_CONFIRM_CANCEL; uiIDA[1]=IDS_CONFIRM_OK; ui.RequestMessageBox(IDS_EXIT_GAME, IDS_CONFIRM_EXIT_GAME_PROGRESS_LOST, uiIDA, 2, m_iPad,&IUIScene_PauseMenu::ExitGameDialogReturned, dynamic_cast(this), app.GetStringTable(), NULL, 0, false); @@ -790,7 +790,7 @@ void UIScene_PauseMenu::PerformActionSaveGame() { #if defined(__PS3__) m_eAction=eAction_SaveGamePSN; - UINT uiIDA[2]; + unsigned int uiIDA[2]; uiIDA[0]=IDS_PRO_NOTONLINE_ACCEPT; uiIDA[1]=IDS_PRO_NOTONLINE_DECLINE; ui.RequestMessageBox(IDS_PRO_NOTONLINE_TITLE, IDS_PRO_XBOXLIVE_NOTIFICATION, uiIDA, 2, ProfileManager.GetPrimaryPad(),&UIScene_PauseMenu::MustSignInReturnedPSN,this, app.GetStringTable(), NULL, 0, false); @@ -800,7 +800,7 @@ void UIScene_PauseMenu::PerformActionSaveGame() if (npAvailability == SCE_NP_ERROR_AGE_RESTRICTION) { // 4J Stu - This is a bit messy and is due to the library incorrectly returning false for IsSignedInLive is the npAvailability isn't SCE_OK - UINT uiIDA[1]; + unsigned int uiIDA[1]; uiIDA[0]=IDS_OK; ui.RequestMessageBox(IDS_ONLINE_SERVICE_TITLE, IDS_CONTENT_RESTRICTION, uiIDA, 1, m_iPad, NULL, NULL, app.GetStringTable()); } @@ -811,14 +811,14 @@ void UIScene_PauseMenu::PerformActionSaveGame() // Signed in to PSN but not connected (no internet access) assert(!ProfileManager.isConnectedToPSN(m_iPad)); - UINT uiIDA[1]; + unsigned int uiIDA[1]; uiIDA[0] = IDS_OK; ui.RequestMessageBox( IDS_ERROR_NETWORK_TITLE, IDS_ERROR_NETWORK, uiIDA, 1, m_iPad, NULL, NULL, app.GetStringTable()); } else { // Not signed in to PSN - UINT uiIDA[1]; + unsigned int uiIDA[1]; uiIDA[0] = IDS_PRO_NOTONLINE_ACCEPT; ui.RequestMessageBox( IDS_PRO_NOTONLINE_TITLE, IDS_PRO_NOTONLINE_TEXT, uiIDA, 1, m_iPad, &UIScene_PauseMenu::MustSignInReturnedPSN, this, app.GetStringTable(), NULL, 0, false); } @@ -826,7 +826,7 @@ void UIScene_PauseMenu::PerformActionSaveGame() } else { - UINT uiIDA[2]; + unsigned int uiIDA[2]; uiIDA[0]=IDS_CONFIRM_OK; uiIDA[1]=IDS_CONFIRM_CANCEL; ui.RequestMessageBox(IDS_UNLOCK_TITLE, IDS_UNLOCK_TOSAVE_TEXT, uiIDA, 2,m_iPad,&UIScene_PauseMenu::UnlockFullSaveReturned,this,app.GetStringTable(), NULL, 0, false); @@ -847,7 +847,7 @@ void UIScene_PauseMenu::PerformActionSaveGame() { // upsell #ifdef _XBOX - ULONGLONG ullOfferID_Full; + uint64_t ullOfferID_Full; // get the dlc texture pack DLCTexturePack *pDLCTexPack=(DLCTexturePack *)tPack; @@ -856,7 +856,7 @@ void UIScene_PauseMenu::PerformActionSaveGame() // tell sentient about the upsell of the full version of the texture pack TelemetryManager->RecordUpsellPresented(m_iPad, eSet_UpsellID_Texture_DLC, ullOfferID_Full & 0xFFFFFFFF); #endif - UINT uiIDA[2]; + unsigned int uiIDA[2]; uiIDA[0]=IDS_CONFIRM_OK; uiIDA[1]=IDS_CONFIRM_CANCEL; @@ -884,7 +884,7 @@ void UIScene_PauseMenu::PerformActionSaveGame() if(result == C4JStorage::ELoadGame_DeviceRemoved) { // this will be a tester trying to be clever - UINT uiIDA[2]; + unsigned int uiIDA[2]; uiIDA[0]=IDS_SELECTANEWDEVICE; uiIDA[1]=IDS_NODEVICE_DECLINE; @@ -896,7 +896,7 @@ void UIScene_PauseMenu::PerformActionSaveGame() #if defined(_XBOX_ONE) || defined(__ORBIS__) if(!m_savesDisabled) { - UINT uiIDA[2]; + unsigned int uiIDA[2]; uiIDA[0]=IDS_CANCEL; uiIDA[1]=IDS_CONFIRM_OK; ui.RequestMessageBox(IDS_TITLE_DISABLE_AUTOSAVE, IDS_CONFIRM_DISABLE_AUTOSAVE, uiIDA, 2, m_iPad,&IUIScene_PauseMenu::DisableAutosaveDialogReturned,this, app.GetStringTable(), NULL, 0, false); @@ -906,7 +906,7 @@ void UIScene_PauseMenu::PerformActionSaveGame() // we need to ask if they are sure they want to overwrite the existing game if(bSaveExists) { - UINT uiIDA[2]; + unsigned int uiIDA[2]; uiIDA[0]=IDS_CONFIRM_CANCEL; uiIDA[1]=IDS_CONFIRM_OK; ui.RequestMessageBox(IDS_TITLE_SAVE_GAME, IDS_CONFIRM_SAVE_GAME, uiIDA, 2, m_iPad,&IUIScene_PauseMenu::SaveGameDialogReturned,this, app.GetStringTable(), NULL, 0, false); @@ -914,7 +914,7 @@ void UIScene_PauseMenu::PerformActionSaveGame() else { #if defined(_XBOX_ONE) || defined(__ORBIS__) - UINT uiIDA[2]; + unsigned int uiIDA[2]; uiIDA[0]=IDS_CONFIRM_CANCEL; uiIDA[1]=IDS_CONFIRM_OK; ui.RequestMessageBox(IDS_TITLE_ENABLE_AUTOSAVE, IDS_CONFIRM_ENABLE_AUTOSAVE, uiIDA, 2, m_iPad,&IUIScene_PauseMenu::EnableAutosaveDialogReturned,this, app.GetStringTable(), NULL, 0, false); @@ -983,7 +983,7 @@ int UIScene_PauseMenu::UnlockFullSaveReturned(void *pParam,int iPad,C4JStorage:: ProfileManager.GetChatAndContentRestrictions(ProfileManager.GetPrimaryPad(),true,NULL,&bContentRestricted,NULL); if(bContentRestricted) { - UINT uiIDA[1]; + unsigned int uiIDA[1]; uiIDA[0]=IDS_CONFIRM_OK; ui.RequestMessageBox(IDS_ONLINE_SERVICE_TITLE, IDS_CONTENT_RESTRICTION, uiIDA, 1, ProfileManager.GetPrimaryPad(),NULL,pClass, app.GetStringTable(), NULL, 0, false); } @@ -1099,7 +1099,7 @@ int UIScene_PauseMenu::ViewLeaderboards_SignInReturned(void *pParam,bool bContin if(bContinue==true) { - UINT uiIDA[1]; + unsigned int uiIDA[1]; uiIDA[0]=IDS_CONFIRM_OK; // guests can't look at leaderboards @@ -1148,7 +1148,7 @@ int UIScene_PauseMenu::WarningTrialTexturePackReturned(void *pParam,int iPad,C4J if (npAvailability == SCE_NP_ERROR_AGE_RESTRICTION) { // 4J Stu - This is a bit messy and is due to the library incorrectly returning false for IsSignedInLive is the npAvailability isn't SCE_OK - UINT uiIDA[1]; + unsigned int uiIDA[1]; uiIDA[0]=IDS_OK; ui.RequestMessageBox(IDS_ONLINE_SERVICE_TITLE, IDS_CONTENT_RESTRICTION, uiIDA, 1, iPad, NULL, NULL, app.GetStringTable()); } @@ -1159,19 +1159,19 @@ int UIScene_PauseMenu::WarningTrialTexturePackReturned(void *pParam,int iPad,C4J // Signed in to PSN but not connected (no internet access) assert(!ProfileManager.isConnectedToPSN(iPad)); - UINT uiIDA[1]; + unsigned int uiIDA[1]; uiIDA[0] = IDS_OK; ui.RequestMessageBox( IDS_ERROR_NETWORK_TITLE, IDS_ERROR_NETWORK, uiIDA, 1, iPad, NULL, NULL, app.GetStringTable()); } else { - UINT uiIDA[1]; + unsigned int uiIDA[1]; uiIDA[0] = IDS_PRO_NOTONLINE_ACCEPT; ui.RequestMessageBox( IDS_PRO_NOTONLINE_TITLE, IDS_PRO_NOTONLINE_TEXT, uiIDA, 1, iPad, &UIScene_PauseMenu::MustSignInReturnedPSN, pClass, app.GetStringTable(), NULL, 0, false); } #else // __PS3__ // You're not signed in to PSN! - UINT uiIDA[2]; + unsigned int uiIDA[2]; uiIDA[0]=IDS_PRO_NOTONLINE_ACCEPT; uiIDA[1]=IDS_PRO_NOTONLINE_DECLINE; ui.RequestMessageBox(IDS_PRO_NOTONLINE_TITLE, IDS_PRO_XBOXLIVE_NOTIFICATION, uiIDA, 2, iPad,&UIScene_PauseMenu::MustSignInReturnedPSN,pClass, app.GetStringTable(), NULL, 0, false); @@ -1185,7 +1185,7 @@ int UIScene_PauseMenu::WarningTrialTexturePackReturned(void *pParam,int iPad,C4J ProfileManager.GetChatAndContentRestrictions(ProfileManager.GetPrimaryPad(),true,NULL,&bContentRestricted,NULL); if(bContentRestricted) { - UINT uiIDA[1]; + unsigned int uiIDA[1]; uiIDA[0]=IDS_CONFIRM_OK; ui.RequestMessageBox(IDS_ONLINE_SERVICE_TITLE, IDS_CONTENT_RESTRICTION, uiIDA, 1, iPad,NULL,pClass, app.GetStringTable(), NULL, 0, false); } @@ -1264,7 +1264,7 @@ int UIScene_PauseMenu::BuyTexturePack_SignInReturned(void *pParam,bool bContinue ProfileManager.GetChatAndContentRestrictions(iPad,true,NULL,&bContentRestricted,NULL); if(bContentRestricted) { - UINT uiIDA[1]; + unsigned int uiIDA[1]; uiIDA[0]=IDS_CONFIRM_OK; ui.RequestMessageBox(IDS_ONLINE_SERVICE_TITLE, IDS_CONTENT_RESTRICTION, uiIDA, 1, iPad,NULL,pClass, app.GetStringTable(), NULL, 0, false); } @@ -1368,7 +1368,7 @@ int UIScene_PauseMenu::ExitGameSaveDialogReturned(void *pParam,int iPad,C4JStora { #ifdef _XBOX // upsell - ULONGLONG ullOfferID_Full; + uint64_t ullOfferID_Full; // get the dlc texture pack DLCTexturePack *pDLCTexPack=(DLCTexturePack *)tPack; @@ -1378,7 +1378,7 @@ int UIScene_PauseMenu::ExitGameSaveDialogReturned(void *pParam,int iPad,C4JStora TelemetryManager->RecordUpsellPresented(iPad, eSet_UpsellID_Texture_DLC, ullOfferID_Full & 0xFFFFFFFF); #endif - UINT uiIDA[2]; + unsigned int uiIDA[2]; uiIDA[0]=IDS_CONFIRM_OK; uiIDA[1]=IDS_CONFIRM_CANCEL; @@ -1396,7 +1396,7 @@ int UIScene_PauseMenu::ExitGameSaveDialogReturned(void *pParam,int iPad,C4JStora // we need to ask if they are sure they want to overwrite the existing game if(bSaveExists) { - UINT uiIDA[2]; + unsigned int uiIDA[2]; uiIDA[0]=IDS_CONFIRM_CANCEL; uiIDA[1]=IDS_CONFIRM_OK; ui.RequestMessageBox(IDS_TITLE_SAVE_GAME, IDS_CONFIRM_SAVE_GAME, uiIDA, 2, ProfileManager.GetPrimaryPad(),&IUIScene_PauseMenu::ExitGameAndSaveReturned, dynamic_cast(pClass), app.GetStringTable(), NULL, 0, false); @@ -1413,7 +1413,7 @@ int UIScene_PauseMenu::ExitGameSaveDialogReturned(void *pParam,int iPad,C4JStora else { // been a few requests for a confirm on exit without saving - UINT uiIDA[2]; + unsigned int uiIDA[2]; uiIDA[0]=IDS_CONFIRM_CANCEL; uiIDA[1]=IDS_CONFIRM_OK; ui.RequestMessageBox(IDS_TITLE_DECLINE_SAVE_GAME, IDS_CONFIRM_DECLINE_SAVE_GAME, uiIDA, 2, ProfileManager.GetPrimaryPad(),&IUIScene_PauseMenu::ExitGameDeclineSaveReturned, dynamic_cast(pClass), app.GetStringTable(), NULL, 0, false); diff --git a/src/client/Common/UI/UIScene_QuadrantSignin.cpp b/src/client/Common/UI/UIScene_QuadrantSignin.cpp index 319198b8..a1eb7454 100644 --- a/src/client/Common/UI/UIScene_QuadrantSignin.cpp +++ b/src/client/Common/UI/UIScene_QuadrantSignin.cpp @@ -198,7 +198,7 @@ int UIScene_QuadrantSignin::SignInReturned(void *pParam,bool bContinue, int iPad } #ifdef _DURANGO -void UIScene_QuadrantSignin::checkAllPrivilegesCallback(LPVOID lpParam, bool hasPrivileges, int iPad) +void UIScene_QuadrantSignin::checkAllPrivilegesCallback(void* lpParam, bool hasPrivileges, int iPad) { UIScene_QuadrantSignin* pClass = (UIScene_QuadrantSignin*)lpParam; @@ -269,7 +269,7 @@ void UIScene_QuadrantSignin::setControllerState(int iPad, EControllerStatus stat } } -int UIScene_QuadrantSignin::AvatarReturned(LPVOID lpParam,PBYTE pbThumbnail,DWORD dwThumbnailBytes) +int UIScene_QuadrantSignin::AvatarReturned(void* lpParam,uint8_t* pbThumbnail,unsigned long dwThumbnailBytes) { UIScene_QuadrantSignin *pClass = (UIScene_QuadrantSignin *)lpParam; app.DebugPrintf(app.USER_SR,"AvatarReturned callback\n"); diff --git a/src/client/Common/UI/UIScene_QuadrantSignin.h b/src/client/Common/UI/UIScene_QuadrantSignin.h index b500fcc3..162b8228 100644 --- a/src/client/Common/UI/UIScene_QuadrantSignin.h +++ b/src/client/Common/UI/UIScene_QuadrantSignin.h @@ -99,12 +99,12 @@ public: private: static int SignInReturned(void *pParam,bool bContinue, int iPad); - static int AvatarReturned(LPVOID lpParam,PBYTE pbThumbnail,DWORD dwThumbnailBytes); + static int AvatarReturned(void* lpParam,uint8_t* pbThumbnail,unsigned long dwThumbnailBytes); void updateState(); void setControllerState(int iPad, EControllerStatus state); #ifdef _DURANGO - static void checkAllPrivilegesCallback(LPVOID lpParam, bool hasPrivileges, int iPad); + static void checkAllPrivilegesCallback(void* lpParam, bool hasPrivileges, int iPad); #endif }; diff --git a/src/client/Common/UI/UIScene_SaveMessage.cpp b/src/client/Common/UI/UIScene_SaveMessage.cpp index a91d5aa8..d0b17872 100644 --- a/src/client/Common/UI/UIScene_SaveMessage.cpp +++ b/src/client/Common/UI/UIScene_SaveMessage.cpp @@ -156,7 +156,7 @@ void UIScene_SaveMessage::handleTimerComplete(int id) app.SetOptionsCallbackStatus(0,C4JStorage::eOptions_Callback_Read_CorruptDeletePending); m_bIgnoreInput=false; // give the option to delete the save - UINT uiIDA[1]; + unsigned int uiIDA[1]; uiIDA[0]=IDS_CONFIRM_OK; ui.RequestMessageBox(IDS_CORRUPT_FILE, IDS_CORRUPT_OPTIONS, uiIDA, 1, 0,&UIScene_SaveMessage::DeleteOptionsDialogReturned,this, app.GetStringTable()); diff --git a/src/client/Common/UI/UIScene_SettingsAudioMenu.cpp b/src/client/Common/UI/UIScene_SettingsAudioMenu.cpp index 2dc06850..348f51fa 100644 --- a/src/client/Common/UI/UIScene_SettingsAudioMenu.cpp +++ b/src/client/Common/UI/UIScene_SettingsAudioMenu.cpp @@ -7,11 +7,11 @@ UIScene_SettingsAudioMenu::UIScene_SettingsAudioMenu(int iPad, void *initData, U // Setup all the Iggy references we need for this scene initialiseMovie(); - WCHAR TempString[256]; - swprintf( (WCHAR *)TempString, 256, L"%ls: %d%%", app.GetString( IDS_SLIDER_MUSIC ),app.GetGameSettings(m_iPad,eGameSetting_MusicVolume)); + wchar_t TempString[256]; + swprintf( (wchar_t *)TempString, 256, L"%ls: %d%%", app.GetString( IDS_SLIDER_MUSIC ),app.GetGameSettings(m_iPad,eGameSetting_MusicVolume)); m_sliderMusic.init(TempString,eControl_Music,0,100,app.GetGameSettings(m_iPad,eGameSetting_MusicVolume)); - swprintf( (WCHAR *)TempString, 256, L"%ls: %d%%", app.GetString( IDS_SLIDER_SOUND ),app.GetGameSettings(m_iPad,eGameSetting_SoundFXVolume)); + swprintf( (wchar_t *)TempString, 256, L"%ls: %d%%", app.GetString( IDS_SLIDER_SOUND ),app.GetGameSettings(m_iPad,eGameSetting_SoundFXVolume)); m_sliderSound.init(TempString,eControl_Sound,0,100,app.GetGameSettings(m_iPad,eGameSetting_SoundFXVolume)); doHorizontalResizeCheck(); @@ -92,7 +92,7 @@ void UIScene_SettingsAudioMenu::handleInput(int iPad, int key, bool repeat, bool void UIScene_SettingsAudioMenu::handleSliderMove(F64 sliderId, F64 currentValue) { - WCHAR TempString[256]; + wchar_t TempString[256]; int value = (int)currentValue; switch((int)sliderId) { @@ -100,7 +100,7 @@ void UIScene_SettingsAudioMenu::handleSliderMove(F64 sliderId, F64 currentValue) m_sliderMusic.handleSliderMove(value); app.SetGameSettings(m_iPad,eGameSetting_MusicVolume,value); - swprintf( (WCHAR *)TempString, 256, L"%ls: %d%%", app.GetString( IDS_SLIDER_MUSIC ),value); + swprintf( (wchar_t *)TempString, 256, L"%ls: %d%%", app.GetString( IDS_SLIDER_MUSIC ),value); m_sliderMusic.setLabel(TempString); break; @@ -108,7 +108,7 @@ void UIScene_SettingsAudioMenu::handleSliderMove(F64 sliderId, F64 currentValue) m_sliderSound.handleSliderMove(value); app.SetGameSettings(m_iPad,eGameSetting_SoundFXVolume,value); - swprintf( (WCHAR *)TempString, 256, L"%ls: %d%%", app.GetString( IDS_SLIDER_SOUND ),value); + swprintf( (wchar_t *)TempString, 256, L"%ls: %d%%", app.GetString( IDS_SLIDER_SOUND ),value); m_sliderSound.setLabel(TempString); break; diff --git a/src/client/Common/UI/UIScene_SettingsControlMenu.cpp b/src/client/Common/UI/UIScene_SettingsControlMenu.cpp index d5447f77..aef39d1e 100644 --- a/src/client/Common/UI/UIScene_SettingsControlMenu.cpp +++ b/src/client/Common/UI/UIScene_SettingsControlMenu.cpp @@ -7,11 +7,11 @@ UIScene_SettingsControlMenu::UIScene_SettingsControlMenu(int iPad, void *initDat // Setup all the Iggy references we need for this scene initialiseMovie(); - WCHAR TempString[256]; - swprintf( (WCHAR *)TempString, 256, L"%ls: %d%%", app.GetString( IDS_SLIDER_SENSITIVITY_INGAME ),app.GetGameSettings(m_iPad,eGameSetting_Sensitivity_InGame)); + wchar_t TempString[256]; + swprintf( (wchar_t *)TempString, 256, L"%ls: %d%%", app.GetString( IDS_SLIDER_SENSITIVITY_INGAME ),app.GetGameSettings(m_iPad,eGameSetting_Sensitivity_InGame)); m_sliderSensitivityInGame.init(TempString,eControl_SensitivityInGame,0,200,app.GetGameSettings(m_iPad,eGameSetting_Sensitivity_InGame)); - swprintf( (WCHAR *)TempString, 256, L"%ls: %d%%", app.GetString( IDS_SLIDER_SENSITIVITY_INMENU ),app.GetGameSettings(m_iPad,eGameSetting_Sensitivity_InMenu)); + swprintf( (wchar_t *)TempString, 256, L"%ls: %d%%", app.GetString( IDS_SLIDER_SENSITIVITY_INMENU ),app.GetGameSettings(m_iPad,eGameSetting_Sensitivity_InMenu)); m_sliderSensitivityInMenu.init(TempString,eControl_SensitivityInMenu,0,200,app.GetGameSettings(m_iPad,eGameSetting_Sensitivity_InMenu)); doHorizontalResizeCheck(); @@ -92,7 +92,7 @@ void UIScene_SettingsControlMenu::handleInput(int iPad, int key, bool repeat, bo void UIScene_SettingsControlMenu::handleSliderMove(F64 sliderId, F64 currentValue) { - WCHAR TempString[256]; + wchar_t TempString[256]; int value = (int)currentValue; switch((int)sliderId) { @@ -100,7 +100,7 @@ void UIScene_SettingsControlMenu::handleSliderMove(F64 sliderId, F64 currentValu m_sliderSensitivityInGame.handleSliderMove(value); app.SetGameSettings(m_iPad,eGameSetting_Sensitivity_InGame,value); - swprintf( (WCHAR *)TempString, 256, L"%ls: %d%%", app.GetString( IDS_SLIDER_SENSITIVITY_INGAME ),value); + swprintf( (wchar_t *)TempString, 256, L"%ls: %d%%", app.GetString( IDS_SLIDER_SENSITIVITY_INGAME ),value); m_sliderSensitivityInGame.setLabel(TempString); break; @@ -108,7 +108,7 @@ void UIScene_SettingsControlMenu::handleSliderMove(F64 sliderId, F64 currentValu m_sliderSensitivityInMenu.handleSliderMove(value); app.SetGameSettings(m_iPad,eGameSetting_Sensitivity_InMenu,value); - swprintf( (WCHAR *)TempString, 256, L"%ls: %d%%", app.GetString( IDS_SLIDER_SENSITIVITY_INMENU ),value); + swprintf( (wchar_t *)TempString, 256, L"%ls: %d%%", app.GetString( IDS_SLIDER_SENSITIVITY_INMENU ),value); m_sliderSensitivityInMenu.setLabel(TempString); break; diff --git a/src/client/Common/UI/UIScene_SettingsGraphicsMenu.cpp b/src/client/Common/UI/UIScene_SettingsGraphicsMenu.cpp index 1234121e..4763392b 100644 --- a/src/client/Common/UI/UIScene_SettingsGraphicsMenu.cpp +++ b/src/client/Common/UI/UIScene_SettingsGraphicsMenu.cpp @@ -14,12 +14,12 @@ UIScene_SettingsGraphicsMenu::UIScene_SettingsGraphicsMenu(int iPad, void *initD m_checkboxCustomSkinAnim.init(app.GetString(IDS_CHECKBOX_CUSTOM_SKIN_ANIM),eControl_CustomSkinAnim,(app.GetGameSettings(m_iPad,eGameSetting_CustomSkinAnim)!=0)); - WCHAR TempString[256]; + wchar_t TempString[256]; - swprintf( (WCHAR *)TempString, 256, L"%ls: %d%%", app.GetString( IDS_SLIDER_GAMMA ),app.GetGameSettings(m_iPad,eGameSetting_Gamma)); + swprintf( (wchar_t *)TempString, 256, L"%ls: %d%%", app.GetString( IDS_SLIDER_GAMMA ),app.GetGameSettings(m_iPad,eGameSetting_Gamma)); m_sliderGamma.init(TempString,eControl_Gamma,0,100,app.GetGameSettings(m_iPad,eGameSetting_Gamma)); - swprintf( (WCHAR *)TempString, 256, L"%ls: %d%%", app.GetString( IDS_SLIDER_INTERFACEOPACITY ),app.GetGameSettings(m_iPad,eGameSetting_InterfaceOpacity)); + swprintf( (wchar_t *)TempString, 256, L"%ls: %d%%", app.GetString( IDS_SLIDER_INTERFACEOPACITY ),app.GetGameSettings(m_iPad,eGameSetting_InterfaceOpacity)); m_sliderInterfaceOpacity.init(TempString,eControl_InterfaceOpacity,0,100,app.GetGameSettings(m_iPad,eGameSetting_InterfaceOpacity)); doHorizontalResizeCheck(); @@ -129,7 +129,7 @@ void UIScene_SettingsGraphicsMenu::handleInput(int iPad, int key, bool repeat, b void UIScene_SettingsGraphicsMenu::handleSliderMove(F64 sliderId, F64 currentValue) { - WCHAR TempString[256]; + wchar_t TempString[256]; int value = (int)currentValue; switch((int)sliderId) { @@ -137,7 +137,7 @@ void UIScene_SettingsGraphicsMenu::handleSliderMove(F64 sliderId, F64 currentVal m_sliderGamma.handleSliderMove(value); app.SetGameSettings(m_iPad,eGameSetting_Gamma,value); - swprintf( (WCHAR *)TempString, 256, L"%ls: %d%%", app.GetString( IDS_SLIDER_GAMMA ),value); + swprintf( (wchar_t *)TempString, 256, L"%ls: %d%%", app.GetString( IDS_SLIDER_GAMMA ),value); m_sliderGamma.setLabel(TempString); break; @@ -145,7 +145,7 @@ void UIScene_SettingsGraphicsMenu::handleSliderMove(F64 sliderId, F64 currentVal m_sliderInterfaceOpacity.handleSliderMove(value); app.SetGameSettings(m_iPad,eGameSetting_InterfaceOpacity,value); - swprintf( (WCHAR *)TempString, 256, L"%ls: %d%%", app.GetString( IDS_SLIDER_INTERFACEOPACITY ),value); + swprintf( (wchar_t *)TempString, 256, L"%ls: %d%%", app.GetString( IDS_SLIDER_INTERFACEOPACITY ),value); m_sliderInterfaceOpacity.setLabel(TempString); break; diff --git a/src/client/Common/UI/UIScene_SettingsMenu.cpp b/src/client/Common/UI/UIScene_SettingsMenu.cpp index 38d5c766..4ac876a7 100644 --- a/src/client/Common/UI/UIScene_SettingsMenu.cpp +++ b/src/client/Common/UI/UIScene_SettingsMenu.cpp @@ -138,7 +138,7 @@ void UIScene_SettingsMenu::handlePress(F64 controlId, F64 childId) case BUTTON_ALL_RESETTODEFAULTS: { // check they really want to do this - UINT uiIDA[2]; + unsigned int uiIDA[2]; uiIDA[0]=IDS_CONFIRM_CANCEL; uiIDA[1]=IDS_CONFIRM_OK; diff --git a/src/client/Common/UI/UIScene_SettingsOptionsMenu.cpp b/src/client/Common/UI/UIScene_SettingsOptionsMenu.cpp index 72576ded..7864d04c 100644 --- a/src/client/Common/UI/UIScene_SettingsOptionsMenu.cpp +++ b/src/client/Common/UI/UIScene_SettingsOptionsMenu.cpp @@ -221,7 +221,7 @@ void UIScene_SettingsOptionsMenu::handleInput(int iPad, int key, bool repeat, bo void UIScene_SettingsOptionsMenu::handleSliderMove(F64 sliderId, F64 currentValue) { - WCHAR TempString[256]; + wchar_t TempString[256]; int value = (int)currentValue; switch((int)sliderId) { diff --git a/src/client/Common/UI/UIScene_SettingsUIMenu.cpp b/src/client/Common/UI/UIScene_SettingsUIMenu.cpp index 917012d6..a741586c 100644 --- a/src/client/Common/UI/UIScene_SettingsUIMenu.cpp +++ b/src/client/Common/UI/UIScene_SettingsUIMenu.cpp @@ -16,12 +16,12 @@ UIScene_SettingsUIMenu::UIScene_SettingsUIMenu(int iPad, void *initData, UILayer m_checkboxSplitscreen.init(app.GetString(IDS_CHECKBOX_VERTICAL_SPLIT_SCREEN),eControl_Splitscreen,(app.GetGameSettings(m_iPad,eGameSetting_SplitScreenVertical)!=0)); m_checkboxShowSplitscreenGamertags.init(app.GetString(IDS_CHECKBOX_DISPLAY_SPLITSCREENGAMERTAGS),eControl_ShowSplitscreenGamertags,(app.GetGameSettings(m_iPad,eGameSetting_DisplaySplitscreenGamertags)!=0)); - WCHAR TempString[256]; + wchar_t TempString[256]; - swprintf( (WCHAR *)TempString, 256, L"%ls: %d", app.GetString( IDS_SLIDER_UISIZE ),app.GetGameSettings(m_iPad,eGameSetting_UISize)+1); + swprintf( (wchar_t *)TempString, 256, L"%ls: %d", app.GetString( IDS_SLIDER_UISIZE ),app.GetGameSettings(m_iPad,eGameSetting_UISize)+1); m_sliderUISize.init(TempString,eControl_UISize,1,3,app.GetGameSettings(m_iPad,eGameSetting_UISize)+1); - swprintf( (WCHAR *)TempString, 256, L"%ls: %d", app.GetString( IDS_SLIDER_UISIZESPLITSCREEN ),app.GetGameSettings(m_iPad,eGameSetting_UISizeSplitscreen)+1); + swprintf( (wchar_t *)TempString, 256, L"%ls: %d", app.GetString( IDS_SLIDER_UISIZESPLITSCREEN ),app.GetGameSettings(m_iPad,eGameSetting_UISizeSplitscreen)+1); m_sliderUISizeSplitscreen.init(TempString,eControl_UISizeSplitscreen,1,3,app.GetGameSettings(m_iPad,eGameSetting_UISizeSplitscreen)+1); doHorizontalResizeCheck(); @@ -145,14 +145,14 @@ void UIScene_SettingsUIMenu::handleInput(int iPad, int key, bool repeat, bool pr void UIScene_SettingsUIMenu::handleSliderMove(F64 sliderId, F64 currentValue) { - WCHAR TempString[256]; + wchar_t TempString[256]; int value = (int)currentValue; switch((int)sliderId) { case eControl_UISize: m_sliderUISize.handleSliderMove(value); - swprintf( (WCHAR *)TempString, 256, L"%ls: %d", app.GetString( IDS_SLIDER_UISIZE ),value); + swprintf( (wchar_t *)TempString, 256, L"%ls: %d", app.GetString( IDS_SLIDER_UISIZE ),value); m_sliderUISize.setLabel(TempString); // is this different from the current value? @@ -167,7 +167,7 @@ void UIScene_SettingsUIMenu::handleSliderMove(F64 sliderId, F64 currentValue) case eControl_UISizeSplitscreen: m_sliderUISizeSplitscreen.handleSliderMove(value); - swprintf( (WCHAR *)TempString, 256, L"%ls: %d", app.GetString( IDS_SLIDER_UISIZESPLITSCREEN ),value); + swprintf( (wchar_t *)TempString, 256, L"%ls: %d", app.GetString( IDS_SLIDER_UISIZESPLITSCREEN ),value); m_sliderUISizeSplitscreen.setLabel(TempString); if(value != app.GetGameSettings(m_iPad,eGameSetting_UISizeSplitscreen)+1) diff --git a/src/client/Common/UI/UIScene_SignEntryMenu.cpp b/src/client/Common/UI/UIScene_SignEntryMenu.cpp index 20a694c4..4f639cbf 100644 --- a/src/client/Common/UI/UIScene_SignEntryMenu.cpp +++ b/src/client/Common/UI/UIScene_SignEntryMenu.cpp @@ -140,7 +140,7 @@ void UIScene_SignEntryMenu::handleInput(int iPad, int key, bool repeat, bool pre } } -int UIScene_SignEntryMenu::KeyboardCompleteCallback(LPVOID lpParam,bool bRes) +int UIScene_SignEntryMenu::KeyboardCompleteCallback(void* lpParam,bool bRes) { // 4J HEG - No reason to set value if keyboard was cancelled UIScene_SignEntryMenu *pClass=(UIScene_SignEntryMenu *)lpParam; @@ -179,14 +179,14 @@ void UIScene_SignEntryMenu::handlePress(F64 controlId, F64 childId) case XC_LANGUAGE_JAPANESE: case XC_LANGUAGE_KOREAN: case XC_LANGUAGE_TCHINESE: - InputManager.RequestKeyboard(app.GetString(IDS_SIGN_TITLE),m_textInputLines[m_iEditingLine].getLabel(),(DWORD)m_iPad,15,&UIScene_SignEntryMenu::KeyboardCompleteCallback,this,C_4JInput::EKeyboardMode_Email); + InputManager.RequestKeyboard(app.GetString(IDS_SIGN_TITLE),m_textInputLines[m_iEditingLine].getLabel(),(unsigned long)m_iPad,15,&UIScene_SignEntryMenu::KeyboardCompleteCallback,this,C_4JInput::EKeyboardMode_Email); break; default: - InputManager.RequestKeyboard(app.GetString(IDS_SIGN_TITLE),m_textInputLines[m_iEditingLine].getLabel(),(DWORD)m_iPad,15,&UIScene_SignEntryMenu::KeyboardCompleteCallback,this,C_4JInput::EKeyboardMode_Alphabet); + InputManager.RequestKeyboard(app.GetString(IDS_SIGN_TITLE),m_textInputLines[m_iEditingLine].getLabel(),(unsigned long)m_iPad,15,&UIScene_SignEntryMenu::KeyboardCompleteCallback,this,C_4JInput::EKeyboardMode_Alphabet); break; } #else - InputManager.RequestKeyboard(app.GetString(IDS_SIGN_TITLE),m_textInputLines[m_iEditingLine].getLabel(),(DWORD)m_iPad,15,&UIScene_SignEntryMenu::KeyboardCompleteCallback,this,C_4JInput::EKeyboardMode_Alphabet); + InputManager.RequestKeyboard(app.GetString(IDS_SIGN_TITLE),m_textInputLines[m_iEditingLine].getLabel(),(unsigned long)m_iPad,15,&UIScene_SignEntryMenu::KeyboardCompleteCallback,this,C_4JInput::EKeyboardMode_Alphabet); #endif } break; diff --git a/src/client/Common/UI/UIScene_SignEntryMenu.h b/src/client/Common/UI/UIScene_SignEntryMenu.h index 28b37d53..4fe9f0c6 100644 --- a/src/client/Common/UI/UIScene_SignEntryMenu.h +++ b/src/client/Common/UI/UIScene_SignEntryMenu.h @@ -53,6 +53,6 @@ public: protected: void handlePress(F64 controlId, F64 childId); - static int KeyboardCompleteCallback(LPVOID lpParam,const bool bRes); + static int KeyboardCompleteCallback(void* lpParam,const bool bRes); virtual void handleDestroy(); }; \ No newline at end of file diff --git a/src/client/Common/UI/UIScene_SkinSelectMenu.cpp b/src/client/Common/UI/UIScene_SkinSelectMenu.cpp index b2982e5d..f9129c9d 100644 --- a/src/client/Common/UI/UIScene_SkinSelectMenu.cpp +++ b/src/client/Common/UI/UIScene_SkinSelectMenu.cpp @@ -13,7 +13,7 @@ //#define SKIN_SELECT_PACK_PLAYER_CUSTOM 1 #define SKIN_SELECT_MAX_DEFAULTS 2 -WCHAR *UIScene_SkinSelectMenu::wchDefaultNamesA[]= +wchar_t *UIScene_SkinSelectMenu::wchDefaultNamesA[]= { L"USE LOCALISED VERSION", // Server selected L"Steve", @@ -303,7 +303,7 @@ void UIScene_SkinSelectMenu::handleInput(int iPad, int key, bool repeat, bool pr #endif // no - UINT uiIDA[1] = { IDS_OK }; + unsigned int uiIDA[1] = { IDS_OK }; #ifdef __ORBIS__ // Check if PSN is unavailable because of age restriction int npAvailability = ProfileManager.getNPAvailability(iPad); @@ -329,7 +329,7 @@ void UIScene_SkinSelectMenu::handleInput(int iPad, int key, bool repeat, bool pr // upsell #ifdef _XBOX DLC_INFO *pDLCInfo = app.GetDLCInfoForTrialOfferID(m_currentPack->getPurchaseOfferId()); - ULONGLONG ullOfferID_Full; + uint64_t ullOfferID_Full; if(pDLCInfo!=NULL) { @@ -351,7 +351,7 @@ void UIScene_SkinSelectMenu::handleInput(int iPad, int key, bool repeat, bool pr { #if !(defined(_XBOX) || defined(_WIN64)) // 4J Stu - Temp to get the win build running, but so we check this for other platforms // you can't see the store - UINT uiIDA[1] = { IDS_CONFIRM_OK }; + unsigned int uiIDA[1] = { IDS_CONFIRM_OK }; ui.RequestMessageBox(IDS_ONLINE_SERVICE_TITLE, IDS_CONTENT_RESTRICTION, uiIDA, 1, iPad,NULL,this, app.GetStringTable(),NULL,0,false); #endif } @@ -364,7 +364,7 @@ void UIScene_SkinSelectMenu::handleInput(int iPad, int key, bool repeat, bool pr { this->m_bIgnoreInput = true; - UINT uiIDA[2] = { IDS_CONFIRM_OK, IDS_CONFIRM_CANCEL }; + unsigned int uiIDA[2] = { IDS_CONFIRM_OK, IDS_CONFIRM_CANCEL }; ui.RequestMessageBox(IDS_UNLOCK_DLC_TITLE, IDS_UNLOCK_DLC_SKIN, uiIDA, 2, iPad,&UIScene_SkinSelectMenu::UnlockSkinReturned,this,app.GetStringTable(),NULL,0,false); } } @@ -442,7 +442,7 @@ void UIScene_SkinSelectMenu::handleInput(int iPad, int key, bool repeat, bool pr { ui.AnimateKeyPress(iPad, key, repeat, pressed, released); ui.PlayUISFX(eSFX_Scroll); - DWORD startingIndex = m_packIndex; + unsigned long startingIndex = m_packIndex; m_packIndex = getPreviousPackIndex(m_packIndex); if(startingIndex != m_packIndex) { @@ -477,7 +477,7 @@ void UIScene_SkinSelectMenu::handleInput(int iPad, int key, bool repeat, bool pr { ui.AnimateKeyPress(iPad, key, repeat, pressed, released); ui.PlayUISFX(eSFX_Scroll); - DWORD startingIndex = m_packIndex; + unsigned long startingIndex = m_packIndex; m_packIndex = getNextPackIndex(m_packIndex); if(startingIndex != m_packIndex) { @@ -615,7 +615,7 @@ void UIScene_SkinSelectMenu::InputActionOK(unsigned int iPad) if(!m_currentPack->hasPurchasedFile( DLCManager::e_DLCType_Skin, skinFile->getPath() )) { // no - UINT uiIDA[1]; + unsigned int uiIDA[1]; uiIDA[0]=IDS_OK; // We need to upsell the full version @@ -636,7 +636,7 @@ void UIScene_SkinSelectMenu::InputActionOK(unsigned int iPad) // upsell #ifdef _XBOX DLC_INFO *pDLCInfo = app.GetDLCInfoForTrialOfferID(m_currentPack->getPurchaseOfferId()); - ULONGLONG ullOfferID_Full; + uint64_t ullOfferID_Full; if(pDLCInfo!=NULL) { @@ -658,7 +658,7 @@ void UIScene_SkinSelectMenu::InputActionOK(unsigned int iPad) { #if !(defined(_XBOX) || defined(_WIN64)) // 4J Stu - Temp to get the win build running, but so we check this for other platforms // you can't see the store - UINT uiIDA[1]; + unsigned int uiIDA[1]; uiIDA[0]=IDS_CONFIRM_OK; ui.RequestMessageBox(IDS_ONLINE_SERVICE_TITLE, IDS_CONTENT_RESTRICTION, uiIDA, 1, ProfileManager.GetPrimaryPad(),NULL,this, app.GetStringTable(),NULL,0,false); #endif @@ -673,7 +673,7 @@ void UIScene_SkinSelectMenu::InputActionOK(unsigned int iPad) m_bIgnoreInput = true; renableInputAfterOperation = false; - UINT uiIDA[2] = { IDS_CONFIRM_OK, IDS_CONFIRM_CANCEL }; + unsigned int uiIDA[2] = { IDS_CONFIRM_OK, IDS_CONFIRM_CANCEL }; ui.RequestMessageBox(IDS_UNLOCK_DLC_TITLE, IDS_UNLOCK_DLC_SKIN, uiIDA, 2, iPad,&UIScene_SkinSelectMenu::UnlockSkinReturned,this,app.GetStringTable(),NULL,0,false); } } @@ -744,15 +744,15 @@ void UIScene_SkinSelectMenu::customDraw(IggyCustomDrawCallbackRegion *region) void UIScene_SkinSelectMenu::handleSkinIndexChanged() { - BOOL showPrevious = false, showNext = false; - DWORD previousIndex = 0, nextIndex = 0; + bool showPrevious = false, showNext = false; + unsigned long previousIndex = 0, nextIndex = 0; wstring skinName = L""; wstring skinOrigin = L""; bool bSkinIsFree=false; bool bLicensed=false; DLCSkinFile *skinFile=NULL; DLCPack *Pack=NULL; - BYTE sidePreviewControlsL,sidePreviewControlsR; + uint8_t sidePreviewControlsL,sidePreviewControlsR; m_bNoSkinsToShow=false; TEXTURE_NAME backupTexture = TN_MOB_CHAR; @@ -935,7 +935,7 @@ void UIScene_SkinSelectMenu::handleSkinIndexChanged() sidePreviewControlsL=sidePreviewControlsR=sidePreviewControls; } - for(BYTE i = 0; i < sidePreviewControlsR; ++i) + for(uint8_t i = 0; i < sidePreviewControlsR; ++i) { if(showNext) { @@ -1006,7 +1006,7 @@ void UIScene_SkinSelectMenu::handleSkinIndexChanged() - for(BYTE i = 0; i < sidePreviewControlsL; ++i) + for(uint8_t i = 0; i < sidePreviewControlsL; ++i) { if(showPrevious) { @@ -1113,7 +1113,7 @@ TEXTURE_NAME UIScene_SkinSelectMenu::getTextureId(int skinIndex) return texture; } -int UIScene_SkinSelectMenu::getNextSkinIndex(DWORD sourceIndex) +int UIScene_SkinSelectMenu::getNextSkinIndex(unsigned long sourceIndex) { int nextSkin = sourceIndex; @@ -1147,7 +1147,7 @@ int UIScene_SkinSelectMenu::getNextSkinIndex(DWORD sourceIndex) return nextSkin; } -int UIScene_SkinSelectMenu::getPreviousSkinIndex(DWORD sourceIndex) +int UIScene_SkinSelectMenu::getPreviousSkinIndex(unsigned long sourceIndex) { int previousSkin = sourceIndex; switch(m_packIndex) @@ -1200,7 +1200,7 @@ void UIScene_SkinSelectMenu::handlePackIndexChanged() if(m_currentPack != NULL) { bool found; - DWORD currentSkinIndex = m_currentPack->getSkinIndexAt(m_currentSkinPath, found); + unsigned long currentSkinIndex = m_currentPack->getSkinIndexAt(m_currentSkinPath, found); if(found) m_skinIndex = currentSkinIndex; } else @@ -1210,8 +1210,8 @@ void UIScene_SkinSelectMenu::handlePackIndexChanged() case SKIN_SELECT_PACK_DEFAULT: if( !GET_IS_DLC_SKIN_FROM_BITMASK(m_originalSkinId) ) { - DWORD ugcSkinIndex = GET_UGC_SKIN_ID_FROM_BITMASK(m_originalSkinId); - DWORD defaultSkinIndex = GET_DEFAULT_SKIN_ID_FROM_BITMASK(m_originalSkinId); + unsigned long ugcSkinIndex = GET_UGC_SKIN_ID_FROM_BITMASK(m_originalSkinId); + unsigned long defaultSkinIndex = GET_DEFAULT_SKIN_ID_FROM_BITMASK(m_originalSkinId); if( ugcSkinIndex == 0 ) { m_skinIndex = (EDefaultSkins) defaultSkinIndex; @@ -1229,7 +1229,7 @@ void UIScene_SkinSelectMenu::handlePackIndexChanged() DLCPack *Pack=app.m_dlcManager.getPackContainingSkin(chars); if(Pack) { - DWORD currentSkinIndex = Pack->getSkinIndexAt(m_currentSkinPath, found); + unsigned long currentSkinIndex = Pack->getSkinIndexAt(m_currentSkinPath, found); if(found) m_skinIndex = app.GetPlayerFavoriteSkinsPos(m_iPad); } } @@ -1304,7 +1304,7 @@ void UIScene_SkinSelectMenu::updatePackDisplay() } -int UIScene_SkinSelectMenu::getNextPackIndex(DWORD sourceIndex) +int UIScene_SkinSelectMenu::getNextPackIndex(unsigned long sourceIndex) { int nextPack = sourceIndex; ++nextPack; @@ -1316,12 +1316,12 @@ int UIScene_SkinSelectMenu::getNextPackIndex(DWORD sourceIndex) return nextPack; } -int UIScene_SkinSelectMenu::getPreviousPackIndex(DWORD sourceIndex) +int UIScene_SkinSelectMenu::getPreviousPackIndex(unsigned long sourceIndex) { int previousPack = sourceIndex; if (previousPack == SKIN_SELECT_PACK_DEFAULT) { - DWORD packCount = app.m_dlcManager.getPackCount(DLCManager::e_DLCType_Skin); + unsigned long packCount = app.m_dlcManager.getPackCount(DLCManager::e_DLCType_Skin); if (packCount > 0) { @@ -1523,7 +1523,7 @@ void UIScene_SkinSelectMenu::handleTouchInput(unsigned int iPad, S32 x, S32 y, i if( m_currentNavigation == eSkinNavigation_Pack ) { ui.PlayUISFX(eSFX_Scroll); - DWORD startingIndex = m_packIndex; + unsigned long startingIndex = m_packIndex; m_packIndex = getPreviousPackIndex(m_packIndex); if(startingIndex != m_packIndex) { @@ -1535,7 +1535,7 @@ void UIScene_SkinSelectMenu::handleTouchInput(unsigned int iPad, S32 x, S32 y, i if( m_currentNavigation == eSkinNavigation_Pack ) { ui.PlayUISFX(eSFX_Scroll); - DWORD startingIndex = m_packIndex; + unsigned long startingIndex = m_packIndex; m_packIndex = getNextPackIndex(m_packIndex); if(startingIndex != m_packIndex) { @@ -1644,7 +1644,7 @@ void UIScene_SkinSelectMenu::showNotOnlineDialog(int iPad) #elif defined(_DURANGO) - UINT uiIDA[1] = { IDS_CONFIRM_OK }; + unsigned int uiIDA[1] = { IDS_CONFIRM_OK }; ui.RequestMessageBox(IDS_PRO_NOTONLINE_TITLE, IDS_PRO_XBOXLIVE_NOTIFICATION, uiIDA, 1, iPad, NULL, NULL, app.GetStringTable() ); #endif @@ -1712,7 +1712,7 @@ int UIScene_SkinSelectMenu::UnlockSkinReturned(void *pParam,int iPad,C4JStorage: pScene->m_bIgnoreInput = false; } #elif defined _XBOX_ONE - StorageManager.InstallOffer(1,(WCHAR *)(pScene->m_currentPack->getPurchaseOfferId().c_str()), &RenableInput, pScene, NULL); + StorageManager.InstallOffer(1,(wchar_t *)(pScene->m_currentPack->getPurchaseOfferId().c_str()), &RenableInput, pScene, NULL); #endif } else // Is signed in, but not live. @@ -1729,7 +1729,7 @@ int UIScene_SkinSelectMenu::UnlockSkinReturned(void *pParam,int iPad,C4JStorage: return 0; } -int UIScene_SkinSelectMenu::RenableInput(LPVOID lpVoid, int, int) +int UIScene_SkinSelectMenu::RenableInput(void* lpVoid, int, int) { ((UIScene_SkinSelectMenu*) lpVoid)->m_bIgnoreInput = false; return 0; diff --git a/src/client/Common/UI/UIScene_SkinSelectMenu.h b/src/client/Common/UI/UIScene_SkinSelectMenu.h index b0c028e0..a06fa848 100644 --- a/src/client/Common/UI/UIScene_SkinSelectMenu.h +++ b/src/client/Common/UI/UIScene_SkinSelectMenu.h @@ -6,10 +6,10 @@ class UIScene_SkinSelectMenu : public UIScene { private: - static WCHAR *wchDefaultNamesA[eDefaultSkins_Count]; + static wchar_t *wchDefaultNamesA[eDefaultSkins_Count]; // 4J Stu - How many to show on each side of the main control - static const BYTE sidePreviewControls = 4; + static const uint8_t sidePreviewControls = 4; #ifdef __PSVITA__ enum ETouchInput @@ -100,8 +100,8 @@ private: UI_END_MAP_ELEMENTS_AND_NAMES() DLCPack *m_currentPack; - DWORD m_packIndex, m_skinIndex; - DWORD m_originalSkinId; + unsigned long m_packIndex, m_skinIndex; + unsigned long m_originalSkinId; wstring m_currentSkinPath, m_selectedSkinPath, m_selectedCapePath; vector *m_vAdditionalSkinBoxes; @@ -109,7 +109,7 @@ private: ESkinSelectNavigation m_currentNavigation; bool m_bNoSkinsToShow; - DWORD m_currentPackCount; + unsigned long m_currentPackCount; bool m_bIgnoreInput; bool m_bSkinIndexChanged; wstring m_leftLabel, m_centreLabel, m_rightLabel; @@ -144,15 +144,15 @@ public: private: void handleSkinIndexChanged(); - int getNextSkinIndex(DWORD sourceIndex); - int getPreviousSkinIndex(DWORD sourceIndex); + int getNextSkinIndex(unsigned long sourceIndex); + int getPreviousSkinIndex(unsigned long sourceIndex); TEXTURE_NAME getTextureId(int skinIndex); void handlePackIndexChanged(); void updatePackDisplay(); - int getNextPackIndex(DWORD sourceIndex); - int getPreviousPackIndex(DWORD sourceIndex); + int getNextPackIndex(unsigned long sourceIndex); + int getPreviousPackIndex(unsigned long sourceIndex); void setCharacterSelected(bool selected); void setCharacterLocked(bool locked); @@ -170,7 +170,7 @@ private: void showNotOnlineDialog(int iPad); static int UnlockSkinReturned(void *pParam,int iPad,C4JStorage::EMessageResult result); - static int RenableInput(LPVOID lpVoid, int, int); + static int RenableInput(void* lpVoid, int, int); void AddFavoriteSkin(int iPad,int iSkinID); void InputActionOK(unsigned int iPad); diff --git a/src/client/Common/UI/UIScene_TeleportMenu.cpp b/src/client/Common/UI/UIScene_TeleportMenu.cpp index 075811b7..33846e06 100644 --- a/src/client/Common/UI/UIScene_TeleportMenu.cpp +++ b/src/client/Common/UI/UIScene_TeleportMenu.cpp @@ -34,10 +34,10 @@ UIScene_TeleportMenu::UIScene_TeleportMenu(int iPad, void *initData, UILayer *pa m_playerNames[i] = L""; } - DWORD playerCount = g_NetworkManager.GetPlayerCount(); + unsigned long playerCount = g_NetworkManager.GetPlayerCount(); m_playersCount = 0; - for(DWORD i = 0; i < playerCount; ++i) + for(unsigned long i = 0; i < playerCount; ++i) { INetworkPlayer *player = g_NetworkManager.GetPlayerByIndex( i ); @@ -124,10 +124,10 @@ void UIScene_TeleportMenu::handleGainFocus(bool navBack) void UIScene_TeleportMenu::handleReload() { - DWORD playerCount = g_NetworkManager.GetPlayerCount(); + unsigned long playerCount = g_NetworkManager.GetPlayerCount(); m_playersCount = 0; - for(DWORD i = 0; i < playerCount; ++i) + for(unsigned long i = 0; i < playerCount; ++i) { INetworkPlayer *player = g_NetworkManager.GetPlayerByIndex( i ); @@ -185,7 +185,7 @@ void UIScene_TeleportMenu::tick() { UIScene::tick(); - for(DWORD i = 0; i < m_playersCount; ++i) + for(unsigned long i = 0; i < m_playersCount; ++i) { INetworkPlayer *player = g_NetworkManager.GetPlayerBySmallId( m_players[i] ); diff --git a/src/client/Common/UI/UIScene_TeleportMenu.h b/src/client/Common/UI/UIScene_TeleportMenu.h index ebbaa2a0..b9ae508c 100644 --- a/src/client/Common/UI/UIScene_TeleportMenu.h +++ b/src/client/Common/UI/UIScene_TeleportMenu.h @@ -12,7 +12,7 @@ private: bool m_teleportToPlayer; int m_playersCount; - BYTE m_players[MINECRAFT_NET_MAX_PLAYERS]; // An array of QNet small-id's + uint8_t m_players[MINECRAFT_NET_MAX_PLAYERS]; // An array of QNet small-id's char m_playersVoiceState[MINECRAFT_NET_MAX_PLAYERS]; short m_playersColourState[MINECRAFT_NET_MAX_PLAYERS]; wstring m_playerNames[MINECRAFT_NET_MAX_PLAYERS]; diff --git a/src/client/Common/UI/UIScene_TrialExitUpsell.cpp b/src/client/Common/UI/UIScene_TrialExitUpsell.cpp index 34fc1ebd..f940cec1 100644 --- a/src/client/Common/UI/UIScene_TrialExitUpsell.cpp +++ b/src/client/Common/UI/UIScene_TrialExitUpsell.cpp @@ -53,7 +53,7 @@ void UIScene_TrialExitUpsell::handleInput(int iPad, int key, bool repeat, bool p ProfileManager.GetChatAndContentRestrictions(ProfileManager.GetPrimaryPad(),true,NULL,&bContentRestricted,NULL); if(bContentRestricted) { - UINT uiIDA[1]; + unsigned int uiIDA[1]; uiIDA[0]=IDS_CONFIRM_OK; ui.RequestMessageBox(IDS_ONLINE_SERVICE_TITLE, IDS_CONTENT_RESTRICTION, uiIDA, 1, ProfileManager.GetPrimaryPad(),NULL,this, app.GetStringTable()); } diff --git a/src/client/Common/UI/UIStructs.h b/src/client/Common/UI/UIStructs.h index 01e1e4d5..90a3db4d 100644 --- a/src/client/Common/UI/UIStructs.h +++ b/src/client/Common/UI/UIStructs.h @@ -137,8 +137,8 @@ typedef struct _ConnectionProgressParams bool showTooltips; bool setFailTimer; int timerTime; - void (*cancelFunc)(LPVOID param); - LPVOID cancelFuncParam; + void (*cancelFunc)(void* param); + void* cancelFuncParam; _ConnectionProgressParams() { @@ -155,10 +155,10 @@ typedef struct _ConnectionProgressParams // Fullscreen progress typedef struct _UIFullscreenProgressCompletionData { - BOOL bRequiresUserAction; - BOOL bShowBackground; - BOOL bShowLogo; - BOOL bShowTips; + bool bRequiresUserAction; + bool bShowBackground; + bool bShowLogo; + bool bShowTips; ProgressionCompletionType type; int iPad; EUIScene scene; @@ -176,8 +176,8 @@ typedef struct _UIFullscreenProgressCompletionData // Create world typedef struct _CreateWorldMenuInitData { - BOOL bOnline; - BOOL bIsPrivate; + bool bOnline; + bool bIsPrivate; int iPad; } CreateWorldMenuInitData; @@ -186,8 +186,8 @@ CreateWorldMenuInitData; typedef struct _SaveListDetails { int saveId; - PBYTE pbThumbnailData; - DWORD dwThumbnailSize; + uint8_t* pbThumbnailData; + unsigned long dwThumbnailSize; #ifdef _DURANGO wchar_t UTF16SaveName[128]; wchar_t UTF16SaveFilename[MAX_SAVEFILENAME_LENGTH]; @@ -236,28 +236,28 @@ typedef struct _JoinMenuInitData // More Options typedef struct _LaunchMoreOptionsMenuInitData { - BOOL bOnlineGame; - BOOL bInviteOnly; - BOOL bAllowFriendsOfFriends; + bool bOnlineGame; + bool bInviteOnly; + bool bAllowFriendsOfFriends; - BOOL bGenerateOptions; - BOOL bStructures; - BOOL bFlatWorld; - BOOL bBonusChest; + bool bGenerateOptions; + bool bStructures; + bool bFlatWorld; + bool bBonusChest; - BOOL bPVP; - BOOL bTrust; - BOOL bFireSpreads; - BOOL bTNT; + bool bPVP; + bool bTrust; + bool bFireSpreads; + bool bTNT; - BOOL bHostPrivileges; - BOOL bResetNether; + bool bHostPrivileges; + bool bResetNether; - BOOL bOnlineSettingChangedBySystem; + bool bOnlineSettingChangedBySystem; int iPad; - DWORD dwTexturePack; + unsigned long dwTexturePack; wstring seed; int worldSize; @@ -282,14 +282,14 @@ LaunchMoreOptionsMenuInitData; typedef struct _LoadingInputParams { C4JThreadStartFunc* func; - LPVOID lpParam; + void* lpParam; UIFullscreenProgressCompletionData *completionData; int cancelText; - void (*cancelFunc)(LPVOID param); - void (*completeFunc)(LPVOID param); - LPVOID m_cancelFuncParam; - LPVOID m_completeFuncParam; + void (*cancelFunc)(void* param); + void (*completeFunc)(void* param); + void* m_cancelFuncParam; + void* m_completeFuncParam; bool waitForThreadToDelete; _LoadingInputParams() @@ -319,8 +319,8 @@ typedef struct _TutorialPopupInfo #else UIScene *interactScene; #endif - LPCWSTR desc; - LPCWSTR title; + const wchar_t* desc; + const wchar_t* title; int icon; int iAuxVal /* = 0 */; bool isFoil /* = false */; @@ -346,15 +346,15 @@ typedef struct _TutorialPopupInfo // Quadrant sign in typedef struct _SignInInfo { - int( *Func)(LPVOID,const bool, const int iPad); - LPVOID lpParam; + int( *Func)(void*,const bool, const int iPad); + void* lpParam; bool requireOnline; } SignInInfo; // Credits typedef struct { - LPCWSTR m_Text; // Should contain string, optionally with %s to add in translated string ... e.g. "Andy West - %s" + const wchar_t* m_Text; // Should contain string, optionally with %s to add in translated string ... e.g. "Andy West - %s" int m_iStringID[2]; // May be NO_TRANSLATED_STRING if we do not require to add any translated string. ECreditTextTypes m_eType; } @@ -363,16 +363,16 @@ SCreditTextItemDef; // Message box typedef struct _MessageBoxInfo { - UINT uiTitle; - UINT uiText; - UINT *uiOptionA; - UINT uiOptionC; - DWORD dwPad; - int( *Func)(LPVOID,int,const C4JStorage::EMessageResult); - LPVOID lpParam; + unsigned int uiTitle; + unsigned int uiText; + unsigned int *uiOptionA; + unsigned int uiOptionC; + unsigned long dwPad; + int( *Func)(void*,int,const C4JStorage::EMessageResult); + void* lpParam; //C4JStringTable *pStringTable; // 4J Stu - We don't need this for our internal message boxes - WCHAR *pwchFormatString; - DWORD dwFocusButton; + wchar_t *pwchFormatString; + unsigned long dwFocusButton; } MessageBoxInfo; typedef struct _DLCOffersParam @@ -386,7 +386,7 @@ DLCOffersParam; typedef struct _InGamePlayerOptionsInitData { int iPad; - BYTE networkSmallId; + uint8_t networkSmallId; unsigned int playerPrivileges; } InGamePlayerOptionsInitData; diff --git a/src/client/Common/UI/UITTFFont.cpp b/src/client/Common/UI/UITTFFont.cpp index bf92925c..c08c32c7 100644 --- a/src/client/Common/UI/UITTFFont.cpp +++ b/src/client/Common/UI/UITTFFont.cpp @@ -10,26 +10,26 @@ UITTFFont::UITTFFont(const string &path, S32 fallbackCharacter) #ifdef _UNICODE wstring wPath = convStringToWstring(path); - HANDLE file = CreateFile(wPath.c_str(), GENERIC_READ, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); + void* file = CreateFile(wPath.c_str(), GENERIC_READ, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); #else - HANDLE file = CreateFile(path.c_str(), GENERIC_READ, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); + void* file = CreateFile(path.c_str(), GENERIC_READ, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); #endif if( file == INVALID_HANDLE_VALUE ) { - DWORD error = GetLastError(); + unsigned long error = GetLastError(); app.DebugPrintf("Failed to open TTF file with error code %d (%x)\n", error, error); assert(false); } - DWORD dwHigh=0; - DWORD dwFileSize = GetFileSize(file,&dwHigh); + unsigned long dwHigh=0; + unsigned long dwFileSize = GetFileSize(file,&dwHigh); if(dwFileSize!=0) { - DWORD bytesRead; + unsigned long bytesRead; - pbData = (PBYTE) new BYTE[dwFileSize]; - BOOL bSuccess = ReadFile(file,pbData,dwFileSize,&bytesRead,NULL); + pbData = (uint8_t*) new uint8_t[dwFileSize]; + bool bSuccess = ReadFile(file,pbData,dwFileSize,&bytesRead,NULL); if(bSuccess==false) { app.FatalLoadError(); diff --git a/src/client/Common/UI/UITTFFont.h b/src/client/Common/UI/UITTFFont.h index 0de7c4e0..5f8191ca 100644 --- a/src/client/Common/UI/UITTFFont.h +++ b/src/client/Common/UI/UITTFFont.h @@ -3,8 +3,8 @@ class UITTFFont { private: - PBYTE pbData; - //DWORD dwDataSize; + uint8_t* pbData; + //unsigned long dwDataSize; public: UITTFFont(const string &path, S32 fallbackCharacter); diff --git a/src/client/Common/XUI/SlotProgressControl.cpp b/src/client/Common/XUI/SlotProgressControl.cpp index ec976554..3e2054ae 100644 --- a/src/client/Common/XUI/SlotProgressControl.cpp +++ b/src/client/Common/XUI/SlotProgressControl.cpp @@ -43,7 +43,7 @@ int SlotProgressControl::GetValue() } else { - LPCWSTR name; + const wchar_t* name; XuiElementGetId( hParent, &name ); OutputDebugStringW( name ); diff --git a/src/client/Common/XUI/XUI_BasePlayer.cpp b/src/client/Common/XUI/XUI_BasePlayer.cpp index 21348070..9295f9a1 100644 --- a/src/client/Common/XUI/XUI_BasePlayer.cpp +++ b/src/client/Common/XUI/XUI_BasePlayer.cpp @@ -2,7 +2,7 @@ #include #include "XUI_BasePlayer.h" -HRESULT CXuiSceneBasePlayer::OnInit( XUIMessageInit* pInitData, BOOL& bHandled ) +int CXuiSceneBasePlayer::OnInit( XUIMessageInit* pInitData, bool& bHandled ) { return S_OK; } diff --git a/src/client/Common/XUI/XUI_BasePlayer.h b/src/client/Common/XUI/XUI_BasePlayer.h index fd777e6a..fb67eee4 100644 --- a/src/client/Common/XUI/XUI_BasePlayer.h +++ b/src/client/Common/XUI/XUI_BasePlayer.h @@ -4,7 +4,7 @@ class CXuiSceneBasePlayer : public CXuiSceneImpl { protected: - HRESULT OnInit( XUIMessageInit* pInitData, BOOL& bHandled ); + int OnInit( XUIMessageInit* pInitData, bool& bHandled ); public: // Define the class. The class name must match the ClassOverride property diff --git a/src/client/Common/XUI/XUI_Chat.cpp b/src/client/Common/XUI/XUI_Chat.cpp index abc2c889..a086e09e 100644 --- a/src/client/Common/XUI/XUI_Chat.cpp +++ b/src/client/Common/XUI/XUI_Chat.cpp @@ -3,7 +3,7 @@ #include "Minecraft.h" #include "Gui.h" -HRESULT CScene_Chat::OnInit( XUIMessageInit* pInitData, BOOL& bHandled ) +int CScene_Chat::OnInit( XUIMessageInit* pInitData, bool& bHandled ) { m_iPad = *(int *)pInitData->pvInitData; @@ -16,12 +16,12 @@ HRESULT CScene_Chat::OnInit( XUIMessageInit* pInitData, BOOL& bHandled ) return S_OK; } -HRESULT CScene_Chat::OnTimer( XUIMessageTimer *pXUIMessageTimer, BOOL &bHandled) +int CScene_Chat::OnTimer( XUIMessageTimer *pXUIMessageTimer, bool &bHandled) { Minecraft *pMinecraft = Minecraft::GetInstance(); Gui *pGui = pMinecraft->gui; - //DWORD messagesToDisplay = min( CHAT_LINES_COUNT, pGui->getMessagesCount(m_iPad) ); + //unsigned long messagesToDisplay = min( CHAT_LINES_COUNT, pGui->getMessagesCount(m_iPad) ); for( unsigned int i = 0; i < CHAT_LINES_COUNT; ++i ) { float opacity = pGui->getOpacity(m_iPad, i); @@ -45,7 +45,7 @@ HRESULT CScene_Chat::OnTimer( XUIMessageTimer *pXUIMessageTimer, BOOL &bHandled) return S_OK; } -HRESULT CScene_Chat::OnCustomMessage_Splitscreenplayer(bool bJoining, BOOL& bHandled) +int CScene_Chat::OnCustomMessage_Splitscreenplayer(bool bJoining, bool& bHandled) { bHandled=true; @@ -54,7 +54,7 @@ HRESULT CScene_Chat::OnCustomMessage_Splitscreenplayer(bool bJoining, BOOL& bHan return S_OK; } -HRESULT CScene_Chat::OffsetTextPosition( float xOffset, float yOffset /*= 0.0f*/ ) +int CScene_Chat::OffsetTextPosition( float xOffset, float yOffset /*= 0.0f*/ ) { D3DXVECTOR3 vPos; float fWidth, fHeight; diff --git a/src/client/Common/XUI/XUI_Chat.h b/src/client/Common/XUI/XUI_Chat.h index d685e587..6ac84db8 100644 --- a/src/client/Common/XUI/XUI_Chat.h +++ b/src/client/Common/XUI/XUI_Chat.h @@ -46,14 +46,14 @@ protected: MAP_CONTROL(IDC_XuiLabelJukebox, m_Jukebox) END_CONTROL_MAP() - HRESULT OnInit( XUIMessageInit* pInitData, BOOL& bHandled ); - HRESULT OnTimer( XUIMessageTimer *pXUIMessageTimer, BOOL &bHandled); - HRESULT OnCustomMessage_Splitscreenplayer(bool bJoining, BOOL& bHandled); + int OnInit( XUIMessageInit* pInitData, bool& bHandled ); + int OnTimer( XUIMessageTimer *pXUIMessageTimer, bool &bHandled); + int OnCustomMessage_Splitscreenplayer(bool bJoining, bool& bHandled); public: // Define the class. The class name must match the ClassOverride property // set for the scene in the UI Authoring tool. XUI_IMPLEMENT_CLASS( CScene_Chat, L"CScene_Chat", XUI_CLASS_SCENE ) - HRESULT OffsetTextPosition( float xOffset, float yOffset = 0.0f ); + int OffsetTextPosition( float xOffset, float yOffset = 0.0f ); }; \ No newline at end of file diff --git a/src/client/Common/XUI/XUI_ConnectingProgress.cpp b/src/client/Common/XUI/XUI_ConnectingProgress.cpp index b50c91b2..4107074d 100644 --- a/src/client/Common/XUI/XUI_ConnectingProgress.cpp +++ b/src/client/Common/XUI/XUI_ConnectingProgress.cpp @@ -10,7 +10,7 @@ //---------------------------------------------------------------------------------- // Performs initialization tasks - retrieves controls. //---------------------------------------------------------------------------------- -HRESULT CScene_ConnectingProgress::OnInit( XUIMessageInit* pInitData, BOOL& bHandled ) +int CScene_ConnectingProgress::OnInit( XUIMessageInit* pInitData, bool& bHandled ) { ConnectionProgressParams *param = (ConnectionProgressParams *)pInitData->pvInitData; m_iPad = param->iPad; @@ -48,7 +48,7 @@ HRESULT CScene_ConnectingProgress::OnInit( XUIMessageInit* pInitData, BOOL& bHan } // The framework calls this handler when the object is to be destroyed. -HRESULT CScene_ConnectingProgress::OnDestroy() +int CScene_ConnectingProgress::OnDestroy() { return S_OK; } @@ -56,7 +56,7 @@ HRESULT CScene_ConnectingProgress::OnDestroy() //---------------------------------------------------------------------------------- // Updates the UI when the list selection changes. //---------------------------------------------------------------------------------- -HRESULT CScene_ConnectingProgress::OnNotifySelChanged( HXUIOBJ hObjSource, XUINotifySelChanged* pNotifySelChangedData, BOOL& bHandled ) +int CScene_ConnectingProgress::OnNotifySelChanged( HXUIOBJ hObjSource, XUINotifySelChanged* pNotifySelChangedData, bool& bHandled ) { return S_OK; } @@ -64,7 +64,7 @@ HRESULT CScene_ConnectingProgress::OnNotifySelChanged( HXUIOBJ hObjSource, XUINo //---------------------------------------------------------------------------------- // Handler for the button press message. //---------------------------------------------------------------------------------- -HRESULT CScene_ConnectingProgress::OnNotifyPressEx(HXUIOBJ hObjPressed, XUINotifyPress* pNotifyPressData, BOOL& rfHandled) +int CScene_ConnectingProgress::OnNotifyPressEx(HXUIOBJ hObjPressed, XUINotifyPress* pNotifyPressData, bool& rfHandled) { // This assumes all buttons can only be pressed with the A button ui.AnimateKeyPress(pNotifyPressData->UserIndex, VK_PAD_A); @@ -87,7 +87,7 @@ HRESULT CScene_ConnectingProgress::OnNotifyPressEx(HXUIOBJ hObjPressed, XUINotif return S_OK; } -HRESULT CScene_ConnectingProgress::OnKeyDown(XUIMessageInput* pInputData, BOOL& rfHandled) +int CScene_ConnectingProgress::OnKeyDown(XUIMessageInput* pInputData, bool& rfHandled) { if( m_showTooltips ) { @@ -105,14 +105,14 @@ HRESULT CScene_ConnectingProgress::OnKeyDown(XUIMessageInput* pInputData, BOOL& return S_OK; } -HRESULT CScene_ConnectingProgress::OnGetSourceDataText(XUIMessageGetSourceText *pGetSourceTextData, BOOL& bHandled) +int CScene_ConnectingProgress::OnGetSourceDataText(XUIMessageGetSourceText *pGetSourceTextData, bool& bHandled) { // This gets called every frame, so use it to update our two text boxes return S_OK; } -HRESULT CScene_ConnectingProgress::OnTransitionStart( XUIMessageTransition *pTransition, BOOL& bHandled ) +int CScene_ConnectingProgress::OnTransitionStart( XUIMessageTransition *pTransition, bool& bHandled ) { //if(m_runFailTimer) XuiSetTimer(m_hObj,0,m_timerTime); if( pTransition->dwTransType == XUI_TRANSITION_FROM ) @@ -123,7 +123,7 @@ HRESULT CScene_ConnectingProgress::OnTransitionStart( XUIMessageTransition *pTra return S_OK; } -HRESULT CScene_ConnectingProgress::OnTransitionEnd( XUIMessageTransition *pTransition, BOOL& bHandled ) +int CScene_ConnectingProgress::OnTransitionEnd( XUIMessageTransition *pTransition, bool& bHandled ) { // are we being destroyed? If so, don't do anything if(pTransition->dwTransAction==XUI_TRANSITION_ACTION_DESTROY ) @@ -139,7 +139,7 @@ HRESULT CScene_ConnectingProgress::OnTransitionEnd( XUIMessageTransition *pTrans return S_OK; } -HRESULT CScene_ConnectingProgress::OnTimer( XUIMessageTimer *pTimer, BOOL& bHandled ) +int CScene_ConnectingProgress::OnTimer( XUIMessageTimer *pTimer, bool& bHandled ) { // Check if the connection failed Minecraft *pMinecraft = Minecraft::GetInstance(); @@ -200,7 +200,7 @@ HRESULT CScene_ConnectingProgress::OnTimer( XUIMessageTimer *pTimer, BOOL& bHand } else { - UINT uiIDA[1]; + unsigned int uiIDA[1]; uiIDA[0]=IDS_CONFIRM_OK; #ifdef _XBOX StorageManager.RequestMessageBox( IDS_CONNECTION_FAILED, exitReasonStringId, uiIDA,1,ProfileManager.GetPrimaryPad(),NULL,NULL, app.GetStringTable()); diff --git a/src/client/Common/XUI/XUI_ConnectingProgress.h b/src/client/Common/XUI/XUI_ConnectingProgress.h index 360ca0b0..e9752bf1 100644 --- a/src/client/Common/XUI/XUI_ConnectingProgress.h +++ b/src/client/Common/XUI/XUI_ConnectingProgress.h @@ -33,15 +33,15 @@ protected: END_CONTROL_MAP() - HRESULT OnInit( XUIMessageInit* pInitData, BOOL& bHandled ); - HRESULT OnDestroy(); - HRESULT OnNotifySelChanged( HXUIOBJ hObjSource, XUINotifySelChanged* pNotifySelChangedData, BOOL& bHandled ); - HRESULT OnNotifyPressEx(HXUIOBJ hObjPressed, XUINotifyPress* pNotifyPressData,BOOL& rfHandled); - HRESULT OnKeyDown(XUIMessageInput* pInputData, BOOL& rfHandled); - HRESULT OnGetSourceDataText(XUIMessageGetSourceText *pGetSourceTextData, BOOL& bHandled); - HRESULT OnTransitionStart( XUIMessageTransition *pTransition, BOOL& bHandled ); - HRESULT OnTransitionEnd( XUIMessageTransition *pTransition, BOOL& bHandled ); - HRESULT OnTimer( XUIMessageTimer *pTimer, BOOL& bHandled ); + int OnInit( XUIMessageInit* pInitData, bool& bHandled ); + int OnDestroy(); + int OnNotifySelChanged( HXUIOBJ hObjSource, XUINotifySelChanged* pNotifySelChangedData, bool& bHandled ); + int OnNotifyPressEx(HXUIOBJ hObjPressed, XUINotifyPress* pNotifyPressData,bool& rfHandled); + int OnKeyDown(XUIMessageInput* pInputData, bool& rfHandled); + int OnGetSourceDataText(XUIMessageGetSourceText *pGetSourceTextData, bool& bHandled); + int OnTransitionStart( XUIMessageTransition *pTransition, bool& bHandled ); + int OnTransitionEnd( XUIMessageTransition *pTransition, bool& bHandled ); + int OnTimer( XUIMessageTimer *pTimer, bool& bHandled ); public: // Define the class. The class name must match the ClassOverride property diff --git a/src/client/Common/XUI/XUI_Control_ComboBox.cpp b/src/client/Common/XUI/XUI_Control_ComboBox.cpp index 47abac76..f851e2c5 100644 --- a/src/client/Common/XUI/XUI_Control_ComboBox.cpp +++ b/src/client/Common/XUI/XUI_Control_ComboBox.cpp @@ -2,7 +2,7 @@ #include "XUI_Control_ComboBox.h" #include "Xbox_App.h" -HRESULT CXuiControl4JComboBox::OnInit(XUIMessageInit *pInitData, BOOL& bHandled) +int CXuiControl4JComboBox::OnInit(XUIMessageInit *pInitData, bool& bHandled) { m_ListData.nItems=0; m_ListData.pItems=NULL; @@ -13,7 +13,7 @@ HRESULT CXuiControl4JComboBox::OnInit(XUIMessageInit *pInitData, BOOL& bHandled) void CXuiControl4JComboBox::SetData(LIST_ITEM_INFO *pItems,int iCount) { CXuiControl4JComboBox *pThis; - HRESULT hr = XuiObjectFromHandle(m_hObj, (void **) &pThis); + int hr = XuiObjectFromHandle(m_hObj, (void **) &pThis); // copy the data in pThis->m_ListData.pItems= new LIST_ITEM_INFO [iCount] ; @@ -29,7 +29,7 @@ int CXuiControl4JComboBox::GetSelectedIndex() } // Gets called every frame -HRESULT CXuiControl4JComboBox::OnGetSourceDataText(XUIMessageGetSourceText *pGetSourceTextData,BOOL& bHandled) +int CXuiControl4JComboBox::OnGetSourceDataText(XUIMessageGetSourceText *pGetSourceTextData,bool& bHandled) { if( ( 0 == pGetSourceTextData->iData ) && ( ( pGetSourceTextData->bItemData ) ) ) { @@ -40,14 +40,14 @@ HRESULT CXuiControl4JComboBox::OnGetSourceDataText(XUIMessageGetSourceText *pGet return S_OK; } -HRESULT CXuiControl4JComboBox::OnGetItemCountAll(XUIMessageGetItemCount *pGetItemCountData,BOOL& bHandled) +int CXuiControl4JComboBox::OnGetItemCountAll(XUIMessageGetItemCount *pGetItemCountData,bool& bHandled) { pGetItemCountData->cItems = m_ListData.nItems; bHandled = true; return S_OK; } -HRESULT CXuiControl4JComboBox::OnGetSourceDataImage(XUIMessageGetSourceImage *pGetSourceImageData,BOOL& bHandled) +int CXuiControl4JComboBox::OnGetSourceDataImage(XUIMessageGetSourceImage *pGetSourceImageData,bool& bHandled) { return S_OK; @@ -69,7 +69,7 @@ HRESULT CXuiControl4JComboBox::OnGetSourceDataImage(XUIMessageGetSourceImage *pG //return S_OK; } -HRESULT CXuiControl4JComboBox::OnGetItemEnable(XUIMessageGetItemEnable *pGetItemEnableData,BOOL& bHandled) +int CXuiControl4JComboBox::OnGetItemEnable(XUIMessageGetItemEnable *pGetItemEnableData,bool& bHandled) { if(m_ListData.pItems!=NULL && m_ListData.nItems!=0) { @@ -83,7 +83,7 @@ HRESULT CXuiControl4JComboBox::OnGetItemEnable(XUIMessageGetItemEnable *pGetItem //---------------------------------------------------------------------------------- // Handler for the button press message. //---------------------------------------------------------------------------------- -HRESULT CXuiControl4JComboBox::OnNotifyPressEx(HXUIOBJ hObjPressed, XUINotifyPress* pNotifyPressData, BOOL& rfHandled) +int CXuiControl4JComboBox::OnNotifyPressEx(HXUIOBJ hObjPressed, XUINotifyPress* pNotifyPressData, bool& rfHandled) { // This assumes all buttons can only be pressed with the A button CScene_Base::HandleKeyPress(pNotifyPressData->UserIndex, VK_PAD_A); diff --git a/src/client/Common/XUI/XUI_Control_ComboBox.h b/src/client/Common/XUI/XUI_Control_ComboBox.h index 28b61187..80f46a56 100644 --- a/src/client/Common/XUI/XUI_Control_ComboBox.h +++ b/src/client/Common/XUI/XUI_Control_ComboBox.h @@ -7,11 +7,11 @@ public: // Information for one list item. typedef struct _LIST_ITEM_INFO { - LPCWSTR pwszText; - LPCWSTR pwszImage; + const wchar_t* pwszText; + const wchar_t* pwszImage; HXUIBRUSH hXuiBrush; - BOOL fChecked; - BOOL fEnabled; + bool fChecked; + bool fEnabled; } LIST_ITEM_INFO; @@ -42,12 +42,12 @@ protected: XUI_END_MSG_MAP() - HRESULT OnInit( XUIMessageInit* pInitData, BOOL& bHandled ); - HRESULT OnGetSourceDataText(XUIMessageGetSourceText *pGetSourceTextData, BOOL& bHandled); - HRESULT OnGetItemCountAll(XUIMessageGetItemCount *pGetItemCountData, BOOL& bHandled); - HRESULT OnGetSourceDataImage(XUIMessageGetSourceImage *pGetSourceImageData,BOOL& bHandled); - HRESULT OnGetItemEnable(XUIMessageGetItemEnable *pGetItemEnableData,BOOL& bHandled); - HRESULT OnNotifyPressEx(HXUIOBJ hObjPressed, XUINotifyPress* pNotifyPressData,BOOL& rfHandled); + int OnInit( XUIMessageInit* pInitData, bool& bHandled ); + int OnGetSourceDataText(XUIMessageGetSourceText *pGetSourceTextData, bool& bHandled); + int OnGetItemCountAll(XUIMessageGetItemCount *pGetItemCountData, bool& bHandled); + int OnGetSourceDataImage(XUIMessageGetSourceImage *pGetSourceImageData,bool& bHandled); + int OnGetItemEnable(XUIMessageGetItemEnable *pGetItemEnableData,bool& bHandled); + int OnNotifyPressEx(HXUIOBJ hObjPressed, XUINotifyPress* pNotifyPressData,bool& rfHandled); }; \ No newline at end of file diff --git a/src/client/Common/XUI/XUI_Ctrl_4JEdit.cpp b/src/client/Common/XUI/XUI_Ctrl_4JEdit.cpp index b9b5d074..b28955be 100644 --- a/src/client/Common/XUI/XUI_Ctrl_4JEdit.cpp +++ b/src/client/Common/XUI/XUI_Ctrl_4JEdit.cpp @@ -3,9 +3,9 @@ -HRESULT CXuiCtrl4JEdit::OnInit(XUIMessageInit* pInitData, BOOL& rfHandled) +int CXuiCtrl4JEdit::OnInit(XUIMessageInit* pInitData, bool& rfHandled) { - HRESULT hr=S_OK; + int hr=S_OK; // set a limit for the text box m_uTextLimit=XUI_4JEDIT_MAX_CHARS-1; @@ -13,7 +13,7 @@ HRESULT CXuiCtrl4JEdit::OnInit(XUIMessageInit* pInitData, BOOL& rfHandled) // Find the text limit. (Add one for NULL terminator) //m_uTextLimit = min( XuiEditGetTextLimit(m_hObj) + 1, XUI_4JEDIT_MAX_CHARS); - ZeroMemory( wchText , sizeof(WCHAR)*(m_uTextLimit+1) ); + ZeroMemory( wchText , sizeof(wchar_t)*(m_uTextLimit+1) ); m_bReadOnly = false; m_uiTitle = 0; @@ -23,34 +23,34 @@ HRESULT CXuiCtrl4JEdit::OnInit(XUIMessageInit* pInitData, BOOL& rfHandled) } -HRESULT CXuiCtrl4JEdit::SetTextLimit(int iLimit) +int CXuiCtrl4JEdit::SetTextLimit(int iLimit) { CXuiCtrl4JEdit *pThis; - HRESULT hr = XuiObjectFromHandle(m_hObj, (void **) &pThis); + int hr = XuiObjectFromHandle(m_hObj, (void **) &pThis); if (FAILED(hr)) return hr; if(iLimitm_uTextLimit=iLimit; XuiEditSetTextLimit(pThis->m_hObj,iLimit); - ZeroMemory( pThis->wchText , sizeof(WCHAR)*XUI_4JEDIT_MAX_CHARS ); + ZeroMemory( pThis->wchText , sizeof(wchar_t)*XUI_4JEDIT_MAX_CHARS ); } return S_OK; } -HRESULT CXuiCtrl4JEdit::SetCaretPosition(int iPos) +int CXuiCtrl4JEdit::SetCaretPosition(int iPos) { CXuiCtrl4JEdit *pThis; - HRESULT hr = XuiObjectFromHandle(m_hObj, (void **) &pThis); + int hr = XuiObjectFromHandle(m_hObj, (void **) &pThis); if (FAILED(hr)) return hr; XuiEditSetCaretPosition(pThis->m_hObj,iPos); return S_OK; } -HRESULT CXuiCtrl4JEdit::SetTitleAndText(unsigned int uiTitle, unsigned int uiText) +int CXuiCtrl4JEdit::SetTitleAndText(unsigned int uiTitle, unsigned int uiText) { CXuiCtrl4JEdit *pThis; - HRESULT hr = XuiObjectFromHandle(m_hObj, (void **) &pThis); + int hr = XuiObjectFromHandle(m_hObj, (void **) &pThis); if (FAILED(hr)) return hr; pThis->m_uiTitle=uiTitle; @@ -59,12 +59,12 @@ HRESULT CXuiCtrl4JEdit::SetTitleAndText(unsigned int uiTitle, unsigned int uiTex return S_OK; } -HRESULT CXuiCtrl4JEdit::SetReadOnly(bool bReadOnly) +int CXuiCtrl4JEdit::SetReadOnly(bool bReadOnly) { // Attempt to make the change on the actual original version of this object that XUI made itself, rather // than the copy we make ourselves and then map to it, which shares the same handle CXuiCtrl4JEdit *pThis; - HRESULT hr = XuiObjectFromHandle(m_hObj, (void **) &pThis); + int hr = XuiObjectFromHandle(m_hObj, (void **) &pThis); if (FAILED(hr)) return hr; pThis->m_bReadOnly = bReadOnly; @@ -72,22 +72,22 @@ HRESULT CXuiCtrl4JEdit::SetReadOnly(bool bReadOnly) return S_OK; } -HRESULT CXuiCtrl4JEdit::SetKeyboardType(C_4JInput::EKeyboardMode eKeyboardMode) +int CXuiCtrl4JEdit::SetKeyboardType(C_4JInput::EKeyboardMode eKeyboardMode) { CXuiCtrl4JEdit *pThis; - HRESULT hr = XuiObjectFromHandle(m_hObj, (void **) &pThis); + int hr = XuiObjectFromHandle(m_hObj, (void **) &pThis); if (FAILED(hr)) return hr; pThis->m_eKeyboardMode= eKeyboardMode; return S_OK; } -// HRESULT CXuiCtrl4JEdit::SetIPMode(bool bIPMode) +// int CXuiCtrl4JEdit::SetIPMode(bool bIPMode) // { // // Attempt to make the change on the actual original version of this object that XUI made itself, rather // // than the copy we make ourselves and then map to it, which shares the same handle // CXuiCtrl4JEdit *pThis; -// HRESULT hr = XuiObjectFromHandle(m_hObj, (void **) &pThis); +// int hr = XuiObjectFromHandle(m_hObj, (void **) &pThis); // if (FAILED(hr)) // return hr; // pThis->m_bIPMode= bIPMode; @@ -95,12 +95,12 @@ HRESULT CXuiCtrl4JEdit::SetKeyboardType(C_4JInput::EKeyboardMode eKeyboardMode) // return S_OK; // } -// HRESULT CXuiCtrl4JEdit::SetExtendedMode(bool bExtendedMode) +// int CXuiCtrl4JEdit::SetExtendedMode(bool bExtendedMode) // { // // Attempt to make the change on the actual original version of this object that XUI made itself, rather // // than the copy we make ourselves and then map to it, which shares the same handle // CXuiCtrl4JEdit *pThis; -// HRESULT hr = XuiObjectFromHandle(m_hObj, (void **) &pThis); +// int hr = XuiObjectFromHandle(m_hObj, (void **) &pThis); // if (FAILED(hr)) // return hr; // pThis->m_bExtendedMode= bExtendedMode; @@ -108,10 +108,10 @@ HRESULT CXuiCtrl4JEdit::SetKeyboardType(C_4JInput::EKeyboardMode eKeyboardMode) // return S_OK; // } -HRESULT CXuiCtrl4JEdit::OnChar(XUIMessageChar* pInputData, BOOL& rfHandled) +int CXuiCtrl4JEdit::OnChar(XUIMessageChar* pInputData, bool& rfHandled) { CXuiCtrl4JEdit *pThis; - HRESULT hr = XuiObjectFromHandle(m_hObj, (void **) &pThis); + int hr = XuiObjectFromHandle(m_hObj, (void **) &pThis); if (FAILED(hr)) return hr; @@ -132,16 +132,16 @@ HRESULT CXuiCtrl4JEdit::OnChar(XUIMessageChar* pInputData, BOOL& rfHandled) return hr; } -HRESULT CXuiCtrl4JEdit::OnKeyDown(XUIMessageInput* pInputData, BOOL& rfHandled) +int CXuiCtrl4JEdit::OnKeyDown(XUIMessageInput* pInputData, bool& rfHandled) { CXuiCtrl4JEdit *pThis; - HRESULT hr = XuiObjectFromHandle(m_hObj, (void **) &pThis); + int hr = XuiObjectFromHandle(m_hObj, (void **) &pThis); if (FAILED(hr)) return hr; ui.AnimateKeyPress(pInputData->UserIndex, pInputData->dwKeyCode); - //HRESULT hr = S_OK; + //int hr = S_OK; if( pThis->m_bReadOnly ) return hr; @@ -164,14 +164,14 @@ void CXuiCtrl4JEdit::RequestKeyboard(int iPad) //----------------------------------------------------------------------------- -HRESULT CXuiCtrl4JEdit::SendNotifyValueChanged(int iValue) +int CXuiCtrl4JEdit::SendNotifyValueChanged(int iValue) { CXuiCtrl4JEdit *pThis; - HRESULT hr = XuiObjectFromHandle(m_hObj, (void **) &pThis); + int hr = XuiObjectFromHandle(m_hObj, (void **) &pThis); if (FAILED(hr)) return hr; HXUIOBJ hParent; - //HRESULT hr=S_OK; + //int hr=S_OK; XUIMessage msg; XUINotify msgNotify; XUINotifyValueChanged msgNotifyValueChanged; @@ -186,7 +186,7 @@ HRESULT CXuiCtrl4JEdit::SendNotifyValueChanged(int iValue) int CXuiCtrl4JEdit::KeyboardReturned(void *pParam,bool bSet) { CXuiCtrl4JEdit* pClass = (CXuiCtrl4JEdit*)pParam; - HRESULT hr = S_OK; + int hr = S_OK; if(bSet) { diff --git a/src/client/Common/XUI/XUI_Ctrl_4JEdit.h b/src/client/Common/XUI/XUI_Ctrl_4JEdit.h index f6899d19..d7c2ebbc 100644 --- a/src/client/Common/XUI/XUI_Ctrl_4JEdit.h +++ b/src/client/Common/XUI/XUI_Ctrl_4JEdit.h @@ -18,17 +18,17 @@ protected: XUI_ON_XM_KEYDOWN(OnKeyDown) XUI_END_MSG_MAP() - HRESULT OnInit(XUIMessageInit* pInitData, BOOL& rfHandled); - HRESULT OnChar(XUIMessageChar* pInputData, BOOL& rfHandled); - HRESULT OnKeyDown(XUIMessageInput* pInputData, BOOL& rfHandled); + int OnInit(XUIMessageInit* pInitData, bool& rfHandled); + int OnChar(XUIMessageChar* pInputData, bool& rfHandled); + int OnKeyDown(XUIMessageInput* pInputData, bool& rfHandled); public: - HRESULT SetReadOnly(bool bReadOnly); -// HRESULT SetIPMode(bool bIPMode); -// HRESULT SetExtendedMode(bool bExtendedMode); - HRESULT SetKeyboardType(C_4JInput::EKeyboardMode eKeyboardMode); - HRESULT SetTextLimit(int iLimit); - HRESULT SetCaretPosition(int iPos); - HRESULT SetTitleAndText(unsigned int uiTitle, unsigned int uiText); + int SetReadOnly(bool bReadOnly); +// int SetIPMode(bool bIPMode); +// int SetExtendedMode(bool bExtendedMode); + int SetKeyboardType(C_4JInput::EKeyboardMode eKeyboardMode); + int SetTextLimit(int iLimit); + int SetCaretPosition(int iPos); + int SetTitleAndText(unsigned int uiTitle, unsigned int uiText); void RequestKeyboard(int iPad); protected: @@ -38,7 +38,7 @@ protected: private: static int KeyboardReturned(void *pParam,bool bSet); - HRESULT SendNotifyValueChanged(int); - WCHAR wchText[XUI_4JEDIT_MAX_CHARS]; + int SendNotifyValueChanged(int); + wchar_t wchText[XUI_4JEDIT_MAX_CHARS]; unsigned int m_uTextLimit; }; diff --git a/src/client/Common/XUI/XUI_Ctrl_4JIcon.cpp b/src/client/Common/XUI/XUI_Ctrl_4JIcon.cpp index 2b09c5c5..b27ab15d 100644 --- a/src/client/Common/XUI/XUI_Ctrl_4JIcon.cpp +++ b/src/client/Common/XUI/XUI_Ctrl_4JIcon.cpp @@ -1,17 +1,17 @@ #include "stdafx.h" #include "XUI_Ctrl_4JIcon.h" -HRESULT CXuiCtrl4JIcon::OnInit(XUIMessageInit *pInitData, BOOL& bHandled) +int CXuiCtrl4JIcon::OnInit(XUIMessageInit *pInitData, bool& bHandled) { m_hBrush=NULL; return S_OK; } -HRESULT CXuiCtrl4JIcon::OnGetSourceDataImage(XUIMessageGetSourceImage *pGetSourceImageData,BOOL& bHandled) +int CXuiCtrl4JIcon::OnGetSourceDataImage(XUIMessageGetSourceImage *pGetSourceImageData,bool& bHandled) { XUIMessage Message; XUIMessageGetSourceImage MsgGetImage; - HRESULT hr; + int hr; HXUIOBJ hObj; if(m_hBrush) @@ -39,7 +39,7 @@ HRESULT CXuiCtrl4JIcon::OnGetSourceDataImage(XUIMessageGetSourceImage *pGetSourc return S_OK; } -HRESULT CXuiCtrl4JIcon::UseBrush(HXUIBRUSH hBrush) +int CXuiCtrl4JIcon::UseBrush(HXUIBRUSH hBrush) { if( m_hBrush ) { @@ -49,7 +49,7 @@ HRESULT CXuiCtrl4JIcon::UseBrush(HXUIBRUSH hBrush) return XuiControlSetImageBrush(m_hObj,hBrush); } -HRESULT CXuiCtrl4JIcon::OnDestroy() +int CXuiCtrl4JIcon::OnDestroy() { if( m_hBrush ) diff --git a/src/client/Common/XUI/XUI_Ctrl_4JIcon.h b/src/client/Common/XUI/XUI_Ctrl_4JIcon.h index d99f0c55..cf2a6f08 100644 --- a/src/client/Common/XUI/XUI_Ctrl_4JIcon.h +++ b/src/client/Common/XUI/XUI_Ctrl_4JIcon.h @@ -6,7 +6,7 @@ class CXuiCtrl4JIcon : public CXuiControlImpl public: XUI_IMPLEMENT_CLASS(CXuiCtrl4JIcon, L"CXuiCtrl4JIcon", XUI_CLASS_LABEL); - HRESULT UseBrush(HXUIBRUSH hBrush); + int UseBrush(HXUIBRUSH hBrush); protected: @@ -17,9 +17,9 @@ protected: XUI_END_MSG_MAP() - HRESULT OnInit( XUIMessageInit* pInitData, BOOL& bHandled ); - HRESULT OnGetSourceDataImage(XUIMessageGetSourceImage *pGetSourceImageData,BOOL& bHandled); - HRESULT OnDestroy(); + int OnInit( XUIMessageInit* pInitData, bool& bHandled ); + int OnGetSourceDataImage(XUIMessageGetSourceImage *pGetSourceImageData,bool& bHandled); + int OnDestroy(); HXUIBRUSH m_hBrush; }; diff --git a/src/client/Common/XUI/XUI_Ctrl_4JList.cpp b/src/client/Common/XUI/XUI_Ctrl_4JList.cpp index 9a97c28b..4494a323 100644 --- a/src/client/Common/XUI/XUI_Ctrl_4JList.cpp +++ b/src/client/Common/XUI/XUI_Ctrl_4JList.cpp @@ -3,7 +3,7 @@ static bool TimeSortFn(const void *a, const void *b); -HRESULT CXuiCtrl4JList::OnInit(XUIMessageInit *pInitData, BOOL& bHandled) +int CXuiCtrl4JList::OnInit(XUIMessageInit *pInitData, bool& bHandled) { InitializeCriticalSection(&m_AccessListData); @@ -16,42 +16,42 @@ void CXuiCtrl4JList::AddData( const LIST_ITEM_INFO& ItemInfo , int iSortListFrom { // need to allocate memory for the structure and its strings // and remap the string pointers - DWORD dwBytes=0; - DWORD dwLen1=0; - DWORD dwLen2=0; + unsigned long dwBytes=0; + unsigned long dwLen1=0; + unsigned long dwLen2=0; if(ItemInfo.pwszText) { - dwLen1=(int)wcslen(ItemInfo.pwszText)*sizeof(WCHAR); - dwBytes+=dwLen1+sizeof(WCHAR); + dwLen1=(int)wcslen(ItemInfo.pwszText)*sizeof(wchar_t); + dwBytes+=dwLen1+sizeof(wchar_t); } if(ItemInfo.pwszImage) { - dwLen2=(int)(wcslen(ItemInfo.pwszImage))*sizeof(WCHAR); - dwBytes+=dwLen2+sizeof(WCHAR); + dwLen2=(int)(wcslen(ItemInfo.pwszImage))*sizeof(wchar_t); + dwBytes+=dwLen2+sizeof(wchar_t); } dwBytes+=sizeof( LIST_ITEM_INFO ); - LIST_ITEM_INFO *pItemInfo = (LIST_ITEM_INFO *)new BYTE[dwBytes]; + LIST_ITEM_INFO *pItemInfo = (LIST_ITEM_INFO *)new uint8_t[dwBytes]; ZeroMemory(pItemInfo,dwBytes); XMemCpy( pItemInfo, &ItemInfo, sizeof( LIST_ITEM_INFO ) ); if(dwLen1!=0) { XMemCpy( &pItemInfo[1], ItemInfo.pwszText, dwLen1 ); - pItemInfo->pwszText=(LPCWSTR)&pItemInfo[1]; + pItemInfo->pwszText=(const wchar_t*)&pItemInfo[1]; if(dwLen2!=0) { - BYTE *pwszImage = ((BYTE *)&pItemInfo[1])+dwLen1+sizeof(WCHAR); + uint8_t *pwszImage = ((uint8_t *)&pItemInfo[1])+dwLen1+sizeof(wchar_t); XMemCpy( pwszImage, ItemInfo.pwszImage, dwLen2 ); - pItemInfo->pwszImage=(LPCWSTR)pwszImage; + pItemInfo->pwszImage=(const wchar_t*)pwszImage; } } else if(dwLen2!=0) { XMemCpy( &pItemInfo[1], ItemInfo.pwszImage, dwLen2 ); - pItemInfo->pwszImage=(LPCWSTR)&pItemInfo[1]; + pItemInfo->pwszImage=(const wchar_t*)&pItemInfo[1]; } EnterCriticalSection(&m_AccessListData); @@ -162,7 +162,7 @@ int CXuiCtrl4JList::GetIndexByUserData(int iData) return 0; } -CXuiCtrl4JList::LIST_ITEM_INFO& CXuiCtrl4JList::GetData(DWORD dw) +CXuiCtrl4JList::LIST_ITEM_INFO& CXuiCtrl4JList::GetData(unsigned long dw) { return *m_vListData[dw]; } @@ -268,7 +268,7 @@ void CXuiCtrl4JList::UpdateGraphic(int iItem,HXUIBRUSH hXuiBrush ) LeaveCriticalSection(&m_AccessListData); } -void CXuiCtrl4JList::UpdateText(int iItem,LPCWSTR pwszText ) +void CXuiCtrl4JList::UpdateText(int iItem,const wchar_t* pwszText ) { // need to update the one with the matching filetime EnterCriticalSection(&m_AccessListData); @@ -301,7 +301,7 @@ void CXuiCtrl4JList::UpdateGraphic(FILETIME *pfTime,HXUIBRUSH hXuiBrush ) } // Gets called every frame -HRESULT CXuiCtrl4JList::OnGetSourceDataText(XUIMessageGetSourceText *pGetSourceTextData,BOOL& bHandled) +int CXuiCtrl4JList::OnGetSourceDataText(XUIMessageGetSourceText *pGetSourceTextData,bool& bHandled) { if( ( 0 == pGetSourceTextData->iData ) && ( ( pGetSourceTextData->bItemData ) ) ) { @@ -314,14 +314,14 @@ HRESULT CXuiCtrl4JList::OnGetSourceDataText(XUIMessageGetSourceText *pGetSourceT return S_OK; } -HRESULT CXuiCtrl4JList::OnGetItemCountAll(XUIMessageGetItemCount *pGetItemCountData,BOOL& bHandled) +int CXuiCtrl4JList::OnGetItemCountAll(XUIMessageGetItemCount *pGetItemCountData,bool& bHandled) { pGetItemCountData->cItems = (int)m_vListData.size(); bHandled = true; return S_OK; } -HRESULT CXuiCtrl4JList::OnGetSourceDataImage(XUIMessageGetSourceImage *pGetSourceImageData,BOOL& bHandled) +int CXuiCtrl4JList::OnGetSourceDataImage(XUIMessageGetSourceImage *pGetSourceImageData,bool& bHandled) { if( ( 0 == pGetSourceImageData->iData ) && ( pGetSourceImageData->bItemData ) ) { @@ -342,7 +342,7 @@ HRESULT CXuiCtrl4JList::OnGetSourceDataImage(XUIMessageGetSourceImage *pGetSourc return S_OK; } -HRESULT CXuiCtrl4JList::OnGetItemEnable(XUIMessageGetItemEnable *pGetItemEnableData,BOOL& bHandled) +int CXuiCtrl4JList::OnGetItemEnable(XUIMessageGetItemEnable *pGetItemEnableData,bool& bHandled) { if(m_vListData.size()!=0) { @@ -356,7 +356,7 @@ HRESULT CXuiCtrl4JList::OnGetItemEnable(XUIMessageGetItemEnable *pGetItemEnableD } -HRESULT CXuiCtrl4JList::SetBorder(DWORD dw,BOOL bShow) +int CXuiCtrl4JList::SetBorder(unsigned long dw,bool bShow) { CXuiControl Control; HXUIOBJ hVisual,hBorder; @@ -371,7 +371,7 @@ void CXuiCtrl4JList::SetSelectionChangedHandle(HXUIOBJ hObj) m_hSelectionChangedHandlerObj = hObj; } -HRESULT CXuiCtrl4JList::OnDestroy() +int CXuiCtrl4JList::OnDestroy() { DeleteCriticalSection(&m_AccessListData); @@ -383,13 +383,13 @@ HRESULT CXuiCtrl4JList::OnDestroy() { XuiDestroyBrush( m_vListData[i]->hXuiBrush ); } - delete [] (BYTE *)m_vListData[i]; + delete [] (uint8_t *)m_vListData[i]; } } return S_OK; } -HRESULT CXuiCtrl4JList::OnNotifySelChanged( HXUIOBJ hObjSource, XUINotifySelChanged* pNotifySelChangedData, BOOL& bHandled ) +int CXuiCtrl4JList::OnNotifySelChanged( HXUIOBJ hObjSource, XUINotifySelChanged* pNotifySelChangedData, bool& bHandled ) { if(m_hSelectionChangedHandlerObj) { diff --git a/src/client/Common/XUI/XUI_Ctrl_4JList.h b/src/client/Common/XUI/XUI_Ctrl_4JList.h index 11bdd456..d7c62119 100644 --- a/src/client/Common/XUI/XUI_Ctrl_4JList.h +++ b/src/client/Common/XUI/XUI_Ctrl_4JList.h @@ -14,11 +14,11 @@ public: // Information for one list item. typedef struct _LIST_ITEM_INFO { - LPCWSTR pwszText; - LPCWSTR pwszImage; + const wchar_t* pwszText; + const wchar_t* pwszImage; HXUIBRUSH hXuiBrush; - BOOL fChecked; - BOOL fEnabled; + bool fChecked; + bool fEnabled; bool bIsDamaged; // damaged save FILETIME fTime; int iData; // user data @@ -33,17 +33,17 @@ public: void AddData( const LIST_ITEM_INFO& ItemInfo , int iSortListFromIndex=-1, int iSortFunction=CXuiCtrl4JList::eSortList_Date); void RemoveAllData( ); - void UpdateText(int iItem,LPCWSTR pwszText ); + void UpdateText(int iItem,const wchar_t* pwszText ); void SelectByUserData(int iData); int GetIndexByUserData(int iData); void UpdateGraphic(int iItem,HXUIBRUSH hXuiBrush ); void UpdateGraphic(FILETIME *pfTime,HXUIBRUSH hXuiBrush ); void UpdateGraphicFromiData(int iData,HXUIBRUSH hXuiBrush ); - LIST_ITEM_INFO& GetData(DWORD dw); + LIST_ITEM_INFO& GetData(unsigned long dw); LIST_ITEM_INFO& GetData(FILETIME *pFileTime); LIST_ITEM_INFO& GetDataiData(int iData); - HRESULT SetBorder(DWORD dw,BOOL bShow); // for a highlight around the current selected item in the controls layout + int SetBorder(unsigned long dw,bool bShow); // for a highlight around the current selected item in the controls layout void SetSelectionChangedHandle(HXUIOBJ hObj); protected: @@ -58,13 +58,13 @@ protected: XUI_END_MSG_MAP() - HRESULT OnInit( XUIMessageInit* pInitData, BOOL& bHandled ); - HRESULT OnGetSourceDataText(XUIMessageGetSourceText *pGetSourceTextData, BOOL& bHandled); - HRESULT OnGetItemCountAll(XUIMessageGetItemCount *pGetItemCountData, BOOL& bHandled); - HRESULT OnGetSourceDataImage(XUIMessageGetSourceImage *pGetSourceImageData,BOOL& bHandled); - HRESULT OnGetItemEnable(XUIMessageGetItemEnable *pGetItemEnableData,BOOL& bHandled); - HRESULT OnDestroy(); - HRESULT OnNotifySelChanged( HXUIOBJ hObjSource, XUINotifySelChanged* pNotifySelChangedData, BOOL& bHandled ); + int OnInit( XUIMessageInit* pInitData, bool& bHandled ); + int OnGetSourceDataText(XUIMessageGetSourceText *pGetSourceTextData, bool& bHandled); + int OnGetItemCountAll(XUIMessageGetItemCount *pGetItemCountData, bool& bHandled); + int OnGetSourceDataImage(XUIMessageGetSourceImage *pGetSourceImageData,bool& bHandled); + int OnGetItemEnable(XUIMessageGetItemEnable *pGetItemEnableData,bool& bHandled); + int OnDestroy(); + int OnNotifySelChanged( HXUIOBJ hObjSource, XUINotifySelChanged* pNotifySelChangedData, bool& bHandled ); LISTITEMINFOARRAY m_vListData; CRITICAL_SECTION m_AccessListData; diff --git a/src/client/Common/XUI/XUI_Ctrl_CraftIngredientSlot.cpp b/src/client/Common/XUI/XUI_Ctrl_CraftIngredientSlot.cpp index fe13145d..9aeba348 100644 --- a/src/client/Common/XUI/XUI_Ctrl_CraftIngredientSlot.cpp +++ b/src/client/Common/XUI/XUI_Ctrl_CraftIngredientSlot.cpp @@ -20,14 +20,14 @@ CXuiCtrlCraftIngredientSlot::CXuiCtrlCraftIngredientSlot() //----------------------------------------------------------------------------- -HRESULT CXuiCtrlCraftIngredientSlot::OnInit(XUIMessageInit* pInitData, BOOL& rfHandled) +int CXuiCtrlCraftIngredientSlot::OnInit(XUIMessageInit* pInitData, bool& rfHandled) { - HRESULT hr=S_OK; + int hr=S_OK; return hr; } //----------------------------------------------------------------------------- -HRESULT CXuiCtrlCraftIngredientSlot::OnCustomMessage_GetSlotItem(CustomMessage_GetSlotItem_Struct *pData, BOOL& bHandled) +int CXuiCtrlCraftIngredientSlot::OnCustomMessage_GetSlotItem(CustomMessage_GetSlotItem_Struct *pData, bool& bHandled) { if( m_iID != 0 || m_item != NULL ) { @@ -47,7 +47,7 @@ HRESULT CXuiCtrlCraftIngredientSlot::OnCustomMessage_GetSlotItem(CustomMessage_G return S_OK; } -HRESULT CXuiCtrlCraftIngredientSlot::OnGetSourceText(XUIMessageGetSourceText *pGetSourceTextData,BOOL& bHandled) +int CXuiCtrlCraftIngredientSlot::OnGetSourceText(XUIMessageGetSourceText *pGetSourceTextData,bool& bHandled) { pGetSourceTextData->szText=m_Desc; bHandled = true; @@ -55,9 +55,9 @@ HRESULT CXuiCtrlCraftIngredientSlot::OnGetSourceText(XUIMessageGetSourceText *pG return S_OK; } -void CXuiCtrlCraftIngredientSlot::SetRedBox(BOOL bVal) +void CXuiCtrlCraftIngredientSlot::SetRedBox(bool bVal) { - HRESULT hr=S_OK; + int hr=S_OK; HXUIOBJ hObj,hObjChild; hr=GetVisual(&hObj); @@ -67,7 +67,7 @@ void CXuiCtrlCraftIngredientSlot::SetRedBox(BOOL bVal) XuiElementSetShow(hObjChild,bVal); } -void CXuiCtrlCraftIngredientSlot::SetIcon(int iPad, int iId,int iAuxVal, int iCount, int iScale, unsigned int uiAlpha,bool bDecorations,bool isFoil, BOOL bShow) +void CXuiCtrlCraftIngredientSlot::SetIcon(int iPad, int iId,int iAuxVal, int iCount, int iScale, unsigned int uiAlpha,bool bDecorations,bool isFoil, bool bShow) { m_item = nullptr; m_iID=iId; @@ -92,7 +92,7 @@ void CXuiCtrlCraftIngredientSlot::SetIcon(int iPad, int iId,int iAuxVal, int iCo XuiElementSetShow(m_hObj,bShow); } -void CXuiCtrlCraftIngredientSlot::SetIcon(int iPad, shared_ptr item, int iScale, unsigned int uiAlpha,bool bDecorations, BOOL bShow) +void CXuiCtrlCraftIngredientSlot::SetIcon(int iPad, shared_ptr item, int iScale, unsigned int uiAlpha,bool bDecorations, bool bShow) { if(item == NULL) SetIcon(iPad, 0,0,0,0,0,false,false,bShow); else @@ -110,9 +110,9 @@ void CXuiCtrlCraftIngredientSlot::SetIcon(int iPad, shared_ptr ite } } -void CXuiCtrlCraftIngredientSlot::SetDescription(LPCWSTR Desc) +void CXuiCtrlCraftIngredientSlot::SetDescription(const wchar_t* Desc) { - HRESULT hr=S_OK; + int hr=S_OK; HXUIOBJ hObj,hObjChild; hr=GetVisual(&hObj); diff --git a/src/client/Common/XUI/XUI_Ctrl_CraftIngredientSlot.h b/src/client/Common/XUI/XUI_Ctrl_CraftIngredientSlot.h index 346a0904..dd945300 100644 --- a/src/client/Common/XUI/XUI_Ctrl_CraftIngredientSlot.h +++ b/src/client/Common/XUI/XUI_Ctrl_CraftIngredientSlot.h @@ -14,10 +14,10 @@ public: CXuiCtrlCraftIngredientSlot(); virtual ~CXuiCtrlCraftIngredientSlot() { }; - void SetRedBox(BOOL bVal); - void SetIcon(int iPad, int iId,int iAuxVal, int iCount, int iScale, unsigned int uiAlpha, bool bDecorations, bool isFoil = false, BOOL bShow=true); - void SetIcon(int iPad, shared_ptr item, int iScale, unsigned int uiAlpha,bool bDecorations, BOOL bShow=true); - void SetDescription(LPCWSTR Desc); + void SetRedBox(bool bVal); + void SetIcon(int iPad, int iId,int iAuxVal, int iCount, int iScale, unsigned int uiAlpha, bool bDecorations, bool isFoil = false, bool bShow=true); + void SetIcon(int iPad, shared_ptr item, int iScale, unsigned int uiAlpha,bool bDecorations, bool bShow=true); + void SetDescription(const wchar_t* Desc); protected: XUI_BEGIN_MSG_MAP() @@ -26,9 +26,9 @@ protected: XUI_ON_XM_GET_SOURCE_TEXT(OnGetSourceText) XUI_END_MSG_MAP() - HRESULT OnCustomMessage_GetSlotItem(CustomMessage_GetSlotItem_Struct *pData, BOOL& bHandled); - HRESULT OnGetSourceText(XUIMessageGetSourceText *pGetSourceTextData, BOOL& bHandled); - HRESULT OnInit(XUIMessageInit* pInitData, BOOL& rfHandled); + int OnCustomMessage_GetSlotItem(CustomMessage_GetSlotItem_Struct *pData, bool& bHandled); + int OnGetSourceText(XUIMessageGetSourceText *pGetSourceTextData, bool& bHandled); + int OnInit(XUIMessageInit* pInitData, bool& rfHandled); private: shared_ptr m_item; @@ -40,6 +40,6 @@ private: int m_iPad; bool m_bDecorations; bool m_isFoil; - LPCWSTR m_Desc; + const wchar_t* m_Desc; bool m_isDirty; }; \ No newline at end of file diff --git a/src/client/Common/XUI/XUI_Ctrl_EnchantButton.cpp b/src/client/Common/XUI/XUI_Ctrl_EnchantButton.cpp index 23f41664..633407c5 100644 --- a/src/client/Common/XUI/XUI_Ctrl_EnchantButton.cpp +++ b/src/client/Common/XUI/XUI_Ctrl_EnchantButton.cpp @@ -8,9 +8,9 @@ #include "XUI_Ctrl_EnchantButton.h" //----------------------------------------------------------------------------- -HRESULT CXuiCtrlEnchantmentButton::OnInit(XUIMessageInit* pInitData, BOOL& rfHandled) +int CXuiCtrlEnchantmentButton::OnInit(XUIMessageInit* pInitData, bool& rfHandled) { - HRESULT hr=S_OK; + int hr=S_OK; Minecraft *pMinecraft=Minecraft::GetInstance(); @@ -32,7 +32,7 @@ HRESULT CXuiCtrlEnchantmentButton::OnInit(XUIMessageInit* pInitData, BOOL& rfHan assert( parent != NULL ); - VOID *pObj; + void *pObj; XuiObjectFromHandle( parent, &pObj ); m_containerScene = (CXuiSceneEnchant *)pObj; @@ -50,7 +50,7 @@ void CXuiCtrlEnchantmentButton::SetData(int iPad, int index) m_index = index; } -HRESULT CXuiCtrlEnchantmentButton::OnGetSourceDataText(XUIMessageGetSourceText *pGetSourceTextData, BOOL& bHandled) +int CXuiCtrlEnchantmentButton::OnGetSourceDataText(XUIMessageGetSourceText *pGetSourceTextData, bool& bHandled) { EnchantmentMenu *menu = m_containerScene->getMenu(); diff --git a/src/client/Common/XUI/XUI_Ctrl_EnchantButton.h b/src/client/Common/XUI/XUI_Ctrl_EnchantButton.h index 0b414d69..81dec70b 100644 --- a/src/client/Common/XUI/XUI_Ctrl_EnchantButton.h +++ b/src/client/Common/XUI/XUI_Ctrl_EnchantButton.h @@ -15,8 +15,8 @@ protected: XUI_ON_XM_GET_SOURCE_TEXT(OnGetSourceDataText) XUI_END_MSG_MAP() - HRESULT OnInit(XUIMessageInit* pInitData, BOOL& rfHandled); - HRESULT OnGetSourceDataText(XUIMessageGetSourceText *pGetSourceTextData, BOOL& bHandled); + int OnInit(XUIMessageInit* pInitData, bool& rfHandled); + int OnGetSourceDataText(XUIMessageGetSourceText *pGetSourceTextData, bool& bHandled); public: void SetData(int iPad, int index); diff --git a/src/client/Common/XUI/XUI_Ctrl_EnchantmentBook.cpp b/src/client/Common/XUI/XUI_Ctrl_EnchantmentBook.cpp index 0a9834a9..620c6c23 100644 --- a/src/client/Common/XUI/XUI_Ctrl_EnchantmentBook.cpp +++ b/src/client/Common/XUI/XUI_Ctrl_EnchantmentBook.cpp @@ -48,9 +48,9 @@ CXuiCtrlEnchantmentBook::~CXuiCtrlEnchantmentBook() } //----------------------------------------------------------------------------- -HRESULT CXuiCtrlEnchantmentBook::OnInit(XUIMessageInit* pInitData, BOOL& rfHandled) +int CXuiCtrlEnchantmentBook::OnInit(XUIMessageInit* pInitData, bool& rfHandled) { - HRESULT hr=S_OK; + int hr=S_OK; HXUIOBJ parent = m_hObj; HXUICLASS hcInventoryClass = XuiFindClass( L"CXuiSceneEnchant" ); @@ -64,7 +64,7 @@ HRESULT CXuiCtrlEnchantmentBook::OnInit(XUIMessageInit* pInitData, BOOL& rfHandl assert( parent != NULL ); - VOID *pObj; + void *pObj; XuiObjectFromHandle( parent, &pObj ); m_containerScene = (CXuiSceneEnchant *)pObj; @@ -75,7 +75,7 @@ HRESULT CXuiCtrlEnchantmentBook::OnInit(XUIMessageInit* pInitData, BOOL& rfHandl return hr; } -HRESULT CXuiCtrlEnchantmentBook::OnRender(XUIMessageRender *pRenderData, BOOL &bHandled ) +int CXuiCtrlEnchantmentBook::OnRender(XUIMessageRender *pRenderData, bool &bHandled ) { #ifdef _XBOX HXUIDC hDC = pRenderData->hDC; @@ -198,7 +198,7 @@ HRESULT CXuiCtrlEnchantmentBook::OnRender(XUIMessageRender *pRenderData, BOOL &b return S_OK; } -//HRESULT CXuiCtrlEnchantmentBook::OnRender(XUIMessageRender *pRenderData, BOOL &bHandled ) +//int CXuiCtrlEnchantmentBook::OnRender(XUIMessageRender *pRenderData, bool &bHandled ) //{ // HXUIDC hDC = pRenderData->hDC; // diff --git a/src/client/Common/XUI/XUI_Ctrl_EnchantmentBook.h b/src/client/Common/XUI/XUI_Ctrl_EnchantmentBook.h index 34aed731..19d7e512 100644 --- a/src/client/Common/XUI/XUI_Ctrl_EnchantmentBook.h +++ b/src/client/Common/XUI/XUI_Ctrl_EnchantmentBook.h @@ -26,8 +26,8 @@ protected: XUI_ON_XM_RENDER(OnRender) XUI_END_MSG_MAP() - HRESULT OnInit(XUIMessageInit* pInitData, BOOL& rfHandled); - HRESULT OnRender(XUIMessageRender *pRenderData, BOOL &rfHandled); + int OnInit(XUIMessageInit* pInitData, bool& rfHandled); + int OnRender(XUIMessageRender *pRenderData, bool &rfHandled); private: BookModel *model; @@ -38,7 +38,7 @@ private: float flip, oFlip, flipT, flipA; float open, oOpen; - BOOL m_bDirty; + bool m_bDirty; float m_fScale,m_fAlpha; int m_iPad; CXuiSceneEnchant *m_containerScene; diff --git a/src/client/Common/XUI/XUI_Ctrl_EnchantmentButtonText.cpp b/src/client/Common/XUI/XUI_Ctrl_EnchantmentButtonText.cpp index c1ecf4a7..258f0e16 100644 --- a/src/client/Common/XUI/XUI_Ctrl_EnchantmentButtonText.cpp +++ b/src/client/Common/XUI/XUI_Ctrl_EnchantmentButtonText.cpp @@ -18,9 +18,9 @@ #include //----------------------------------------------------------------------------- -HRESULT CXuiCtrlEnchantmentButtonText::OnInit(XUIMessageInit* pInitData, BOOL& rfHandled) +int CXuiCtrlEnchantmentButtonText::OnInit(XUIMessageInit* pInitData, bool& rfHandled) { - HRESULT hr=S_OK; + int hr=S_OK; Minecraft *pMinecraft=Minecraft::GetInstance(); @@ -42,7 +42,7 @@ HRESULT CXuiCtrlEnchantmentButtonText::OnInit(XUIMessageInit* pInitData, BOOL& r assert( parent != NULL ); - VOID *pObj; + void *pObj; XuiObjectFromHandle( parent, &pObj ); m_parentControl = (CXuiCtrlEnchantmentButton *)pObj; @@ -56,7 +56,7 @@ HRESULT CXuiCtrlEnchantmentButtonText::OnInit(XUIMessageInit* pInitData, BOOL& r return hr; } -HRESULT CXuiCtrlEnchantmentButtonText::OnRender(XUIMessageRender *pRenderData, BOOL &bHandled ) +int CXuiCtrlEnchantmentButtonText::OnRender(XUIMessageRender *pRenderData, bool &bHandled ) { HXUIDC hDC = pRenderData->hDC; CXuiControl xuiControl(m_hObj); diff --git a/src/client/Common/XUI/XUI_Ctrl_EnchantmentButtonText.h b/src/client/Common/XUI/XUI_Ctrl_EnchantmentButtonText.h index c28b29ed..d28a4231 100644 --- a/src/client/Common/XUI/XUI_Ctrl_EnchantmentButtonText.h +++ b/src/client/Common/XUI/XUI_Ctrl_EnchantmentButtonText.h @@ -14,8 +14,8 @@ protected: XUI_ON_XM_RENDER(OnRender) XUI_END_MSG_MAP() - HRESULT OnInit(XUIMessageInit* pInitData, BOOL& rfHandled); - HRESULT OnRender(XUIMessageRender *pRenderData, BOOL &rfHandled); + int OnInit(XUIMessageInit* pInitData, bool& rfHandled); + int OnRender(XUIMessageRender *pRenderData, bool &rfHandled); private: CXuiCtrlEnchantmentButton *m_parentControl; diff --git a/src/client/Common/XUI/XUI_Ctrl_MinecraftPlayer.cpp b/src/client/Common/XUI/XUI_Ctrl_MinecraftPlayer.cpp index 1e0dcfcd..f59b8e8e 100644 --- a/src/client/Common/XUI/XUI_Ctrl_MinecraftPlayer.cpp +++ b/src/client/Common/XUI/XUI_Ctrl_MinecraftPlayer.cpp @@ -29,9 +29,9 @@ CXuiCtrlMinecraftPlayer::CXuiCtrlMinecraftPlayer() : } //----------------------------------------------------------------------------- -HRESULT CXuiCtrlMinecraftPlayer::OnInit(XUIMessageInit* pInitData, BOOL& rfHandled) +int CXuiCtrlMinecraftPlayer::OnInit(XUIMessageInit* pInitData, bool& rfHandled) { - HRESULT hr=S_OK; + int hr=S_OK; HXUIOBJ parent = m_hObj; HXUICLASS hcInventoryClass = XuiFindClass( L"CXuiSceneInventory" ); @@ -45,7 +45,7 @@ HRESULT CXuiCtrlMinecraftPlayer::OnInit(XUIMessageInit* pInitData, BOOL& rfHandl assert( parent != NULL ); - VOID *pObj; + void *pObj; XuiObjectFromHandle( parent, &pObj ); m_containerScene = (CXuiSceneInventory *)pObj; @@ -54,7 +54,7 @@ HRESULT CXuiCtrlMinecraftPlayer::OnInit(XUIMessageInit* pInitData, BOOL& rfHandl return hr; } -HRESULT CXuiCtrlMinecraftPlayer::OnRender(XUIMessageRender *pRenderData, BOOL &bHandled ) +int CXuiCtrlMinecraftPlayer::OnRender(XUIMessageRender *pRenderData, bool &bHandled ) { #ifdef _XBOX HXUIDC hDC = pRenderData->hDC; diff --git a/src/client/Common/XUI/XUI_Ctrl_MinecraftPlayer.h b/src/client/Common/XUI/XUI_Ctrl_MinecraftPlayer.h index fa28d6b8..9f96bea1 100644 --- a/src/client/Common/XUI/XUI_Ctrl_MinecraftPlayer.h +++ b/src/client/Common/XUI/XUI_Ctrl_MinecraftPlayer.h @@ -27,11 +27,11 @@ protected: XUI_ON_XM_RENDER(OnRender) XUI_END_MSG_MAP() - HRESULT OnInit(XUIMessageInit* pInitData, BOOL& rfHandled); - HRESULT OnRender(XUIMessageRender *pRenderData, BOOL &rfHandled); + int OnInit(XUIMessageInit* pInitData, bool& rfHandled); + int OnRender(XUIMessageRender *pRenderData, bool &rfHandled); private: - BOOL m_bDirty; + bool m_bDirty; float m_fScale,m_fAlpha; int m_iPad; CXuiSceneInventory *m_containerScene; diff --git a/src/client/Common/XUI/XUI_Ctrl_MinecraftSkinPreview.cpp b/src/client/Common/XUI/XUI_Ctrl_MinecraftSkinPreview.cpp index 02136175..f8e83671 100644 --- a/src/client/Common/XUI/XUI_Ctrl_MinecraftSkinPreview.cpp +++ b/src/client/Common/XUI/XUI_Ctrl_MinecraftSkinPreview.cpp @@ -67,9 +67,9 @@ CXuiCtrlMinecraftSkinPreview::CXuiCtrlMinecraftSkinPreview() : } //----------------------------------------------------------------------------- -HRESULT CXuiCtrlMinecraftSkinPreview::OnInit(XUIMessageInit* pInitData, BOOL& rfHandled) +int CXuiCtrlMinecraftSkinPreview::OnInit(XUIMessageInit* pInitData, bool& rfHandled) { - HRESULT hr=S_OK; + int hr=S_OK; return hr; } @@ -151,7 +151,7 @@ void CXuiCtrlMinecraftSkinPreview::CyclePreviousAnimation() m_swingTime = 0.0f; } -HRESULT CXuiCtrlMinecraftSkinPreview::OnRender(XUIMessageRender *pRenderData, BOOL &bHandled ) +int CXuiCtrlMinecraftSkinPreview::OnRender(XUIMessageRender *pRenderData, bool &bHandled ) { if( m_bAnimatingToFacing ) { diff --git a/src/client/Common/XUI/XUI_Ctrl_MinecraftSkinPreview.h b/src/client/Common/XUI/XUI_Ctrl_MinecraftSkinPreview.h index fd6e0e90..46fd95c4 100644 --- a/src/client/Common/XUI/XUI_Ctrl_MinecraftSkinPreview.h +++ b/src/client/Common/XUI/XUI_Ctrl_MinecraftSkinPreview.h @@ -65,15 +65,15 @@ protected: XUI_ON_XM_RENDER(OnRender) XUI_END_MSG_MAP() - HRESULT OnInit(XUIMessageInit* pInitData, BOOL& rfHandled); - HRESULT OnRender(XUIMessageRender *pRenderData, BOOL &rfHandled); + int OnInit(XUIMessageInit* pInitData, bool& rfHandled); + int OnRender(XUIMessageRender *pRenderData, bool &rfHandled); private: void render(EntityRenderer *renderer, double x, double y, double z, float rot, float a); bool bindTexture(const wstring& urlTexture, int backupTexture); bool bindTexture(const wstring& urlTexture, const wstring& backupTexture); - BOOL m_bDirty; + bool m_bDirty; float m_fScale,m_fAlpha; wstring m_customTextureUrl; @@ -93,7 +93,7 @@ private: float m_walkAnimPos; bool m_bAutoRotate, m_bRotatingLeft; - BYTE m_rotateTick; + uint8_t m_rotateTick; float m_fTargetRotation, m_fOriginalRotation; int m_framesAnimatingRotation; bool m_bAnimatingToFacing; diff --git a/src/client/Common/XUI/XUI_Ctrl_MinecraftSlot.cpp b/src/client/Common/XUI/XUI_Ctrl_MinecraftSlot.cpp index 7ce8f2c5..b01a5ca4 100644 --- a/src/client/Common/XUI/XUI_Ctrl_MinecraftSlot.cpp +++ b/src/client/Common/XUI/XUI_Ctrl_MinecraftSlot.cpp @@ -17,7 +17,7 @@ // The xzp path icons for the leaderboard -LPCWSTR CXuiCtrlMinecraftSlot::xzpIcons[15]= +const wchar_t* CXuiCtrlMinecraftSlot::xzpIcons[15]= { L"Graphics\\Leaderboard\\LeaderBoard_Icon_Skeleton.png", L"Graphics\\Leaderboard\\LeaderBoard_Icon_Creeper.png", @@ -73,7 +73,7 @@ CXuiCtrlMinecraftSlot::~CXuiCtrlMinecraftSlot() delete m_pItemRenderer; } -VOID CXuiCtrlMinecraftSlot::SetPassThroughDataAssociation(unsigned int iID, unsigned int iData) +void CXuiCtrlMinecraftSlot::SetPassThroughDataAssociation(unsigned int iID, unsigned int iData) { m_item = nullptr; m_iPassThroughIdAssociation = iID; @@ -81,11 +81,11 @@ VOID CXuiCtrlMinecraftSlot::SetPassThroughDataAssociation(unsigned int iID, unsi } //----------------------------------------------------------------------------- -HRESULT CXuiCtrlMinecraftSlot::OnGetSourceImage(XUIMessageGetSourceImage* pData, BOOL& rfHandled) +int CXuiCtrlMinecraftSlot::OnGetSourceImage(XUIMessageGetSourceImage* pData, bool& rfHandled) { XUIMessage Message; CustomMessage_GetSlotItem_Struct MsgGetSlotItem; - HRESULT hr; + int hr; HXUIOBJ hObj; CustomMessage_GetSlotItem(&Message, &MsgGetSlotItem, m_iPassThroughIdAssociation, m_iPassThroughDataAssociation); @@ -165,21 +165,21 @@ HRESULT CXuiCtrlMinecraftSlot::OnGetSourceImage(XUIMessageGetSourceImage* pData, } //----------------------------------------------------------------------------- -HRESULT CXuiCtrlMinecraftSlot::OnInit(XUIMessageInit* pInitData, BOOL& rfHandled) +int CXuiCtrlMinecraftSlot::OnInit(XUIMessageInit* pInitData, bool& rfHandled) { - //DWORD dwPropId; - HRESULT hr=S_OK; + //unsigned long dwPropId; + int hr=S_OK; return hr; } //----------------------------------------------------------------------------- -HRESULT CXuiCtrlMinecraftSlot::OnRender(XUIMessageRender *pRenderData, BOOL &bHandled ) +int CXuiCtrlMinecraftSlot::OnRender(XUIMessageRender *pRenderData, bool &bHandled ) { // Force an update of the id XUIMessage Message; XUIMessageGetSourceImage MsgGetImage; - HRESULT hr; + int hr; XuiMessageGetSourceImage(&Message, &MsgGetImage, m_iPassThroughIdAssociation, m_iPassThroughDataAssociation, false); hr = XuiSendMessage(m_hObj, &Message); @@ -309,7 +309,7 @@ HRESULT CXuiCtrlMinecraftSlot::OnRender(XUIMessageRender *pRenderData, BOOL &bHa } -void CXuiCtrlMinecraftSlot::SetIcon(int iPad, int iId,int iAuxVal, int iCount, int iScale, unsigned int uiAlpha,bool bDecorations,BOOL bShow, bool isFoil) +void CXuiCtrlMinecraftSlot::SetIcon(int iPad, int iId,int iAuxVal, int iCount, int iScale, unsigned int uiAlpha,bool bDecorations,bool bShow, bool isFoil) { m_item = nullptr; m_iID=iId; @@ -343,7 +343,7 @@ void CXuiCtrlMinecraftSlot::SetIcon(int iPad, int iId,int iAuxVal, int iCount, i XuiElementSetShow(m_hObj,bShow); } -void CXuiCtrlMinecraftSlot::SetIcon(int iPad, shared_ptr item, int iScale, unsigned int uiAlpha,bool bDecorations, BOOL bShow) +void CXuiCtrlMinecraftSlot::SetIcon(int iPad, shared_ptr item, int iScale, unsigned int uiAlpha,bool bDecorations, bool bShow) { m_item = item; m_isFoil = item->isFoil(); diff --git a/src/client/Common/XUI/XUI_Ctrl_MinecraftSlot.h b/src/client/Common/XUI/XUI_Ctrl_MinecraftSlot.h index a33fd867..f78101ce 100644 --- a/src/client/Common/XUI/XUI_Ctrl_MinecraftSlot.h +++ b/src/client/Common/XUI/XUI_Ctrl_MinecraftSlot.h @@ -16,14 +16,14 @@ class CXuiCtrlMinecraftSlot : public CXuiControlImpl public: XUI_IMPLEMENT_CLASS(CXuiCtrlMinecraftSlot, L"CXuiCtrlMinecraftSlot", XUI_CLASS_LABEL) - VOID SetPassThroughDataAssociation(unsigned int iID, unsigned int iData); + void SetPassThroughDataAssociation(unsigned int iID, unsigned int iData); CXuiCtrlMinecraftSlot(); virtual ~CXuiCtrlMinecraftSlot(); void renderGuiItem(Font *font, Textures *textures,ItemInstance *item, int x, int y); void RenderItem(); - void SetIcon(int iPad, int iId,int iAuxVal, int iCount, int iScale, unsigned int uiAlpha,bool bDecorations,BOOL bShow, bool isFoil); - void SetIcon(int iPad, shared_ptr item, int iScale, unsigned int uiAlpha,bool bDecorations, BOOL bShow=true); + void SetIcon(int iPad, int iId,int iAuxVal, int iCount, int iScale, unsigned int uiAlpha,bool bDecorations,bool bShow, bool isFoil); + void SetIcon(int iPad, shared_ptr item, int iScale, unsigned int uiAlpha,bool bDecorations, bool bShow=true); protected: @@ -33,15 +33,15 @@ protected: XUI_ON_XM_RENDER(OnRender) XUI_END_MSG_MAP() - HRESULT OnGetSourceImage(XUIMessageGetSourceImage* pData, BOOL& rfHandled); - HRESULT OnInit(XUIMessageInit* pInitData, BOOL& rfHandled); - HRESULT OnRender(XUIMessageRender *pRenderData, BOOL &rfHandled); + int OnGetSourceImage(XUIMessageGetSourceImage* pData, bool& rfHandled); + int OnInit(XUIMessageInit* pInitData, bool& rfHandled); + int OnRender(XUIMessageRender *pRenderData, bool &rfHandled); private: shared_ptr m_item; - BOOL m_bDirty; - INT m_iPassThroughDataAssociation; - INT m_iPassThroughIdAssociation; + bool m_bDirty; + int m_iPassThroughDataAssociation; + int m_iPassThroughIdAssociation; float m_fScale,m_fAlpha; int m_iPad; int m_iID; @@ -55,5 +55,5 @@ private: float m_fScreenWidth,m_fScreenHeight; ItemRenderer *m_pItemRenderer; - static LPCWSTR xzpIcons[15]; + static const wchar_t* xzpIcons[15]; }; \ No newline at end of file diff --git a/src/client/Common/XUI/XUI_Ctrl_MobEffect.cpp b/src/client/Common/XUI/XUI_Ctrl_MobEffect.cpp index 62a8457c..d8f1ee8d 100644 --- a/src/client/Common/XUI/XUI_Ctrl_MobEffect.cpp +++ b/src/client/Common/XUI/XUI_Ctrl_MobEffect.cpp @@ -1,7 +1,7 @@ #include "stdafx.h" #include "XUI_Ctrl_MobEffect.h" -LPCWSTR CXuiCtrlMobEffect::iconFrameNames[MobEffect::e_MobEffectIcon_COUNT]= +const wchar_t* CXuiCtrlMobEffect::iconFrameNames[MobEffect::e_MobEffectIcon_COUNT]= { L"Normal", L"Blindness", @@ -23,7 +23,7 @@ LPCWSTR CXuiCtrlMobEffect::iconFrameNames[MobEffect::e_MobEffectIcon_COUNT]= L"Weakness", }; -HRESULT CXuiCtrlMobEffect::OnInit(XUIMessageInit* pInitData, BOOL& rfHandled) +int CXuiCtrlMobEffect::OnInit(XUIMessageInit* pInitData, bool& rfHandled) { m_icon = MobEffect::e_MobEffectIcon_None; m_name = L""; @@ -31,7 +31,7 @@ HRESULT CXuiCtrlMobEffect::OnInit(XUIMessageInit* pInitData, BOOL& rfHandled) return S_OK; } -HRESULT CXuiCtrlMobEffect::OnGetSourceDataText(XUIMessageGetSourceText *pGetSourceTextData, BOOL& bHandled) +int CXuiCtrlMobEffect::OnGetSourceDataText(XUIMessageGetSourceText *pGetSourceTextData, bool& bHandled) { if( pGetSourceTextData->iData == 1 ) { diff --git a/src/client/Common/XUI/XUI_Ctrl_MobEffect.h b/src/client/Common/XUI/XUI_Ctrl_MobEffect.h index 181b1e9d..8cadd4ab 100644 --- a/src/client/Common/XUI/XUI_Ctrl_MobEffect.h +++ b/src/client/Common/XUI/XUI_Ctrl_MobEffect.h @@ -14,8 +14,8 @@ protected: XUI_ON_XM_GET_SOURCE_TEXT(OnGetSourceDataText) XUI_END_MSG_MAP() - HRESULT OnInit(XUIMessageInit* pInitData, BOOL& rfHandled); - HRESULT OnGetSourceDataText(XUIMessageGetSourceText *pGetSourceTextData, BOOL& bHandled); + int OnInit(XUIMessageInit* pInitData, bool& rfHandled); + int OnGetSourceDataText(XUIMessageGetSourceText *pGetSourceTextData, bool& bHandled); public: void setIcon(MobEffect::EMobEffectIcon icon); @@ -27,5 +27,5 @@ private: wstring m_name; wstring m_duration; - static LPCWSTR iconFrameNames[MobEffect::e_MobEffectIcon_COUNT]; + static const wchar_t* iconFrameNames[MobEffect::e_MobEffectIcon_COUNT]; }; \ No newline at end of file diff --git a/src/client/Common/XUI/XUI_Ctrl_PassThroughList.cpp b/src/client/Common/XUI/XUI_Ctrl_PassThroughList.cpp index 5bd7191d..4e92abd8 100644 --- a/src/client/Common/XUI/XUI_Ctrl_PassThroughList.cpp +++ b/src/client/Common/XUI/XUI_Ctrl_PassThroughList.cpp @@ -1,16 +1,16 @@ #include "stdafx.h" #include "XUI_Ctrl_PassThroughList.h" -HRESULT CXuiCtrlPassThroughList::OnInit(XUIMessageInit *pInitData, BOOL& bHandled) +int CXuiCtrlPassThroughList::OnInit(XUIMessageInit *pInitData, bool& bHandled) { return S_OK; } -HRESULT CXuiCtrlPassThroughList::OnKeyDown(XUIMessageInput* pInputData, BOOL& bHandled) +int CXuiCtrlPassThroughList::OnKeyDown(XUIMessageInput* pInputData, bool& bHandled) { XUIMessage message; XUIMessageInput messageInput; - HRESULT hr; + int hr; HXUIOBJ hObj; XuiMessageInput( &message, &messageInput, XUI_KEYDOWN, pInputData->dwKeyCode, pInputData->wch, pInputData->dwFlags, pInputData->UserIndex ); @@ -31,11 +31,11 @@ HRESULT CXuiCtrlPassThroughList::OnKeyDown(XUIMessageInput* pInputData, BOOL& bH } // Gets called every frame -HRESULT CXuiCtrlPassThroughList::OnGetSourceDataText(XUIMessageGetSourceText *pGetSourceTextData,BOOL& bHandled) +int CXuiCtrlPassThroughList::OnGetSourceDataText(XUIMessageGetSourceText *pGetSourceTextData,bool& bHandled) { XUIMessage Message; XUIMessageGetSourceText MsgGetText; - HRESULT hr; + int hr; HXUIOBJ hObj; @@ -57,11 +57,11 @@ HRESULT CXuiCtrlPassThroughList::OnGetSourceDataText(XUIMessageGetSourceText *pG } // Gets called every frame -HRESULT CXuiCtrlPassThroughList::OnGetSourceDataImage(XUIMessageGetSourceImage *pGetSourceImageData,BOOL& bHandled) +int CXuiCtrlPassThroughList::OnGetSourceDataImage(XUIMessageGetSourceImage *pGetSourceImageData,bool& bHandled) { XUIMessage Message; XUIMessageGetSourceImage MsgGetImage; - HRESULT hr; + int hr; HXUIOBJ hObj; @@ -82,11 +82,11 @@ HRESULT CXuiCtrlPassThroughList::OnGetSourceDataImage(XUIMessageGetSourceImage * return S_OK; } -HRESULT CXuiCtrlPassThroughList::OnGetItemCountAll(XUIMessageGetItemCount *pGetItemCountData,BOOL& bHandled) +int CXuiCtrlPassThroughList::OnGetItemCountAll(XUIMessageGetItemCount *pGetItemCountData,bool& bHandled) { XUIMessage Message; XUIMessageGetItemCount MsgGetItemCountAll; - HRESULT hr; + int hr; HXUIOBJ hObj; diff --git a/src/client/Common/XUI/XUI_Ctrl_PassthroughList.h b/src/client/Common/XUI/XUI_Ctrl_PassthroughList.h index 9e2c1bdf..fa81cfb5 100644 --- a/src/client/Common/XUI/XUI_Ctrl_PassthroughList.h +++ b/src/client/Common/XUI/XUI_Ctrl_PassthroughList.h @@ -18,11 +18,11 @@ protected: XUI_END_MSG_MAP() - HRESULT OnInit( XUIMessageInit* pInitData, BOOL& bHandled ); - HRESULT OnKeyDown(XUIMessageInput* pInputData, BOOL& bHandled); - HRESULT OnGetSourceDataText(XUIMessageGetSourceText *pGetSourceTextData, BOOL& bHandled); - HRESULT OnGetSourceDataImage(XUIMessageGetSourceImage *pGetSourceImageData,BOOL& bHandled); - HRESULT OnGetItemCountAll(XUIMessageGetItemCount *pGetItemCountData, BOOL& bHandled); + int OnInit( XUIMessageInit* pInitData, bool& bHandled ); + int OnKeyDown(XUIMessageInput* pInputData, bool& bHandled); + int OnGetSourceDataText(XUIMessageGetSourceText *pGetSourceTextData, bool& bHandled); + int OnGetSourceDataImage(XUIMessageGetSourceImage *pGetSourceImageData,bool& bHandled); + int OnGetItemCountAll(XUIMessageGetItemCount *pGetItemCountData, bool& bHandled); }; diff --git a/src/client/Common/XUI/XUI_Ctrl_ProgressCtrlBase.cpp b/src/client/Common/XUI/XUI_Ctrl_ProgressCtrlBase.cpp index b06ec049..4358ff70 100644 --- a/src/client/Common/XUI/XUI_Ctrl_ProgressCtrlBase.cpp +++ b/src/client/Common/XUI/XUI_Ctrl_ProgressCtrlBase.cpp @@ -2,7 +2,7 @@ #include "XUI_Ctrl_ProgressCtrlBase.h" -HRESULT CXuiCtrlProgressCtrlBase::OnGetSourceDataText(XUIMessageGetSourceText *pGetSourceTextData, BOOL& bHandled) +int CXuiCtrlProgressCtrlBase::OnGetSourceDataText(XUIMessageGetSourceText *pGetSourceTextData, bool& bHandled) { // The Xui backend calls GetSourceDataText every frame to get the text for the indexed label // We don't want to change the label, but take this opportunity to send out a message to ourself diff --git a/src/client/Common/XUI/XUI_Ctrl_ProgressCtrlBase.h b/src/client/Common/XUI/XUI_Ctrl_ProgressCtrlBase.h index 7a4302d3..a2d28cc5 100644 --- a/src/client/Common/XUI/XUI_Ctrl_ProgressCtrlBase.h +++ b/src/client/Common/XUI/XUI_Ctrl_ProgressCtrlBase.h @@ -3,7 +3,7 @@ class CXuiCtrlProgressCtrlBase : public CXuiProgressBar, public CXuiElementImplBase { public: - HRESULT OnGetSourceDataText(XUIMessageGetSourceText *pGetSourceTextData, BOOL& bHandled); + int OnGetSourceDataText(XUIMessageGetSourceText *pGetSourceTextData, bool& bHandled); // Override these in the derived classes to return the values to be displayed on the control virtual int GetValue() = 0; diff --git a/src/client/Common/XUI/XUI_Ctrl_SliderWrapper.cpp b/src/client/Common/XUI/XUI_Ctrl_SliderWrapper.cpp index 8e84272e..b53a189d 100644 --- a/src/client/Common/XUI/XUI_Ctrl_SliderWrapper.cpp +++ b/src/client/Common/XUI/XUI_Ctrl_SliderWrapper.cpp @@ -3,9 +3,9 @@ #define NO_SOUND_TIMER 0 -HRESULT CXuiCtrlSliderWrapper::OnInit( XUIMessageInit* pInitData, BOOL& bHandled ) +int CXuiCtrlSliderWrapper::OnInit( XUIMessageInit* pInitData, bool& bHandled ) { - VOID *pObj; + void *pObj; HXUIOBJ hObjChild; XuiElementGetChildById(m_hObj,L"FocusSink",&hObjChild); @@ -24,7 +24,7 @@ HRESULT CXuiCtrlSliderWrapper::OnInit( XUIMessageInit* pInitData, BOOL& bHandled return S_OK; } -HRESULT CXuiCtrlSliderWrapper::OnKeyDown(XUIMessageInput* pInputData, BOOL& rfHandled) +int CXuiCtrlSliderWrapper::OnKeyDown(XUIMessageInput* pInputData, bool& rfHandled) { ui.AnimateKeyPress(pInputData->UserIndex, pInputData->dwKeyCode); @@ -56,12 +56,12 @@ HRESULT CXuiCtrlSliderWrapper::OnKeyDown(XUIMessageInput* pInputData, BOOL& rfHa return S_OK; } -HRESULT CXuiCtrlSliderWrapper::OnNotifyValueChanged (HXUIOBJ hObjSource, XUINotifyValueChanged* pValueChangedData, BOOL& rfHandled) +int CXuiCtrlSliderWrapper::OnNotifyValueChanged (HXUIOBJ hObjSource, XUINotifyValueChanged* pValueChangedData, bool& rfHandled) { XUIMessage Message; XUINotify Notify; XUINotifyValueChanged MsgValueChanged; - HRESULT hr; + int hr; HXUIOBJ hObj; if(m_bPlaySound) @@ -86,7 +86,7 @@ HRESULT CXuiCtrlSliderWrapper::OnNotifyValueChanged (HXUIOBJ hObjSource, XUINoti } -HRESULT CXuiCtrlSliderWrapper::OnTimer(XUIMessageTimer *pData,BOOL& rfHandled) +int CXuiCtrlSliderWrapper::OnTimer(XUIMessageTimer *pData,bool& rfHandled) { if(pData->nId==NO_SOUND_TIMER) { @@ -97,10 +97,10 @@ HRESULT CXuiCtrlSliderWrapper::OnTimer(XUIMessageTimer *pData,BOOL& rfHandled) return S_OK; } -HRESULT CXuiCtrlSliderWrapper::SetValue( int nValue ) +int CXuiCtrlSliderWrapper::SetValue( int nValue ) { CXuiCtrlSliderWrapper *pThis; - HRESULT hr = XuiObjectFromHandle(m_hObj, (void **) &pThis); + int hr = XuiObjectFromHandle(m_hObj, (void **) &pThis); if (FAILED(hr)) return hr; @@ -108,11 +108,11 @@ HRESULT CXuiCtrlSliderWrapper::SetValue( int nValue ) return S_OK; } -HRESULT CXuiCtrlSliderWrapper::SetValueDisplay( BOOL bShow ) +int CXuiCtrlSliderWrapper::SetValueDisplay( bool bShow ) { CXuiCtrlSliderWrapper *pThis; HXUIOBJ hVisual,hText; - HRESULT hr = XuiObjectFromHandle(m_hObj, (void **) &pThis); + int hr = XuiObjectFromHandle(m_hObj, (void **) &pThis); if (FAILED(hr)) return hr; @@ -127,20 +127,20 @@ HRESULT CXuiCtrlSliderWrapper::SetValueDisplay( BOOL bShow ) return S_OK; } -LPCWSTR CXuiCtrlSliderWrapper::GetText( ) +const wchar_t* CXuiCtrlSliderWrapper::GetText( ) { CXuiCtrlSliderWrapper *pThis; - HRESULT hr = XuiObjectFromHandle(m_hObj, (void **) &pThis); + int hr = XuiObjectFromHandle(m_hObj, (void **) &pThis); if (FAILED(hr)) return NULL; return pThis->m_pSlider->GetText(); //return S_OK; } -HRESULT CXuiCtrlSliderWrapper::SetText(LPCWSTR text , int iDataAssoc) +int CXuiCtrlSliderWrapper::SetText(const wchar_t* text , int iDataAssoc) { CXuiCtrlSliderWrapper *pThis; - HRESULT hr = XuiObjectFromHandle(m_hObj, (void **) &pThis); + int hr = XuiObjectFromHandle(m_hObj, (void **) &pThis); if (FAILED(hr)) return hr; @@ -157,16 +157,16 @@ HRESULT CXuiCtrlSliderWrapper::SetText(LPCWSTR text , int iDataAssoc) HXUIOBJ CXuiCtrlSliderWrapper::GetSlider() { CXuiCtrlSliderWrapper *pThis; - HRESULT hr = XuiObjectFromHandle(m_hObj, (void **) &pThis); + int hr = XuiObjectFromHandle(m_hObj, (void **) &pThis); if (FAILED(hr)) return NULL; return pThis->m_pSlider->m_hObj; } -HRESULT CXuiCtrlSliderWrapper::SetRange( int nRangeMin, int nRangeMax) +int CXuiCtrlSliderWrapper::SetRange( int nRangeMin, int nRangeMax) { CXuiCtrlSliderWrapper *pThis; - HRESULT hr = XuiObjectFromHandle(m_hObj, (void **) &pThis); + int hr = XuiObjectFromHandle(m_hObj, (void **) &pThis); if (FAILED(hr)) return hr; pThis->m_pSlider->SetRange(nRangeMin, nRangeMax); diff --git a/src/client/Common/XUI/XUI_Ctrl_SliderWrapper.h b/src/client/Common/XUI/XUI_Ctrl_SliderWrapper.h index 03659fca..539ff77b 100644 --- a/src/client/Common/XUI/XUI_Ctrl_SliderWrapper.h +++ b/src/client/Common/XUI/XUI_Ctrl_SliderWrapper.h @@ -18,21 +18,21 @@ protected: XUI_ON_XM_NOTIFY_VALUE_CHANGED(OnNotifyValueChanged) XUI_END_MSG_MAP() - HRESULT OnInit( XUIMessageInit* pInitData, BOOL& bHandled ); - HRESULT OnKeyDown(XUIMessageInput* pInputData, BOOL& rfHandled); - HRESULT OnNotifyValueChanged (HXUIOBJ hObjSource, XUINotifyValueChanged* pValueChangedData, BOOL& rfHandled); - HRESULT OnTimer(XUIMessageTimer *pData,BOOL& rfHandled); + int OnInit( XUIMessageInit* pInitData, bool& bHandled ); + int OnKeyDown(XUIMessageInput* pInputData, bool& rfHandled); + int OnNotifyValueChanged (HXUIOBJ hObjSource, XUINotifyValueChanged* pValueChangedData, bool& rfHandled); + int OnTimer(XUIMessageTimer *pData,bool& rfHandled); public: // Define the class. The class name must match the ClassOverride property // set for the scene in the UI Authoring tool. XUI_IMPLEMENT_CLASS( CXuiCtrlSliderWrapper, L"CXuiCtrlSliderWrapper", XUI_CLASS_SCENE ) - HRESULT SetValue( int nValue ); + int SetValue( int nValue ); HXUIOBJ GetSlider(); - HRESULT SetRange( int nRangeMin, int nRangeMax); - LPCWSTR GetText( ); - HRESULT SetText(LPCWSTR text, int iDataAssoc=0 ); - HRESULT SetValueDisplay( BOOL bShow ); + int SetRange( int nRangeMin, int nRangeMax); + const wchar_t* GetText( ); + int SetText(const wchar_t* text, int iDataAssoc=0 ); + int SetValueDisplay( bool bShow ); }; \ No newline at end of file diff --git a/src/client/Common/XUI/XUI_Ctrl_SlotItem.h b/src/client/Common/XUI/XUI_Ctrl_SlotItem.h index 1fad4a34..caff48a2 100644 --- a/src/client/Common/XUI/XUI_Ctrl_SlotItem.h +++ b/src/client/Common/XUI/XUI_Ctrl_SlotItem.h @@ -20,18 +20,18 @@ public: XUI_END_MSG_MAP() using CXuiCtrlSlotItemCtrlBase::OnInit; - HRESULT OnInit(XUIMessageInit* pInitData, BOOL& bHandled) { return this->OnInit( m_hObj, pInitData, bHandled ); }; + int OnInit(XUIMessageInit* pInitData, bool& bHandled) { return this->OnInit( m_hObj, pInitData, bHandled ); }; using CXuiCtrlSlotItemCtrlBase::OnDestroy; - HRESULT OnDestroy() { return this->OnDestroy( m_hObj ); }; + int OnDestroy() { return this->OnDestroy( m_hObj ); }; using CXuiCtrlSlotItemCtrlBase::OnCustomMessage_GetSlotItem; - HRESULT OnCustomMessage_GetSlotItem(CustomMessage_GetSlotItem_Struct *pData, BOOL& bHandled) { return this->OnCustomMessage_GetSlotItem( m_hObj, pData, bHandled ); }; + int OnCustomMessage_GetSlotItem(CustomMessage_GetSlotItem_Struct *pData, bool& bHandled) { return this->OnCustomMessage_GetSlotItem( m_hObj, pData, bHandled ); }; // 4J WESTY : Pointer Prototype : Added to support prototype only. using CXuiCtrlSlotItemCtrlBase::OnControlNavigate; - HRESULT OnControlNavigate(XUIMessageControlNavigate *pControlNavigateData, BOOL& bHandled) { return this->OnControlNavigate( m_hObj, pControlNavigateData, bHandled ); }; + int OnControlNavigate(XUIMessageControlNavigate *pControlNavigateData, bool& bHandled) { return this->OnControlNavigate( m_hObj, pControlNavigateData, bHandled ); }; using CXuiCtrlSlotItemCtrlBase::OnKeyDown; - HRESULT OnKeyDown(XUIMessageInput *pInputData, BOOL& bHandled) { return this->OnKeyDown( m_hObj, pInputData, bHandled ); }; + int OnKeyDown(XUIMessageInput *pInputData, bool& bHandled) { return this->OnKeyDown( m_hObj, pInputData, bHandled ); }; }; \ No newline at end of file diff --git a/src/client/Common/XUI/XUI_Ctrl_SlotItemCtrlBase.cpp b/src/client/Common/XUI/XUI_Ctrl_SlotItemCtrlBase.cpp index 1eeb8280..6964cddb 100644 --- a/src/client/Common/XUI/XUI_Ctrl_SlotItemCtrlBase.cpp +++ b/src/client/Common/XUI/XUI_Ctrl_SlotItemCtrlBase.cpp @@ -8,9 +8,9 @@ #include "XUI_Ctrl_SlotItemCtrlBase.h" -HRESULT CXuiCtrlSlotItemCtrlBase::OnInit( HXUIOBJ hObj, XUIMessageInit* pInitData, BOOL& bHandled ) +int CXuiCtrlSlotItemCtrlBase::OnInit( HXUIOBJ hObj, XUIMessageInit* pInitData, bool& bHandled ) { - HRESULT hr = S_OK; + int hr = S_OK; SlotControlUserDataContainer* pvUserData = new SlotControlUserDataContainer(); hr = XuiElementSetUserData(hObj, (void *)pvUserData ); @@ -20,9 +20,9 @@ HRESULT CXuiCtrlSlotItemCtrlBase::OnInit( HXUIOBJ hObj, XUIMessageInit* pInitDat return hr; } -HRESULT CXuiCtrlSlotItemCtrlBase::OnDestroy( HXUIOBJ hObj ) +int CXuiCtrlSlotItemCtrlBase::OnDestroy( HXUIOBJ hObj ) { - HRESULT hr = S_OK; + int hr = S_OK; void* pvUserData; hr = XuiElementGetUserData( hObj, &pvUserData ); @@ -34,7 +34,7 @@ HRESULT CXuiCtrlSlotItemCtrlBase::OnDestroy( HXUIOBJ hObj ) return hr; } -HRESULT CXuiCtrlSlotItemCtrlBase::OnCustomMessage_GetSlotItem(HXUIOBJ hObj, CustomMessage_GetSlotItem_Struct *pData, BOOL& bHandled) +int CXuiCtrlSlotItemCtrlBase::OnCustomMessage_GetSlotItem(HXUIOBJ hObj, CustomMessage_GetSlotItem_Struct *pData, bool& bHandled) { shared_ptr item = shared_ptr(); @@ -206,7 +206,7 @@ Slot *CXuiCtrlSlotItemCtrlBase::getSlot( HXUIOBJ hObj ) return pUserDataContainer->slot; } -HRESULT CXuiCtrlSlotItemCtrlBase::OnKeyDown(HXUIOBJ hObj, XUIMessageInput *pInputData, BOOL& bHandled) +int CXuiCtrlSlotItemCtrlBase::OnKeyDown(HXUIOBJ hObj, XUIMessageInput *pInputData, bool& bHandled) { if( pInputData->dwKeyCode == VK_PAD_DPAD_LEFT || pInputData->dwKeyCode == VK_PAD_DPAD_RIGHT || @@ -216,7 +216,7 @@ HRESULT CXuiCtrlSlotItemCtrlBase::OnKeyDown(HXUIOBJ hObj, XUIMessageInput *pInpu pInputData->dwKeyCode == VK_PAD_RTRIGGER) { HXUIOBJ parent; - HRESULT hr; + int hr; hr = XuiElementGetParent( hObj, &parent ); XUIMessage message; @@ -239,7 +239,7 @@ HRESULT CXuiCtrlSlotItemCtrlBase::OnKeyDown(HXUIOBJ hObj, XUIMessageInput *pInpu } // 4J WESTY : Pointer Prototype : Added to support prototype only. -HRESULT CXuiCtrlSlotItemCtrlBase::OnControlNavigate( HXUIOBJ hObj, XUIMessageControlNavigate *pControlNavigateData, BOOL& bHandled) +int CXuiCtrlSlotItemCtrlBase::OnControlNavigate( HXUIOBJ hObj, XUIMessageControlNavigate *pControlNavigateData, bool& bHandled) { // Skip default navigation behaviour when navigation is by pointer. if ( m_bSkipDefaultNavigation ) diff --git a/src/client/Common/XUI/XUI_Ctrl_SlotItemCtrlBase.h b/src/client/Common/XUI/XUI_Ctrl_SlotItemCtrlBase.h index 2fd21749..3eb14c4d 100644 --- a/src/client/Common/XUI/XUI_Ctrl_SlotItemCtrlBase.h +++ b/src/client/Common/XUI/XUI_Ctrl_SlotItemCtrlBase.h @@ -24,22 +24,22 @@ class CXuiCtrlSlotItemCtrlBase { private: // 4J WESTY : Pointer Prototype : Added to support prototype only. - BOOL m_bSkipDefaultNavigation; + bool m_bSkipDefaultNavigation; public: // We define a lot of functions as virtual. These should be implemented to call the protected version by // passing in the HXUIOBJ of the control as the first parameter. We do not have access to that normally // due to the inheritance structure - virtual HRESULT OnInit( XUIMessageInit* pInitData, BOOL& bHandled ) = 0; + virtual int OnInit( XUIMessageInit* pInitData, bool& bHandled ) = 0; - virtual HRESULT OnDestroy() = 0; + virtual int OnDestroy() = 0; - virtual HRESULT OnCustomMessage_GetSlotItem(CustomMessage_GetSlotItem_Struct *pData, BOOL& bHandled) = 0; + virtual int OnCustomMessage_GetSlotItem(CustomMessage_GetSlotItem_Struct *pData, bool& bHandled) = 0; // 4J WESTY : Pointer Prototype : Added to support prototype only. - virtual HRESULT OnControlNavigate(XUIMessageControlNavigate *pControlNavigateData, BOOL& bHandled) = 0; + virtual int OnControlNavigate(XUIMessageControlNavigate *pControlNavigateData, bool& bHandled) = 0; - virtual HRESULT OnKeyDown(XUIMessageInput *pInputData, BOOL& bHandled) = 0; + virtual int OnKeyDown(XUIMessageInput *pInputData, bool& bHandled) = 0; void SetSlot( HXUIOBJ hObj, Slot* slot ); void SetAlpha( HXUIOBJ hObj, float fAlpha ); @@ -56,7 +56,7 @@ public: int GetObjectCount( HXUIOBJ hObj ); // 4J WESTY : Pointer Prototype : Added to support prototype only. - void SetSkipsDefaultNavigation( BOOL bSkipDefaultNavigation ) { m_bSkipDefaultNavigation = bSkipDefaultNavigation; } + void SetSkipsDefaultNavigation( bool bSkipDefaultNavigation ) { m_bSkipDefaultNavigation = bSkipDefaultNavigation; } // 4J WESTY : Pointer Prototype : Added to support prototype only. int GetEmptyStackSpace( HXUIOBJ hObj ); // Returns number of items that can still be stacked into this slot. @@ -65,14 +65,14 @@ public: bool IsSameItemAs( HXUIOBJ hThisObj, HXUIOBJ hOtherObj ); protected: - HRESULT OnInit( HXUIOBJ hObj, XUIMessageInit* pInitData, BOOL& bHandled ); + int OnInit( HXUIOBJ hObj, XUIMessageInit* pInitData, bool& bHandled ); - HRESULT OnDestroy( HXUIOBJ hObj ); + int OnDestroy( HXUIOBJ hObj ); - HRESULT OnCustomMessage_GetSlotItem(HXUIOBJ hObj, CustomMessage_GetSlotItem_Struct *pData, BOOL& bHandled); + int OnCustomMessage_GetSlotItem(HXUIOBJ hObj, CustomMessage_GetSlotItem_Struct *pData, bool& bHandled); // 4J WESTY : Pointer Prototype : Added to support prototype only. - HRESULT OnControlNavigate(HXUIOBJ hObj, XUIMessageControlNavigate *pControlNavigateData, BOOL& bHandled); + int OnControlNavigate(HXUIOBJ hObj, XUIMessageControlNavigate *pControlNavigateData, bool& bHandled); - HRESULT OnKeyDown(HXUIOBJ hObj, XUIMessageInput *pInputData, BOOL& bHandled); + int OnKeyDown(HXUIOBJ hObj, XUIMessageInput *pInputData, bool& bHandled); }; \ No newline at end of file diff --git a/src/client/Common/XUI/XUI_Ctrl_SlotItemListItem.h b/src/client/Common/XUI/XUI_Ctrl_SlotItemListItem.h index bee1b93f..013297ec 100644 --- a/src/client/Common/XUI/XUI_Ctrl_SlotItemListItem.h +++ b/src/client/Common/XUI/XUI_Ctrl_SlotItemListItem.h @@ -21,18 +21,18 @@ public: XUI_END_MSG_MAP() using CXuiCtrlSlotItemCtrlBase::OnInit; - HRESULT OnInit(XUIMessageInit* pInitData, BOOL& bHandled) { return this->OnInit( m_hObj, pInitData, bHandled ); }; + int OnInit(XUIMessageInit* pInitData, bool& bHandled) { return this->OnInit( m_hObj, pInitData, bHandled ); }; using CXuiCtrlSlotItemCtrlBase::OnDestroy; - HRESULT OnDestroy() { return this->OnDestroy( m_hObj ); }; + int OnDestroy() { return this->OnDestroy( m_hObj ); }; using CXuiCtrlSlotItemCtrlBase::OnCustomMessage_GetSlotItem; - HRESULT OnCustomMessage_GetSlotItem(CustomMessage_GetSlotItem_Struct *pData, BOOL& bHandled) { return this->OnCustomMessage_GetSlotItem( m_hObj, pData, bHandled ); }; + int OnCustomMessage_GetSlotItem(CustomMessage_GetSlotItem_Struct *pData, bool& bHandled) { return this->OnCustomMessage_GetSlotItem( m_hObj, pData, bHandled ); }; // 4J WESTY : Pointer Prototype : Added to support prototype only. using CXuiCtrlSlotItemCtrlBase::OnControlNavigate; - HRESULT OnControlNavigate(XUIMessageControlNavigate *pControlNavigateData, BOOL& bHandled) { return this->OnControlNavigate( m_hObj, pControlNavigateData, bHandled ); } + int OnControlNavigate(XUIMessageControlNavigate *pControlNavigateData, bool& bHandled) { return this->OnControlNavigate( m_hObj, pControlNavigateData, bHandled ); } using CXuiCtrlSlotItemCtrlBase::OnKeyDown; - HRESULT OnKeyDown(XUIMessageInput *pInputData, BOOL& bHandled) { return this->OnKeyDown( m_hObj, pInputData, bHandled ); }; + int OnKeyDown(XUIMessageInput *pInputData, bool& bHandled) { return this->OnKeyDown( m_hObj, pInputData, bHandled ); }; }; \ No newline at end of file diff --git a/src/client/Common/XUI/XUI_Ctrl_SlotList.cpp b/src/client/Common/XUI/XUI_Ctrl_SlotList.cpp index 9ccda173..999263e2 100644 --- a/src/client/Common/XUI/XUI_Ctrl_SlotList.cpp +++ b/src/client/Common/XUI/XUI_Ctrl_SlotList.cpp @@ -10,19 +10,19 @@ // Name: CXuiCtrlSlotList::OnInit // Desc: Message handler for XM_INIT //-------------------------------------------------------------------------------------- -HRESULT CXuiCtrlSlotList::OnInit( XUIMessageInit* pInitData, BOOL& bHandled ) +int CXuiCtrlSlotList::OnInit( XUIMessageInit* pInitData, bool& bHandled ) { slotCount = 0; return S_OK; } -HRESULT CXuiCtrlSlotList::OnDestroy() +int CXuiCtrlSlotList::OnDestroy() { return S_OK; } -HRESULT CXuiCtrlSlotList::OnKeyDown(XUIMessageInput *pInputData, BOOL& bHandled) +int CXuiCtrlSlotList::OnKeyDown(XUIMessageInput *pInputData, bool& bHandled) { if( pInputData->dwKeyCode == VK_PAD_DPAD_LEFT || pInputData->dwKeyCode == VK_PAD_DPAD_RIGHT || @@ -32,7 +32,7 @@ HRESULT CXuiCtrlSlotList::OnKeyDown(XUIMessageInput *pInputData, BOOL& bHandled) pInputData->dwKeyCode == VK_PAD_RTRIGGER) { HXUIOBJ parent; - HRESULT hr; + int hr; hr = XuiElementGetParent( m_hObj, &parent ); XUIMessage message; @@ -107,7 +107,7 @@ void CXuiCtrlSlotList::SetData(int m_iPad, AbstractContainerMenu* menu, int rows } } -HRESULT CXuiCtrlSlotList::OnGetItemCountAll( XUIMessageGetItemCount *pGetItemCountData, BOOL& bHandled ) +int CXuiCtrlSlotList::OnGetItemCountAll( XUIMessageGetItemCount *pGetItemCountData, bool& bHandled ) { // We don't need to look at the type of request. The message map // has already filtered out a request to retrieve all items. @@ -117,7 +117,7 @@ HRESULT CXuiCtrlSlotList::OnGetItemCountAll( XUIMessageGetItemCount *pGetItemCou return( S_OK ); } -HRESULT CXuiCtrlSlotList::OnGetItemCountMaxLines( XUIMessageGetItemCount *pGetItemCountData, BOOL& bHandled ) +int CXuiCtrlSlotList::OnGetItemCountMaxLines( XUIMessageGetItemCount *pGetItemCountData, bool& bHandled ) { // We don't need to look at the type of request. The message map // has already filtered out a request to retrieve max lines. @@ -127,7 +127,7 @@ HRESULT CXuiCtrlSlotList::OnGetItemCountMaxLines( XUIMessageGetItemCount *pGetIt return( S_OK ); } -HRESULT CXuiCtrlSlotList::OnGetItemCountMaxPerLine( XUIMessageGetItemCount *pGetItemCountData, BOOL& bHandled ) +int CXuiCtrlSlotList::OnGetItemCountMaxPerLine( XUIMessageGetItemCount *pGetItemCountData, bool& bHandled ) { // We don't need to look at the type of request. The message map // has already filtered out a request to retrieve max per line. @@ -224,7 +224,7 @@ void CXuiCtrlSlotList::Clicked() void CXuiCtrlSlotList::GetCXuiCtrlSlotItem(int itemIndex, CXuiCtrlSlotItemListItem** CXuiCtrlSlotItem) { HXUIOBJ itemControl = this->GetItemControl(itemIndex); - VOID *pObj; + void *pObj; XuiObjectFromHandle( itemControl, &pObj ); *CXuiCtrlSlotItem = (CXuiCtrlSlotItemListItem *)pObj; } diff --git a/src/client/Common/XUI/XUI_Ctrl_SlotList.h b/src/client/Common/XUI/XUI_Ctrl_SlotList.h index d428ab14..ccc66baf 100644 --- a/src/client/Common/XUI/XUI_Ctrl_SlotList.h +++ b/src/client/Common/XUI/XUI_Ctrl_SlotList.h @@ -1,6 +1,6 @@ #pragma once -// Sig: HRESULT OnGetItemCountMaxLines(XUIMessageGetItemCount *pGetItemCountData, BOOL& bHandled) +// Sig: int OnGetItemCountMaxLines(XUIMessageGetItemCount *pGetItemCountData, bool& bHandled) #define XUI_ON_XM_GET_ITEMCOUNT_MAX_LINES(MemberFunc)\ if (pMessage->dwMessage == XM_GET_ITEMCOUNT && ((XUIMessageGetItemCount *) pMessage->pvData)->nType == XUI_ITEMCOUNT_MAX_LINES)\ {\ @@ -8,7 +8,7 @@ return MemberFunc(pData, pMessage->bHandled);\ } -// Sig: HRESULT OnGetItemCountMaxPerLine(XUIMessageGetItemCount *pGetItemCountData, BOOL& bHandled) +// Sig: int OnGetItemCountMaxPerLine(XUIMessageGetItemCount *pGetItemCountData, bool& bHandled) #define XUI_ON_XM_GET_ITEMCOUNT_MAX_PER_LINE(MemberFunc)\ if (pMessage->dwMessage == XM_GET_ITEMCOUNT && ((XUIMessageGetItemCount *) pMessage->pvData)->nType == XUI_ITEMCOUNT_MAX_PER_LINE)\ {\ @@ -36,13 +36,13 @@ public: XUI_ON_XM_GET_ITEMCOUNT_MAX_PER_LINE(OnGetItemCountMaxPerLine) XUI_END_MSG_MAP() - HRESULT OnInit( XUIMessageInit* pInitData, BOOL& bHandled ); - HRESULT OnDestroy(); - HRESULT OnKeyDown(XUIMessageInput *pInputData, BOOL& bHandled); - HRESULT OnGetItemCountAll( XUIMessageGetItemCount *pGetItemCountData, BOOL& bHandled ); - HRESULT OnGetItemCountMaxLines(XUIMessageGetItemCount *pGetItemCountData, BOOL& bHandled); - HRESULT OnGetItemCountMaxPerLine(XUIMessageGetItemCount *pGetItemCountData, BOOL& bHandled); - HRESULT OnRender(XUIMessageRender *pRenderData, BOOL &rfHandled); + int OnInit( XUIMessageInit* pInitData, bool& bHandled ); + int OnDestroy(); + int OnKeyDown(XUIMessageInput *pInputData, bool& bHandled); + int OnGetItemCountAll( XUIMessageGetItemCount *pGetItemCountData, bool& bHandled ); + int OnGetItemCountMaxLines(XUIMessageGetItemCount *pGetItemCountData, bool& bHandled); + int OnGetItemCountMaxPerLine(XUIMessageGetItemCount *pGetItemCountData, bool& bHandled); + int OnRender(XUIMessageRender *pRenderData, bool &rfHandled); public: void SetData(int m_iPad, AbstractContainerMenu* menu, int rows, int columns, int startIndex = 0, int endIndex = 0); diff --git a/src/client/Common/XUI/XUI_Ctrl_SplashPulser.cpp b/src/client/Common/XUI/XUI_Ctrl_SplashPulser.cpp index a6aa7c2e..816c0b0b 100644 --- a/src/client/Common/XUI/XUI_Ctrl_SplashPulser.cpp +++ b/src/client/Common/XUI/XUI_Ctrl_SplashPulser.cpp @@ -27,13 +27,13 @@ CXuiCtrlSplashPulser::CXuiCtrlSplashPulser() : } //----------------------------------------------------------------------------- -HRESULT CXuiCtrlSplashPulser::OnInit(XUIMessageInit* pInitData, BOOL& rfHandled) +int CXuiCtrlSplashPulser::OnInit(XUIMessageInit* pInitData, bool& rfHandled) { - HRESULT hr=S_OK; + int hr=S_OK; return hr; } -HRESULT CXuiCtrlSplashPulser::OnRender(XUIMessageRender *pRenderData, BOOL &bHandled ) +int CXuiCtrlSplashPulser::OnRender(XUIMessageRender *pRenderData, bool &bHandled ) { #ifdef _XBOX HXUIDC hDC = pRenderData->hDC; diff --git a/src/client/Common/XUI/XUI_Ctrl_SplashPulser.h b/src/client/Common/XUI/XUI_Ctrl_SplashPulser.h index 504cf4c5..25def6a3 100644 --- a/src/client/Common/XUI/XUI_Ctrl_SplashPulser.h +++ b/src/client/Common/XUI/XUI_Ctrl_SplashPulser.h @@ -23,11 +23,11 @@ protected: XUI_ON_XM_RENDER(OnRender) XUI_END_MSG_MAP() - HRESULT OnInit(XUIMessageInit* pInitData, BOOL& rfHandled); - HRESULT OnRender(XUIMessageRender *pRenderData, BOOL &rfHandled); + int OnInit(XUIMessageInit* pInitData, bool& rfHandled); + int OnRender(XUIMessageRender *pRenderData, bool &rfHandled); private: - BOOL m_bDirty; + bool m_bDirty; float m_fScale,m_fAlpha; float m_fScreenWidth,m_fScreenHeight; diff --git a/src/client/Common/XUI/XUI_CustomMessages.h b/src/client/Common/XUI/XUI_CustomMessages.h index 888f8ad0..bf26ecf7 100644 --- a/src/client/Common/XUI/XUI_CustomMessages.h +++ b/src/client/Common/XUI/XUI_CustomMessages.h @@ -19,14 +19,14 @@ typedef struct // Legacy values for compatibility int iDataBitField; int iItemBitField; - LPCWSTR szPath; - BOOL bDirty; + const wchar_t* szPath; + bool bDirty; } CustomMessage_GetSlotItem_Struct; // Define the prototype for your handler function -// Sig: HRESULT OnCustomMessage_GetSlotItem(CustomMessage_GetSlotItem_Struct *pData, BOOL& bHandled) +// Sig: int OnCustomMessage_GetSlotItem(CustomMessage_GetSlotItem_Struct *pData, bool& bHandled) // Define the message map macro #define XUI_ON_XM_GETSLOTITEM_MESSAGE(MemberFunc)\ @@ -55,7 +55,7 @@ CustomMessage_Splitscreenplayer_Struct; // Define the prototype for your handler function -// Sig: HRESULT OnCustomMessage_Splitscreenplayer(bool bJoining, BOOL& bHandled) +// Sig: int OnCustomMessage_Splitscreenplayer(bool bJoining, bool& bHandled) // Define the message map macro #define XUI_ON_XM_SPLITSCREENPLAYER_MESSAGE(MemberFunc)\ @@ -73,7 +73,7 @@ static __declspec(noinline) void CustomMessage_Splitscreenplayer(XUIMessage *pMs } // Define the prototype for your handler function -// Sig: HRESULT OnFontRendererChange() +// Sig: int OnFontRendererChange() // Define the message map macro #define XUI_ON_XM_FONTRENDERERCHANGE_MESSAGE(MemberFunc)\ @@ -88,7 +88,7 @@ static __declspec(noinline) void CustomMessage_FontRendererChange(XUIMessage *pM } // Define the prototype for your handler function -// Sig: HRESULT OnDLCMounted() +// Sig: int OnDLCMounted() // Define the message map macro #define XUI_ON_XM_DLCLOADED_MESSAGE(MemberFunc)\ @@ -103,7 +103,7 @@ static __declspec(noinline) void CustomMessage_DLCMountingComplete(XUIMessage *p } // Define the prototype for your handler function -// Sig: HRESULT OnBasePositionChanged() +// Sig: int OnBasePositionChanged() // Define the message map macro #define XUI_ON_XM_BASE_POSITION_CHANGED_MESSAGE(MemberFunc)\ @@ -118,7 +118,7 @@ static __declspec(noinline) void CustomMessage_BasePositionChanged(XUIMessage *p } // the prototype for your handler function -// Sig: HRESULT OnDLCInstalled() +// Sig: int OnDLCInstalled() // Define the message map macro #define XUI_ON_XM_DLCINSTALLED_MESSAGE(MemberFunc)\ @@ -133,7 +133,7 @@ static __declspec(noinline) void CustomMessage_DLCInstalled(XUIMessage *pMsg) } // the prototype for your handler function -// Sig: HRESULT OnCustomMessage_InventoryUpdated() +// Sig: int OnCustomMessage_InventoryUpdated() // Define the message map macro #define XUI_ON_XM_INVENTORYUPDATED_MESSAGE(MemberFunc)\ @@ -148,7 +148,7 @@ static __declspec(noinline) void CustomMessage_InventoryUpdated(XUIMessage *pMsg } // the prototype for your handler function -// Sig: HRESULT OnCustomMessage_() +// Sig: int OnCustomMessage_() // Define the message map macro #define XUI_ON_XM_TMS_DLCFILE_RETRIEVED_MESSAGE(MemberFunc)\ @@ -163,7 +163,7 @@ static __declspec(noinline) void CustomMessage_TMS_DLCFileRetrieved(XUIMessage * } // the prototype for your handler function -// Sig: HRESULT OnCustomMessage_() +// Sig: int OnCustomMessage_() // Define the message map macro #define XUI_ON_XM_TMS_BANFILE_RETRIEVED_MESSAGE(MemberFunc)\ @@ -178,7 +178,7 @@ static __declspec(noinline) void CustomMessage_TMS_BanFileRetrieved(XUIMessage * } // Define the prototype for your handler function -// Sig: HRESULT OnCustomMessage_TickScene() +// Sig: int OnCustomMessage_TickScene() // Define the message map macro #define XUI_ON_XM_CUSTOMTICKSCENE_MESSAGE(MemberFunc)\ diff --git a/src/client/Common/XUI/XUI_DLCOffers.cpp b/src/client/Common/XUI/XUI_DLCOffers.cpp index c0d78f7f..e5604061 100644 --- a/src/client/Common/XUI/XUI_DLCOffers.cpp +++ b/src/client/Common/XUI/XUI_DLCOffers.cpp @@ -22,7 +22,7 @@ // DLC Main -HRESULT CScene_DLCMain::OnInit( XUIMessageInit* pInitData, BOOL& bHandled ) +int CScene_DLCMain::OnInit( XUIMessageInit* pInitData, bool& bHandled ) { iPad = *(int *) pInitData->pvInitData; @@ -37,7 +37,7 @@ HRESULT CScene_DLCMain::OnInit( XUIMessageInit* pInitData, BOOL& bHandled ) m_Timer.SetShow(false); m_bIgnoreInput=false; - VOID *pObj; + void *pObj; XuiObjectFromHandle( xList, &pObj ); list = (CXuiCtrl4JList *) pObj; @@ -91,18 +91,18 @@ HRESULT CScene_DLCMain::OnInit( XUIMessageInit* pInitData, BOOL& bHandled ) return S_OK; } -HRESULT CScene_DLCMain::OnDestroy() +int CScene_DLCMain::OnDestroy() { return S_OK; } -HRESULT CScene_DLCMain::OnTimer(XUIMessageTimer *pData,BOOL& rfHandled) +int CScene_DLCMain::OnTimer(XUIMessageTimer *pData,bool& rfHandled) { if(pData->nId==TIMER_ID_NETWORK_CONNECTION) { if(ProfileManager.GetLiveConnectionStatus()!=XONLINE_S_LOGON_CONNECTION_ESTABLISHED) { - UINT uiIDA[1]; + unsigned int uiIDA[1]; uiIDA[0]=IDS_CONFIRM_OK; StorageManager.ClearDLCOffers(); @@ -122,7 +122,7 @@ HRESULT CScene_DLCMain::OnTimer(XUIMessageTimer *pData,BOOL& rfHandled) } -HRESULT CScene_DLCMain::OnKeyDown(XUIMessageInput* pInputData, BOOL& rfHandled) +int CScene_DLCMain::OnKeyDown(XUIMessageInput* pInputData, bool& rfHandled) { if(m_bIgnoreInput) return S_OK; @@ -147,7 +147,7 @@ HRESULT CScene_DLCMain::OnKeyDown(XUIMessageInput* pInputData, BOOL& rfHandled) return S_OK; } -HRESULT CScene_DLCMain::OnNotifyPressEx(HXUIOBJ hObjPressed, XUINotifyPress* pNotifyPressData, BOOL& rfHandled) +int CScene_DLCMain::OnNotifyPressEx(HXUIOBJ hObjPressed, XUINotifyPress* pNotifyPressData, bool& rfHandled) { ui.AnimateKeyPress(pNotifyPressData->UserIndex, VK_PAD_A); @@ -168,7 +168,7 @@ HRESULT CScene_DLCMain::OnNotifyPressEx(HXUIOBJ hObjPressed, XUINotifyPress* pNo return S_OK; } -HRESULT CScene_DLCMain::OnNavReturn(HXUIOBJ hObj,BOOL& rfHandled) +int CScene_DLCMain::OnNavReturn(HXUIOBJ hObj,bool& rfHandled) { ui.SetTooltips( DEFAULT_XUI_MENU_USER, IDS_TOOLTIPS_SELECT, IDS_TOOLTIPS_BACK ); @@ -180,7 +180,7 @@ HRESULT CScene_DLCMain::OnNavReturn(HXUIOBJ hObj,BOOL& rfHandled) //---------------------------------------------------------------------------------- // Performs initialization tasks - retrieves controls. //---------------------------------------------------------------------------------- -HRESULT CScene_DLCOffers::OnInit( XUIMessageInit* pInitData, BOOL& bHandled ) +int CScene_DLCOffers::OnInit( XUIMessageInit* pInitData, bool& bHandled ) { DLCOffersParam *param = (DLCOffersParam *) pInitData->pvInitData; m_iPad = param->iPad; @@ -200,7 +200,7 @@ HRESULT CScene_DLCOffers::OnInit( XUIMessageInit* pInitData, BOOL& bHandled ) if(m_iType==e_DLC_AvatarItems) { XAVATAR_METADATA AvatarMetadata; - HRESULT hRes; + int hRes; hRes=XAvatarInitialize(XAVATAR_COORDINATE_SYSTEM_LEFT_HANDED,0,0,0,NULL); @@ -222,7 +222,7 @@ HRESULT CScene_DLCOffers::OnInit( XUIMessageInit* pInitData, BOOL& bHandled ) m_bIgnorePress=true; - VOID *pObj; + void *pObj; m_hXuiBrush=NULL; XuiObjectFromHandle( m_List, &pObj ); @@ -257,15 +257,15 @@ HRESULT CScene_DLCOffers::OnInit( XUIMessageInit* pInitData, BOOL& bHandled ) return S_OK; } -HRESULT CScene_DLCOffers::GetDLCInfo( int iOfferC, bool bUpdateOnly ) +int CScene_DLCOffers::GetDLCInfo( int iOfferC, bool bUpdateOnly ) { CXuiCtrl4JList::LIST_ITEM_INFO *pListInfo=NULL; //XMARKETPLACE_CONTENTOFFER_INFO xOffer; XMARKETPLACE_CURRENCY_CONTENTOFFER_INFO xOffer; - const DWORD LOCATOR_SIZE = 256; // Use this to allocate space to hold a ResourceLocator string - WCHAR szResourceLocator[ LOCATOR_SIZE ]; - ZeroMemory(szResourceLocator,sizeof(WCHAR)*LOCATOR_SIZE); - const ULONG_PTR c_ModuleHandle = (ULONG_PTR)GetModuleHandle(NULL); + const unsigned long LOCATOR_SIZE = 256; // Use this to allocate space to hold a ResourceLocator string + wchar_t szResourceLocator[ LOCATOR_SIZE ]; + ZeroMemory(szResourceLocator,sizeof(wchar_t)*LOCATOR_SIZE); + const uintptr_t c_ModuleHandle = (uintptr_t)GetModuleHandle(NULL); int iCount=0; if(bUpdateOnly) // Just update the info on the current list @@ -371,7 +371,7 @@ HRESULT CScene_DLCOffers::GetDLCInfo( int iOfferC, bool bUpdateOnly ) // Bug 49249 - JPN: Code Defect: Missing Text: String 'Minecraft' is missing in contents download screen. // Looks like we shouldn't be removing this text for Japanese, and probably Chinese & Korean - DWORD dwLanguage = XGetLanguage( ); + unsigned long dwLanguage = XGetLanguage( ); switch(dwLanguage) { case XC_LANGUAGE_KOREAN: @@ -449,11 +449,11 @@ HRESULT CScene_DLCOffers::GetDLCInfo( int iOfferC, bool bUpdateOnly ) DLC_INFO *dlc = app.GetDLCInfoForFullOfferID(xOffer.qwOfferID); if (dlc != NULL) { - BYTE *pData=NULL; - UINT uiSize=0; - DWORD dwSize=0; + uint8_t *pData=NULL; + unsigned int uiSize=0; + unsigned long dwSize=0; - WCHAR *cString = dlc->wchBanner; + wchar_t *cString = dlc->wchBanner; // is the file in the TMS XZP? int iIndex = app.GetLocalTMSFileIndex(cString, true); @@ -527,7 +527,7 @@ HRESULT CScene_DLCOffers::GetDLCInfo( int iOfferC, bool bUpdateOnly ) return S_OK; } -HRESULT CScene_DLCOffers::OnDestroy() +int CScene_DLCOffers::OnDestroy() { // 4J-PB - don't cancel the DLC anymore //StorageManager.CancelGetDLCOffers(); @@ -541,7 +541,7 @@ HRESULT CScene_DLCOffers::OnDestroy() //---------------------------------------------------------------------------------- // Handler for the button press message. //---------------------------------------------------------------------------------- -HRESULT CScene_DLCOffers::OnNotifyPressEx(HXUIOBJ hObjPressed, XUINotifyPress* pNotifyPressData, BOOL& rfHandled) +int CScene_DLCOffers::OnNotifyPressEx(HXUIOBJ hObjPressed, XUINotifyPress* pNotifyPressData, bool& rfHandled) { if(m_bIgnorePress) return S_OK; @@ -557,7 +557,7 @@ HRESULT CScene_DLCOffers::OnNotifyPressEx(HXUIOBJ hObjPressed, XUINotifyPress* p iIndex=m_List.GetCurSel(&pItem); ItemInfo=m_pOffersList->GetData(iIndex); - ULONGLONG ullIndexA[1]; + uint64_t ullIndexA[1]; // check if it's already installed // if(StorageManager.GetOffer(iIndex).fUserHasPurchased) @@ -575,7 +575,7 @@ HRESULT CScene_DLCOffers::OnNotifyPressEx(HXUIOBJ hObjPressed, XUINotifyPress* p return S_OK; } -HRESULT CScene_DLCOffers::OnKeyDown(XUIMessageInput* pInputData, BOOL& rfHandled) +int CScene_DLCOffers::OnKeyDown(XUIMessageInput* pInputData, bool& rfHandled) { // Fix for Compliance fail - // On a functional console, the game must not enter an extended unresponsive state, cause unintentional loss of player data, crash, or cause an unintended reboot of the machine. @@ -622,7 +622,7 @@ HRESULT CScene_DLCOffers::OnKeyDown(XUIMessageInput* pInputData, BOOL& rfHandled } -HRESULT CScene_DLCOffers::OnNavReturn(HXUIOBJ hObj,BOOL& rfHandled) +int CScene_DLCOffers::OnNavReturn(HXUIOBJ hObj,bool& rfHandled) { // re-enable button presses m_bIgnorePress=false; @@ -645,7 +645,7 @@ void CScene_DLCOffers::UpdateTooltips(XMARKETPLACE_CURRENCY_CONTENTOFFER_INFO& x } -HRESULT CScene_DLCOffers::OnGetSourceDataImage(XUIMessageGetSourceImage *pGetSourceImageData,BOOL& bHandled) +int CScene_DLCOffers::OnGetSourceDataImage(XUIMessageGetSourceImage *pGetSourceImageData,bool& bHandled) { if( pGetSourceImageData->bItemData ) { @@ -656,7 +656,7 @@ HRESULT CScene_DLCOffers::OnGetSourceDataImage(XUIMessageGetSourceImage *pGetSou return S_OK; } -HRESULT CScene_DLCOffers::OnNotifySelChanged(HXUIOBJ hObjSource, XUINotifySelChanged *pNotifySelChangedData, BOOL& bHandled) +int CScene_DLCOffers::OnNotifySelChanged(HXUIOBJ hObjSource, XUINotifySelChanged *pNotifySelChangedData, bool& bHandled) { //int index = pNotifySelChangedData->iItem; // reset the image monitor, but not for the first selection @@ -702,11 +702,11 @@ HRESULT CScene_DLCOffers::OnNotifySelChanged(HXUIOBJ hObjSource, XUINotifySelCha if (dlc != NULL) { - BYTE *pImage=NULL; - UINT uiSize=0; - DWORD dwSize=0; + uint8_t *pImage=NULL; + unsigned int uiSize=0; + unsigned long dwSize=0; - WCHAR *cString = dlc->wchBanner; + wchar_t *cString = dlc->wchBanner; int iIndex = app.GetLocalTMSFileIndex(cString,true); @@ -771,13 +771,13 @@ HRESULT CScene_DLCOffers::OnNotifySelChanged(HXUIOBJ hObjSource, XUINotifySelCha } -HRESULT CScene_DLCOffers::OnTimer(XUIMessageTimer *pData,BOOL& rfHandled) +int CScene_DLCOffers::OnTimer(XUIMessageTimer *pData,bool& rfHandled) { // check the ethernet status - if it's disconnected, exit the xui if(ProfileManager.GetLiveConnectionStatus()!=XONLINE_S_LOGON_CONNECTION_ESTABLISHED) { - UINT uiIDA[1]; + unsigned int uiIDA[1]; uiIDA[0]=IDS_CONFIRM_OK; m_pOffersList->RemoveAllData(); @@ -805,14 +805,14 @@ HRESULT CScene_DLCOffers::OnTimer(XUIMessageTimer *pData,BOOL& rfHandled) if(m_pNoImageFor_DLC!=NULL) { // Is it present now? - WCHAR *cString = m_pNoImageFor_DLC->wchBanner; + wchar_t *cString = m_pNoImageFor_DLC->wchBanner; bool bPresent = app.IsFileInMemoryTextures(cString); if(bPresent) { - BYTE *pImage=NULL; - DWORD dwSize=0; + uint8_t *pImage=NULL; + unsigned long dwSize=0; if(m_hXuiBrush!=NULL) { @@ -838,7 +838,7 @@ HRESULT CScene_DLCOffers::OnTimer(XUIMessageTimer *pData,BOOL& rfHandled) // return 0; // } -HRESULT CScene_DLCOffers::OnCustomMessage_DLCInstalled() +int CScene_DLCOffers::OnCustomMessage_DLCInstalled() { // mounted DLC may have changed - need to re-run the GetDLC ui.SetTooltips( DEFAULT_XUI_MENU_USER, -1, IDS_TOOLTIPS_BACK); diff --git a/src/client/Common/XUI/XUI_DLCOffers.h b/src/client/Common/XUI/XUI_DLCOffers.h index 412446d0..4a5f4fc1 100644 --- a/src/client/Common/XUI/XUI_DLCOffers.h +++ b/src/client/Common/XUI/XUI_DLCOffers.h @@ -37,12 +37,12 @@ class CScene_DLCMain : public CXuiSceneImpl MAP_CONTROL(IDC_Timer, m_Timer) END_CONTROL_MAP() - HRESULT OnInit( XUIMessageInit* pInitData, BOOL& bHandled ); - HRESULT OnDestroy(); - HRESULT OnKeyDown(XUIMessageInput* pInputData, BOOL& rfHandled); - HRESULT OnNotifyPressEx(HXUIOBJ hObjPressed, XUINotifyPress* pNotifyPressData, BOOL& rfHandled); - HRESULT OnNavReturn(HXUIOBJ hObj,BOOL& rfHandled); - HRESULT OnTimer( XUIMessageTimer *pTimer, BOOL& bHandled ); + int OnInit( XUIMessageInit* pInitData, bool& bHandled ); + int OnDestroy(); + int OnKeyDown(XUIMessageInput* pInputData, bool& rfHandled); + int OnNotifyPressEx(HXUIOBJ hObjPressed, XUINotifyPress* pNotifyPressData, bool& rfHandled); + int OnNavReturn(HXUIOBJ hObj,bool& rfHandled); + int OnTimer( XUIMessageTimer *pTimer, bool& bHandled ); public: XUI_IMPLEMENT_CLASS( CScene_DLCMain, L"CScene_DLCMain", XUI_CLASS_SCENE ) @@ -89,17 +89,17 @@ protected: MAP_CONTROL(IDC_Timer, m_Timer) END_CONTROL_MAP() - HRESULT OnInit( XUIMessageInit* pInitData, BOOL& bHandled ); - HRESULT OnNotifySelChanged( HXUIOBJ hObjSource, XUINotifySelChanged* pNotifySelChangedData, BOOL& bHandled ); - HRESULT OnNotifyPressEx(HXUIOBJ hObjPressed, XUINotifyPress* pNotifyPressData, BOOL& rfHandled); - HRESULT OnKeyDown(XUIMessageInput* pInputData, BOOL& rfHandled); - HRESULT OnDestroy(); - HRESULT OnNavReturn(HXUIOBJ hObj,BOOL& rfHandled); - HRESULT OnTimer( XUIMessageTimer *pTimer, BOOL& bHandled ); - HRESULT OnCustomMessage_DLCInstalled(); - HRESULT OnGetSourceDataImage(XUIMessageGetSourceImage *pGetSourceImageData,BOOL& bHandled); + int OnInit( XUIMessageInit* pInitData, bool& bHandled ); + int OnNotifySelChanged( HXUIOBJ hObjSource, XUINotifySelChanged* pNotifySelChangedData, bool& bHandled ); + int OnNotifyPressEx(HXUIOBJ hObjPressed, XUINotifyPress* pNotifyPressData, bool& rfHandled); + int OnKeyDown(XUIMessageInput* pInputData, bool& rfHandled); + int OnDestroy(); + int OnNavReturn(HXUIOBJ hObj,bool& rfHandled); + int OnTimer( XUIMessageTimer *pTimer, bool& bHandled ); + int OnCustomMessage_DLCInstalled(); + int OnGetSourceDataImage(XUIMessageGetSourceImage *pGetSourceImageData,bool& bHandled); - HRESULT GetDLCInfo( int iOfferC, bool bUpdateOnly=false ); + int GetDLCInfo( int iOfferC, bool bUpdateOnly=false ); //static int EthernetDisconnectReturned(void *pParam,int iPad,const C4JStorage::EMessageResult); static int TMSReadCallback(void *pParam,int iPad,bool bResult); diff --git a/src/client/Common/XUI/XUI_Death.cpp b/src/client/Common/XUI/XUI_Death.cpp index c0e0cc22..a3de1a58 100644 --- a/src/client/Common/XUI/XUI_Death.cpp +++ b/src/client/Common/XUI/XUI_Death.cpp @@ -24,7 +24,7 @@ //---------------------------------------------------------------------------------- // Performs initialization tasks - retrieves controls. //---------------------------------------------------------------------------------- -HRESULT CScene_Death::OnInit( XUIMessageInit* pInitData, BOOL& bHandled ) +int CScene_Death::OnInit( XUIMessageInit* pInitData, bool& bHandled ) { m_iPad = *(int *)pInitData->pvInitData; @@ -49,7 +49,7 @@ HRESULT CScene_Death::OnInit( XUIMessageInit* pInitData, BOOL& bHandled ) //---------------------------------------------------------------------------------- // Updates the UI when the list selection changes. //---------------------------------------------------------------------------------- -HRESULT CScene_Death::OnNotifySelChanged( HXUIOBJ hObjSource, XUINotifySelChanged* pNotifySelChangedData, BOOL& bHandled ) +int CScene_Death::OnNotifySelChanged( HXUIOBJ hObjSource, XUINotifySelChanged* pNotifySelChangedData, bool& bHandled ) { if( hObjSource == m_Scene ) { @@ -75,7 +75,7 @@ HRESULT CScene_Death::OnNotifySelChanged( HXUIOBJ hObjSource, XUINotifySelChange //---------------------------------------------------------------------------------- // Handler for the button press message. //---------------------------------------------------------------------------------- -HRESULT CScene_Death::OnNotifyPressEx(HXUIOBJ hObjPressed, XUINotifyPress* pNotifyPressData, BOOL& rfHandled) +int CScene_Death::OnNotifyPressEx(HXUIOBJ hObjPressed, XUINotifyPress* pNotifyPressData, bool& rfHandled) { if(m_bIgnoreInput) return S_OK; @@ -99,7 +99,7 @@ HRESULT CScene_Death::OnNotifyPressEx(HXUIOBJ hObjPressed, XUINotifyPress* pNoti // Check if it's the trial version if(ProfileManager.IsFullVersion()) { - UINT uiIDA[3]; + unsigned int uiIDA[3]; // is it the primary player exiting? if(pNotifyPressData->UserIndex==ProfileManager.GetPrimaryPad()) @@ -155,7 +155,7 @@ HRESULT CScene_Death::OnNotifyPressEx(HXUIOBJ hObjPressed, XUINotifyPress* pNoti CXuiSceneBase::ReduceTrialTimerValue(); // exit the level - UINT uiIDA[2]; + unsigned int uiIDA[2]; uiIDA[0]=IDS_CONFIRM_CANCEL; uiIDA[1]=IDS_CONFIRM_OK; StorageManager.RequestMessageBox(IDS_EXIT_GAME, IDS_CONFIRM_EXIT_GAME_PROGRESS_LOST, uiIDA, 2, pNotifyPressData->UserIndex,&UIScene_PauseMenu::ExitGameDialogReturned,this, app.GetStringTable()); @@ -186,7 +186,7 @@ HRESULT CScene_Death::OnNotifyPressEx(HXUIOBJ hObjPressed, XUINotifyPress* pNoti return S_OK; } -HRESULT CScene_Death::OnKeyDown(XUIMessageInput* pInputData, BOOL& rfHandled) +int CScene_Death::OnKeyDown(XUIMessageInput* pInputData, bool& rfHandled) { ui.AnimateKeyPress(pInputData->UserIndex, pInputData->dwKeyCode); @@ -235,7 +235,7 @@ int CScene_Death::RespawnThreadProc( void* lpParameter ) return S_OK; } -HRESULT CScene_Death::OnCustomMessage_Splitscreenplayer(bool bJoining, BOOL& bHandled) +int CScene_Death::OnCustomMessage_Splitscreenplayer(bool bJoining, bool& bHandled) { bHandled=true; return app.AdjustSplitscreenScene_PlayerChanged(m_hObj,&m_OriginalPosition,m_iPad,bJoining); diff --git a/src/client/Common/XUI/XUI_Death.h b/src/client/Common/XUI/XUI_Death.h index 62d37d0d..b5905040 100644 --- a/src/client/Common/XUI/XUI_Death.h +++ b/src/client/Common/XUI/XUI_Death.h @@ -32,11 +32,11 @@ class CScene_Death : public CXuiSceneImpl MAP_CONTROL(IDC_Title, m_Title) END_CONTROL_MAP() - HRESULT OnInit( XUIMessageInit* pInitData, BOOL& bHandled ); - HRESULT OnNotifySelChanged( HXUIOBJ hObjSource, XUINotifySelChanged* pNotifySelChangedData, BOOL& bHandled ); - HRESULT OnNotifyPressEx(HXUIOBJ hObjPressed, XUINotifyPress* pNotifyPressData,BOOL& rfHandled); - HRESULT OnKeyDown(XUIMessageInput* pInputData, BOOL& rfHandled); - HRESULT OnCustomMessage_Splitscreenplayer(bool bJoining, BOOL& bHandled); + int OnInit( XUIMessageInit* pInitData, bool& bHandled ); + int OnNotifySelChanged( HXUIOBJ hObjSource, XUINotifySelChanged* pNotifySelChangedData, bool& bHandled ); + int OnNotifyPressEx(HXUIOBJ hObjPressed, XUINotifyPress* pNotifyPressData,bool& rfHandled); + int OnKeyDown(XUIMessageInput* pInputData, bool& rfHandled); + int OnCustomMessage_Splitscreenplayer(bool bJoining, bool& bHandled); public: // Define the class. The class name must match the ClassOverride property diff --git a/src/client/Common/XUI/XUI_Debug.h b/src/client/Common/XUI/XUI_Debug.h index 1fa6d3c8..c3a83854 100644 --- a/src/client/Common/XUI/XUI_Debug.h +++ b/src/client/Common/XUI/XUI_Debug.h @@ -17,12 +17,12 @@ class CScene_Debug : public CXuiSceneImpl XUI_ON_XM_CONTROL_NAVIGATE(OnControlNavigate) XUI_END_MSG_MAP() - HRESULT OnInit( XUIMessageInit* pInitData, BOOL& bHandled ); - HRESULT OnKeyDown(XUIMessageInput* pInputData, BOOL& rfHandled); - HRESULT OnNotifySelChanged( HXUIOBJ hObjSource, XUINotifySelChanged* pNotifySelChangedData, BOOL& bHandled ); - HRESULT OnNotifyValueChanged( HXUIOBJ hObjSource, XUINotifyValueChanged* pNotifyValueChanged, BOOL& bHandled ); - HRESULT OnNotifyPressEx(HXUIOBJ hObjPressed, XUINotifyPress* pNotifyPressData,BOOL& rfHandled); - HRESULT OnControlNavigate(XUIMessageControlNavigate *pControlNavigateData, BOOL& bHandled); + int OnInit( XUIMessageInit* pInitData, bool& bHandled ); + int OnKeyDown(XUIMessageInput* pInputData, bool& rfHandled); + int OnNotifySelChanged( HXUIOBJ hObjSource, XUINotifySelChanged* pNotifySelChangedData, bool& bHandled ); + int OnNotifyValueChanged( HXUIOBJ hObjSource, XUINotifyValueChanged* pNotifyValueChanged, bool& bHandled ); + int OnNotifyPressEx(HXUIOBJ hObjPressed, XUINotifyPress* pNotifyPressData,bool& rfHandled); + int OnControlNavigate(XUIMessageControlNavigate *pControlNavigateData, bool& bHandled); public: @@ -35,13 +35,13 @@ private: typedef struct { HXUIOBJ hXuiObj; - VOID *pvData; + void *pvData; } DEBUGDATA; - static LPCWSTR m_DebugCheckboxTextA[eDebugSetting_Max+1]; - static LPCWSTR m_DebugButtonTextA[eDebugButton_Max+1]; + static const wchar_t* m_DebugCheckboxTextA[eDebugSetting_Max+1]; + static const wchar_t* m_DebugButtonTextA[eDebugButton_Max+1]; int m_iTotalCheckboxElements; int m_iTotalButtonElements; DEBUGDATA *m_DebugCheckboxDataA; diff --git a/src/client/Common/XUI/XUI_DebugItemEditor.cpp b/src/client/Common/XUI/XUI_DebugItemEditor.cpp index a401ee5d..d2b9ef6c 100644 --- a/src/client/Common/XUI/XUI_DebugItemEditor.cpp +++ b/src/client/Common/XUI/XUI_DebugItemEditor.cpp @@ -10,7 +10,7 @@ #include "XUI_DebugItemEditor.h" #ifdef _DEBUG_MENUS_ENABLED -HRESULT CScene_DebugItemEditor::OnInit( XUIMessageInit *pInitData, BOOL &bHandled ) +int CScene_DebugItemEditor::OnInit( XUIMessageInit *pInitData, bool &bHandled ) { MapChildControls(); @@ -43,7 +43,7 @@ HRESULT CScene_DebugItemEditor::OnInit( XUIMessageInit *pInitData, BOOL &bHandle return S_OK; } -HRESULT CScene_DebugItemEditor::OnKeyDown(XUIMessageInput* pInputData, BOOL& rfHandled) +int CScene_DebugItemEditor::OnKeyDown(XUIMessageInput* pInputData, bool& rfHandled) { ui.AnimateKeyPress(pInputData->UserIndex, pInputData->dwKeyCode); @@ -74,7 +74,7 @@ HRESULT CScene_DebugItemEditor::OnKeyDown(XUIMessageInput* pInputData, BOOL& rfH return S_OK; } -HRESULT CScene_DebugItemEditor::OnNotifyValueChanged( HXUIOBJ hObjSource, XUINotifyValueChanged *pNotifyValueChangedData, BOOL &bHandled) +int CScene_DebugItemEditor::OnNotifyValueChanged( HXUIOBJ hObjSource, XUINotifyValueChanged *pNotifyValueChangedData, bool &bHandled) { if(m_item == NULL) m_item = shared_ptr( new ItemInstance(0,1,0) ); if(hObjSource == m_itemId) diff --git a/src/client/Common/XUI/XUI_DebugItemEditor.h b/src/client/Common/XUI/XUI_DebugItemEditor.h index 42614bcf..d85b8f1e 100644 --- a/src/client/Common/XUI/XUI_DebugItemEditor.h +++ b/src/client/Common/XUI/XUI_DebugItemEditor.h @@ -45,9 +45,9 @@ protected: MAP_CONTROL(IDC_itemName, m_itemName) END_CONTROL_MAP() - HRESULT OnInit( XUIMessageInit* pInitData, BOOL& bHandled ); - HRESULT OnKeyDown(XUIMessageInput* pInputData, BOOL& rfHandled); - HRESULT OnNotifyValueChanged( HXUIOBJ hObjSource, XUINotifyValueChanged *pNotifyValueChangedData, BOOL &bHandled); + int OnInit( XUIMessageInit* pInitData, bool& bHandled ); + int OnKeyDown(XUIMessageInput* pInputData, bool& rfHandled); + int OnNotifyValueChanged( HXUIOBJ hObjSource, XUINotifyValueChanged *pNotifyValueChangedData, bool &bHandled); public: // Define the class. The class name must match the ClassOverride property diff --git a/src/client/Common/XUI/XUI_DebugOverlay.cpp b/src/client/Common/XUI/XUI_DebugOverlay.cpp index 0bf6da19..f102f412 100644 --- a/src/client/Common/XUI/XUI_DebugOverlay.cpp +++ b/src/client/Common/XUI/XUI_DebugOverlay.cpp @@ -29,7 +29,7 @@ #include "ConsoleSaveFileOriginal.h" #ifdef _DEBUG_MENUS_ENABLED -HRESULT CScene_DebugOverlay::OnInit( XUIMessageInit *pInitData, BOOL &bHandled ) +int CScene_DebugOverlay::OnInit( XUIMessageInit *pInitData, bool &bHandled ) { MapChildControls(); @@ -111,7 +111,7 @@ HRESULT CScene_DebugOverlay::OnInit( XUIMessageInit *pInitData, BOOL &bHandled ) } // Handler for the XM_NOTIFY message -HRESULT CScene_DebugOverlay::OnNotifyPressEx(HXUIOBJ hObjPressed, XUINotifyPress* pNotifyPressData, BOOL& rfHandled) +int CScene_DebugOverlay::OnNotifyPressEx(HXUIOBJ hObjPressed, XUINotifyPress* pNotifyPressData, bool& rfHandled) { // This assumes all buttons can only be pressed with the A button ui.AnimateKeyPress(pNotifyPressData->UserIndex, VK_PAD_A); @@ -166,13 +166,13 @@ HRESULT CScene_DebugOverlay::OnNotifyPressEx(HXUIOBJ hObjPressed, XUINotifyPress { #ifndef _CONTENT_PACKAGE // load from the .xzp file - const ULONG_PTR c_ModuleHandle = (ULONG_PTR)GetModuleHandle(NULL); + const uintptr_t c_ModuleHandle = (uintptr_t)GetModuleHandle(NULL); HXUIOBJ hScene; - HRESULT hr; - //const WCHAR XZP_SEPARATOR = L'#'; - const DWORD LOCATOR_SIZE = 256; // Use this to allocate space to hold a ResourceLocator string - WCHAR szResourceLocator[ LOCATOR_SIZE ]; + int hr; + //const wchar_t XZP_SEPARATOR = L'#'; + const unsigned long LOCATOR_SIZE = 256; // Use this to allocate space to hold a ResourceLocator string + wchar_t szResourceLocator[ LOCATOR_SIZE ]; swprintf(szResourceLocator, LOCATOR_SIZE, L"section://%X,%ls#%ls",c_ModuleHandle,L"media", L"media/"); hr = XuiSceneCreate(szResourceLocator,app.GetSceneName(eUIScene_DebugCreateSchematic,false, false), NULL, &hScene); @@ -184,13 +184,13 @@ HRESULT CScene_DebugOverlay::OnNotifyPressEx(HXUIOBJ hObjPressed, XUINotifyPress { #ifndef _CONTENT_PACKAGE // load from the .xzp file - const ULONG_PTR c_ModuleHandle = (ULONG_PTR)GetModuleHandle(NULL); + const uintptr_t c_ModuleHandle = (uintptr_t)GetModuleHandle(NULL); HXUIOBJ hScene; - HRESULT hr; - //const WCHAR XZP_SEPARATOR = L'#'; - const DWORD LOCATOR_SIZE = 256; // Use this to allocate space to hold a ResourceLocator string - WCHAR szResourceLocator[ LOCATOR_SIZE ]; + int hr; + //const wchar_t XZP_SEPARATOR = L'#'; + const unsigned long LOCATOR_SIZE = 256; // Use this to allocate space to hold a ResourceLocator string + wchar_t szResourceLocator[ LOCATOR_SIZE ]; swprintf(szResourceLocator, LOCATOR_SIZE, L"section://%X,%ls#%ls",c_ModuleHandle,L"media", L"media/"); hr = XuiSceneCreate(szResourceLocator,app.GetSceneName(eUIScene_DebugSetCamera, false, false), NULL, &hScene); @@ -227,7 +227,7 @@ HRESULT CScene_DebugOverlay::OnNotifyPressEx(HXUIOBJ hObjPressed, XUINotifyPress return S_OK; } -HRESULT CScene_DebugOverlay::OnKeyDown(XUIMessageInput* pInputData, BOOL& rfHandled) +int CScene_DebugOverlay::OnKeyDown(XUIMessageInput* pInputData, bool& rfHandled) { ui.AnimateKeyPress(pInputData->UserIndex, pInputData->dwKeyCode); @@ -251,7 +251,7 @@ HRESULT CScene_DebugOverlay::OnKeyDown(XUIMessageInput* pInputData, BOOL& rfHand return S_OK; } -HRESULT CScene_DebugOverlay::OnNotifyValueChanged( HXUIOBJ hObjSource, XUINotifyValueChanged *pNotifyValueChangedData, BOOL &bHandled) +int CScene_DebugOverlay::OnNotifyValueChanged( HXUIOBJ hObjSource, XUINotifyValueChanged *pNotifyValueChangedData, bool &bHandled) { if( hObjSource == m_setTime ) { @@ -271,7 +271,7 @@ HRESULT CScene_DebugOverlay::OnNotifyValueChanged( HXUIOBJ hObjSource, XUINotify return S_OK; } -HRESULT CScene_DebugOverlay::OnTimer( XUIMessageTimer *pTimer, BOOL& bHandled ) +int CScene_DebugOverlay::OnTimer( XUIMessageTimer *pTimer, bool& bHandled ) { Minecraft *pMinecraft = Minecraft::GetInstance(); if(pMinecraft->level != NULL) @@ -307,7 +307,7 @@ void CScene_DebugOverlay::SaveLimitedFile(int chunkRadius) //SetSpawnToPlayerPos(); FileEntry *origFileEntry = currentSave->createFile( wstring( L"level.dat" ) ); byteArray levelData( origFileEntry->getFileSize() ); - DWORD bytesRead; + unsigned long bytesRead; currentSave->setFilePointer(origFileEntry,0,NULL,FILE_BEGIN); currentSave->readFile( origFileEntry, @@ -317,7 +317,7 @@ void CScene_DebugOverlay::SaveLimitedFile(int chunkRadius) ); FileEntry *newFileEntry = newSave.createFile( wstring( L"level.dat" ) ); - DWORD bytesWritten; + unsigned long bytesWritten; newSave.writeFile( newFileEntry, levelData.data, // data buffer origFileEntry->getFileSize(), // number of bytes to write diff --git a/src/client/Common/XUI/XUI_DebugOverlay.h b/src/client/Common/XUI/XUI_DebugOverlay.h index 93d98e98..a375cb9e 100644 --- a/src/client/Common/XUI/XUI_DebugOverlay.h +++ b/src/client/Common/XUI/XUI_DebugOverlay.h @@ -49,11 +49,11 @@ protected: MAP_CONTROL(IDC_SetCamera, m_setCamera) END_CONTROL_MAP() - HRESULT OnInit( XUIMessageInit* pInitData, BOOL& bHandled ); - HRESULT OnNotifyPressEx(HXUIOBJ hObjPressed, XUINotifyPress* pNotifyPressData, BOOL& rfHandled); - HRESULT OnKeyDown(XUIMessageInput* pInputData, BOOL& rfHandled); - HRESULT OnNotifyValueChanged( HXUIOBJ hObjSource, XUINotifyValueChanged *pNotifyValueChangedData, BOOL &bHandled); - HRESULT OnTimer( XUIMessageTimer *pTimer, BOOL& bHandled ); + int OnInit( XUIMessageInit* pInitData, bool& bHandled ); + int OnNotifyPressEx(HXUIOBJ hObjPressed, XUINotifyPress* pNotifyPressData, bool& rfHandled); + int OnKeyDown(XUIMessageInput* pInputData, bool& rfHandled); + int OnNotifyValueChanged( HXUIOBJ hObjSource, XUINotifyValueChanged *pNotifyValueChangedData, bool &bHandled); + int OnTimer( XUIMessageTimer *pTimer, bool& bHandled ); public: // Define the class. The class name must match the ClassOverride property diff --git a/src/client/Common/XUI/XUI_DebugSchematicCreator.cpp b/src/client/Common/XUI/XUI_DebugSchematicCreator.cpp index c2cfecfd..f7fc4e51 100644 --- a/src/client/Common/XUI/XUI_DebugSchematicCreator.cpp +++ b/src/client/Common/XUI/XUI_DebugSchematicCreator.cpp @@ -5,7 +5,7 @@ #include "net.minecraft.world.level.h" #ifndef _CONTENT_PACKAGE -HRESULT CScene_DebugSchematicCreator::OnInit( XUIMessageInit *pInitData, BOOL &bHandled ) +int CScene_DebugSchematicCreator::OnInit( XUIMessageInit *pInitData, bool &bHandled ) { MapChildControls(); @@ -21,7 +21,7 @@ HRESULT CScene_DebugSchematicCreator::OnInit( XUIMessageInit *pInitData, BOOL &b return S_OK; } -HRESULT CScene_DebugSchematicCreator::OnNotifyPressEx(HXUIOBJ hObjPressed, XUINotifyPress* pNotifyPressData, BOOL& rfHandled) +int CScene_DebugSchematicCreator::OnNotifyPressEx(HXUIOBJ hObjPressed, XUINotifyPress* pNotifyPressData, bool& rfHandled) { // This assumes all buttons can only be pressed with the A button ui.AnimateKeyPress(pNotifyPressData->UserIndex, VK_PAD_A); @@ -84,7 +84,7 @@ HRESULT CScene_DebugSchematicCreator::OnNotifyPressEx(HXUIOBJ hObjPressed, XUINo return S_OK; } -HRESULT CScene_DebugSchematicCreator::OnKeyDown(XUIMessageInput* pInputData, BOOL& rfHandled) +int CScene_DebugSchematicCreator::OnKeyDown(XUIMessageInput* pInputData, bool& rfHandled) { ui.AnimateKeyPress(pInputData->UserIndex, pInputData->dwKeyCode); @@ -105,7 +105,7 @@ HRESULT CScene_DebugSchematicCreator::OnKeyDown(XUIMessageInput* pInputData, BOO return S_OK; } -HRESULT CScene_DebugSchematicCreator::OnNotifyValueChanged( HXUIOBJ hObjSource, XUINotifyValueChanged *pNotifyValueChangedData, BOOL &bHandled) +int CScene_DebugSchematicCreator::OnNotifyValueChanged( HXUIOBJ hObjSource, XUINotifyValueChanged *pNotifyValueChangedData, bool &bHandled) { if(hObjSource == m_startX) { diff --git a/src/client/Common/XUI/XUI_DebugSchematicCreator.h b/src/client/Common/XUI/XUI_DebugSchematicCreator.h index 6428e1fe..44cd7e93 100644 --- a/src/client/Common/XUI/XUI_DebugSchematicCreator.h +++ b/src/client/Common/XUI/XUI_DebugSchematicCreator.h @@ -36,10 +36,10 @@ protected: MAP_CONTROL(IDC_UseXboxCompression, m_useXboxCompr) END_CONTROL_MAP() - HRESULT OnInit( XUIMessageInit* pInitData, BOOL& bHandled ); - HRESULT OnNotifyPressEx(HXUIOBJ hObjPressed, XUINotifyPress* pNotifyPressData, BOOL& rfHandled); - HRESULT OnKeyDown(XUIMessageInput* pInputData, BOOL& rfHandled); - HRESULT OnNotifyValueChanged( HXUIOBJ hObjSource, XUINotifyValueChanged *pNotifyValueChangedData, BOOL &bHandled); + int OnInit( XUIMessageInit* pInitData, bool& bHandled ); + int OnNotifyPressEx(HXUIOBJ hObjPressed, XUINotifyPress* pNotifyPressData, bool& rfHandled); + int OnKeyDown(XUIMessageInput* pInputData, bool& rfHandled); + int OnNotifyValueChanged( HXUIOBJ hObjSource, XUINotifyValueChanged *pNotifyValueChangedData, bool &bHandled); public: // Define the class. The class name must match the ClassOverride property diff --git a/src/client/Common/XUI/XUI_DebugSetCamera.cpp b/src/client/Common/XUI/XUI_DebugSetCamera.cpp index ad28c62f..414ed90b 100644 --- a/src/client/Common/XUI/XUI_DebugSetCamera.cpp +++ b/src/client/Common/XUI/XUI_DebugSetCamera.cpp @@ -9,7 +9,7 @@ #include "MultiplayerLocalPlayer.h" #ifndef _CONTENT_PACKAGE -HRESULT CScene_DebugSetCamera::OnInit( XUIMessageInit *pInitData, BOOL &bHandled ) +int CScene_DebugSetCamera::OnInit( XUIMessageInit *pInitData, bool &bHandled ) { MapChildControls(); @@ -43,12 +43,12 @@ HRESULT CScene_DebugSetCamera::OnInit( XUIMessageInit *pInitData, BOOL &bHandled m_yRot.SetKeyboardType(C_4JInput::EKeyboardMode_Full); m_elevation.SetKeyboardType(C_4JInput::EKeyboardMode_Full); - m_camX.SetText((CONST WCHAR *) _toString(currentPosition->m_camX).c_str()); - m_camY.SetText((CONST WCHAR *) _toString(currentPosition->m_camY + 1.62).c_str()); - m_camZ.SetText((CONST WCHAR *) _toString(currentPosition->m_camZ).c_str()); + m_camX.SetText((const wchar_t *) _toString(currentPosition->m_camX).c_str()); + m_camY.SetText((const wchar_t *) _toString(currentPosition->m_camY + 1.62).c_str()); + m_camZ.SetText((const wchar_t *) _toString(currentPosition->m_camZ).c_str()); - m_yRot.SetText((CONST WCHAR *) _toString(currentPosition->m_yRot).c_str()); - m_elevation.SetText((CONST WCHAR *) _toString(currentPosition->m_elev).c_str()); + m_yRot.SetText((const wchar_t *) _toString(currentPosition->m_yRot).c_str()); + m_elevation.SetText((const wchar_t *) _toString(currentPosition->m_elev).c_str()); //fpp = new FreezePlayerParam(); //fpp->player = playerNo; @@ -61,7 +61,7 @@ HRESULT CScene_DebugSetCamera::OnInit( XUIMessageInit *pInitData, BOOL &bHandled return S_OK; } -HRESULT CScene_DebugSetCamera::OnNotifyPressEx(HXUIOBJ hObjPressed, XUINotifyPress* pNotifyPressData, BOOL& rfHandled) +int CScene_DebugSetCamera::OnNotifyPressEx(HXUIOBJ hObjPressed, XUINotifyPress* pNotifyPressData, bool& rfHandled) { // This assumes all buttons can only be pressed with the A button ui.AnimateKeyPress(pNotifyPressData->UserIndex, VK_PAD_A); @@ -83,7 +83,7 @@ HRESULT CScene_DebugSetCamera::OnNotifyPressEx(HXUIOBJ hObjPressed, XUINotifyPre return S_OK; } -HRESULT CScene_DebugSetCamera::OnKeyDown(XUIMessageInput* pInputData, BOOL& rfHandled) +int CScene_DebugSetCamera::OnKeyDown(XUIMessageInput* pInputData, bool& rfHandled) { ui.AnimateKeyPress(pInputData->UserIndex, pInputData->dwKeyCode); switch(pInputData->dwKeyCode) @@ -102,7 +102,7 @@ HRESULT CScene_DebugSetCamera::OnKeyDown(XUIMessageInput* pInputData, BOOL& rfHa return S_OK; } -HRESULT CScene_DebugSetCamera::OnNotifyValueChanged( HXUIOBJ hObjSource, XUINotifyValueChanged *pNotifyValueChangedData, BOOL &bHandled) +int CScene_DebugSetCamera::OnNotifyValueChanged( HXUIOBJ hObjSource, XUINotifyValueChanged *pNotifyValueChangedData, bool &bHandled) { // Text Boxes diff --git a/src/client/Common/XUI/XUI_DebugSetCamera.h b/src/client/Common/XUI/XUI_DebugSetCamera.h index 900b7fe7..5304d1a2 100644 --- a/src/client/Common/XUI/XUI_DebugSetCamera.h +++ b/src/client/Common/XUI/XUI_DebugSetCamera.h @@ -41,10 +41,10 @@ protected: MAP_CONTROL(IDC_Teleport, m_teleport) END_CONTROL_MAP() - HRESULT OnInit( XUIMessageInit* pInitData, BOOL& bHandled ); - HRESULT OnNotifyPressEx(HXUIOBJ hObjPressed, XUINotifyPress* pNotifyPressData, BOOL& rfHandled); - HRESULT OnKeyDown(XUIMessageInput* pInputData, BOOL& rfHandled); - HRESULT OnNotifyValueChanged( HXUIOBJ hObjSource, XUINotifyValueChanged *pNotifyValueChangedData, BOOL &bHandled); + int OnInit( XUIMessageInit* pInitData, bool& bHandled ); + int OnNotifyPressEx(HXUIOBJ hObjPressed, XUINotifyPress* pNotifyPressData, bool& rfHandled); + int OnKeyDown(XUIMessageInput* pInputData, bool& rfHandled); + int OnNotifyValueChanged( HXUIOBJ hObjSource, XUINotifyValueChanged *pNotifyValueChangedData, bool &bHandled); public: // Define the class. The class name must match the ClassOverride property diff --git a/src/client/Common/XUI/XUI_DebugTips.cpp b/src/client/Common/XUI/XUI_DebugTips.cpp index 614a3d7b..0460818b 100644 --- a/src/client/Common/XUI/XUI_DebugTips.cpp +++ b/src/client/Common/XUI/XUI_DebugTips.cpp @@ -7,7 +7,7 @@ //---------------------------------------------------------------------------------- // Performs initialization tasks - retrieves controls. //---------------------------------------------------------------------------------- -HRESULT CScene_DebugTips::OnInit( XUIMessageInit* pInitData, BOOL& bHandled ) +int CScene_DebugTips::OnInit( XUIMessageInit* pInitData, bool& bHandled ) { m_iPad = *(int *)pInitData->pvInitData; @@ -28,7 +28,7 @@ HRESULT CScene_DebugTips::OnInit( XUIMessageInit* pInitData, BOOL& bHandled ) } -HRESULT CScene_DebugTips::OnKeyDown(XUIMessageInput* pInputData, BOOL& rfHandled) +int CScene_DebugTips::OnKeyDown(XUIMessageInput* pInputData, bool& rfHandled) { //ui.AnimateKeyPress(pInputData->UserIndex, pInputData->dwKeyCode); diff --git a/src/client/Common/XUI/XUI_DebugTips.h b/src/client/Common/XUI/XUI_DebugTips.h index 10627d3c..879c4846 100644 --- a/src/client/Common/XUI/XUI_DebugTips.h +++ b/src/client/Common/XUI/XUI_DebugTips.h @@ -22,8 +22,8 @@ class CScene_DebugTips : public CXuiSceneImpl MAP_CONTROL(IDC_Tip, m_tip) END_CONTROL_MAP() - HRESULT OnInit( XUIMessageInit* pInitData, BOOL& bHandled ); - HRESULT OnKeyDown(XUIMessageInput* pInputData, BOOL& rfHandled); + int OnInit( XUIMessageInit* pInitData, bool& bHandled ); + int OnKeyDown(XUIMessageInput* pInputData, bool& rfHandled); public: // Define the class. The class name must match the ClassOverride property diff --git a/src/client/Common/XUI/XUI_FullscreenProgress.cpp b/src/client/Common/XUI/XUI_FullscreenProgress.cpp index 312ccbd3..b32a2d16 100644 --- a/src/client/Common/XUI/XUI_FullscreenProgress.cpp +++ b/src/client/Common/XUI/XUI_FullscreenProgress.cpp @@ -12,7 +12,7 @@ //---------------------------------------------------------------------------------- // Performs initialization tasks - retrieves controls. //---------------------------------------------------------------------------------- -HRESULT CScene_FullscreenProgress::OnInit( XUIMessageInit* pInitData, BOOL& bHandled ) +int CScene_FullscreenProgress::OnInit( XUIMessageInit* pInitData, bool& bHandled ) { MapChildControls(); @@ -65,7 +65,7 @@ HRESULT CScene_FullscreenProgress::OnInit( XUIMessageInit* pInitData, BOOL& bHan } // The framework calls this handler when the object is to be destroyed. -HRESULT CScene_FullscreenProgress::OnDestroy() +int CScene_FullscreenProgress::OnDestroy() { if( thread != NULL && thread != INVALID_HANDLE_VALUE ) delete thread; @@ -76,7 +76,7 @@ HRESULT CScene_FullscreenProgress::OnDestroy() return S_OK; } -HRESULT CScene_FullscreenProgress::OnKeyDown(XUIMessageInput* pInputData, BOOL& rfHandled) +int CScene_FullscreenProgress::OnKeyDown(XUIMessageInput* pInputData, bool& rfHandled) { ui.AnimateKeyPress(pInputData->UserIndex, pInputData->dwKeyCode); @@ -100,7 +100,7 @@ HRESULT CScene_FullscreenProgress::OnKeyDown(XUIMessageInput* pInputData, BOOL& //---------------------------------------------------------------------------------- // Updates the UI when the list selection changes. //---------------------------------------------------------------------------------- -HRESULT CScene_FullscreenProgress::OnNotifySelChanged( HXUIOBJ hObjSource, XUINotifySelChanged* pNotifySelChangedData, BOOL& bHandled ) +int CScene_FullscreenProgress::OnNotifySelChanged( HXUIOBJ hObjSource, XUINotifySelChanged* pNotifySelChangedData, bool& bHandled ) { return S_OK; @@ -109,7 +109,7 @@ HRESULT CScene_FullscreenProgress::OnNotifySelChanged( HXUIOBJ hObjSource, XUINo //---------------------------------------------------------------------------------- // Handler for the button press message. //---------------------------------------------------------------------------------- -HRESULT CScene_FullscreenProgress::OnNotifyPressEx(HXUIOBJ hObjPressed, XUINotifyPress* pNotifyPressData, BOOL& rfHandled) +int CScene_FullscreenProgress::OnNotifyPressEx(HXUIOBJ hObjPressed, XUINotifyPress* pNotifyPressData, bool& rfHandled) { // This assumes all buttons can only be pressed with the A button ui.AnimateKeyPress(pNotifyPressData->UserIndex, VK_PAD_A); @@ -165,7 +165,7 @@ HRESULT CScene_FullscreenProgress::OnNotifyPressEx(HXUIOBJ hObjPressed, XUINotif return S_OK; } -HRESULT CScene_FullscreenProgress::OnGetSourceDataText(XUIMessageGetSourceText *pGetSourceTextData, BOOL& bHandled) +int CScene_FullscreenProgress::OnGetSourceDataText(XUIMessageGetSourceText *pGetSourceTextData, bool& bHandled) { // This gets called every frame, so use it to update our two text boxes @@ -186,7 +186,7 @@ HRESULT CScene_FullscreenProgress::OnGetSourceDataText(XUIMessageGetSourceText * return S_OK; } -HRESULT CScene_FullscreenProgress::OnTransitionStart( XUIMessageTransition *pTransition, BOOL& bHandled ) +int CScene_FullscreenProgress::OnTransitionStart( XUIMessageTransition *pTransition, bool& bHandled ) { if(!threadStarted) { @@ -198,10 +198,10 @@ HRESULT CScene_FullscreenProgress::OnTransitionStart( XUIMessageTransition *pTra return S_OK; } -HRESULT CScene_FullscreenProgress::OnTimer( XUIMessageTimer *pTimer, BOOL& bHandled ) +int CScene_FullscreenProgress::OnTimer( XUIMessageTimer *pTimer, bool& bHandled ) { int code = thread->GetExitCode(); - DWORD exitcode = *((DWORD *)&code); + unsigned long exitcode = *((unsigned long *)&code); //app.DebugPrintf("CScene_FullscreenProgress Timer %d\n",pTimer->nId); @@ -242,7 +242,7 @@ HRESULT CScene_FullscreenProgress::OnTimer( XUIMessageTimer *pTimer, BOOL& bHand pMinecraft->progressRenderer->progressStartNoAbort( exitReasonStringId );*/ //app.NavigateBack(m_CompletionData->iPad); - UINT uiIDA[1]; + unsigned int uiIDA[1]; uiIDA[0]=IDS_CONFIRM_OK; StorageManager.RequestMessageBox( IDS_CONNECTION_FAILED, IDS_CONNECTION_LOST_SERVER, uiIDA,1,ProfileManager.GetPrimaryPad(),NULL,NULL, app.GetStringTable()); diff --git a/src/client/Common/XUI/XUI_FullscreenProgress.h b/src/client/Common/XUI/XUI_FullscreenProgress.h index 02e04cc9..18341ec9 100644 --- a/src/client/Common/XUI/XUI_FullscreenProgress.h +++ b/src/client/Common/XUI/XUI_FullscreenProgress.h @@ -41,14 +41,14 @@ protected: END_CONTROL_MAP() - HRESULT OnInit( XUIMessageInit* pInitData, BOOL& bHandled ); - HRESULT OnDestroy(); - HRESULT OnKeyDown(XUIMessageInput* pInputData, BOOL& rfHandled); - HRESULT OnNotifySelChanged( HXUIOBJ hObjSource, XUINotifySelChanged* pNotifySelChangedData, BOOL& bHandled ); - HRESULT OnNotifyPressEx(HXUIOBJ hObjPressed, XUINotifyPress* pNotifyPressData,BOOL& rfHandled); - HRESULT OnGetSourceDataText(XUIMessageGetSourceText *pGetSourceTextData, BOOL& bHandled); - HRESULT OnTransitionStart( XUIMessageTransition *pTransition, BOOL& bHandled ); - HRESULT OnTimer( XUIMessageTimer *pTimer, BOOL& bHandled ); + int OnInit( XUIMessageInit* pInitData, bool& bHandled ); + int OnDestroy(); + int OnKeyDown(XUIMessageInput* pInputData, bool& rfHandled); + int OnNotifySelChanged( HXUIOBJ hObjSource, XUINotifySelChanged* pNotifySelChangedData, bool& bHandled ); + int OnNotifyPressEx(HXUIOBJ hObjPressed, XUINotifyPress* pNotifyPressData,bool& rfHandled); + int OnGetSourceDataText(XUIMessageGetSourceText *pGetSourceTextData, bool& bHandled); + int OnTransitionStart( XUIMessageTransition *pTransition, bool& bHandled ); + int OnTimer( XUIMessageTimer *pTimer, bool& bHandled ); public: // Define the class. The class name must match the ClassOverride property @@ -58,10 +58,10 @@ public: private: bool m_threadCompleted; int m_iPad; - void (*m_cancelFunc)(LPVOID param); - void (*m_completeFunc)(LPVOID param); - LPVOID m_cancelFuncParam; - LPVOID m_completeFuncParam; + void (*m_cancelFunc)(void* param); + void (*m_completeFunc)(void* param); + void* m_cancelFuncParam; + void* m_completeFuncParam; D3DXVECTOR3 m_OriginalPosition; bool m_bWasCancelled; diff --git a/src/client/Common/XUI/XUI_HUD.cpp b/src/client/Common/XUI/XUI_HUD.cpp index 5b7aa929..4d985449 100644 --- a/src/client/Common/XUI/XUI_HUD.cpp +++ b/src/client/Common/XUI/XUI_HUD.cpp @@ -8,7 +8,7 @@ #include "net.minecraft.world.effect.h" #include "net.minecraft.world.level.material.h" -HRESULT CXuiSceneHud::OnInit( XUIMessageInit* pInitData, BOOL& bHandled ) +int CXuiSceneHud::OnInit( XUIMessageInit* pInitData, bool& bHandled ) { m_iPad = *(int *)pInitData->pvInitData; @@ -21,7 +21,7 @@ HRESULT CXuiSceneHud::OnInit( XUIMessageInit* pInitData, BOOL& bHandled ) return S_OK; } -HRESULT CXuiSceneHud::OnCustomMessage_Splitscreenplayer(bool bJoining, BOOL& bHandled) +int CXuiSceneHud::OnCustomMessage_Splitscreenplayer(bool bJoining, bool& bHandled) { bHandled=true; @@ -30,7 +30,7 @@ HRESULT CXuiSceneHud::OnCustomMessage_Splitscreenplayer(bool bJoining, BOOL& bHa return S_OK; } -HRESULT CXuiSceneHud::OnCustomMessage_TickScene() +int CXuiSceneHud::OnCustomMessage_TickScene() { Minecraft *pMinecraft = Minecraft::GetInstance(); if(pMinecraft->localplayers[m_iPad] == NULL || pMinecraft->localgameModes[m_iPad] == NULL) return S_OK; @@ -424,7 +424,7 @@ HRESULT CXuiSceneHud::OnCustomMessage_TickScene() return S_OK; } -HRESULT CXuiSceneHud::OnCustomMessage_DLCInstalled() +int CXuiSceneHud::OnCustomMessage_DLCInstalled() { // mounted DLC may have changed bool bPauseMenuDisplayed=false; @@ -449,7 +449,7 @@ HRESULT CXuiSceneHud::OnCustomMessage_DLCInstalled() } -HRESULT CXuiSceneHud::OnCustomMessage_DLCMountingComplete() +int CXuiSceneHud::OnCustomMessage_DLCMountingComplete() { // A join from invite may have installed the trial pack during the game. // Need to switch to the texture pack if it's not being used yet, and turn off background downloads diff --git a/src/client/Common/XUI/XUI_HUD.h b/src/client/Common/XUI/XUI_HUD.h index 1bf6bcbf..c67308be 100644 --- a/src/client/Common/XUI/XUI_HUD.h +++ b/src/client/Common/XUI/XUI_HUD.h @@ -117,11 +117,11 @@ protected: END_MAP_CHILD_CONTROLS() END_CONTROL_MAP() - HRESULT OnInit( XUIMessageInit* pInitData, BOOL& bHandled ); - HRESULT OnCustomMessage_Splitscreenplayer(bool bJoining, BOOL& bHandled); - HRESULT OnCustomMessage_TickScene(); - HRESULT OnCustomMessage_DLCInstalled(); - HRESULT OnCustomMessage_DLCMountingComplete(); + int OnInit( XUIMessageInit* pInitData, bool& bHandled ); + int OnCustomMessage_Splitscreenplayer(bool bJoining, bool& bHandled); + int OnCustomMessage_TickScene(); + int OnCustomMessage_DLCInstalled(); + int OnCustomMessage_DLCMountingComplete(); public: // Define the class. The class name must match the ClassOverride property // set for the scene in the UI Authoring tool. diff --git a/src/client/Common/XUI/XUI_HelpAndOptions.cpp b/src/client/Common/XUI/XUI_HelpAndOptions.cpp index ca831506..da18e497 100644 --- a/src/client/Common/XUI/XUI_HelpAndOptions.cpp +++ b/src/client/Common/XUI/XUI_HelpAndOptions.cpp @@ -10,7 +10,7 @@ //---------------------------------------------------------------------------------- // Performs initialization tasks - retrieves controls. //---------------------------------------------------------------------------------- -HRESULT CScene_HelpAndOptions::OnInit( XUIMessageInit* pInitData, BOOL& bHandled ) +int CScene_HelpAndOptions::OnInit( XUIMessageInit* pInitData, bool& bHandled ) { m_iPad = *(int *)pInitData->pvInitData; bool bNotInGame=(Minecraft::GetInstance()->level==NULL); @@ -138,7 +138,7 @@ HRESULT CScene_HelpAndOptions::OnInit( XUIMessageInit* pInitData, BOOL& bHandled return S_OK; } -/*HRESULT CScene_HelpAndOptions::OnTMSDLCFileRetrieved( ) +/*int CScene_HelpAndOptions::OnTMSDLCFileRetrieved( ) { bool bNotInGame=(Minecraft::GetInstance()->level==NULL); m_Timer.SetShow(false); @@ -249,7 +249,7 @@ HRESULT CScene_HelpAndOptions::OnInit( XUIMessageInit* pInitData, BOOL& bHandled return S_OK; }*/ -HRESULT CScene_HelpAndOptions::OnControlNavigate(XUIMessageControlNavigate *pControlNavigateData, BOOL& bHandled) +int CScene_HelpAndOptions::OnControlNavigate(XUIMessageControlNavigate *pControlNavigateData, bool& bHandled) { pControlNavigateData->hObjDest=XuiControlGetNavigation(pControlNavigateData->hObjSource,pControlNavigateData->nControlNavigate,true,true); @@ -264,7 +264,7 @@ HRESULT CScene_HelpAndOptions::OnControlNavigate(XUIMessageControlNavigate *pCon //---------------------------------------------------------------------------------- // Handler for the button press message. //---------------------------------------------------------------------------------- -HRESULT CScene_HelpAndOptions::OnNotifyPressEx(HXUIOBJ hObjPressed, XUINotifyPress* pNotifyPressData, BOOL& rfHandled) +int CScene_HelpAndOptions::OnNotifyPressEx(HXUIOBJ hObjPressed, XUINotifyPress* pNotifyPressData, bool& rfHandled) { // This assumes all buttons can only be pressed with the A button ui.AnimateKeyPress(pNotifyPressData->UserIndex, VK_PAD_A); @@ -309,7 +309,7 @@ HRESULT CScene_HelpAndOptions::OnNotifyPressEx(HXUIOBJ hObjPressed, XUINotifyPre return S_OK; } -HRESULT CScene_HelpAndOptions::OnKeyDown(XUIMessageInput* pInputData, BOOL& rfHandled) +int CScene_HelpAndOptions::OnKeyDown(XUIMessageInput* pInputData, bool& rfHandled) { if(m_bIgnoreInput) return S_OK; @@ -326,7 +326,7 @@ HRESULT CScene_HelpAndOptions::OnKeyDown(XUIMessageInput* pInputData, BOOL& rfHa case VK_PAD_B: case VK_ESCAPE: - BYTE userIndex = pInputData->UserIndex; + uint8_t userIndex = pInputData->UserIndex; if( !app.IsPauseMenuDisplayed(userIndex) ) { // If we are not from a pause menu, then we are from the main menu @@ -342,7 +342,7 @@ HRESULT CScene_HelpAndOptions::OnKeyDown(XUIMessageInput* pInputData, BOOL& rfHa return S_OK; } -HRESULT CScene_HelpAndOptions::OnNavReturn(HXUIOBJ hObj,BOOL& rfHandled) +int CScene_HelpAndOptions::OnNavReturn(HXUIOBJ hObj,bool& rfHandled) { bool bNotInGame=(Minecraft::GetInstance()->level==NULL); @@ -405,7 +405,7 @@ HRESULT CScene_HelpAndOptions::OnNavReturn(HXUIOBJ hObj,BOOL& rfHandled) // return 0; // } -HRESULT CScene_HelpAndOptions::OnTransitionStart( XUIMessageTransition *pTransition, BOOL& bHandled ) +int CScene_HelpAndOptions::OnTransitionStart( XUIMessageTransition *pTransition, bool& bHandled ) { if(pTransition->dwTransAction==XUI_TRANSITION_ACTION_DESTROY ) return S_OK; @@ -421,7 +421,7 @@ HRESULT CScene_HelpAndOptions::OnTransitionStart( XUIMessageTransition *pTransit float fMaxButton; float fWidth,fHeight; - HRESULT hr=XuiControlGetVisual(m_Buttons[0].m_hObj,&visual); + int hr=XuiControlGetVisual(m_Buttons[0].m_hObj,&visual); hr=XuiElementGetChildById(visual,L"text_Label",&text); hr=XuiElementGetBounds(text,&fTextVisualLen,&fHeight); m_Buttons[0].GetBounds(&fMaxButton,&fHeight); @@ -455,7 +455,7 @@ HRESULT CScene_HelpAndOptions::OnTransitionStart( XUIMessageTransition *pTransit } -HRESULT CScene_HelpAndOptions::OnCustomMessage_Splitscreenplayer(bool bJoining, BOOL& bHandled) +int CScene_HelpAndOptions::OnCustomMessage_Splitscreenplayer(bool bJoining, bool& bHandled) { bHandled=true; return app.AdjustSplitscreenScene_PlayerChanged(m_hObj,&m_OriginalPosition,m_iPad,bJoining,false); diff --git a/src/client/Common/XUI/XUI_HelpAndOptions.h b/src/client/Common/XUI/XUI_HelpAndOptions.h index 9ece2cd9..e00e8765 100644 --- a/src/client/Common/XUI/XUI_HelpAndOptions.h +++ b/src/client/Common/XUI/XUI_HelpAndOptions.h @@ -48,14 +48,14 @@ protected: END_CONTROL_MAP() - HRESULT OnInit( XUIMessageInit* pInitData, BOOL& bHandled ); - HRESULT OnNotifyPressEx(HXUIOBJ hObjPressed, XUINotifyPress* pNotifyPressData,BOOL& rfHandled); - HRESULT OnKeyDown(XUIMessageInput* pInputData, BOOL& rfHandled); - HRESULT OnNavReturn(HXUIOBJ hObj,BOOL& rfHandled); - HRESULT OnCustomMessage_Splitscreenplayer(bool bJoining, BOOL& bHandled); - HRESULT OnTransitionStart( XUIMessageTransition *pTransition, BOOL& bHandled ); - HRESULT OnControlNavigate(XUIMessageControlNavigate *pControlNavigateData, BOOL& bHandled); - //HRESULT OnTMSDLCFileRetrieved( ); + int OnInit( XUIMessageInit* pInitData, bool& bHandled ); + int OnNotifyPressEx(HXUIOBJ hObjPressed, XUINotifyPress* pNotifyPressData,bool& rfHandled); + int OnKeyDown(XUIMessageInput* pInputData, bool& rfHandled); + int OnNavReturn(HXUIOBJ hObj,bool& rfHandled); + int OnCustomMessage_Splitscreenplayer(bool bJoining, bool& bHandled); + int OnTransitionStart( XUIMessageTransition *pTransition, bool& bHandled ); + int OnControlNavigate(XUIMessageControlNavigate *pControlNavigateData, bool& bHandled); + //int OnTMSDLCFileRetrieved( ); public: // Define the class. The class name must match the ClassOverride property diff --git a/src/client/Common/XUI/XUI_HelpControls.cpp b/src/client/Common/XUI/XUI_HelpControls.cpp index 20d95087..2542f8ef 100644 --- a/src/client/Common/XUI/XUI_HelpControls.cpp +++ b/src/client/Common/XUI/XUI_HelpControls.cpp @@ -12,13 +12,13 @@ #define ALIGN_END 1 typedef struct { - WCHAR wchName[20]; + wchar_t wchName[20]; int iAlign; D3DXVECTOR3 vPos; } CONTROLDETAILS; -LPCWSTR CScene_Controls::m_LayoutNameA[3]= +const wchar_t* CScene_Controls::m_LayoutNameA[3]= { L"1", L"2", @@ -85,7 +85,7 @@ CONTROLDETAILS controlDetailsA[MAX_CONTROLS]= //---------------------------------------------------------------------------------- // Performs initialization tasks - retrieves controls. //---------------------------------------------------------------------------------- -HRESULT CScene_Controls::OnInit( XUIMessageInit* pInitData, BOOL& bHandled ) +int CScene_Controls::OnInit( XUIMessageInit* pInitData, bool& bHandled ) { MapChildControls(); XuiControlSetText(m_SouthPaw,app.GetString(IDS_SOUTHPAW)); @@ -137,7 +137,7 @@ HRESULT CScene_Controls::OnInit( XUIMessageInit* pInitData, BOOL& bHandled ) // get the figures HXUIOBJ hObj; - HRESULT hr; + int hr; // turn off all the figures to start with for(int i=0;iSetCurSelVisible(iSelected); m_iCurrentNavigatedControlsLayout=iSelected; - LPWSTR layoutString = new wchar_t[ 128 ]; + wchar_t* layoutString = new wchar_t[ 128 ]; swprintf( layoutString, 128, L"%ls : %ls", app.GetString( IDS_CURRENT_LAYOUT ),app.GetString(m_iSchemeTextA[iSelected])); XuiControlSetText(m_CurrentLayout,layoutString); @@ -196,10 +196,10 @@ HRESULT CScene_Controls::OnInit( XUIMessageInit* pInitData, BOOL& bHandled ) delete [] layoutString; // Set check box initial states. - BOOL bInvertLook = app.GetGameSettings(m_iPad,eGameSetting_ControlInvertLook); + bool bInvertLook = app.GetGameSettings(m_iPad,eGameSetting_ControlInvertLook); m_InvertLook.SetCheck( bInvertLook ); - BOOL bSouthPaw = app.GetGameSettings(m_iPad,eGameSetting_ControlSouthPaw); + bool bSouthPaw = app.GetGameSettings(m_iPad,eGameSetting_ControlSouthPaw); m_SouthPaw.SetCheck( bSouthPaw ); return S_OK; @@ -207,7 +207,7 @@ HRESULT CScene_Controls::OnInit( XUIMessageInit* pInitData, BOOL& bHandled ) -HRESULT CScene_Controls::OnTransitionStart( XUIMessageTransition *pTransition, BOOL& bHandled ) +int CScene_Controls::OnTransitionStart( XUIMessageTransition *pTransition, bool& bHandled ) { if(pTransition->dwTransAction==XUI_TRANSITION_ACTION_DESTROY ) return S_OK; @@ -288,11 +288,11 @@ void CScene_Controls::PositionAllText(int iPad) } } -HRESULT CScene_Controls::OnKeyDown(XUIMessageInput* pInputData, BOOL& rfHandled) +int CScene_Controls::OnKeyDown(XUIMessageInput* pInputData, bool& rfHandled) { ui.AnimateKeyPress(pInputData->UserIndex, pInputData->dwKeyCode); - HRESULT hr=S_OK; + int hr=S_OK; // Explicitly handle B button presses switch(pInputData->dwKeyCode) @@ -315,7 +315,7 @@ void CScene_Controls::PositionText(int iPad,int iTextID, unsigned char ucAction) // position the text depending on the control id //int iTextWidth; XUIRect xuiRect; - LPCWSTR pwchText; + const wchar_t* pwchText; D3DXVECTOR3 vpos,vScale; HXUIOBJ hFigGroup; unsigned int uiVal=InputManager.GetGameJoypadMaps(m_iCurrentNavigatedControlsLayout,ucAction); @@ -328,12 +328,12 @@ void CScene_Controls::PositionText(int iPad,int iTextID, unsigned char ucAction) if(m_TextPresenterA[m_iCurrentTextIndex]==NULL) { HXUIOBJ hObj=NULL; - HRESULT hr=XuiControlGetVisual(m_TextA[m_iCurrentTextIndex].m_hObj,&hObj); + int hr=XuiControlGetVisual(m_TextA[m_iCurrentTextIndex].m_hObj,&hObj); hr=XuiElementGetChildById(hObj,L"Text",&m_TextPresenterA[m_iCurrentTextIndex]); } pwchText=app.GetString(iTextID); - HRESULT hr=XuiTextPresenterMeasureText(m_TextPresenterA[m_iCurrentTextIndex], pwchText, &xuiRect); + int hr=XuiTextPresenterMeasureText(m_TextPresenterA[m_iCurrentTextIndex], pwchText, &xuiRect); m_TextA[m_iCurrentTextIndex].SetBounds(xuiRect.right,xuiRect.bottom); int iControlDetailsIndex=0; @@ -438,7 +438,7 @@ void CScene_Controls::PositionTextDirect(int iPad,int iTextID, int iControlDetai // position the text depending on the control id //int iTextWidth; XUIRect xuiRect; - LPCWSTR pwchText; + const wchar_t* pwchText; D3DXVECTOR3 vpos,vScale; HXUIOBJ hFigGroup; @@ -455,12 +455,12 @@ void CScene_Controls::PositionTextDirect(int iPad,int iTextID, int iControlDetai if(m_TextPresenterA[m_iCurrentTextIndex]==NULL) { HXUIOBJ hObj=NULL; - HRESULT hr=XuiControlGetVisual(m_TextA[m_iCurrentTextIndex].m_hObj,&hObj); + int hr=XuiControlGetVisual(m_TextA[m_iCurrentTextIndex].m_hObj,&hObj); hr=XuiElementGetChildById(hObj,L"Text",&m_TextPresenterA[m_iCurrentTextIndex]); } pwchText=app.GetString(iTextID); - HRESULT hr=XuiTextPresenterMeasureText(m_TextPresenterA[m_iCurrentTextIndex], pwchText, &xuiRect); + int hr=XuiTextPresenterMeasureText(m_TextPresenterA[m_iCurrentTextIndex], pwchText, &xuiRect); m_TextA[m_iCurrentTextIndex].SetBounds(xuiRect.right,xuiRect.bottom); @@ -506,7 +506,7 @@ void CScene_Controls::PositionTextDirect(int iPad,int iTextID, int iControlDetai m_iCurrentTextIndex++; } -HRESULT CScene_Controls::OnNotifySelChanged( HXUIOBJ hObjSource, XUINotifySelChanged* pNotifySelChangedData, BOOL& bHandled ) +int CScene_Controls::OnNotifySelChanged( HXUIOBJ hObjSource, XUINotifySelChanged* pNotifySelChangedData, bool& bHandled ) { if( ( !m_bIgnoreNotifies )&&( hObjSource==m_pLayoutList->m_hObj ) ) { @@ -523,7 +523,7 @@ HRESULT CScene_Controls::OnNotifySelChanged( HXUIOBJ hObjSource, XUINotifySelCha -HRESULT CScene_Controls::OnNotifyPressEx(HXUIOBJ hObjPressed, XUINotifyPress* pNotifyPressData,BOOL& rfHandled) +int CScene_Controls::OnNotifyPressEx(HXUIOBJ hObjPressed, XUINotifyPress* pNotifyPressData,bool& rfHandled) { // This assumes all buttons can only be pressed with the A button ui.AnimateKeyPress(pNotifyPressData->UserIndex, VK_PAD_A); @@ -531,12 +531,12 @@ HRESULT CScene_Controls::OnNotifyPressEx(HXUIOBJ hObjPressed, XUINotifyPress* pN // Handle check box changes. if ( hObjPressed == m_InvertLook.m_hObj ) { - BOOL bIsChecked = m_InvertLook.IsChecked(); + bool bIsChecked = m_InvertLook.IsChecked(); app.SetGameSettings(m_iPad,eGameSetting_ControlInvertLook,(unsigned char)( bIsChecked ) ); } else if ( hObjPressed == m_SouthPaw.m_hObj ) { - BOOL bIsChecked = m_SouthPaw.IsChecked(); + bool bIsChecked = m_SouthPaw.IsChecked(); app.SetGameSettings(m_iPad,eGameSetting_ControlSouthPaw,(unsigned char)( bIsChecked ) ); PositionAllText(m_iPad); } @@ -544,7 +544,7 @@ HRESULT CScene_Controls::OnNotifyPressEx(HXUIOBJ hObjPressed, XUINotifyPress* pN { // check what's been selected app.SetGameSettings(m_iPad,eGameSetting_ControlScheme,(unsigned char)m_SchemeList.GetCurSel()); - LPWSTR layoutString = new wchar_t[ 128 ]; + wchar_t* layoutString = new wchar_t[ 128 ]; swprintf( layoutString, 128, L"%ls : %ls", app.GetString( IDS_CURRENT_LAYOUT ),app.GetString(m_iSchemeTextA[m_SchemeList.GetCurSel()]) ); XuiControlSetText(m_CurrentLayout,layoutString); @@ -559,7 +559,7 @@ HRESULT CScene_Controls::OnNotifyPressEx(HXUIOBJ hObjPressed, XUINotifyPress* pN return S_OK; } -HRESULT CScene_Controls::OnCustomMessage_Splitscreenplayer(bool bJoining, BOOL& bHandled) +int CScene_Controls::OnCustomMessage_Splitscreenplayer(bool bJoining, bool& bHandled) { bHandled=true; return app.AdjustSplitscreenScene_PlayerChanged(m_hObj,&m_OriginalPosition,m_iPad,bJoining,32.0f); diff --git a/src/client/Common/XUI/XUI_HelpControls.h b/src/client/Common/XUI/XUI_HelpControls.h index 4d14953b..260ac081 100644 --- a/src/client/Common/XUI/XUI_HelpControls.h +++ b/src/client/Common/XUI/XUI_HelpControls.h @@ -21,7 +21,7 @@ class CScene_Controls : public CXuiSceneImpl CXuiControl m_CurrentLayout; CXuiCheckbox m_InvertLook; CXuiCheckbox m_SouthPaw; - static LPCWSTR m_LayoutNameA[3]; + static const wchar_t* m_LayoutNameA[3]; // Message map. Here we tie messages to message handlers. XUI_BEGIN_MSG_MAP() @@ -81,12 +81,12 @@ class CScene_Controls : public CXuiSceneImpl END_MAP_CHILD_CONTROLS() END_CONTROL_MAP() - HRESULT OnInit( XUIMessageInit* pInitData, BOOL& bHandled ); - HRESULT OnKeyDown(XUIMessageInput* pInputData, BOOL& rfHandled); - HRESULT OnNotifySelChanged( HXUIOBJ hObjSource, XUINotifySelChanged* pNotifySelChangedData, BOOL& bHandled ); - HRESULT OnNotifyPressEx(HXUIOBJ hObjPressed, XUINotifyPress* pNotifyPressData,BOOL& rfHandled); - HRESULT OnCustomMessage_Splitscreenplayer(bool bJoining, BOOL& bHandled); - HRESULT OnTransitionStart( XUIMessageTransition *pTransition, BOOL& bHandled ); + int OnInit( XUIMessageInit* pInitData, bool& bHandled ); + int OnKeyDown(XUIMessageInput* pInputData, bool& rfHandled); + int OnNotifySelChanged( HXUIOBJ hObjSource, XUINotifySelChanged* pNotifySelChangedData, bool& bHandled ); + int OnNotifyPressEx(HXUIOBJ hObjPressed, XUINotifyPress* pNotifyPressData,bool& rfHandled); + int OnCustomMessage_Splitscreenplayer(bool bJoining, bool& bHandled); + int OnTransitionStart( XUIMessageTransition *pTransition, bool& bHandled ); void PositionText(int iPad,int iTextID, unsigned char ucAction); diff --git a/src/client/Common/XUI/XUI_HelpCredits.cpp b/src/client/Common/XUI/XUI_HelpCredits.cpp index 1666ffe7..57b00547 100644 --- a/src/client/Common/XUI/XUI_HelpCredits.cpp +++ b/src/client/Common/XUI/XUI_HelpCredits.cpp @@ -384,7 +384,7 @@ static const int gs_aNumTextElements[ eNumTextTypes ] = //---------------------------------------------------------------------------------- // Performs initialization tasks - retrieves controls. //---------------------------------------------------------------------------------- -HRESULT CScene_Credits::OnInit( XUIMessageInit* pInitData, BOOL& bHandled ) +int CScene_Credits::OnInit( XUIMessageInit* pInitData, bool& bHandled ) { int iPad = *(int *)pInitData->pvInitData; @@ -422,7 +422,7 @@ HRESULT CScene_Credits::OnInit( XUIMessageInit* pInitData, BOOL& bHandled ) // Init text elements. int iIDTag = 1; - LPWSTR idString = new wchar_t[ 32 ]; + wchar_t* idString = new wchar_t[ 32 ]; for ( int i = 0; i < eNumTextTypes; ++i ) { @@ -439,7 +439,7 @@ HRESULT CScene_Credits::OnInit( XUIMessageInit* pInitData, BOOL& bHandled ) HXUIOBJ text; GetChildById( idString, &text ); - VOID* pTextObj; + void* pTextObj; XuiObjectFromHandle( text, &pTextObj ); m_aTextTypes[ i ].m_appTextElements[ j ] = (CXuiControl *)pTextObj; m_aTextTypes[ i ].m_appTextElements[ j ]->SetShow( false ); @@ -459,13 +459,13 @@ HRESULT CScene_Credits::OnInit( XUIMessageInit* pInitData, BOOL& bHandled ) m_fMoveToNextDef = 0.0f; // Add timer to tick credits update at 60Hz - HRESULT timerResult = SetTimer( CREDITS_TICK_TIMER_ID, ( 1000 / 60 ) ); + int timerResult = SetTimer( CREDITS_TICK_TIMER_ID, ( 1000 / 60 ) ); assert( timerResult == S_OK ); return S_OK; } -HRESULT CScene_Credits::OnDestroy() +int CScene_Credits::OnDestroy() { // Free up memory that we allocated. for ( int i = 0; i < eNumTextTypes; ++i ) @@ -476,11 +476,11 @@ HRESULT CScene_Credits::OnDestroy() return S_OK; } -HRESULT CScene_Credits::OnKeyDown(XUIMessageInput* pInputData, BOOL& rfHandled) +int CScene_Credits::OnKeyDown(XUIMessageInput* pInputData, bool& rfHandled) { ui.AnimateKeyPress(pInputData->UserIndex, pInputData->dwKeyCode); - HRESULT hr=S_OK; + int hr=S_OK; // Explicitly handle B button presses switch(pInputData->dwKeyCode) @@ -497,10 +497,10 @@ HRESULT CScene_Credits::OnKeyDown(XUIMessageInput* pInputData, BOOL& rfHandled) return hr; } -HRESULT CScene_Credits::OnControlNavigate(XUIMessageControlNavigate *pControlNavigateData, BOOL& bHandled) +int CScene_Credits::OnControlNavigate(XUIMessageControlNavigate *pControlNavigateData, bool& bHandled) { // ignore any joypads other than the main - BYTE bFocusUser=XuiElementGetFocusUser(pControlNavigateData->hObjSource); + uint8_t bFocusUser=XuiElementGetFocusUser(pControlNavigateData->hObjSource); // get the user from the control /*if(!=ProfileManager.GetLockedProfile()) { @@ -513,7 +513,7 @@ HRESULT CScene_Credits::OnControlNavigate(XUIMessageControlNavigate *pControlNav //---------------------------------------------------------------------------------- // Handler for the button press message. //---------------------------------------------------------------------------------- -HRESULT CScene_Credits::OnNotifyPressEx(HXUIOBJ hObjPressed, XUINotifyPress* pNotifyPressData, BOOL& rfHandled) +int CScene_Credits::OnNotifyPressEx(HXUIOBJ hObjPressed, XUINotifyPress* pNotifyPressData, bool& rfHandled) { // This assumes all buttons can only be pressed with the A button ui.AnimateKeyPress(pNotifyPressData->UserIndex, VK_PAD_A); @@ -524,7 +524,7 @@ HRESULT CScene_Credits::OnNotifyPressEx(HXUIOBJ hObjPressed, XUINotifyPress* pNo -HRESULT CScene_Credits::OnTimer( XUIMessageTimer *pTimer, BOOL& bHandled ) +int CScene_Credits::OnTimer( XUIMessageTimer *pTimer, bool& bHandled ) { // Update pointer from stick input on timer. if ( pTimer->nId == CREDITS_TICK_TIMER_ID ) @@ -572,7 +572,7 @@ HRESULT CScene_Credits::OnTimer( XUIMessageTimer *pTimer, BOOL& bHandled ) } else // using additional translated string. { - LPWSTR creditsString = new wchar_t[ 128 ]; + wchar_t* creditsString = new wchar_t[ 128 ]; if(pDef->m_iStringID[1]!=NO_TRANSLATED_STRING) { swprintf( creditsString, 128, pDef->m_Text, app.GetString( pDef->m_iStringID[0] ), app.GetString( pDef->m_iStringID[1] ) ); diff --git a/src/client/Common/XUI/XUI_HelpCredits.h b/src/client/Common/XUI/XUI_HelpCredits.h index 078c1935..929aaa33 100644 --- a/src/client/Common/XUI/XUI_HelpCredits.h +++ b/src/client/Common/XUI/XUI_HelpCredits.h @@ -27,12 +27,12 @@ protected: END_CONTROL_MAP() - HRESULT OnInit( XUIMessageInit* pInitData, BOOL& bHandled ); - HRESULT OnKeyDown(XUIMessageInput* pInputData, BOOL& rfHandled); - HRESULT OnNotifyPressEx(HXUIOBJ hObjPressed, XUINotifyPress* pNotifyPressData,BOOL& rfHandled); - HRESULT OnControlNavigate(XUIMessageControlNavigate *pControlNavigateData, BOOL& bHandled); - HRESULT OnTimer( XUIMessageTimer *pTimer, BOOL& bHandled ); - HRESULT OnDestroy(); + int OnInit( XUIMessageInit* pInitData, bool& bHandled ); + int OnKeyDown(XUIMessageInput* pInputData, bool& rfHandled); + int OnNotifyPressEx(HXUIOBJ hObjPressed, XUINotifyPress* pNotifyPressData,bool& rfHandled); + int OnControlNavigate(XUIMessageControlNavigate *pControlNavigateData, bool& bHandled); + int OnTimer( XUIMessageTimer *pTimer, bool& bHandled ); + int OnDestroy(); private: diff --git a/src/client/Common/XUI/XUI_HelpHowToPlay.cpp b/src/client/Common/XUI/XUI_HelpHowToPlay.cpp index 28d5d319..64462d6f 100644 --- a/src/client/Common/XUI/XUI_HelpHowToPlay.cpp +++ b/src/client/Common/XUI/XUI_HelpHowToPlay.cpp @@ -36,7 +36,7 @@ static SHowToPlayPageDef gs_aPageDefs[ eHowToPlay_NumPages ] = //---------------------------------------------------------------------------------- // Performs initialization tasks - retrieves controls. //---------------------------------------------------------------------------------- -HRESULT CScene_HowToPlay::OnInit( XUIMessageInit* pInitData, BOOL& bHandled ) +int CScene_HowToPlay::OnInit( XUIMessageInit* pInitData, bool& bHandled ) { // Extract pad and required page from init data. We just put the data into the pointer rather than using it as an address. size_t uiInitData = ( size_t )( pInitData->pvInitData ); @@ -99,7 +99,7 @@ HRESULT CScene_HowToPlay::OnInit( XUIMessageInit* pInitData, BOOL& bHandled ) return S_OK; } -HRESULT CScene_HowToPlay::OnKeyDown(XUIMessageInput* pInputData, BOOL& rfHandled) +int CScene_HowToPlay::OnKeyDown(XUIMessageInput* pInputData, bool& rfHandled) { ui.AnimateKeyPress(pInputData->UserIndex, pInputData->dwKeyCode); @@ -231,7 +231,7 @@ void CScene_HowToPlay::StartPage( EHowToPlayPage ePage ) TelemetryManager->RecordMenuShown(m_iPad, eUIScene_HowToPlay, (ETelemetry_HowToPlay_SubMenuId)ePage); } -HRESULT CScene_HowToPlay::OnCustomMessage_Splitscreenplayer(bool bJoining, BOOL& bHandled) +int CScene_HowToPlay::OnCustomMessage_Splitscreenplayer(bool bJoining, bool& bHandled) { bHandled=true; return app.AdjustSplitscreenScene_PlayerChanged(m_hObj,&m_OriginalPosition,m_iPad,bJoining); diff --git a/src/client/Common/XUI/XUI_HelpHowToPlay.h b/src/client/Common/XUI/XUI_HelpHowToPlay.h index 8a37e925..95c7b6a8 100644 --- a/src/client/Common/XUI/XUI_HelpHowToPlay.h +++ b/src/client/Common/XUI/XUI_HelpHowToPlay.h @@ -201,9 +201,9 @@ protected: END_CONTROL_MAP() - HRESULT OnInit( XUIMessageInit* pInitData, BOOL& bHandled ); - HRESULT OnKeyDown(XUIMessageInput* pInputData, BOOL& rfHandled); - HRESULT OnCustomMessage_Splitscreenplayer(bool bJoining, BOOL& bHandled); + int OnInit( XUIMessageInit* pInitData, bool& bHandled ); + int OnKeyDown(XUIMessageInput* pInputData, bool& rfHandled); + int OnCustomMessage_Splitscreenplayer(bool bJoining, bool& bHandled); void StartPage( EHowToPlayPage ePage ); public: diff --git a/src/client/Common/XUI/XUI_Helper.h b/src/client/Common/XUI/XUI_Helper.h index cb476185..e6994abd 100644 --- a/src/client/Common/XUI/XUI_Helper.h +++ b/src/client/Common/XUI/XUI_Helper.h @@ -1,9 +1,9 @@ #pragma once #define BEGIN_CONTROL_MAP() \ - HRESULT MapChildControls() \ + int MapChildControls() \ { \ - HRESULT hr = S_OK; \ + int hr = S_OK; \ CXuiElement e = m_hObj; \ @@ -27,7 +27,7 @@ HXUIOBJ h; \ hr = e.GetChildById(name, &h); \ assert(hr==0); \ - hr = XuiObjectFromHandle(h, reinterpret_cast(&member)); \ + hr = XuiObjectFromHandle(h, reinterpret_cast(&member)); \ assert(hr==0); \ } \ diff --git a/src/client/Common/XUI/XUI_HowToPlayMenu.cpp b/src/client/Common/XUI/XUI_HowToPlayMenu.cpp index 0fdbc412..6b50f0de 100644 --- a/src/client/Common/XUI/XUI_HowToPlayMenu.cpp +++ b/src/client/Common/XUI/XUI_HowToPlayMenu.cpp @@ -63,7 +63,7 @@ unsigned int CScene_HowToPlayMenu::m_uiHTPSceneA[]= //---------------------------------------------------------------------------------- // Performs initialization tasks - retrieves controls. //---------------------------------------------------------------------------------- -HRESULT CScene_HowToPlayMenu::OnInit( XUIMessageInit* pInitData, BOOL& bHandled ) +int CScene_HowToPlayMenu::OnInit( XUIMessageInit* pInitData, bool& bHandled ) { m_iPad = *(int *)pInitData->pvInitData; // if we're not in the game, we need to use basescene 0 @@ -82,7 +82,7 @@ HRESULT CScene_HowToPlayMenu::OnInit( XUIMessageInit* pInitData, BOOL& bHandled // 4J-PB - changing all versions to use a list of buttons, since we're adding some // We're going to use a list of buttons here CXuiElement e = m_hObj; - HRESULT hr = e.GetChildById(L"HowToListButtons", &m_ButtonList); + int hr = e.GetChildById(L"HowToListButtons", &m_ButtonList); m_iButtons=eHTPButton_Max; for(int i=0;ibItemData ) { @@ -142,7 +142,7 @@ HRESULT CScene_HowToPlayMenu::OnGetSourceDataText(XUIMessageGetSourceText *pGetS return S_OK; } -HRESULT CScene_HowToPlayMenu::OnGetItemCountAll(XUIMessageGetItemCount *pGetItemCountData, BOOL& bHandled) +int CScene_HowToPlayMenu::OnGetItemCountAll(XUIMessageGetItemCount *pGetItemCountData, bool& bHandled) { pGetItemCountData->cItems = m_iButtons; bHandled = true; @@ -150,7 +150,7 @@ HRESULT CScene_HowToPlayMenu::OnGetItemCountAll(XUIMessageGetItemCount *pGetItem } -HRESULT CScene_HowToPlayMenu::OnNotifySelChanged(HXUIOBJ hObjSource, XUINotifySelChanged *pNotifySelChangedData, BOOL& bHandled) +int CScene_HowToPlayMenu::OnNotifySelChanged(HXUIOBJ hObjSource, XUINotifySelChanged *pNotifySelChangedData, bool& bHandled) { // In a list, we need to play the 'focus' sound ourselves if((pNotifySelChangedData->iOldItem!=-1) && m_ButtonList && (hObjSource==m_ButtonList.m_hObj)) @@ -163,7 +163,7 @@ HRESULT CScene_HowToPlayMenu::OnNotifySelChanged(HXUIOBJ hObjSource, XUINotifySe //---------------------------------------------------------------------------------- // Handler for the button press message. //---------------------------------------------------------------------------------- -HRESULT CScene_HowToPlayMenu::OnNotifyPressEx(HXUIOBJ hObjPressed, XUINotifyPress* pNotifyPressData, BOOL& rfHandled) +int CScene_HowToPlayMenu::OnNotifyPressEx(HXUIOBJ hObjPressed, XUINotifyPress* pNotifyPressData, bool& rfHandled) { // This assumes all buttons can only be pressed with the A button ui.AnimateKeyPress(pNotifyPressData->UserIndex, VK_PAD_A); @@ -200,7 +200,7 @@ HRESULT CScene_HowToPlayMenu::OnNotifyPressEx(HXUIOBJ hObjPressed, XUINotifyPres return S_OK; } -HRESULT CScene_HowToPlayMenu::OnKeyDown(XUIMessageInput* pInputData, BOOL& rfHandled) +int CScene_HowToPlayMenu::OnKeyDown(XUIMessageInput* pInputData, bool& rfHandled) { ui.AnimateKeyPress(pInputData->UserIndex, pInputData->dwKeyCode); @@ -218,14 +218,14 @@ HRESULT CScene_HowToPlayMenu::OnKeyDown(XUIMessageInput* pInputData, BOOL& rfHan return S_OK; } -HRESULT CScene_HowToPlayMenu::OnNavReturn(HXUIOBJ hObj,BOOL& rfHandled) +int CScene_HowToPlayMenu::OnNavReturn(HXUIOBJ hObj,bool& rfHandled) { ui.SetTooltips( m_iPad, IDS_TOOLTIPS_SELECT,IDS_TOOLTIPS_BACK); return S_OK; } -HRESULT CScene_HowToPlayMenu::OnCustomMessage_Splitscreenplayer(bool bJoining, BOOL& bHandled) +int CScene_HowToPlayMenu::OnCustomMessage_Splitscreenplayer(bool bJoining, bool& bHandled) { bHandled=true; return app.AdjustSplitscreenScene_PlayerChanged(m_hObj,&m_OriginalPosition,m_iPad,bJoining,false); diff --git a/src/client/Common/XUI/XUI_HowToPlayMenu.h b/src/client/Common/XUI/XUI_HowToPlayMenu.h index ba334c80..4e9b4e11 100644 --- a/src/client/Common/XUI/XUI_HowToPlayMenu.h +++ b/src/client/Common/XUI/XUI_HowToPlayMenu.h @@ -51,14 +51,14 @@ protected: XUI_END_MSG_MAP() - HRESULT OnInit( XUIMessageInit* pInitData, BOOL& bHandled ); - HRESULT OnNotifyPressEx(HXUIOBJ hObjPressed, XUINotifyPress* pNotifyPressData,BOOL& rfHandled); - HRESULT OnKeyDown(XUIMessageInput* pInputData, BOOL& rfHandled); - HRESULT OnNavReturn(HXUIOBJ hObj,BOOL& rfHandled); - HRESULT OnCustomMessage_Splitscreenplayer(bool bJoining, BOOL& bHandled); - HRESULT OnGetSourceDataText(XUIMessageGetSourceText *pGetSourceTextData, BOOL& bHandled); - HRESULT OnGetItemCountAll(XUIMessageGetItemCount *pGetItemCountData, BOOL& bHandled); - HRESULT OnNotifySelChanged(HXUIOBJ hObjSource, XUINotifySelChanged *pNotifySelChangedData, BOOL& bHandled); + int OnInit( XUIMessageInit* pInitData, bool& bHandled ); + int OnNotifyPressEx(HXUIOBJ hObjPressed, XUINotifyPress* pNotifyPressData,bool& rfHandled); + int OnKeyDown(XUIMessageInput* pInputData, bool& rfHandled); + int OnNavReturn(HXUIOBJ hObj,bool& rfHandled); + int OnCustomMessage_Splitscreenplayer(bool bJoining, bool& bHandled); + int OnGetSourceDataText(XUIMessageGetSourceText *pGetSourceTextData, bool& bHandled); + int OnGetItemCountAll(XUIMessageGetItemCount *pGetItemCountData, bool& bHandled); + int OnNotifySelChanged(HXUIOBJ hObjSource, XUINotifySelChanged *pNotifySelChangedData, bool& bHandled); public: diff --git a/src/client/Common/XUI/XUI_InGameHostOptions.cpp b/src/client/Common/XUI/XUI_InGameHostOptions.cpp index 378db90e..9a92eaa0 100644 --- a/src/client/Common/XUI/XUI_InGameHostOptions.cpp +++ b/src/client/Common/XUI/XUI_InGameHostOptions.cpp @@ -10,7 +10,7 @@ //---------------------------------------------------------------------------------- // Performs initialization tasks - retrieves controls. //---------------------------------------------------------------------------------- -HRESULT CScene_InGameHostOptions::OnInit( XUIMessageInit* pInitData, BOOL& bHandled ) +int CScene_InGameHostOptions::OnInit( XUIMessageInit* pInitData, bool& bHandled ) { m_iPad = *(int *)pInitData->pvInitData; @@ -57,7 +57,7 @@ HRESULT CScene_InGameHostOptions::OnInit( XUIMessageInit* pInitData, BOOL& bHand } -HRESULT CScene_InGameHostOptions::OnKeyDown(XUIMessageInput* pInputData, BOOL& rfHandled) +int CScene_InGameHostOptions::OnKeyDown(XUIMessageInput* pInputData, bool& rfHandled) { ui.AnimateKeyPress(pInputData->UserIndex, pInputData->dwKeyCode); @@ -93,7 +93,7 @@ HRESULT CScene_InGameHostOptions::OnKeyDown(XUIMessageInput* pInputData, BOOL& r //---------------------------------------------------------------------------------- // Handler for the button press message. //---------------------------------------------------------------------------------- -HRESULT CScene_InGameHostOptions::OnNotifyPressEx(HXUIOBJ hObjPressed, XUINotifyPress* pNotifyPressData, BOOL& rfHandled) +int CScene_InGameHostOptions::OnNotifyPressEx(HXUIOBJ hObjPressed, XUINotifyPress* pNotifyPressData, bool& rfHandled) { // This assumes all buttons can only be pressed with the A button ui.AnimateKeyPress(pNotifyPressData->UserIndex, VK_PAD_A); diff --git a/src/client/Common/XUI/XUI_InGameHostOptions.h b/src/client/Common/XUI/XUI_InGameHostOptions.h index a2e95ec9..24c9d1cf 100644 --- a/src/client/Common/XUI/XUI_InGameHostOptions.h +++ b/src/client/Common/XUI/XUI_InGameHostOptions.h @@ -26,9 +26,9 @@ protected: END_CONTROL_MAP() - HRESULT OnInit( XUIMessageInit* pInitData, BOOL& bHandled ); - HRESULT OnKeyDown(XUIMessageInput* pInputData, BOOL& rfHandled); - HRESULT OnNotifyPressEx(HXUIOBJ hObjPressed, XUINotifyPress* pNotifyPressData, BOOL& rfHandled); + int OnInit( XUIMessageInit* pInitData, bool& bHandled ); + int OnKeyDown(XUIMessageInput* pInputData, bool& rfHandled); + int OnNotifyPressEx(HXUIOBJ hObjPressed, XUINotifyPress* pNotifyPressData, bool& rfHandled); public: diff --git a/src/client/Common/XUI/XUI_InGameInfo.cpp b/src/client/Common/XUI/XUI_InGameInfo.cpp index 03ad47b5..37f9dcfe 100644 --- a/src/client/Common/XUI/XUI_InGameInfo.cpp +++ b/src/client/Common/XUI/XUI_InGameInfo.cpp @@ -22,7 +22,7 @@ //---------------------------------------------------------------------------------- // Performs initialization tasks - retrieves controls. //---------------------------------------------------------------------------------- -HRESULT CScene_InGameInfo::OnInit( XUIMessageInit* pInitData, BOOL& bHandled ) +int CScene_InGameInfo::OnInit( XUIMessageInit* pInitData, bool& bHandled ) { m_bIgnoreKeyPresses=true; m_iPad = *(int *)pInitData->pvInitData; @@ -37,10 +37,10 @@ HRESULT CScene_InGameInfo::OnInit( XUIMessageInit* pInitData, BOOL& bHandled ) app.AdjustSplitscreenScene(m_hObj,&m_OriginalPosition,m_iPad); } - DWORD playerCount = g_NetworkManager.GetPlayerCount(); + unsigned long playerCount = g_NetworkManager.GetPlayerCount(); m_playersCount = 0; - for(DWORD i = 0; i < playerCount; ++i) + for(unsigned long i = 0; i < playerCount; ++i) { INetworkPlayer *player = g_NetworkManager.GetPlayerByIndex( i ); @@ -90,7 +90,7 @@ HRESULT CScene_InGameInfo::OnInit( XUIMessageInit* pInitData, BOOL& bHandled ) return S_OK; } -HRESULT CScene_InGameInfo::OnDestroy() +int CScene_InGameInfo::OnDestroy() { XuiKillTimer(m_hObj,TOOLTIP_TIMERID); g_NetworkManager.UnRegisterPlayerChangedCallback(m_iPad, &CScene_InGameInfo::OnPlayerChanged, this); @@ -100,7 +100,7 @@ HRESULT CScene_InGameInfo::OnDestroy() //---------------------------------------------------------------------------------- // Updates the UI when the list selection changes. //---------------------------------------------------------------------------------- -HRESULT CScene_InGameInfo::OnNotifySelChanged( HXUIOBJ hObjSource, XUINotifySelChanged* pNotifySelChangedData, BOOL& bHandled ) +int CScene_InGameInfo::OnNotifySelChanged( HXUIOBJ hObjSource, XUINotifySelChanged* pNotifySelChangedData, bool& bHandled ) { if( hObjSource == playersList) { @@ -112,7 +112,7 @@ HRESULT CScene_InGameInfo::OnNotifySelChanged( HXUIOBJ hObjSource, XUINotifySelC return S_OK; } -HRESULT CScene_InGameInfo::OnKeyDown(XUIMessageInput* pInputData, BOOL& rfHandled) +int CScene_InGameInfo::OnKeyDown(XUIMessageInput* pInputData, bool& rfHandled) { if(m_bIgnoreKeyPresses) return S_OK; @@ -124,7 +124,7 @@ HRESULT CScene_InGameInfo::OnKeyDown(XUIMessageInput* pInputData, BOOL& rfHandle } ui.AnimateKeyPress(pInputData->UserIndex, pInputData->dwKeyCode); - HRESULT hr = S_OK; + int hr = S_OK; switch(pInputData->dwKeyCode) { @@ -173,7 +173,7 @@ HRESULT CScene_InGameInfo::OnKeyDown(XUIMessageInput* pInputData, BOOL& rfHandle //---------------------------------------------------------------------------------- // Handler for the button press message. //---------------------------------------------------------------------------------- -HRESULT CScene_InGameInfo::OnNotifyPressEx(HXUIOBJ hObjPressed, XUINotifyPress* pNotifyPressData, BOOL& rfHandled) +int CScene_InGameInfo::OnNotifyPressEx(HXUIOBJ hObjPressed, XUINotifyPress* pNotifyPressData, bool& rfHandled) { // This assumes all buttons can only be pressed with the A button ui.AnimateKeyPress(pNotifyPressData->UserIndex, VK_PAD_A); @@ -209,9 +209,9 @@ HRESULT CScene_InGameInfo::OnNotifyPressEx(HXUIOBJ hObjPressed, XUINotifyPress* else if(selectedPlayer->IsLocal() != true && selectedPlayer->IsSameSystem(g_NetworkManager.GetHostPlayer()) != true) { // Only ops will hit this, can kick anyone not local and not local to the host - BYTE *smallId = new BYTE(); + uint8_t *smallId = new uint8_t(); *smallId = m_players[playersList.GetCurSel()]; - UINT uiIDA[2]; + unsigned int uiIDA[2]; uiIDA[0]=IDS_CONFIRM_OK; uiIDA[1]=IDS_CONFIRM_CANCEL; @@ -226,7 +226,7 @@ HRESULT CScene_InGameInfo::OnNotifyPressEx(HXUIOBJ hObjPressed, XUINotifyPress* return S_OK; } -HRESULT CScene_InGameInfo::OnTimer(XUIMessageTimer *pData,BOOL& rfHandled) +int CScene_InGameInfo::OnTimer(XUIMessageTimer *pData,bool& rfHandled) { if(pData->nId==IGNORE_KEYPRESS_TIMERID) { @@ -241,7 +241,7 @@ HRESULT CScene_InGameInfo::OnTimer(XUIMessageTimer *pData,BOOL& rfHandled) return S_OK; } -HRESULT CScene_InGameInfo::OnTransitionStart( XUIMessageTransition *pTransition, BOOL& bHandled ) +int CScene_InGameInfo::OnTransitionStart( XUIMessageTransition *pTransition, bool& bHandled ) { if(pTransition->dwTransType == XUI_TRANSITION_FROM) { @@ -250,7 +250,7 @@ HRESULT CScene_InGameInfo::OnTransitionStart( XUIMessageTransition *pTransition, return S_OK; } -HRESULT CScene_InGameInfo::OnTransitionEnd( XUIMessageTransition *pTransition, BOOL& bHandled ) +int CScene_InGameInfo::OnTransitionEnd( XUIMessageTransition *pTransition, bool& bHandled ) { if(pTransition->dwTransType == XUI_TRANSITION_BACKTO) { @@ -260,7 +260,7 @@ HRESULT CScene_InGameInfo::OnTransitionEnd( XUIMessageTransition *pTransition, B return S_OK; } -HRESULT CScene_InGameInfo::OnNotifySetFocus( HXUIOBJ hObjSource, XUINotifyFocus *pNotifyFocusData, BOOL& bHandled ) +int CScene_InGameInfo::OnNotifySetFocus( HXUIOBJ hObjSource, XUINotifyFocus *pNotifyFocusData, bool& bHandled ) { updateTooltips(); return S_OK; @@ -304,7 +304,7 @@ void CScene_InGameInfo::OnPlayerChanged(void *callbackParam, INetworkPlayer *pPl } -HRESULT CScene_InGameInfo::OnGetSourceDataText(XUIMessageGetSourceText *pGetSourceTextData, BOOL& bHandled) +int CScene_InGameInfo::OnGetSourceDataText(XUIMessageGetSourceText *pGetSourceTextData, bool& bHandled) { if( pGetSourceTextData->bItemData ) { @@ -329,7 +329,7 @@ HRESULT CScene_InGameInfo::OnGetSourceDataText(XUIMessageGetSourceText *pGetSour pGetSourceTextData->szText = L""; } - HRESULT hr; + int hr; HXUIOBJ hButton, hVisual, hPlayerIcon, hVoiceIcon; hButton = playersList.GetItemControl(pGetSourceTextData->iItem); hr=XuiControlGetVisual(hButton,&hVisual); @@ -430,7 +430,7 @@ HRESULT CScene_InGameInfo::OnGetSourceDataText(XUIMessageGetSourceText *pGetSour return S_OK; } -HRESULT CScene_InGameInfo::OnGetSourceDataImage(XUIMessageGetSourceImage *pGetSourceImageData,BOOL& bHandled) +int CScene_InGameInfo::OnGetSourceDataImage(XUIMessageGetSourceImage *pGetSourceImageData,bool& bHandled) { if( pGetSourceImageData->bItemData ) { @@ -442,7 +442,7 @@ HRESULT CScene_InGameInfo::OnGetSourceDataImage(XUIMessageGetSourceImage *pGetSo return S_OK; } -HRESULT CScene_InGameInfo::OnGetItemCountAll(XUIMessageGetItemCount *pGetItemCountData, BOOL& bHandled) +int CScene_InGameInfo::OnGetItemCountAll(XUIMessageGetItemCount *pGetItemCountData, bool& bHandled) { pGetItemCountData->cItems = m_playersCount; bHandled = true; @@ -512,7 +512,7 @@ void CScene_InGameInfo::updateTooltips() } -HRESULT CScene_InGameInfo::OnCustomMessage_Splitscreenplayer(bool bJoining, BOOL& bHandled) +int CScene_InGameInfo::OnCustomMessage_Splitscreenplayer(bool bJoining, bool& bHandled) { bHandled=true; return app.AdjustSplitscreenScene_PlayerChanged(m_hObj,&m_OriginalPosition,m_iPad,bJoining); @@ -520,7 +520,7 @@ HRESULT CScene_InGameInfo::OnCustomMessage_Splitscreenplayer(bool bJoining, BOOL int CScene_InGameInfo::KickPlayerReturned(void *pParam,int iPad,C4JStorage::EMessageResult result) { - BYTE smallId = *(BYTE *)pParam; + uint8_t smallId = *(uint8_t *)pParam; delete pParam; if(result==C4JStorage::EMessage_ResultAccept) diff --git a/src/client/Common/XUI/XUI_InGameInfo.h b/src/client/Common/XUI/XUI_InGameInfo.h index 8b685aaf..8826965f 100644 --- a/src/client/Common/XUI/XUI_InGameInfo.h +++ b/src/client/Common/XUI/XUI_InGameInfo.h @@ -44,21 +44,21 @@ protected: MAP_CONTROL(IDC_Title, m_title) END_CONTROL_MAP() - HRESULT OnInit( XUIMessageInit* pInitData, BOOL& bHandled ); - HRESULT OnDestroy(); - HRESULT OnNotifySelChanged( HXUIOBJ hObjSource, XUINotifySelChanged* pNotifySelChangedData, BOOL& bHandled ); - HRESULT OnNotifyPressEx(HXUIOBJ hObjPressed, XUINotifyPress* pNotifyPressData, BOOL& rfHandled); - HRESULT OnKeyDown(XUIMessageInput* pInputData, BOOL& rfHandled); - HRESULT OnTimer(XUIMessageTimer *pData,BOOL& rfHandled); - HRESULT OnTransitionStart( XUIMessageTransition *pTransition, BOOL& bHandled ); - HRESULT OnTransitionEnd( XUIMessageTransition *pTransition, BOOL& bHandled ); - HRESULT OnNotifySetFocus( HXUIOBJ hObjSource, XUINotifyFocus *pNotifyFocusData, BOOL& bHandled ); + int OnInit( XUIMessageInit* pInitData, bool& bHandled ); + int OnDestroy(); + int OnNotifySelChanged( HXUIOBJ hObjSource, XUINotifySelChanged* pNotifySelChangedData, bool& bHandled ); + int OnNotifyPressEx(HXUIOBJ hObjPressed, XUINotifyPress* pNotifyPressData, bool& rfHandled); + int OnKeyDown(XUIMessageInput* pInputData, bool& rfHandled); + int OnTimer(XUIMessageTimer *pData,bool& rfHandled); + int OnTransitionStart( XUIMessageTransition *pTransition, bool& bHandled ); + int OnTransitionEnd( XUIMessageTransition *pTransition, bool& bHandled ); + int OnNotifySetFocus( HXUIOBJ hObjSource, XUINotifyFocus *pNotifyFocusData, bool& bHandled ); - HRESULT OnCustomMessage_Splitscreenplayer(bool bJoining, BOOL& bHandled); + int OnCustomMessage_Splitscreenplayer(bool bJoining, bool& bHandled); - HRESULT OnGetSourceDataText(XUIMessageGetSourceText *pGetSourceTextData, BOOL& bHandled); - HRESULT OnGetSourceDataImage(XUIMessageGetSourceImage *pGetSourceImageData,BOOL& bHandled); - HRESULT OnGetItemCountAll(XUIMessageGetItemCount *pGetItemCountData, BOOL& bHandled); + int OnGetSourceDataText(XUIMessageGetSourceText *pGetSourceTextData, bool& bHandled); + int OnGetSourceDataImage(XUIMessageGetSourceImage *pGetSourceImageData,bool& bHandled); + int OnGetItemCountAll(XUIMessageGetItemCount *pGetItemCountData, bool& bHandled); public: @@ -74,7 +74,7 @@ private: D3DXVECTOR3 m_OriginalPosition; int m_playersCount; - BYTE m_players[MINECRAFT_NET_MAX_PLAYERS]; // An array of QNet small-id's + uint8_t m_players[MINECRAFT_NET_MAX_PLAYERS]; // An array of QNet small-id's bool m_bIgnoreKeyPresses; void updateTooltips(); diff --git a/src/client/Common/XUI/XUI_InGamePlayerOptions.cpp b/src/client/Common/XUI/XUI_InGamePlayerOptions.cpp index 4f597cf9..278bc92c 100644 --- a/src/client/Common/XUI/XUI_InGamePlayerOptions.cpp +++ b/src/client/Common/XUI/XUI_InGamePlayerOptions.cpp @@ -14,7 +14,7 @@ //---------------------------------------------------------------------------------- // Performs initialization tasks - retrieves controls. //---------------------------------------------------------------------------------- -HRESULT CScene_InGamePlayerOptions::OnInit( XUIMessageInit* pInitData, BOOL& bHandled ) +int CScene_InGamePlayerOptions::OnInit( XUIMessageInit* pInitData, bool& bHandled ) { m_iPad = *(int *)pInitData->pvInitData; @@ -202,14 +202,14 @@ HRESULT CScene_InGamePlayerOptions::OnInit( XUIMessageInit* pInitData, BOOL& bHa return S_OK; } -HRESULT CScene_InGamePlayerOptions::OnDestroy() +int CScene_InGamePlayerOptions::OnDestroy() { g_NetworkManager.UnRegisterPlayerChangedCallback(m_iPad, &CScene_InGameInfo::OnPlayerChanged, this); return S_OK; } -HRESULT CScene_InGamePlayerOptions::OnKeyDown(XUIMessageInput* pInputData, BOOL& rfHandled) +int CScene_InGamePlayerOptions::OnKeyDown(XUIMessageInput* pInputData, bool& rfHandled) { ui.AnimateKeyPress(pInputData->UserIndex, pInputData->dwKeyCode); @@ -292,17 +292,17 @@ HRESULT CScene_InGamePlayerOptions::OnKeyDown(XUIMessageInput* pInputData, BOOL& return S_OK; } -HRESULT CScene_InGamePlayerOptions::OnNotifyPressEx(HXUIOBJ hObjPressed, XUINotifyPress* pNotifyPressData, BOOL& rfHandled) +int CScene_InGamePlayerOptions::OnNotifyPressEx(HXUIOBJ hObjPressed, XUINotifyPress* pNotifyPressData, bool& rfHandled) { - //HRESULT hr = S_OK; + //int hr = S_OK; // This assumes all buttons can only be pressed with the A button ui.AnimateKeyPress(pNotifyPressData->UserIndex, VK_PAD_A); if( hObjPressed == m_buttonKick ) { - BYTE *smallId = new BYTE(); + uint8_t *smallId = new uint8_t(); *smallId = m_networkSmallId; - UINT uiIDA[2]; + unsigned int uiIDA[2]; uiIDA[0]=IDS_CONFIRM_OK; uiIDA[1]=IDS_CONFIRM_CANCEL; @@ -316,7 +316,7 @@ HRESULT CScene_InGamePlayerOptions::OnNotifyPressEx(HXUIOBJ hObjPressed, XUINoti return S_OK; } -HRESULT CScene_InGamePlayerOptions::OnControlNavigate(XUIMessageControlNavigate *pControlNavigateData, BOOL& bHandled) +int CScene_InGamePlayerOptions::OnControlNavigate(XUIMessageControlNavigate *pControlNavigateData, bool& bHandled) { pControlNavigateData->hObjDest=XuiControlGetNavigation(pControlNavigateData->hObjSource,pControlNavigateData->nControlNavigate,true,true); @@ -330,7 +330,7 @@ HRESULT CScene_InGamePlayerOptions::OnControlNavigate(XUIMessageControlNavigate int CScene_InGamePlayerOptions::KickPlayerReturned(void *pParam,int iPad,C4JStorage::EMessageResult result) { - BYTE smallId = *(BYTE *)pParam; + uint8_t smallId = *(uint8_t *)pParam; delete pParam; if(result==C4JStorage::EMessage_ResultAccept) @@ -357,7 +357,7 @@ void CScene_InGamePlayerOptions::OnPlayerChanged(void *callbackParam, INetworkPl HXUIOBJ hBackScene = scene->GetBackScene(); CScene_InGameInfo* infoScene; - VOID *pObj; + void *pObj; XuiObjectFromHandle( hBackScene, &pObj ); infoScene = (CScene_InGameInfo *)pObj; if(infoScene != NULL) CScene_InGameInfo::OnPlayerChanged(infoScene,pPlayer,leaving); @@ -368,7 +368,7 @@ void CScene_InGamePlayerOptions::OnPlayerChanged(void *callbackParam, INetworkPl } } -HRESULT CScene_InGamePlayerOptions::OnTransitionStart( XUIMessageTransition *pTransition, BOOL& bHandled ) +int CScene_InGamePlayerOptions::OnTransitionStart( XUIMessageTransition *pTransition, bool& bHandled ) { if(pTransition->dwTransType == XUI_TRANSITION_TO || pTransition->dwTransType == XUI_TRANSITION_BACKTO) { diff --git a/src/client/Common/XUI/XUI_InGamePlayerOptions.h b/src/client/Common/XUI/XUI_InGamePlayerOptions.h index b8351c02..6f30c1cc 100644 --- a/src/client/Common/XUI/XUI_InGamePlayerOptions.h +++ b/src/client/Common/XUI/XUI_InGamePlayerOptions.h @@ -61,12 +61,12 @@ protected: END_CONTROL_MAP() - HRESULT OnInit( XUIMessageInit* pInitData, BOOL& bHandled ); - HRESULT OnDestroy(); - HRESULT OnKeyDown(XUIMessageInput* pInputData, BOOL& rfHandled); - HRESULT OnNotifyPressEx(HXUIOBJ hObjPressed, XUINotifyPress* pNotifyPressData, BOOL& rfHandled); - HRESULT OnControlNavigate(XUIMessageControlNavigate *pControlNavigateData, BOOL& bHandled); - HRESULT OnTransitionStart( XUIMessageTransition *pTransition, BOOL& bHandled ); + int OnInit( XUIMessageInit* pInitData, bool& bHandled ); + int OnDestroy(); + int OnKeyDown(XUIMessageInput* pInputData, bool& rfHandled); + int OnNotifyPressEx(HXUIOBJ hObjPressed, XUINotifyPress* pNotifyPressData, bool& rfHandled); + int OnControlNavigate(XUIMessageControlNavigate *pControlNavigateData, bool& bHandled); + int OnTransitionStart( XUIMessageTransition *pTransition, bool& bHandled ); public: @@ -79,7 +79,7 @@ public: private: bool m_editingSelf; int m_iPad; - BYTE m_networkSmallId; + uint8_t m_networkSmallId; unsigned int m_playerPrivileges; D3DXVECTOR3 m_OriginalPosition; diff --git a/src/client/Common/XUI/XUI_Intro.cpp b/src/client/Common/XUI/XUI_Intro.cpp index c0833492..670e2f28 100644 --- a/src/client/Common/XUI/XUI_Intro.cpp +++ b/src/client/Common/XUI/XUI_Intro.cpp @@ -13,7 +13,7 @@ //---------------------------------------------------------------------------------- // Performs initialization tasks - retrieves controls. //---------------------------------------------------------------------------------- -HRESULT CScene_Intro::OnInit( XUIMessageInit* pInitData, BOOL& bHandled ) +int CScene_Intro::OnInit( XUIMessageInit* pInitData, bool& bHandled ) { MapChildControls(); @@ -41,7 +41,7 @@ HRESULT CScene_Intro::OnInit( XUIMessageInit* pInitData, BOOL& bHandled ) //---------------------------------------------------------------------------------- // Handler for the button press message. //---------------------------------------------------------------------------------- -HRESULT CScene_Intro::OnNotifyPressEx(HXUIOBJ hObjPressed, XUINotifyPress* pNotifyPressData, BOOL& rfHandled) +int CScene_Intro::OnNotifyPressEx(HXUIOBJ hObjPressed, XUINotifyPress* pNotifyPressData, bool& rfHandled) { // This assumes all buttons can only be pressed with the A button ui.AnimateKeyPress(pNotifyPressData->UserIndex, VK_PAD_A); @@ -50,7 +50,7 @@ HRESULT CScene_Intro::OnNotifyPressEx(HXUIOBJ hObjPressed, XUINotifyPress* pNoti return S_OK; } -HRESULT CScene_Intro::OnKeyDown(XUIMessageInput* pInputData, BOOL& rfHandled) +int CScene_Intro::OnKeyDown(XUIMessageInput* pInputData, bool& rfHandled) { ui.AnimateKeyPress(pInputData->UserIndex, pInputData->dwKeyCode); @@ -76,7 +76,7 @@ HRESULT CScene_Intro::OnKeyDown(XUIMessageInput* pInputData, BOOL& rfHandled) return S_OK; } -HRESULT CScene_Intro::OnTimelineEnd(HXUIOBJ hObjSource, BOOL& bHandled) +int CScene_Intro::OnTimelineEnd(HXUIOBJ hObjSource, bool& bHandled) { int nStart, nEnd; @@ -136,9 +136,9 @@ HRESULT CScene_Intro::OnTimelineEnd(HXUIOBJ hObjSource, BOOL& bHandled) } -HRESULT CScene_Intro::OnTimer(XUIMessageTimer *pData,BOOL& rfHandled) +int CScene_Intro::OnTimer(XUIMessageTimer *pData,bool& rfHandled) { - HRESULT hr=XuiKillTimer(m_hObj,0); + int hr=XuiKillTimer(m_hObj,0); m_bSkippable=true; if(m_bWantsToSkip) diff --git a/src/client/Common/XUI/XUI_Intro.h b/src/client/Common/XUI/XUI_Intro.h index f896faed..29a784d7 100644 --- a/src/client/Common/XUI/XUI_Intro.h +++ b/src/client/Common/XUI/XUI_Intro.h @@ -26,11 +26,11 @@ class CScene_Intro : public CXuiSceneImpl END_CONTROL_MAP() - HRESULT OnInit( XUIMessageInit* pInitData, BOOL& bHandled ); - HRESULT OnNotifyPressEx(HXUIOBJ hObjPressed, XUINotifyPress* pNotifyPressData,BOOL& rfHandled); - HRESULT OnKeyDown(XUIMessageInput* pInputData, BOOL& rfHandled); - HRESULT OnTimelineEnd(HXUIOBJ hObjSource, BOOL& bHandled); - HRESULT OnTimer(XUIMessageTimer *pData,BOOL& rfHandled); + int OnInit( XUIMessageInit* pInitData, bool& bHandled ); + int OnNotifyPressEx(HXUIOBJ hObjPressed, XUINotifyPress* pNotifyPressData,bool& rfHandled); + int OnKeyDown(XUIMessageInput* pInputData, bool& rfHandled); + int OnTimelineEnd(HXUIOBJ hObjSource, bool& bHandled); + int OnTimer(XUIMessageTimer *pData,bool& rfHandled); bool m_bSkippable; bool m_bWantsToSkip; diff --git a/src/client/Common/XUI/XUI_Leaderboards.cpp b/src/client/Common/XUI/XUI_Leaderboards.cpp index bc7decfb..c7062a21 100644 --- a/src/client/Common/XUI/XUI_Leaderboards.cpp +++ b/src/client/Common/XUI/XUI_Leaderboards.cpp @@ -7,7 +7,7 @@ #include "XUI_Ctrl_CraftIngredientSlot.h" #include "XUI_XZP_Icons.h" -LPCWSTR CScene_Leaderboards::m_TitleIconNameA[7]= +const wchar_t* CScene_Leaderboards::m_TitleIconNameA[7]= { L"XuiHSlot1", L"XuiHSlot2", @@ -18,7 +18,7 @@ LPCWSTR CScene_Leaderboards::m_TitleIconNameA[7]= L"XuiHSlot7", }; -LPCWSTR CScene_Leaderboards::m_TextColumnNameA[7]= +const wchar_t* CScene_Leaderboards::m_TextColumnNameA[7]= { L"text_Column1", L"text_Column2", @@ -73,7 +73,7 @@ const CScene_Leaderboards::LeaderboardDescriptor CScene_Leaderboards::LEADERBOAR }, }; -HRESULT CScene_Leaderboards::OnInit(XUIMessageInit *pInitData, BOOL &bHandled) +int CScene_Leaderboards::OnInit(XUIMessageInit *pInitData, bool &bHandled) { m_iPad = *(int *)pInitData->pvInitData; MapChildControls(); @@ -177,7 +177,7 @@ void CScene_Leaderboards::RepositionText(int iNumber) } } -HRESULT CScene_Leaderboards::OnDestroy() +int CScene_Leaderboards::OnDestroy() { LeaderboardManager::Instance()->CancelOperation(); LeaderboardManager::Instance()->CloseSession(); @@ -199,13 +199,13 @@ HRESULT CScene_Leaderboards::OnDestroy() return S_OK; } -HRESULT CScene_Leaderboards::OnNotifySetFocus(HXUIOBJ hObjSource, XUINotifyFocus *pNotifyFocusData, BOOL& bHandled) +int CScene_Leaderboards::OnNotifySetFocus(HXUIOBJ hObjSource, XUINotifyFocus *pNotifyFocusData, bool& bHandled) { UpdateTooltips(); return S_OK; } -HRESULT CScene_Leaderboards::OnNotifySelChanged(HXUIOBJ hObjSource, XUINotifySelChanged *pNotifySelChangedData, BOOL& bHandled) +int CScene_Leaderboards::OnNotifySelChanged(HXUIOBJ hObjSource, XUINotifySelChanged *pNotifySelChangedData, bool& bHandled) { if(m_bReady && pNotifySelChangedData->iOldItem!=-1) @@ -272,7 +272,7 @@ void CScene_Leaderboards::UpdateTooltips() } } -HRESULT CScene_Leaderboards::OnKeyDown(XUIMessageInput* pInputData, BOOL& bHandled) +int CScene_Leaderboards::OnKeyDown(XUIMessageInput* pInputData, bool& bHandled) { ui.AnimateKeyPress(pInputData->UserIndex, pInputData->dwKeyCode); @@ -473,7 +473,7 @@ HRESULT CScene_Leaderboards::OnKeyDown(XUIMessageInput* pInputData, BOOL& bHandl case VK_PAD_B: case VK_ESCAPE: { - BYTE userIndex = pInputData->UserIndex; + uint8_t userIndex = pInputData->UserIndex; if( !app.IsPauseMenuDisplayed(userIndex) ) { // If we are not from a pause menu, then we are from the main menu @@ -492,9 +492,9 @@ HRESULT CScene_Leaderboards::OnKeyDown(XUIMessageInput* pInputData, BOOL& bHandl #if 0 void CScene_Leaderboards::GetFriends() { - DWORD resultsSize; - HANDLE hEnumerator; - DWORD ret; + unsigned long resultsSize; + void* hEnumerator; + unsigned long ret; m_numFriends = 0; @@ -503,8 +503,8 @@ void CScene_Leaderboards::GetFriends() if( ret != ERROR_SUCCESS ) return; - m_friends = (XONLINE_FRIEND*) new BYTE[ resultsSize ]; - DWORD numFriends; + m_friends = (XONLINE_FRIEND*) new uint8_t[ resultsSize ]; + unsigned long numFriends; ret = XEnumerate( hEnumerator, @@ -780,7 +780,7 @@ bool CScene_Leaderboards::RetrieveStats() return true; } -HRESULT CScene_Leaderboards::OnGetItemCountAll(XUIMessageGetItemCount *pGetItemCountData, BOOL& bHandled) +int CScene_Leaderboards::OnGetItemCountAll(XUIMessageGetItemCount *pGetItemCountData, bool& bHandled) { pGetItemCountData->cItems = m_leaderboard.m_totalEntryCount; @@ -793,13 +793,13 @@ HRESULT CScene_Leaderboards::OnGetItemCountAll(XUIMessageGetItemCount *pGetItemC return S_OK; } -HRESULT CScene_Leaderboards::OnGetSourceDataText(XUIMessageGetSourceText *pGetSourceTextData,BOOL& bHandled) +int CScene_Leaderboards::OnGetSourceDataText(XUIMessageGetSourceText *pGetSourceTextData,bool& bHandled) { if( pGetSourceTextData->bItemData ) { if( m_newTop != -1 && m_newSel != -1 ) { - HRESULT ret = m_listGamers.SetTopItem(m_newTop); + int ret = m_listGamers.SetTopItem(m_newTop); assert( ret == S_OK ); ret = m_listGamers.SetCurSel(m_newSel); @@ -861,7 +861,7 @@ HRESULT CScene_Leaderboards::OnGetSourceDataText(XUIMessageGetSourceText *pGetSo return S_OK; } -HRESULT CScene_Leaderboards::OnGetSourceDataImage(XUIMessageGetSourceImage* pGetImage, BOOL& bHandled) +int CScene_Leaderboards::OnGetSourceDataImage(XUIMessageGetSourceImage* pGetImage, bool& bHandled) { if( (pGetImage->iData == 2) && (pGetImage->bItemData) ) { @@ -897,14 +897,14 @@ HRESULT CScene_Leaderboards::OnGetSourceDataImage(XUIMessageGetSourceImage* pGet void CScene_Leaderboards::PopulateLeaderboard(bool noResults) { - HRESULT hr; + int hr; HXUIOBJ visual=NULL; HXUIOBJ hTemp=NULL; hr=XuiControlGetVisual(m_listGamers.m_hObj,&visual); if(m_pHTitleIconSlots[0]==NULL) { - VOID *pObj; + void *pObj; HXUIOBJ button; D3DXVECTOR3 vPos; @@ -962,14 +962,14 @@ void CScene_Leaderboards::PopulateLeaderboard(bool noResults) // some leaderboards in production atm. // Changed to loop over the range of cached values, although even that is probably overkill. // Really only the newly updated rows need changed, but this shouldn't cause any performance issues - for(DWORD i = m_leaderboard.m_entryStartIndex - 1; i < (m_leaderboard.m_entryStartIndex - 1) + m_leaderboard.m_currentEntryCount; ++i) + for(unsigned long i = m_leaderboard.m_entryStartIndex - 1; i < (m_leaderboard.m_entryStartIndex - 1) + m_leaderboard.m_currentEntryCount; ++i) { HXUIOBJ visual=NULL; HXUIOBJ button; D3DXVECTOR3 vPos; // 4J-PB - fix for #13768 - Leaderboards: Player scores appear misaligned when viewed under the "My Score" leaderboard filter HXUIOBJ hTop=m_listGamers.GetItemControl(i-(m_leaderboard.m_entryStartIndex - 1)); - HRESULT hr=XuiControlGetVisual(hTop,&visual); + int hr=XuiControlGetVisual(hTop,&visual); for(int j=0;j<7;j++) { @@ -1027,7 +1027,7 @@ void CScene_Leaderboards::CopyLeaderboardEntry(PXUSER_STATS_ROW statsRow, Leader //Copy the rank leaderboardEntry->m_rank = statsRow->dwRank; - DWORD displayRank = leaderboardEntry->m_rank; + unsigned long displayRank = leaderboardEntry->m_rank; if(displayRank > 9999999) displayRank = 9999999; swprintf_s(leaderboardEntry->m_wcRank, 12, L"%u", displayRank); @@ -1053,7 +1053,7 @@ void CScene_Leaderboards::CopyLeaderboardEntry(PXUSER_STATS_ROW statsRow, Leader leaderboardEntry->m_columns[i] = statsRow->pColumns[i].Value.nData; if( !isDistanceLeaderboard ) { - DWORD displayValue = leaderboardEntry->m_columns[i]; + unsigned long displayValue = leaderboardEntry->m_columns[i]; if(displayValue > 99999) displayValue = 99999; swprintf_s(leaderboardEntry->m_wcColumns[i], 12, L"%u",displayValue); #ifdef _DEBUG @@ -1147,10 +1147,10 @@ void CScene_Leaderboards::CopyLeaderboardEntry(PXUSER_STATS_ROW statsRow, Leader void CScene_Leaderboards::SetLeaderboardHeader() { - WCHAR buffer[40]; - DWORD bufferLength = 40; + wchar_t buffer[40]; + unsigned long bufferLength = 40; - DWORD ret = XResourceGetString(LEADERBOARD_HEADERS[m_currentLeaderboard][m_currentDifficulty], buffer, &bufferLength, NULL); + unsigned long ret = XResourceGetString(LEADERBOARD_HEADERS[m_currentLeaderboard][m_currentDifficulty], buffer, &bufferLength, NULL); if( ret == ERROR_SUCCESS ) m_textLeaderboard.SetText(buffer); @@ -1186,7 +1186,7 @@ void CScene_Leaderboards::ClearLeaderboardTitlebar() HXUIOBJ visual=NULL; HXUIOBJ hTemp=NULL; - HRESULT hr; + int hr; hr=XuiControlGetVisual(m_listGamers.m_hObj,&visual); hr=XuiElementGetChildById(visual,L"XuiLabel_Gamertag",&hTemp); diff --git a/src/client/Common/XUI/XUI_Leaderboards.h b/src/client/Common/XUI/XUI_Leaderboards.h index c16ab433..5fbba100 100644 --- a/src/client/Common/XUI/XUI_Leaderboards.h +++ b/src/client/Common/XUI/XUI_Leaderboards.h @@ -19,7 +19,7 @@ private: static const int NUM_ENTRIES = 101; //Cache up to this many entries static const int READ_SIZE = 15; //Read this many entries at a time -// static LPCWSTR FLAG_ICON_PATHS[37]; +// static const wchar_t* FLAG_ICON_PATHS[37]; int m_iPad; bool m_bPopulatedOnce; @@ -27,16 +27,16 @@ private: static const int LEADERBOARD_HEADERS[NUM_LEADERBOARDS][4]; static const int TitleIcons[NUM_LEADERBOARDS][7]; - static LPCWSTR m_TitleIconNameA[7]; - static LPCWSTR m_TextColumnNameA[7]; + static const wchar_t* m_TitleIconNameA[7]; + static const wchar_t* m_TextColumnNameA[7]; HXUIOBJ m_hTextEntryA[7]; struct LeaderboardDescriptor { - DWORD m_viewId; - DWORD m_columnCount; - WORD m_columnIds[8]; + unsigned long m_viewId; + unsigned long m_columnCount; + uint16_t m_columnIds[8]; - LeaderboardDescriptor(DWORD viewId, DWORD columnCount, WORD columnId_0, WORD columnId_1, WORD columnId_2, WORD columnId_3, WORD columnId_4, WORD columnId_5, WORD columnId_6, WORD columnId_7) + LeaderboardDescriptor(unsigned long viewId, unsigned long columnCount, uint16_t columnId_0, uint16_t columnId_1, uint16_t columnId_2, uint16_t columnId_3, uint16_t columnId_4, uint16_t columnId_5, uint16_t columnId_6, uint16_t columnId_7) { m_viewId = viewId; m_columnCount = columnCount; @@ -55,12 +55,12 @@ private: struct LeaderboardEntry { PlayerUID m_xuid; - DWORD m_rank; - WCHAR m_wcRank[12]; - WCHAR m_gamerTag[XUSER_NAME_SIZE+1]; + unsigned long m_rank; + wchar_t m_wcRank[12]; + wchar_t m_gamerTag[XUSER_NAME_SIZE+1]; //int m_locale; unsigned int m_columns[7]; - WCHAR m_wcColumns[7][12]; + wchar_t m_wcColumns[7][12]; bool m_bPlayer; //Is the player bool m_bOnline; //Is online bool m_bFriend; //Is friend @@ -68,11 +68,11 @@ private: }; struct Leaderboard { - DWORD m_totalEntryCount; //Either total number of entries in leaderboard, or total number of results for a friends query - DWORD m_entryStartIndex; //Index of first entry - DWORD m_currentEntryCount; //Current number of entries + unsigned long m_totalEntryCount; //Either total number of entries in leaderboard, or total number of results for a friends query + unsigned long m_entryStartIndex; //Index of first entry + unsigned long m_currentEntryCount; //Current number of entries LeaderboardEntry m_entries[NUM_ENTRIES]; - DWORD m_numColumns; + unsigned long m_numColumns; }; Leaderboard m_leaderboard; //All leaderboard data for the currently selected filter @@ -124,14 +124,14 @@ private: MAP_CONTROL(IDC_XuiTextEntries, m_textEntries) END_CONTROL_MAP() - HRESULT OnInit(XUIMessageInit* pInitData, BOOL& bHandled); - HRESULT OnDestroy(); - HRESULT OnKeyDown(XUIMessageInput* pInputData, BOOL& bHandled); - HRESULT OnGetItemCountAll(XUIMessageGetItemCount *pGetItemCountData, BOOL& bHandled); - HRESULT OnGetSourceDataText(XUIMessageGetSourceText *pGetSourceTextData, BOOL& bHandled); - HRESULT OnGetSourceDataImage(XUIMessageGetSourceImage* pGetImage, BOOL& bHandled); - HRESULT OnNotifySetFocus(HXUIOBJ hObjSource, XUINotifyFocus *pNotifyFocusData, BOOL& bHandled); - HRESULT OnNotifySelChanged(HXUIOBJ hObjSource, XUINotifySelChanged *pNotifySelChangedData, BOOL& bHandled); + int OnInit(XUIMessageInit* pInitData, bool& bHandled); + int OnDestroy(); + int OnKeyDown(XUIMessageInput* pInputData, bool& bHandled); + int OnGetItemCountAll(XUIMessageGetItemCount *pGetItemCountData, bool& bHandled); + int OnGetSourceDataText(XUIMessageGetSourceText *pGetSourceTextData, bool& bHandled); + int OnGetSourceDataImage(XUIMessageGetSourceImage* pGetImage, bool& bHandled); + int OnNotifySetFocus(HXUIOBJ hObjSource, XUINotifyFocus *pNotifyFocusData, bool& bHandled); + int OnNotifySelChanged(HXUIOBJ hObjSource, XUINotifySelChanged *pNotifySelChangedData, bool& bHandled); //Start a read request with the current parameters void ReadStats(int startIndex); diff --git a/src/client/Common/XUI/XUI_LoadSettings.cpp b/src/client/Common/XUI/XUI_LoadSettings.cpp index d2c85537..5e006143 100644 --- a/src/client/Common/XUI/XUI_LoadSettings.cpp +++ b/src/client/Common/XUI/XUI_LoadSettings.cpp @@ -40,14 +40,14 @@ int CScene_LoadGameSettings::m_iDifficultyTitleSettingA[4]= }; -HRESULT CScene_LoadGameSettings::OnInit( XUIMessageInit* pInitData, BOOL& bHandled ) +int CScene_LoadGameSettings::OnInit( XUIMessageInit* pInitData, bool& bHandled ) { m_hXuiBrush = NULL; m_bSetup = false; m_texturePackDescDisplayed = false; m_iConfigA=NULL; - WCHAR TempString[256]; + wchar_t TempString[256]; m_params = (LoadMenuInitData *)pInitData->pvInitData; @@ -115,7 +115,7 @@ HRESULT CScene_LoadGameSettings::OnInit( XUIMessageInit* pInitData, BOOL& bHandl m_bGameModeSurvival=true; m_CurrentDifficulty=app.GetGameSettings(m_iPad,eGameSetting_Difficulty); m_SliderDifficulty.SetValue(m_CurrentDifficulty); - swprintf( (WCHAR *)TempString, 256, L"%ls: %ls", app.GetString( IDS_SLIDER_DIFFICULTY ),app.GetString(m_iDifficultyTitleSettingA[m_CurrentDifficulty])); + swprintf( (wchar_t *)TempString, 256, L"%ls: %ls", app.GetString( IDS_SLIDER_DIFFICULTY ),app.GetString(m_iDifficultyTitleSettingA[m_CurrentDifficulty])); m_SliderDifficulty.SetText(TempString); m_bHasBeenInCreative = false; @@ -130,8 +130,8 @@ HRESULT CScene_LoadGameSettings::OnInit( XUIMessageInit* pInitData, BOOL& bHandl // retrieve the save icon from the texture pack, if there is one TexturePack *tp = Minecraft::GetInstance()->skins->getTexturePackById(m_MoreOptionsParams.dwTexturePack); - DWORD dwImageBytes; - PBYTE pbImageData = tp->getPackIcon(dwImageBytes); + unsigned long dwImageBytes; + uint8_t* pbImageData = tp->getPackIcon(dwImageBytes); if(dwImageBytes > 0 && pbImageData) { @@ -146,8 +146,8 @@ HRESULT CScene_LoadGameSettings::OnInit( XUIMessageInit* pInitData, BOOL& bHandl else { // set the save icon - PBYTE pbImageData=NULL; - DWORD dwImageBytes=0; + uint8_t* pbImageData=NULL; + unsigned long dwImageBytes=0; StorageManager.GetSaveCacheFileInfo(m_params->iSaveGameInfoIndex,m_XContentData); StorageManager.GetSaveCacheFileInfo(m_params->iSaveGameInfoIndex,&pbImageData,&dwImageBytes); @@ -158,10 +158,10 @@ HRESULT CScene_LoadGameSettings::OnInit( XUIMessageInit* pInitData, BOOL& bHandl unsigned int uiHostOptions = 0; if(pbImageData==NULL) { - DWORD dwResult=XContentGetThumbnail(ProfileManager.GetPrimaryPad(),&m_XContentData,NULL,&dwImageBytes,NULL); + unsigned long dwResult=XContentGetThumbnail(ProfileManager.GetPrimaryPad(),&m_XContentData,NULL,&dwImageBytes,NULL); if(dwResult==ERROR_SUCCESS) { - pbImageData = new BYTE[dwImageBytes]; + pbImageData = new uint8_t[dwImageBytes]; XContentGetThumbnail(ProfileManager.GetPrimaryPad(),&m_XContentData,pbImageData,&dwImageBytes,NULL); XuiCreateTextureBrushFromMemory(pbImageData,dwImageBytes,&m_hXuiBrush); } @@ -175,15 +175,15 @@ HRESULT CScene_LoadGameSettings::OnInit( XUIMessageInit* pInitData, BOOL& bHandl // #ifdef _DEBUG // // dump out the thumbnail -// HANDLE hThumbnail = CreateFile("GAME:\\thumbnail.png", GENERIC_WRITE, 0, NULL, OPEN_ALWAYS, FILE_FLAG_RANDOM_ACCESS, NULL); -// DWORD dwBytes; +// void* hThumbnail = CreateFile("GAME:\\thumbnail.png", GENERIC_WRITE, 0, NULL, OPEN_ALWAYS, FILE_FLAG_RANDOM_ACCESS, NULL); +// unsigned long dwBytes; // WriteFile(hThumbnail,pbImageData,dwImageBytes,&dwBytes,NULL); // XCloseHandle(hThumbnail); // #endif if(m_szSeed[0]!=0) { - swprintf( (WCHAR *)TempString, 256, L"%ls: %hs", app.GetString( IDS_SEED ),m_szSeed); + swprintf( (wchar_t *)TempString, 256, L"%ls: %hs", app.GetString( IDS_SEED ),m_szSeed); m_GameSeed.SetText(TempString); } else @@ -263,15 +263,15 @@ HRESULT CScene_LoadGameSettings::OnInit( XUIMessageInit* pInitData, BOOL& bHandl int texturePacksCount = pMinecraft->skins->getTexturePackCount(); CXuiCtrl4JList::LIST_ITEM_INFO ListInfo; - HRESULT hr; + int hr; for(unsigned int i = 0; i < texturePacksCount; ++i) { TexturePack *tp = pMinecraft->skins->getTexturePackByIndex(i); ZeroMemory(&ListInfo,sizeof(CXuiCtrl4JList::LIST_ITEM_INFO)); - DWORD dwImageBytes; - PBYTE pbImageData = tp->getPackIcon(dwImageBytes); + unsigned long dwImageBytes; + uint8_t* pbImageData = tp->getPackIcon(dwImageBytes); if(dwImageBytes > 0 && pbImageData) { @@ -320,7 +320,7 @@ HRESULT CScene_LoadGameSettings::OnInit( XUIMessageInit* pInitData, BOOL& bHandl for(unsigned int i = 0; i < app.GetDLCInfoTexturesOffersCount(); ++i) { bTexturePackAlreadyListed=false; - ULONGLONG ull=app.GetDLCInfoTexturesFullOffer(i); + uint64_t ull=app.GetDLCInfoTexturesFullOffer(i); pDLCInfo=app.GetDLCInfoForFullOfferID(ull); for(unsigned int i = 0; i < texturePacksCount; ++i) { @@ -349,7 +349,7 @@ HRESULT CScene_LoadGameSettings::OnInit( XUIMessageInit* pInitData, BOOL& bHandl for(unsigned int i = 0; i < app.GetDLCInfoTexturesOffersCount(); ++i) { bTexturePackAlreadyListed=false; - ULONGLONG ull=app.GetDLCInfoTexturesFullOffer(i); + uint64_t ull=app.GetDLCInfoTexturesFullOffer(i); pDLCInfo=app.GetDLCInfoForFullOfferID(ull); for(unsigned int i = 0; i < texturePacksCount; ++i) { @@ -372,7 +372,7 @@ HRESULT CScene_LoadGameSettings::OnInit( XUIMessageInit* pInitData, BOOL& bHandl return S_OK; } -HRESULT CScene_LoadGameSettings::OnControlNavigate(XUIMessageControlNavigate *pControlNavigateData, BOOL& bHandled) +int CScene_LoadGameSettings::OnControlNavigate(XUIMessageControlNavigate *pControlNavigateData, bool& bHandled) { pControlNavigateData->hObjDest=XuiControlGetNavigation(pControlNavigateData->hObjSource,pControlNavigateData->nControlNavigate,true,true); @@ -384,14 +384,14 @@ HRESULT CScene_LoadGameSettings::OnControlNavigate(XUIMessageControlNavigate *pC return S_OK; } -HRESULT CScene_LoadGameSettings::LaunchGame(void) +int CScene_LoadGameSettings::LaunchGame(void) { // stop the timer running that causes a check for new texture packs in TMS but not installed, since this will run all through the load game, and will crash if it tries to create an hbrush XuiKillTimer(m_hObj,CHECKFORAVAILABLETEXTUREPACKS_TIMER_ID); if( (m_bGameModeSurvival != true || m_bHasBeenInCreative) || m_MoreOptionsParams.bHostPrivileges == true) { - UINT uiIDA[2]; + unsigned int uiIDA[2]; uiIDA[0]=IDS_CONFIRM_OK; uiIDA[1]=IDS_CONFIRM_CANCEL; if(m_bGameModeSurvival != true || m_bHasBeenInCreative) @@ -424,7 +424,7 @@ HRESULT CScene_LoadGameSettings::LaunchGame(void) // disable saving StorageManager.SetSaveDisabled(true); StorageManager.SetSaveDeviceSelected(m_iPad,false); - UINT uiIDA[1]; + unsigned int uiIDA[1]; uiIDA[0]=IDS_OK; StorageManager.RequestMessageBox(IDS_STORAGEDEVICEPROBLEM_TITLE, IDS_FAILED_TO_LOADSAVE_TEXT, uiIDA, 1, m_iPad,&CScene_LoadGameSettings::DeviceRemovedDialogReturned,this); @@ -458,7 +458,7 @@ HRESULT CScene_LoadGameSettings::LaunchGame(void) // disable saving StorageManager.SetSaveDisabled(true); StorageManager.SetSaveDeviceSelected(m_iPad,false); - UINT uiIDA[1]; + unsigned int uiIDA[1]; uiIDA[0]=IDS_OK; StorageManager.RequestMessageBox(IDS_STORAGEDEVICEPROBLEM_TITLE, IDS_FAILED_TO_LOADSAVE_TEXT, uiIDA, 1, m_iPad,&CScene_LoadGameSettings::DeviceRemovedDialogReturned,this); } @@ -486,7 +486,7 @@ int CScene_LoadGameSettings::CheckResetNetherReturned(void *pParam,int iPad,C4JS return 0; } -HRESULT CScene_LoadGameSettings::OnNotifyPressEx(HXUIOBJ hObjPressed, XUINotifyPress* pNotifyPressData, BOOL& rfHandled) +int CScene_LoadGameSettings::OnNotifyPressEx(HXUIOBJ hObjPressed, XUINotifyPress* pNotifyPressData, bool& rfHandled) { // 4J-PB - stop people double pressing this if(m_bIgnoreInput) return S_OK; @@ -514,7 +514,7 @@ HRESULT CScene_LoadGameSettings::OnNotifyPressEx(HXUIOBJ hObjPressed, XUINotifyP // upsell the texture pack - ULONGLONG ullOfferID_Full; + uint64_t ullOfferID_Full; app.GetDLCFullOfferIDForPackID(ListItem.iData,&ullOfferID_Full); // 4J-PB - if the full offer id is 0, then the texture pack dlc load failed @@ -523,7 +523,7 @@ HRESULT CScene_LoadGameSettings::OnNotifyPressEx(HXUIOBJ hObjPressed, XUINotifyP // tell sentient about the upsell of the full version of the skin pack TelemetryManager->RecordUpsellPresented(ProfileManager.GetPrimaryPad(), eSet_UpsellID_Texture_DLC, ullOfferID_Full & 0xFFFFFFFF); - UINT uiIDA[3]; + unsigned int uiIDA[3]; // Need to check if the texture pack has both Full and Trial versions - we may do some as free ones, so only Full DLC_INFO *pDLCInfo=app.GetDLCInfoForFullOfferID(ullOfferID_Full); @@ -584,7 +584,7 @@ HRESULT CScene_LoadGameSettings::OnNotifyPressEx(HXUIOBJ hObjPressed, XUINotifyP if(m_pDLCPack && !m_pDLCPack->hasPurchasedFile( DLCManager::e_DLCType_Texture, L"" )) { // no - UINT uiIDA[1]; + unsigned int uiIDA[1]; uiIDA[0]=IDS_OK; if(!ProfileManager.IsSignedInLive(pNotifyPressData->UserIndex)) @@ -598,7 +598,7 @@ HRESULT CScene_LoadGameSettings::OnNotifyPressEx(HXUIOBJ hObjPressed, XUINotifyP // upsell DLC_INFO *pDLCInfo = app.GetDLCInfoForTrialOfferID(m_pDLCPack->getPurchaseOfferId()); - ULONGLONG ullOfferID_Full; + uint64_t ullOfferID_Full; if(pDLCInfo!=NULL) { @@ -612,7 +612,7 @@ HRESULT CScene_LoadGameSettings::OnNotifyPressEx(HXUIOBJ hObjPressed, XUINotifyP // tell sentient about the upsell of the full version of the texture pack TelemetryManager->RecordUpsellPresented(pNotifyPressData->UserIndex, eSet_UpsellID_Texture_DLC, ullOfferID_Full & 0xFFFFFFFF); - UINT uiIDA[2]; + unsigned int uiIDA[2]; uiIDA[0]=IDS_CONFIRM_OK; uiIDA[1]=IDS_CONFIRM_CANCEL; @@ -630,7 +630,7 @@ HRESULT CScene_LoadGameSettings::OnNotifyPressEx(HXUIOBJ hObjPressed, XUINotifyP // Check if they have the Reset Nether flag set, and confirm they want to do this if(m_MoreOptionsParams.bResetNether==true) { - UINT uiIDA[2]; + unsigned int uiIDA[2]; uiIDA[0]=IDS_DONT_RESET_NETHER; uiIDA[1]=IDS_RESET_NETHER; @@ -665,7 +665,7 @@ HRESULT CScene_LoadGameSettings::OnNotifyPressEx(HXUIOBJ hObjPressed, XUINotifyP return S_OK; } -HRESULT CScene_LoadGameSettings::OnKeyDown(XUIMessageInput* pInputData, BOOL& rfHandled) +int CScene_LoadGameSettings::OnKeyDown(XUIMessageInput* pInputData, bool& rfHandled) { if(m_bIgnoreInput) return S_OK; @@ -692,7 +692,7 @@ HRESULT CScene_LoadGameSettings::OnKeyDown(XUIMessageInput* pInputData, BOOL& rf return S_OK; } -HRESULT CScene_LoadGameSettings::OnFontRendererChange() +int CScene_LoadGameSettings::OnFontRendererChange() { int iRB=-1; @@ -720,7 +720,7 @@ int CScene_LoadGameSettings::ConfirmLoadReturned(void *pParam,int iPad,C4JStorag // disable saving StorageManager.SetSaveDisabled(true); StorageManager.SetSaveDeviceSelected(pClass->m_iPad,false); - UINT uiIDA[1]; + unsigned int uiIDA[1]; uiIDA[0]=IDS_OK; StorageManager.RequestMessageBox(IDS_STORAGEDEVICEPROBLEM_TITLE, IDS_FAILED_TO_LOADSAVE_TEXT, uiIDA, 1, pClass->m_iPad,&CScene_LoadGameSettings::DeviceRemovedDialogReturned,pClass); } @@ -734,7 +734,7 @@ int CScene_LoadGameSettings::ConfirmLoadReturned(void *pParam,int iPad,C4JStorag return 0; } -HRESULT CScene_LoadGameSettings::OnTimer( XUIMessageTimer *pTimer, BOOL& bHandled ) +int CScene_LoadGameSettings::OnTimer( XUIMessageTimer *pTimer, bool& bHandled ) { // 4J-PB - TODO - Don't think we can do this - if a 2nd player signs in here with an offline profile, the signed in LIVE player gets re-logged in, and bMultiplayerAllowed is false briefly switch(pTimer->nId) @@ -783,20 +783,20 @@ HRESULT CScene_LoadGameSettings::OnTimer( XUIMessageTimer *pTimer, BOOL& bHandle { if(m_iConfigA[i]!=-1) { - DWORD dwBytes=0; - PBYTE pbData=NULL; + unsigned long dwBytes=0; + uint8_t* pbData=NULL; app.GetTPD(m_iConfigA[i],&pbData,&dwBytes); ZeroMemory(&ListInfo,sizeof(CXuiCtrl4JList::LIST_ITEM_INFO)); if(dwBytes > 0 && pbData) { - DWORD dwImageBytes=0; - PBYTE pbImageData=NULL; + unsigned long dwImageBytes=0; + uint8_t* pbImageData=NULL; app.GetFileFromTPD(eTPDFileType_Icon,pbData,dwBytes,&pbImageData,&dwImageBytes ); ListInfo.fEnabled = true; ListInfo.iData = m_iConfigA[i]; - HRESULT hr=XuiCreateTextureBrushFromMemory(pbImageData,dwImageBytes,&ListInfo.hXuiBrush); + int hr=XuiCreateTextureBrushFromMemory(pbImageData,dwImageBytes,&ListInfo.hXuiBrush); ListInfo.iSortIndex=m_iConfigA[i]; m_pTexturePacksList->AddData(ListInfo,0,CXuiCtrl4JList::eSortList_Index); @@ -829,7 +829,7 @@ HRESULT CScene_LoadGameSettings::OnTimer( XUIMessageTimer *pTimer, BOOL& bHandle return S_OK; } - PBYTE pbData; + uint8_t* pbData; int CScene_LoadGameSettings::Progress(void *pParam,float fProgress) { @@ -847,7 +847,7 @@ int CScene_LoadGameSettings::LoadSaveDataReturned(void *pParam,bool bContinue) bool isClientSide = ProfileManager.IsSignedInLive(ProfileManager.GetPrimaryPad()) && pClass->m_MoreOptionsParams.bOnlineGame; // 4J Stu - If we only have one controller connected, then don't show the sign-in UI again - DWORD connectedControllers = 0; + unsigned long connectedControllers = 0; for(unsigned int i = 0; i < XUSER_MAX_COUNT; ++i) { if( InputManager.IsPadConnected(i) || ProfileManager.IsSignedIn(i) ) ++connectedControllers; @@ -857,8 +857,8 @@ int CScene_LoadGameSettings::LoadSaveDataReturned(void *pParam,bool bContinue) { // Check if user-created content is allowed, as we cannot play multiplayer if it's not bool noUGC = false; - BOOL pccAllowed = true; - BOOL pccFriendsAllowed = true; + bool pccAllowed = true; + bool pccFriendsAllowed = true; ProfileManager.AllowedPlayerCreatedContent(ProfileManager.GetPrimaryPad(),false,&pccAllowed,&pccFriendsAllowed); if(!pccAllowed && !pccFriendsAllowed) noUGC = true; @@ -866,13 +866,13 @@ int CScene_LoadGameSettings::LoadSaveDataReturned(void *pParam,bool bContinue) { pClass->SetShow( true ); pClass->m_bIgnoreInput=false; - UINT uiIDA[1]; + unsigned int uiIDA[1]; uiIDA[0]=IDS_CONFIRM_OK; StorageManager.RequestMessageBox( IDS_FAILED_TO_CREATE_GAME_TITLE, IDS_NO_USER_CREATED_CONTENT_PRIVILEGE_CREATE, uiIDA,1,ProfileManager.GetPrimaryPad(),NULL,NULL, app.GetStringTable()); } else { - DWORD dwLocalUsersMask = CGameNetworkManager::GetLocalPlayerMask(ProfileManager.GetPrimaryPad()); + unsigned long dwLocalUsersMask = CGameNetworkManager::GetLocalPlayerMask(ProfileManager.GetPrimaryPad()); // No guest problems so we don't need to force a sign-in of players here StartGameFromSave(pClass, dwLocalUsersMask); @@ -891,7 +891,7 @@ int CScene_LoadGameSettings::LoadSaveDataReturned(void *pParam,bool bContinue) pClass->m_bIgnoreInput=false; // give the option to delete the save - UINT uiIDA[2]; + unsigned int uiIDA[2]; uiIDA[0]=IDS_CONFIRM_CANCEL; uiIDA[1]=IDS_CONFIRM_OK; StorageManager.RequestMessageBox(IDS_CORRUPT_OR_DAMAGED_SAVE_TITLE, IDS_CORRUPT_OR_DAMAGED_SAVE_TEXT, uiIDA, 2, @@ -938,9 +938,9 @@ int CScene_LoadGameSettings::DeviceRemovedDialogReturned(void *pParam,int iPad,C } // 4J Stu - Shared functionality that is the same whether we needed a quadrant sign-in or not -void CScene_LoadGameSettings::StartGameFromSave(CScene_LoadGameSettings* pClass, DWORD dwLocalUsersMask) +void CScene_LoadGameSettings::StartGameFromSave(CScene_LoadGameSettings* pClass, unsigned long dwLocalUsersMask) { - INT saveOrCheckpointId = 0; + int saveOrCheckpointId = 0; bool validSave = StorageManager.GetSaveUniqueNumber(&saveOrCheckpointId); TelemetryManager->RecordLevelResume(pClass->m_iPad, eSen_FriendOrMatch_Playing_With_Invited_Friends, eSen_CompeteOrCoop_Coop_and_Competitive, app.GetGameSettings(pClass->m_iPad,eGameSetting_Difficulty), app.GetLocalPlayerCount(), g_NetworkManager.GetOnlinePlayerCount(), saveOrCheckpointId); @@ -983,7 +983,7 @@ void CScene_LoadGameSettings::StartGameFromSave(CScene_LoadGameSettings* pClass, LoadingInputParams *loadingParams = new LoadingInputParams(); loadingParams->func = &CGameNetworkManager::RunNetworkGameThreadProc; - loadingParams->lpParam = (LPVOID)param; + loadingParams->lpParam = (void*)param; // Reset the autosave timer app.SetAutosaveTimerTime(); @@ -1007,7 +1007,7 @@ int CScene_LoadGameSettings::StartGame_SignInReturned(void *pParam,bool bContinu // It's possible that the player has not signed in - they can back out if(ProfileManager.IsSignedIn(iPad)) { - DWORD dwLocalUsersMask = 0; + unsigned long dwLocalUsersMask = 0; bool isClientSide = ProfileManager.IsSignedInLive(ProfileManager.GetPrimaryPad()) && pClass->m_MoreOptionsParams.bOnlineGame; bool noPrivileges = false; @@ -1022,8 +1022,8 @@ int CScene_LoadGameSettings::StartGame_SignInReturned(void *pParam,bool bContinu // Check if user-created content is allowed, as we cannot play multiplayer if it's not bool noUGC = false; - BOOL pccAllowed = true; - BOOL pccFriendsAllowed = true; + bool pccAllowed = true; + bool pccFriendsAllowed = true; ProfileManager.AllowedPlayerCreatedContent(ProfileManager.GetPrimaryPad(), false, &pccAllowed,&pccFriendsAllowed); if(!pccAllowed && !pccFriendsAllowed) noUGC = true; @@ -1034,7 +1034,7 @@ int CScene_LoadGameSettings::StartGame_SignInReturned(void *pParam,bool bContinu pClass->SetShow( true ); pClass->m_bIgnoreInput=false; //pClass->m_bAbortSearch=false; - UINT uiIDA[1]; + unsigned int uiIDA[1]; uiIDA[0]=IDS_CONFIRM_OK; StorageManager.RequestMessageBox( IDS_FAILED_TO_CREATE_GAME_TITLE, IDS_NO_USER_CREATED_CONTENT_PRIVILEGE_CREATE, uiIDA,1,ProfileManager.GetPrimaryPad(),NULL,NULL, app.GetStringTable()); } @@ -1043,7 +1043,7 @@ int CScene_LoadGameSettings::StartGame_SignInReturned(void *pParam,bool bContinu pClass->SetShow( true ); pClass->m_bIgnoreInput=false; //pClass->m_bAbortSearch=false; - UINT uiIDA[1]; + unsigned int uiIDA[1]; uiIDA[0]=IDS_CONFIRM_OK; StorageManager.RequestMessageBox( IDS_NO_MULTIPLAYER_PRIVILEGE_TITLE, IDS_NO_MULTIPLAYER_PRIVILEGE_HOST_TEXT, uiIDA,1,ProfileManager.GetPrimaryPad(),NULL,NULL, app.GetStringTable()); } @@ -1064,7 +1064,7 @@ int CScene_LoadGameSettings::StartGame_SignInReturned(void *pParam,bool bContinu } -HRESULT CScene_LoadGameSettings::OnGetSourceDataImage(XUIMessageGetSourceImage *pGetSourceImageData,BOOL& bHandled) +int CScene_LoadGameSettings::OnGetSourceDataImage(XUIMessageGetSourceImage *pGetSourceImageData,bool& bHandled) { if( pGetSourceImageData->bItemData ) { @@ -1075,20 +1075,20 @@ HRESULT CScene_LoadGameSettings::OnGetSourceDataImage(XUIMessageGetSourceImage * } -HRESULT CScene_LoadGameSettings::OnNotifyValueChanged( HXUIOBJ hObjSource, XUINotifyValueChanged* pNotifyValueChanged, BOOL& bHandled ) +int CScene_LoadGameSettings::OnNotifyValueChanged( HXUIOBJ hObjSource, XUINotifyValueChanged* pNotifyValueChanged, bool& bHandled ) { - WCHAR TempString[256]; + wchar_t TempString[256]; if(hObjSource==m_SliderDifficulty.GetSlider() ) { app.SetGameSettings(m_iPad,eGameSetting_Difficulty,pNotifyValueChanged->nValue); - swprintf( (WCHAR *)TempString, 256, L"%ls: %ls", app.GetString( IDS_SLIDER_DIFFICULTY ),app.GetString(m_iDifficultyTitleSettingA[pNotifyValueChanged->nValue])); + swprintf( (wchar_t *)TempString, 256, L"%ls: %ls", app.GetString( IDS_SLIDER_DIFFICULTY ),app.GetString(m_iDifficultyTitleSettingA[pNotifyValueChanged->nValue])); m_SliderDifficulty.SetText(TempString); } return S_OK; } -HRESULT CScene_LoadGameSettings::OnTransitionStart( XUIMessageTransition *pTransition, BOOL& bHandled ) +int CScene_LoadGameSettings::OnTransitionStart( XUIMessageTransition *pTransition, bool& bHandled ) { //if(pTransition->dwTransAction==XUI_TRANSITION_ACTION_DESTROY ) return S_OK; @@ -1123,7 +1123,7 @@ HRESULT CScene_LoadGameSettings::OnTransitionStart( XUIMessageTransition *pTrans return S_OK; } -HRESULT CScene_LoadGameSettings::OnTransitionEnd( XUIMessageTransition *pTransition, BOOL& bHandled ) +int CScene_LoadGameSettings::OnTransitionEnd( XUIMessageTransition *pTransition, bool& bHandled ) { //if(pTransition->dwTransAction==XUI_TRANSITION_ACTION_DESTROY ) return S_OK; @@ -1156,7 +1156,7 @@ int CScene_LoadGameSettings::UnlockTexturePackReturned(void *pParam,int iPad,C4J { if(ProfileManager.IsSignedIn(iPad)) { - ULONGLONG ullIndexA[1]; + uint64_t ullIndexA[1]; DLC_INFO *pDLCInfo = app.GetDLCInfoForTrialOfferID(pScene->m_pDLCPack->getPurchaseOfferId()); if(pDLCInfo!=NULL) @@ -1184,7 +1184,7 @@ int CScene_LoadGameSettings::UnlockTexturePackReturned(void *pParam,int iPad,C4J return 0; } -HRESULT CScene_LoadGameSettings::OnNotifySelChanged( HXUIOBJ hObjSource, XUINotifySelChanged* pNotifySelChangedData, BOOL& bHandled ) +int CScene_LoadGameSettings::OnNotifySelChanged( HXUIOBJ hObjSource, XUINotifySelChanged* pNotifySelChangedData, bool& bHandled ) { if(hObjSource == m_pTexturePacksList->m_hObj) { @@ -1205,7 +1205,7 @@ HRESULT CScene_LoadGameSettings::OnNotifySelChanged( HXUIOBJ hObjSource, XUINoti return S_OK; } -HRESULT CScene_LoadGameSettings::OnNotifyKillFocus(HXUIOBJ hObjSource, XUINotifyFocus *pNotifyFocusData, BOOL& bHandled) +int CScene_LoadGameSettings::OnNotifyKillFocus(HXUIOBJ hObjSource, XUINotifyFocus *pNotifyFocusData, bool& bHandled) { HXUIOBJ hSourceParent, hDestParent; XuiElementGetParent(hObjSource,&hSourceParent); @@ -1241,8 +1241,8 @@ void CScene_LoadGameSettings::UpdateTexturePackDescription(int index) if(tp==NULL) { // this is probably a texture pack icon added from TMS - DWORD dwBytes=0,dwFileBytes=0; - PBYTE pbData=NULL,pbFileData=NULL; + unsigned long dwBytes=0,dwFileBytes=0; + uint8_t* pbData=NULL,pbFileData=NULL; CXuiCtrl4JList::LIST_ITEM_INFO ListItem; // get the current index of the list, and then get the data @@ -1280,8 +1280,8 @@ void CScene_LoadGameSettings::UpdateTexturePackDescription(int index) m_texturePackTitle.SetText(tp->getName().c_str()); m_texturePackDescription.SetText(tp->getDesc1().c_str()); - DWORD dwImageBytes; - PBYTE pbImageData = tp->getPackIcon(dwImageBytes); + unsigned long dwImageBytes; + uint8_t* pbImageData = tp->getPackIcon(dwImageBytes); if(dwImageBytes > 0 && pbImageData) { @@ -1333,12 +1333,12 @@ void CScene_LoadGameSettings::UpdateCurrentTexturePack() // upsell the texture pack // tell sentient about the upsell of the full version of the skin pack - ULONGLONG ullOfferID_Full; + uint64_t ullOfferID_Full; app.GetDLCFullOfferIDForPackID(ListItem.iData,&ullOfferID_Full); TelemetryManager->RecordUpsellPresented(ProfileManager.GetPrimaryPad(), eSet_UpsellID_Texture_DLC, ullOfferID_Full & 0xFFFFFFFF); - UINT uiIDA[3]; + unsigned int uiIDA[3]; // Need to check if the texture pack has both Full and Trial versions - we may do some as free ones, so only Full DLC_INFO *pDLCInfo=app.GetDLCInfoForFullOfferID(ullOfferID_Full); @@ -1370,7 +1370,7 @@ void CScene_LoadGameSettings::UpdateCurrentTexturePack() } } -HRESULT CScene_LoadGameSettings::OnDestroy() +int CScene_LoadGameSettings::OnDestroy() { if( m_hXuiBrush ) { @@ -1395,7 +1395,7 @@ void CScene_LoadGameSettings::LoadLevelGen(LevelGenerationOptions *levelGen) bool isClientSide = ProfileManager.IsSignedInLive(ProfileManager.GetPrimaryPad()) && m_MoreOptionsParams.bOnlineGame; // 4J Stu - If we only have one controller connected, then don't show the sign-in UI again - DWORD connectedControllers = 0; + unsigned long connectedControllers = 0; for(unsigned int i = 0; i < XUSER_MAX_COUNT; ++i) { if( InputManager.IsPadConnected(i) || ProfileManager.IsSignedIn(i) ) ++connectedControllers; @@ -1405,8 +1405,8 @@ void CScene_LoadGameSettings::LoadLevelGen(LevelGenerationOptions *levelGen) { // Check if user-created content is allowed, as we cannot play multiplayer if it's not bool noUGC = false; - BOOL pccAllowed = true; - BOOL pccFriendsAllowed = true; + bool pccAllowed = true; + bool pccFriendsAllowed = true; ProfileManager.AllowedPlayerCreatedContent(ProfileManager.GetPrimaryPad(),false,&pccAllowed,&pccFriendsAllowed); if(!pccAllowed && !pccFriendsAllowed) noUGC = true; @@ -1414,14 +1414,14 @@ void CScene_LoadGameSettings::LoadLevelGen(LevelGenerationOptions *levelGen) { SetShow( true ); m_bIgnoreInput=false; - UINT uiIDA[1]; + unsigned int uiIDA[1]; uiIDA[0]=IDS_CONFIRM_OK; StorageManager.RequestMessageBox( IDS_FAILED_TO_CREATE_GAME_TITLE, IDS_NO_USER_CREATED_CONTENT_PRIVILEGE_CREATE, uiIDA,1,ProfileManager.GetPrimaryPad(),NULL,NULL, app.GetStringTable()); return; } } - DWORD dwLocalUsersMask = 0; + unsigned long dwLocalUsersMask = 0; dwLocalUsersMask |= CGameNetworkManager::GetLocalPlayerMask(ProfileManager.GetPrimaryPad()); // Load data from disc @@ -1482,7 +1482,7 @@ void CScene_LoadGameSettings::LoadLevelGen(LevelGenerationOptions *levelGen) LoadingInputParams *loadingParams = new LoadingInputParams(); loadingParams->func = &CGameNetworkManager::RunNetworkGameThreadProc; - loadingParams->lpParam = (LPVOID)param; + loadingParams->lpParam = (void*)param; // Reset the autosave timer app.SetAutosaveTimerTime(); @@ -1498,7 +1498,7 @@ void CScene_LoadGameSettings::LoadLevelGen(LevelGenerationOptions *levelGen) } -HRESULT CScene_LoadGameSettings::OnCustomMessage_DLCInstalled() +int CScene_LoadGameSettings::OnCustomMessage_DLCInstalled() { // mounted DLC may have changed if(app.StartInstallDLCProcess(m_iPad)==false) @@ -1520,20 +1520,20 @@ HRESULT CScene_LoadGameSettings::OnCustomMessage_DLCInstalled() } -HRESULT CScene_LoadGameSettings::OnCustomMessage_DLCMountingComplete() +int CScene_LoadGameSettings::OnCustomMessage_DLCMountingComplete() { m_pTexturePacksList->SetSelectionChangedHandle(m_hObj); Minecraft *pMinecraft = Minecraft::GetInstance(); int texturePacksCount = pMinecraft->skins->getTexturePackCount(); CXuiCtrl4JList::LIST_ITEM_INFO ListInfo; - HRESULT hr; + int hr; for(unsigned int i = 0; i < texturePacksCount; ++i) { TexturePack *tp = pMinecraft->skins->getTexturePackByIndex(i); ZeroMemory(&ListInfo,sizeof(CXuiCtrl4JList::LIST_ITEM_INFO)); - DWORD dwImageBytes; - PBYTE pbImageData = tp->getPackIcon(dwImageBytes); + unsigned long dwImageBytes; + uint8_t* pbImageData = tp->getPackIcon(dwImageBytes); if(dwImageBytes > 0 && pbImageData) { @@ -1575,7 +1575,7 @@ HRESULT CScene_LoadGameSettings::OnCustomMessage_DLCMountingComplete() for(unsigned int i = 0; i < app.GetDLCInfoTexturesOffersCount(); ++i) { bTexturePackAlreadyListed=false; - ULONGLONG ull=app.GetDLCInfoTexturesFullOffer(i); + uint64_t ull=app.GetDLCInfoTexturesFullOffer(i); pDLCInfo=app.GetDLCInfoForFullOfferID(ull); for(unsigned int i = 0; i < texturePacksCount; ++i) { @@ -1609,7 +1609,7 @@ HRESULT CScene_LoadGameSettings::OnCustomMessage_DLCMountingComplete() for(unsigned int i = 0; i < app.GetDLCInfoTexturesOffersCount(); ++i) { bTexturePackAlreadyListed=false; - ULONGLONG ull=app.GetDLCInfoTexturesFullOffer(i); + uint64_t ull=app.GetDLCInfoTexturesFullOffer(i); pDLCInfo=app.GetDLCInfoForFullOfferID(ull); for(unsigned int i = 0; i < texturePacksCount; ++i) { @@ -1645,8 +1645,8 @@ int CScene_LoadGameSettings::TexturePackDialogReturned(void *pParam,int iPad,C4J // we need to enable background downloading for the DLC XBackgroundDownloadSetMode(XBACKGROUND_DOWNLOAD_MODE_ALWAYS_ALLOW); - ULONGLONG ullOfferID_Full; - ULONGLONG ullIndexA[1]; + uint64_t ullOfferID_Full; + uint64_t ullIndexA[1]; CXuiCtrl4JList::LIST_ITEM_INFO ListItem; // get the current index of the list, and then get the data ListItem=pClass->m_pTexturePacksList->GetData(pClass->m_currentTexturePackIndex); @@ -1674,7 +1674,7 @@ int CScene_LoadGameSettings::TexturePackDialogReturned(void *pParam,int iPad,C4J return 0; } -HRESULT CScene_LoadGameSettings::OnNavReturn(HXUIOBJ hObj,BOOL& rfHandled) +int CScene_LoadGameSettings::OnNavReturn(HXUIOBJ hObj,bool& rfHandled) { // update the tooltips int iRB=-1; diff --git a/src/client/Common/XUI/XUI_LoadSettings.h b/src/client/Common/XUI/XUI_LoadSettings.h index 61e934b7..833c2444 100644 --- a/src/client/Common/XUI/XUI_LoadSettings.h +++ b/src/client/Common/XUI/XUI_LoadSettings.h @@ -74,28 +74,28 @@ protected: END_MAP_CHILD_CONTROLS() END_CONTROL_MAP() - HRESULT OnInit( XUIMessageInit* pInitData, BOOL& bHandled ); - HRESULT OnNotifyPressEx(HXUIOBJ hObjPressed, XUINotifyPress* pNotifyPressData, BOOL& rfHandled); - HRESULT OnKeyDown(XUIMessageInput* pInputData, BOOL& rfHandled); - HRESULT OnGetSourceDataImage(XUIMessageGetSourceImage *pGetSourceImageData,BOOL& bHandled); - HRESULT OnNotifyValueChanged( HXUIOBJ hObjSource, XUINotifyValueChanged* pNotifyValueChanged, BOOL& bHandled ); - HRESULT OnTransitionStart( XUIMessageTransition *pTransition, BOOL& bHandled ); - HRESULT OnTransitionEnd( XUIMessageTransition *pTransition, BOOL& bHandled ); - HRESULT OnFontRendererChange(); - HRESULT OnControlNavigate(XUIMessageControlNavigate *pControlNavigateData, BOOL& bHandled); - HRESULT OnNotifySelChanged( HXUIOBJ hObjSource, XUINotifySelChanged* pNotifySelChangedData, BOOL& bHandled ); - HRESULT OnTimer( XUIMessageTimer *pTimer, BOOL& bHandled ); - HRESULT OnNotifyKillFocus(HXUIOBJ hObjSource, XUINotifyFocus *pNotifyFocusData, BOOL& bHandled); - HRESULT OnDestroy(); - HRESULT OnCustomMessage_DLCInstalled(); - HRESULT OnCustomMessage_DLCMountingComplete(); - HRESULT OnNavReturn(HXUIOBJ hObj,BOOL& rfHandled); + int OnInit( XUIMessageInit* pInitData, bool& bHandled ); + int OnNotifyPressEx(HXUIOBJ hObjPressed, XUINotifyPress* pNotifyPressData, bool& rfHandled); + int OnKeyDown(XUIMessageInput* pInputData, bool& rfHandled); + int OnGetSourceDataImage(XUIMessageGetSourceImage *pGetSourceImageData,bool& bHandled); + int OnNotifyValueChanged( HXUIOBJ hObjSource, XUINotifyValueChanged* pNotifyValueChanged, bool& bHandled ); + int OnTransitionStart( XUIMessageTransition *pTransition, bool& bHandled ); + int OnTransitionEnd( XUIMessageTransition *pTransition, bool& bHandled ); + int OnFontRendererChange(); + int OnControlNavigate(XUIMessageControlNavigate *pControlNavigateData, bool& bHandled); + int OnNotifySelChanged( HXUIOBJ hObjSource, XUINotifySelChanged* pNotifySelChangedData, bool& bHandled ); + int OnTimer( XUIMessageTimer *pTimer, bool& bHandled ); + int OnNotifyKillFocus(HXUIOBJ hObjSource, XUINotifyFocus *pNotifyFocusData, bool& bHandled); + int OnDestroy(); + int OnCustomMessage_DLCInstalled(); + int OnCustomMessage_DLCMountingComplete(); + int OnNavReturn(HXUIOBJ hObj,bool& rfHandled); static int LoadSaveDataReturned(void *pParam,bool bContinue); static int LoadSaveDataForNameChangeReturned(void *pParam,bool bContinue); static int DeviceRemovedDialogReturned(void *pParam,int iPad,C4JStorage::EMessageResult result); - static void StartGameFromSave(CScene_LoadGameSettings* pClass, DWORD dwLocalUsersMask); + static void StartGameFromSave(CScene_LoadGameSettings* pClass, unsigned long dwLocalUsersMask); static int StartGame_SignInReturned(void *pParam,bool bContinue, int iPad); static int DeviceSelectReturned(void *pParam,bool bContinue); static int ConfirmLoadReturned(void *pParam,int iPad,C4JStorage::EMessageResult result); @@ -108,7 +108,7 @@ protected: void LoadLevelGen(LevelGenerationOptions *levelGen); - HRESULT LaunchGame(void); + int LaunchGame(void); public: static unsigned char szPNG[8]; @@ -136,7 +136,7 @@ private: bool m_bSetup; bool m_texturePackDescDisplayed; - DWORD m_dwSaveFileC; + unsigned long m_dwSaveFileC; #ifdef _XBOX C4JStorage::CACHEINFOSTRUCT *m_InfoA; #endif diff --git a/src/client/Common/XUI/XUI_MainMenu.cpp b/src/client/Common/XUI/XUI_MainMenu.cpp index df16bbc8..a8c42555 100644 --- a/src/client/Common/XUI/XUI_MainMenu.cpp +++ b/src/client/Common/XUI/XUI_MainMenu.cpp @@ -29,7 +29,7 @@ Random *CScene_Main::random = new Random(); //---------------------------------------------------------------------------------- // Performs initialization tasks - retrieves controls. //---------------------------------------------------------------------------------- -HRESULT CScene_Main::OnInit( XUIMessageInit* pInitData, BOOL& bHandled ) +int CScene_Main::OnInit( XUIMessageInit* pInitData, bool& bHandled ) { MapChildControls(); @@ -44,7 +44,7 @@ HRESULT CScene_Main::OnInit( XUIMessageInit* pInitData, BOOL& bHandled ) m_eAction=eAction_None; // Display the tooltips - HRESULT hr = S_OK; + int hr = S_OK; ui.SetTooltips(DEFAULT_XUI_MENU_USER, IDS_TOOLTIPS_SELECT); // can't set presence until someone is signed in and playing @@ -68,15 +68,15 @@ HRESULT CScene_Main::OnInit( XUIMessageInit* pInitData, BOOL& bHandled ) CXuiSceneBase::ShowBackground( DEFAULT_XUI_MENU_USER, true ); CXuiSceneBase::ShowLogo( DEFAULT_XUI_MENU_USER, true ); - const DWORD LOCATOR_SIZE = 256; // Use this to allocate space to hold a ResourceLocator string - WCHAR szResourceLocator[ LOCATOR_SIZE ]; + const unsigned long LOCATOR_SIZE = 256; // Use this to allocate space to hold a ResourceLocator string + wchar_t szResourceLocator[ LOCATOR_SIZE ]; // load from the .xzp file - const ULONG_PTR c_ModuleHandle = (ULONG_PTR)GetModuleHandle(NULL); + const uintptr_t c_ModuleHandle = (uintptr_t)GetModuleHandle(NULL); swprintf(szResourceLocator, LOCATOR_SIZE ,L"section://%X,%ls#%ls",c_ModuleHandle,L"media", L"media/splashes.txt"); - BYTE *splashesData; - UINT splashesSize; + uint8_t *splashesData; + unsigned int splashesSize; hr = XuiResourceLoadAllNoLoc(szResourceLocator, &splashesData, &splashesSize); if( HRESULT_SUCCEEDED( hr ) ) @@ -127,7 +127,7 @@ HRESULT CScene_Main::OnInit( XUIMessageInit* pInitData, BOOL& bHandled ) return S_OK; } -HRESULT CScene_Main::OnNotifySetFocus(HXUIOBJ hObjSource, XUINotifyFocus *pNotifyFocusData, BOOL& bHandled) +int CScene_Main::OnNotifySetFocus(HXUIOBJ hObjSource, XUINotifyFocus *pNotifyFocusData, bool& bHandled) { // If we sign out when in the saves list, we get a notifysetfocus in the saves list after the init of the main menu ui.SetTooltips(DEFAULT_XUI_MENU_USER, IDS_TOOLTIPS_SELECT); @@ -139,7 +139,7 @@ HRESULT CScene_Main::OnNotifySetFocus(HXUIOBJ hObjSource, XUINotifyFocus *pNotif //---------------------------------------------------------------------------------- // Handler for the button press message. //---------------------------------------------------------------------------------- -HRESULT CScene_Main::OnNotifyPressEx(HXUIOBJ hObjPressed, XUINotifyPress* pNotifyPressData, BOOL& rfHandled) +int CScene_Main::OnNotifyPressEx(HXUIOBJ hObjPressed, XUINotifyPress* pNotifyPressData, bool& rfHandled) { // should we ignore the button press? This will be set if we're waiting for a callback from a function launched from a button press if(m_bIgnorePress) return S_OK; @@ -173,7 +173,7 @@ HRESULT CScene_Main::OnNotifyPressEx(HXUIOBJ hObjPressed, XUINotifyPress* pNotif else { // get them to sign in - UINT uiIDA[2]; + unsigned int uiIDA[2]; uiIDA[0]=IDS_CONFIRM_OK; uiIDA[1]=IDS_CONFIRM_CANCEL; StorageManager.RequestMessageBox(IDS_MUST_SIGN_IN_TITLE, IDS_MUST_SIGN_IN_TEXT, uiIDA, 2, pNotifyPressData->UserIndex,&CScene_Main::MustSignInReturned,this, app.GetStringTable()); @@ -192,7 +192,7 @@ HRESULT CScene_Main::OnNotifyPressEx(HXUIOBJ hObjPressed, XUINotifyPress* pNotif // get them to sign in //ProfileManager.RequestSignInUI(false, false, true,false,true, &CScene_Main::Leaderboards_SignInReturned, this); // get them to sign in - UINT uiIDA[2]; + unsigned int uiIDA[2]; uiIDA[0]=IDS_CONFIRM_OK; uiIDA[1]=IDS_CONFIRM_CANCEL; StorageManager.RequestMessageBox(IDS_MUST_SIGN_IN_TITLE, IDS_MUST_SIGN_IN_TEXT, uiIDA, 2, pNotifyPressData->UserIndex,&CScene_Main::MustSignInReturned,this, app.GetStringTable()); @@ -210,7 +210,7 @@ HRESULT CScene_Main::OnNotifyPressEx(HXUIOBJ hObjPressed, XUINotifyPress* pNotif // get them to sign in //ProfileManager.RequestSignInUI(false, false, true,false,true,&CScene_Main::Achievements_SignInReturned,this ); // get them to sign in - UINT uiIDA[2]; + unsigned int uiIDA[2]; uiIDA[0]=IDS_CONFIRM_OK; uiIDA[1]=IDS_CONFIRM_CANCEL; StorageManager.RequestMessageBox(IDS_MUST_SIGN_IN_TITLE, IDS_MUST_SIGN_IN_TEXT, uiIDA, 2, pNotifyPressData->UserIndex,&CScene_Main::MustSignInReturned,this, app.GetStringTable()); @@ -232,7 +232,7 @@ HRESULT CScene_Main::OnNotifyPressEx(HXUIOBJ hObjPressed, XUINotifyPress* pNotif // get them to sign in //ProfileManager.RequestSignInUI(false, false, true,false,true,&CScene_Main::HelpAndOptions_SignInReturned,this ); // get them to sign in - UINT uiIDA[2]; + unsigned int uiIDA[2]; uiIDA[0]=IDS_CONFIRM_OK; uiIDA[1]=IDS_CONFIRM_CANCEL; StorageManager.RequestMessageBox(IDS_MUST_SIGN_IN_TITLE, IDS_MUST_SIGN_IN_TEXT, uiIDA, 2, pNotifyPressData->UserIndex,&CScene_Main::MustSignInReturned,this, app.GetStringTable()); @@ -254,7 +254,7 @@ HRESULT CScene_Main::OnNotifyPressEx(HXUIOBJ hObjPressed, XUINotifyPress* pNotif else { // get them to sign in - UINT uiIDA[2]; + unsigned int uiIDA[2]; uiIDA[0]=IDS_CONFIRM_OK; uiIDA[1]=IDS_CONFIRM_CANCEL; StorageManager.RequestMessageBox(IDS_MUST_SIGN_IN_TITLE, IDS_MUST_SIGN_IN_TEXT, uiIDA, 2, pNotifyPressData->UserIndex,&CScene_Main::MustSignInReturned,this, app.GetStringTable()); @@ -264,7 +264,7 @@ HRESULT CScene_Main::OnNotifyPressEx(HXUIOBJ hObjPressed, XUINotifyPress* pNotif case BUTTON_EXITGAME: if( ProfileManager.IsFullVersion() ) { - UINT uiIDA[2]; + unsigned int uiIDA[2]; uiIDA[0]=IDS_CANCEL; uiIDA[1]=IDS_OK; StorageManager.RequestMessageBox(IDS_WARNING_ARCADE_TITLE, IDS_WARNING_ARCADE_TEXT, uiIDA, 2, XUSER_INDEX_ANY,&CScene_Main::ExitGameReturned,this); @@ -284,7 +284,7 @@ HRESULT CScene_Main::OnNotifyPressEx(HXUIOBJ hObjPressed, XUINotifyPress* pNotif return S_OK; } -HRESULT CScene_Main::OnNavReturn(HXUIOBJ hObj,BOOL& rfHandled) +int CScene_Main::OnNavReturn(HXUIOBJ hObj,bool& rfHandled) { ui.SetTooltips( DEFAULT_XUI_MENU_USER, IDS_TOOLTIPS_SELECT); CXuiSceneBase::ShowLogo(DEFAULT_XUI_MENU_USER,true); @@ -318,7 +318,7 @@ HRESULT CScene_Main::OnNavReturn(HXUIOBJ hObj,BOOL& rfHandled) return S_OK; } -HRESULT CScene_Main::OnTransitionStart( XUIMessageTransition *pTransition, BOOL& bHandled ) +int CScene_Main::OnTransitionStart( XUIMessageTransition *pTransition, bool& bHandled ) { if(pTransition->dwTransAction==XUI_TRANSITION_ACTION_DESTROY ) return S_OK; @@ -356,7 +356,7 @@ HRESULT CScene_Main::OnTransitionStart( XUIMessageTransition *pTransition, BOOL& #ifndef OVERRIDE_XUI_FONT_RENDERER XUIRect xuiRect; - HRESULT hr=S_OK; + int hr=S_OK; float fWidth,fHeight; HXUIOBJ visual=NULL; @@ -430,7 +430,7 @@ HRESULT CScene_Main::OnTransitionStart( XUIMessageTransition *pTransition, BOOL& return S_OK; } -HRESULT CScene_Main::OnControlNavigate(XUIMessageControlNavigate *pControlNavigateData, BOOL& bHandled) +int CScene_Main::OnControlNavigate(XUIMessageControlNavigate *pControlNavigateData, bool& bHandled) { #ifdef _MINECON // added so we can skip greyed out items for Minecon @@ -444,7 +444,7 @@ HRESULT CScene_Main::OnControlNavigate(XUIMessageControlNavigate *pControlNaviga return S_OK; } -HRESULT CScene_Main::OnKeyDown(XUIMessageInput *pInputData, BOOL& bHandled) +int CScene_Main::OnKeyDown(XUIMessageInput *pInputData, bool& bHandled) { ui.AnimateKeyPress(pInputData->UserIndex, pInputData->dwKeyCode); @@ -471,7 +471,7 @@ int CScene_Main::SignInReturned(void *pParam,bool bContinue) int CScene_Main::DeviceSelectReturned(void *pParam,bool bContinue) { CScene_Main* pClass = (CScene_Main*)pParam; - //HRESULT hr; + //int hr; if(bContinue==true) { @@ -559,7 +559,7 @@ int CScene_Main::CreateLoad_SignInReturned(void *pParam,bool bContinue, int iPad if(bContinue==true) { - UINT uiIDA[1]; + unsigned int uiIDA[1]; uiIDA[0]=IDS_OK; if(ProfileManager.IsGuest(ProfileManager.GetPrimaryPad())) @@ -710,7 +710,7 @@ int CScene_Main::MustSignInReturned(void *pParam,int iPad,C4JStorage::EMessageRe int CScene_Main::AchievementsDeviceSelectReturned(void *pParam,bool bContinue) { //CScene_Main* pClass = (CScene_Main*)pParam; - //HRESULT hr; + //int hr; if(bContinue==true) { @@ -727,7 +727,7 @@ int CScene_Main::Leaderboards_SignInReturned(void *pParam,bool bContinue,int iPa if(bContinue==true) { - UINT uiIDA[1]; + unsigned int uiIDA[1]; uiIDA[0]=IDS_OK; // guests can't look at leaderboards if(ProfileManager.IsGuest(ProfileManager.GetPrimaryPad())) @@ -915,7 +915,7 @@ void CScene_Main::LoadTrial(void) LoadingInputParams *loadingParams = new LoadingInputParams(); loadingParams->func = &CGameNetworkManager::RunNetworkGameThreadProc; - loadingParams->lpParam = (LPVOID)param; + loadingParams->lpParam = (void*)param; UIFullscreenProgressCompletionData *completionData = new UIFullscreenProgressCompletionData(); completionData->bShowBackground=true; @@ -939,7 +939,7 @@ void CScene_Main::RunPlayGame(int iPad) if(ProfileManager.IsGuest(iPad)) { - UINT uiIDA[1]; + unsigned int uiIDA[1]; uiIDA[0]=IDS_OK; StorageManager.RequestMessageBox(IDS_PRO_GUESTPROFILE_TITLE, IDS_PRO_GUESTPROFILE_TEXT, uiIDA, 1); @@ -1031,7 +1031,7 @@ void CScene_Main::RunPlayGame(int iPad) } } -HRESULT CScene_Main::OnTMSBanFileRetrieved() +int CScene_Main::OnTMSBanFileRetrieved() { Minecraft *pMinecraft=Minecraft::GetInstance(); int iPad=ProfileManager.GetLockedProfile(); @@ -1055,7 +1055,7 @@ HRESULT CScene_Main::OnTMSBanFileRetrieved() void CScene_Main::RunLeaderboards(int iPad) { - UINT uiIDA[1]; + unsigned int uiIDA[1]; uiIDA[0]=IDS_OK; // guests can't look at leaderboards @@ -1078,7 +1078,7 @@ void CScene_Main::RunLeaderboards(int iPad) } void CScene_Main::RunAchievements(int iPad) { - UINT uiIDA[1]; + unsigned int uiIDA[1]; uiIDA[0]=IDS_OK; // guests can't look at achievements @@ -1095,7 +1095,7 @@ void CScene_Main::RunHelpAndOptions(int iPad) { if(ProfileManager.IsGuest(iPad)) { - UINT uiIDA[1]; + unsigned int uiIDA[1]; uiIDA[0]=IDS_OK; StorageManager.RequestMessageBox(IDS_PRO_GUESTPROFILE_TITLE, IDS_PRO_GUESTPROFILE_TEXT, uiIDA, 1); } @@ -1130,7 +1130,7 @@ void CScene_Main::RunHelpAndOptions(int iPad) } } -HRESULT CScene_Main::OnTMSDLCFileRetrieved( ) +int CScene_Main::OnTMSDLCFileRetrieved( ) { m_Timer.SetShow(false); switch(m_eAction) @@ -1149,7 +1149,7 @@ HRESULT CScene_Main::OnTMSDLCFileRetrieved( ) void CScene_Main::RunUnlockOrDLC(int iPad) { - UINT uiIDA[1]; + unsigned int uiIDA[1]; uiIDA[0]=IDS_OK; // Check if this means downloadable content @@ -1262,7 +1262,7 @@ int CScene_Main::TMSFileReadReturned(void *pParam,int iPad,C4JStorage::PTMSPP_FI return 0; } -HRESULT CScene_Main::OnTimer( XUIMessageTimer *pTimer, BOOL& bHandled ) +int CScene_Main::OnTimer( XUIMessageTimer *pTimer, bool& bHandled ) { // 4J-PB - TODO - Don't think we can do this - if a 2nd player signs in here with an offline profile, the signed in LIVE player gets re-logged in, and bMultiplayerAllowed is false briefly if( pTimer->nId == DLC_INSTALLED_TIMER_ID) diff --git a/src/client/Common/XUI/XUI_MainMenu.h b/src/client/Common/XUI/XUI_MainMenu.h index 2e4279e4..ff986844 100644 --- a/src/client/Common/XUI/XUI_MainMenu.h +++ b/src/client/Common/XUI/XUI_MainMenu.h @@ -80,16 +80,16 @@ protected: MAP_CONTROL(IDC_Timer, m_Timer) END_CONTROL_MAP() - HRESULT OnInit( XUIMessageInit* pInitData, BOOL& bHandled ); - HRESULT OnNotifyPressEx(HXUIOBJ hObjPressed, XUINotifyPress* pNotifyPressData,BOOL& rfHandled); - HRESULT OnNavReturn(HXUIOBJ hObj,BOOL& rfHandled); - HRESULT OnTransitionStart( XUIMessageTransition *pTransition, BOOL& bHandled ); - HRESULT OnControlNavigate(XUIMessageControlNavigate *pControlNavigateData, BOOL& bHandled); - HRESULT OnKeyDown(XUIMessageInput *pInputData, BOOL& bHandled); - HRESULT OnNotifySetFocus(HXUIOBJ hObjSource, XUINotifyFocus *pNotifyFocusData, BOOL& bHandled); - HRESULT OnTMSBanFileRetrieved(); - HRESULT OnTMSDLCFileRetrieved( ); - HRESULT OnTimer( XUIMessageTimer *pTimer, BOOL& bHandled ); + int OnInit( XUIMessageInit* pInitData, bool& bHandled ); + int OnNotifyPressEx(HXUIOBJ hObjPressed, XUINotifyPress* pNotifyPressData,bool& rfHandled); + int OnNavReturn(HXUIOBJ hObj,bool& rfHandled); + int OnTransitionStart( XUIMessageTransition *pTransition, bool& bHandled ); + int OnControlNavigate(XUIMessageControlNavigate *pControlNavigateData, bool& bHandled); + int OnKeyDown(XUIMessageInput *pInputData, bool& bHandled); + int OnNotifySetFocus(HXUIOBJ hObjSource, XUINotifyFocus *pNotifyFocusData, bool& bHandled); + int OnTMSBanFileRetrieved(); + int OnTMSDLCFileRetrieved( ); + int OnTimer( XUIMessageTimer *pTimer, bool& bHandled ); int SetSaveDevice(); static void LoadTrial(); diff --git a/src/client/Common/XUI/XUI_MultiGameCreate.cpp b/src/client/Common/XUI/XUI_MultiGameCreate.cpp index e7d30e81..e2e1eb0e 100644 --- a/src/client/Common/XUI/XUI_MultiGameCreate.cpp +++ b/src/client/Common/XUI/XUI_MultiGameCreate.cpp @@ -34,13 +34,13 @@ int CScene_MultiGameCreate::m_iDifficultyTitleSettingA[4]= //---------------------------------------------------------------------------------- // Performs initialization tasks - retrieves controls. //---------------------------------------------------------------------------------- -HRESULT CScene_MultiGameCreate::OnInit( XUIMessageInit* pInitData, BOOL& bHandled ) +int CScene_MultiGameCreate::OnInit( XUIMessageInit* pInitData, bool& bHandled ) { m_bSetup = false; m_texturePackDescDisplayed = false; m_iConfigA=NULL; - WCHAR TempString[256]; + wchar_t TempString[256]; MapChildControls(); XuiControlSetText(m_EditWorldName,app.GetString(IDS_DEFAULT_WORLD_NAME)); @@ -104,7 +104,7 @@ HRESULT CScene_MultiGameCreate::OnInit( XUIMessageInit* pInitData, BOOL& bHandle m_CurrentDifficulty=app.GetGameSettings(m_iPad,eGameSetting_Difficulty); m_SliderDifficulty.SetValue(m_CurrentDifficulty); - swprintf( (WCHAR *)TempString, 256, L"%ls: %ls", app.GetString( IDS_SLIDER_DIFFICULTY ),app.GetString(m_iDifficultyTitleSettingA[m_CurrentDifficulty])); + swprintf( (wchar_t *)TempString, 256, L"%ls: %ls", app.GetString( IDS_SLIDER_DIFFICULTY ),app.GetString(m_iDifficultyTitleSettingA[m_CurrentDifficulty])); m_SliderDifficulty.SetText(TempString); ui.SetTooltips( DEFAULT_XUI_MENU_USER, IDS_TOOLTIPS_SELECT,IDS_TOOLTIPS_BACK); @@ -178,14 +178,14 @@ HRESULT CScene_MultiGameCreate::OnInit( XUIMessageInit* pInitData, BOOL& bHandle Minecraft *pMinecraft = Minecraft::GetInstance(); int texturePacksCount = pMinecraft->skins->getTexturePackCount(); CXuiCtrl4JList::LIST_ITEM_INFO ListInfo; - HRESULT hr; + int hr; for(unsigned int i = 0; i < texturePacksCount; ++i) { TexturePack *tp = pMinecraft->skins->getTexturePackByIndex(i); ZeroMemory(&ListInfo,sizeof(CXuiCtrl4JList::LIST_ITEM_INFO)); - DWORD dwImageBytes; - PBYTE pbImageData = tp->getPackIcon(dwImageBytes); + unsigned long dwImageBytes; + uint8_t* pbImageData = tp->getPackIcon(dwImageBytes); if(dwImageBytes > 0 && pbImageData) { @@ -231,7 +231,7 @@ HRESULT CScene_MultiGameCreate::OnInit( XUIMessageInit* pInitData, BOOL& bHandle for(unsigned int i = 0; i < app.GetDLCInfoTexturesOffersCount(); ++i) { bTexturePackAlreadyListed=false; - ULONGLONG ull=app.GetDLCInfoTexturesFullOffer(i); + uint64_t ull=app.GetDLCInfoTexturesFullOffer(i); pDLCInfo=app.GetDLCInfoForFullOfferID(ull); for(unsigned int i = 0; i < texturePacksCount; ++i) { @@ -261,7 +261,7 @@ HRESULT CScene_MultiGameCreate::OnInit( XUIMessageInit* pInitData, BOOL& bHandle for(unsigned int i = 0; i < app.GetDLCInfoTexturesOffersCount(); ++i) { bTexturePackAlreadyListed=false; - ULONGLONG ull=app.GetDLCInfoTexturesFullOffer(i); + uint64_t ull=app.GetDLCInfoTexturesFullOffer(i); pDLCInfo=app.GetDLCInfoForFullOfferID(ull); for(unsigned int i = 0; i < texturePacksCount; ++i) { @@ -287,7 +287,7 @@ HRESULT CScene_MultiGameCreate::OnInit( XUIMessageInit* pInitData, BOOL& bHandle } -HRESULT CScene_MultiGameCreate::OnDestroy() +int CScene_MultiGameCreate::OnDestroy() { // clear out the texture pack data for(int i=0;iRecordUpsellPresented(ProfileManager.GetPrimaryPad(), eSet_UpsellID_Texture_DLC, ullOfferID_Full & 0xFFFFFFFF); - UINT uiIDA[3]; + unsigned int uiIDA[3]; // Need to check if the texture pack has both Full and Trial versions - we may do some as free ones, so only Full DLC_INFO *pDLCInfo=app.GetDLCInfoForFullOfferID(ullOfferID_Full); @@ -403,7 +403,7 @@ HRESULT CScene_MultiGameCreate::OnNotifyPressEx(HXUIOBJ hObjPressed, XUINotifyPr if(m_pDLCPack && !m_pDLCPack->hasPurchasedFile( DLCManager::e_DLCType_Texture, L"" )) { // no - UINT uiIDA[1]; + unsigned int uiIDA[1]; uiIDA[0]=IDS_OK; if(!ProfileManager.IsSignedInLive(pNotifyPressData->UserIndex)) @@ -417,7 +417,7 @@ HRESULT CScene_MultiGameCreate::OnNotifyPressEx(HXUIOBJ hObjPressed, XUINotifyPr // upsell DLC_INFO *pDLCInfo = app.GetDLCInfoForTrialOfferID(m_pDLCPack->getPurchaseOfferId()); - ULONGLONG ullOfferID_Full; + uint64_t ullOfferID_Full; if(pDLCInfo!=NULL) { @@ -431,7 +431,7 @@ HRESULT CScene_MultiGameCreate::OnNotifyPressEx(HXUIOBJ hObjPressed, XUINotifyPr // tell sentient about the upsell of the full version of the skin pack TelemetryManager->RecordUpsellPresented(pNotifyPressData->UserIndex, eSet_UpsellID_Texture_DLC, ullOfferID_Full & 0xFFFFFFFF); - UINT uiIDA[1]; + unsigned int uiIDA[1]; uiIDA[0]=IDS_CONFIRM_OK; // Give the player a warning about the trial version of the texture pack @@ -444,7 +444,7 @@ HRESULT CScene_MultiGameCreate::OnNotifyPressEx(HXUIOBJ hObjPressed, XUINotifyPr if(m_bGameModeSurvival != true || m_MoreOptionsParams.bHostPrivileges == true) { - UINT uiIDA[2]; + unsigned int uiIDA[2]; uiIDA[0]=IDS_CONFIRM_OK; uiIDA[1]=IDS_CONFIRM_CANCEL; if(m_bGameModeSurvival != true) @@ -459,7 +459,7 @@ HRESULT CScene_MultiGameCreate::OnNotifyPressEx(HXUIOBJ hObjPressed, XUINotifyPr else { // 4J Stu - If we only have one controller connected, then don't show the sign-in UI again - DWORD connectedControllers = 0; + unsigned long connectedControllers = 0; for(unsigned int i = 0; i < XUSER_MAX_COUNT; ++i) { if( InputManager.IsPadConnected(i) || ProfileManager.IsSignedIn(i) ) ++connectedControllers; @@ -474,8 +474,8 @@ HRESULT CScene_MultiGameCreate::OnNotifyPressEx(HXUIOBJ hObjPressed, XUINotifyPr // Check if user-created content is allowed, as we cannot play multiplayer if it's not //bool isClientSide = ProfileManager.IsSignedInLive(ProfileManager.GetPrimaryPad()) && m_MoreOptionsParams.bOnlineGame; bool noUGC = false; - BOOL pccAllowed = true; - BOOL pccFriendsAllowed = true; + bool pccAllowed = true; + bool pccFriendsAllowed = true; ProfileManager.AllowedPlayerCreatedContent(ProfileManager.GetPrimaryPad(),false,&pccAllowed,&pccFriendsAllowed); if(!pccAllowed && !pccFriendsAllowed) noUGC = true; @@ -483,7 +483,7 @@ HRESULT CScene_MultiGameCreate::OnNotifyPressEx(HXUIOBJ hObjPressed, XUINotifyPr { m_bIgnoreInput = false; SetShow( true ); - UINT uiIDA[1]; + unsigned int uiIDA[1]; uiIDA[0]=IDS_CONFIRM_OK; StorageManager.RequestMessageBox( IDS_FAILED_TO_CREATE_GAME_TITLE, IDS_NO_USER_CREATED_CONTENT_PRIVILEGE_CREATE, uiIDA,1,ProfileManager.GetPrimaryPad(),NULL,NULL, app.GetStringTable()); } @@ -528,7 +528,7 @@ int CScene_MultiGameCreate::UnlockTexturePackReturned(void *pParam,int iPad,C4JS { if(ProfileManager.IsSignedIn(iPad)) { - ULONGLONG ullIndexA[1]; + uint64_t ullIndexA[1]; DLC_INFO *pDLCInfo = app.GetDLCInfoForTrialOfferID(pScene->m_pDLCPack->getPurchaseOfferId()); if(pDLCInfo!=NULL) @@ -565,7 +565,7 @@ int CScene_MultiGameCreate::WarningTrialTexturePackReturned(void *pParam,int iPa // 4J Stu - If we only have one controller connected, then don't show the sign-in UI again - DWORD connectedControllers = 0; + unsigned long connectedControllers = 0; for(unsigned int i = 0; i < XUSER_MAX_COUNT; ++i) { if( InputManager.IsPadConnected(i) || ProfileManager.IsSignedIn(i) ) ++connectedControllers; @@ -579,14 +579,14 @@ int CScene_MultiGameCreate::WarningTrialTexturePackReturned(void *pParam,int iPa { // Check if user-created content is allowed, as we cannot play multiplayer if it's not bool noUGC = false; - BOOL pccAllowed = true; - BOOL pccFriendsAllowed = true; + bool pccAllowed = true; + bool pccFriendsAllowed = true; ProfileManager.AllowedPlayerCreatedContent(ProfileManager.GetPrimaryPad(),false,&pccAllowed,&pccFriendsAllowed); if(!pccAllowed && !pccFriendsAllowed) noUGC = true; if(isClientSide && noUGC ) { - UINT uiIDA[1]; + unsigned int uiIDA[1]; uiIDA[0]=IDS_CONFIRM_OK; StorageManager.RequestMessageBox( IDS_FAILED_TO_CREATE_GAME_TITLE, IDS_NO_USER_CREATED_CONTENT_PRIVILEGE_CREATE, uiIDA,1,ProfileManager.GetPrimaryPad(),NULL,NULL, app.GetStringTable()); } @@ -602,7 +602,7 @@ int CScene_MultiGameCreate::WarningTrialTexturePackReturned(void *pParam,int iPa return 0; } -HRESULT CScene_MultiGameCreate::OnKeyDown(XUIMessageInput* pInputData, BOOL& rfHandled) +int CScene_MultiGameCreate::OnKeyDown(XUIMessageInput* pInputData, bool& rfHandled) { if(m_bIgnoreInput) return S_OK; @@ -620,28 +620,28 @@ HRESULT CScene_MultiGameCreate::OnKeyDown(XUIMessageInput* pInputData, BOOL& rfH return S_OK; } -HRESULT CScene_MultiGameCreate::OnNotifyValueChanged (HXUIOBJ hObjSource, XUINotifyValueChanged* pValueChangedData, BOOL& rfHandled) +int CScene_MultiGameCreate::OnNotifyValueChanged (HXUIOBJ hObjSource, XUINotifyValueChanged* pValueChangedData, bool& rfHandled) { - WCHAR TempString[256]; + wchar_t TempString[256]; if(hObjSource == m_EditWorldName) { // Enable the done button when we have all of the necessary information wstring wWorldName = m_EditWorldName.GetText(); - BOOL bHasWorldName = ( wWorldName.length()!=0); + bool bHasWorldName = ( wWorldName.length()!=0); m_NewWorld.SetEnable(bHasWorldName); } else if(hObjSource==m_SliderDifficulty.GetSlider() ) { app.SetGameSettings(m_iPad,eGameSetting_Difficulty,pValueChangedData->nValue); - swprintf( (WCHAR *)TempString, 256, L"%ls: %ls", app.GetString( IDS_SLIDER_DIFFICULTY ),app.GetString(m_iDifficultyTitleSettingA[pValueChangedData->nValue])); + swprintf( (wchar_t *)TempString, 256, L"%ls: %ls", app.GetString( IDS_SLIDER_DIFFICULTY ),app.GetString(m_iDifficultyTitleSettingA[pValueChangedData->nValue])); m_SliderDifficulty.SetText(TempString); } return S_OK; } -HRESULT CScene_MultiGameCreate::OnControlNavigate(XUIMessageControlNavigate *pControlNavigateData, BOOL& bHandled) +int CScene_MultiGameCreate::OnControlNavigate(XUIMessageControlNavigate *pControlNavigateData, bool& bHandled) { pControlNavigateData->hObjDest=XuiControlGetNavigation(pControlNavigateData->hObjSource,pControlNavigateData->nControlNavigate,true,true); @@ -654,7 +654,7 @@ HRESULT CScene_MultiGameCreate::OnControlNavigate(XUIMessageControlNavigate *pCo return S_OK; } -HRESULT CScene_MultiGameCreate::OnTimer( XUIMessageTimer *pTimer, BOOL& bHandled ) +int CScene_MultiGameCreate::OnTimer( XUIMessageTimer *pTimer, bool& bHandled ) { // 4J-PB - TODO - Don't think we can do this - if a 2nd player signs in here with an offline profile, the signed in LIVE player gets re-logged in, and bMultiplayerAllowed is false briefly switch(pTimer->nId) @@ -705,8 +705,8 @@ HRESULT CScene_MultiGameCreate::OnTimer( XUIMessageTimer *pTimer, BOOL& bHandled { if(m_iConfigA[i]!=-1) { - DWORD dwBytes=0; - PBYTE pbData=NULL; + unsigned long dwBytes=0; + uint8_t* pbData=NULL; //app.DebugPrintf("Retrieving iConfig %d from TPD\n",m_iConfigA[i]); app.GetTPD(m_iConfigA[i],&pbData,&dwBytes); @@ -714,13 +714,13 @@ HRESULT CScene_MultiGameCreate::OnTimer( XUIMessageTimer *pTimer, BOOL& bHandled ZeroMemory(&ListInfo,sizeof(CXuiCtrl4JList::LIST_ITEM_INFO)); if(dwBytes > 0 && pbData) { - DWORD dwImageBytes=0; - PBYTE pbImageData=NULL; + unsigned long dwImageBytes=0; + uint8_t* pbImageData=NULL; app.GetFileFromTPD(eTPDFileType_Icon,pbData,dwBytes,&pbImageData,&dwImageBytes ); ListInfo.fEnabled = true; ListInfo.iData = m_iConfigA[i]; - HRESULT hr=XuiCreateTextureBrushFromMemory(pbImageData,dwImageBytes,&ListInfo.hXuiBrush); + int hr=XuiCreateTextureBrushFromMemory(pbImageData,dwImageBytes,&ListInfo.hXuiBrush); app.DebugPrintf("Adding texturepack %d from TPD\n",m_iConfigA[i]); ListInfo.iSortIndex=m_iConfigA[i]; @@ -761,7 +761,7 @@ int CScene_MultiGameCreate::ConfirmCreateReturned(void *pParam,int iPad,C4JStora bool isClientSide = ProfileManager.IsSignedInLive(ProfileManager.GetPrimaryPad()) && pClass->m_MoreOptionsParams.bOnlineGame; // 4J Stu - If we only have one controller connected, then don't show the sign-in UI again - DWORD connectedControllers = 0; + unsigned long connectedControllers = 0; for(unsigned int i = 0; i < XUSER_MAX_COUNT; ++i) { if( InputManager.IsPadConnected(i) || ProfileManager.IsSignedIn(i) ) ++connectedControllers; @@ -776,8 +776,8 @@ int CScene_MultiGameCreate::ConfirmCreateReturned(void *pParam,int iPad,C4JStora // Check if user-created content is allowed, as we cannot play multiplayer if it's not bool isClientSide = ProfileManager.IsSignedInLive(ProfileManager.GetPrimaryPad()) && pClass->m_MoreOptionsParams.bOnlineGame; bool noUGC = false; - BOOL pccAllowed = true; - BOOL pccFriendsAllowed = true; + bool pccAllowed = true; + bool pccFriendsAllowed = true; ProfileManager.AllowedPlayerCreatedContent(ProfileManager.GetPrimaryPad(),false,&pccAllowed,&pccFriendsAllowed); if(!pccAllowed && !pccFriendsAllowed) noUGC = true; @@ -785,7 +785,7 @@ int CScene_MultiGameCreate::ConfirmCreateReturned(void *pParam,int iPad,C4JStora { pClass->m_bIgnoreInput = false; pClass->SetShow( true ); - UINT uiIDA[1]; + unsigned int uiIDA[1]; uiIDA[0]=IDS_CONFIRM_OK; StorageManager.RequestMessageBox( IDS_FAILED_TO_CREATE_GAME_TITLE, IDS_NO_USER_CREATED_CONTENT_PRIVILEGE_CREATE, uiIDA,1,ProfileManager.GetPrimaryPad(),NULL,NULL, app.GetStringTable()); } @@ -815,7 +815,7 @@ int CScene_MultiGameCreate::StartGame_SignInReturned(void *pParam,bool bContinue // It's possible that the player has not signed in - they can back out if(ProfileManager.IsSignedIn(iPad)) { - DWORD dwLocalUsersMask = 0; + unsigned long dwLocalUsersMask = 0; bool isClientSide = ProfileManager.IsSignedInLive(ProfileManager.GetPrimaryPad()) && pClass->m_MoreOptionsParams.bOnlineGame; bool noPrivileges = false; @@ -831,8 +831,8 @@ int CScene_MultiGameCreate::StartGame_SignInReturned(void *pParam,bool bContinue // Check if user-created content is allowed, as we cannot play multiplayer if it's not bool noUGC = false; - BOOL pccAllowed = true; - BOOL pccFriendsAllowed = true; + bool pccAllowed = true; + bool pccFriendsAllowed = true; ProfileManager.AllowedPlayerCreatedContent(ProfileManager.GetPrimaryPad(),false,&pccAllowed,&pccFriendsAllowed); if(!pccAllowed && !pccFriendsAllowed) noUGC = true; @@ -842,7 +842,7 @@ int CScene_MultiGameCreate::StartGame_SignInReturned(void *pParam,bool bContinue { pClass->m_bIgnoreInput = false; pClass->SetShow( true ); - UINT uiIDA[1]; + unsigned int uiIDA[1]; uiIDA[0]=IDS_CONFIRM_OK; StorageManager.RequestMessageBox( IDS_FAILED_TO_CREATE_GAME_TITLE, IDS_NO_USER_CREATED_CONTENT_PRIVILEGE_CREATE, uiIDA,1,ProfileManager.GetPrimaryPad(),NULL,NULL, app.GetStringTable()); } @@ -850,7 +850,7 @@ int CScene_MultiGameCreate::StartGame_SignInReturned(void *pParam,bool bContinue { pClass->m_bIgnoreInput = false; pClass->SetShow( true ); - UINT uiIDA[1]; + unsigned int uiIDA[1]; uiIDA[0]=IDS_CONFIRM_OK; StorageManager.RequestMessageBox( IDS_NO_MULTIPLAYER_PRIVILEGE_TITLE, IDS_NO_MULTIPLAYER_PRIVILEGE_HOST_TEXT, uiIDA,1,ProfileManager.GetPrimaryPad(),NULL,NULL, app.GetStringTable()); } @@ -871,7 +871,7 @@ int CScene_MultiGameCreate::StartGame_SignInReturned(void *pParam,bool bContinue } // 4J Stu - Shared functionality that is the same whether we needed a quadrant sign-in or not -void CScene_MultiGameCreate::CreateGame(CScene_MultiGameCreate* pClass, DWORD dwLocalUsersMask) +void CScene_MultiGameCreate::CreateGame(CScene_MultiGameCreate* pClass, unsigned long dwLocalUsersMask) { // stop the timer running that causes a check for new texture packs in TMS but not installed, since this will run all through the create game, and will crash if it tries to create an hbrush XuiKillTimer(pClass->m_hObj,CHECKFORAVAILABLETEXTUREPACKS_TIMER_ID); @@ -889,7 +889,7 @@ void CScene_MultiGameCreate::CreateGame(CScene_MultiGameCreate* pClass, DWORD dw // Make our next save default to the name of the level StorageManager.SetSaveTitle((wchar_t *)wWorldName.c_str()); - BOOL bHasSeed = (pClass->m_EditSeed.GetText() != NULL); + bool bHasSeed = (pClass->m_EditSeed.GetText() != NULL); wstring wSeed; if(bHasSeed) @@ -904,11 +904,11 @@ void CScene_MultiGameCreate::CreateGame(CScene_MultiGameCreate* pClass, DWORD dw // start the game bool isFlat = (pClass->m_MoreOptionsParams.bFlatWorld==true); - __int64 seedValue = 0; //BiomeSource::findSeed(isFlat?LevelType::lvl_flat:LevelType::lvl_normal); // 4J - was (new Random())->nextLong() - now trying to actually find a seed to suit our requirements + int64_t seedValue = 0; //BiomeSource::findSeed(isFlat?LevelType::lvl_flat:LevelType::lvl_normal); // 4J - was (new Random())->nextLong() - now trying to actually find a seed to suit our requirements if (wSeed.length() != 0) { - __int64 value = 0; + int64_t value = 0; unsigned int len = (unsigned int)wSeed.length(); //Check if the input string contains a numerical value @@ -923,7 +923,7 @@ void CScene_MultiGameCreate::CreateGame(CScene_MultiGameCreate* pClass, DWORD dw //If the input string is a numerical value, convert it to a number if( isNumber ) - value = _fromString<__int64>(wSeed); + value = _fromString(wSeed); //If the value is not 0 use it, otherwise use the algorithm from the java String.hashCode() function to hash it if( value != 0 ) @@ -979,7 +979,7 @@ void CScene_MultiGameCreate::CreateGame(CScene_MultiGameCreate* pClass, DWORD dw LoadingInputParams *loadingParams = new LoadingInputParams(); loadingParams->func = &CGameNetworkManager::RunNetworkGameThreadProc; - loadingParams->lpParam = (LPVOID)param; + loadingParams->lpParam = (void*)param; // Reset the autosave time app.SetAutosaveTimerTime(); @@ -994,7 +994,7 @@ void CScene_MultiGameCreate::CreateGame(CScene_MultiGameCreate* pClass, DWORD dw app.NavigateToScene(ProfileManager.GetPrimaryPad(),eUIScene_FullscreenProgress, loadingParams); } -HRESULT CScene_MultiGameCreate::OnTransitionStart( XUIMessageTransition *pTransition, BOOL& bHandled ) +int CScene_MultiGameCreate::OnTransitionStart( XUIMessageTransition *pTransition, bool& bHandled ) { if(pTransition->dwTransAction==XUI_TRANSITION_ACTION_DESTROY ) return S_OK; @@ -1006,7 +1006,7 @@ HRESULT CScene_MultiGameCreate::OnTransitionStart( XUIMessageTransition *pTransi return S_OK; } -HRESULT CScene_MultiGameCreate::OnTransitionEnd( XUIMessageTransition *pTransition, BOOL& bHandled ) +int CScene_MultiGameCreate::OnTransitionEnd( XUIMessageTransition *pTransition, bool& bHandled ) { //if(pTransition->dwTransAction==XUI_TRANSITION_ACTION_DESTROY ) return S_OK; @@ -1049,7 +1049,7 @@ HRESULT CScene_MultiGameCreate::OnTransitionEnd( XUIMessageTransition *pTransiti return S_OK; } -HRESULT CScene_MultiGameCreate::OnNotifySelChanged( HXUIOBJ hObjSource, XUINotifySelChanged* pNotifySelChangedData, BOOL& bHandled ) +int CScene_MultiGameCreate::OnNotifySelChanged( HXUIOBJ hObjSource, XUINotifySelChanged* pNotifySelChangedData, bool& bHandled ) { if(hObjSource == m_pTexturePacksList->m_hObj) { @@ -1061,7 +1061,7 @@ HRESULT CScene_MultiGameCreate::OnNotifySelChanged( HXUIOBJ hObjSource, XUINotif return S_OK; } -HRESULT CScene_MultiGameCreate::OnNotifyKillFocus(HXUIOBJ hObjSource, XUINotifyFocus *pNotifyFocusData, BOOL& bHandled) +int CScene_MultiGameCreate::OnNotifyKillFocus(HXUIOBJ hObjSource, XUINotifyFocus *pNotifyFocusData, bool& bHandled) { HXUIOBJ hSourceParent, hDestParent; XuiElementGetParent(hObjSource,&hSourceParent); @@ -1099,8 +1099,8 @@ void CScene_MultiGameCreate::UpdateTexturePackDescription(int index) { // this is probably a texture pack icon added from TMS - DWORD dwBytes=0,dwFileBytes=0; - PBYTE pbData=NULL,pbFileData=NULL; + unsigned long dwBytes=0,dwFileBytes=0; + uint8_t* pbData=NULL,pbFileData=NULL; CXuiCtrl4JList::LIST_ITEM_INFO ListItem; // get the current index of the list, and then get the data @@ -1138,8 +1138,8 @@ void CScene_MultiGameCreate::UpdateTexturePackDescription(int index) m_texturePackTitle.SetText(tp->getName().c_str()); m_texturePackDescription.SetText(tp->getDesc1().c_str()); - DWORD dwImageBytes; - PBYTE pbImageData = tp->getPackIcon(dwImageBytes); + unsigned long dwImageBytes; + uint8_t* pbImageData = tp->getPackIcon(dwImageBytes); if(dwImageBytes > 0 && pbImageData) { @@ -1179,12 +1179,12 @@ void CScene_MultiGameCreate::UpdateCurrentTexturePack() // upsell the texture pack // tell sentient about the upsell of the full version of the skin pack - ULONGLONG ullOfferID_Full; + uint64_t ullOfferID_Full; app.GetDLCFullOfferIDForPackID(ListItem.iData,&ullOfferID_Full); TelemetryManager->RecordUpsellPresented(ProfileManager.GetPrimaryPad(), eSet_UpsellID_Texture_DLC, ullOfferID_Full & 0xFFFFFFFF); - UINT uiIDA[3]; + unsigned int uiIDA[3]; // Need to check if the texture pack has both Full and Trial versions - we may do some as free ones, so only Full DLC_INFO *pDLCInfo=app.GetDLCInfoForFullOfferID(ullOfferID_Full); @@ -1226,8 +1226,8 @@ int CScene_MultiGameCreate::TexturePackDialogReturned(void *pParam,int iPad,C4JS // we need to enable background downloading for the DLC XBackgroundDownloadSetMode(XBACKGROUND_DOWNLOAD_MODE_ALWAYS_ALLOW); - ULONGLONG ullOfferID_Full; - ULONGLONG ullIndexA[1]; + uint64_t ullOfferID_Full; + uint64_t ullIndexA[1]; CXuiCtrl4JList::LIST_ITEM_INFO ListItem; // get the current index of the list, and then get the data ListItem=pClass->m_pTexturePacksList->GetData(pClass->m_currentTexturePackIndex); @@ -1254,7 +1254,7 @@ int CScene_MultiGameCreate::TexturePackDialogReturned(void *pParam,int iPad,C4JS return 0; } -HRESULT CScene_MultiGameCreate::OnCustomMessage_DLCInstalled() +int CScene_MultiGameCreate::OnCustomMessage_DLCInstalled() { // mounted DLC may have changed if(app.StartInstallDLCProcess(m_iPad)==false) @@ -1273,7 +1273,7 @@ HRESULT CScene_MultiGameCreate::OnCustomMessage_DLCInstalled() return S_OK; } -HRESULT CScene_MultiGameCreate::OnCustomMessage_DLCMountingComplete() +int CScene_MultiGameCreate::OnCustomMessage_DLCMountingComplete() { // refill the texture pack list m_pTexturePacksList->SetSelectionChangedHandle(m_hObj); @@ -1281,14 +1281,14 @@ HRESULT CScene_MultiGameCreate::OnCustomMessage_DLCMountingComplete() Minecraft *pMinecraft = Minecraft::GetInstance(); int texturePacksCount = pMinecraft->skins->getTexturePackCount(); CXuiCtrl4JList::LIST_ITEM_INFO ListInfo; - HRESULT hr; + int hr; for(unsigned int i = 0; i < texturePacksCount; ++i) { TexturePack *tp = pMinecraft->skins->getTexturePackByIndex(i); ZeroMemory(&ListInfo,sizeof(CXuiCtrl4JList::LIST_ITEM_INFO)); - DWORD dwImageBytes; - PBYTE pbImageData = tp->getPackIcon(dwImageBytes); + unsigned long dwImageBytes; + uint8_t* pbImageData = tp->getPackIcon(dwImageBytes); if(dwImageBytes > 0 && pbImageData) { @@ -1328,7 +1328,7 @@ HRESULT CScene_MultiGameCreate::OnCustomMessage_DLCMountingComplete() for(unsigned int i = 0; i < app.GetDLCInfoTexturesOffersCount(); ++i) { bTexturePackAlreadyListed=false; - ULONGLONG ull=app.GetDLCInfoTexturesFullOffer(i); + uint64_t ull=app.GetDLCInfoTexturesFullOffer(i); pDLCInfo=app.GetDLCInfoForFullOfferID(ull); for(unsigned int i = 0; i < texturePacksCount; ++i) { @@ -1362,7 +1362,7 @@ HRESULT CScene_MultiGameCreate::OnCustomMessage_DLCMountingComplete() for(unsigned int i = 0; i < app.GetDLCInfoTexturesOffersCount(); ++i) { bTexturePackAlreadyListed=false; - ULONGLONG ull=app.GetDLCInfoTexturesFullOffer(i); + uint64_t ull=app.GetDLCInfoTexturesFullOffer(i); pDLCInfo=app.GetDLCInfoForFullOfferID(ull); for(unsigned int i = 0; i < texturePacksCount; ++i) { diff --git a/src/client/Common/XUI/XUI_MultiGameCreate.h b/src/client/Common/XUI/XUI_MultiGameCreate.h index 1f2abea0..c26697b7 100644 --- a/src/client/Common/XUI/XUI_MultiGameCreate.h +++ b/src/client/Common/XUI/XUI_MultiGameCreate.h @@ -65,19 +65,19 @@ protected: END_CONTROL_MAP() - HRESULT OnInit( XUIMessageInit* pInitData, BOOL& bHandled ); - HRESULT OnNotifyPressEx(HXUIOBJ hObjPressed, XUINotifyPress* pNotifyPressData,BOOL& rfHandled); - HRESULT OnKeyDown(XUIMessageInput* pInputData, BOOL& rfHandled); - HRESULT OnNotifyValueChanged (HXUIOBJ hObjSource, XUINotifyValueChanged* pValueChangedData, BOOL& rfHandled); - HRESULT OnControlNavigate( XUIMessageControlNavigate *pControlNavigateData, BOOL &bHandled); - HRESULT OnTimer( XUIMessageTimer *pTimer, BOOL& bHandled ); - HRESULT OnTransitionStart( XUIMessageTransition *pTransition, BOOL& bHandled ); - HRESULT OnTransitionEnd( XUIMessageTransition *pTransition, BOOL& bHandled ); - HRESULT OnNotifySelChanged( HXUIOBJ hObjSource, XUINotifySelChanged* pNotifySelChangedData, BOOL& bHandled ); - HRESULT OnNotifyKillFocus(HXUIOBJ hObjSource, XUINotifyFocus *pNotifyFocusData, BOOL& bHandled); - HRESULT OnCustomMessage_DLCInstalled(); - HRESULT OnCustomMessage_DLCMountingComplete(); - HRESULT OnDestroy(); + int OnInit( XUIMessageInit* pInitData, bool& bHandled ); + int OnNotifyPressEx(HXUIOBJ hObjPressed, XUINotifyPress* pNotifyPressData,bool& rfHandled); + int OnKeyDown(XUIMessageInput* pInputData, bool& rfHandled); + int OnNotifyValueChanged (HXUIOBJ hObjSource, XUINotifyValueChanged* pValueChangedData, bool& rfHandled); + int OnControlNavigate( XUIMessageControlNavigate *pControlNavigateData, bool &bHandled); + int OnTimer( XUIMessageTimer *pTimer, bool& bHandled ); + int OnTransitionStart( XUIMessageTransition *pTransition, bool& bHandled ); + int OnTransitionEnd( XUIMessageTransition *pTransition, bool& bHandled ); + int OnNotifySelChanged( HXUIOBJ hObjSource, XUINotifySelChanged* pNotifySelChangedData, bool& bHandled ); + int OnNotifyKillFocus(HXUIOBJ hObjSource, XUINotifyFocus *pNotifyFocusData, bool& bHandled); + int OnCustomMessage_DLCInstalled(); + int OnCustomMessage_DLCMountingComplete(); + int OnDestroy(); public: @@ -88,7 +88,7 @@ public: private: static int LoadSaveDataReturned(void *pParam,bool bContinue); static int StartGame_SignInReturned(void *pParam,bool bContinue, int iPad); - static void CreateGame(CScene_MultiGameCreate* pClass, DWORD dwLocalUsersMask); + static void CreateGame(CScene_MultiGameCreate* pClass, unsigned long dwLocalUsersMask); static int ConfirmCreateReturned(void *pParam,int iPad,C4JStorage::EMessageResult result); static int UnlockTexturePackReturned(void *pParam,int iPad,C4JStorage::EMessageResult result); static int WarningTrialTexturePackReturned(void *pParam,int iPad,C4JStorage::EMessageResult result); diff --git a/src/client/Common/XUI/XUI_MultiGameInfo.cpp b/src/client/Common/XUI/XUI_MultiGameInfo.cpp index eb0a2720..7fc92522 100644 --- a/src/client/Common/XUI/XUI_MultiGameInfo.cpp +++ b/src/client/Common/XUI/XUI_MultiGameInfo.cpp @@ -15,7 +15,7 @@ //---------------------------------------------------------------------------------- // Performs initialization tasks - retrieves controls. //---------------------------------------------------------------------------------- -HRESULT CScene_MultiGameInfo::OnInit( XUIMessageInit* pInitData, BOOL& bHandled ) +int CScene_MultiGameInfo::OnInit( XUIMessageInit* pInitData, bool& bHandled ) { MapChildControls(); @@ -133,7 +133,7 @@ HRESULT CScene_MultiGameInfo::OnInit( XUIMessageInit* pInitData, BOOL& bHandled //---------------------------------------------------------------------------------- // Handler for the button press message. //---------------------------------------------------------------------------------- -HRESULT CScene_MultiGameInfo::OnNotifyPressEx(HXUIOBJ hObjPressed, XUINotifyPress* pNotifyPressData, BOOL& rfHandled) +int CScene_MultiGameInfo::OnNotifyPressEx(HXUIOBJ hObjPressed, XUINotifyPress* pNotifyPressData, bool& rfHandled) { if(m_bIgnoreInput) return S_OK; @@ -149,7 +149,7 @@ HRESULT CScene_MultiGameInfo::OnNotifyPressEx(HXUIOBJ hObjPressed, XUINotifyPres m_bIgnoreInput=true; // 4J Stu - If we only have one controller connected, then don't show the sign-in UI again - DWORD connectedControllers = 0; + unsigned long connectedControllers = 0; for(unsigned int i = 0; i < XUSER_MAX_COUNT; ++i) { if( InputManager.IsPadConnected(i) || ProfileManager.IsSignedIn(i) ) ++connectedControllers; @@ -168,13 +168,13 @@ HRESULT CScene_MultiGameInfo::OnNotifyPressEx(HXUIOBJ hObjPressed, XUINotifyPres return S_OK; } -HRESULT CScene_MultiGameInfo::OnKeyDown(XUIMessageInput* pInputData, BOOL& rfHandled) +int CScene_MultiGameInfo::OnKeyDown(XUIMessageInput* pInputData, bool& rfHandled) { if(m_bIgnoreInput) return S_OK; ui.AnimateKeyPress(pInputData->UserIndex, pInputData->dwKeyCode); - HRESULT hr = S_OK; + int hr = S_OK; // Explicitly handle B button presses switch(pInputData->dwKeyCode) @@ -197,14 +197,14 @@ HRESULT CScene_MultiGameInfo::OnKeyDown(XUIMessageInput* pInputData, BOOL& rfHan return hr; } -HRESULT CScene_MultiGameInfo::OnNavReturn(HXUIOBJ hObj,BOOL& rfHandled) +int CScene_MultiGameInfo::OnNavReturn(HXUIOBJ hObj,bool& rfHandled) { ui.SetTooltips( DEFAULT_XUI_MENU_USER, IDS_TOOLTIPS_SELECT, IDS_TOOLTIPS_BACK); return S_OK; } -HRESULT CScene_MultiGameInfo::OnNotifySelChanged(HXUIOBJ hObjSource, XUINotifySelChanged *pNotifySelChangedData, BOOL& bHandled) +int CScene_MultiGameInfo::OnNotifySelChanged(HXUIOBJ hObjSource, XUINotifySelChanged *pNotifySelChangedData, bool& bHandled) { if(pNotifySelChangedData->iOldItem!=-1) { @@ -215,7 +215,7 @@ HRESULT CScene_MultiGameInfo::OnNotifySelChanged(HXUIOBJ hObjSource, XUINotifySe return S_OK; } -HRESULT CScene_MultiGameInfo::OnNotifySetFocus(HXUIOBJ hObjSource, XUINotifyFocus *pNotifyFocusData, BOOL& bHandled) +int CScene_MultiGameInfo::OnNotifySetFocus(HXUIOBJ hObjSource, XUINotifyFocus *pNotifyFocusData, bool& bHandled) { if( playersList.TreeHasFocus() && playersList.GetItemCount() > 0 ) { @@ -225,7 +225,7 @@ HRESULT CScene_MultiGameInfo::OnNotifySetFocus(HXUIOBJ hObjSource, XUINotifyFocu return S_OK; } -HRESULT CScene_MultiGameInfo::OnNotifyKillFocus(HXUIOBJ hObjSource, XUINotifyFocus *pNotifyFocusData, BOOL& bHandled) +int CScene_MultiGameInfo::OnNotifyKillFocus(HXUIOBJ hObjSource, XUINotifyFocus *pNotifyFocusData, bool& bHandled) { if( pNotifyFocusData->hObjOther == m_JoinGame ) { @@ -258,9 +258,9 @@ int CScene_MultiGameInfo::StartGame_SignInReturned(void *pParam,bool bContinue, // Shared function to join the game that is the same whether we used the sign-in UI or not void CScene_MultiGameInfo::JoinGame(CScene_MultiGameInfo* pClass) { - DWORD dwLocalUsersMask = 0; + unsigned long dwLocalUsersMask = 0; bool noPrivileges = false; - DWORD dwSignedInUsers = 0; + unsigned long dwSignedInUsers = 0; // if we're in SD mode, then only the primary player gets to play if(RenderManager.IsHiDef()) @@ -287,8 +287,8 @@ void CScene_MultiGameInfo::JoinGame(CScene_MultiGameInfo* pClass) // Check if user-created content is allowed, as we cannot play multiplayer if it's not bool noUGC = false; - BOOL pccAllowed = true; - BOOL pccFriendsAllowed = true; + bool pccAllowed = true; + bool pccFriendsAllowed = true; ProfileManager.AllowedPlayerCreatedContent(ProfileManager.GetPrimaryPad(),false,&pccAllowed,&pccFriendsAllowed); if(!pccAllowed && !pccFriendsAllowed) noUGC = true; @@ -296,7 +296,7 @@ void CScene_MultiGameInfo::JoinGame(CScene_MultiGameInfo* pClass) { pClass->SetShow( true ); pClass->m_bIgnoreInput=false; - UINT uiIDA[1]; + unsigned int uiIDA[1]; uiIDA[0]=IDS_CONFIRM_OK; int messageText = IDS_NO_USER_CREATED_CONTENT_PRIVILEGE_SINGLE_LOCAL; @@ -309,7 +309,7 @@ void CScene_MultiGameInfo::JoinGame(CScene_MultiGameInfo* pClass) { pClass->SetShow( true ); pClass->m_bIgnoreInput=false; - UINT uiIDA[1]; + unsigned int uiIDA[1]; uiIDA[0]=IDS_CONFIRM_OK; StorageManager.RequestMessageBox( IDS_NO_MULTIPLAYER_PRIVILEGE_TITLE, IDS_NO_MULTIPLAYER_PRIVILEGE_JOIN_TEXT, uiIDA,1,ProfileManager.GetPrimaryPad(),NULL,NULL, app.GetStringTable()); } @@ -336,7 +336,7 @@ void CScene_MultiGameInfo::JoinGame(CScene_MultiGameInfo* pClass) } else { - UINT uiIDA[1]; + unsigned int uiIDA[1]; uiIDA[0]=IDS_CONFIRM_OK; StorageManager.RequestMessageBox( IDS_CONNECTION_FAILED, exitReasonStringId, uiIDA,1,ProfileManager.GetPrimaryPad(),NULL,NULL, app.GetStringTable()); exitReasonStringId = -1; @@ -347,7 +347,7 @@ void CScene_MultiGameInfo::JoinGame(CScene_MultiGameInfo* pClass) } } -HRESULT CScene_MultiGameInfo::OnTimer( XUIMessageTimer *pTimer, BOOL& bHandled ) +int CScene_MultiGameInfo::OnTimer( XUIMessageTimer *pTimer, bool& bHandled ) { if ( pTimer->nId == UPDATE_PLAYERS_TIMER_ID) { diff --git a/src/client/Common/XUI/XUI_MultiGameInfo.h b/src/client/Common/XUI/XUI_MultiGameInfo.h index 8ea16cf6..de4a2e0b 100644 --- a/src/client/Common/XUI/XUI_MultiGameInfo.h +++ b/src/client/Common/XUI/XUI_MultiGameInfo.h @@ -56,14 +56,14 @@ protected: END_CONTROL_MAP() - HRESULT OnInit( XUIMessageInit* pInitData, BOOL& bHandled ); - HRESULT OnNotifyPressEx(HXUIOBJ hObjPressed, XUINotifyPress* pNotifyPressData,BOOL& rfHandled); - HRESULT OnKeyDown(XUIMessageInput* pInputData, BOOL& rfHandled); - HRESULT OnNavReturn(HXUIOBJ hObj,BOOL& rfHandled); - HRESULT OnNotifySelChanged(HXUIOBJ hObjSource, XUINotifySelChanged *pNotifySelChangedData, BOOL& bHandled); - HRESULT OnNotifySetFocus(HXUIOBJ hObjSource, XUINotifyFocus *pNotifyFocusData, BOOL& bHandled); - HRESULT OnNotifyKillFocus(HXUIOBJ hObjSource, XUINotifyFocus *pNotifyFocusData, BOOL& bHandled); - HRESULT OnTimer( XUIMessageTimer *pTimer, BOOL& bHandled ); + int OnInit( XUIMessageInit* pInitData, bool& bHandled ); + int OnNotifyPressEx(HXUIOBJ hObjPressed, XUINotifyPress* pNotifyPressData,bool& rfHandled); + int OnKeyDown(XUIMessageInput* pInputData, bool& rfHandled); + int OnNavReturn(HXUIOBJ hObj,bool& rfHandled); + int OnNotifySelChanged(HXUIOBJ hObjSource, XUINotifySelChanged *pNotifySelChangedData, bool& bHandled); + int OnNotifySetFocus(HXUIOBJ hObjSource, XUINotifyFocus *pNotifyFocusData, bool& bHandled); + int OnNotifyKillFocus(HXUIOBJ hObjSource, XUINotifyFocus *pNotifyFocusData, bool& bHandled); + int OnTimer( XUIMessageTimer *pTimer, bool& bHandled ); public: diff --git a/src/client/Common/XUI/XUI_MultiGameJoinLoad.cpp b/src/client/Common/XUI/XUI_MultiGameJoinLoad.cpp index 250bea7d..ca46876c 100644 --- a/src/client/Common/XUI/XUI_MultiGameJoinLoad.cpp +++ b/src/client/Common/XUI/XUI_MultiGameJoinLoad.cpp @@ -33,7 +33,7 @@ //---------------------------------------------------------------------------------- // Performs initialization tasks - retrieves controls. //---------------------------------------------------------------------------------- -HRESULT CScene_MultiGameJoinLoad::OnInit( XUIMessageInit* pInitData, BOOL& bHandled ) +int CScene_MultiGameJoinLoad::OnInit( XUIMessageInit* pInitData, bool& bHandled ) { m_iPad=*(int *)pInitData->pvInitData; @@ -48,14 +48,14 @@ HRESULT CScene_MultiGameJoinLoad::OnInit( XUIMessageInit* pInitData, BOOL& bHand XuiControlSetText(m_SavesList,app.GetString(IDS_START_GAME)); - const DWORD LOCATOR_SIZE = 256; // Use this to allocate space to hold a ResourceLocator string - WCHAR szResourceLocator[ LOCATOR_SIZE ]; + const unsigned long LOCATOR_SIZE = 256; // Use this to allocate space to hold a ResourceLocator string + wchar_t szResourceLocator[ LOCATOR_SIZE ]; - const ULONG_PTR c_ModuleHandle = (ULONG_PTR)GetModuleHandle(NULL); + const uintptr_t c_ModuleHandle = (uintptr_t)GetModuleHandle(NULL); swprintf(szResourceLocator, LOCATOR_SIZE ,L"section://%X,%ls#%ls",c_ModuleHandle,L"media", L"media/Graphics/TexturePackIcon.png"); m_DefaultMinecraftIconSize = 0; - HRESULT hr = XuiResourceLoadAllNoLoc(szResourceLocator, &m_DefaultMinecraftIconData, &m_DefaultMinecraftIconSize); + int hr = XuiResourceLoadAllNoLoc(szResourceLocator, &m_DefaultMinecraftIconData, &m_DefaultMinecraftIconSize); m_localPlayers = 1; m_bKillSaveInfoEnumerate=false; @@ -93,7 +93,7 @@ HRESULT CScene_MultiGameJoinLoad::OnInit( XUIMessageInit* pInitData, BOOL& bHand m_iSaveInfoC=0; - VOID *pObj; + void *pObj; XuiObjectFromHandle( m_SavesList, &pObj ); m_pSavesList = (CXuiCtrl4JList *)pObj; @@ -193,13 +193,13 @@ HRESULT CScene_MultiGameJoinLoad::OnInit( XUIMessageInit* pInitData, BOOL& bHand Minecraft *pMinecraft = Minecraft::GetInstance(); int texturePacksCount = pMinecraft->skins->getTexturePackCount(); //CXuiCtrl4JList::LIST_ITEM_INFO ListInfo; - //HRESULT hr; + //int hr; for(unsigned int i = 0; i < app.GetDLCInfoTexturesOffersCount(); ++i) { bTexturePackAlreadyListed=false; - ULONGLONG ull=app.GetDLCInfoTexturesFullOffer(i); + uint64_t ull=app.GetDLCInfoTexturesFullOffer(i); pDLCInfo=app.GetDLCInfoForFullOfferID(ull); for(unsigned int i = 0; i < texturePacksCount; ++i) { @@ -229,7 +229,7 @@ HRESULT CScene_MultiGameJoinLoad::OnInit( XUIMessageInit* pInitData, BOOL& bHand for(unsigned int i = 0; i < app.GetDLCInfoTexturesOffersCount(); ++i) { bTexturePackAlreadyListed=false; - ULONGLONG ull=app.GetDLCInfoTexturesFullOffer(i); + uint64_t ull=app.GetDLCInfoTexturesFullOffer(i); pDLCInfo=app.GetDLCInfoForFullOfferID(ull); for(unsigned int i = 0; i < texturePacksCount; ++i) { @@ -295,8 +295,8 @@ void CScene_MultiGameJoinLoad::AddDefaultButtons() // increment the count of the mash-up pack worlds in the save list m_iMashUpButtonsC++; TexturePack *tp = Minecraft::GetInstance()->skins->getTexturePackById(levelGen->getRequiredTexturePackId()); - DWORD dwImageBytes; - PBYTE pbImageData = tp->getPackIcon(dwImageBytes); + unsigned long dwImageBytes; + uint8_t* pbImageData = tp->getPackIcon(dwImageBytes); HXUIBRUSH hXuiBrush; if(dwImageBytes > 0 && pbImageData) @@ -314,7 +314,7 @@ void CScene_MultiGameJoinLoad::AddDefaultButtons() } -HRESULT CScene_MultiGameJoinLoad::GetSaveInfo( ) +int CScene_MultiGameJoinLoad::GetSaveInfo( ) { unsigned int uiSaveC=0; @@ -383,7 +383,7 @@ HRESULT CScene_MultiGameJoinLoad::GetSaveInfo( ) return S_OK; } -HRESULT CScene_MultiGameJoinLoad::OnDestroy() +int CScene_MultiGameJoinLoad::OnDestroy() { g_NetworkManager.SetSessionsUpdatedCallback( NULL, NULL ); @@ -438,7 +438,7 @@ int CScene_MultiGameJoinLoad::DeviceRemovedDialogReturned(void *pParam,int iPad, //---------------------------------------------------------------------------------- // Handler for the button press message. //---------------------------------------------------------------------------------- -HRESULT CScene_MultiGameJoinLoad::OnNotifyPressEx(HXUIOBJ hObjPressed, XUINotifyPress* pNotifyPressData, BOOL& rfHandled) +int CScene_MultiGameJoinLoad::OnNotifyPressEx(HXUIOBJ hObjPressed, XUINotifyPress* pNotifyPressData, bool& rfHandled) { if(m_bIgnoreInput) return S_OK; @@ -455,7 +455,7 @@ HRESULT CScene_MultiGameJoinLoad::OnNotifyPressEx(HXUIOBJ hObjPressed, XUINotify { m_bIgnoreInput=true; - DWORD nIndex = m_pGamesList->GetCurSel(); + unsigned long nIndex = m_pGamesList->GetCurSel(); if( m_pGamesList->GetItemCount() > 0 && nIndex < currentSessions.size() ) { @@ -484,12 +484,12 @@ HRESULT CScene_MultiGameJoinLoad::OnNotifyPressEx(HXUIOBJ hObjPressed, XUINotify { // upsell the texture pack // tell sentient about the upsell of the full version of the skin pack - ULONGLONG ullOfferID_Full; + uint64_t ullOfferID_Full; app.GetDLCFullOfferIDForPackID(m_initData->selectedSession->data.texturePackParentId,&ullOfferID_Full); TelemetryManager->RecordUpsellPresented(pNotifyPressData->UserIndex, eSet_UpsellID_Texture_DLC, ullOfferID_Full & 0xFFFFFFFF); - UINT uiIDA[3]; + unsigned int uiIDA[3]; // Need to check if the texture pack has both Full and Trial versions - we may do some as free ones, so only Full DLC_INFO *pDLCInfo=app.GetDLCInfoForFullOfferID(ullOfferID_Full); @@ -576,7 +576,7 @@ HRESULT CScene_MultiGameJoinLoad::OnNotifyPressEx(HXUIOBJ hObjPressed, XUINotify if(m_pSavesList->GetData(iIndex).bIsDamaged) { // give the option to delete the save - UINT uiIDA[2]; + unsigned int uiIDA[2]; uiIDA[0]=IDS_CONFIRM_CANCEL; uiIDA[1]=IDS_CONFIRM_OK; StorageManager.RequestMessageBox(IDS_CORRUPT_OR_DAMAGED_SAVE_TITLE, IDS_CORRUPT_OR_DAMAGED_SAVE_TEXT, uiIDA, 2, pNotifyPressData->UserIndex,&CScene_MultiGameJoinLoad::DeleteSaveDialogReturned,this, app.GetStringTable()); @@ -609,7 +609,7 @@ HRESULT CScene_MultiGameJoinLoad::OnNotifyPressEx(HXUIOBJ hObjPressed, XUINotify return S_OK; } -HRESULT CScene_MultiGameJoinLoad::OnKeyDown(XUIMessageInput* pInputData, BOOL& rfHandled) +int CScene_MultiGameJoinLoad::OnKeyDown(XUIMessageInput* pInputData, bool& rfHandled) { if(m_bIgnoreInput) return S_OK; @@ -621,7 +621,7 @@ HRESULT CScene_MultiGameJoinLoad::OnKeyDown(XUIMessageInput* pInputData, BOOL& r ui.AnimateKeyPress(pInputData->UserIndex, pInputData->dwKeyCode); - HRESULT hr = S_OK; + int hr = S_OK; // Explicitly handle B button presses switch(pInputData->dwKeyCode) @@ -645,7 +645,7 @@ HRESULT CScene_MultiGameJoinLoad::OnKeyDown(XUIMessageInput* pInputData, BOOL& r case VK_PAD_Y: if(m_pGamesList->TreeHasFocus() && m_pGamesList->GetItemCount() > 0) { - DWORD nIndex = m_pGamesList->GetCurSel(); + unsigned long nIndex = m_pGamesList->GetCurSel(); FriendSessionInfo *pSelectedSession = currentSessions.at( nIndex ); PlayerUID xuid = pSelectedSession->data.hostPlayerUID; @@ -659,10 +659,10 @@ HRESULT CScene_MultiGameJoinLoad::OnKeyDown(XUIMessageInput* pInputData, BOOL& r if(ProfileManager.IsSignedInLive( m_iPad )) { // 4J-PB - required for a delete of the save if it's found to be a corrupted save - DWORD nIndex = m_pSavesList->GetCurSel(); + unsigned long nIndex = m_pSavesList->GetCurSel(); m_iChangingSaveGameInfoIndex=m_pSavesList->GetData(nIndex).iIndex; - UINT uiIDA[2]; + unsigned int uiIDA[2]; uiIDA[0]=IDS_UPLOAD_SAVE; uiIDA[1]=IDS_CONFIRM_CANCEL; @@ -683,7 +683,7 @@ HRESULT CScene_MultiGameJoinLoad::OnKeyDown(XUIMessageInput* pInputData, BOOL& r { // delete the save game // Have to ask the player if they are sure they want to delete this game - UINT uiIDA[2]; + unsigned int uiIDA[2]; uiIDA[0]=IDS_CONFIRM_CANCEL; uiIDA[1]=IDS_CONFIRM_OK; StorageManager.RequestMessageBox(IDS_TOOLTIPS_DELETESAVE, IDS_TEXT_DELETE_SAVE, uiIDA, 2, pInputData->UserIndex,&CScene_MultiGameJoinLoad::DeleteSaveDialogReturned,this, app.GetStringTable()); @@ -692,7 +692,7 @@ HRESULT CScene_MultiGameJoinLoad::OnKeyDown(XUIMessageInput* pInputData, BOOL& r { if(StorageManager.EnoughSpaceForAMinSaveGame()) { - UINT uiIDA[3]; + unsigned int uiIDA[3]; uiIDA[0]=IDS_CONFIRM_CANCEL; uiIDA[1]=IDS_TITLE_RENAMESAVE; uiIDA[2]=IDS_TOOLTIPS_DELETESAVE; @@ -702,7 +702,7 @@ HRESULT CScene_MultiGameJoinLoad::OnKeyDown(XUIMessageInput* pInputData, BOOL& r { // delete the save game // Have to ask the player if they are sure they want to delete this game - UINT uiIDA[2]; + unsigned int uiIDA[2]; uiIDA[0]=IDS_CONFIRM_CANCEL; uiIDA[1]=IDS_CONFIRM_OK; StorageManager.RequestMessageBox(IDS_TOOLTIPS_DELETESAVE, IDS_TEXT_DELETE_SAVE, uiIDA, 2, pInputData->UserIndex,&CScene_MultiGameJoinLoad::DeleteSaveDialogReturned,this, app.GetStringTable()); @@ -759,7 +759,7 @@ HRESULT CScene_MultiGameJoinLoad::OnKeyDown(XUIMessageInput* pInputData, BOOL& r return hr; } -HRESULT CScene_MultiGameJoinLoad::OnNavReturn(HXUIOBJ hSceneFrom,BOOL& rfHandled) +int CScene_MultiGameJoinLoad::OnNavReturn(HXUIOBJ hSceneFrom,bool& rfHandled) { CXuiSceneBase::ShowLogo( DEFAULT_XUI_MENU_USER, true ); @@ -868,7 +868,7 @@ HRESULT CScene_MultiGameJoinLoad::OnNavReturn(HXUIOBJ hSceneFrom,BOOL& rfHandled return S_OK; } -HRESULT CScene_MultiGameJoinLoad::OnNotifySelChanged(HXUIOBJ hObjSource, XUINotifySelChanged *pNotifySelChangedData, BOOL& bHandled) +int CScene_MultiGameJoinLoad::OnNotifySelChanged(HXUIOBJ hObjSource, XUINotifySelChanged *pNotifySelChangedData, bool& bHandled) { if(m_bReady) @@ -880,7 +880,7 @@ HRESULT CScene_MultiGameJoinLoad::OnNotifySelChanged(HXUIOBJ hObjSource, XUINoti } -HRESULT CScene_MultiGameJoinLoad::OnTransitionStart( XUIMessageTransition *pTransition, BOOL& bHandled ) +int CScene_MultiGameJoinLoad::OnTransitionStart( XUIMessageTransition *pTransition, bool& bHandled ) { //if(pTransition->dwTransAction==XUI_TRANSITION_ACTION_DESTROY ) return S_OK; @@ -920,7 +920,7 @@ HRESULT CScene_MultiGameJoinLoad::OnTransitionStart( XUIMessageTransition *pTran return S_OK; } -HRESULT CScene_MultiGameJoinLoad::OnFontRendererChange() +int CScene_MultiGameJoinLoad::OnFontRendererChange() { // update the tooltips // if the saves list has focus, then we should show the Delete Save tooltip @@ -981,7 +981,7 @@ HRESULT CScene_MultiGameJoinLoad::OnFontRendererChange() return S_OK; } -HRESULT CScene_MultiGameJoinLoad::OnNotifySetFocus(HXUIOBJ hObjSource, XUINotifyFocus *pNotifyFocusData, BOOL& bHandled) +int CScene_MultiGameJoinLoad::OnNotifySetFocus(HXUIOBJ hObjSource, XUINotifyFocus *pNotifyFocusData, bool& bHandled) { // update the tooltips // if the saves list has focus, then we should show the Delete Save tooltip @@ -1042,7 +1042,7 @@ HRESULT CScene_MultiGameJoinLoad::OnNotifySetFocus(HXUIOBJ hObjSource, XUINotify return S_OK; } -HRESULT CScene_MultiGameJoinLoad::OnNotifyKillFocus(HXUIOBJ hObjSource, XUINotifyFocus *pNotifyFocusData, BOOL& bHandled) +int CScene_MultiGameJoinLoad::OnNotifyKillFocus(HXUIOBJ hObjSource, XUINotifyFocus *pNotifyFocusData, bool& bHandled) { return S_OK; } @@ -1110,7 +1110,7 @@ bool CScene_MultiGameJoinLoad::DoesGamesListHaveFocus() return false; } -void CScene_MultiGameJoinLoad::UpdateGamesListCallback(LPVOID lpParam) +void CScene_MultiGameJoinLoad::UpdateGamesListCallback(void* lpParam) { if(lpParam != NULL) { @@ -1133,7 +1133,7 @@ void CScene_MultiGameJoinLoad::UpdateGamesList() return; } - DWORD nIndex = -1; + unsigned long nIndex = -1; FriendSessionInfo *pSelectedSession = NULL; if(m_pGamesList->TreeHasFocus() && m_pGamesList->GetItemCount() > 0) { @@ -1216,7 +1216,7 @@ void CScene_MultiGameJoinLoad::UpdateGamesList() unsigned int xuiListSize = m_pGamesList->GetItemCount(); unsigned int filteredListSize = (unsigned int)currentSessions.size(); - BOOL gamesListHasFocus = m_pGamesList->TreeHasFocus(); + bool gamesListHasFocus = m_pGamesList->TreeHasFocus(); if(filteredListSize > 0) { @@ -1268,15 +1268,15 @@ void CScene_MultiGameJoinLoad::UpdateGamesList() // Do we have the texture pack Minecraft *pMinecraft = Minecraft::GetInstance(); TexturePack *tp = pMinecraft->skins->getTexturePackById(sessionInfo->data.texturePackParentId); - HRESULT hr; + int hr; - DWORD dwImageBytes=0; - PBYTE pbImageData=NULL; + unsigned long dwImageBytes=0; + uint8_t* pbImageData=NULL; if(tp==NULL) { - DWORD dwBytes=0; - PBYTE pbData=NULL; + unsigned long dwBytes=0; + uint8_t* pbData=NULL; app.GetTPD(sessionInfo->data.texturePackParentId,&pbData,&dwBytes); // is it in the tpd data ? @@ -1315,7 +1315,7 @@ void CScene_MultiGameJoinLoad::UpdateGamesList() } } -void CScene_MultiGameJoinLoad::UpdateGamesList(DWORD dwNumResults, IQNetGameSearch *pGameSearch) +void CScene_MultiGameJoinLoad::UpdateGamesList(unsigned long dwNumResults, IQNetGameSearch *pGameSearch) { // We don't use the QNet callback, but could resurrect this if we ever do normal matchmaking, but updated to work as the function above #if 0 @@ -1379,7 +1379,7 @@ void CScene_MultiGameJoinLoad::UpdateGamesList(DWORD dwNumResults, IQNetGameSear //XuiElementSetDisableFocusRecursion( m_GamesList.m_hObj, false); // Loop through all the results. - for( DWORD dwResult = 0; dwResult < pGameSearch->GetNumResults(); dwResult++ ) + for( unsigned long dwResult = 0; dwResult < pGameSearch->GetNumResults(); dwResult++ ) { pSearchResult = pGameSearch->GetSearchResultAtIndex( dwResult ); @@ -1485,7 +1485,7 @@ void CScene_MultiGameJoinLoad::UpdateGamesList(DWORD dwNumResults, IQNetGameSear HXUIOBJ hObj=NULL; HXUIOBJ hTextPres=NULL; - HRESULT hr=XuiControlGetVisual(item,&hObj); + int hr=XuiControlGetVisual(item,&hObj); hr=XuiElementGetChildById(hObj,L"text_Label",&hTextPres); unsigned char displayLabelViewableStartIndex = 0; @@ -1515,7 +1515,7 @@ void CScene_MultiGameJoinLoad::UpdateGamesList(DWORD dwNumResults, IQNetGameSear #endif }*/ -void CScene_MultiGameJoinLoad::SearchForGameCallback(void *param, DWORD dwNumResults, IQNetGameSearch *pGameSearch) +void CScene_MultiGameJoinLoad::SearchForGameCallback(void *param, unsigned long dwNumResults, IQNetGameSearch *pGameSearch) { #if 0 HXUIOBJ hObj = (HXUIOBJ)param; @@ -1531,7 +1531,7 @@ void CScene_MultiGameJoinLoad::SearchForGameCallback(void *param, DWORD dwNumRes int CScene_MultiGameJoinLoad::DeviceSelectReturned(void *pParam,bool bContinue) { CScene_MultiGameJoinLoad* pClass = (CScene_MultiGameJoinLoad*)pParam; - //HRESULT hr; + //int hr; if(bContinue==true) { @@ -1578,7 +1578,7 @@ int CScene_MultiGameJoinLoad::DeviceSelectReturned(void *pParam,bool bContinue) else iLB = IDS_TOOLTIPS_PARTY_GAMES; } - //BOOL bOnlineGame=pClass->m_CheckboxOnline.IsChecked(); + //bool bOnlineGame=pClass->m_CheckboxOnline.IsChecked(); // refresh the saves list (if there is a device selected) @@ -1621,7 +1621,7 @@ int CScene_MultiGameJoinLoad::DeviceSelectReturned(void *pParam,bool bContinue) return 0; } -HRESULT CScene_MultiGameJoinLoad::OnTimer( XUIMessageTimer *pTimer, BOOL& bHandled ) +int CScene_MultiGameJoinLoad::OnTimer( XUIMessageTimer *pTimer, bool& bHandled ) { // 4J-PB - TODO - Don't think we can do this - if a 2nd player signs in here with an offline profile, the signed in LIVE player gets re-logged in, and bMultiplayerAllowed is false briefly switch(pTimer->nId) @@ -1742,8 +1742,8 @@ HRESULT CScene_MultiGameJoinLoad::OnTimer( XUIMessageTimer *pTimer, BOOL& bHandl { if(m_iConfigA[i]!=-1) { - DWORD dwBytes=0; - PBYTE pbData=NULL; + unsigned long dwBytes=0; + uint8_t* pbData=NULL; //app.DebugPrintf("Retrieving iConfig %d from TPD\n",m_iConfigA[i]); app.GetTPD(m_iConfigA[i],&pbData,&dwBytes); @@ -1788,7 +1788,7 @@ int CScene_MultiGameJoinLoad::LoadSaveDataReturned(void *pParam,bool bContinue) bool isClientSide = ProfileManager.IsSignedInLive(ProfileManager.GetPrimaryPad()); // 4J Stu - If we only have one controller connected, then don't show the sign-in UI again - DWORD connectedControllers = 0; + unsigned long connectedControllers = 0; for(unsigned int i = 0; i < XUSER_MAX_COUNT; ++i) { if( InputManager.IsPadConnected(i) || ProfileManager.IsSignedIn(i) ) ++connectedControllers; @@ -1796,7 +1796,7 @@ int CScene_MultiGameJoinLoad::LoadSaveDataReturned(void *pParam,bool bContinue) if(!isClientSide || connectedControllers == 1 || !RenderManager.IsHiDef()) { - DWORD dwLocalUsersMask = CGameNetworkManager::GetLocalPlayerMask(ProfileManager.GetPrimaryPad()); + unsigned long dwLocalUsersMask = CGameNetworkManager::GetLocalPlayerMask(ProfileManager.GetPrimaryPad()); // No guest problems so we don't need to force a sign-in of players here StartGameFromSave(pClass, dwLocalUsersMask); @@ -1823,7 +1823,7 @@ int CScene_MultiGameJoinLoad::StartGame_SignInReturned(void *pParam,bool bContin // It's possible that the player has not signed in - they can back out if(ProfileManager.IsSignedIn(iPad)) { - DWORD dwLocalUsersMask = 0; + unsigned long dwLocalUsersMask = 0; for(unsigned int index = 0; index < XUSER_MAX_COUNT; ++index) { @@ -1843,7 +1843,7 @@ int CScene_MultiGameJoinLoad::StartGame_SignInReturned(void *pParam,bool bContin } // 4J Stu - Shared functionality that is the same whether we needed a quadrant sign-in or not -void CScene_MultiGameJoinLoad::StartGameFromSave(CScene_MultiGameJoinLoad* pClass, DWORD dwLocalUsersMask) +void CScene_MultiGameJoinLoad::StartGameFromSave(CScene_MultiGameJoinLoad* pClass, unsigned long dwLocalUsersMask) { /*bool isClientSide = ProfileManager.IsSignedInLive(ProfileManager.GetPrimaryPad()) && pClass->m_CheckboxOnline.IsChecked() == true; //bool isPrivate = pClass->m_CheckboxPrivate.IsChecked() == true; @@ -1926,7 +1926,7 @@ void CScene_MultiGameJoinLoad::LoadLevelGen(LevelGenerationOptions *levelGen) LoadingInputParams *loadingParams = new LoadingInputParams(); loadingParams->func = &CGameNetworkManager::RunNetworkGameThreadProc; - loadingParams->lpParam = (LPVOID)param; + loadingParams->lpParam = (void*)param; UIFullscreenProgressCompletionData *completionData = new UIFullscreenProgressCompletionData(); completionData->bShowBackground=true; @@ -1947,7 +1947,7 @@ void CScene_MultiGameJoinLoad::LoadSaveFromDisk(File *saveFile) // Make our next save default to the name of the level StorageManager.SetSaveTitle(saveFile->getName().c_str()); - __int64 fileSize = saveFile->length(); + int64_t fileSize = saveFile->length(); FileInputStream fis(*saveFile); byteArray ba(fileSize); fis.read(ba); @@ -1976,7 +1976,7 @@ void CScene_MultiGameJoinLoad::LoadSaveFromDisk(File *saveFile) LoadingInputParams *loadingParams = new LoadingInputParams(); loadingParams->func = &CGameNetworkManager::RunNetworkGameThreadProc; - loadingParams->lpParam = (LPVOID)param; + loadingParams->lpParam = (void*)param; UIFullscreenProgressCompletionData *completionData = new UIFullscreenProgressCompletionData(); completionData->bShowBackground=true; @@ -2039,7 +2039,7 @@ int CScene_MultiGameJoinLoad::SaveTransferDialogReturned(void *pParam,int iPad,C return 0; } -int CScene_MultiGameJoinLoad::UploadSaveForXboxOneThreadProc( LPVOID lpParameter ) +int CScene_MultiGameJoinLoad::UploadSaveForXboxOneThreadProc( void* lpParameter ) { CScene_MultiGameJoinLoad* pClass = (CScene_MultiGameJoinLoad *) lpParameter; Minecraft *pMinecraft = Minecraft::GetInstance(); @@ -2055,7 +2055,7 @@ int CScene_MultiGameJoinLoad::UploadSaveForXboxOneThreadProc( LPVOID lpParameter { unsigned int uiSaveBytes; uiSaveBytes=StorageManager.GetSaveSize(); - pClass->m_pbSaveTransferData=new BYTE [uiSaveBytes]; + pClass->m_pbSaveTransferData=new uint8_t [uiSaveBytes]; StorageManager.GetSaveData(pClass->m_pbSaveTransferData,&uiSaveBytes); @@ -2076,7 +2076,7 @@ int CScene_MultiGameJoinLoad::UploadSaveForXboxOneThreadProc( LPVOID lpParameter ByteArrayOutputStream baos; DataOutputStream dos(&baos); - LPCWSTR title = StorageManager.GetSaveTitle(); + const wchar_t* title = StorageManager.GetSaveTitle(); dos.writeUTF(title); char szUniqueMapName[14]; @@ -2085,8 +2085,8 @@ int CScene_MultiGameJoinLoad::UploadSaveForXboxOneThreadProc( LPVOID lpParameter { // set the save icon - PBYTE pbImageData=NULL; - DWORD dwImageBytes=0; + uint8_t* pbImageData=NULL; + unsigned long dwImageBytes=0; XCONTENT_DATA XContentData; int iIndex=pClass->m_pSavesList->GetData(pClass->m_pSavesList->GetCurSel()).iIndex-pClass->m_iDefaultButtonsC; StorageManager.GetSaveCacheFileInfo(iIndex,XContentData); @@ -2096,10 +2096,10 @@ int CScene_MultiGameJoinLoad::UploadSaveForXboxOneThreadProc( LPVOID lpParameter // Don't delete the image data after creating the xuibrush, since we'll use it in the rename of the save if(pbImageData==NULL) { - DWORD dwResult=XContentGetThumbnail(ProfileManager.GetPrimaryPad(),&XContentData,NULL,&dwImageBytes,NULL); + unsigned long dwResult=XContentGetThumbnail(ProfileManager.GetPrimaryPad(),&XContentData,NULL,&dwImageBytes,NULL); if(dwResult==ERROR_SUCCESS) { - pClass->m_pbSaveTransferData = new BYTE[dwImageBytes]; + pClass->m_pbSaveTransferData = new uint8_t[dwImageBytes]; pbImageData = pClass->m_pbSaveTransferData; // Copy pointer so that we can use the same name as the library owned one, but m_pbSaveTransferData will get deleted when done XContentGetThumbnail(ProfileManager.GetPrimaryPad(),&XContentData,pbImageData,&dwImageBytes,NULL); } @@ -2111,7 +2111,7 @@ int CScene_MultiGameJoinLoad::UploadSaveForXboxOneThreadProc( LPVOID lpParameter dos.write(ba); } - pClass->m_pbSaveTransferData=new BYTE [baos.size()]; + pClass->m_pbSaveTransferData=new uint8_t [baos.size()]; memcpy(pClass->m_pbSaveTransferData,baos.buf.data,baos.size()); app.DebugPrintf("Uploading meta data (%d bytes)\n", baos.size()); @@ -2169,7 +2169,7 @@ void CScene_MultiGameJoinLoad::DeleteFile(CScene_MultiGameJoinLoad *pClass, char } } -void CScene_MultiGameJoinLoad::UploadFile(CScene_MultiGameJoinLoad *pClass, char *filename, LPVOID data, DWORD size) +void CScene_MultiGameJoinLoad::UploadFile(CScene_MultiGameJoinLoad *pClass, char *filename, void* data, unsigned long size) { pClass->m_fProgress=0.0f; pClass->m_bTransferComplete=false; @@ -2180,7 +2180,7 @@ void CScene_MultiGameJoinLoad::UploadFile(CScene_MultiGameJoinLoad *pClass, char C4JStorage::TMS_FILETYPE_BINARY, C4JStorage::TMS_UGCTYPE_NONE, filename, - (CHAR *)data, + (char *)data, size, &CScene_MultiGameJoinLoad::TransferComplete,pClass, 0, &CScene_MultiGameJoinLoad::Progress,pClass); @@ -2191,9 +2191,9 @@ void CScene_MultiGameJoinLoad::UploadFile(CScene_MultiGameJoinLoad *pClass, char File targetFileDir(L"GAME:\\FakeTMSPP"); if(!targetFileDir.exists()) targetFileDir.mkdir(); string path = string( wstringtofilename( targetFileDir.getPath() ) ).append("\\").append(filename); - HANDLE hSaveFile = CreateFile( path.c_str(), GENERIC_WRITE, 0, NULL, OPEN_ALWAYS, FILE_FLAG_RANDOM_ACCESS, NULL); + void* hSaveFile = CreateFile( path.c_str(), GENERIC_WRITE, 0, NULL, OPEN_ALWAYS, FILE_FLAG_RANDOM_ACCESS, NULL); - DWORD numberOfBytesWritten = 0; + unsigned long numberOfBytesWritten = 0; WriteFile( hSaveFile,data,size,&numberOfBytesWritten,NULL); assert(numberOfBytesWritten == size); @@ -2239,7 +2239,7 @@ int CScene_MultiGameJoinLoad::SaveOptionsDialogReturned(void *pParam,int iPad,C4 { if(result==C4JStorage::EMessage_ResultDecline) // rename { - ZeroMemory(pClass->m_wchNewName,sizeof(WCHAR)*XCONTENT_MAX_DISPLAYNAME_LENGTH); + ZeroMemory(pClass->m_wchNewName,sizeof(wchar_t)*XCONTENT_MAX_DISPLAYNAME_LENGTH); // bring up a keyboard InputManager.RequestKeyboard(IDS_RENAME_WORLD_TITLE,L"",IDS_RENAME_WORLD_TEXT,iPad,pClass->m_wchNewName,XCONTENT_MAX_DISPLAYNAME_LENGTH,&CScene_MultiGameJoinLoad::KeyboardReturned,pClass,C_4JInput::EKeyboardMode_Default,app.GetStringTable()); } @@ -2247,7 +2247,7 @@ int CScene_MultiGameJoinLoad::SaveOptionsDialogReturned(void *pParam,int iPad,C4 { // delete the save game // Have to ask the player if they are sure they want to delete this game - UINT uiIDA[2]; + unsigned int uiIDA[2]; uiIDA[0]=IDS_CONFIRM_CANCEL; uiIDA[1]=IDS_CONFIRM_OK; StorageManager.RequestMessageBox(IDS_TOOLTIPS_DELETESAVE, IDS_TEXT_DELETE_SAVE, uiIDA, 2, iPad,&CScene_MultiGameJoinLoad::DeleteSaveDialogReturned,pClass, app.GetStringTable()); @@ -2270,7 +2270,7 @@ int CScene_MultiGameJoinLoad::LoadSaveDataReturned(void *pParam,bool bContinue) pClass->m_bSaveTransferInProgress=true; LoadingInputParams *loadingParams = new LoadingInputParams(); loadingParams->func = &CScene_MultiGameJoinLoad::UploadSaveForXboxOneThreadProc; - loadingParams->lpParam = (LPVOID)pParam; + loadingParams->lpParam = (void*)pParam; UIFullscreenProgressCompletionData *completionData = new UIFullscreenProgressCompletionData(); completionData->bShowBackground=true; @@ -2299,7 +2299,7 @@ int CScene_MultiGameJoinLoad::LoadSaveDataReturned(void *pParam,bool bContinue) pClass->m_bIgnoreInput=false; // give the option to delete the save - UINT uiIDA[2]; + unsigned int uiIDA[2]; uiIDA[0]=IDS_CONFIRM_CANCEL; uiIDA[1]=IDS_CONFIRM_OK; StorageManager.RequestMessageBox(IDS_CORRUPT_OR_DAMAGED_SAVE_TITLE, IDS_CORRUPT_OR_DAMAGED_SAVE_TEXT, uiIDA, 2, @@ -2329,7 +2329,7 @@ int CScene_MultiGameJoinLoad::TransferComplete(void *pParam,int iPad, int iResul { // There was a transfer fail // Display a dialog - UINT uiIDA[1]; + unsigned int uiIDA[1]; uiIDA[0]=IDS_CONFIRM_OK; StorageManager.RequestMessageBox(IDS_SAVE_TRANSFER_TITLE, IDS_SAVE_TRANSFER_UPLOADFAILED, uiIDA, 1, ProfileManager.GetPrimaryPad(),NULL,NULL,app.GetStringTable()); pClass->m_bTransferFail=true; @@ -2353,7 +2353,7 @@ int CScene_MultiGameJoinLoad::DeleteComplete(void *pParam,int iPad, int iResult) int CScene_MultiGameJoinLoad::KeyboardReturned(void *pParam,bool bSet) { CScene_MultiGameJoinLoad* pClass = (CScene_MultiGameJoinLoad*)pParam; - HRESULT hr = S_OK; + int hr = S_OK; // if the user has left the name empty, treat this as backing out if((pClass->m_wchNewName[0]!=0) && bSet) @@ -2369,7 +2369,7 @@ int CScene_MultiGameJoinLoad::KeyboardReturned(void *pParam,bool bSet) // disable saving StorageManager.SetSaveDisabled(true); StorageManager.SetSaveDeviceSelected(ProfileManager.GetPrimaryPad(),false); - UINT uiIDA[1]; + unsigned int uiIDA[1]; uiIDA[0]=IDS_OK; StorageManager.RequestMessageBox(IDS_STORAGEDEVICEPROBLEM_TITLE, IDS_FAILED_TO_LOADSAVE_TEXT, uiIDA, 1, ProfileManager.GetPrimaryPad(),&CScene_MultiGameJoinLoad::DeviceRemovedDialogReturned,pClass); } @@ -2393,8 +2393,8 @@ int CScene_MultiGameJoinLoad::LoadSaveDataForRenameReturned(void *pParam,bool bC if(bContinue==true) { // set the save icon - PBYTE pbImageData=NULL; - DWORD dwImageBytes=0; + uint8_t* pbImageData=NULL; + unsigned long dwImageBytes=0; HXUIBRUSH hXuiBrush; XCONTENT_DATA XContentData; StorageManager.GetSaveCacheFileInfo(pClass->m_iChangingSaveGameInfoIndex-pClass->m_iDefaultButtonsC,XContentData); @@ -2404,10 +2404,10 @@ int CScene_MultiGameJoinLoad::LoadSaveDataForRenameReturned(void *pParam,bool bC // Don't delete the image data after creating the xuibrush, since we'll use it in the rename of the save if(pbImageData==NULL) { - DWORD dwResult=XContentGetThumbnail(ProfileManager.GetPrimaryPad(),&XContentData,NULL,&dwImageBytes,NULL); + unsigned long dwResult=XContentGetThumbnail(ProfileManager.GetPrimaryPad(),&XContentData,NULL,&dwImageBytes,NULL); if(dwResult==ERROR_SUCCESS) { - pbImageData = new BYTE[dwImageBytes]; + pbImageData = new uint8_t[dwImageBytes]; XContentGetThumbnail(ProfileManager.GetPrimaryPad(),&XContentData,pbImageData,&dwImageBytes,NULL); XuiCreateTextureBrushFromMemory(pbImageData,dwImageBytes,&hXuiBrush); } @@ -2461,8 +2461,8 @@ int CScene_MultiGameJoinLoad::TexturePackDialogReturned(void *pParam,int iPad,C4 // we need to enable background downloading for the DLC XBackgroundDownloadSetMode(XBACKGROUND_DOWNLOAD_MODE_ALWAYS_ALLOW); - ULONGLONG ullOfferID_Full; - ULONGLONG ullIndexA[1]; + uint64_t ullOfferID_Full; + uint64_t ullIndexA[1]; app.GetDLCFullOfferIDForPackID(pClass->m_initData->selectedSession->data.texturePackParentId,&ullOfferID_Full); if( result==C4JStorage::EMessage_ResultAccept ) // Full version @@ -2486,7 +2486,7 @@ int CScene_MultiGameJoinLoad::TexturePackDialogReturned(void *pParam,int iPad,C4 return 0; } -HRESULT CScene_MultiGameJoinLoad::OnCustomMessage_DLCInstalled() +int CScene_MultiGameJoinLoad::OnCustomMessage_DLCInstalled() { // mounted DLC may have changed @@ -2507,10 +2507,10 @@ HRESULT CScene_MultiGameJoinLoad::OnCustomMessage_DLCInstalled() return S_OK; } -HRESULT CScene_MultiGameJoinLoad::OnCustomMessage_DLCMountingComplete() +int CScene_MultiGameJoinLoad::OnCustomMessage_DLCMountingComplete() { - VOID *pObj; + void *pObj; XuiObjectFromHandle( m_SavesList, &pObj ); m_pSavesList = (CXuiCtrl4JList *)pObj; @@ -2644,14 +2644,14 @@ void CScene_MultiGameJoinLoad::UpdateTooltips() #ifdef _XBOX -bool CScene_MultiGameJoinLoad::GetSavesInfoCallback(LPVOID pParam,int iTotalSaveInfoC, C4JStorage::CACHEINFOSTRUCT *InfoA, int iPad, HRESULT hResult) +bool CScene_MultiGameJoinLoad::GetSavesInfoCallback(void* pParam,int iTotalSaveInfoC, C4JStorage::CACHEINFOSTRUCT *InfoA, int iPad, int hResult) { CScene_MultiGameJoinLoad *pClass=(CScene_MultiGameJoinLoad *)pParam; CXuiCtrl4JList::LIST_ITEM_INFO ListInfo; - PBYTE pbImageData=(PBYTE)InfoA; - PBYTE pbCurrentImagePtr; + uint8_t* pbImageData=(uint8_t*)InfoA; + uint8_t* pbCurrentImagePtr; HXUIBRUSH hXuiBrush; - HRESULT hr; + int hr; // move the image data pointer to the right place if(iTotalSaveInfoC!=0) @@ -2698,9 +2698,9 @@ bool CScene_MultiGameJoinLoad::GetSavesInfoCallback(LPVOID pParam,int iTotalSave else { // we could put in a damaged save icon here - const DWORD LOCATOR_SIZE = 256; // Use this to allocate space to hold a ResourceLocator string - WCHAR szResourceLocator[ LOCATOR_SIZE ]; - const ULONG_PTR c_ModuleHandle = (ULONG_PTR)GetModuleHandle(NULL); + const unsigned long LOCATOR_SIZE = 256; // Use this to allocate space to hold a ResourceLocator string + wchar_t szResourceLocator[ LOCATOR_SIZE ]; + const uintptr_t c_ModuleHandle = (uintptr_t)GetModuleHandle(NULL); swprintf(szResourceLocator, LOCATOR_SIZE, L"section://%X,%ls#%ls",c_ModuleHandle,L"media", L"media/Graphics/MinecraftBrokenIcon.png"); @@ -2732,13 +2732,13 @@ bool CScene_MultiGameJoinLoad::GetSavesInfoCallback(LPVOID pParam,int iTotalSave return false; } #else -int CScene_MultiGameJoinLoad::GetSavesInfoCallback(LPVOID lpParam,const bool) +int CScene_MultiGameJoinLoad::GetSavesInfoCallback(void* lpParam,const bool) { return true; } #endif -void CScene_MultiGameJoinLoad::CancelSaveUploadCallback(LPVOID lpParam) +void CScene_MultiGameJoinLoad::CancelSaveUploadCallback(void* lpParam) { CScene_MultiGameJoinLoad* pClass = (CScene_MultiGameJoinLoad *) lpParam; @@ -2751,11 +2751,11 @@ void CScene_MultiGameJoinLoad::CancelSaveUploadCallback(LPVOID lpParam) // app.getRemoteStorage()->abort(); // pClass->m_eSaveUploadState = eSaveUpload_Idle; - UINT uiIDA[1] = { IDS_CONFIRM_OK }; + unsigned int uiIDA[1] = { IDS_CONFIRM_OK }; ui.RequestMessageBox(IDS_XBONE_CANCEL_UPLOAD_TITLE, IDS_XBONE_CANCEL_UPLOAD_TEXT, uiIDA, 1, pClass->m_iPad, NULL, NULL, app.GetStringTable()); } -void CScene_MultiGameJoinLoad::SaveUploadCompleteCallback(LPVOID lpParam) +void CScene_MultiGameJoinLoad::SaveUploadCompleteCallback(void* lpParam) { CScene_MultiGameJoinLoad* pClass = (CScene_MultiGameJoinLoad *) lpParam; diff --git a/src/client/Common/XUI/XUI_MultiGameJoinLoad.h b/src/client/Common/XUI/XUI_MultiGameJoinLoad.h index 074464de..9eb7f69f 100644 --- a/src/client/Common/XUI/XUI_MultiGameJoinLoad.h +++ b/src/client/Common/XUI/XUI_MultiGameJoinLoad.h @@ -59,19 +59,19 @@ protected: END_CONTROL_MAP() - HRESULT OnInit( XUIMessageInit* pInitData, BOOL& bHandled ); - HRESULT OnDestroy(); - HRESULT OnNotifyPressEx(HXUIOBJ hObjPressed, XUINotifyPress* pNotifyPressData,BOOL& rfHandled); - HRESULT OnKeyDown(XUIMessageInput* pInputData, BOOL& rfHandled); - HRESULT OnNavReturn(HXUIOBJ hObj,BOOL& rfHandled); - HRESULT OnNotifySelChanged(HXUIOBJ hObjSource, XUINotifySelChanged *pNotifySelChangedData, BOOL& bHandled); - HRESULT OnNotifySetFocus(HXUIOBJ hObjSource, XUINotifyFocus *pNotifyFocusData, BOOL& bHandled); - HRESULT OnNotifyKillFocus(HXUIOBJ hObjSource, XUINotifyFocus *pNotifyFocusData, BOOL& bHandled); - HRESULT OnTimer( XUIMessageTimer *pTimer, BOOL& bHandled ); - HRESULT OnTransitionStart( XUIMessageTransition *pTransition, BOOL& bHandled ); - HRESULT OnFontRendererChange(); - HRESULT OnCustomMessage_DLCInstalled(); - HRESULT OnCustomMessage_DLCMountingComplete(); + int OnInit( XUIMessageInit* pInitData, bool& bHandled ); + int OnDestroy(); + int OnNotifyPressEx(HXUIOBJ hObjPressed, XUINotifyPress* pNotifyPressData,bool& rfHandled); + int OnKeyDown(XUIMessageInput* pInputData, bool& rfHandled); + int OnNavReturn(HXUIOBJ hObj,bool& rfHandled); + int OnNotifySelChanged(HXUIOBJ hObjSource, XUINotifySelChanged *pNotifySelChangedData, bool& bHandled); + int OnNotifySetFocus(HXUIOBJ hObjSource, XUINotifyFocus *pNotifyFocusData, bool& bHandled); + int OnNotifyKillFocus(HXUIOBJ hObjSource, XUINotifyFocus *pNotifyFocusData, bool& bHandled); + int OnTimer( XUIMessageTimer *pTimer, bool& bHandled ); + int OnTransitionStart( XUIMessageTransition *pTransition, bool& bHandled ); + int OnFontRendererChange(); + int OnCustomMessage_DLCInstalled(); + int OnCustomMessage_DLCMountingComplete(); public: @@ -86,19 +86,19 @@ private: bool DoesMashUpWorldHaveFocus(); public: - static void UpdateGamesListCallback(LPVOID pParam); + static void UpdateGamesListCallback(void* pParam); private: void AddDefaultButtons(); void UpdateGamesList(); - void UpdateGamesList(DWORD dwNumResults, IQNetGameSearch *pGameSearch); + void UpdateGamesList(unsigned long dwNumResults, IQNetGameSearch *pGameSearch); //void UpdateGamesListLabels(); - static void SearchForGameCallback(void *hObj, DWORD dwNumResults, IQNetGameSearch *pGameSearch); + static void SearchForGameCallback(void *hObj, unsigned long dwNumResults, IQNetGameSearch *pGameSearch); static int DeviceSelectReturned(void *pParam,bool bContinue); unsigned char m_localPlayers; - HRESULT GetSaveInfo( ); + int GetSaveInfo( ); static int LoadSaveDataReturned(void *pParam,bool bContinue); static int DeleteSaveDataReturned(void *pParam,bool bSuccess); @@ -108,9 +108,9 @@ private: // callback #ifdef _XBOX - static bool GetSavesInfoCallback(LPVOID pParam,int iInstalledC, C4JStorage::CACHEINFOSTRUCT *InfoA, int iPad, HRESULT hRes); + static bool GetSavesInfoCallback(void* pParam,int iInstalledC, C4JStorage::CACHEINFOSTRUCT *InfoA, int iPad, int hRes); #else - static int GetSavesInfoCallback(LPVOID lpParam,const bool); + static int GetSavesInfoCallback(void* lpParam,const bool); #endif static int DeleteSaveDialogReturned(void *pParam,int iPad,C4JStorage::EMessageResult result); static int SaveOptionsDialogReturned(void *pParam,int iPad,C4JStorage::EMessageResult result); @@ -119,19 +119,19 @@ private: static int CopySaveReturned(void *pParam,bool bResult); static int LoadSaveDataForRenameReturned(void *pParam,bool bContinue); static int KeyboardReturned(void *pParam,bool bSet); - static void StartGameFromSave(CScene_MultiGameJoinLoad* pClass, DWORD dwLocalUsersMask); + static void StartGameFromSave(CScene_MultiGameJoinLoad* pClass, unsigned long dwLocalUsersMask); static int TexturePackDialogReturned(void *pParam,int iPad,C4JStorage::EMessageResult result); static int SaveTransferDialogReturned(void *pParam,int iPad,C4JStorage::EMessageResult result); static int Progress(void *pParam,float fProgress); static int TransferComplete(void *pParam,int i1, int i2); static int DeleteComplete(void *pParam,int i1, int i2); - static int UploadSaveForXboxOneThreadProc( LPVOID lpParameter ); + static int UploadSaveForXboxOneThreadProc( void* lpParameter ); static void DeleteFile(CScene_MultiGameJoinLoad *pClass, char *filename); - static void UploadFile(CScene_MultiGameJoinLoad *pClass, char *filename, LPVOID data, DWORD size); + static void UploadFile(CScene_MultiGameJoinLoad *pClass, char *filename, void* data, unsigned long size); static bool WaitForTransferComplete( CScene_MultiGameJoinLoad *pClass ); - static void CancelSaveUploadCallback(LPVOID lpParam); - static void SaveUploadCompleteCallback(LPVOID lpParam); + static void CancelSaveUploadCallback(void* lpParam); + static void SaveUploadCompleteCallback(void* lpParam); bool m_bIgnoreInput; @@ -149,17 +149,17 @@ private: bool m_bReady; bool m_bRetrievingSaveInfo; //bool m_bSaveRenamed; - WCHAR m_wchNewName[XCONTENT_MAX_DISPLAYNAME_LENGTH]; + wchar_t m_wchNewName[XCONTENT_MAX_DISPLAYNAME_LENGTH]; unsigned char m_szSeed[50]; vector *m_generators; JoinMenuInitData *m_initData; - UINT m_DefaultMinecraftIconSize; - PBYTE m_DefaultMinecraftIconData; + unsigned int m_DefaultMinecraftIconSize; + uint8_t* m_DefaultMinecraftIconData; int *m_iConfigA; // track the texture packs that we don't have installed int m_iTexturePacksNotInstalled; - PBYTE m_pbSaveTransferData; + uint8_t* m_pbSaveTransferData; float m_fProgress; bool m_bTransferComplete; diff --git a/src/client/Common/XUI/XUI_MultiGameLaunchMoreOptions.cpp b/src/client/Common/XUI/XUI_MultiGameLaunchMoreOptions.cpp index 098a50cc..065f0fcd 100644 --- a/src/client/Common/XUI/XUI_MultiGameLaunchMoreOptions.cpp +++ b/src/client/Common/XUI/XUI_MultiGameLaunchMoreOptions.cpp @@ -10,7 +10,7 @@ //---------------------------------------------------------------------------------- // Performs initialization tasks - retrieves controls. //---------------------------------------------------------------------------------- -HRESULT CScene_MultiGameLaunchMoreOptions::OnInit( XUIMessageInit* pInitData, BOOL& bHandled ) +int CScene_MultiGameLaunchMoreOptions::OnInit( XUIMessageInit* pInitData, bool& bHandled ) { MapChildControls(); @@ -128,7 +128,7 @@ HRESULT CScene_MultiGameLaunchMoreOptions::OnInit( XUIMessageInit* pInitData, BO } -HRESULT CScene_MultiGameLaunchMoreOptions::OnKeyDown(XUIMessageInput* pInputData, BOOL& rfHandled) +int CScene_MultiGameLaunchMoreOptions::OnKeyDown(XUIMessageInput* pInputData, bool& rfHandled) { ui.AnimateKeyPress(pInputData->UserIndex, pInputData->dwKeyCode); @@ -161,7 +161,7 @@ HRESULT CScene_MultiGameLaunchMoreOptions::OnKeyDown(XUIMessageInput* pInputData } -HRESULT CScene_MultiGameLaunchMoreOptions::OnNotifySetFocus( HXUIOBJ hObjSource, XUINotifyFocus *pNotifyFocusData, BOOL& bHandled ) +int CScene_MultiGameLaunchMoreOptions::OnNotifySetFocus( HXUIOBJ hObjSource, XUINotifyFocus *pNotifyFocusData, bool& bHandled ) { int stringId = 0; if(hObjSource == m_CheckboxStructures) @@ -227,7 +227,7 @@ HRESULT CScene_MultiGameLaunchMoreOptions::OnNotifySetFocus( HXUIOBJ hObjSource, return S_OK; } -HRESULT CScene_MultiGameLaunchMoreOptions::OnControlNavigate(XUIMessageControlNavigate *pControlNavigateData, BOOL& bHandled) +int CScene_MultiGameLaunchMoreOptions::OnControlNavigate(XUIMessageControlNavigate *pControlNavigateData, bool& bHandled) { pControlNavigateData->hObjDest=XuiControlGetNavigation(pControlNavigateData->hObjSource,pControlNavigateData->nControlNavigate,true,true); @@ -242,7 +242,7 @@ HRESULT CScene_MultiGameLaunchMoreOptions::OnControlNavigate(XUIMessageControlNa //---------------------------------------------------------------------------------- // Handler for the button press message. //---------------------------------------------------------------------------------- -HRESULT CScene_MultiGameLaunchMoreOptions::OnNotifyPressEx(HXUIOBJ hObjPressed, XUINotifyPress* pNotifyPressData, BOOL& rfHandled) +int CScene_MultiGameLaunchMoreOptions::OnNotifyPressEx(HXUIOBJ hObjPressed, XUINotifyPress* pNotifyPressData, bool& rfHandled) { // This assumes all buttons can only be pressed with the A button ui.AnimateKeyPress(pNotifyPressData->UserIndex, VK_PAD_A); @@ -265,7 +265,7 @@ HRESULT CScene_MultiGameLaunchMoreOptions::OnNotifyPressEx(HXUIOBJ hObjPressed, return S_OK; } -HRESULT CScene_MultiGameLaunchMoreOptions::OnTimer( XUIMessageTimer *pTimer, BOOL& bHandled ) +int CScene_MultiGameLaunchMoreOptions::OnTimer( XUIMessageTimer *pTimer, bool& bHandled ) { // 4J-PB - TODO - Don't think we can do this - if a 2nd player signs in here with an offline profile, the signed in LIVE player gets re-logged in, and bMultiplayerAllowed is false briefly if( pTimer->nId == GAME_CREATE_ONLINE_TIMER_ID) diff --git a/src/client/Common/XUI/XUI_MultiGameLaunchMoreOptions.h b/src/client/Common/XUI/XUI_MultiGameLaunchMoreOptions.h index 8d2c8bb2..cbd072b8 100644 --- a/src/client/Common/XUI/XUI_MultiGameLaunchMoreOptions.h +++ b/src/client/Common/XUI/XUI_MultiGameLaunchMoreOptions.h @@ -56,12 +56,12 @@ protected: END_CONTROL_MAP() - HRESULT OnInit( XUIMessageInit* pInitData, BOOL& bHandled ); - HRESULT OnKeyDown(XUIMessageInput* pInputData, BOOL& rfHandled); - HRESULT OnNotifySetFocus( HXUIOBJ hObjSource, XUINotifyFocus *pNotifyFocusData, BOOL& bHandled ); - HRESULT OnControlNavigate(XUIMessageControlNavigate *pControlNavigateData, BOOL& bHandled); - HRESULT OnNotifyPressEx(HXUIOBJ hObjPressed, XUINotifyPress* pNotifyPressData,BOOL& rfHandled); - HRESULT OnTimer( XUIMessageTimer *pTimer, BOOL& bHandled ); + int OnInit( XUIMessageInit* pInitData, bool& bHandled ); + int OnKeyDown(XUIMessageInput* pInputData, bool& rfHandled); + int OnNotifySetFocus( HXUIOBJ hObjSource, XUINotifyFocus *pNotifyFocusData, bool& bHandled ); + int OnControlNavigate(XUIMessageControlNavigate *pControlNavigateData, bool& bHandled); + int OnNotifyPressEx(HXUIOBJ hObjPressed, XUINotifyPress* pNotifyPressData,bool& rfHandled); + int OnTimer( XUIMessageTimer *pTimer, bool& bHandled ); public: diff --git a/src/client/Common/XUI/XUI_NewUpdateMessage.cpp b/src/client/Common/XUI/XUI_NewUpdateMessage.cpp index cc6df245..05a3ecaf 100644 --- a/src/client/Common/XUI/XUI_NewUpdateMessage.cpp +++ b/src/client/Common/XUI/XUI_NewUpdateMessage.cpp @@ -6,7 +6,7 @@ #include "StringHelpers.h" -HRESULT CScene_NewUpdateMessage::OnInit( XUIMessageInit* pInitData, BOOL& bHandled ) +int CScene_NewUpdateMessage::OnInit( XUIMessageInit* pInitData, bool& bHandled ) { m_iPad = *(int *) pInitData->pvInitData; m_bIsSD=!RenderManager.IsHiDef() && !RenderManager.IsWidescreen(); @@ -32,7 +32,7 @@ HRESULT CScene_NewUpdateMessage::OnInit( XUIMessageInit* pInitData, BOOL& bHandl -HRESULT CScene_NewUpdateMessage::OnKeyDown(XUIMessageInput* pInputData, BOOL& rfHandled) +int CScene_NewUpdateMessage::OnKeyDown(XUIMessageInput* pInputData, bool& rfHandled) { ui.AnimateKeyPress(pInputData->UserIndex, pInputData->dwKeyCode); @@ -81,7 +81,7 @@ HRESULT CScene_NewUpdateMessage::OnKeyDown(XUIMessageInput* pInputData, BOOL& rf return S_OK; } -HRESULT CScene_NewUpdateMessage::OnNavReturn(HXUIOBJ hObj,BOOL& rfHandled) +int CScene_NewUpdateMessage::OnNavReturn(HXUIOBJ hObj,bool& rfHandled) { ui.SetTooltips( DEFAULT_XUI_MENU_USER, IDS_TOOLTIPS_SELECT, IDS_TOOLTIPS_BACK ); diff --git a/src/client/Common/XUI/XUI_NewUpdateMessage.h b/src/client/Common/XUI/XUI_NewUpdateMessage.h index 8c4fbb36..4ad1f241 100644 --- a/src/client/Common/XUI/XUI_NewUpdateMessage.h +++ b/src/client/Common/XUI/XUI_NewUpdateMessage.h @@ -18,9 +18,9 @@ class CScene_NewUpdateMessage : public CXuiSceneImpl MAP_CONTROL(IDC_XuiHTMLMessage, m_HTMLText) END_CONTROL_MAP() - HRESULT OnInit( XUIMessageInit* pInitData, BOOL& bHandled ); - HRESULT OnKeyDown(XUIMessageInput* pInputData, BOOL& rfHandled); - HRESULT OnNavReturn(HXUIOBJ hObj,BOOL& rfHandled); + int OnInit( XUIMessageInit* pInitData, bool& bHandled ); + int OnKeyDown(XUIMessageInput* pInputData, bool& rfHandled); + int OnNavReturn(HXUIOBJ hObj,bool& rfHandled); public: XUI_IMPLEMENT_CLASS( CScene_NewUpdateMessage, L"CScene_NewUpdateMessage", XUI_CLASS_SCENE ) diff --git a/src/client/Common/XUI/XUI_PartnernetPassword.cpp b/src/client/Common/XUI/XUI_PartnernetPassword.cpp index a617d516..ad4a6273 100644 --- a/src/client/Common/XUI/XUI_PartnernetPassword.cpp +++ b/src/client/Common/XUI/XUI_PartnernetPassword.cpp @@ -8,7 +8,7 @@ //---------------------------------------------------------------------------------- // Performs initialization tasks - retrieves controls. //---------------------------------------------------------------------------------- -HRESULT CScene_PartnernetPassword::OnInit( XUIMessageInit* pInitData, BOOL& bHandled ) +int CScene_PartnernetPassword::OnInit( XUIMessageInit* pInitData, bool& bHandled ) { MapChildControls(); ui.SetTooltips( DEFAULT_XUI_MENU_USER, IDS_TOOLTIPS_SELECT); @@ -29,7 +29,7 @@ HRESULT CScene_PartnernetPassword::OnInit( XUIMessageInit* pInitData, BOOL& bHan //---------------------------------------------------------------------------------- // Handler for the button press message. //---------------------------------------------------------------------------------- -HRESULT CScene_PartnernetPassword::OnNotifyPressEx(HXUIOBJ hObjPressed, XUINotifyPress* pNotifyPressData, BOOL& rfHandled) +int CScene_PartnernetPassword::OnNotifyPressEx(HXUIOBJ hObjPressed, XUINotifyPress* pNotifyPressData, bool& rfHandled) { // This assumes all buttons can only be pressed with the A button ui.AnimateKeyPress(pNotifyPressData->UserIndex, VK_PAD_A); @@ -50,7 +50,7 @@ HRESULT CScene_PartnernetPassword::OnNotifyPressEx(HXUIOBJ hObjPressed, XUINotif return S_OK; } -HRESULT CScene_PartnernetPassword::OnKeyDown(XUIMessageInput* pInputData, BOOL& rfHandled) +int CScene_PartnernetPassword::OnKeyDown(XUIMessageInput* pInputData, bool& rfHandled) { ui.AnimateKeyPress(pInputData->UserIndex, pInputData->dwKeyCode); diff --git a/src/client/Common/XUI/XUI_PartnernetPassword.h b/src/client/Common/XUI/XUI_PartnernetPassword.h index 86f979b4..fe479836 100644 --- a/src/client/Common/XUI/XUI_PartnernetPassword.h +++ b/src/client/Common/XUI/XUI_PartnernetPassword.h @@ -24,9 +24,9 @@ protected: END_CONTROL_MAP() - HRESULT OnInit( XUIMessageInit* pInitData, BOOL& bHandled ); - HRESULT OnKeyDown(XUIMessageInput* pInputData, BOOL& rfHandled); - HRESULT OnNotifyPressEx(HXUIOBJ hObjPressed, XUINotifyPress* pNotifyPressData,BOOL& rfHandled); + int OnInit( XUIMessageInit* pInitData, bool& bHandled ); + int OnKeyDown(XUIMessageInput* pInputData, bool& rfHandled); + int OnNotifyPressEx(HXUIOBJ hObjPressed, XUINotifyPress* pNotifyPressData,bool& rfHandled); public: diff --git a/src/client/Common/XUI/XUI_PauseMenu.cpp b/src/client/Common/XUI/XUI_PauseMenu.cpp index 4aa7323c..1e516d63 100644 --- a/src/client/Common/XUI/XUI_PauseMenu.cpp +++ b/src/client/Common/XUI/XUI_PauseMenu.cpp @@ -28,7 +28,7 @@ //---------------------------------------------------------------------------------- // Performs initialization tasks - retrieves controls. //---------------------------------------------------------------------------------- -HRESULT UIScene_PauseMenu::OnInit( XUIMessageInit* pInitData, BOOL& bHandled ) +int UIScene_PauseMenu::OnInit( XUIMessageInit* pInitData, bool& bHandled ) { m_bIgnoreInput=true; m_iPad = *(int *)pInitData->pvInitData; @@ -164,7 +164,7 @@ HRESULT UIScene_PauseMenu::OnInit( XUIMessageInit* pInitData, BOOL& bHandled ) //---------------------------------------------------------------------------------- // Handler for the button press message. //---------------------------------------------------------------------------------- -HRESULT UIScene_PauseMenu::OnNotifyPressEx(HXUIOBJ hObjPressed, XUINotifyPress* pNotifyPressData, BOOL& rfHandled) +int UIScene_PauseMenu::OnNotifyPressEx(HXUIOBJ hObjPressed, XUINotifyPress* pNotifyPressData, bool& rfHandled) { if(m_bIgnoreInput) return S_OK; @@ -197,7 +197,7 @@ HRESULT UIScene_PauseMenu::OnNotifyPressEx(HXUIOBJ hObjPressed, XUINotifyPress* case BUTTON_PAUSE_LEADERBOARDS: { - UINT uiIDA[1]; + unsigned int uiIDA[1]; uiIDA[0]=IDS_OK; //4J Gordon: Being used for the leaderboards proper now @@ -220,7 +220,7 @@ HRESULT UIScene_PauseMenu::OnNotifyPressEx(HXUIOBJ hObjPressed, XUINotifyPress* // guests can't look at achievements if(ProfileManager.IsGuest(pNotifyPressData->UserIndex)) { - UINT uiIDA[1]; + unsigned int uiIDA[1]; uiIDA[0]=IDS_OK; StorageManager.RequestMessageBox(IDS_PRO_GUESTPROFILE_TITLE, IDS_PRO_GUESTPROFILE_TEXT, uiIDA, 1); } @@ -254,7 +254,7 @@ HRESULT UIScene_PauseMenu::OnNotifyPressEx(HXUIOBJ hObjPressed, XUINotifyPress* if(!m_pDLCPack->hasPurchasedFile( DLCManager::e_DLCType_Texture, L"" )) { // upsell - ULONGLONG ullOfferID_Full; + uint64_t ullOfferID_Full; // get the dlc texture pack DLCTexturePack *pDLCTexPack=(DLCTexturePack *)tPack; @@ -263,7 +263,7 @@ HRESULT UIScene_PauseMenu::OnNotifyPressEx(HXUIOBJ hObjPressed, XUINotifyPress* // tell sentient about the upsell of the full version of the texture pack TelemetryManager->RecordUpsellPresented(pNotifyPressData->UserIndex, eSet_UpsellID_Texture_DLC, ullOfferID_Full & 0xFFFFFFFF); - UINT uiIDA[2]; + unsigned int uiIDA[2]; uiIDA[0]=IDS_CONFIRM_OK; uiIDA[1]=IDS_CONFIRM_CANCEL; @@ -281,7 +281,7 @@ HRESULT UIScene_PauseMenu::OnNotifyPressEx(HXUIOBJ hObjPressed, XUINotifyPress* if(result == C4JStorage::ELoadGame_DeviceRemoved) { // this will be a tester trying to be clever - UINT uiIDA[2]; + unsigned int uiIDA[2]; uiIDA[0]=IDS_SELECTANEWDEVICE; uiIDA[1]=IDS_NODEVICE_DECLINE; @@ -292,7 +292,7 @@ HRESULT UIScene_PauseMenu::OnNotifyPressEx(HXUIOBJ hObjPressed, XUINotifyPress* // we need to ask if they are sure they want to overwrite the existing game if(bSaveExists) { - UINT uiIDA[2]; + unsigned int uiIDA[2]; uiIDA[0]=IDS_CONFIRM_CANCEL; uiIDA[1]=IDS_CONFIRM_OK; StorageManager.RequestMessageBox(IDS_TITLE_SAVE_GAME, IDS_CONFIRM_SAVE_GAME, uiIDA, 2, pNotifyPressData->UserIndex,&UIScene_PauseMenu::SaveGameDialogReturned,this, app.GetStringTable()); @@ -311,7 +311,7 @@ HRESULT UIScene_PauseMenu::OnNotifyPressEx(HXUIOBJ hObjPressed, XUINotifyPress* // Check if it's the trial version if(ProfileManager.IsFullVersion()) { - UINT uiIDA[3]; + unsigned int uiIDA[3]; // is it the primary player exiting? if(pNotifyPressData->UserIndex==ProfileManager.GetPrimaryPad()) @@ -384,7 +384,7 @@ HRESULT UIScene_PauseMenu::OnNotifyPressEx(HXUIOBJ hObjPressed, XUINotifyPress* CXuiSceneBase::ReduceTrialTimerValue(); // exit the level - UINT uiIDA[2]; + unsigned int uiIDA[2]; uiIDA[0]=IDS_CONFIRM_CANCEL; uiIDA[1]=IDS_CONFIRM_OK; StorageManager.RequestMessageBox(IDS_EXIT_GAME, IDS_CONFIRM_EXIT_GAME_PROGRESS_LOST, uiIDA, 2, pNotifyPressData->UserIndex,&UIScene_PauseMenu::ExitGameDialogReturned,this, app.GetStringTable()); @@ -412,7 +412,7 @@ HRESULT UIScene_PauseMenu::OnNotifyPressEx(HXUIOBJ hObjPressed, XUINotifyPress* return S_OK; } -HRESULT UIScene_PauseMenu::OnKeyDown(XUIMessageInput* pInputData, BOOL& rfHandled) +int UIScene_PauseMenu::OnKeyDown(XUIMessageInput* pInputData, bool& rfHandled) { if(m_bIgnoreInput) return S_OK; // ignore repeated start presses to avoid the scene closing before it's opened @@ -492,7 +492,7 @@ HRESULT UIScene_PauseMenu::OnKeyDown(XUIMessageInput* pInputData, BOOL& rfHandle case VK_PAD_RSHOULDER: if( bDisplayBanTip ) { - UINT uiIDA[2]; + unsigned int uiIDA[2]; uiIDA[0]=IDS_CONFIRM_CANCEL; uiIDA[1]=IDS_CONFIRM_OK; StorageManager.RequestMessageBox(IDS_ACTION_BAN_LEVEL_TITLE, IDS_ACTION_BAN_LEVEL_DESCRIPTION, uiIDA, 2, pInputData->UserIndex,&UIScene_PauseMenu::BanGameDialogReturned,this, app.GetStringTable()); @@ -507,7 +507,7 @@ HRESULT UIScene_PauseMenu::OnKeyDown(XUIMessageInput* pInputData, BOOL& rfHandle HXUIOBJ hObjPressed=TreeGetFocus(); XUINotifyPress NotifyPressData; - BOOL rfHandled=false; + bool rfHandled=false; NotifyPressData.UserIndex=pInputData->UserIndex; OnNotifyPressEx(hObjPressed,&NotifyPressData,rfHandled); @@ -518,7 +518,7 @@ HRESULT UIScene_PauseMenu::OnKeyDown(XUIMessageInput* pInputData, BOOL& rfHandle return S_OK; } -HRESULT UIScene_PauseMenu::OnNavReturn(HXUIOBJ hObj,BOOL& rfHandled) +int UIScene_PauseMenu::OnNavReturn(HXUIOBJ hObj,bool& rfHandled) { bool bIsisPrimaryHost=g_NetworkManager.IsHost() && (ProfileManager.GetPrimaryPad()==m_iPad); bool bDisplayBanTip = !g_NetworkManager.IsLocalGame() && !bIsisPrimaryHost && !ProfileManager.IsGuest(m_iPad); @@ -592,7 +592,7 @@ HRESULT UIScene_PauseMenu::OnNavReturn(HXUIOBJ hObj,BOOL& rfHandled) return S_OK; } -HRESULT UIScene_PauseMenu::OnControlNavigate(XUIMessageControlNavigate *pControlNavigateData, BOOL& bHandled) +int UIScene_PauseMenu::OnControlNavigate(XUIMessageControlNavigate *pControlNavigateData, bool& bHandled) { pControlNavigateData->hObjDest=XuiControlGetNavigation(pControlNavigateData->hObjSource,pControlNavigateData->nControlNavigate,true,true); @@ -667,13 +667,13 @@ int UIScene_PauseMenu::DeviceSelectReturned(void *pParam,bool bContinue) return 0; } -HRESULT UIScene_PauseMenu::OnCustomMessage_Splitscreenplayer(bool bJoining, BOOL& bHandled) +int UIScene_PauseMenu::OnCustomMessage_Splitscreenplayer(bool bJoining, bool& bHandled) { bHandled=true; return app.AdjustSplitscreenScene_PlayerChanged(m_hObj,&m_OriginalPosition,m_iPad,bJoining,false); } -HRESULT UIScene_PauseMenu::OnTimer(XUIMessageTimer *pData,BOOL& rfHandled) +int UIScene_PauseMenu::OnTimer(XUIMessageTimer *pData,bool& rfHandled) { if(pData->nId==IGNORE_KEYPRESS_TIMERID) { @@ -695,7 +695,7 @@ HRESULT UIScene_PauseMenu::OnTimer(XUIMessageTimer *pData,BOOL& rfHandled) } -HRESULT UIScene_PauseMenu::OnDestroy() +int UIScene_PauseMenu::OnDestroy() { //XBackgroundDownloadSetMode(XBACKGROUND_DOWNLOAD_MODE_AUTO); TelemetryManager->RecordUnpauseOrActive(m_iPad); @@ -739,7 +739,7 @@ int UIScene_PauseMenu::DeviceRemovedDialogReturned(void *pParam,int iPad,C4JStor return 0; } -HRESULT UIScene_PauseMenu::OnCustomMessage_DLCInstalled() +int UIScene_PauseMenu::OnCustomMessage_DLCInstalled() { // mounted DLC may have changed if(app.StartInstallDLCProcess(m_iPad)==false) @@ -755,7 +755,7 @@ HRESULT UIScene_PauseMenu::OnCustomMessage_DLCInstalled() return S_OK; } -HRESULT UIScene_PauseMenu::OnCustomMessage_DLCMountingComplete() +int UIScene_PauseMenu::OnCustomMessage_DLCMountingComplete() { m_bIgnoreInput=false; app.m_dlcManager.checkForCorruptDLCAndAlert(); @@ -778,7 +778,7 @@ int UIScene_PauseMenu::WarningTrialTexturePackReturned(void *pParam,int iPad,C4J { if(ProfileManager.IsSignedIn(iPad)) { - ULONGLONG ullIndexA[1]; + uint64_t ullIndexA[1]; TexturePack *tPack = Minecraft::GetInstance()->skins->getSelected(); // get the dlc texture pack @@ -822,7 +822,7 @@ int UIScene_PauseMenu::ExitGameSaveDialogReturned(void *pParam,int iPad,C4JStora { #ifdef _XBOX // upsell - ULONGLONG ullOfferID_Full; + uint64_t ullOfferID_Full; // get the dlc texture pack DLCTexturePack *pDLCTexPack=(DLCTexturePack *)tPack; @@ -832,7 +832,7 @@ int UIScene_PauseMenu::ExitGameSaveDialogReturned(void *pParam,int iPad,C4JStora TelemetryManager->RecordUpsellPresented(iPad, eSet_UpsellID_Texture_DLC, ullOfferID_Full & 0xFFFFFFFF); #endif - UINT uiIDA[2]; + unsigned int uiIDA[2]; uiIDA[0]=IDS_CONFIRM_OK; uiIDA[1]=IDS_CONFIRM_CANCEL; @@ -850,7 +850,7 @@ int UIScene_PauseMenu::ExitGameSaveDialogReturned(void *pParam,int iPad,C4JStora // we need to ask if they are sure they want to overwrite the existing game if(bSaveExists) { - UINT uiIDA[2]; + unsigned int uiIDA[2]; uiIDA[0]=IDS_CONFIRM_CANCEL; uiIDA[1]=IDS_CONFIRM_OK; ui.RequestMessageBox(IDS_TITLE_SAVE_GAME, IDS_CONFIRM_SAVE_GAME, uiIDA, 2, ProfileManager.GetPrimaryPad(),&UIScene_PauseMenu::ExitGameAndSaveReturned,pClass, app.GetStringTable()); @@ -864,7 +864,7 @@ int UIScene_PauseMenu::ExitGameSaveDialogReturned(void *pParam,int iPad,C4JStora else { // been a few requests for a confirm on exit without saving - UINT uiIDA[2]; + unsigned int uiIDA[2]; uiIDA[0]=IDS_CONFIRM_CANCEL; uiIDA[1]=IDS_CONFIRM_OK; ui.RequestMessageBox(IDS_TITLE_DECLINE_SAVE_GAME, IDS_CONFIRM_DECLINE_SAVE_GAME, uiIDA, 2, ProfileManager.GetPrimaryPad(),&UIScene_PauseMenu::ExitGameDeclineSaveReturned, dynamic_cast(pClass), app.GetStringTable()); @@ -891,7 +891,7 @@ int UIScene_PauseMenu::ExitGameDeclineSaveReturned(void *pParam,int iPad,C4JStor if(ui.IsPauseMenuDisplayed(ProfileManager.GetPrimaryPad())) { IUIScene_PauseMenu* pClass = (IUIScene_PauseMenu*)pParam; - UINT uiIDA[3]; + unsigned int uiIDA[3]; // you cancelled the save on exit after choosing exit and save? You go back to the Exit choices then. uiIDA[0]=IDS_CONFIRM_CANCEL; uiIDA[1]=IDS_EXIT_GAME_SAVE; @@ -928,7 +928,7 @@ int UIScene_PauseMenu::ExitGameAndSaveReturned(void *pParam,int iPad,C4JStorage: if(ui.IsPauseMenuDisplayed(ProfileManager.GetPrimaryPad())) { UIScene_PauseMenu* pClass = (UIScene_PauseMenu*)pParam; - UINT uiIDA[3]; + unsigned int uiIDA[3]; // you cancelled the save on exit after choosing exit and save? You go back to the Exit choices then. uiIDA[0]=IDS_CONFIRM_CANCEL; uiIDA[1]=IDS_EXIT_GAME_SAVE; @@ -969,7 +969,7 @@ int UIScene_PauseMenu::ExitGameDialogReturned(void *pParam,int iPad,C4JStorage:: return 0; } -int UIScene_PauseMenu::SaveWorldThreadProc( LPVOID lpParameter ) +int UIScene_PauseMenu::SaveWorldThreadProc( void* lpParameter ) { bool bAutosave=(bool)lpParameter; if(bAutosave) @@ -1002,7 +1002,7 @@ int UIScene_PauseMenu::SaveWorldThreadProc( LPVOID lpParameter ) if(!MinecraftServer::serverHalted() && !app.GetChangingSessionType() ) app.SetGameStarted(true); } - HRESULT hr = S_OK; + int hr = S_OK; if(app.GetChangingSessionType()) { // 4J Stu - This causes the fullscreenprogress scene to ignore the action it was given @@ -1026,7 +1026,7 @@ int UIScene_PauseMenu::ExitWorldThreadProc( void* lpParameter ) } // This function performs the meat of exiting from a level. It should be called from a thread other than the main thread. -void UIScene_PauseMenu::_ExitWorld(LPVOID lpParameter) +void UIScene_PauseMenu::_ExitWorld(void* lpParameter) { Minecraft *pMinecraft=Minecraft::GetInstance(); @@ -1100,7 +1100,7 @@ void UIScene_PauseMenu::_ExitWorld(LPVOID lpParameter) } //pMinecraft->progressRenderer->progressStartNoAbort( exitReasonStringId ); - UINT uiIDA[1]; + unsigned int uiIDA[1]; uiIDA[0]=IDS_CONFIRM_OK; // 4J Stu - Fix for #48669 - TU5: Code: Compliance: TCR #15: Incorrect/misleading messages after signing out a profile during online game session. // If the primary player is signed out, then that is most likely the cause of the disconnection so don't display a message box. This will allow the message box requested by the libraries to be brought up @@ -1178,7 +1178,7 @@ void UIScene_PauseMenu::_ExitWorld(LPVOID lpParameter) } //pMinecraft->progressRenderer->progressStartNoAbort( exitReasonStringId ); - UINT uiIDA[1]; + unsigned int uiIDA[1]; uiIDA[0]=IDS_CONFIRM_OK; ui.RequestMessageBox( exitReasonTitleId, exitReasonStringId, uiIDA,1,ProfileManager.GetPrimaryPad(),NULL,NULL, app.GetStringTable()); exitReasonStringId = -1; diff --git a/src/client/Common/XUI/XUI_PauseMenu.h b/src/client/Common/XUI/XUI_PauseMenu.h index 99da486c..81b4484f 100644 --- a/src/client/Common/XUI/XUI_PauseMenu.h +++ b/src/client/Common/XUI/XUI_PauseMenu.h @@ -43,16 +43,16 @@ class UIScene_PauseMenu : public CXuiSceneImpl, public IUIScene_PauseMenu MAP_CONTROL(IDC_XuiButton6, m_Buttons[BUTTON_PAUSE_EXITGAME]) END_CONTROL_MAP() - HRESULT OnInit( XUIMessageInit* pInitData, BOOL& bHandled ); - HRESULT OnNotifyPressEx(HXUIOBJ hObjPressed, XUINotifyPress* pNotifyPressData,BOOL& rfHandled); - HRESULT OnKeyDown(XUIMessageInput* pInputData, BOOL& rfHandled); - HRESULT OnNavReturn(HXUIOBJ hObj,BOOL& rfHandled); - HRESULT OnControlNavigate(XUIMessageControlNavigate *pControlNavigateData, BOOL& bHandled); - HRESULT OnCustomMessage_Splitscreenplayer(bool bJoining, BOOL& bHandled); - HRESULT OnTimer(XUIMessageTimer *pData,BOOL& rfHandled); - HRESULT OnDestroy(); - HRESULT OnCustomMessage_DLCInstalled(); - HRESULT OnCustomMessage_DLCMountingComplete(); + int OnInit( XUIMessageInit* pInitData, bool& bHandled ); + int OnNotifyPressEx(HXUIOBJ hObjPressed, XUINotifyPress* pNotifyPressData,bool& rfHandled); + int OnKeyDown(XUIMessageInput* pInputData, bool& rfHandled); + int OnNavReturn(HXUIOBJ hObj,bool& rfHandled); + int OnControlNavigate(XUIMessageControlNavigate *pControlNavigateData, bool& bHandled); + int OnCustomMessage_Splitscreenplayer(bool bJoining, bool& bHandled); + int OnTimer(XUIMessageTimer *pData,bool& rfHandled); + int OnDestroy(); + int OnCustomMessage_DLCInstalled(); + int OnCustomMessage_DLCMountingComplete(); public: @@ -72,7 +72,7 @@ public: static int SaveWorldThreadProc( void* lpParameter ); static int ExitWorldThreadProc( void* lpParameter ); - static void _ExitWorld(LPVOID lpParameter); // Call only from a thread + static void _ExitWorld(void* lpParameter); // Call only from a thread protected: diff --git a/src/client/Common/XUI/XUI_Reinstall.cpp b/src/client/Common/XUI/XUI_Reinstall.cpp index a2efa905..b5a2ef50 100644 --- a/src/client/Common/XUI/XUI_Reinstall.cpp +++ b/src/client/Common/XUI/XUI_Reinstall.cpp @@ -23,7 +23,7 @@ //---------------------------------------------------------------------------------- // Performs initialization tasks - retrieves controls. //---------------------------------------------------------------------------------- -HRESULT CScene_Reinstall::OnInit( XUIMessageInit* pInitData, BOOL& bHandled ) +int CScene_Reinstall::OnInit( XUIMessageInit* pInitData, bool& bHandled ) { // We'll only be in this menu from the main menu, not in game m_iPad = *(int *)pInitData->pvInitData; @@ -132,7 +132,7 @@ HRESULT CScene_Reinstall::OnInit( XUIMessageInit* pInitData, BOOL& bHandled ) //---------------------------------------------------------------------------------- // Handler for the button press message. //---------------------------------------------------------------------------------- -HRESULT CScene_Reinstall::OnNotifyPressEx(HXUIOBJ hObjPressed, XUINotifyPress* pNotifyPressData, BOOL& rfHandled) +int CScene_Reinstall::OnNotifyPressEx(HXUIOBJ hObjPressed, XUINotifyPress* pNotifyPressData, bool& rfHandled) { if(m_bIgnoreInput) return S_OK; @@ -184,7 +184,7 @@ HRESULT CScene_Reinstall::OnNotifyPressEx(HXUIOBJ hObjPressed, XUINotifyPress* p return S_OK; } -HRESULT CScene_Reinstall::OnKeyDown(XUIMessageInput* pInputData, BOOL& rfHandled) +int CScene_Reinstall::OnKeyDown(XUIMessageInput* pInputData, bool& rfHandled) { if(m_bIgnoreInput) return S_OK; @@ -214,13 +214,13 @@ HRESULT CScene_Reinstall::OnKeyDown(XUIMessageInput* pInputData, BOOL& rfHandled return S_OK; } -HRESULT CScene_Reinstall::OnNavReturn(HXUIOBJ hObj,BOOL& rfHandled) +int CScene_Reinstall::OnNavReturn(HXUIOBJ hObj,bool& rfHandled) { return S_OK; } -HRESULT CScene_Reinstall::OnControlNavigate(XUIMessageControlNavigate *pControlNavigateData, BOOL& bHandled) +int CScene_Reinstall::OnControlNavigate(XUIMessageControlNavigate *pControlNavigateData, bool& bHandled) { pControlNavigateData->hObjDest=XuiControlGetNavigation(pControlNavigateData->hObjSource,pControlNavigateData->nControlNavigate,true,true); @@ -232,7 +232,7 @@ HRESULT CScene_Reinstall::OnControlNavigate(XUIMessageControlNavigate *pControlN return S_OK; } -HRESULT CScene_Reinstall::OnTransitionStart( XUIMessageTransition *pTransition, BOOL& bHandled ) +int CScene_Reinstall::OnTransitionStart( XUIMessageTransition *pTransition, bool& bHandled ) { if(pTransition->dwTransAction==XUI_TRANSITION_ACTION_DESTROY ) return S_OK; @@ -248,7 +248,7 @@ HRESULT CScene_Reinstall::OnTransitionStart( XUIMessageTransition *pTransition, float fMaxButton; float fWidth,fHeight; - HRESULT hr=XuiControlGetVisual(m_Buttons[0].m_hObj,&visual); + int hr=XuiControlGetVisual(m_Buttons[0].m_hObj,&visual); hr=XuiElementGetChildById(visual,L"text_Label",&text); hr=XuiElementGetBounds(text,&fTextVisualLen,&fHeight); m_Buttons[0].GetBounds(&fMaxButton,&fHeight); diff --git a/src/client/Common/XUI/XUI_Reinstall.h b/src/client/Common/XUI/XUI_Reinstall.h index 06b823cb..5971840f 100644 --- a/src/client/Common/XUI/XUI_Reinstall.h +++ b/src/client/Common/XUI/XUI_Reinstall.h @@ -37,12 +37,12 @@ class CScene_Reinstall : public CXuiSceneImpl MAP_CONTROL(IDC_XuiButton6, m_Buttons[BUTTON_REINSTALL_AVATAR3 ]) END_CONTROL_MAP() - HRESULT OnInit( XUIMessageInit* pInitData, BOOL& bHandled ); - HRESULT OnNotifyPressEx(HXUIOBJ hObjPressed, XUINotifyPress* pNotifyPressData,BOOL& rfHandled); - HRESULT OnKeyDown(XUIMessageInput* pInputData, BOOL& rfHandled); - HRESULT OnNavReturn(HXUIOBJ hObj,BOOL& rfHandled); - HRESULT OnControlNavigate(XUIMessageControlNavigate *pControlNavigateData, BOOL& bHandled); - HRESULT OnTransitionStart( XUIMessageTransition *pTransition, BOOL& bHandled ); + int OnInit( XUIMessageInit* pInitData, bool& bHandled ); + int OnNotifyPressEx(HXUIOBJ hObjPressed, XUINotifyPress* pNotifyPressData,bool& rfHandled); + int OnKeyDown(XUIMessageInput* pInputData, bool& rfHandled); + int OnNavReturn(HXUIOBJ hObj,bool& rfHandled); + int OnControlNavigate(XUIMessageControlNavigate *pControlNavigateData, bool& bHandled); + int OnTransitionStart( XUIMessageTransition *pTransition, bool& bHandled ); static int DeviceSelectReturned(void *pParam,bool bContinue); static int DeviceSelectReturned_AndReinstall(void *pParam,bool bContinue); diff --git a/src/client/Common/XUI/XUI_SaveMessage.cpp b/src/client/Common/XUI/XUI_SaveMessage.cpp index 57f6ae73..6a6707dc 100644 --- a/src/client/Common/XUI/XUI_SaveMessage.cpp +++ b/src/client/Common/XUI/XUI_SaveMessage.cpp @@ -5,7 +5,7 @@ //---------------------------------------------------------------------------------- // Performs initialization tasks - retrieves controls. //---------------------------------------------------------------------------------- -HRESULT CScene_SaveMessage::OnInit( XUIMessageInit* pInitData, BOOL& bHandled ) +int CScene_SaveMessage::OnInit( XUIMessageInit* pInitData, bool& bHandled ) { MapChildControls(); CXuiSceneBase::ShowBackground( DEFAULT_XUI_MENU_USER, true ); @@ -39,7 +39,7 @@ HRESULT CScene_SaveMessage::OnInit( XUIMessageInit* pInitData, BOOL& bHandled ) //---------------------------------------------------------------------------------- // Handler for the button press message. //---------------------------------------------------------------------------------- -HRESULT CScene_SaveMessage::OnNotifyPressEx(HXUIOBJ hObjPressed, XUINotifyPress* pNotifyPressData, BOOL& rfHandled) +int CScene_SaveMessage::OnNotifyPressEx(HXUIOBJ hObjPressed, XUINotifyPress* pNotifyPressData, bool& rfHandled) { if(m_bIgnoreInput) return S_OK; @@ -52,7 +52,7 @@ HRESULT CScene_SaveMessage::OnNotifyPressEx(HXUIOBJ hObjPressed, XUINotifyPress* return S_OK; } -HRESULT CScene_SaveMessage::OnKeyDown(XUIMessageInput* pInputData, BOOL& rfHandled) +int CScene_SaveMessage::OnKeyDown(XUIMessageInput* pInputData, bool& rfHandled) { if(m_bIgnoreInput) return S_OK; @@ -64,7 +64,7 @@ HRESULT CScene_SaveMessage::OnKeyDown(XUIMessageInput* pInputData, BOOL& rfHandl // 4J-PB - added for Compliance fail - // Games must enter an interactive state that accepts player input within 20 seconds after the initial start-up sequence. // If an animation or cinematic shown during the start-up sequence runs longer than 20 seconds, it must be skippable using the START button or natural input. -HRESULT CScene_SaveMessage::OnTimer(XUIMessageTimer *pData,BOOL& rfHandled) +int CScene_SaveMessage::OnTimer(XUIMessageTimer *pData,bool& rfHandled) { m_bIgnoreInput=true; XuiKillTimer(m_hObj,0); diff --git a/src/client/Common/XUI/XUI_SaveMessage.h b/src/client/Common/XUI/XUI_SaveMessage.h index 3e84541c..cd659551 100644 --- a/src/client/Common/XUI/XUI_SaveMessage.h +++ b/src/client/Common/XUI/XUI_SaveMessage.h @@ -21,10 +21,10 @@ class CScene_SaveMessage : public CXuiSceneImpl END_CONTROL_MAP() - HRESULT OnInit( XUIMessageInit* pInitData, BOOL& bHandled ); - HRESULT OnNotifyPressEx(HXUIOBJ hObjPressed, XUINotifyPress* pNotifyPressData,BOOL& rfHandled); - HRESULT OnKeyDown(XUIMessageInput* pInputData, BOOL& rfHandled); - HRESULT OnTimer( XUIMessageTimer *pXUIMessageTimer, BOOL &bHandled); + int OnInit( XUIMessageInit* pInitData, bool& bHandled ); + int OnNotifyPressEx(HXUIOBJ hObjPressed, XUINotifyPress* pNotifyPressData,bool& rfHandled); + int OnKeyDown(XUIMessageInput* pInputData, bool& rfHandled); + int OnTimer( XUIMessageTimer *pXUIMessageTimer, bool &bHandled); bool m_bIgnoreInput; public: diff --git a/src/client/Common/XUI/XUI_Scene_AbstractContainer.cpp b/src/client/Common/XUI/XUI_Scene_AbstractContainer.cpp index 1b4d112e..d79352b1 100644 --- a/src/client/Common/XUI/XUI_Scene_AbstractContainer.cpp +++ b/src/client/Common/XUI/XUI_Scene_AbstractContainer.cpp @@ -105,7 +105,7 @@ void CXuiSceneAbstractContainer::PlatformInitialize(int iPad, int startIndex) #endif // Add timer to poll controller stick input at 60Hz - HRESULT timerResult = SetTimer( POINTER_INPUT_TIMER_ID, ( 1000 / 60 ) ); + int timerResult = SetTimer( POINTER_INPUT_TIMER_ID, ( 1000 / 60 ) ); assert( timerResult == S_OK ); XuiSetTimer(m_hObj,IGNORE_KEYPRESS_TIMERID,IGNORE_KEYPRESS_TIME); @@ -154,7 +154,7 @@ int CXuiSceneAbstractContainer::getSectionRows(ESceneSection eSection) } // Adding this so we can turn off the pointer text background, since it flickers on then off at the start of a scene where a tutorial popup is -HRESULT CXuiSceneAbstractContainer::OnTransitionStart( XUIMessageTransition *pTransition, BOOL& bHandled ) +int CXuiSceneAbstractContainer::OnTransitionStart( XUIMessageTransition *pTransition, bool& bHandled ) { if(pTransition->dwTransAction==XUI_TRANSITION_ACTION_DESTROY ) return S_OK; @@ -164,14 +164,14 @@ HRESULT CXuiSceneAbstractContainer::OnTransitionStart( XUIMessageTransition *pTr if(pTransition->dwTransType == XUI_TRANSITION_BACKTO) { // Add timer to poll controller stick input at 60Hz - HRESULT timerResult = SetTimer( POINTER_INPUT_TIMER_ID, ( 1000 / 60 ) ); + int timerResult = SetTimer( POINTER_INPUT_TIMER_ID, ( 1000 / 60 ) ); assert( timerResult == S_OK ); InitDataAssociations(m_iPad, m_menu); } HXUIOBJ hObj=NULL; - HRESULT hr=XuiControlGetVisual(m_pointerControl->m_hObj,&hObj); + int hr=XuiControlGetVisual(m_pointerControl->m_hObj,&hObj); hr=XuiElementGetChildById(hObj,L"text_measurer",&m_hPointerTextMeasurer); hr=XuiElementGetChildById(hObj,L"text_name",&m_hPointerText); hr=XuiElementGetChildById(hObj,L"text_panel",&m_hPointerTextBkg); @@ -189,7 +189,7 @@ D3DXVECTOR3 CXuiSceneAbstractContainer::GetCursorScreenPosition() return app.GetElementScreenPosition(m_pointerControl->m_hObj); } -HRESULT CXuiSceneAbstractContainer::OnKeyDown(XUIMessageInput *pInputData, BOOL& bHandled) +int CXuiSceneAbstractContainer::OnKeyDown(XUIMessageInput *pInputData, bool& bHandled) { if(m_bIgnoreKeyPresses) return S_OK; @@ -263,7 +263,7 @@ void CXuiSceneAbstractContainer::handleSectionClick(ESceneSection eSection) slotList->Clicked(); } -HRESULT CXuiSceneAbstractContainer::handleCustomTimer( XUIMessageTimer *pTimer, BOOL& bHandled ) +int CXuiSceneAbstractContainer::handleCustomTimer( XUIMessageTimer *pTimer, bool& bHandled ) { return S_OK; } @@ -320,9 +320,9 @@ bool CXuiSceneAbstractContainer::isSlotEmpty(ESceneSection eSection, int iSlot) return pCXuiCtrlSlotItem->isEmpty( pCXuiCtrlSlotItem->m_hObj ); } -HRESULT CXuiSceneAbstractContainer::OnTimer( XUIMessageTimer *pTimer, BOOL& bHandled ) +int CXuiSceneAbstractContainer::OnTimer( XUIMessageTimer *pTimer, bool& bHandled ) { - HRESULT hr = S_OK; + int hr = S_OK; // Update pointer from stick input on timer. if ( pTimer->nId == POINTER_INPUT_TIMER_ID ) @@ -350,7 +350,7 @@ HRESULT CXuiSceneAbstractContainer::OnTimer( XUIMessageTimer *pTimer, BOOL& bHan return hr; } -HRESULT CXuiSceneAbstractContainer::OnCustomMessage_Splitscreenplayer(bool bJoining, BOOL& bHandled) +int CXuiSceneAbstractContainer::OnCustomMessage_Splitscreenplayer(bool bJoining, bool& bHandled) { bHandled=true; return app.AdjustSplitscreenScene_PlayerChanged(m_hObj,&m_OriginalPosition,m_iPad,bJoining); @@ -363,7 +363,7 @@ bool CXuiSceneAbstractContainer::doesSectionTreeHaveFocus(ESceneSection eSection void CXuiSceneAbstractContainer::setSectionFocus(ESceneSection eSection, int iPad) { - HRESULT focusResult = GetSectionControl( eSection )->SetFocus( iPad ); + int focusResult = GetSectionControl( eSection )->SetFocus( iPad ); assert( focusResult == S_OK ); } @@ -391,7 +391,7 @@ void CXuiSceneAbstractContainer::SetPointerText(const wstring &description, vect wstring desc = L"(smallPointer ? 12 :14) + L"\">" + description + L""; XUIRect tempXuiRect, xuiRect; - HRESULT hr; + int hr; xuiRect.right = 0; for(AUTO_VAR(it, unformattedStrings.begin()); it != unformattedStrings.end(); ++it) diff --git a/src/client/Common/XUI/XUI_Scene_AbstractContainer.h b/src/client/Common/XUI/XUI_Scene_AbstractContainer.h index 6936fc88..34167671 100644 --- a/src/client/Common/XUI/XUI_Scene_AbstractContainer.h +++ b/src/client/Common/XUI/XUI_Scene_AbstractContainer.h @@ -11,7 +11,7 @@ class Slot; class CXuiSceneAbstractContainer : public CXuiSceneImpl, public virtual IUIScene_AbstractContainerMenu { public: - BOOL isPauseScreen() { + bool isPauseScreen() { return false; }; @@ -26,11 +26,11 @@ protected: CXuiCtrlSlotItem* m_pointerControl; CXuiControl m_InventoryText; - HRESULT OnKeyDown(XUIMessageInput *pInputData, BOOL& bHandled); + int OnKeyDown(XUIMessageInput *pInputData, bool& bHandled); // Timer function to poll stick input and update pointer position. - HRESULT OnTimer( XUIMessageTimer *pTimer, BOOL& bHandled ); - HRESULT OnCustomMessage_Splitscreenplayer(bool bJoining, BOOL& bHandled); - HRESULT OnTransitionStart( XUIMessageTransition *pTransition, BOOL& bHandled ); + int OnTimer( XUIMessageTimer *pTimer, bool& bHandled ); + int OnCustomMessage_Splitscreenplayer(bool bJoining, bool& bHandled); + int OnTransitionStart( XUIMessageTransition *pTransition, bool& bHandled ); protected: // 4J JEV - Wanted to override onClick method in XUI_Scene_Inventory_Creative, @@ -46,7 +46,7 @@ private: int mapVKToAction(int vk); protected: - virtual HRESULT handleCustomTimer( XUIMessageTimer *pTimer, BOOL& bHandled ); + virtual int handleCustomTimer( XUIMessageTimer *pTimer, bool& bHandled ); public: int getPad() { return m_iPad; } diff --git a/src/client/Common/XUI/XUI_Scene_Anvil.cpp b/src/client/Common/XUI/XUI_Scene_Anvil.cpp index d382f17c..a7ddf82b 100644 --- a/src/client/Common/XUI/XUI_Scene_Anvil.cpp +++ b/src/client/Common/XUI/XUI_Scene_Anvil.cpp @@ -15,7 +15,7 @@ // Name: CXuiSceneAnvil::OnInit // Desc: Message handler for XM_INIT //-------------------------------------------------------------------------------------- -HRESULT CXuiSceneAnvil::OnInit( XUIMessageInit* pInitData, BOOL& bHandled ) +int CXuiSceneAnvil::OnInit( XUIMessageInit* pInitData, bool& bHandled ) { MapChildControls(); @@ -63,7 +63,7 @@ HRESULT CXuiSceneAnvil::OnInit( XUIMessageInit* pInitData, BOOL& bHandled ) return S_OK; } -HRESULT CXuiSceneAnvil::OnDestroy() +int CXuiSceneAnvil::OnDestroy() { Minecraft *pMinecraft = Minecraft::GetInstance(); @@ -79,12 +79,12 @@ HRESULT CXuiSceneAnvil::OnDestroy() return S_OK; } -HRESULT CXuiSceneAnvil::OnNotifyValueChanged (HXUIOBJ hObjSource, XUINotifyValueChanged* pValueChangedData, BOOL& rfHandled) +int CXuiSceneAnvil::OnNotifyValueChanged (HXUIOBJ hObjSource, XUINotifyValueChanged* pValueChangedData, bool& rfHandled) { if(hObjSource == m_editName) { wstring newValue = m_editName.GetText(); - LPCWSTR szText=newValue.c_str(); + const wchar_t* szText=newValue.c_str(); stripWhitespaceForHtml(newValue); // strip leading spaces @@ -113,7 +113,7 @@ HRESULT CXuiSceneAnvil::OnNotifyValueChanged (HXUIOBJ hObjSource, XUINotifyValue } // else // { -// LPCWSTR szText=m_itemName.c_str(); +// const wchar_t* szText=m_itemName.c_str(); // m_editName.SetText(szText); // m_editName.SetCaretPosition(m_itemName.length()); // } @@ -122,7 +122,7 @@ HRESULT CXuiSceneAnvil::OnNotifyValueChanged (HXUIOBJ hObjSource, XUINotifyValue return S_OK; } -HRESULT CXuiSceneAnvil::handleCustomTimer( XUIMessageTimer *pTimer, BOOL& bHandled ) +int CXuiSceneAnvil::handleCustomTimer( XUIMessageTimer *pTimer, bool& bHandled ) { if(pTimer->nId == ANVIL_UPDATE_TIMER_ID) { diff --git a/src/client/Common/XUI/XUI_Scene_Anvil.h b/src/client/Common/XUI/XUI_Scene_Anvil.h index 9698be9a..8ec56ea5 100644 --- a/src/client/Common/XUI/XUI_Scene_Anvil.h +++ b/src/client/Common/XUI/XUI_Scene_Anvil.h @@ -54,12 +54,12 @@ protected: END_MAP_CHILD_CONTROLS() END_CONTROL_MAP() - HRESULT OnInit( XUIMessageInit* pInitData, BOOL& bHandled ); - HRESULT OnDestroy(); - HRESULT OnNotifyValueChanged (HXUIOBJ hObjSource, XUINotifyValueChanged* pValueChangedData, BOOL& rfHandled); -// HRESULT OnCustomMessage_Splitscreenplayer(bool bJoining, BOOL& bHandled); + int OnInit( XUIMessageInit* pInitData, bool& bHandled ); + int OnDestroy(); + int OnNotifyValueChanged (HXUIOBJ hObjSource, XUINotifyValueChanged* pValueChangedData, bool& rfHandled); +// int OnCustomMessage_Splitscreenplayer(bool bJoining, bool& bHandled); - virtual HRESULT handleCustomTimer( XUIMessageTimer *pTimer, BOOL& bHandled ); + virtual int handleCustomTimer( XUIMessageTimer *pTimer, bool& bHandled ); virtual void InitDataAssociations(int iPad, AbstractContainerMenu *menu, int startIndex = 0); diff --git a/src/client/Common/XUI/XUI_Scene_Base.cpp b/src/client/Common/XUI/XUI_Scene_Base.cpp index 8ca261b0..ef984a0d 100644 --- a/src/client/Common/XUI/XUI_Scene_Base.cpp +++ b/src/client/Common/XUI/XUI_Scene_Base.cpp @@ -23,11 +23,11 @@ #define PRESS_START_TIMER 0 CXuiSceneBase *CXuiSceneBase::Instance = NULL; -DWORD CXuiSceneBase::m_dwTrialTimerLimitSecs=DYNAMIC_CONFIG_DEFAULT_TRIAL_TIME; +unsigned long CXuiSceneBase::m_dwTrialTimerLimitSecs=DYNAMIC_CONFIG_DEFAULT_TRIAL_TIME; //---------------------------------------------------------------------------------- // Performs initialization tasks - retrieves controls. //---------------------------------------------------------------------------------- -HRESULT CXuiSceneBase::OnInit( XUIMessageInit* pInitData, BOOL& bHandled ) +int CXuiSceneBase::OnInit( XUIMessageInit* pInitData, bool& bHandled ) { ASSERT( CXuiSceneBase::Instance == NULL ); CXuiSceneBase::Instance = this; @@ -36,7 +36,7 @@ HRESULT CXuiSceneBase::OnInit( XUIMessageInit* pInitData, BOOL& bHandled ) MapChildControls(); // Display the tooltips - HRESULT hr = S_OK; + int hr = S_OK; CXuiElement xuiElement = m_hObj; HXUIOBJ hTemp; @@ -95,7 +95,7 @@ HRESULT CXuiSceneBase::OnInit( XUIMessageInit* pInitData, BOOL& bHandled ) return S_OK; } -HRESULT CXuiSceneBase::OnTimer(XUIMessageTimer *pData,BOOL& rfHandled) +int CXuiSceneBase::OnTimer(XUIMessageTimer *pData,bool& rfHandled) { if(pData->nId==PRESS_START_TIMER) { @@ -108,7 +108,7 @@ HRESULT CXuiSceneBase::OnTimer(XUIMessageTimer *pData,BOOL& rfHandled) HXUIOBJ hObj=NULL,hQuadrant; - HRESULT hr=XuiControlGetVisual(m_PressStart.m_hObj,&hObj); + int hr=XuiControlGetVisual(m_PressStart.m_hObj,&hObj); for(int i=0;ilevel!=NULL) { - __int64 i64TimeOfDay =0; + int64_t i64TimeOfDay =0; // are we in the Nether? - Leave the time as 0 if we are, so we show daylight if(pMinecraft->level->dimension->id==0) { @@ -889,20 +889,20 @@ HRESULT CXuiSceneBase::_ShowBackground( unsigned int iPad, BOOL bShow ) return hr; } -HRESULT CXuiSceneBase::_ShowDarkOverlay( unsigned int iPad, BOOL bShow ) +int CXuiSceneBase::_ShowDarkOverlay( unsigned int iPad, bool bShow ) { return XuiElementSetShow(m_DarkOverlay[iPad],bShow); } -HRESULT CXuiSceneBase::_ShowLogo( unsigned int iPad, BOOL bShow ) +int CXuiSceneBase::_ShowLogo( unsigned int iPad, bool bShow ) { return XuiElementSetShow(m_Logo[iPad],bShow); } -HRESULT CXuiSceneBase::_ShowPressStart(unsigned int iPad) +int CXuiSceneBase::_ShowPressStart(unsigned int iPad) { XUIRect xuiRect; - LPCWSTR pString=app.GetString(IDS_PRESS_START_TO_JOIN);; + const wchar_t* pString=app.GetString(IDS_PRESS_START_TO_JOIN);; float fWidth,fHeight,fWidthChange; XuiSetTimer( m_hObj,PRESS_START_TIMER,3000); @@ -912,7 +912,7 @@ HRESULT CXuiSceneBase::_ShowPressStart(unsigned int iPad) // retrieve the visual for this quadrant HXUIOBJ hObj=NULL,hQuadrant; - HRESULT hr=XuiControlGetVisual(m_PressStart.m_hObj,&hObj); + int hr=XuiControlGetVisual(m_PressStart.m_hObj,&hObj); hr=XuiElementGetChildById(hObj,L"text_ButtonText",&hQuadrant); memset(&xuiRect, 0, sizeof(xuiRect)); hr=XuiTextPresenterMeasureText(hQuadrant, pString, &xuiRect); @@ -953,30 +953,30 @@ HRESULT CXuiSceneBase::_ShowPressStart(unsigned int iPad) return S_OK; } -HRESULT CXuiSceneBase::_HidePressStart() +int CXuiSceneBase::_HidePressStart() { return m_PressStart.SetShow(false); } -HRESULT CXuiSceneBase::_UpdateAutosaveCountdownTimer(unsigned int uiSeconds) +int CXuiSceneBase::_UpdateAutosaveCountdownTimer(unsigned int uiSeconds) { - WCHAR wcAutosaveCountdown[100]; + wchar_t wcAutosaveCountdown[100]; swprintf( wcAutosaveCountdown, 100, app.GetString(IDS_AUTOSAVE_COUNTDOWN),uiSeconds); m_TrialTimer.SetText(wcAutosaveCountdown); return S_OK; } -HRESULT CXuiSceneBase::_ShowAutosaveCountdownTimer(BOOL bVal) +int CXuiSceneBase::_ShowAutosaveCountdownTimer(bool bVal) { m_TrialTimer.SetShow(bVal); return S_OK; } -HRESULT CXuiSceneBase::_UpdateTrialTimer(unsigned int iPad) +int CXuiSceneBase::_UpdateTrialTimer(unsigned int iPad) { - WCHAR wcTime[20]; + wchar_t wcTime[20]; - DWORD dwTimeTicks=(DWORD)app.getTrialTimer(); + unsigned long dwTimeTicks=(unsigned long)app.getTrialTimer(); if(dwTimeTicks>m_dwTrialTimerLimitSecs) { @@ -1014,7 +1014,7 @@ HRESULT CXuiSceneBase::_UpdateTrialTimer(unsigned int iPad) void CXuiSceneBase::_ReduceTrialTimerValue() { - DWORD dwTimeTicks=(int)app.getTrialTimer(); + unsigned long dwTimeTicks=(int)app.getTrialTimer(); if(dwTimeTicks>m_dwTrialTimerLimitSecs) { @@ -1024,7 +1024,7 @@ void CXuiSceneBase::_ReduceTrialTimerValue() m_dwTrialTimerLimitSecs-=dwTimeTicks; } -HRESULT CXuiSceneBase::_ShowTrialTimer(BOOL bVal) +int CXuiSceneBase::_ShowTrialTimer(bool bVal) { m_TrialTimer.SetShow(bVal); return S_OK; @@ -1035,7 +1035,7 @@ bool CXuiSceneBase::_PressStartPlaying(unsigned int iPad) return m_iQuadrantsMask&(1<_SetTooltipsEnabled(iPad, bA, bB, bX, bY, bLT, bRT, bLB, bRB, bLS ); } -HRESULT CXuiSceneBase::EnableTooltip( unsigned int iPad, unsigned int tooltip, bool enable ) +int CXuiSceneBase::EnableTooltip( unsigned int iPad, unsigned int tooltip, bool enable ) { return CXuiSceneBase::Instance->_EnableTooltip(iPad, tooltip, enable); } -HRESULT CXuiSceneBase::AnimateKeyPress(DWORD userIndex, DWORD dwKeyCode) +int CXuiSceneBase::AnimateKeyPress(unsigned long userIndex, unsigned long dwKeyCode) { return CXuiSceneBase::Instance->_AnimateKeyPress(userIndex, dwKeyCode ); } -HRESULT CXuiSceneBase::ShowSavingMessage( unsigned int iPad, C4JStorage::ESavingMessage eVal ) +int CXuiSceneBase::ShowSavingMessage( unsigned int iPad, C4JStorage::ESavingMessage eVal ) { if( CXuiSceneBase::Instance != NULL ) { @@ -1986,51 +1986,51 @@ HRESULT CXuiSceneBase::ShowSavingMessage( unsigned int iPad, C4JStorage::ESaving return S_OK; } -HRESULT CXuiSceneBase::ShowBackground( unsigned int iPad, BOOL bShow ) +int CXuiSceneBase::ShowBackground( unsigned int iPad, bool bShow ) { return CXuiSceneBase::Instance->_ShowBackground(iPad, bShow ); } -HRESULT CXuiSceneBase::ShowDarkOverlay( unsigned int iPad, BOOL bShow ) +int CXuiSceneBase::ShowDarkOverlay( unsigned int iPad, bool bShow ) { return CXuiSceneBase::Instance->_ShowDarkOverlay(iPad, bShow ); } -HRESULT CXuiSceneBase::ShowLogo( unsigned int iPad, BOOL bShow ) +int CXuiSceneBase::ShowLogo( unsigned int iPad, bool bShow ) { return CXuiSceneBase::Instance->_ShowLogo(iPad, bShow ); } -HRESULT CXuiSceneBase::ShowPressStart(unsigned int iPad) +int CXuiSceneBase::ShowPressStart(unsigned int iPad) { CXuiSceneBase::Instance->_ShowPressStart(iPad); return S_OK; } -HRESULT CXuiSceneBase::ShowOtherPlayersBaseScene(int iPad, bool show) +int CXuiSceneBase::ShowOtherPlayersBaseScene(int iPad, bool show) { CXuiSceneBase::Instance->_ShowOtherPlayersBaseScene(iPad, show); return S_OK; } -HRESULT CXuiSceneBase::UpdateAutosaveCountdownTimer(unsigned int uiSeconds) +int CXuiSceneBase::UpdateAutosaveCountdownTimer(unsigned int uiSeconds) { CXuiSceneBase::Instance->_UpdateAutosaveCountdownTimer(uiSeconds); return S_OK; } -HRESULT CXuiSceneBase::ShowAutosaveCountdownTimer(BOOL bVal) +int CXuiSceneBase::ShowAutosaveCountdownTimer(bool bVal) { CXuiSceneBase::Instance->_ShowAutosaveCountdownTimer(bVal); return S_OK; } -HRESULT CXuiSceneBase::UpdateTrialTimer(unsigned int iPad) +int CXuiSceneBase::UpdateTrialTimer(unsigned int iPad) { CXuiSceneBase::Instance->_UpdateTrialTimer(iPad); return S_OK; } -HRESULT CXuiSceneBase::ShowTrialTimer(BOOL bVal) +int CXuiSceneBase::ShowTrialTimer(bool bVal) { CXuiSceneBase::Instance->_ShowTrialTimer(bVal); return S_OK; @@ -2046,17 +2046,17 @@ bool CXuiSceneBase::PressStartPlaying(unsigned int iPad) return CXuiSceneBase::Instance->_PressStartPlaying(iPad); } -HRESULT CXuiSceneBase::HidePressStart() +int CXuiSceneBase::HidePressStart() { return CXuiSceneBase::Instance->_HidePressStart(); } -HRESULT CXuiSceneBase::SetPlayerBaseScenePosition( unsigned int iPad, EBaseScenePosition position ) +int CXuiSceneBase::SetPlayerBaseScenePosition( unsigned int iPad, EBaseScenePosition position ) { return CXuiSceneBase::Instance->_SetPlayerBaseScenePosition(iPad, position ); } -HRESULT CXuiSceneBase::SetPlayerBasePositions(EBaseScenePosition pad0, EBaseScenePosition pad1, EBaseScenePosition pad2, EBaseScenePosition pad3) +int CXuiSceneBase::SetPlayerBasePositions(EBaseScenePosition pad0, EBaseScenePosition pad1, EBaseScenePosition pad2, EBaseScenePosition pad3) { SetPlayerBaseScenePosition( 0, pad0 ); SetPlayerBaseScenePosition( 1, pad1 ); @@ -2066,7 +2066,7 @@ HRESULT CXuiSceneBase::SetPlayerBasePositions(EBaseScenePosition pad0, EBaseScen return S_OK; } -HRESULT CXuiSceneBase::UpdatePlayerBasePositions() +int CXuiSceneBase::UpdatePlayerBasePositions() { EBaseScenePosition padPositions[XUSER_MAX_COUNT]; @@ -2080,7 +2080,7 @@ HRESULT CXuiSceneBase::UpdatePlayerBasePositions() // If the game is not started (or is being held paused for a bit) then display all scenes fullscreen if( pMinecraft == NULL ) { - for( BYTE idx = 0; idx < XUSER_MAX_COUNT; ++idx) + for( uint8_t idx = 0; idx < XUSER_MAX_COUNT; ++idx) { padPositions[idx] = e_BaseScene_Fullscreen; } @@ -2093,7 +2093,7 @@ HRESULT CXuiSceneBase::UpdatePlayerBasePositions() padPositions[primaryPad] = e_BaseScene_Fullscreen; // May need to turn off the player who just left - for( BYTE idx = 0; idx < XUSER_MAX_COUNT; ++idx) + for( uint8_t idx = 0; idx < XUSER_MAX_COUNT; ++idx) { DisplayGamertag(idx,false); } @@ -2103,7 +2103,7 @@ HRESULT CXuiSceneBase::UpdatePlayerBasePositions() else { - for( BYTE idx = 0; idx < XUSER_MAX_COUNT; ++idx) + for( uint8_t idx = 0; idx < XUSER_MAX_COUNT; ++idx) { if(pMinecraft->localplayers[idx] != NULL) { @@ -2173,7 +2173,7 @@ HXUIOBJ CXuiSceneBase::GetPlayerBaseScene(int iPad) return CXuiSceneBase::Instance->_GetPlayerBaseScene(iPad); } -HRESULT CXuiSceneBase::PlayUISFX(ESoundEffect eSound) +int CXuiSceneBase::PlayUISFX(ESoundEffect eSound) { return CXuiSceneBase::Instance->_PlayUISFX(eSound); } @@ -2210,7 +2210,7 @@ void CXuiSceneBase::SetEmptyQuadrantLogo(int iScreenSection) CXuiSceneBase::Instance->_SetEmptyQuadrantLogo(iPad,ePos); } -HRESULT CXuiSceneBase::DisplayGamertag( unsigned int iPad, BOOL bDisplay ) +int CXuiSceneBase::DisplayGamertag( unsigned int iPad, bool bDisplay ) { CXuiSceneBase::Instance->_DisplayGamertag(iPad,bDisplay); @@ -2237,7 +2237,7 @@ bool CXuiSceneBase::GetBaseSceneSafeZone( unsigned int iPad, D3DXVECTOR2 &origin void CXuiSceneBase::CreateBaseSceneInstance() { CXuiSceneBase *sceneBase = new CXuiSceneBase(); - BOOL handled; + bool handled; sceneBase->OnInit(NULL,handled); } #endif \ No newline at end of file diff --git a/src/client/Common/XUI/XUI_Scene_Base.h b/src/client/Common/XUI/XUI_Scene_Base.h index 7cfc8606..77a2ccb8 100644 --- a/src/client/Common/XUI/XUI_Scene_Base.h +++ b/src/client/Common/XUI/XUI_Scene_Base.h @@ -109,8 +109,8 @@ protected: CXuiControl m_selectedItemA[XUSER_MAX_COUNT]; CXuiControl m_selectedItemSmallA[XUSER_MAX_COUNT]; - BOOL m_visible[XUSER_MAX_COUNT][BUTTONS_TOOLTIP_MAX]; - BOOL m_bossHealthVisible[XUSER_MAX_COUNT]; + bool m_visible[XUSER_MAX_COUNT][BUTTONS_TOOLTIP_MAX]; + bool m_bossHealthVisible[XUSER_MAX_COUNT]; int m_iWrongTexturePackTickC; // Message map. Here we tie messages to message handlers. @@ -323,11 +323,11 @@ protected: END_CONTROL_MAP() - HRESULT OnInit( XUIMessageInit* pInitData, BOOL& bHandled ); - HRESULT OnTimer(XUIMessageTimer *pData,BOOL& rfHandled); - HRESULT OnSkinChanged(BOOL& bHandled); -// HRESULT OnCustomMessage_DLCInstalled(); -// HRESULT OnCustomMessage_DLCMountingComplete(); + int OnInit( XUIMessageInit* pInitData, bool& bHandled ); + int OnTimer(XUIMessageTimer *pData,bool& rfHandled); + int OnSkinChanged(bool& bHandled); +// int OnCustomMessage_DLCInstalled(); +// int OnCustomMessage_DLCMountingComplete(); public: // Define the class. The class name must match the ClassOverride property @@ -336,34 +336,34 @@ public: private: void _TickAllBaseScenes(); - HRESULT _SetTooltipText( unsigned int iPad, unsigned int tooltip, int iTextID ); - HRESULT _SetEnableTooltips( unsigned int iPad, BOOL bVal ); - HRESULT _ShowTooltip( unsigned int iPad, unsigned int tooltip, bool show ); - HRESULT _SetTooltipsEnabled( unsigned int iPad, bool bA = true, bool bB = true, bool bX = true, bool bY = true, bool bLT = true, bool bRT = true, bool bLB=true, bool bRB = true, bool bLS = true); - HRESULT _RefreshTooltips( unsigned int iPad); - HRESULT _EnableTooltip( unsigned int iPad, unsigned int tooltip, bool enable ); - HRESULT _ShowSavingMessage( unsigned int iPad, C4JStorage::ESavingMessage eVal ); - HRESULT _ShowBackground( unsigned int iPad, BOOL bShow ); - HRESULT _ShowDarkOverlay( unsigned int iPad, BOOL bShow ); - HRESULT _ShowLogo( unsigned int iPad, BOOL bShow ); - HRESULT _ShowPressStart(unsigned int iPad); - HRESULT _UpdateAutosaveCountdownTimer(unsigned int uiSeconds); - HRESULT _ShowAutosaveCountdownTimer(BOOL bVal); - HRESULT _UpdateTrialTimer(unsigned int iPad); - HRESULT _ShowTrialTimer(BOOL bVal); + int _SetTooltipText( unsigned int iPad, unsigned int tooltip, int iTextID ); + int _SetEnableTooltips( unsigned int iPad, bool bVal ); + int _ShowTooltip( unsigned int iPad, unsigned int tooltip, bool show ); + int _SetTooltipsEnabled( unsigned int iPad, bool bA = true, bool bB = true, bool bX = true, bool bY = true, bool bLT = true, bool bRT = true, bool bLB=true, bool bRB = true, bool bLS = true); + int _RefreshTooltips( unsigned int iPad); + int _EnableTooltip( unsigned int iPad, unsigned int tooltip, bool enable ); + int _ShowSavingMessage( unsigned int iPad, C4JStorage::ESavingMessage eVal ); + int _ShowBackground( unsigned int iPad, bool bShow ); + int _ShowDarkOverlay( unsigned int iPad, bool bShow ); + int _ShowLogo( unsigned int iPad, bool bShow ); + int _ShowPressStart(unsigned int iPad); + int _UpdateAutosaveCountdownTimer(unsigned int uiSeconds); + int _ShowAutosaveCountdownTimer(bool bVal); + int _UpdateTrialTimer(unsigned int iPad); + int _ShowTrialTimer(bool bVal); void _ReduceTrialTimerValue(); - HRESULT _HidePressStart(); - HRESULT _ShowSafeArea( BOOL bShow ); - HRESULT _ShowOtherPlayersBaseScene(int iPad, bool show); + int _HidePressStart(); + int _ShowSafeArea( bool bShow ); + int _ShowOtherPlayersBaseScene(int iPad, bool show); bool _PressStartPlaying(unsigned int iPad); - HRESULT _SetPlayerBaseScenePosition( unsigned int iPad, EBaseScenePosition position ); + int _SetPlayerBaseScenePosition( unsigned int iPad, EBaseScenePosition position ); void _UpdateSelectedItemPos( unsigned int iPad); EBaseScenePosition _GetPlayerBasePosition(int iPad); - HRESULT _AnimateKeyPress(DWORD userIndex, DWORD dwKeyCode); + int _AnimateKeyPress(unsigned long userIndex, unsigned long dwKeyCode); HXUIOBJ _GetPlayerBaseScene(int iPad) {return m_BasePlayerScene[iPad].m_hObj;} - HRESULT _PlayUISFX(ESoundEffect eSound); + int _PlayUISFX(ESoundEffect eSound); void _SetEmptyQuadrantLogo(int iPad,EBaseScenePosition ePos); - HRESULT _DisplayGamertag( unsigned int iPad, BOOL bDisplay ); + int _DisplayGamertag( unsigned int iPad, bool bDisplay ); void _SetSelectedItem( unsigned int iPad, const wstring& name); void _HideAllGameUIElements(); bool _GetBaseSceneSafeZone( unsigned int iPad, D3DXVECTOR2 &origin, float &width, float &height); @@ -381,45 +381,45 @@ private: unsigned int m_uiSelectedItemOpacityCountDown[XUSER_MAX_COUNT]; public: - static DWORD m_dwTrialTimerLimitSecs; + static unsigned long m_dwTrialTimerLimitSecs; public: static CXuiSceneBase *GetInstance() { return Instance; } static void TickAllBaseScenes(); - static HRESULT SetTooltipText( unsigned int iPad, unsigned int tooltip, int iTextID ); - static HRESULT SetEnableTooltips( unsigned int iPad, BOOL bVal ); - static HRESULT ShowTooltip( unsigned int iPad, unsigned int tooltip, bool show ); - static HRESULT SetTooltips( unsigned int iPad, int iA, int iB=-1, int iX=-1, int iY=-1 , int iLT=-1, int iRT=-1, int iLB=-1, int iRB=-1, int iLS=-1, bool forceUpdate = false); - static HRESULT RefreshTooltips( unsigned int iPad); - static HRESULT EnableTooltip( unsigned int iPad, unsigned int tooltip, bool enable ); - static HRESULT SetTooltipsEnabled( unsigned int iPad, bool bA = true, bool bB = true, bool bX = true, bool bY = true, bool bLT = true, bool bRT = true, bool bLB = true, bool bRB=true, bool bLS=true); - static HRESULT AnimateKeyPress(DWORD userIndex, DWORD dwKeyCode); - static HRESULT ShowSavingMessage( unsigned int iPad, C4JStorage::ESavingMessage eVal); - static HRESULT ShowBackground( unsigned int iPad, BOOL bShow ); - static HRESULT ShowDarkOverlay( unsigned int iPad, BOOL bShow ); - static HRESULT ShowLogo( unsigned int iPad, BOOL bShow ); - static HRESULT UpdateAutosaveCountdownTimer(unsigned int uiSeconds); - static HRESULT ShowAutosaveCountdownTimer(BOOL bVal); - static HRESULT UpdateTrialTimer(unsigned int iPad); - static HRESULT ShowTrialTimer(BOOL bVal); + static int SetTooltipText( unsigned int iPad, unsigned int tooltip, int iTextID ); + static int SetEnableTooltips( unsigned int iPad, bool bVal ); + static int ShowTooltip( unsigned int iPad, unsigned int tooltip, bool show ); + static int SetTooltips( unsigned int iPad, int iA, int iB=-1, int iX=-1, int iY=-1 , int iLT=-1, int iRT=-1, int iLB=-1, int iRB=-1, int iLS=-1, bool forceUpdate = false); + static int RefreshTooltips( unsigned int iPad); + static int EnableTooltip( unsigned int iPad, unsigned int tooltip, bool enable ); + static int SetTooltipsEnabled( unsigned int iPad, bool bA = true, bool bB = true, bool bX = true, bool bY = true, bool bLT = true, bool bRT = true, bool bLB = true, bool bRB=true, bool bLS=true); + static int AnimateKeyPress(unsigned long userIndex, unsigned long dwKeyCode); + static int ShowSavingMessage( unsigned int iPad, C4JStorage::ESavingMessage eVal); + static int ShowBackground( unsigned int iPad, bool bShow ); + static int ShowDarkOverlay( unsigned int iPad, bool bShow ); + static int ShowLogo( unsigned int iPad, bool bShow ); + static int UpdateAutosaveCountdownTimer(unsigned int uiSeconds); + static int ShowAutosaveCountdownTimer(bool bVal); + static int UpdateTrialTimer(unsigned int iPad); + static int ShowTrialTimer(bool bVal); static void ReduceTrialTimerValue(); - static HRESULT HidePressStart(); - static HRESULT ShowSafeArea( BOOL bShow ); - static HRESULT ShowOtherPlayersBaseScene(int iPad, bool show); + static int HidePressStart(); + static int ShowSafeArea( bool bShow ); + static int ShowOtherPlayersBaseScene(int iPad, bool show); - static HRESULT ShowPressStart(unsigned int iPad); + static int ShowPressStart(unsigned int iPad); static bool PressStartPlaying(unsigned int iPad); - static HRESULT SetPlayerBaseScenePosition( unsigned int iPad, EBaseScenePosition position ); - static HRESULT SetPlayerBasePositions(EBaseScenePosition pad0, EBaseScenePosition pad1, EBaseScenePosition pad2, EBaseScenePosition pad3); - static HRESULT UpdatePlayerBasePositions(); + static int SetPlayerBaseScenePosition( unsigned int iPad, EBaseScenePosition position ); + static int SetPlayerBasePositions(EBaseScenePosition pad0, EBaseScenePosition pad1, EBaseScenePosition pad2, EBaseScenePosition pad3); + static int UpdatePlayerBasePositions(); static EBaseScenePosition GetPlayerBasePosition(int iPad); static void UpdateSelectedItemPos(int iPad); static HXUIOBJ GetPlayerBaseScene(int iPad); - static HRESULT PlayUISFX(ESoundEffect eSound); + static int PlayUISFX(ESoundEffect eSound); static void SetEmptyQuadrantLogo(int iSection); - static HRESULT DisplayGamertag( unsigned int iPad, BOOL bDisplay ); + static int DisplayGamertag( unsigned int iPad, bool bDisplay ); static void SetSelectedItem( unsigned int iPad, const wstring &name); static void HideAllGameUIElements(); diff --git a/src/client/Common/XUI/XUI_Scene_BrewingStand.cpp b/src/client/Common/XUI/XUI_Scene_BrewingStand.cpp index 84e05bd7..bcaff9ce 100644 --- a/src/client/Common/XUI/XUI_Scene_BrewingStand.cpp +++ b/src/client/Common/XUI/XUI_Scene_BrewingStand.cpp @@ -16,7 +16,7 @@ // Name: CXuiSceneBrewingStand::OnInit // Desc: Message handler for XM_INIT //-------------------------------------------------------------------------------------- -HRESULT CXuiSceneBrewingStand::OnInit( XUIMessageInit* pInitData, BOOL& bHandled ) +int CXuiSceneBrewingStand::OnInit( XUIMessageInit* pInitData, bool& bHandled ) { MapChildControls(); @@ -62,7 +62,7 @@ HRESULT CXuiSceneBrewingStand::OnInit( XUIMessageInit* pInitData, BOOL& bHandled return S_OK; } -HRESULT CXuiSceneBrewingStand::OnDestroy() +int CXuiSceneBrewingStand::OnDestroy() { Minecraft *pMinecraft = Minecraft::GetInstance(); diff --git a/src/client/Common/XUI/XUI_Scene_BrewingStand.h b/src/client/Common/XUI/XUI_Scene_BrewingStand.h index 8801a639..f684783f 100644 --- a/src/client/Common/XUI/XUI_Scene_BrewingStand.h +++ b/src/client/Common/XUI/XUI_Scene_BrewingStand.h @@ -52,9 +52,9 @@ protected: END_MAP_CHILD_CONTROLS() END_CONTROL_MAP() - HRESULT OnInit( XUIMessageInit* pInitData, BOOL& bHandled ); - HRESULT OnDestroy(); -// HRESULT OnCustomMessage_Splitscreenplayer(bool bJoining, BOOL& bHandled); + int OnInit( XUIMessageInit* pInitData, bool& bHandled ); + int OnDestroy(); +// int OnCustomMessage_Splitscreenplayer(bool bJoining, bool& bHandled); virtual void InitDataAssociations(int iPad, AbstractContainerMenu *menu, int startIndex = 0); diff --git a/src/client/Common/XUI/XUI_Scene_Container.cpp b/src/client/Common/XUI/XUI_Scene_Container.cpp index ec2fd887..17c8214f 100644 --- a/src/client/Common/XUI/XUI_Scene_Container.cpp +++ b/src/client/Common/XUI/XUI_Scene_Container.cpp @@ -22,7 +22,7 @@ // Name: CXuiSceneContainer::OnInit // Desc: Message handler for XM_INIT //-------------------------------------------------------------------------------------- -HRESULT CXuiSceneContainer::OnInit( XUIMessageInit* pInitData, BOOL& bHandled ) +int CXuiSceneContainer::OnInit( XUIMessageInit* pInitData, bool& bHandled ) { D3DXVECTOR3 vec; MapChildControls(); @@ -90,7 +90,7 @@ HRESULT CXuiSceneContainer::OnInit( XUIMessageInit* pInitData, BOOL& bHandled ) return S_OK; } -HRESULT CXuiSceneContainer::OnDestroy() +int CXuiSceneContainer::OnDestroy() { Minecraft *pMinecraft = Minecraft::GetInstance(); diff --git a/src/client/Common/XUI/XUI_Scene_Container.h b/src/client/Common/XUI/XUI_Scene_Container.h index e3c14d41..fcbadc61 100644 --- a/src/client/Common/XUI/XUI_Scene_Container.h +++ b/src/client/Common/XUI/XUI_Scene_Container.h @@ -41,9 +41,9 @@ protected: END_MAP_CHILD_CONTROLS() END_CONTROL_MAP() - HRESULT OnInit( XUIMessageInit* pInitData, BOOL& bHandled ); - HRESULT OnDestroy(); - //HRESULT OnCustomMessage_Splitscreenplayer(bool bJoining, BOOL& bHandled) { return S_OK;} + int OnInit( XUIMessageInit* pInitData, bool& bHandled ); + int OnDestroy(); + //int OnCustomMessage_Splitscreenplayer(bool bJoining, bool& bHandled) { return S_OK;} virtual void InitDataAssociations(int iPad, AbstractContainerMenu *menu, int startIndex = 0); diff --git a/src/client/Common/XUI/XUI_Scene_CraftingPanel.cpp b/src/client/Common/XUI/XUI_Scene_CraftingPanel.cpp index 25d9af33..a7bc00ce 100644 --- a/src/client/Common/XUI/XUI_Scene_CraftingPanel.cpp +++ b/src/client/Common/XUI/XUI_Scene_CraftingPanel.cpp @@ -34,19 +34,19 @@ CXuiSceneCraftingPanel::CXuiSceneCraftingPanel() // OnInit // ////////////////////////////////////////////////////////////////////////// -HRESULT CXuiSceneCraftingPanel::OnInit( XUIMessageInit* pInitData, BOOL& bHandled ) +int CXuiSceneCraftingPanel::OnInit( XUIMessageInit* pInitData, bool& bHandled ) { m_bIgnoreKeyPresses=true; D3DXVECTOR3 vec; - VOID *pObj; + void *pObj; CraftingPanelScreenInput* pCraftingPanelData = (CraftingPanelScreenInput*)pInitData->pvInitData; m_iContainerType=pCraftingPanelData->iContainerType; m_pPlayer=pCraftingPanelData->player; m_iPad=pCraftingPanelData->iPad; m_bSplitscreen=pCraftingPanelData->bSplitscreen; - HRESULT hr = S_OK; + int hr = S_OK; MapChildControls(); @@ -190,7 +190,7 @@ HRESULT CXuiSceneCraftingPanel::OnInit( XUIMessageInit* pInitData, BOOL& bHandle // OnTransitionEnd // ////////////////////////////////////////////////////////////////////////// -HRESULT CXuiSceneCraftingPanel::OnTransitionEnd( XUIMessageTransition *pTransData, BOOL& bHandled ) +int CXuiSceneCraftingPanel::OnTransitionEnd( XUIMessageTransition *pTransData, bool& bHandled ) { // are we being destroyed? If so, don't do anything if(pTransData->dwTransAction==XUI_TRANSITION_ACTION_DESTROY ) @@ -237,7 +237,7 @@ HRESULT CXuiSceneCraftingPanel::OnTransitionEnd( XUIMessageTransition *pTransDat return S_OK; } -HRESULT CXuiSceneCraftingPanel::OnCustomMessage_InventoryUpdated() +int CXuiSceneCraftingPanel::OnCustomMessage_InventoryUpdated() { // Display the tooltips ui.SetTooltips(m_iPad, IDS_TOOLTIPS_CREATE,IDS_TOOLTIPS_EXIT, IDS_TOOLTIPS_SHOW_INVENTORY,-1,-1,-1,-2, IDS_TOOLTIPS_CHANGE_GROUP); @@ -256,7 +256,7 @@ HRESULT CXuiSceneCraftingPanel::OnCustomMessage_InventoryUpdated() // OnKeyDown // ////////////////////////////////////////////////////////////////////////// -HRESULT CXuiSceneCraftingPanel::OnKeyDown(XUIMessageInput* pInputData, BOOL& bHandled) +int CXuiSceneCraftingPanel::OnKeyDown(XUIMessageInput* pInputData, bool& bHandled) { bHandled = handleKeyDown(pInputData->UserIndex, mapVKToAction(pInputData->dwKeyCode), (pInputData->dwFlags & XUI_INPUT_FLAG_REPEAT) != 0); @@ -331,9 +331,9 @@ int CXuiSceneCraftingPanel::mapVKToAction(int vk) // OnGetSourceImage // ////////////////////////////////////////////////////////////////////////// -HRESULT CXuiSceneCraftingPanel::OnGetSourceImage(XUIMessageGetSourceImage* pData, BOOL& rfHandled) +int CXuiSceneCraftingPanel::OnGetSourceImage(XUIMessageGetSourceImage* pData, bool& rfHandled) { - HRESULT hr = S_OK; + int hr = S_OK; //int iId=pData->iItem; int iId=(pData->iData>>22)&0x1FF; pData->szPath = NULL; @@ -347,7 +347,7 @@ HRESULT CXuiSceneCraftingPanel::OnGetSourceImage(XUIMessageGetSourceImage* pData // OnDestroy // ////////////////////////////////////////////////////////////////////////// -HRESULT CXuiSceneCraftingPanel::OnDestroy() +int CXuiSceneCraftingPanel::OnDestroy() { Minecraft *pMinecraft = Minecraft::GetInstance(); @@ -365,13 +365,13 @@ HRESULT CXuiSceneCraftingPanel::OnDestroy() return S_OK; } -HRESULT CXuiSceneCraftingPanel::OnCustomMessage_Splitscreenplayer(bool bJoining, BOOL& bHandled) +int CXuiSceneCraftingPanel::OnCustomMessage_Splitscreenplayer(bool bJoining, bool& bHandled) { bHandled=true; return app.AdjustSplitscreenScene_PlayerChanged(m_hObj,&m_OriginalPosition,m_iPad,bJoining); } -HRESULT CXuiSceneCraftingPanel::OnTimer(XUIMessageTimer *pData,BOOL& rfHandled) +int CXuiSceneCraftingPanel::OnTimer(XUIMessageTimer *pData,bool& rfHandled) { if(pData->nId==IGNORE_KEYPRESS_TIMERID) { @@ -382,7 +382,7 @@ HRESULT CXuiSceneCraftingPanel::OnTimer(XUIMessageTimer *pData,BOOL& rfHandled) return S_OK; } -HRESULT CXuiSceneCraftingPanel::OnKillFocus(HXUIOBJ hObjGettingFocus, BOOL& bHandled) +int CXuiSceneCraftingPanel::OnKillFocus(HXUIOBJ hObjGettingFocus, bool& bHandled) { return S_OK; } @@ -475,7 +475,7 @@ void CXuiSceneCraftingPanel::setIngredientDescriptionRedBox(int index, bool show m_pCraftIngredientDescA[index]->SetRedBox(show?true:false); } -void CXuiSceneCraftingPanel::setIngredientDescriptionText(int index, LPCWSTR text) +void CXuiSceneCraftingPanel::setIngredientDescriptionText(int index, const wchar_t* text) { m_pCraftIngredientDescA[index]->SetDescription(text); } @@ -490,17 +490,17 @@ void CXuiSceneCraftingPanel::showTabHighlight(int iIndex, bool show) m_hTabGroupA[iIndex].SetShow(show?true:false); } -void CXuiSceneCraftingPanel::setGroupText(LPCWSTR text) +void CXuiSceneCraftingPanel::setGroupText(const wchar_t* text) { m_GroupName.SetText(text); } -void CXuiSceneCraftingPanel::setDescriptionText(LPCWSTR text) +void CXuiSceneCraftingPanel::setDescriptionText(const wchar_t* text) { m_DescriptionText.SetText(text); } -void CXuiSceneCraftingPanel::setItemText(LPCWSTR text) +void CXuiSceneCraftingPanel::setItemText(const wchar_t* text) { m_ItemName.SetText(text); } diff --git a/src/client/Common/XUI/XUI_Scene_CraftingPanel.h b/src/client/Common/XUI/XUI_Scene_CraftingPanel.h index 222e4e93..2fed17be 100644 --- a/src/client/Common/XUI/XUI_Scene_CraftingPanel.h +++ b/src/client/Common/XUI/XUI_Scene_CraftingPanel.h @@ -146,15 +146,15 @@ public: END_MAP_CHILD_CONTROLS() END_CONTROL_MAP() - HRESULT OnInit( XUIMessageInit* pInitData, BOOL& bHandled ); - HRESULT OnKeyDown(XUIMessageInput* pInputData, BOOL& rfHandled); - HRESULT OnTransitionEnd( XUIMessageTransition *pTransData, BOOL& bHandled); - HRESULT OnGetSourceImage(XUIMessageGetSourceImage* pData, BOOL& rfHandled); - HRESULT OnDestroy(); - HRESULT OnCustomMessage_Splitscreenplayer(bool bJoining, BOOL& bHandled); - HRESULT OnTimer(XUIMessageTimer *pData,BOOL& rfHandled); - HRESULT OnKillFocus(HXUIOBJ hObjGettingFocus, BOOL& bHandled); - HRESULT OnCustomMessage_InventoryUpdated(); + int OnInit( XUIMessageInit* pInitData, bool& bHandled ); + int OnKeyDown(XUIMessageInput* pInputData, bool& rfHandled); + int OnTransitionEnd( XUIMessageTransition *pTransData, bool& bHandled); + int OnGetSourceImage(XUIMessageGetSourceImage* pData, bool& rfHandled); + int OnDestroy(); + int OnCustomMessage_Splitscreenplayer(bool bJoining, bool& bHandled); + int OnTimer(XUIMessageTimer *pData,bool& rfHandled); + int OnKillFocus(HXUIOBJ hObjGettingFocus, bool& bHandled); + int OnCustomMessage_InventoryUpdated(); CXuiSceneCraftingPanel(); ~CXuiSceneCraftingPanel() { } @@ -190,12 +190,12 @@ protected: virtual void setIngredientSlotRedBox(int index, bool show); virtual void setIngredientDescriptionItem(int iPad, int index, shared_ptr item); virtual void setIngredientDescriptionRedBox(int index, bool show); - virtual void setIngredientDescriptionText(int index, LPCWSTR text); + virtual void setIngredientDescriptionText(int index, const wchar_t* text); virtual void setShowCraftHSlot(int iIndex, bool show); virtual void showTabHighlight(int iIndex, bool show); - virtual void setGroupText(LPCWSTR text); - virtual void setDescriptionText(LPCWSTR text); - virtual void setItemText(LPCWSTR text); + virtual void setGroupText(const wchar_t* text); + virtual void setDescriptionText(const wchar_t* text); + virtual void setItemText(const wchar_t* text); virtual void scrollDescriptionUp(); virtual void scrollDescriptionDown(); virtual void updateHighlightAndScrollPositions(); diff --git a/src/client/Common/XUI/XUI_Scene_Enchant.cpp b/src/client/Common/XUI/XUI_Scene_Enchant.cpp index 39e6b8e0..5276098b 100644 --- a/src/client/Common/XUI/XUI_Scene_Enchant.cpp +++ b/src/client/Common/XUI/XUI_Scene_Enchant.cpp @@ -21,7 +21,7 @@ // Name: CXuiSceneEnchant::OnInit // Desc: Message handler for XM_INIT //-------------------------------------------------------------------------------------- -HRESULT CXuiSceneEnchant::OnInit( XUIMessageInit *pInitData, BOOL &bHandled ) +int CXuiSceneEnchant::OnInit( XUIMessageInit *pInitData, bool &bHandled ) { D3DXVECTOR3 vec; MapChildControls(); @@ -68,7 +68,7 @@ HRESULT CXuiSceneEnchant::OnInit( XUIMessageInit *pInitData, BOOL &bHandled ) return S_OK; } -HRESULT CXuiSceneEnchant::OnDestroy() +int CXuiSceneEnchant::OnDestroy() { Minecraft *pMinecraft = Minecraft::GetInstance(); diff --git a/src/client/Common/XUI/XUI_Scene_Enchant.h b/src/client/Common/XUI/XUI_Scene_Enchant.h index b7682a1b..11a240e9 100644 --- a/src/client/Common/XUI/XUI_Scene_Enchant.h +++ b/src/client/Common/XUI/XUI_Scene_Enchant.h @@ -66,8 +66,8 @@ protected: END_MAP_CHILD_CONTROLS() END_CONTROL_MAP() - HRESULT OnInit( XUIMessageInit* pInitData, BOOL& bHandled ); - HRESULT OnDestroy(); + int OnInit( XUIMessageInit* pInitData, bool& bHandled ); + int OnDestroy(); virtual void InitDataAssociations(int iPad, AbstractContainerMenu *menu, int startIndex = 0); diff --git a/src/client/Common/XUI/XUI_Scene_Furnace.cpp b/src/client/Common/XUI/XUI_Scene_Furnace.cpp index f325c15c..c09b4df7 100644 --- a/src/client/Common/XUI/XUI_Scene_Furnace.cpp +++ b/src/client/Common/XUI/XUI_Scene_Furnace.cpp @@ -16,7 +16,7 @@ // Name: CXuiSceneFurnace::OnInit // Desc: Message handler for XM_INIT //-------------------------------------------------------------------------------------- -HRESULT CXuiSceneFurnace::OnInit( XUIMessageInit* pInitData, BOOL& bHandled ) +int CXuiSceneFurnace::OnInit( XUIMessageInit* pInitData, bool& bHandled ) { MapChildControls(); @@ -64,7 +64,7 @@ HRESULT CXuiSceneFurnace::OnInit( XUIMessageInit* pInitData, BOOL& bHandled ) return S_OK; } -HRESULT CXuiSceneFurnace::OnDestroy() +int CXuiSceneFurnace::OnDestroy() { Minecraft *pMinecraft = Minecraft::GetInstance(); diff --git a/src/client/Common/XUI/XUI_Scene_Furnace.h b/src/client/Common/XUI/XUI_Scene_Furnace.h index 6f427104..c6db0e12 100644 --- a/src/client/Common/XUI/XUI_Scene_Furnace.h +++ b/src/client/Common/XUI/XUI_Scene_Furnace.h @@ -54,9 +54,9 @@ protected: END_MAP_CHILD_CONTROLS() END_CONTROL_MAP() - HRESULT OnInit( XUIMessageInit* pInitData, BOOL& bHandled ); - HRESULT OnDestroy(); -// HRESULT OnCustomMessage_Splitscreenplayer(bool bJoining, BOOL& bHandled); + int OnInit( XUIMessageInit* pInitData, bool& bHandled ); + int OnDestroy(); +// int OnCustomMessage_Splitscreenplayer(bool bJoining, bool& bHandled); virtual void InitDataAssociations(int iPad, AbstractContainerMenu *menu, int startIndex = 0); diff --git a/src/client/Common/XUI/XUI_Scene_Inventory.cpp b/src/client/Common/XUI/XUI_Scene_Inventory.cpp index 43e3e756..db3c40d9 100644 --- a/src/client/Common/XUI/XUI_Scene_Inventory.cpp +++ b/src/client/Common/XUI/XUI_Scene_Inventory.cpp @@ -16,7 +16,7 @@ // Name: CXuiSceneInventory::OnInit // Desc: Message handler for XM_INIT //-------------------------------------------------------------------------------------- -HRESULT CXuiSceneInventory::OnInit( XUIMessageInit *pInitData, BOOL &bHandled ) +int CXuiSceneInventory::OnInit( XUIMessageInit *pInitData, bool &bHandled ) { D3DXVECTOR3 vec; MapChildControls(); @@ -75,7 +75,7 @@ HRESULT CXuiSceneInventory::OnInit( XUIMessageInit *pInitData, BOOL &bHandled ) return S_OK; } -HRESULT CXuiSceneInventory::OnDestroy() +int CXuiSceneInventory::OnDestroy() { Minecraft *pMinecraft = Minecraft::GetInstance(); @@ -91,7 +91,7 @@ HRESULT CXuiSceneInventory::OnDestroy() return S_OK; } -HRESULT CXuiSceneInventory::handleCustomTimer( XUIMessageTimer *pTimer, BOOL& bHandled ) +int CXuiSceneInventory::handleCustomTimer( XUIMessageTimer *pTimer, bool& bHandled ) { if(pTimer->nId == INVENTORY_UPDATE_EFFECTS_TIMER_ID) { diff --git a/src/client/Common/XUI/XUI_Scene_Inventory.h b/src/client/Common/XUI/XUI_Scene_Inventory.h index 129d35df..f2636bc1 100644 --- a/src/client/Common/XUI/XUI_Scene_Inventory.h +++ b/src/client/Common/XUI/XUI_Scene_Inventory.h @@ -62,13 +62,13 @@ protected: END_MAP_CHILD_CONTROLS() END_CONTROL_MAP() - HRESULT OnInit( XUIMessageInit* pInitData, BOOL& bHandled ); - HRESULT OnDestroy(); - //HRESULT OnCustomMessage_Splitscreenplayer(bool bJoining, BOOL& bHandled) {return S_OK;} + int OnInit( XUIMessageInit* pInitData, bool& bHandled ); + int OnDestroy(); + //int OnCustomMessage_Splitscreenplayer(bool bJoining, bool& bHandled) {return S_OK;} virtual void InitDataAssociations(int iPad, AbstractContainerMenu *menu, int startIndex = 0); - virtual HRESULT handleCustomTimer( XUIMessageTimer *pTimer, BOOL& bHandled ); + virtual int handleCustomTimer( XUIMessageTimer *pTimer, bool& bHandled ); private: float m_effectDisplayHeight; diff --git a/src/client/Common/XUI/XUI_Scene_Inventory_Creative.cpp b/src/client/Common/XUI/XUI_Scene_Inventory_Creative.cpp index 44ca24de..80258466 100644 --- a/src/client/Common/XUI/XUI_Scene_Inventory_Creative.cpp +++ b/src/client/Common/XUI/XUI_Scene_Inventory_Creative.cpp @@ -26,7 +26,7 @@ // Name: CXuiSceneInventoryCreative::OnInit // Desc: Message handler for XM_INIT //-------------------------------------------------------------------------------------- -HRESULT CXuiSceneInventoryCreative::OnInit( XUIMessageInit *pInitData, BOOL &bHandled ) +int CXuiSceneInventoryCreative::OnInit( XUIMessageInit *pInitData, bool &bHandled ) { D3DXVECTOR3 vec; MapChildControls(); @@ -90,7 +90,7 @@ HRESULT CXuiSceneInventoryCreative::OnInit( XUIMessageInit *pInitData, BOOL &bHa return S_OK; } -HRESULT CXuiSceneInventoryCreative::OnDestroy() +int CXuiSceneInventoryCreative::OnDestroy() { Minecraft *pMinecraft = Minecraft::GetInstance(); @@ -113,7 +113,7 @@ HRESULT CXuiSceneInventoryCreative::OnDestroy() // OnTransitionEnd // ////////////////////////////////////////////////////////////////////////// -HRESULT CXuiSceneInventoryCreative::OnTransitionEnd( XUIMessageTransition *pTransData, BOOL& bHandled ) +int CXuiSceneInventoryCreative::OnTransitionEnd( XUIMessageTransition *pTransData, bool& bHandled ) { // are we being destroyed? If so, don't do anything if(pTransData->dwTransAction==XUI_TRANSITION_ACTION_DESTROY ) diff --git a/src/client/Common/XUI/XUI_Scene_Inventory_Creative.h b/src/client/Common/XUI/XUI_Scene_Inventory_Creative.h index 1094de91..455071e8 100644 --- a/src/client/Common/XUI/XUI_Scene_Inventory_Creative.h +++ b/src/client/Common/XUI/XUI_Scene_Inventory_Creative.h @@ -84,10 +84,10 @@ protected: END_MAP_CHILD_CONTROLS() END_CONTROL_MAP() - HRESULT OnInit( XUIMessageInit* pInitData, BOOL& bHandled ); - HRESULT OnDestroy(); - HRESULT OnTransitionEnd( XUIMessageTransition *pTransData, BOOL& bHandled); - //HRESULT OnCustomMessage_Splitscreenplayer(bool bJoining, BOOL& bHandled) {return S_OK;} + int OnInit( XUIMessageInit* pInitData, bool& bHandled ); + int OnDestroy(); + int OnTransitionEnd( XUIMessageTransition *pTransData, bool& bHandled); + //int OnCustomMessage_Splitscreenplayer(bool bJoining, bool& bHandled) {return S_OK;} private: CXuiControl m_sceneGroup; diff --git a/src/client/Common/XUI/XUI_Scene_Trading.cpp b/src/client/Common/XUI/XUI_Scene_Trading.cpp index db6a3e63..17ee6389 100644 --- a/src/client/Common/XUI/XUI_Scene_Trading.cpp +++ b/src/client/Common/XUI/XUI_Scene_Trading.cpp @@ -16,7 +16,7 @@ // Name: CXuiSceneTrading::OnInit // Desc: Message handler for XM_INIT //-------------------------------------------------------------------------------------- -HRESULT CXuiSceneTrading::OnInit( XUIMessageInit* pInitData, BOOL& bHandled ) +int CXuiSceneTrading::OnInit( XUIMessageInit* pInitData, bool& bHandled ) { MapChildControls(); @@ -75,7 +75,7 @@ HRESULT CXuiSceneTrading::OnInit( XUIMessageInit* pInitData, BOOL& bHandled ) return S_OK; } -HRESULT CXuiSceneTrading::OnDestroy() +int CXuiSceneTrading::OnDestroy() { Minecraft *pMinecraft = Minecraft::GetInstance(); @@ -91,14 +91,14 @@ HRESULT CXuiSceneTrading::OnDestroy() return S_OK; } -HRESULT CXuiSceneTrading::OnTransitionStart( XUIMessageTransition *pTransition, BOOL& bHandled ) +int CXuiSceneTrading::OnTransitionStart( XUIMessageTransition *pTransition, bool& bHandled ) { if(pTransition->dwTransAction==XUI_TRANSITION_ACTION_DESTROY ) return S_OK; if(pTransition->dwTransType == XUI_TRANSITION_TO || pTransition->dwTransType == XUI_TRANSITION_BACKTO) { HXUIOBJ hObj=NULL; - HRESULT hr=XuiControlGetVisual(m_offerInfoControl.m_hObj,&hObj); + int hr=XuiControlGetVisual(m_offerInfoControl.m_hObj,&hObj); hr=XuiElementGetChildById(hObj,L"text_measurer",&m_hOfferInfoTextMeasurer); hr=XuiElementGetChildById(hObj,L"text_name",&m_hOfferInfoText); hr=XuiElementGetChildById(hObj,L"text_panel",&m_hOfferInfoTextBkg); @@ -107,20 +107,20 @@ HRESULT CXuiSceneTrading::OnTransitionStart( XUIMessageTransition *pTransition, return S_OK; } -HRESULT CXuiSceneTrading::OnKeyDown(XUIMessageInput *pInputData, BOOL& bHandled) +int CXuiSceneTrading::OnKeyDown(XUIMessageInput *pInputData, bool& bHandled) { bHandled = handleKeyDown(pInputData->UserIndex, mapVKToAction(pInputData->dwKeyCode), (pInputData->dwFlags & XUI_INPUT_FLAG_REPEAT) != 0); return S_OK; } -HRESULT CXuiSceneTrading::OnCustomMessage_Splitscreenplayer(bool bJoining, BOOL& bHandled) +int CXuiSceneTrading::OnCustomMessage_Splitscreenplayer(bool bJoining, bool& bHandled) { bHandled=true; return app.AdjustSplitscreenScene_PlayerChanged(m_hObj,&m_OriginalPosition,m_iPad,bJoining); } -HRESULT CXuiSceneTrading::OnTimer( XUIMessageTimer *pTimer, BOOL& bHandled ) +int CXuiSceneTrading::OnTimer( XUIMessageTimer *pTimer, bool& bHandled ) { if(pTimer->nId == TRADING_UPDATE_TIMER_ID) { @@ -273,7 +273,7 @@ void CXuiSceneTrading::setOfferDescription(const wstring &name, vector wstring desc = L"(smallPointer ? 12 :14) + L"\">" + name + L""; XUIRect tempXuiRect, xuiRect; - HRESULT hr; + int hr; xuiRect.right = 0; for(AUTO_VAR(it, unformattedStrings.begin()); it != unformattedStrings.end(); ++it) diff --git a/src/client/Common/XUI/XUI_Scene_Trading.h b/src/client/Common/XUI/XUI_Scene_Trading.h index 5f7f9999..54615d71 100644 --- a/src/client/Common/XUI/XUI_Scene_Trading.h +++ b/src/client/Common/XUI/XUI_Scene_Trading.h @@ -86,12 +86,12 @@ protected: END_MAP_CHILD_CONTROLS() END_CONTROL_MAP() - HRESULT OnInit( XUIMessageInit* pInitData, BOOL& bHandled ); - HRESULT OnKeyDown(XUIMessageInput* pInputData, BOOL& rfHandled); - HRESULT OnDestroy(); - HRESULT OnTimer( XUIMessageTimer *pTimer, BOOL& bHandled ); - HRESULT OnCustomMessage_Splitscreenplayer(bool bJoining, BOOL& bHandled); - HRESULT OnTransitionStart( XUIMessageTransition *pTransition, BOOL& bHandled ); + int OnInit( XUIMessageInit* pInitData, bool& bHandled ); + int OnKeyDown(XUIMessageInput* pInputData, bool& rfHandled); + int OnDestroy(); + int OnTimer( XUIMessageTimer *pTimer, bool& bHandled ); + int OnCustomMessage_Splitscreenplayer(bool bJoining, bool& bHandled); + int OnTransitionStart( XUIMessageTransition *pTransition, bool& bHandled ); protected: int m_iPad; diff --git a/src/client/Common/XUI/XUI_Scene_Trap.cpp b/src/client/Common/XUI/XUI_Scene_Trap.cpp index 01801c68..e2dabf0b 100644 --- a/src/client/Common/XUI/XUI_Scene_Trap.cpp +++ b/src/client/Common/XUI/XUI_Scene_Trap.cpp @@ -13,7 +13,7 @@ // Name: CXuiSceneTrap::OnInit // Desc: Message handler for XM_INIT //-------------------------------------------------------------------------------------- -HRESULT CXuiSceneTrap::OnInit( XUIMessageInit* pInitData, BOOL& bHandled ) +int CXuiSceneTrap::OnInit( XUIMessageInit* pInitData, bool& bHandled ) { D3DXVECTOR3 vec; MapChildControls(); @@ -52,7 +52,7 @@ HRESULT CXuiSceneTrap::OnInit( XUIMessageInit* pInitData, BOOL& bHandled ) return S_OK; } -HRESULT CXuiSceneTrap::OnDestroy() +int CXuiSceneTrap::OnDestroy() { Minecraft *pMinecraft = Minecraft::GetInstance(); diff --git a/src/client/Common/XUI/XUI_Scene_Trap.h b/src/client/Common/XUI/XUI_Scene_Trap.h index e85aea2f..449b44dc 100644 --- a/src/client/Common/XUI/XUI_Scene_Trap.h +++ b/src/client/Common/XUI/XUI_Scene_Trap.h @@ -46,9 +46,9 @@ protected: END_MAP_CHILD_CONTROLS() END_CONTROL_MAP() - HRESULT OnInit( XUIMessageInit* pInitData, BOOL& bHandled ); - HRESULT OnDestroy(); - //HRESULT OnCustomMessage_Splitscreenplayer(bool bJoining, BOOL& bHandled) {return S_OK;} + int OnInit( XUIMessageInit* pInitData, bool& bHandled ); + int OnDestroy(); + //int OnCustomMessage_Splitscreenplayer(bool bJoining, bool& bHandled) {return S_OK;} virtual void InitDataAssociations(int iPad, AbstractContainerMenu *menu, int startIndex = 0); private: diff --git a/src/client/Common/XUI/XUI_Scene_Win.cpp b/src/client/Common/XUI/XUI_Scene_Win.cpp index db03b6c9..a46d4454 100644 --- a/src/client/Common/XUI/XUI_Scene_Win.cpp +++ b/src/client/Common/XUI/XUI_Scene_Win.cpp @@ -11,7 +11,7 @@ #include "MultiplayerLocalPlayer.h" #include "XUI_Scene_Win.h" -BYTE CScene_Win::s_winUserIndex = 0; +uint8_t CScene_Win::s_winUserIndex = 0; const float CScene_Win::AUTO_SCROLL_SPEED = 1.0f; const float CScene_Win::PLAYER_SCROLL_SPEED = 3.0f; @@ -19,7 +19,7 @@ const float CScene_Win::PLAYER_SCROLL_SPEED = 3.0f; //---------------------------------------------------------------------------------- // Performs initialization tasks - retrieves controls. //---------------------------------------------------------------------------------- -HRESULT CScene_Win::OnInit( XUIMessageInit* pInitData, BOOL& bHandled ) +int CScene_Win::OnInit( XUIMessageInit* pInitData, bool& bHandled ) { m_iPad = *(int *)pInitData->pvInitData; @@ -86,7 +86,7 @@ HRESULT CScene_Win::OnInit( XUIMessageInit* pInitData, BOOL& bHandled ) //wcout << result.c_str(); m_scrollDir = 1; - HRESULT hr = XuiHtmlControlSetSmoothScroll(m_htmlControl.m_hObj, XUI_SMOOTHSCROLL_VERTICAL,true,AUTO_SCROLL_SPEED,1.0f,AUTO_SCROLL_SPEED); + int hr = XuiHtmlControlSetSmoothScroll(m_htmlControl.m_hObj, XUI_SMOOTHSCROLL_VERTICAL,true,AUTO_SCROLL_SPEED,1.0f,AUTO_SCROLL_SPEED); XuiHtmlControlVScrollBy(m_htmlControl.m_hObj,m_scrollDir * 1000); SetTimer(0,200); @@ -94,7 +94,7 @@ HRESULT CScene_Win::OnInit( XUIMessageInit* pInitData, BOOL& bHandled ) return S_OK; } -HRESULT CScene_Win::OnTimer( XUIMessageTimer *pXUIMessageTimer, BOOL &bHandled) +int CScene_Win::OnTimer( XUIMessageTimer *pXUIMessageTimer, bool &bHandled) { if(!TreeHasFocus()) return S_OK; @@ -104,7 +104,7 @@ HRESULT CScene_Win::OnTimer( XUIMessageTimer *pXUIMessageTimer, BOOL &bHandled) updateNoise(); XUIHtmlScrollInfo scrollInfo; - HRESULT hr = m_htmlControl.GetVScrollInfo(&scrollInfo); + int hr = m_htmlControl.GetVScrollInfo(&scrollInfo); m_htmlControl.SetText(noiseString.c_str()); //wcout << noiseString.c_str(); //hr = m_htmlControl.SetVScrollPos(scrollInfo.nPos+2); @@ -115,7 +115,7 @@ HRESULT CScene_Win::OnTimer( XUIMessageTimer *pXUIMessageTimer, BOOL &bHandled) return S_OK; } -HRESULT CScene_Win::OnKeyDown(XUIMessageInput* pInputData, BOOL& rfHandled) +int CScene_Win::OnKeyDown(XUIMessageInput* pInputData, bool& rfHandled) { if(m_bIgnoreInput) return S_OK; @@ -156,7 +156,7 @@ HRESULT CScene_Win::OnKeyDown(XUIMessageInput* pInputData, BOOL& rfHandled) case VK_PAD_RTHUMB_DOWN: case VK_PAD_LTHUMB_DOWN: { - HRESULT hr = XuiHtmlControlSetSmoothScroll(m_htmlControl.m_hObj, XUI_SMOOTHSCROLL_VERTICAL,true,AUTO_SCROLL_SPEED,1.0f,PLAYER_SCROLL_SPEED); + int hr = XuiHtmlControlSetSmoothScroll(m_htmlControl.m_hObj, XUI_SMOOTHSCROLL_VERTICAL,true,AUTO_SCROLL_SPEED,1.0f,PLAYER_SCROLL_SPEED); } break; } @@ -164,7 +164,7 @@ HRESULT CScene_Win::OnKeyDown(XUIMessageInput* pInputData, BOOL& rfHandled) return S_OK; } -HRESULT CScene_Win::OnKeyUp(XUIMessageInput* pInputData, BOOL& rfHandled) +int CScene_Win::OnKeyUp(XUIMessageInput* pInputData, bool& rfHandled) { if(m_bIgnoreInput) return S_OK; @@ -176,7 +176,7 @@ HRESULT CScene_Win::OnKeyUp(XUIMessageInput* pInputData, BOOL& rfHandled) case VK_PAD_LTHUMB_DOWN: { m_scrollDir = 1; - HRESULT hr = XuiHtmlControlSetSmoothScroll(m_htmlControl.m_hObj, XUI_SMOOTHSCROLL_VERTICAL,true,AUTO_SCROLL_SPEED,1.0f,AUTO_SCROLL_SPEED); + int hr = XuiHtmlControlSetSmoothScroll(m_htmlControl.m_hObj, XUI_SMOOTHSCROLL_VERTICAL,true,AUTO_SCROLL_SPEED,1.0f,AUTO_SCROLL_SPEED); } break; } @@ -184,7 +184,7 @@ HRESULT CScene_Win::OnKeyUp(XUIMessageInput* pInputData, BOOL& rfHandled) return S_OK; } -HRESULT CScene_Win::OnCustomMessage_Splitscreenplayer(bool bJoining, BOOL& bHandled) +int CScene_Win::OnCustomMessage_Splitscreenplayer(bool bJoining, bool& bHandled) { bHandled=true; return app.AdjustSplitscreenScene_PlayerChanged(m_hObj,&m_OriginalPosition,m_iPad,bJoining); @@ -266,7 +266,7 @@ void CScene_Win::updateNoise() } } -HRESULT CScene_Win::OnNavReturn(HXUIOBJ hObj,BOOL& rfHandled) +int CScene_Win::OnNavReturn(HXUIOBJ hObj,bool& rfHandled) { SetTimer(0,200); @@ -290,11 +290,11 @@ HRESULT CScene_Win::OnNavReturn(HXUIOBJ hObj,BOOL& rfHandled) return S_OK; } -HRESULT CScene_Win::OnNavForward(XUIMessageNavForward *pNavForwardData, BOOL& bHandled) +int CScene_Win::OnNavForward(XUIMessageNavForward *pNavForwardData, bool& bHandled) { XuiHtmlControlVScrollBy(m_htmlControl.m_hObj,0); XUIHtmlScrollInfo scrollInfo; - HRESULT hr = m_htmlControl.GetVScrollInfo(&scrollInfo); + int hr = m_htmlControl.GetVScrollInfo(&scrollInfo); hr = m_htmlControl.SetVScrollPos(scrollInfo.nPos); KillTimer(0); diff --git a/src/client/Common/XUI/XUI_Scene_Win.h b/src/client/Common/XUI/XUI_Scene_Win.h index 7a5e9da0..53353e48 100644 --- a/src/client/Common/XUI/XUI_Scene_Win.h +++ b/src/client/Common/XUI/XUI_Scene_Win.h @@ -27,13 +27,13 @@ protected: MAP_CONTROL(IDC_HtmlControl, m_htmlControl) END_CONTROL_MAP() - HRESULT OnInit( XUIMessageInit* pInitData, BOOL& bHandled ); - HRESULT OnTimer( XUIMessageTimer *pXUIMessageTimer, BOOL &bHandled); - HRESULT OnKeyDown(XUIMessageInput* pInputData, BOOL& rfHandled); - HRESULT OnKeyUp(XUIMessageInput* pInputData, BOOL& rfHandled); - HRESULT OnCustomMessage_Splitscreenplayer(bool bJoining, BOOL& bHandled); - HRESULT OnNavReturn(HXUIOBJ hObj,BOOL& rfHandled); - HRESULT OnNavForward(XUIMessageNavForward *pNavForwardData, BOOL& bHandled); + int OnInit( XUIMessageInit* pInitData, bool& bHandled ); + int OnTimer( XUIMessageTimer *pXUIMessageTimer, bool &bHandled); + int OnKeyDown(XUIMessageInput* pInputData, bool& rfHandled); + int OnKeyUp(XUIMessageInput* pInputData, bool& rfHandled); + int OnCustomMessage_Splitscreenplayer(bool bJoining, bool& bHandled); + int OnNavReturn(HXUIOBJ hObj,bool& rfHandled); + int OnNavForward(XUIMessageNavForward *pNavForwardData, bool& bHandled); public: // Define the class. The class name must match the ClassOverride property @@ -53,6 +53,6 @@ private: void updateNoise(); public: - static BYTE s_winUserIndex; - static void setWinUserIndex(BYTE winUserIndex) { s_winUserIndex = winUserIndex; } + static uint8_t s_winUserIndex; + static void setWinUserIndex(uint8_t winUserIndex) { s_winUserIndex = winUserIndex; } }; \ No newline at end of file diff --git a/src/client/Common/XUI/XUI_SettingsAll.cpp b/src/client/Common/XUI/XUI_SettingsAll.cpp index ac69b01f..c1611352 100644 --- a/src/client/Common/XUI/XUI_SettingsAll.cpp +++ b/src/client/Common/XUI/XUI_SettingsAll.cpp @@ -7,9 +7,9 @@ //---------------------------------------------------------------------------------- // Performs initialization tasks - retrieves controls. //---------------------------------------------------------------------------------- -HRESULT CScene_SettingsAll::OnInit( XUIMessageInit* pInitData, BOOL& bHandled ) +int CScene_SettingsAll::OnInit( XUIMessageInit* pInitData, bool& bHandled ) { - //WCHAR TempString[256]; + //wchar_t TempString[256]; m_iPad=*(int *)pInitData->pvInitData; // if we're not in the game, we need to use basescene 0 bool bNotInGame=(Minecraft::GetInstance()->level==NULL); @@ -83,11 +83,11 @@ HRESULT CScene_SettingsAll::OnInit( XUIMessageInit* pInitData, BOOL& bHandled ) -HRESULT CScene_SettingsAll::OnKeyDown(XUIMessageInput* pInputData, BOOL& rfHandled) +int CScene_SettingsAll::OnKeyDown(XUIMessageInput* pInputData, bool& rfHandled) { ui.AnimateKeyPress(pInputData->UserIndex, pInputData->dwKeyCode); - HRESULT hr=S_OK; + int hr=S_OK; // Explicitly handle B button presses switch(pInputData->dwKeyCode) @@ -107,7 +107,7 @@ HRESULT CScene_SettingsAll::OnKeyDown(XUIMessageInput* pInputData, BOOL& rfHandl return hr; } -HRESULT CScene_SettingsAll::OnControlNavigate(XUIMessageControlNavigate *pControlNavigateData, BOOL& bHandled) +int CScene_SettingsAll::OnControlNavigate(XUIMessageControlNavigate *pControlNavigateData, bool& bHandled) { // added so we can skip greyed out items pControlNavigateData->hObjDest=XuiControlGetNavigation(pControlNavigateData->hObjSource,pControlNavigateData->nControlNavigate,true,true); @@ -120,9 +120,9 @@ HRESULT CScene_SettingsAll::OnControlNavigate(XUIMessageControlNavigate *pContro return S_OK; } -HRESULT CScene_SettingsAll::OnTransitionStart( XUIMessageTransition *pTransition, BOOL& bHandled ) +int CScene_SettingsAll::OnTransitionStart( XUIMessageTransition *pTransition, bool& bHandled ) { - //HRESULT hr; + //int hr; if(pTransition->dwTransAction==XUI_TRANSITION_ACTION_DESTROY ) return S_OK; if(pTransition->dwTransType == XUI_TRANSITION_TO || pTransition->dwTransType == XUI_TRANSITION_BACKTO) @@ -136,7 +136,7 @@ HRESULT CScene_SettingsAll::OnTransitionStart( XUIMessageTransition *pTransition //---------------------------------------------------------------------------------- // Handler for the button press message. //---------------------------------------------------------------------------------- -HRESULT CScene_SettingsAll::OnNotifyPressEx(HXUIOBJ hObjPressed, XUINotifyPress* pNotifyPressData, BOOL& rfHandled) +int CScene_SettingsAll::OnNotifyPressEx(HXUIOBJ hObjPressed, XUINotifyPress* pNotifyPressData, bool& rfHandled) { // This assumes all buttons can only be pressed with the A button ui.AnimateKeyPress(pNotifyPressData->UserIndex, VK_PAD_A); @@ -165,7 +165,7 @@ HRESULT CScene_SettingsAll::OnNotifyPressEx(HXUIOBJ hObjPressed, XUINotifyPress* case BUTTON_ALL_RESETTODEFAULTS: { // check they really want to do this - UINT uiIDA[2]; + unsigned int uiIDA[2]; uiIDA[0]=IDS_CONFIRM_CANCEL; uiIDA[1]=IDS_CONFIRM_OK; @@ -179,7 +179,7 @@ HRESULT CScene_SettingsAll::OnNotifyPressEx(HXUIOBJ hObjPressed, XUINotifyPress* return S_OK; } -HRESULT CScene_SettingsAll::OnNavReturn(HXUIOBJ hObj,BOOL& rfHandled) +int CScene_SettingsAll::OnNavReturn(HXUIOBJ hObj,bool& rfHandled) { bool bNotInGame=(Minecraft::GetInstance()->level==NULL); @@ -205,7 +205,7 @@ HRESULT CScene_SettingsAll::OnNavReturn(HXUIOBJ hObj,BOOL& rfHandled) return S_OK; } -HRESULT CScene_SettingsAll::OnCustomMessage_Splitscreenplayer(bool bJoining, BOOL& bHandled) +int CScene_SettingsAll::OnCustomMessage_Splitscreenplayer(bool bJoining, bool& bHandled) { bHandled=true; return app.AdjustSplitscreenScene_PlayerChanged(m_hObj,&m_OriginalPosition,m_iPad,bJoining); diff --git a/src/client/Common/XUI/XUI_SettingsAll.h b/src/client/Common/XUI/XUI_SettingsAll.h index 217f6c73..179dfc79 100644 --- a/src/client/Common/XUI/XUI_SettingsAll.h +++ b/src/client/Common/XUI/XUI_SettingsAll.h @@ -38,13 +38,13 @@ protected: MAP_CONTROL(IDC_XuiButtonResetToDefaults, m_Buttons[BUTTON_ALL_RESETTODEFAULTS]) END_CONTROL_MAP() - HRESULT OnInit( XUIMessageInit* pInitData, BOOL& bHandled ); - HRESULT OnNotifyPressEx(HXUIOBJ hObjPressed, XUINotifyPress* pNotifyPressData,BOOL& rfHandled); - HRESULT OnKeyDown(XUIMessageInput *pInputData, BOOL& bHandled); - HRESULT OnControlNavigate(XUIMessageControlNavigate *pControlNavigateData, BOOL& bHandled); - HRESULT OnTransitionStart( XUIMessageTransition *pTransition, BOOL& bHandled ); - HRESULT OnCustomMessage_Splitscreenplayer(bool bJoining, BOOL& bHandled); - HRESULT OnNavReturn(HXUIOBJ hObj,BOOL& rfHandled); + int OnInit( XUIMessageInit* pInitData, bool& bHandled ); + int OnNotifyPressEx(HXUIOBJ hObjPressed, XUINotifyPress* pNotifyPressData,bool& rfHandled); + int OnKeyDown(XUIMessageInput *pInputData, bool& bHandled); + int OnControlNavigate(XUIMessageControlNavigate *pControlNavigateData, bool& bHandled); + int OnTransitionStart( XUIMessageTransition *pTransition, bool& bHandled ); + int OnCustomMessage_Splitscreenplayer(bool bJoining, bool& bHandled); + int OnNavReturn(HXUIOBJ hObj,bool& rfHandled); static int ResetDefaultsDialogReturned(void *pParam,int iPad,C4JStorage::EMessageResult result); int m_iPad; diff --git a/src/client/Common/XUI/XUI_SettingsAudio.cpp b/src/client/Common/XUI/XUI_SettingsAudio.cpp index 3f724243..c806bc3a 100644 --- a/src/client/Common/XUI/XUI_SettingsAudio.cpp +++ b/src/client/Common/XUI/XUI_SettingsAudio.cpp @@ -4,9 +4,9 @@ //---------------------------------------------------------------------------------- // Performs initialization tasks - retrieves controls. //---------------------------------------------------------------------------------- -HRESULT CScene_SettingsAudio::OnInit( XUIMessageInit* pInitData, BOOL& bHandled ) +int CScene_SettingsAudio::OnInit( XUIMessageInit* pInitData, bool& bHandled ) { - WCHAR TempString[256]; + wchar_t TempString[256]; m_iPad=*(int *)pInitData->pvInitData; // if we're not in the game, we need to use basescene 0 bool bNotInGame=(Minecraft::GetInstance()->level==NULL); @@ -14,15 +14,15 @@ HRESULT CScene_SettingsAudio::OnInit( XUIMessageInit* pInitData, BOOL& bHandled MapChildControls(); // Display the tooltips - HRESULT hr = S_OK; + int hr = S_OK; HXUIOBJ hSlider; m_SliderA[SLIDER_SETTINGS_MUSIC].SetValue(app.GetGameSettings(m_iPad,eGameSetting_MusicVolume)); - swprintf( (WCHAR *)TempString, 256, L"%ls: %d%%", app.GetString( IDS_SLIDER_MUSIC ),app.GetGameSettings(m_iPad,eGameSetting_MusicVolume)); + swprintf( (wchar_t *)TempString, 256, L"%ls: %d%%", app.GetString( IDS_SLIDER_MUSIC ),app.GetGameSettings(m_iPad,eGameSetting_MusicVolume)); m_SliderA[SLIDER_SETTINGS_MUSIC].SetText(TempString); m_SliderA[SLIDER_SETTINGS_SOUND].SetValue(app.GetGameSettings(m_iPad,eGameSetting_SoundFXVolume)); - swprintf( (WCHAR *)TempString, 256, L"%ls: %d%%", app.GetString( IDS_SLIDER_SOUND ),app.GetGameSettings(m_iPad,eGameSetting_SoundFXVolume)); + swprintf( (wchar_t *)TempString, 256, L"%ls: %d%%", app.GetString( IDS_SLIDER_SOUND ),app.GetGameSettings(m_iPad,eGameSetting_SoundFXVolume)); m_SliderA[SLIDER_SETTINGS_SOUND].SetText(TempString); // only the primary player gets to change the music and sound settings @@ -79,20 +79,20 @@ HRESULT CScene_SettingsAudio::OnInit( XUIMessageInit* pInitData, BOOL& bHandled return S_OK; } -HRESULT CScene_SettingsAudio::OnNotifyValueChanged( HXUIOBJ hObjSource, XUINotifyValueChanged* pNotifyValueChanged, BOOL& bHandled ) +int CScene_SettingsAudio::OnNotifyValueChanged( HXUIOBJ hObjSource, XUINotifyValueChanged* pNotifyValueChanged, bool& bHandled ) { - WCHAR TempString[256]; + wchar_t TempString[256]; if(hObjSource==m_SliderA[SLIDER_SETTINGS_MUSIC].GetSlider() ) { app.SetGameSettings(m_iPad,eGameSetting_MusicVolume,pNotifyValueChanged->nValue); - swprintf( (WCHAR *)TempString, 256, L"%ls: %d%%", app.GetString( IDS_SLIDER_MUSIC ),pNotifyValueChanged->nValue); + swprintf( (wchar_t *)TempString, 256, L"%ls: %d%%", app.GetString( IDS_SLIDER_MUSIC ),pNotifyValueChanged->nValue); m_SliderA[SLIDER_SETTINGS_MUSIC].SetText(TempString); } else if(hObjSource==m_SliderA[SLIDER_SETTINGS_SOUND].GetSlider() ) { app.SetGameSettings(m_iPad,eGameSetting_SoundFXVolume,pNotifyValueChanged->nValue); - swprintf( (WCHAR *)TempString, 256, L"%ls: %d%%", app.GetString( IDS_SLIDER_SOUND ),pNotifyValueChanged->nValue); + swprintf( (wchar_t *)TempString, 256, L"%ls: %d%%", app.GetString( IDS_SLIDER_SOUND ),pNotifyValueChanged->nValue); m_SliderA[SLIDER_SETTINGS_SOUND].SetText(TempString); } @@ -101,11 +101,11 @@ HRESULT CScene_SettingsAudio::OnNotifyValueChanged( HXUIOBJ hObjSource, XUINotif } -HRESULT CScene_SettingsAudio::OnKeyDown(XUIMessageInput* pInputData, BOOL& rfHandled) +int CScene_SettingsAudio::OnKeyDown(XUIMessageInput* pInputData, bool& rfHandled) { ui.AnimateKeyPress(pInputData->UserIndex, pInputData->dwKeyCode); - HRESULT hr=S_OK; + int hr=S_OK; // Explicitly handle B button presses switch(pInputData->dwKeyCode) @@ -128,7 +128,7 @@ HRESULT CScene_SettingsAudio::OnKeyDown(XUIMessageInput* pInputData, BOOL& rfHan //---------------------------------------------------------------------------------- // Handler for the button press message. //---------------------------------------------------------------------------------- -HRESULT CScene_SettingsAudio::OnNotifyPressEx(HXUIOBJ hObjPressed, XUINotifyPress* pNotifyPressData, BOOL& rfHandled) +int CScene_SettingsAudio::OnNotifyPressEx(HXUIOBJ hObjPressed, XUINotifyPress* pNotifyPressData, bool& rfHandled) { // This assumes all buttons can only be pressed with the A button ui.AnimateKeyPress(pNotifyPressData->UserIndex, VK_PAD_A); @@ -136,7 +136,7 @@ HRESULT CScene_SettingsAudio::OnNotifyPressEx(HXUIOBJ hObjPressed, XUINotifyPres return S_OK; } -HRESULT CScene_SettingsAudio::OnControlNavigate(XUIMessageControlNavigate *pControlNavigateData, BOOL& bHandled) +int CScene_SettingsAudio::OnControlNavigate(XUIMessageControlNavigate *pControlNavigateData, bool& bHandled) { // added so we can skip greyed out items pControlNavigateData->hObjDest=XuiControlGetNavigation(pControlNavigateData->hObjSource,pControlNavigateData->nControlNavigate,true,true); @@ -149,10 +149,10 @@ HRESULT CScene_SettingsAudio::OnControlNavigate(XUIMessageControlNavigate *pCont return S_OK; } -HRESULT CScene_SettingsAudio::OnTransitionStart( XUIMessageTransition *pTransition, BOOL& bHandled ) +int CScene_SettingsAudio::OnTransitionStart( XUIMessageTransition *pTransition, bool& bHandled ) { - HRESULT hr; - WCHAR TempString[256]; + int hr; + wchar_t TempString[256]; if(pTransition->dwTransAction==XUI_TRANSITION_ACTION_DESTROY ) return S_OK; if(pTransition->dwTransType == XUI_TRANSITION_TO || pTransition->dwTransType == XUI_TRANSITION_BACKTO) @@ -184,10 +184,10 @@ HRESULT CScene_SettingsAudio::OnTransitionStart( XUIMessageTransition *pTransiti switch(i) { case SLIDER_SETTINGS_MUSIC: // 3 digits - swprintf( (WCHAR *)TempString, 256, L"%ls: %d%%", app.GetString( IDS_SLIDER_MUSIC ),999); + swprintf( (wchar_t *)TempString, 256, L"%ls: %d%%", app.GetString( IDS_SLIDER_MUSIC ),999); break; case SLIDER_SETTINGS_SOUND: // 3 digits - swprintf( (WCHAR *)TempString, 256, L"%ls: %d%%", app.GetString( IDS_SLIDER_SOUND ),999); + swprintf( (wchar_t *)TempString, 256, L"%ls: %d%%", app.GetString( IDS_SLIDER_SOUND ),999); break; } @@ -238,7 +238,7 @@ HRESULT CScene_SettingsAudio::OnTransitionStart( XUIMessageTransition *pTransiti return S_OK; } -HRESULT CScene_SettingsAudio::OnNavReturn(HXUIOBJ hObj,BOOL& rfHandled) +int CScene_SettingsAudio::OnNavReturn(HXUIOBJ hObj,bool& rfHandled) { bool bNotInGame=(Minecraft::GetInstance()->level==NULL); @@ -255,7 +255,7 @@ HRESULT CScene_SettingsAudio::OnNavReturn(HXUIOBJ hObj,BOOL& rfHandled) return S_OK; } -HRESULT CScene_SettingsAudio::OnCustomMessage_Splitscreenplayer(bool bJoining, BOOL& bHandled) +int CScene_SettingsAudio::OnCustomMessage_Splitscreenplayer(bool bJoining, bool& bHandled) { bHandled=true; return app.AdjustSplitscreenScene_PlayerChanged(m_hObj,&m_OriginalPosition,m_iPad,bJoining); diff --git a/src/client/Common/XUI/XUI_SettingsAudio.h b/src/client/Common/XUI/XUI_SettingsAudio.h index c77f5798..1ae5ca06 100644 --- a/src/client/Common/XUI/XUI_SettingsAudio.h +++ b/src/client/Common/XUI/XUI_SettingsAudio.h @@ -33,14 +33,14 @@ protected: MAP_CONTROL(IDC_XuiSliderSound, m_SliderA[SLIDER_SETTINGS_SOUND]) END_CONTROL_MAP() - HRESULT OnInit( XUIMessageInit* pInitData, BOOL& bHandled ); - HRESULT OnKeyDown(XUIMessageInput *pInputData, BOOL& bHandled); - HRESULT OnNotifyPressEx(HXUIOBJ hObjPressed, XUINotifyPress* pNotifyPressData,BOOL& rfHandled); - HRESULT OnNotifyValueChanged( HXUIOBJ hObjSource, XUINotifyValueChanged* pNotifyValueChanged, BOOL& bHandled ); - HRESULT OnControlNavigate(XUIMessageControlNavigate *pControlNavigateData, BOOL& bHandled); - HRESULT OnTransitionStart( XUIMessageTransition *pTransition, BOOL& bHandled ); - HRESULT OnCustomMessage_Splitscreenplayer(bool bJoining, BOOL& bHandled); - HRESULT OnNavReturn(HXUIOBJ hObj,BOOL& rfHandled); + int OnInit( XUIMessageInit* pInitData, bool& bHandled ); + int OnKeyDown(XUIMessageInput *pInputData, bool& bHandled); + int OnNotifyPressEx(HXUIOBJ hObjPressed, XUINotifyPress* pNotifyPressData,bool& rfHandled); + int OnNotifyValueChanged( HXUIOBJ hObjSource, XUINotifyValueChanged* pNotifyValueChanged, bool& bHandled ); + int OnControlNavigate(XUIMessageControlNavigate *pControlNavigateData, bool& bHandled); + int OnTransitionStart( XUIMessageTransition *pTransition, bool& bHandled ); + int OnCustomMessage_Splitscreenplayer(bool bJoining, bool& bHandled); + int OnNavReturn(HXUIOBJ hObj,bool& rfHandled); int m_iPad; D3DXVECTOR3 m_OriginalPosition; diff --git a/src/client/Common/XUI/XUI_SettingsControl.cpp b/src/client/Common/XUI/XUI_SettingsControl.cpp index 39eadf43..5f2048dd 100644 --- a/src/client/Common/XUI/XUI_SettingsControl.cpp +++ b/src/client/Common/XUI/XUI_SettingsControl.cpp @@ -7,9 +7,9 @@ //---------------------------------------------------------------------------------- // Performs initialization tasks - retrieves controls. //---------------------------------------------------------------------------------- -HRESULT CScene_SettingsControl::OnInit( XUIMessageInit* pInitData, BOOL& bHandled ) +int CScene_SettingsControl::OnInit( XUIMessageInit* pInitData, bool& bHandled ) { - WCHAR TempString[256]; + wchar_t TempString[256]; m_iPad=*(int *)pInitData->pvInitData; // if we're not in the game, we need to use basescene 0 bool bNotInGame=(Minecraft::GetInstance()->level==NULL); @@ -19,11 +19,11 @@ HRESULT CScene_SettingsControl::OnInit( XUIMessageInit* pInitData, BOOL& bHandle // Display the tooltips m_SliderA[SLIDER_SETTINGS_SENSITIVITY_INGAME].SetValue(app.GetGameSettings(m_iPad,eGameSetting_Sensitivity_InGame)); - swprintf( (WCHAR *)TempString, 256, L"%ls: %d%%", app.GetString( IDS_SLIDER_SENSITIVITY_INGAME ),app.GetGameSettings(m_iPad,eGameSetting_Sensitivity_InGame)); + swprintf( (wchar_t *)TempString, 256, L"%ls: %d%%", app.GetString( IDS_SLIDER_SENSITIVITY_INGAME ),app.GetGameSettings(m_iPad,eGameSetting_Sensitivity_InGame)); m_SliderA[SLIDER_SETTINGS_SENSITIVITY_INGAME].SetText(TempString); m_SliderA[SLIDER_SETTINGS_SENSITIVITY_INMENU].SetValue(app.GetGameSettings(m_iPad,eGameSetting_Sensitivity_InMenu)); - swprintf( (WCHAR *)TempString, 256, L"%ls: %d%%", app.GetString( IDS_SLIDER_SENSITIVITY_INMENU ),app.GetGameSettings(m_iPad,eGameSetting_Sensitivity_InMenu)); + swprintf( (wchar_t *)TempString, 256, L"%ls: %d%%", app.GetString( IDS_SLIDER_SENSITIVITY_INMENU ),app.GetGameSettings(m_iPad,eGameSetting_Sensitivity_InMenu)); m_SliderA[SLIDER_SETTINGS_SENSITIVITY_INMENU].SetText(TempString); // if we're not in the game, we need to use basescene 0 @@ -59,20 +59,20 @@ HRESULT CScene_SettingsControl::OnInit( XUIMessageInit* pInitData, BOOL& bHandle return S_OK; } -HRESULT CScene_SettingsControl::OnNotifyValueChanged( HXUIOBJ hObjSource, XUINotifyValueChanged* pNotifyValueChanged, BOOL& bHandled ) +int CScene_SettingsControl::OnNotifyValueChanged( HXUIOBJ hObjSource, XUINotifyValueChanged* pNotifyValueChanged, bool& bHandled ) { - WCHAR TempString[256]; + wchar_t TempString[256]; if(hObjSource==m_SliderA[SLIDER_SETTINGS_SENSITIVITY_INGAME].GetSlider() ) { app.SetGameSettings(m_iPad,eGameSetting_Sensitivity_InGame,pNotifyValueChanged->nValue); - swprintf( (WCHAR *)TempString, 256, L"%ls: %d%%", app.GetString( IDS_SLIDER_SENSITIVITY_INGAME ),pNotifyValueChanged->nValue); + swprintf( (wchar_t *)TempString, 256, L"%ls: %d%%", app.GetString( IDS_SLIDER_SENSITIVITY_INGAME ),pNotifyValueChanged->nValue); m_SliderA[SLIDER_SETTINGS_SENSITIVITY_INGAME].SetText(TempString); } else if(hObjSource==m_SliderA[SLIDER_SETTINGS_SENSITIVITY_INMENU].GetSlider() ) { app.SetGameSettings(m_iPad,eGameSetting_Sensitivity_InMenu,pNotifyValueChanged->nValue); - swprintf( (WCHAR *)TempString, 256, L"%ls: %d%%", app.GetString( IDS_SLIDER_SENSITIVITY_INMENU ),pNotifyValueChanged->nValue); + swprintf( (wchar_t *)TempString, 256, L"%ls: %d%%", app.GetString( IDS_SLIDER_SENSITIVITY_INMENU ),pNotifyValueChanged->nValue); m_SliderA[SLIDER_SETTINGS_SENSITIVITY_INMENU].SetText(TempString); } @@ -80,11 +80,11 @@ HRESULT CScene_SettingsControl::OnNotifyValueChanged( HXUIOBJ hObjSource, XUINot } -HRESULT CScene_SettingsControl::OnKeyDown(XUIMessageInput* pInputData, BOOL& rfHandled) +int CScene_SettingsControl::OnKeyDown(XUIMessageInput* pInputData, bool& rfHandled) { ui.AnimateKeyPress(pInputData->UserIndex, pInputData->dwKeyCode); - HRESULT hr=S_OK; + int hr=S_OK; // Explicitly handle B button presses switch(pInputData->dwKeyCode) @@ -107,7 +107,7 @@ HRESULT CScene_SettingsControl::OnKeyDown(XUIMessageInput* pInputData, BOOL& rfH //---------------------------------------------------------------------------------- // Handler for the button press message. //---------------------------------------------------------------------------------- -HRESULT CScene_SettingsControl::OnNotifyPressEx(HXUIOBJ hObjPressed, XUINotifyPress* pNotifyPressData, BOOL& rfHandled) +int CScene_SettingsControl::OnNotifyPressEx(HXUIOBJ hObjPressed, XUINotifyPress* pNotifyPressData, bool& rfHandled) { // This assumes all buttons can only be pressed with the A button ui.AnimateKeyPress(pNotifyPressData->UserIndex, VK_PAD_A); @@ -115,7 +115,7 @@ HRESULT CScene_SettingsControl::OnNotifyPressEx(HXUIOBJ hObjPressed, XUINotifyPr return S_OK; } -HRESULT CScene_SettingsControl::OnControlNavigate(XUIMessageControlNavigate *pControlNavigateData, BOOL& bHandled) +int CScene_SettingsControl::OnControlNavigate(XUIMessageControlNavigate *pControlNavigateData, bool& bHandled) { // added so we can skip greyed out items pControlNavigateData->hObjDest=XuiControlGetNavigation(pControlNavigateData->hObjSource,pControlNavigateData->nControlNavigate,true,true); @@ -128,10 +128,10 @@ HRESULT CScene_SettingsControl::OnControlNavigate(XUIMessageControlNavigate *pCo return S_OK; } -HRESULT CScene_SettingsControl::OnTransitionStart( XUIMessageTransition *pTransition, BOOL& bHandled ) +int CScene_SettingsControl::OnTransitionStart( XUIMessageTransition *pTransition, bool& bHandled ) { - HRESULT hr; - WCHAR TempString[256]; + int hr; + wchar_t TempString[256]; if(pTransition->dwTransAction==XUI_TRANSITION_ACTION_DESTROY ) return S_OK; if(pTransition->dwTransType == XUI_TRANSITION_TO || pTransition->dwTransType == XUI_TRANSITION_BACKTO) @@ -163,10 +163,10 @@ HRESULT CScene_SettingsControl::OnTransitionStart( XUIMessageTransition *pTransi switch(i) { case SLIDER_SETTINGS_SENSITIVITY_INGAME: // 3 digits - swprintf( (WCHAR *)TempString, 256, L"%ls: %d%%", app.GetString( IDS_SLIDER_SENSITIVITY_INGAME ),999); + swprintf( (wchar_t *)TempString, 256, L"%ls: %d%%", app.GetString( IDS_SLIDER_SENSITIVITY_INGAME ),999); break; case SLIDER_SETTINGS_SENSITIVITY_INMENU: // 3 digits - swprintf( (WCHAR *)TempString, 256, L"%ls: %d%%", app.GetString( IDS_SLIDER_SENSITIVITY_INMENU ),999); + swprintf( (wchar_t *)TempString, 256, L"%ls: %d%%", app.GetString( IDS_SLIDER_SENSITIVITY_INMENU ),999); break; } hr=XuiTextPresenterMeasureText(hText, TempString, &xuiRect); @@ -216,7 +216,7 @@ HRESULT CScene_SettingsControl::OnTransitionStart( XUIMessageTransition *pTransi return S_OK; } -HRESULT CScene_SettingsControl::OnNavReturn(HXUIOBJ hObj,BOOL& rfHandled) +int CScene_SettingsControl::OnNavReturn(HXUIOBJ hObj,bool& rfHandled) { bool bNotInGame=(Minecraft::GetInstance()->level==NULL); @@ -233,7 +233,7 @@ HRESULT CScene_SettingsControl::OnNavReturn(HXUIOBJ hObj,BOOL& rfHandled) return S_OK; } -HRESULT CScene_SettingsControl::OnCustomMessage_Splitscreenplayer(bool bJoining, BOOL& bHandled) +int CScene_SettingsControl::OnCustomMessage_Splitscreenplayer(bool bJoining, bool& bHandled) { bHandled=true; return app.AdjustSplitscreenScene_PlayerChanged(m_hObj,&m_OriginalPosition,m_iPad,bJoining); diff --git a/src/client/Common/XUI/XUI_SettingsControl.h b/src/client/Common/XUI/XUI_SettingsControl.h index 67e43699..51abd404 100644 --- a/src/client/Common/XUI/XUI_SettingsControl.h +++ b/src/client/Common/XUI/XUI_SettingsControl.h @@ -32,14 +32,14 @@ protected: MAP_CONTROL(IDC_XuiSliderSensitivityInMenu, m_SliderA[SLIDER_SETTINGS_SENSITIVITY_INMENU]) END_CONTROL_MAP() - HRESULT OnInit( XUIMessageInit* pInitData, BOOL& bHandled ); - HRESULT OnKeyDown(XUIMessageInput *pInputData, BOOL& bHandled); - HRESULT OnNotifyPressEx(HXUIOBJ hObjPressed, XUINotifyPress* pNotifyPressData,BOOL& rfHandled); - HRESULT OnNotifyValueChanged( HXUIOBJ hObjSource, XUINotifyValueChanged* pNotifyValueChanged, BOOL& bHandled ); - HRESULT OnControlNavigate(XUIMessageControlNavigate *pControlNavigateData, BOOL& bHandled); - HRESULT OnTransitionStart( XUIMessageTransition *pTransition, BOOL& bHandled ); - HRESULT OnCustomMessage_Splitscreenplayer(bool bJoining, BOOL& bHandled); - HRESULT OnNavReturn(HXUIOBJ hObj,BOOL& rfHandled); + int OnInit( XUIMessageInit* pInitData, bool& bHandled ); + int OnKeyDown(XUIMessageInput *pInputData, bool& bHandled); + int OnNotifyPressEx(HXUIOBJ hObjPressed, XUINotifyPress* pNotifyPressData,bool& rfHandled); + int OnNotifyValueChanged( HXUIOBJ hObjSource, XUINotifyValueChanged* pNotifyValueChanged, bool& bHandled ); + int OnControlNavigate(XUIMessageControlNavigate *pControlNavigateData, bool& bHandled); + int OnTransitionStart( XUIMessageTransition *pTransition, bool& bHandled ); + int OnCustomMessage_Splitscreenplayer(bool bJoining, bool& bHandled); + int OnNavReturn(HXUIOBJ hObj,bool& rfHandled); int m_iPad; D3DXVECTOR3 m_OriginalPosition; diff --git a/src/client/Common/XUI/XUI_SettingsGraphics.cpp b/src/client/Common/XUI/XUI_SettingsGraphics.cpp index 8265cac4..9874bd08 100644 --- a/src/client/Common/XUI/XUI_SettingsGraphics.cpp +++ b/src/client/Common/XUI/XUI_SettingsGraphics.cpp @@ -7,9 +7,9 @@ //---------------------------------------------------------------------------------- // Performs initialization tasks - retrieves controls. //---------------------------------------------------------------------------------- -HRESULT CScene_SettingsGraphics::OnInit( XUIMessageInit* pInitData, BOOL& bHandled ) +int CScene_SettingsGraphics::OnInit( XUIMessageInit* pInitData, bool& bHandled ) { - WCHAR TempString[256]; + wchar_t TempString[256]; m_iPad=*(int *)pInitData->pvInitData; // if we're not in the game, we need to use basescene 0 bool bNotInGame=(Minecraft::GetInstance()->level==NULL); @@ -23,11 +23,11 @@ HRESULT CScene_SettingsGraphics::OnInit( XUIMessageInit* pInitData, BOOL& bHandl m_Clouds.SetText(app.GetString( IDS_CHECKBOX_RENDER_CLOUDS )); m_SliderA[SLIDER_SETTINGS_GAMMA].SetValue(app.GetGameSettings(m_iPad,eGameSetting_Gamma)); - swprintf( (WCHAR *)TempString, 256, L"%ls: %d%%", app.GetString( IDS_SLIDER_GAMMA ),app.GetGameSettings(m_iPad,eGameSetting_Gamma)); + swprintf( (wchar_t *)TempString, 256, L"%ls: %d%%", app.GetString( IDS_SLIDER_GAMMA ),app.GetGameSettings(m_iPad,eGameSetting_Gamma)); m_SliderA[SLIDER_SETTINGS_GAMMA].SetText(TempString); m_SliderA[SLIDER_SETTINGS_INTERFACE_OPACITY].SetValue(app.GetGameSettings(m_iPad,eGameSetting_InterfaceOpacity)); - swprintf( (WCHAR *)TempString, 256, L"%ls: %d%%", app.GetString( IDS_SLIDER_INTERFACEOPACITY ),app.GetGameSettings(m_iPad,eGameSetting_InterfaceOpacity)); + swprintf( (wchar_t *)TempString, 256, L"%ls: %d%%", app.GetString( IDS_SLIDER_INTERFACEOPACITY ),app.GetGameSettings(m_iPad,eGameSetting_InterfaceOpacity)); m_SliderA[SLIDER_SETTINGS_INTERFACE_OPACITY].SetText(TempString); m_BedrockFog.SetCheck( (app.GetGameSettings(m_iPad,eGameSetting_BedrockFog)!=0)?true:false); @@ -132,20 +132,20 @@ HRESULT CScene_SettingsGraphics::OnInit( XUIMessageInit* pInitData, BOOL& bHandl return S_OK; } -HRESULT CScene_SettingsGraphics::OnNotifyValueChanged( HXUIOBJ hObjSource, XUINotifyValueChanged* pNotifyValueChanged, BOOL& bHandled ) +int CScene_SettingsGraphics::OnNotifyValueChanged( HXUIOBJ hObjSource, XUINotifyValueChanged* pNotifyValueChanged, bool& bHandled ) { - WCHAR TempString[256]; + wchar_t TempString[256]; if(hObjSource==m_SliderA[SLIDER_SETTINGS_GAMMA].GetSlider() ) { app.SetGameSettings(m_iPad,eGameSetting_Gamma,pNotifyValueChanged->nValue); - swprintf( (WCHAR *)TempString, 256, L"%ls: %d%%", app.GetString( IDS_SLIDER_GAMMA ),pNotifyValueChanged->nValue); + swprintf( (wchar_t *)TempString, 256, L"%ls: %d%%", app.GetString( IDS_SLIDER_GAMMA ),pNotifyValueChanged->nValue); m_SliderA[SLIDER_SETTINGS_GAMMA].SetText(TempString); } else if(hObjSource==m_SliderA[SLIDER_SETTINGS_INTERFACE_OPACITY].GetSlider() ) { app.SetGameSettings(m_iPad,eGameSetting_InterfaceOpacity,pNotifyValueChanged->nValue); - swprintf( (WCHAR *)TempString, 256, L"%ls: %d%%", app.GetString( IDS_SLIDER_INTERFACEOPACITY ),pNotifyValueChanged->nValue); + swprintf( (wchar_t *)TempString, 256, L"%ls: %d%%", app.GetString( IDS_SLIDER_INTERFACEOPACITY ),pNotifyValueChanged->nValue); m_SliderA[SLIDER_SETTINGS_INTERFACE_OPACITY].SetText(TempString); } @@ -153,11 +153,11 @@ HRESULT CScene_SettingsGraphics::OnNotifyValueChanged( HXUIOBJ hObjSource, XUINo } -HRESULT CScene_SettingsGraphics::OnKeyDown(XUIMessageInput* pInputData, BOOL& rfHandled) +int CScene_SettingsGraphics::OnKeyDown(XUIMessageInput* pInputData, bool& rfHandled) { ui.AnimateKeyPress(pInputData->UserIndex, pInputData->dwKeyCode); - HRESULT hr=S_OK; + int hr=S_OK; // Explicitly handle B button presses switch(pInputData->dwKeyCode) @@ -185,7 +185,7 @@ HRESULT CScene_SettingsGraphics::OnKeyDown(XUIMessageInput* pInputData, BOOL& rf //---------------------------------------------------------------------------------- // Handler for the button press message. //---------------------------------------------------------------------------------- -HRESULT CScene_SettingsGraphics::OnNotifyPressEx(HXUIOBJ hObjPressed, XUINotifyPress* pNotifyPressData, BOOL& rfHandled) +int CScene_SettingsGraphics::OnNotifyPressEx(HXUIOBJ hObjPressed, XUINotifyPress* pNotifyPressData, bool& rfHandled) { // This assumes all buttons can only be pressed with the A button ui.AnimateKeyPress(pNotifyPressData->UserIndex, VK_PAD_A); @@ -193,7 +193,7 @@ HRESULT CScene_SettingsGraphics::OnNotifyPressEx(HXUIOBJ hObjPressed, XUINotifyP return S_OK; } -HRESULT CScene_SettingsGraphics::OnControlNavigate(XUIMessageControlNavigate *pControlNavigateData, BOOL& bHandled) +int CScene_SettingsGraphics::OnControlNavigate(XUIMessageControlNavigate *pControlNavigateData, bool& bHandled) { // added so we can skip greyed out items pControlNavigateData->hObjDest=XuiControlGetNavigation(pControlNavigateData->hObjSource,pControlNavigateData->nControlNavigate,true,true); @@ -206,10 +206,10 @@ HRESULT CScene_SettingsGraphics::OnControlNavigate(XUIMessageControlNavigate *pC return S_OK; } -HRESULT CScene_SettingsGraphics::OnTransitionStart( XUIMessageTransition *pTransition, BOOL& bHandled ) +int CScene_SettingsGraphics::OnTransitionStart( XUIMessageTransition *pTransition, bool& bHandled ) { - HRESULT hr; - WCHAR TempString[256]; + int hr; + wchar_t TempString[256]; if(pTransition->dwTransAction==XUI_TRANSITION_ACTION_DESTROY ) return S_OK; if(pTransition->dwTransType == XUI_TRANSITION_TO || pTransition->dwTransType == XUI_TRANSITION_BACKTO) @@ -244,10 +244,10 @@ HRESULT CScene_SettingsGraphics::OnTransitionStart( XUIMessageTransition *pTrans switch(i) { case SLIDER_SETTINGS_GAMMA: // 3 digits - swprintf( (WCHAR *)TempString, 256, L"%ls: %d%%", app.GetString( IDS_SLIDER_GAMMA ),999); + swprintf( (wchar_t *)TempString, 256, L"%ls: %d%%", app.GetString( IDS_SLIDER_GAMMA ),999); break; case SLIDER_SETTINGS_INTERFACE_OPACITY: // 3 digits - swprintf( (WCHAR *)TempString, 256, L"%ls: %d%%", app.GetString( IDS_SLIDER_INTERFACEOPACITY ),999); + swprintf( (wchar_t *)TempString, 256, L"%ls: %d%%", app.GetString( IDS_SLIDER_INTERFACEOPACITY ),999); break; } hr=XuiTextPresenterMeasureText(hText, TempString, &xuiRect); @@ -308,7 +308,7 @@ HRESULT CScene_SettingsGraphics::OnTransitionStart( XUIMessageTransition *pTrans return S_OK; } -HRESULT CScene_SettingsGraphics::OnNavReturn(HXUIOBJ hObj,BOOL& rfHandled) +int CScene_SettingsGraphics::OnNavReturn(HXUIOBJ hObj,bool& rfHandled) { bool bNotInGame=(Minecraft::GetInstance()->level==NULL); @@ -325,7 +325,7 @@ HRESULT CScene_SettingsGraphics::OnNavReturn(HXUIOBJ hObj,BOOL& rfHandled) return S_OK; } -HRESULT CScene_SettingsGraphics::OnCustomMessage_Splitscreenplayer(bool bJoining, BOOL& bHandled) +int CScene_SettingsGraphics::OnCustomMessage_Splitscreenplayer(bool bJoining, bool& bHandled) { bHandled=true; return app.AdjustSplitscreenScene_PlayerChanged(m_hObj,&m_OriginalPosition,m_iPad,bJoining); diff --git a/src/client/Common/XUI/XUI_SettingsGraphics.h b/src/client/Common/XUI/XUI_SettingsGraphics.h index 224dedd7..ce652140 100644 --- a/src/client/Common/XUI/XUI_SettingsGraphics.h +++ b/src/client/Common/XUI/XUI_SettingsGraphics.h @@ -40,14 +40,14 @@ protected: END_CONTROL_MAP() - HRESULT OnInit( XUIMessageInit* pInitData, BOOL& bHandled ); - HRESULT OnKeyDown(XUIMessageInput *pInputData, BOOL& bHandled); - HRESULT OnNotifyPressEx(HXUIOBJ hObjPressed, XUINotifyPress* pNotifyPressData,BOOL& rfHandled); - HRESULT OnNotifyValueChanged( HXUIOBJ hObjSource, XUINotifyValueChanged* pNotifyValueChanged, BOOL& bHandled ); - HRESULT OnControlNavigate(XUIMessageControlNavigate *pControlNavigateData, BOOL& bHandled); - HRESULT OnTransitionStart( XUIMessageTransition *pTransition, BOOL& bHandled ); - HRESULT OnCustomMessage_Splitscreenplayer(bool bJoining, BOOL& bHandled); - HRESULT OnNavReturn(HXUIOBJ hObj,BOOL& rfHandled); + int OnInit( XUIMessageInit* pInitData, bool& bHandled ); + int OnKeyDown(XUIMessageInput *pInputData, bool& bHandled); + int OnNotifyPressEx(HXUIOBJ hObjPressed, XUINotifyPress* pNotifyPressData,bool& rfHandled); + int OnNotifyValueChanged( HXUIOBJ hObjSource, XUINotifyValueChanged* pNotifyValueChanged, bool& bHandled ); + int OnControlNavigate(XUIMessageControlNavigate *pControlNavigateData, bool& bHandled); + int OnTransitionStart( XUIMessageTransition *pTransition, bool& bHandled ); + int OnCustomMessage_Splitscreenplayer(bool bJoining, bool& bHandled); + int OnNavReturn(HXUIOBJ hObj,bool& rfHandled); int m_iPad; D3DXVECTOR3 m_OriginalPosition; diff --git a/src/client/Common/XUI/XUI_SettingsOptions.cpp b/src/client/Common/XUI/XUI_SettingsOptions.cpp index 1747dfdd..1fb183a5 100644 --- a/src/client/Common/XUI/XUI_SettingsOptions.cpp +++ b/src/client/Common/XUI/XUI_SettingsOptions.cpp @@ -23,9 +23,9 @@ int CScene_SettingsOptions::m_iDifficultyTitleSettingA[4]= //---------------------------------------------------------------------------------- // Performs initialization tasks - retrieves controls. //---------------------------------------------------------------------------------- -HRESULT CScene_SettingsOptions::OnInit( XUIMessageInit* pInitData, BOOL& bHandled ) +int CScene_SettingsOptions::OnInit( XUIMessageInit* pInitData, bool& bHandled ) { - WCHAR TempString[256]; + wchar_t TempString[256]; m_iPad=*(int *)pInitData->pvInitData; // if we're not in the game, we need to use basescene 0 bool bNotInGame=(Minecraft::GetInstance()->level==NULL); @@ -53,18 +53,18 @@ HRESULT CScene_SettingsOptions::OnInit( XUIMessageInit* pInitData, BOOL& bHandle } // Display the tooltips - HRESULT hr = S_OK; + int hr = S_OK; HXUIOBJ hSlider; unsigned char ucValue=app.GetGameSettings(m_iPad,eGameSetting_Autosave); m_SliderA[SLIDER_SETTINGS_AUTOSAVE].SetValue(ucValue); if(ucValue==0) { - swprintf( (WCHAR *)TempString, 256, L"%ls", app.GetString( IDS_SLIDER_AUTOSAVE_OFF )); + swprintf( (wchar_t *)TempString, 256, L"%ls", app.GetString( IDS_SLIDER_AUTOSAVE_OFF )); } else { - swprintf( (WCHAR *)TempString, 256, L"%ls: %d %ls", app.GetString( IDS_SLIDER_AUTOSAVE ),ucValue*15, app.GetString( IDS_MINUTES )); + swprintf( (wchar_t *)TempString, 256, L"%ls: %d %ls", app.GetString( IDS_SLIDER_AUTOSAVE ),ucValue*15, app.GetString( IDS_MINUTES )); } m_SliderA[SLIDER_SETTINGS_AUTOSAVE].SetText(TempString); @@ -76,7 +76,7 @@ HRESULT CScene_SettingsOptions::OnInit( XUIMessageInit* pInitData, BOOL& bHandle m_Tooltips.SetCheck( (app.GetGameSettings(m_iPad,eGameSetting_Tooltips)!=0)?true:false); m_SliderA[SLIDER_SETTINGS_DIFFICULTY].SetValue(app.GetGameSettings(m_iPad,eGameSetting_Difficulty)); - swprintf( (WCHAR *)TempString, 256, L"%ls: %ls", app.GetString( IDS_SLIDER_DIFFICULTY ),app.GetString(m_iDifficultyTitleSettingA[app.GetGameSettings(m_iPad,eGameSetting_Difficulty)])); + swprintf( (wchar_t *)TempString, 256, L"%ls: %ls", app.GetString( IDS_SLIDER_DIFFICULTY ),app.GetString(m_iDifficultyTitleSettingA[app.GetGameSettings(m_iPad,eGameSetting_Difficulty)])); m_SliderA[SLIDER_SETTINGS_DIFFICULTY].SetText(TempString); @@ -257,9 +257,9 @@ HRESULT CScene_SettingsOptions::OnInit( XUIMessageInit* pInitData, BOOL& bHandle return S_OK; } -HRESULT CScene_SettingsOptions::OnNotifyValueChanged( HXUIOBJ hObjSource, XUINotifyValueChanged* pNotifyValueChanged, BOOL& bHandled ) +int CScene_SettingsOptions::OnNotifyValueChanged( HXUIOBJ hObjSource, XUINotifyValueChanged* pNotifyValueChanged, bool& bHandled ) { - WCHAR TempString[256]; + wchar_t TempString[256]; if(hObjSource==m_SliderA[SLIDER_SETTINGS_AUTOSAVE].GetSlider() ) { @@ -269,19 +269,19 @@ HRESULT CScene_SettingsOptions::OnNotifyValueChanged( HXUIOBJ hObjSource, XUINot if(pNotifyValueChanged->nValue==0) { - swprintf( (WCHAR *)TempString, 256, L"%ls", app.GetString( IDS_SLIDER_AUTOSAVE_OFF )); + swprintf( (wchar_t *)TempString, 256, L"%ls", app.GetString( IDS_SLIDER_AUTOSAVE_OFF )); } else { app.SetAutosaveTimerTime(); - swprintf( (WCHAR *)TempString, 256, L"%ls: %d %ls", app.GetString( IDS_SLIDER_AUTOSAVE ),pNotifyValueChanged->nValue*15, app.GetString( IDS_MINUTES )); + swprintf( (wchar_t *)TempString, 256, L"%ls: %d %ls", app.GetString( IDS_SLIDER_AUTOSAVE ),pNotifyValueChanged->nValue*15, app.GetString( IDS_MINUTES )); } m_SliderA[SLIDER_SETTINGS_AUTOSAVE].SetText(TempString); } else if(hObjSource==m_SliderA[SLIDER_SETTINGS_DIFFICULTY].GetSlider() ) { app.SetGameSettings(m_iPad,eGameSetting_Difficulty,pNotifyValueChanged->nValue); - swprintf( (WCHAR *)TempString, 256, L"%ls: %ls", app.GetString( IDS_SLIDER_DIFFICULTY ),app.GetString(m_iDifficultyTitleSettingA[pNotifyValueChanged->nValue])); + swprintf( (wchar_t *)TempString, 256, L"%ls: %ls", app.GetString( IDS_SLIDER_DIFFICULTY ),app.GetString(m_iDifficultyTitleSettingA[pNotifyValueChanged->nValue])); m_SliderA[SLIDER_SETTINGS_DIFFICULTY].SetText(TempString); wstring wsText=app.GetString(m_iDifficultySettingA[pNotifyValueChanged->nValue]); @@ -299,11 +299,11 @@ HRESULT CScene_SettingsOptions::OnNotifyValueChanged( HXUIOBJ hObjSource, XUINot } -HRESULT CScene_SettingsOptions::OnKeyDown(XUIMessageInput* pInputData, BOOL& rfHandled) +int CScene_SettingsOptions::OnKeyDown(XUIMessageInput* pInputData, bool& rfHandled) { ui.AnimateKeyPress(pInputData->UserIndex, pInputData->dwKeyCode); - HRESULT hr=S_OK; + int hr=S_OK; // Explicitly handle B button presses switch(pInputData->dwKeyCode) @@ -340,7 +340,7 @@ HRESULT CScene_SettingsOptions::OnKeyDown(XUIMessageInput* pInputData, BOOL& rfH //---------------------------------------------------------------------------------- // Handler for the button press message. //---------------------------------------------------------------------------------- -HRESULT CScene_SettingsOptions::OnNotifyPressEx(HXUIOBJ hObjPressed, XUINotifyPress* pNotifyPressData, BOOL& rfHandled) +int CScene_SettingsOptions::OnNotifyPressEx(HXUIOBJ hObjPressed, XUINotifyPress* pNotifyPressData, bool& rfHandled) { // This assumes all buttons can only be pressed with the A button ui.AnimateKeyPress(pNotifyPressData->UserIndex, VK_PAD_A); @@ -348,7 +348,7 @@ HRESULT CScene_SettingsOptions::OnNotifyPressEx(HXUIOBJ hObjPressed, XUINotifyPr return S_OK; } -HRESULT CScene_SettingsOptions::OnControlNavigate(XUIMessageControlNavigate *pControlNavigateData, BOOL& bHandled) +int CScene_SettingsOptions::OnControlNavigate(XUIMessageControlNavigate *pControlNavigateData, bool& bHandled) { // added so we can skip greyed out items pControlNavigateData->hObjDest=XuiControlGetNavigation(pControlNavigateData->hObjSource,pControlNavigateData->nControlNavigate,true,true); @@ -361,10 +361,10 @@ HRESULT CScene_SettingsOptions::OnControlNavigate(XUIMessageControlNavigate *pCo return S_OK; } -HRESULT CScene_SettingsOptions::OnTransitionStart( XUIMessageTransition *pTransition, BOOL& bHandled ) +int CScene_SettingsOptions::OnTransitionStart( XUIMessageTransition *pTransition, bool& bHandled ) { - HRESULT hr; - WCHAR TempString[256]; + int hr; + wchar_t TempString[256]; if(pTransition->dwTransAction==XUI_TRANSITION_ACTION_DESTROY ) return S_OK; @@ -405,14 +405,14 @@ HRESULT CScene_SettingsOptions::OnTransitionStart( XUIMessageTransition *pTransi switch(i) { case SLIDER_SETTINGS_AUTOSAVE: // 3 digits - swprintf( (WCHAR *)TempString, 256, L"%ls: %d %ls", app.GetString( IDS_SLIDER_AUTOSAVE ),999, app.GetString( IDS_MINUTES )); + swprintf( (wchar_t *)TempString, 256, L"%ls: %d %ls", app.GetString( IDS_SLIDER_AUTOSAVE ),999, app.GetString( IDS_MINUTES )); break; case SLIDER_SETTINGS_DIFFICULTY: // 3 digits - swprintf( (WCHAR *)TempString, 256, L"%ls: %ls", app.GetString( IDS_SLIDER_DIFFICULTY ),app.GetString(IDS_DIFFICULTY_TITLE_PEACEFUL)); + swprintf( (wchar_t *)TempString, 256, L"%ls: %ls", app.GetString( IDS_SLIDER_DIFFICULTY ),app.GetString(IDS_DIFFICULTY_TITLE_PEACEFUL)); break; } - //LPCWSTR temp=m_SliderA[i].GetText(); + //const wchar_t* temp=m_SliderA[i].GetText(); hr=XuiTextPresenterMeasureText(hText, TempString, &xuiRect); // 4J-PB - the text measuring doesn't seem to be long enough - add a fudge xuiRect.right+=25.0f; @@ -501,7 +501,7 @@ HRESULT CScene_SettingsOptions::OnTransitionStart( XUIMessageTransition *pTransi } -HRESULT CScene_SettingsOptions::OnCustomMessage_Splitscreenplayer(bool bJoining, BOOL& bHandled) +int CScene_SettingsOptions::OnCustomMessage_Splitscreenplayer(bool bJoining, bool& bHandled) { bHandled=true; return app.AdjustSplitscreenScene_PlayerChanged(m_hObj,&m_OriginalPosition,m_iPad,bJoining); diff --git a/src/client/Common/XUI/XUI_SettingsOptions.h b/src/client/Common/XUI/XUI_SettingsOptions.h index 020e7653..e5f4bff7 100644 --- a/src/client/Common/XUI/XUI_SettingsOptions.h +++ b/src/client/Common/XUI/XUI_SettingsOptions.h @@ -41,13 +41,13 @@ protected: MAP_CONTROL(IDC_XuiMashUpWorlds, m_MashUpWorlds) END_CONTROL_MAP() - HRESULT OnInit( XUIMessageInit* pInitData, BOOL& bHandled ); - HRESULT OnKeyDown(XUIMessageInput *pInputData, BOOL& bHandled); - HRESULT OnNotifyPressEx(HXUIOBJ hObjPressed, XUINotifyPress* pNotifyPressData,BOOL& rfHandled); - HRESULT OnNotifyValueChanged( HXUIOBJ hObjSource, XUINotifyValueChanged* pNotifyValueChanged, BOOL& bHandled ); - HRESULT OnControlNavigate(XUIMessageControlNavigate *pControlNavigateData, BOOL& bHandled); - HRESULT OnTransitionStart( XUIMessageTransition *pTransition, BOOL& bHandled ); - HRESULT OnCustomMessage_Splitscreenplayer(bool bJoining, BOOL& bHandled); + int OnInit( XUIMessageInit* pInitData, bool& bHandled ); + int OnKeyDown(XUIMessageInput *pInputData, bool& bHandled); + int OnNotifyPressEx(HXUIOBJ hObjPressed, XUINotifyPress* pNotifyPressData,bool& rfHandled); + int OnNotifyValueChanged( HXUIOBJ hObjSource, XUINotifyValueChanged* pNotifyValueChanged, bool& bHandled ); + int OnControlNavigate(XUIMessageControlNavigate *pControlNavigateData, bool& bHandled); + int OnTransitionStart( XUIMessageTransition *pTransition, bool& bHandled ); + int OnCustomMessage_Splitscreenplayer(bool bJoining, bool& bHandled); int m_iPad; static int m_iDifficultySettingA[4]; diff --git a/src/client/Common/XUI/XUI_SettingsUI.cpp b/src/client/Common/XUI/XUI_SettingsUI.cpp index c20fa824..6282e494 100644 --- a/src/client/Common/XUI/XUI_SettingsUI.cpp +++ b/src/client/Common/XUI/XUI_SettingsUI.cpp @@ -7,9 +7,9 @@ //---------------------------------------------------------------------------------- // Performs initialization tasks - retrieves controls. //---------------------------------------------------------------------------------- -HRESULT CScene_SettingsUI::OnInit( XUIMessageInit* pInitData, BOOL& bHandled ) +int CScene_SettingsUI::OnInit( XUIMessageInit* pInitData, bool& bHandled ) { - WCHAR TempString[256]; + wchar_t TempString[256]; m_iPad=*(int *)pInitData->pvInitData; // if we're not in the game, we need to use basescene 0 bool bNotInGame=(Minecraft::GetInstance()->level==NULL); @@ -24,11 +24,11 @@ HRESULT CScene_SettingsUI::OnInit( XUIMessageInit* pInitData, BOOL& bHandled ) m_SplitScreenGamertags.SetText(app.GetString( IDS_CHECKBOX_DISPLAY_SPLITSCREENGAMERTAGS )); m_SliderA[SLIDER_SETTINGS_UISIZE].SetValue(app.GetGameSettings(m_iPad,eGameSetting_UISize)+1); - swprintf( (WCHAR *)TempString, 256, L"%ls: %d", app.GetString( IDS_SLIDER_UISIZE ),app.GetGameSettings(m_iPad,eGameSetting_UISize)+1); + swprintf( (wchar_t *)TempString, 256, L"%ls: %d", app.GetString( IDS_SLIDER_UISIZE ),app.GetGameSettings(m_iPad,eGameSetting_UISize)+1); m_SliderA[SLIDER_SETTINGS_UISIZE].SetText(TempString); m_SliderA[SLIDER_SETTINGS_UISIZESPLITSCREEN].SetValue(app.GetGameSettings(m_iPad,eGameSetting_UISizeSplitscreen)+1); - swprintf( (WCHAR *)TempString, 256, L"%ls: %d", app.GetString( IDS_SLIDER_UISIZESPLITSCREEN ),app.GetGameSettings(m_iPad,eGameSetting_UISizeSplitscreen)+1); + swprintf( (wchar_t *)TempString, 256, L"%ls: %d", app.GetString( IDS_SLIDER_UISIZESPLITSCREEN ),app.GetGameSettings(m_iPad,eGameSetting_UISizeSplitscreen)+1); m_SliderA[SLIDER_SETTINGS_UISIZESPLITSCREEN].SetText(TempString); m_DisplayHUD.SetCheck( (app.GetGameSettings(m_iPad,eGameSetting_DisplayHUD)!=0)?true:false); @@ -106,16 +106,16 @@ HRESULT CScene_SettingsUI::OnInit( XUIMessageInit* pInitData, BOOL& bHandled ) return S_OK; } -HRESULT CScene_SettingsUI::OnNotifyValueChanged( HXUIOBJ hObjSource, XUINotifyValueChanged* pNotifyValueChanged, BOOL& bHandled ) +int CScene_SettingsUI::OnNotifyValueChanged( HXUIOBJ hObjSource, XUINotifyValueChanged* pNotifyValueChanged, bool& bHandled ) { - WCHAR TempString[256]; + wchar_t TempString[256]; if(hObjSource==m_SliderA[SLIDER_SETTINGS_UISIZE].GetSlider() ) { // slider is 1 to 3 // is this different from the current value? - swprintf( (WCHAR *)TempString, 256, L"%ls: %d", app.GetString( IDS_SLIDER_UISIZE ),pNotifyValueChanged->nValue); + swprintf( (wchar_t *)TempString, 256, L"%ls: %d", app.GetString( IDS_SLIDER_UISIZE ),pNotifyValueChanged->nValue); m_SliderA[SLIDER_SETTINGS_UISIZE].SetText(TempString); if(pNotifyValueChanged->nValue != app.GetGameSettings(m_iPad,eGameSetting_UISize)+1) { @@ -126,7 +126,7 @@ HRESULT CScene_SettingsUI::OnNotifyValueChanged( HXUIOBJ hObjSource, XUINotifyVa } else if(hObjSource==m_SliderA[SLIDER_SETTINGS_UISIZESPLITSCREEN].GetSlider() ) { - swprintf( (WCHAR *)TempString, 256, L"%ls: %d", app.GetString( IDS_SLIDER_UISIZESPLITSCREEN ),pNotifyValueChanged->nValue); + swprintf( (wchar_t *)TempString, 256, L"%ls: %d", app.GetString( IDS_SLIDER_UISIZESPLITSCREEN ),pNotifyValueChanged->nValue); m_SliderA[SLIDER_SETTINGS_UISIZESPLITSCREEN].SetText(TempString); if(pNotifyValueChanged->nValue != app.GetGameSettings(m_iPad,eGameSetting_UISizeSplitscreen)+1) @@ -142,11 +142,11 @@ HRESULT CScene_SettingsUI::OnNotifyValueChanged( HXUIOBJ hObjSource, XUINotifyVa } -HRESULT CScene_SettingsUI::OnKeyDown(XUIMessageInput* pInputData, BOOL& rfHandled) +int CScene_SettingsUI::OnKeyDown(XUIMessageInput* pInputData, bool& rfHandled) { ui.AnimateKeyPress(pInputData->UserIndex, pInputData->dwKeyCode); - HRESULT hr=S_OK; + int hr=S_OK; // Explicitly handle B button presses switch(pInputData->dwKeyCode) @@ -197,7 +197,7 @@ HRESULT CScene_SettingsUI::OnKeyDown(XUIMessageInput* pInputData, BOOL& rfHandle //---------------------------------------------------------------------------------- // Handler for the button press message. //---------------------------------------------------------------------------------- -HRESULT CScene_SettingsUI::OnNotifyPressEx(HXUIOBJ hObjPressed, XUINotifyPress* pNotifyPressData, BOOL& rfHandled) +int CScene_SettingsUI::OnNotifyPressEx(HXUIOBJ hObjPressed, XUINotifyPress* pNotifyPressData, bool& rfHandled) { // This assumes all buttons can only be pressed with the A button ui.AnimateKeyPress(pNotifyPressData->UserIndex, VK_PAD_A); @@ -205,7 +205,7 @@ HRESULT CScene_SettingsUI::OnNotifyPressEx(HXUIOBJ hObjPressed, XUINotifyPress* return S_OK; } -HRESULT CScene_SettingsUI::OnControlNavigate(XUIMessageControlNavigate *pControlNavigateData, BOOL& bHandled) +int CScene_SettingsUI::OnControlNavigate(XUIMessageControlNavigate *pControlNavigateData, bool& bHandled) { // added so we can skip greyed out items pControlNavigateData->hObjDest=XuiControlGetNavigation(pControlNavigateData->hObjSource,pControlNavigateData->nControlNavigate,true,true); @@ -218,10 +218,10 @@ HRESULT CScene_SettingsUI::OnControlNavigate(XUIMessageControlNavigate *pControl return S_OK; } -HRESULT CScene_SettingsUI::OnTransitionStart( XUIMessageTransition *pTransition, BOOL& bHandled ) +int CScene_SettingsUI::OnTransitionStart( XUIMessageTransition *pTransition, bool& bHandled ) { - HRESULT hr; - WCHAR TempString[256]; + int hr; + wchar_t TempString[256]; if(pTransition->dwTransAction==XUI_TRANSITION_ACTION_DESTROY ) return S_OK; if(pTransition->dwTransType == XUI_TRANSITION_TO || pTransition->dwTransType == XUI_TRANSITION_BACKTO) @@ -258,14 +258,14 @@ HRESULT CScene_SettingsUI::OnTransitionStart( XUIMessageTransition *pTransition, switch(i) { case SLIDER_SETTINGS_UISIZE: // 3 digits - swprintf( (WCHAR *)TempString, 256, L"%ls: %d", app.GetString( IDS_SLIDER_UISIZE ),3); + swprintf( (wchar_t *)TempString, 256, L"%ls: %d", app.GetString( IDS_SLIDER_UISIZE ),3); break; case SLIDER_SETTINGS_UISIZESPLITSCREEN: // 3 digits - swprintf( (WCHAR *)TempString, 256, L"%ls: %d", app.GetString( IDS_SLIDER_UISIZESPLITSCREEN ),3); + swprintf( (wchar_t *)TempString, 256, L"%ls: %d", app.GetString( IDS_SLIDER_UISIZESPLITSCREEN ),3); break; } - //LPCWSTR temp=m_SliderA[i].GetText(); + //const wchar_t* temp=m_SliderA[i].GetText(); hr=XuiTextPresenterMeasureText(hText, TempString, &xuiRect); // 4J-PB - the text measuring doesn't seem to be long enough - add a fudge xuiRect.right+=25.0f; @@ -351,7 +351,7 @@ HRESULT CScene_SettingsUI::OnTransitionStart( XUIMessageTransition *pTransition, return S_OK; } -HRESULT CScene_SettingsUI::OnNavReturn(HXUIOBJ hObj,BOOL& rfHandled) +int CScene_SettingsUI::OnNavReturn(HXUIOBJ hObj,bool& rfHandled) { bool bNotInGame=(Minecraft::GetInstance()->level==NULL); @@ -368,7 +368,7 @@ HRESULT CScene_SettingsUI::OnNavReturn(HXUIOBJ hObj,BOOL& rfHandled) return S_OK; } -HRESULT CScene_SettingsUI::OnCustomMessage_Splitscreenplayer(bool bJoining, BOOL& bHandled) +int CScene_SettingsUI::OnCustomMessage_Splitscreenplayer(bool bJoining, bool& bHandled) { bHandled=true; return app.AdjustSplitscreenScene_PlayerChanged(m_hObj,&m_OriginalPosition,m_iPad,bJoining); diff --git a/src/client/Common/XUI/XUI_SettingsUI.h b/src/client/Common/XUI/XUI_SettingsUI.h index 12bffead..9274a15f 100644 --- a/src/client/Common/XUI/XUI_SettingsUI.h +++ b/src/client/Common/XUI/XUI_SettingsUI.h @@ -45,14 +45,14 @@ protected: END_CONTROL_MAP() - HRESULT OnInit( XUIMessageInit* pInitData, BOOL& bHandled ); - HRESULT OnKeyDown(XUIMessageInput *pInputData, BOOL& bHandled); - HRESULT OnNotifyPressEx(HXUIOBJ hObjPressed, XUINotifyPress* pNotifyPressData,BOOL& rfHandled); - HRESULT OnNotifyValueChanged( HXUIOBJ hObjSource, XUINotifyValueChanged* pNotifyValueChanged, BOOL& bHandled ); - HRESULT OnControlNavigate(XUIMessageControlNavigate *pControlNavigateData, BOOL& bHandled); - HRESULT OnTransitionStart( XUIMessageTransition *pTransition, BOOL& bHandled ); - HRESULT OnCustomMessage_Splitscreenplayer(bool bJoining, BOOL& bHandled); - HRESULT OnNavReturn(HXUIOBJ hObj,BOOL& rfHandled); + int OnInit( XUIMessageInit* pInitData, bool& bHandled ); + int OnKeyDown(XUIMessageInput *pInputData, bool& bHandled); + int OnNotifyPressEx(HXUIOBJ hObjPressed, XUINotifyPress* pNotifyPressData,bool& rfHandled); + int OnNotifyValueChanged( HXUIOBJ hObjSource, XUINotifyValueChanged* pNotifyValueChanged, bool& bHandled ); + int OnControlNavigate(XUIMessageControlNavigate *pControlNavigateData, bool& bHandled); + int OnTransitionStart( XUIMessageTransition *pTransition, bool& bHandled ); + int OnCustomMessage_Splitscreenplayer(bool bJoining, bool& bHandled); + int OnNavReturn(HXUIOBJ hObj,bool& rfHandled); int m_iPad; D3DXVECTOR3 m_OriginalPosition; diff --git a/src/client/Common/XUI/XUI_SignEntry.cpp b/src/client/Common/XUI/XUI_SignEntry.cpp index a1b2229e..e243f5ee 100644 --- a/src/client/Common/XUI/XUI_SignEntry.cpp +++ b/src/client/Common/XUI/XUI_SignEntry.cpp @@ -8,7 +8,7 @@ #include "MultiPlayerLocalPlayer.h" #include "XUI_SignEntry.h" -HRESULT CScene_SignEntry::OnInit( XUIMessageInit* pInitData, BOOL& bHandled ) +int CScene_SignEntry::OnInit( XUIMessageInit* pInitData, bool& bHandled ) { MapChildControls(); @@ -54,7 +54,7 @@ HRESULT CScene_SignEntry::OnInit( XUIMessageInit* pInitData, BOOL& bHandled ) return S_OK; } -HRESULT CScene_SignEntry::OnNotifyPressEx(HXUIOBJ hObjPressed, XUINotifyPress* pNotifyPressData, BOOL& rfHandled) +int CScene_SignEntry::OnNotifyPressEx(HXUIOBJ hObjPressed, XUINotifyPress* pNotifyPressData, bool& rfHandled) { // This assumes all buttons can only be pressed with the A button ui.AnimateKeyPress(pNotifyPressData->UserIndex, VK_PAD_A); @@ -85,7 +85,7 @@ HRESULT CScene_SignEntry::OnNotifyPressEx(HXUIOBJ hObjPressed, XUINotifyPress* p return S_OK; } -HRESULT CScene_SignEntry::OnKeyDown(XUIMessageInput* pInputData, BOOL& rfHandled) +int CScene_SignEntry::OnKeyDown(XUIMessageInput* pInputData, bool& rfHandled) { ui.AnimateKeyPress(pInputData->UserIndex, pInputData->dwKeyCode); diff --git a/src/client/Common/XUI/XUI_SignEntry.h b/src/client/Common/XUI/XUI_SignEntry.h index 4f8c44d2..12568b1c 100644 --- a/src/client/Common/XUI/XUI_SignEntry.h +++ b/src/client/Common/XUI/XUI_SignEntry.h @@ -32,9 +32,9 @@ class CScene_SignEntry : public CXuiSceneImpl MAP_CONTROL(IDC_EditLineFour, m_signRows[3]) END_CONTROL_MAP() - HRESULT OnInit( XUIMessageInit* pInitData, BOOL& bHandled ); - HRESULT OnNotifyPressEx(HXUIOBJ hObjPressed, XUINotifyPress* pNotifyPressData, BOOL& rfHandled); - HRESULT OnKeyDown(XUIMessageInput* pInputData, BOOL& rfHandled); + int OnInit( XUIMessageInit* pInitData, bool& bHandled ); + int OnNotifyPressEx(HXUIOBJ hObjPressed, XUINotifyPress* pNotifyPressData, bool& rfHandled); + int OnKeyDown(XUIMessageInput* pInputData, bool& rfHandled); public: diff --git a/src/client/Common/XUI/XUI_SkinSelect.cpp b/src/client/Common/XUI/XUI_SkinSelect.cpp index 6d026343..7fa5d567 100644 --- a/src/client/Common/XUI/XUI_SkinSelect.cpp +++ b/src/client/Common/XUI/XUI_SkinSelect.cpp @@ -7,7 +7,7 @@ //#define SKIN_SELECT_PACK_PLAYER_CUSTOM 1 #define SKIN_SELECT_MAX_DEFAULTS 2 -WCHAR *CScene_SkinSelect::wchDefaultNamesA[]= +wchar_t *CScene_SkinSelect::wchDefaultNamesA[]= { L"USE LOCALISED VERSION", // Server selected L"Steve", @@ -24,7 +24,7 @@ WCHAR *CScene_SkinSelect::wchDefaultNamesA[]= //---------------------------------------------------------------------------------- // Performs initialization tasks - retrieves controls. //---------------------------------------------------------------------------------- -HRESULT CScene_SkinSelect::OnInit( XUIMessageInit* pInitData, BOOL& bHandled ) +int CScene_SkinSelect::OnInit( XUIMessageInit* pInitData, bool& bHandled ) { m_iPad=*(int *)pInitData->pvInitData; // if we're not in the game, we need to use basescene 0 @@ -58,7 +58,7 @@ HRESULT CScene_SkinSelect::OnInit( XUIMessageInit* pInitData, BOOL& bHandled ) m_packRight.SetEnable(false); - for(BYTE i = 0; i < sidePreviewControls; ++i) + for(uint8_t i = 0; i < sidePreviewControls; ++i) { //m_previewNextControl->SetAutoRotate(true); m_previewNextControls[i]->SetFacing(CXuiCtrlMinecraftSkinPreview::e_SkinPreviewFacing_Left); @@ -142,7 +142,7 @@ HRESULT CScene_SkinSelect::OnInit( XUIMessageInit* pInitData, BOOL& bHandled ) } -HRESULT CScene_SkinSelect::OnKeyUp(XUIMessageInput* pInputData, BOOL& rfHandled) +int CScene_SkinSelect::OnKeyUp(XUIMessageInput* pInputData, bool& rfHandled) { if(m_bIgnoreInput) return S_OK; @@ -181,7 +181,7 @@ HRESULT CScene_SkinSelect::OnKeyUp(XUIMessageInput* pInputData, BOOL& rfHandled) } -HRESULT CScene_SkinSelect::OnKeyDown(XUIMessageInput* pInputData, BOOL& rfHandled) +int CScene_SkinSelect::OnKeyDown(XUIMessageInput* pInputData, bool& rfHandled) { if(m_bIgnoreInput) return S_OK; @@ -191,7 +191,7 @@ HRESULT CScene_SkinSelect::OnKeyDown(XUIMessageInput* pInputData, BOOL& rfHandle // ignore any key press if we are animating a move //if(m_bAnimatingMove) return S_OK; - HRESULT hr=S_OK; + int hr=S_OK; // Explicitly handle B button presses switch(pInputData->dwKeyCode) @@ -244,7 +244,7 @@ HRESULT CScene_SkinSelect::OnKeyDown(XUIMessageInput* pInputData, BOOL& rfHandle if(!m_currentPack->hasPurchasedFile( DLCManager::e_DLCType_Skin, skinFile->getPath() )) { // no - UINT uiIDA[1]; + unsigned int uiIDA[1]; uiIDA[0]=IDS_OK; // We need to upsell the full version @@ -264,7 +264,7 @@ HRESULT CScene_SkinSelect::OnKeyDown(XUIMessageInput* pInputData, BOOL& rfHandle // upsell DLC_INFO *pDLCInfo = app.GetDLCInfoForTrialOfferID(m_currentPack->getPurchaseOfferId()); - ULONGLONG ullOfferID_Full; + uint64_t ullOfferID_Full; if(pDLCInfo!=NULL) { @@ -278,7 +278,7 @@ HRESULT CScene_SkinSelect::OnKeyDown(XUIMessageInput* pInputData, BOOL& rfHandle // tell sentient about the upsell of the full version of the skin pack TelemetryManager->RecordUpsellPresented(pInputData->UserIndex, eSet_UpsellID_Skin_DLC, ullOfferID_Full & 0xFFFFFFFF); - UINT uiIDA[2]; + unsigned int uiIDA[2]; uiIDA[0]=IDS_CONFIRM_OK; uiIDA[1]=IDS_CONFIRM_CANCEL; @@ -327,7 +327,7 @@ HRESULT CScene_SkinSelect::OnKeyDown(XUIMessageInput* pInputData, BOOL& rfHandle #if 0 case VK_PAD_RSHOULDER: { - DWORD startingIndex = m_packIndex; + unsigned long startingIndex = m_packIndex; m_packIndex = getNextPackIndex(m_packIndex); if(startingIndex != m_packIndex) { @@ -337,7 +337,7 @@ HRESULT CScene_SkinSelect::OnKeyDown(XUIMessageInput* pInputData, BOOL& rfHandle break; case VK_PAD_LSHOULDER: { - DWORD startingIndex = m_packIndex; + unsigned long startingIndex = m_packIndex; m_packIndex = getPreviousPackIndex(m_packIndex); if(startingIndex != m_packIndex) { @@ -394,7 +394,7 @@ HRESULT CScene_SkinSelect::OnKeyDown(XUIMessageInput* pInputData, BOOL& rfHandle m_previewPreviousControls[0]->SetFacing(CXuiCtrlMinecraftSkinPreview::e_SkinPreviewFacing_Forward, true); int startFrame, endFrame; - HRESULT hr = m_charactersGroup.FindNamedFrame(L"CycleRight", &startFrame); + int hr = m_charactersGroup.FindNamedFrame(L"CycleRight", &startFrame); hr = m_charactersGroup.FindNamedFrame( L"EndCycleRight", &endFrame); hr = m_charactersGroup.PlayTimeline(startFrame, startFrame,endFrame,false,false); } @@ -403,7 +403,7 @@ HRESULT CScene_SkinSelect::OnKeyDown(XUIMessageInput* pInputData, BOOL& rfHandle { ui.AnimateKeyPress(pInputData->UserIndex, pInputData->dwKeyCode); CXuiSceneBase::PlayUISFX(eSFX_Scroll); - DWORD startingIndex = m_packIndex; + unsigned long startingIndex = m_packIndex; m_packIndex = getPreviousPackIndex(m_packIndex); if(startingIndex != m_packIndex) { @@ -431,7 +431,7 @@ HRESULT CScene_SkinSelect::OnKeyDown(XUIMessageInput* pInputData, BOOL& rfHandle m_previewNextControls[0]->SetFacing(CXuiCtrlMinecraftSkinPreview::e_SkinPreviewFacing_Forward, true); int startFrame, endFrame; - HRESULT hr = m_charactersGroup.FindNamedFrame(L"CycleLeft", &startFrame); + int hr = m_charactersGroup.FindNamedFrame(L"CycleLeft", &startFrame); hr = m_charactersGroup.FindNamedFrame( L"EndCycleLeft", &endFrame); hr = m_charactersGroup.PlayTimeline(startFrame, startFrame,endFrame,false,false); } @@ -440,7 +440,7 @@ HRESULT CScene_SkinSelect::OnKeyDown(XUIMessageInput* pInputData, BOOL& rfHandle { ui.AnimateKeyPress(pInputData->UserIndex, pInputData->dwKeyCode); CXuiSceneBase::PlayUISFX(eSFX_Scroll); - DWORD startingIndex = m_packIndex; + unsigned long startingIndex = m_packIndex; m_packIndex = getNextPackIndex(m_packIndex); if(startingIndex != m_packIndex) { @@ -550,7 +550,7 @@ HRESULT CScene_SkinSelect::OnKeyDown(XUIMessageInput* pInputData, BOOL& rfHandle //---------------------------------------------------------------------------------- // Handler for the button press message. //---------------------------------------------------------------------------------- -HRESULT CScene_SkinSelect::OnNotifyPressEx(HXUIOBJ hObjPressed, XUINotifyPress* pNotifyPressData, BOOL& rfHandled) +int CScene_SkinSelect::OnNotifyPressEx(HXUIOBJ hObjPressed, XUINotifyPress* pNotifyPressData, bool& rfHandled) { if(m_bIgnoreInput) return S_OK; @@ -560,7 +560,7 @@ HRESULT CScene_SkinSelect::OnNotifyPressEx(HXUIOBJ hObjPressed, XUINotifyPress* return S_OK; } -HRESULT CScene_SkinSelect::OnTransitionStart( XUIMessageTransition *pTransition, BOOL& bHandled ) +int CScene_SkinSelect::OnTransitionStart( XUIMessageTransition *pTransition, bool& bHandled ) { if(pTransition->dwTransAction==XUI_TRANSITION_ACTION_DESTROY ) return S_OK; @@ -572,7 +572,7 @@ HRESULT CScene_SkinSelect::OnTransitionStart( XUIMessageTransition *pTransition, return S_OK; } -HRESULT CScene_SkinSelect::OnTimelineEnd(HXUIOBJ hObjSource, BOOL& bHandled) +int CScene_SkinSelect::OnTimelineEnd(HXUIOBJ hObjSource, bool& bHandled) { if( hObjSource == m_charactersGroup ) { @@ -581,7 +581,7 @@ HRESULT CScene_SkinSelect::OnTimelineEnd(HXUIOBJ hObjSource, BOOL& bHandled) m_bSlidingSkins = false; int startFrame, endFrame; - HRESULT hr = m_charactersGroup.FindNamedFrame(L"Normal", &startFrame); + int hr = m_charactersGroup.FindNamedFrame(L"Normal", &startFrame); hr = m_charactersGroup.FindNamedFrame( L"Normal", &endFrame); hr = m_charactersGroup.PlayTimeline(startFrame, startFrame,endFrame,false,false); } @@ -602,7 +602,7 @@ HRESULT CScene_SkinSelect::OnTimelineEnd(HXUIOBJ hObjSource, BOOL& bHandled) } -HRESULT CScene_SkinSelect::OnCustomMessage_Splitscreenplayer(bool bJoining, BOOL& bHandled) +int CScene_SkinSelect::OnCustomMessage_Splitscreenplayer(bool bJoining, bool& bHandled) { bHandled=true; return app.AdjustSplitscreenScene_PlayerChanged(m_hObj,&m_OriginalPosition,m_iPad,bJoining,false); @@ -611,7 +611,7 @@ HRESULT CScene_SkinSelect::OnCustomMessage_Splitscreenplayer(bool bJoining, BOOL -HRESULT CScene_SkinSelect::OnBasePositionChanged() +int CScene_SkinSelect::OnBasePositionChanged() { updateClipping(); @@ -620,15 +620,15 @@ HRESULT CScene_SkinSelect::OnBasePositionChanged() void CScene_SkinSelect::handleSkinIndexChanged() { - BOOL showPrevious = false, showNext = false; - DWORD previousIndex = 0, nextIndex = 0; + bool showPrevious = false, showNext = false; + unsigned long previousIndex = 0, nextIndex = 0; wstring skinName = L""; wstring skinOrigin = L""; bool bSkinIsFree=false; bool bLicensed=false; DLCSkinFile *skinFile=NULL; DLCPack *Pack=NULL; - BYTE sidePreviewControlsL,sidePreviewControlsR; + uint8_t sidePreviewControlsL,sidePreviewControlsR; bool bNoSkinsToShow=false; TEXTURE_NAME backupTexture = TN_MOB_CHAR; @@ -778,7 +778,7 @@ void CScene_SkinSelect::handleSkinIndexChanged() wchar_t chars[256]; // turn off all displays - for(BYTE i = 0; i < sidePreviewControls; ++i) + for(uint8_t i = 0; i < sidePreviewControls; ++i) { m_previewNextControls[i]->SetShow(false); m_previewPreviousControls[i]->SetShow(false); @@ -816,7 +816,7 @@ void CScene_SkinSelect::handleSkinIndexChanged() sidePreviewControlsL=sidePreviewControlsR=sidePreviewControls; } - for(BYTE i = 0; i < sidePreviewControlsR; ++i) + for(uint8_t i = 0; i < sidePreviewControlsR; ++i) { if(showNext) { @@ -888,7 +888,7 @@ void CScene_SkinSelect::handleSkinIndexChanged() - for(BYTE i = 0; i < sidePreviewControlsL; ++i) + for(uint8_t i = 0; i < sidePreviewControlsL; ++i) { if(showPrevious) { @@ -1007,7 +1007,7 @@ void CScene_SkinSelect::handlePackIndexChanged() if(m_currentPack != NULL) { bool found; - DWORD currentSkinIndex = m_currentPack->getSkinIndexAt(m_currentSkinPath, found); + unsigned long currentSkinIndex = m_currentPack->getSkinIndexAt(m_currentSkinPath, found); if(found) m_skinIndex = currentSkinIndex; } else @@ -1017,8 +1017,8 @@ void CScene_SkinSelect::handlePackIndexChanged() case SKIN_SELECT_PACK_DEFAULT: if( !GET_IS_DLC_SKIN_FROM_BITMASK(m_originalSkinId) ) { - DWORD ugcSkinIndex = GET_UGC_SKIN_ID_FROM_BITMASK(m_originalSkinId); - DWORD defaultSkinIndex = GET_DEFAULT_SKIN_ID_FROM_BITMASK(m_originalSkinId); + unsigned long ugcSkinIndex = GET_UGC_SKIN_ID_FROM_BITMASK(m_originalSkinId); + unsigned long defaultSkinIndex = GET_DEFAULT_SKIN_ID_FROM_BITMASK(m_originalSkinId); if( ugcSkinIndex == 0 ) { m_skinIndex = (EDefaultSkins) defaultSkinIndex; @@ -1036,7 +1036,7 @@ void CScene_SkinSelect::handlePackIndexChanged() DLCPack *Pack=app.m_dlcManager.getPackContainingSkin(chars); if(Pack) { - DWORD currentSkinIndex = Pack->getSkinIndexAt(m_currentSkinPath, found); + unsigned long currentSkinIndex = Pack->getSkinIndexAt(m_currentSkinPath, found); if(found) m_skinIndex = app.GetPlayerFavoriteSkinsPos(m_iPad); } } @@ -1176,7 +1176,7 @@ TEXTURE_NAME CScene_SkinSelect::getTextureId(int skinIndex) return texture; } -int CScene_SkinSelect::getNextSkinIndex(DWORD sourceIndex) +int CScene_SkinSelect::getNextSkinIndex(unsigned long sourceIndex) { int nextSkin = sourceIndex; @@ -1210,7 +1210,7 @@ int CScene_SkinSelect::getNextSkinIndex(DWORD sourceIndex) return nextSkin; } -int CScene_SkinSelect::getPreviousSkinIndex(DWORD sourceIndex) +int CScene_SkinSelect::getPreviousSkinIndex(unsigned long sourceIndex) { int previousSkin = sourceIndex; switch(m_packIndex) @@ -1249,7 +1249,7 @@ int CScene_SkinSelect::getPreviousSkinIndex(DWORD sourceIndex) return previousSkin; } -int CScene_SkinSelect::getNextPackIndex(DWORD sourceIndex) +int CScene_SkinSelect::getNextPackIndex(unsigned long sourceIndex) { int nextPack = sourceIndex; ++nextPack; @@ -1261,7 +1261,7 @@ int CScene_SkinSelect::getNextPackIndex(DWORD sourceIndex) return nextPack; } -int CScene_SkinSelect::getPreviousPackIndex(DWORD sourceIndex) +int CScene_SkinSelect::getPreviousPackIndex(unsigned long sourceIndex) { int previousPack = sourceIndex; if(previousPack == SKIN_SELECT_PACK_DEFAULT) @@ -1285,10 +1285,10 @@ int CScene_SkinSelect::getPreviousPackIndex(DWORD sourceIndex) void CScene_SkinSelect::updateClipping() { - DWORD dwPropertyId; + unsigned long dwPropertyId; XUIElementPropVal propertyVal; propertyVal.Clear(); - HRESULT hr = XuiObjectGetPropertyId( m_charactersGroup.m_hObj, L"ClipChildren", &dwPropertyId); + int hr = XuiObjectGetPropertyId( m_charactersGroup.m_hObj, L"ClipChildren", &dwPropertyId); switch( CXuiSceneBase::GetPlayerBasePosition(m_iPad) ) { case CXuiSceneBase::e_BaseScene_Left: @@ -1317,7 +1317,7 @@ int CScene_SkinSelect::UnlockSkinReturned(void *pParam,int iPad,C4JStorage::EMes { if(ProfileManager.IsSignedIn(iPad)) { - ULONGLONG ullIndexA[1]; + uint64_t ullIndexA[1]; DLC_INFO *pDLCInfo = app.GetDLCInfoForTrialOfferID(pScene->m_currentPack->getPurchaseOfferId()); if(pDLCInfo!=NULL) @@ -1349,7 +1349,7 @@ int CScene_SkinSelect::UnlockSkinReturned(void *pParam,int iPad,C4JStorage::EMes return 0; } -HRESULT CScene_SkinSelect::OnCustomMessage_DLCInstalled() +int CScene_SkinSelect::OnCustomMessage_DLCInstalled() { // mounted DLC may have changed if(app.StartInstallDLCProcess(m_iPad)==false) @@ -1369,7 +1369,7 @@ HRESULT CScene_SkinSelect::OnCustomMessage_DLCInstalled() return S_OK; } -HRESULT CScene_SkinSelect::OnCustomMessage_DLCMountingComplete() +int CScene_SkinSelect::OnCustomMessage_DLCMountingComplete() { m_timer.SetShow( false ); diff --git a/src/client/Common/XUI/XUI_SkinSelect.h b/src/client/Common/XUI/XUI_SkinSelect.h index 73962d15..954da589 100644 --- a/src/client/Common/XUI/XUI_SkinSelect.h +++ b/src/client/Common/XUI/XUI_SkinSelect.h @@ -12,10 +12,10 @@ class CXuiCtrlMinecraftSkinPreview; class CScene_SkinSelect : public CXuiSceneImpl { private: - static WCHAR *wchDefaultNamesA[eDefaultSkins_Count]; + static wchar_t *wchDefaultNamesA[eDefaultSkins_Count]; // 4J Stu - How many to show on each side of the main control - static const BYTE sidePreviewControls = 4; + static const uint8_t sidePreviewControls = 4; enum ESkinSelectNavigation { @@ -96,26 +96,26 @@ protected: END_MAP_CHILD_CONTROLS() END_CONTROL_MAP() - HRESULT OnInit( XUIMessageInit* pInitData, BOOL& bHandled ); - HRESULT OnKeyDown(XUIMessageInput *pInputData, BOOL& bHandled); - HRESULT OnNotifyPressEx(HXUIOBJ hObjPressed, XUINotifyPress* pNotifyPressData,BOOL& rfHandled); - HRESULT OnKeyUp(XUIMessageInput *pInputData, BOOL& bHandled); - HRESULT OnTransitionStart( XUIMessageTransition *pTransition, BOOL& bHandled ); - HRESULT OnTimelineEnd(HXUIOBJ hObjSource, BOOL& bHandled); - HRESULT OnCustomMessage_Splitscreenplayer(bool bJoining, BOOL& bHandled); - HRESULT OnCustomMessage_DLCInstalled(); - HRESULT OnCustomMessage_DLCMountingComplete(); - HRESULT OnBasePositionChanged(); + int OnInit( XUIMessageInit* pInitData, bool& bHandled ); + int OnKeyDown(XUIMessageInput *pInputData, bool& bHandled); + int OnNotifyPressEx(HXUIOBJ hObjPressed, XUINotifyPress* pNotifyPressData,bool& rfHandled); + int OnKeyUp(XUIMessageInput *pInputData, bool& bHandled); + int OnTransitionStart( XUIMessageTransition *pTransition, bool& bHandled ); + int OnTimelineEnd(HXUIOBJ hObjSource, bool& bHandled); + int OnCustomMessage_Splitscreenplayer(bool bJoining, bool& bHandled); + int OnCustomMessage_DLCInstalled(); + int OnCustomMessage_DLCMountingComplete(); + int OnBasePositionChanged(); int m_iPad; D3DXVECTOR3 m_OriginalPosition; wstring m_currentSkinPath, m_selectedSkinPath, m_selectedCapePath; vector *m_vAdditionalSkinBoxes; //vector *m_vAdditionalModelParts; - DWORD m_originalSkinId; + unsigned long m_originalSkinId; DLCPack *m_currentPack; - DWORD m_packIndex, m_skinIndex; + unsigned long m_packIndex, m_skinIndex; public: // Define the class. The class name must match the ClassOverride property @@ -129,11 +129,11 @@ private: void updateCurrentFocus(); TEXTURE_NAME getTextureId(int skinIndex); - int getNextSkinIndex(DWORD sourceIndex); - int getPreviousSkinIndex(DWORD sourceIndex); + int getNextSkinIndex(unsigned long sourceIndex); + int getPreviousSkinIndex(unsigned long sourceIndex); - int getNextPackIndex(DWORD sourceIndex); - int getPreviousPackIndex(DWORD sourceIndex); + int getNextPackIndex(unsigned long sourceIndex); + int getPreviousPackIndex(unsigned long sourceIndex); void updateClipping(); @@ -143,7 +143,7 @@ private: bool m_bSlidingSkins, m_bAnimatingMove; - DWORD currentPackCount; + unsigned long currentPackCount; ESkinSelectNavigation m_currentNavigation; bool m_bIgnoreInput; diff --git a/src/client/Common/XUI/XUI_SocialPost.cpp b/src/client/Common/XUI/XUI_SocialPost.cpp index 6037393b..a734fe2d 100644 --- a/src/client/Common/XUI/XUI_SocialPost.cpp +++ b/src/client/Common/XUI/XUI_SocialPost.cpp @@ -19,7 +19,7 @@ //---------------------------------------------------------------------------------- // Performs initialization tasks - retrieves controls. //---------------------------------------------------------------------------------- -HRESULT CScene_SocialPost::OnInit( XUIMessageInit* pInitData, BOOL& bHandled ) +int CScene_SocialPost::OnInit( XUIMessageInit* pInitData, bool& bHandled ) { m_iPad = *(int *)pInitData->pvInitData; @@ -51,7 +51,7 @@ HRESULT CScene_SocialPost::OnInit( XUIMessageInit* pInitData, BOOL& bHandled ) m_EditCaption.SetCaretPosition((int)wCaption.length()); m_EditDesc.SetCaretPosition((int)wDesc.length()); - BOOL bHasAllText = /*( wTitle.length()!=0) && */(wCaption.length()!=0) && (wDesc.length()!=0); + bool bHasAllText = /*( wTitle.length()!=0) && */(wCaption.length()!=0) && (wDesc.length()!=0); m_OK.SetEnable(bHasAllText); @@ -66,7 +66,7 @@ HRESULT CScene_SocialPost::OnInit( XUIMessageInit* pInitData, BOOL& bHandled ) } -HRESULT CScene_SocialPost::OnNotifyValueChanged (HXUIOBJ hObjSource, XUINotifyValueChanged* pValueChangedData, BOOL& rfHandled) +int CScene_SocialPost::OnNotifyValueChanged (HXUIOBJ hObjSource, XUINotifyValueChanged* pValueChangedData, bool& rfHandled) { wstring wCaption = m_EditCaption.GetText(); wstring wDesc = m_EditDesc.GetText(); @@ -78,14 +78,14 @@ wstring wDesc = m_EditDesc.GetText(); wstring wCaption = m_EditCaption.GetText(); wstring wDesc = m_EditDesc.GetText(); - BOOL bHasAllText = /*( wTitle.length()!=0) &&*/ (wCaption.length()!=0) && (wDesc.length()!=0); + bool bHasAllText = /*( wTitle.length()!=0) &&*/ (wCaption.length()!=0) && (wDesc.length()!=0); m_OK.SetEnable(bHasAllText); } return S_OK; } -HRESULT CScene_SocialPost::OnControlNavigate(XUIMessageControlNavigate *pControlNavigateData, BOOL& bHandled) +int CScene_SocialPost::OnControlNavigate(XUIMessageControlNavigate *pControlNavigateData, bool& bHandled) { pControlNavigateData->hObjDest=XuiControlGetNavigation(pControlNavigateData->hObjSource,pControlNavigateData->nControlNavigate,true,true); @@ -101,7 +101,7 @@ HRESULT CScene_SocialPost::OnControlNavigate(XUIMessageControlNavigate *pControl //---------------------------------------------------------------------------------- // Handler for the button press message. //---------------------------------------------------------------------------------- -HRESULT CScene_SocialPost::OnNotifyPressEx(HXUIOBJ hObjPressed, XUINotifyPress* pNotifyPressData, BOOL& rfHandled) +int CScene_SocialPost::OnNotifyPressEx(HXUIOBJ hObjPressed, XUINotifyPress* pNotifyPressData, bool& rfHandled) { // This assumes all buttons can only be pressed with the A button ui.AnimateKeyPress(pNotifyPressData->UserIndex, VK_PAD_A); @@ -119,7 +119,7 @@ HRESULT CScene_SocialPost::OnNotifyPressEx(HXUIOBJ hObjPressed, XUINotifyPress* } -HRESULT CScene_SocialPost::OnKeyDown(XUIMessageInput* pInputData, BOOL& rfHandled) +int CScene_SocialPost::OnKeyDown(XUIMessageInput* pInputData, bool& rfHandled) { ui.AnimateKeyPress(pInputData->UserIndex, pInputData->dwKeyCode); @@ -140,7 +140,7 @@ HRESULT CScene_SocialPost::OnKeyDown(XUIMessageInput* pInputData, BOOL& rfHandle } -HRESULT CScene_SocialPost::OnCustomMessage_Splitscreenplayer(bool bJoining, BOOL& bHandled) +int CScene_SocialPost::OnCustomMessage_Splitscreenplayer(bool bJoining, bool& bHandled) { bHandled=true; return app.AdjustSplitscreenScene_PlayerChanged(m_hObj,&m_OriginalPosition,m_iPad,bJoining,false); diff --git a/src/client/Common/XUI/XUI_SocialPost.h b/src/client/Common/XUI/XUI_SocialPost.h index 0dd37fa6..fbde2a5b 100644 --- a/src/client/Common/XUI/XUI_SocialPost.h +++ b/src/client/Common/XUI/XUI_SocialPost.h @@ -38,12 +38,12 @@ class CScene_SocialPost : public CXuiSceneImpl END_CONTROL_MAP() - HRESULT OnInit( XUIMessageInit* pInitData, BOOL& bHandled ); - HRESULT OnNotifyPressEx(HXUIOBJ hObjPressed, XUINotifyPress* pNotifyPressData, BOOL& rfHandled); - HRESULT OnKeyDown(XUIMessageInput* pInputData, BOOL& rfHandled); - HRESULT OnNotifyValueChanged (HXUIOBJ hObjSource, XUINotifyValueChanged* pValueChangedData, BOOL& rfHandled); - HRESULT OnControlNavigate(XUIMessageControlNavigate *pControlNavigateData, BOOL& bHandled); - HRESULT OnCustomMessage_Splitscreenplayer(bool bJoining, BOOL& bHandled); + int OnInit( XUIMessageInit* pInitData, bool& bHandled ); + int OnNotifyPressEx(HXUIOBJ hObjPressed, XUINotifyPress* pNotifyPressData, bool& rfHandled); + int OnKeyDown(XUIMessageInput* pInputData, bool& rfHandled); + int OnNotifyValueChanged (HXUIOBJ hObjSource, XUINotifyValueChanged* pValueChangedData, bool& rfHandled); + int OnControlNavigate(XUIMessageControlNavigate *pControlNavigateData, bool& bHandled); + int OnCustomMessage_Splitscreenplayer(bool bJoining, bool& bHandled); D3DXVECTOR3 m_OriginalPosition; int m_iPad; diff --git a/src/client/Common/XUI/XUI_Teleport.cpp b/src/client/Common/XUI/XUI_Teleport.cpp index 41c4141d..1e213e74 100644 --- a/src/client/Common/XUI/XUI_Teleport.cpp +++ b/src/client/Common/XUI/XUI_Teleport.cpp @@ -19,7 +19,7 @@ //---------------------------------------------------------------------------------- // Performs initialization tasks - retrieves controls. //---------------------------------------------------------------------------------- -HRESULT CScene_Teleport::OnInit( XUIMessageInit* pInitData, BOOL& bHandled ) +int CScene_Teleport::OnInit( XUIMessageInit* pInitData, bool& bHandled ) { TeleportMenuInitData *initParam = (TeleportMenuInitData *)pInitData->pvInitData; @@ -44,10 +44,10 @@ HRESULT CScene_Teleport::OnInit( XUIMessageInit* pInitData, BOOL& bHandled ) app.AdjustSplitscreenScene(m_hObj,&m_OriginalPosition,m_iPad); } - DWORD playerCount = g_NetworkManager.GetPlayerCount(); + unsigned long playerCount = g_NetworkManager.GetPlayerCount(); m_playersCount = 0; - for(DWORD i = 0; i < playerCount; ++i) + for(unsigned long i = 0; i < playerCount; ++i) { INetworkPlayer *player = g_NetworkManager.GetPlayerByIndex( i ); @@ -67,17 +67,17 @@ HRESULT CScene_Teleport::OnInit( XUIMessageInit* pInitData, BOOL& bHandled ) return S_OK; } -HRESULT CScene_Teleport::OnDestroy() +int CScene_Teleport::OnDestroy() { g_NetworkManager.UnRegisterPlayerChangedCallback(m_iPad, &CScene_Teleport::OnPlayerChanged, this); return S_OK; } -HRESULT CScene_Teleport::OnKeyDown(XUIMessageInput* pInputData, BOOL& rfHandled) +int CScene_Teleport::OnKeyDown(XUIMessageInput* pInputData, bool& rfHandled) { ui.AnimateKeyPress(pInputData->UserIndex, pInputData->dwKeyCode); - HRESULT hr = S_OK; + int hr = S_OK; switch(pInputData->dwKeyCode) { @@ -98,7 +98,7 @@ HRESULT CScene_Teleport::OnKeyDown(XUIMessageInput* pInputData, BOOL& rfHandled) //---------------------------------------------------------------------------------- // Handler for the button press message. //---------------------------------------------------------------------------------- -HRESULT CScene_Teleport::OnNotifyPressEx(HXUIOBJ hObjPressed, XUINotifyPress* pNotifyPressData, BOOL& rfHandled) +int CScene_Teleport::OnNotifyPressEx(HXUIOBJ hObjPressed, XUINotifyPress* pNotifyPressData, bool& rfHandled) { // This assumes all buttons can only be pressed with the A button ui.AnimateKeyPress(pNotifyPressData->UserIndex, VK_PAD_A); @@ -160,7 +160,7 @@ void CScene_Teleport::OnPlayerChanged(void *callbackParam, INetworkPlayer *pPlay } } -HRESULT CScene_Teleport::OnGetSourceDataText(XUIMessageGetSourceText *pGetSourceTextData, BOOL& bHandled) +int CScene_Teleport::OnGetSourceDataText(XUIMessageGetSourceText *pGetSourceTextData, bool& bHandled) { if( pGetSourceTextData->bItemData ) { @@ -185,7 +185,7 @@ HRESULT CScene_Teleport::OnGetSourceDataText(XUIMessageGetSourceText *pGetSource pGetSourceTextData->szText = L""; } - HRESULT hr; + int hr; HXUIOBJ hButton, hVisual, hPlayerIcon, hVoiceIcon; hButton = playersList.GetItemControl(pGetSourceTextData->iItem); hr=XuiControlGetVisual(hButton,&hVisual); @@ -286,7 +286,7 @@ HRESULT CScene_Teleport::OnGetSourceDataText(XUIMessageGetSourceText *pGetSource return S_OK; } -HRESULT CScene_Teleport::OnGetSourceDataImage(XUIMessageGetSourceImage *pGetSourceImageData,BOOL& bHandled) +int CScene_Teleport::OnGetSourceDataImage(XUIMessageGetSourceImage *pGetSourceImageData,bool& bHandled) { if( pGetSourceImageData->bItemData ) { @@ -298,14 +298,14 @@ HRESULT CScene_Teleport::OnGetSourceDataImage(XUIMessageGetSourceImage *pGetSour return S_OK; } -HRESULT CScene_Teleport::OnGetItemCountAll(XUIMessageGetItemCount *pGetItemCountData, BOOL& bHandled) +int CScene_Teleport::OnGetItemCountAll(XUIMessageGetItemCount *pGetItemCountData, bool& bHandled) { pGetItemCountData->cItems = m_playersCount; bHandled = true; return S_OK; } -HRESULT CScene_Teleport::OnCustomMessage_Splitscreenplayer(bool bJoining, BOOL& bHandled) +int CScene_Teleport::OnCustomMessage_Splitscreenplayer(bool bJoining, bool& bHandled) { bHandled=true; return app.AdjustSplitscreenScene_PlayerChanged(m_hObj,&m_OriginalPosition,m_iPad,bJoining); diff --git a/src/client/Common/XUI/XUI_Teleport.h b/src/client/Common/XUI/XUI_Teleport.h index cf60eab0..7b22ada4 100644 --- a/src/client/Common/XUI/XUI_Teleport.h +++ b/src/client/Common/XUI/XUI_Teleport.h @@ -35,16 +35,16 @@ protected: MAP_CONTROL(IDC_Title, m_title) END_CONTROL_MAP() - HRESULT OnInit( XUIMessageInit* pInitData, BOOL& bHandled ); - HRESULT OnDestroy(); - HRESULT OnNotifyPressEx(HXUIOBJ hObjPressed, XUINotifyPress* pNotifyPressData, BOOL& rfHandled); - HRESULT OnKeyDown(XUIMessageInput* pInputData, BOOL& rfHandled); + int OnInit( XUIMessageInit* pInitData, bool& bHandled ); + int OnDestroy(); + int OnNotifyPressEx(HXUIOBJ hObjPressed, XUINotifyPress* pNotifyPressData, bool& rfHandled); + int OnKeyDown(XUIMessageInput* pInputData, bool& rfHandled); - HRESULT OnCustomMessage_Splitscreenplayer(bool bJoining, BOOL& bHandled); + int OnCustomMessage_Splitscreenplayer(bool bJoining, bool& bHandled); - HRESULT OnGetSourceDataText(XUIMessageGetSourceText *pGetSourceTextData, BOOL& bHandled); - HRESULT OnGetSourceDataImage(XUIMessageGetSourceImage *pGetSourceImageData,BOOL& bHandled); - HRESULT OnGetItemCountAll(XUIMessageGetItemCount *pGetItemCountData, BOOL& bHandled); + int OnGetSourceDataText(XUIMessageGetSourceText *pGetSourceTextData, bool& bHandled); + int OnGetSourceDataImage(XUIMessageGetSourceImage *pGetSourceImageData,bool& bHandled); + int OnGetItemCountAll(XUIMessageGetItemCount *pGetItemCountData, bool& bHandled); public: @@ -60,5 +60,5 @@ private: bool m_teleportToPlayer; int m_playersCount; - BYTE m_players[MINECRAFT_NET_MAX_PLAYERS]; // An array of QNet small-id's + uint8_t m_players[MINECRAFT_NET_MAX_PLAYERS]; // An array of QNet small-id's }; diff --git a/src/client/Common/XUI/XUI_TextEntry.cpp b/src/client/Common/XUI/XUI_TextEntry.cpp index 8281dab2..171a075b 100644 --- a/src/client/Common/XUI/XUI_TextEntry.cpp +++ b/src/client/Common/XUI/XUI_TextEntry.cpp @@ -9,7 +9,7 @@ CScene_TextEntry::CommandParams CScene_TextEntry::CommandA[CScene_TextEntry::eCo { L"give", L"%s%c%s" } }; -HRESULT CScene_TextEntry::Init_Commands() +int CScene_TextEntry::Init_Commands() { for(int i=0;ipvInitData; @@ -29,11 +29,11 @@ HRESULT CScene_TextEntry::OnInit( XUIMessageInit* pInitData, BOOL& bHandled ) m_wchInitialChar=params->wch; delete params; - WCHAR wchEditText[40]; + wchar_t wchEditText[40]; Init_Commands(); - ZeroMemory(wchEditText,sizeof(WCHAR)*40); + ZeroMemory(wchEditText,sizeof(wchar_t)*40); wchEditText[0]=tolower(m_wchInitialChar); m_EditText.SetTextLimit(40); @@ -47,12 +47,12 @@ HRESULT CScene_TextEntry::OnInit( XUIMessageInit* pInitData, BOOL& bHandled ) return S_OK; } -HRESULT CScene_TextEntry::OnNotifyValueChanged (HXUIOBJ hObjSource, XUINotifyValueChanged* pValueChangedData, BOOL& rfHandled) +int CScene_TextEntry::OnNotifyValueChanged (HXUIOBJ hObjSource, XUINotifyValueChanged* pValueChangedData, bool& rfHandled) { // If the user presses return, interpret the string, and exit if(pValueChangedData->nValue==10) { - LPCWSTR pText = m_EditText.GetText(); + const wchar_t* pText = m_EditText.GetText(); if(pText) { @@ -67,7 +67,7 @@ HRESULT CScene_TextEntry::OnNotifyValueChanged (HXUIOBJ hObjSource, XUINotifyVal return S_OK; } -HRESULT CScene_TextEntry::OnKeyDown(XUIMessageInput* pInputData, BOOL& rfHandled) +int CScene_TextEntry::OnKeyDown(XUIMessageInput* pInputData, bool& rfHandled) { ui.AnimateKeyPress(pInputData->UserIndex, pInputData->dwKeyCode); @@ -76,7 +76,7 @@ HRESULT CScene_TextEntry::OnKeyDown(XUIMessageInput* pInputData, BOOL& rfHandled { case VK_PAD_A: { - LPCWSTR pText = m_EditText.GetText(); + const wchar_t* pText = m_EditText.GetText(); if(pText) { @@ -99,12 +99,12 @@ HRESULT CScene_TextEntry::OnKeyDown(XUIMessageInput* pInputData, BOOL& rfHandled return S_OK; } -HRESULT CScene_TextEntry::InterpretString(wstring &wsText) +int CScene_TextEntry::InterpretString(wstring &wsText) { wstring wsFormat; - WCHAR wchCommand[40]; + wchar_t wchCommand[40]; int iCommand=-1; - WCHAR wchSep[2]; + wchar_t wchSep[2]; #ifdef __PS3__ // 4J Stu - The Xbox version uses swscanf_s which isn't available in GCC. diff --git a/src/client/Common/XUI/XUI_TextEntry.h b/src/client/Common/XUI/XUI_TextEntry.h index c834e760..a30154df 100644 --- a/src/client/Common/XUI/XUI_TextEntry.h +++ b/src/client/Common/XUI/XUI_TextEntry.h @@ -9,14 +9,14 @@ public: typedef struct _XuiTextInputParams { int iPad; - WCHAR wch; + wchar_t wch; } XuiTextInputParams; typedef struct _CommamndParams { - WCHAR wchCommand[40]; - WCHAR wchFormat[40]; + wchar_t wchCommand[40]; + wchar_t wchFormat[40]; } CommandParams; @@ -44,12 +44,12 @@ protected: END_CONTROL_MAP() - HRESULT OnInit( XUIMessageInit* pInitData, BOOL& bHandled ); - HRESULT OnNotifyValueChanged (HXUIOBJ hObjSource, XUINotifyValueChanged* pValueChangedData, BOOL& rfHandled); - HRESULT OnKeyDown(XUIMessageInput* pInputData, BOOL& rfHandled); + int OnInit( XUIMessageInit* pInitData, bool& bHandled ); + int OnNotifyValueChanged (HXUIOBJ hObjSource, XUINotifyValueChanged* pValueChangedData, bool& rfHandled); + int OnKeyDown(XUIMessageInput* pInputData, bool& rfHandled); - HRESULT InterpretString(wstring &wsText); - HRESULT Init_Commands(); + int InterpretString(wstring &wsText); + int Init_Commands(); public: // Define the class. The class name must match the ClassOverride property @@ -58,7 +58,7 @@ public: private: int m_iPad; - WCHAR m_wchInitialChar; + wchar_t m_wchInitialChar; static CommandParams CommandA[eCommand_MAX]; unordered_map m_CommandSet; }; \ No newline at end of file diff --git a/src/client/Common/XUI/XUI_TransferToXboxOne.cpp b/src/client/Common/XUI/XUI_TransferToXboxOne.cpp index 993f6221..a813b16e 100644 --- a/src/client/Common/XUI/XUI_TransferToXboxOne.cpp +++ b/src/client/Common/XUI/XUI_TransferToXboxOne.cpp @@ -13,7 +13,7 @@ //---------------------------------------------------------------------------------- // Performs initialization tasks - retrieves controls. //---------------------------------------------------------------------------------- -HRESULT CScene_TransferToXboxOne::OnInit( XUIMessageInit* pInitData, BOOL& bHandled ) +int CScene_TransferToXboxOne::OnInit( XUIMessageInit* pInitData, bool& bHandled ) { m_iX=-1; m_params = (LoadMenuInitData *)pInitData->pvInitData; @@ -24,7 +24,7 @@ HRESULT CScene_TransferToXboxOne::OnInit( XUIMessageInit* pInitData, BOOL& bHand m_bIgnoreInput=false; MapChildControls(); - VOID *pObj; + void *pObj; XuiObjectFromHandle( m_SavesSlotList, &pObj ); m_pSavesSlotList = (CXuiCtrl4JList *)pObj; @@ -66,7 +66,7 @@ HRESULT CScene_TransferToXboxOne::OnInit( XUIMessageInit* pInitData, BOOL& bHand // create dummy slots for(int i=0;im_bWaitingForWrite=false; @@ -95,7 +95,7 @@ int CScene_TransferToXboxOne::TMSPPWriteReturned(LPVOID pParam,int iPad,int iUse //---------------------------------------------------------------------------------- // TMSPPSlotListReturned callback //---------------------------------------------------------------------------------- -int CScene_TransferToXboxOne::TMSPPDeleteReturned(LPVOID pParam,int iPad,int iUserData) +int CScene_TransferToXboxOne::TMSPPDeleteReturned(void* pParam,int iPad,int iUserData) { CScene_TransferToXboxOne* pClass = (CScene_TransferToXboxOne *) pParam; pClass->m_SavesSlotListTimer.SetShow(false); @@ -114,7 +114,7 @@ int CScene_TransferToXboxOne::TMSPPDeleteReturned(LPVOID pParam,int iPad,int iUs for(int i=0;im_MaxSlotC;i++) { - memcpy(pClass->m_pSlotDataA[i].wchSaveTitle,app.GetString(IDS_XBONE_EMPTYSLOT),sizeof(WCHAR)*XCONTENT_MAX_DISPLAYNAME_LENGTH); + memcpy(pClass->m_pSlotDataA[i].wchSaveTitle,app.GetString(IDS_XBONE_EMPTYSLOT),sizeof(wchar_t)*XCONTENT_MAX_DISPLAYNAME_LENGTH); ListInfo.pwszText = app.GetString(IDS_XBONE_EMPTYSLOT); ListInfo.fEnabled = true; ListInfo.iData = -1; @@ -127,7 +127,7 @@ int CScene_TransferToXboxOne::TMSPPDeleteReturned(LPVOID pParam,int iPad,int iUs //---------------------------------------------------------------------------------- // TMSPPSlotListReturned callback //---------------------------------------------------------------------------------- -int CScene_TransferToXboxOne::TMSPPSlotListReturned(LPVOID pParam,int iPad,int iUserData,C4JStorage::PTMSPP_FILEDATA pFileData, LPCSTR szFilename) +int CScene_TransferToXboxOne::TMSPPSlotListReturned(void* pParam,int iPad,int iUserData,C4JStorage::PTMSPP_FILEDATA pFileData, const char* szFilename) { CScene_TransferToXboxOne* pClass = (CScene_TransferToXboxOne *) pParam; unsigned int uiSlotListFileSlots=*((unsigned int *)pFileData->pbData); @@ -139,7 +139,7 @@ int CScene_TransferToXboxOne::TMSPPSlotListReturned(LPVOID pParam,int iPad,int i // set the empty slot strings for(int i=0;im_MaxSlotC;i++) { - memcpy(pClass->m_pSlotDataA[i].wchSaveTitle,app.GetString(IDS_XBONE_EMPTYSLOT),sizeof(WCHAR)*XCONTENT_MAX_DISPLAYNAME_LENGTH); + memcpy(pClass->m_pSlotDataA[i].wchSaveTitle,app.GetString(IDS_XBONE_EMPTYSLOT),sizeof(wchar_t)*XCONTENT_MAX_DISPLAYNAME_LENGTH); } // update our slot info with the data from the file - might have less slots unsigned int uiNewSlotsC=(pClass->m_MaxSlotCm_MaxSlotC:uiSlotListFileSlots; @@ -148,7 +148,7 @@ int CScene_TransferToXboxOne::TMSPPSlotListReturned(LPVOID pParam,int iPad,int i CXuiCtrl4JList::LIST_ITEM_INFO ListInfo; ZeroMemory(&ListInfo,sizeof(CXuiCtrl4JList::LIST_ITEM_INFO)); - PBYTE pbImageData=pClass->m_pbSlotListFile + sizeof(unsigned int) + sizeof(SLOTDATA)*uiSlotListFileSlots; + uint8_t* pbImageData=pClass->m_pbSlotListFile + sizeof(unsigned int) + sizeof(SLOTDATA)*uiSlotListFileSlots; // fill out the slot info for(int i=0;im_MaxSlotC;i++) @@ -185,7 +185,7 @@ int CScene_TransferToXboxOne::TMSPPSlotListReturned(LPVOID pParam,int iPad,int i //---------------------------------------------------------------------------------- // Handler for OnDestroy //---------------------------------------------------------------------------------- -HRESULT CScene_TransferToXboxOne::OnDestroy() +int CScene_TransferToXboxOne::OnDestroy() { return S_OK; } @@ -193,7 +193,7 @@ HRESULT CScene_TransferToXboxOne::OnDestroy() //---------------------------------------------------------------------------------- // Handler for the button press message. //---------------------------------------------------------------------------------- -HRESULT CScene_TransferToXboxOne::OnNotifyPressEx(HXUIOBJ hObjPressed, XUINotifyPress* pNotifyPressData, BOOL& rfHandled) +int CScene_TransferToXboxOne::OnNotifyPressEx(HXUIOBJ hObjPressed, XUINotifyPress* pNotifyPressData, bool& rfHandled) { if(m_bIgnoreInput) return S_OK; @@ -227,7 +227,7 @@ HRESULT CScene_TransferToXboxOne::OnNotifyPressEx(HXUIOBJ hObjPressed, XUINotify } // update the data - memcpy(m_pSlotDataA[iIndex].wchSaveTitle,m_XContentData.szDisplayName,sizeof(WCHAR)*XCONTENT_MAX_DISPLAYNAME_LENGTH); + memcpy(m_pSlotDataA[iIndex].wchSaveTitle,m_XContentData.szDisplayName,sizeof(wchar_t)*XCONTENT_MAX_DISPLAYNAME_LENGTH); m_pSavesSlotList->UpdateText(iIndex,m_pSlotDataA[iIndex].wchSaveTitle); // if there is no thumbnail, retrieve the default one from the file. @@ -250,10 +250,10 @@ HRESULT CScene_TransferToXboxOne::OnNotifyPressEx(HXUIOBJ hObjPressed, XUINotify return S_OK; } -HRESULT CScene_TransferToXboxOne::BuildSlotFile(int iIndexBeingUpdated,PBYTE pbImageData,DWORD dwImageBytes ) +int CScene_TransferToXboxOne::BuildSlotFile(int iIndexBeingUpdated,uint8_t* pbImageData,unsigned long dwImageBytes ) { SLOTDATA *pCurrentSlotData=NULL; - PBYTE pbCurrentSlotDataPtr=NULL; + uint8_t* pbCurrentSlotDataPtr=NULL; // there may be no slot file yet if(m_pbSlotListFile!=NULL) { @@ -277,10 +277,10 @@ HRESULT CScene_TransferToXboxOne::BuildSlotFile(int iIndexBeingUpdated,PBYTE pbI } } - PBYTE pbNewSlotFileData= new BYTE [uiBytesRequired]; + uint8_t* pbNewSlotFileData= new uint8_t [uiBytesRequired]; *((unsigned int *)pbNewSlotFileData)=m_MaxSlotC; - PBYTE pbNewSlotFileDataSlots=pbNewSlotFileData + sizeof(unsigned int); - PBYTE pbNewSlotImageDataPtr=pbNewSlotFileData + sizeof(unsigned int) + sizeof(SLOTDATA)*m_MaxSlotC; + uint8_t* pbNewSlotFileDataSlots=pbNewSlotFileData + sizeof(unsigned int); + uint8_t* pbNewSlotImageDataPtr=pbNewSlotFileData + sizeof(unsigned int) + sizeof(SLOTDATA)*m_MaxSlotC; SLOTDATA *pNewSlotData=(SLOTDATA *)pbNewSlotFileDataSlots; // copy the slot info into the new memory, just after the first int @@ -323,7 +323,7 @@ HRESULT CScene_TransferToXboxOne::BuildSlotFile(int iIndexBeingUpdated,PBYTE pbI LoadingInputParams *loadingParams = new LoadingInputParams(); loadingParams->func = &CScene_TransferToXboxOne::UploadSaveForXboxOneThreadProc; - loadingParams->lpParam = (LPVOID)this; + loadingParams->lpParam = (void*)this; UIFullscreenProgressCompletionData *completionData = new UIFullscreenProgressCompletionData(); completionData->bShowBackground=true; @@ -338,9 +338,9 @@ HRESULT CScene_TransferToXboxOne::BuildSlotFile(int iIndexBeingUpdated,PBYTE pbI return S_OK; } -int CScene_TransferToXboxOne::UploadSaveForXboxOneThreadProc( LPVOID lpParameter ) +int CScene_TransferToXboxOne::UploadSaveForXboxOneThreadProc( void* lpParameter ) { - HRESULT hr = S_OK; + int hr = S_OK; char szFilename[32]; CScene_TransferToXboxOne* pClass = (CScene_TransferToXboxOne *) lpParameter; Minecraft *pMinecraft = Minecraft::GetInstance(); @@ -466,7 +466,7 @@ int CScene_TransferToXboxOne::LoadSaveDataReturned(void *pParam,bool bContinue) if(bContinue==true) { unsigned int uiFileSize = StorageManager.GetSaveSize(); - pClass->m_pvSaveMem = new BYTE [uiFileSize]; + pClass->m_pvSaveMem = new uint8_t [uiFileSize]; pClass->m_uiStorageLength=0; StorageManager.GetSaveData( pClass->m_pvSaveMem, &pClass->m_uiStorageLength ); @@ -477,7 +477,7 @@ int CScene_TransferToXboxOne::LoadSaveDataReturned(void *pParam,bool bContinue) return 0; } -HRESULT CScene_TransferToXboxOne::OnKeyDown(XUIMessageInput* pInputData, BOOL& rfHandled) +int CScene_TransferToXboxOne::OnKeyDown(XUIMessageInput* pInputData, bool& rfHandled) { if(m_bIgnoreInput) return S_OK; @@ -489,7 +489,7 @@ HRESULT CScene_TransferToXboxOne::OnKeyDown(XUIMessageInput* pInputData, BOOL& r ui.AnimateKeyPress(pInputData->UserIndex, pInputData->dwKeyCode); - HRESULT hr = S_OK; + int hr = S_OK; // Explicitly handle B button presses switch(pInputData->dwKeyCode) @@ -517,7 +517,7 @@ HRESULT CScene_TransferToXboxOne::OnKeyDown(XUIMessageInput* pInputData, BOOL& r return hr; } -HRESULT CScene_TransferToXboxOne::OnNotifySelChanged(HXUIOBJ hObjSource, XUINotifySelChanged *pNotifySelChangedData, BOOL& bHandled) +int CScene_TransferToXboxOne::OnNotifySelChanged(HXUIOBJ hObjSource, XUINotifySelChanged *pNotifySelChangedData, bool& bHandled) { //if(m_bReady) @@ -529,7 +529,7 @@ HRESULT CScene_TransferToXboxOne::OnNotifySelChanged(HXUIOBJ hObjSource, XUINoti } -HRESULT CScene_TransferToXboxOne::OnTransitionStart( XUIMessageTransition *pTransition, BOOL& bHandled ) +int CScene_TransferToXboxOne::OnTransitionStart( XUIMessageTransition *pTransition, bool& bHandled ) { //if(pTransition->dwTransAction==XUI_TRANSITION_ACTION_DESTROY ) return S_OK; @@ -545,7 +545,7 @@ HRESULT CScene_TransferToXboxOne::OnTransitionStart( XUIMessageTransition *pTran return S_OK; } -HRESULT CScene_TransferToXboxOne::OnFontRendererChange() +int CScene_TransferToXboxOne::OnFontRendererChange() { // update the tooltips CXuiSceneBase::SetTooltips( DEFAULT_XUI_MENU_USER, IDS_TOOLTIPS_SELECT, IDS_TOOLTIPS_BACK, m_iX, -1,-1,-1,-1,-1,-1,true); @@ -553,7 +553,7 @@ HRESULT CScene_TransferToXboxOne::OnFontRendererChange() return S_OK; } -HRESULT CScene_TransferToXboxOne::OnNotifySetFocus(HXUIOBJ hObjSource, XUINotifyFocus *pNotifyFocusData, BOOL& bHandled) +int CScene_TransferToXboxOne::OnNotifySetFocus(HXUIOBJ hObjSource, XUINotifyFocus *pNotifyFocusData, bool& bHandled) { // update the tooltips CXuiSceneBase::SetTooltips( DEFAULT_XUI_MENU_USER, IDS_TOOLTIPS_SELECT, IDS_TOOLTIPS_BACK, m_iX, -1,-1,-1,-1,-1,-1,true); @@ -561,7 +561,7 @@ HRESULT CScene_TransferToXboxOne::OnNotifySetFocus(HXUIOBJ hObjSource, XUINotify return S_OK; } -HRESULT CScene_TransferToXboxOne::OnNotifyKillFocus(HXUIOBJ hObjSource, XUINotifyFocus *pNotifyFocusData, BOOL& bHandled) +int CScene_TransferToXboxOne::OnNotifyKillFocus(HXUIOBJ hObjSource, XUINotifyFocus *pNotifyFocusData, bool& bHandled) { return S_OK; } diff --git a/src/client/Common/XUI/XUI_TransferToXboxOne.h b/src/client/Common/XUI/XUI_TransferToXboxOne.h index 4167a16b..425bc720 100644 --- a/src/client/Common/XUI/XUI_TransferToXboxOne.h +++ b/src/client/Common/XUI/XUI_TransferToXboxOne.h @@ -13,7 +13,7 @@ protected: typedef struct { - WCHAR wchSaveTitle[XCONTENT_MAX_DISPLAYNAME_LENGTH]; + wchar_t wchSaveTitle[XCONTENT_MAX_DISPLAYNAME_LENGTH]; unsigned int uiImageLength; } SLOTDATA; @@ -41,17 +41,17 @@ protected: END_CONTROL_MAP() - HRESULT OnInit( XUIMessageInit* pInitData, BOOL& bHandled ); - HRESULT OnDestroy(); - HRESULT OnNotifyPressEx(HXUIOBJ hObjPressed, XUINotifyPress* pNotifyPressData,BOOL& rfHandled); - HRESULT OnKeyDown(XUIMessageInput* pInputData, BOOL& rfHandled); - HRESULT OnNavReturn(HXUIOBJ hObj,BOOL& rfHandled); - HRESULT OnNotifySelChanged(HXUIOBJ hObjSource, XUINotifySelChanged *pNotifySelChangedData, BOOL& bHandled); - HRESULT OnNotifySetFocus(HXUIOBJ hObjSource, XUINotifyFocus *pNotifyFocusData, BOOL& bHandled); - HRESULT OnNotifyKillFocus(HXUIOBJ hObjSource, XUINotifyFocus *pNotifyFocusData, BOOL& bHandled); - HRESULT OnTimer( XUIMessageTimer *pTimer, BOOL& bHandled ); - HRESULT OnTransitionStart( XUIMessageTransition *pTransition, BOOL& bHandled ); - HRESULT OnFontRendererChange(); + int OnInit( XUIMessageInit* pInitData, bool& bHandled ); + int OnDestroy(); + int OnNotifyPressEx(HXUIOBJ hObjPressed, XUINotifyPress* pNotifyPressData,bool& rfHandled); + int OnKeyDown(XUIMessageInput* pInputData, bool& rfHandled); + int OnNavReturn(HXUIOBJ hObj,bool& rfHandled); + int OnNotifySelChanged(HXUIOBJ hObjSource, XUINotifySelChanged *pNotifySelChangedData, bool& bHandled); + int OnNotifySetFocus(HXUIOBJ hObjSource, XUINotifyFocus *pNotifyFocusData, bool& bHandled); + int OnNotifyKillFocus(HXUIOBJ hObjSource, XUINotifyFocus *pNotifyFocusData, bool& bHandled); + int OnTimer( XUIMessageTimer *pTimer, bool& bHandled ); + int OnTransitionStart( XUIMessageTransition *pTransition, bool& bHandled ); + int OnFontRendererChange(); public: @@ -59,13 +59,13 @@ public: // set for the scene in the UI Authoring tool. XUI_IMPLEMENT_CLASS( CScene_TransferToXboxOne, L"CScene_TransferToXboxOne", XUI_CLASS_SCENE ) - static int TMSPPSlotListReturned(LPVOID pParam,int iPad,int iUserData,C4JStorage::PTMSPP_FILEDATA pFileData, LPCSTR szFilename); - static int TMSPPWriteReturned(LPVOID pParam,int iPad,int iUserData); - static int TMSPPDeleteReturned(LPVOID pParam,int iPad,int iUserData); - static int UploadSaveForXboxOneThreadProc( LPVOID lpParameter ); + static int TMSPPSlotListReturned(void* pParam,int iPad,int iUserData,C4JStorage::PTMSPP_FILEDATA pFileData, const char* szFilename); + static int TMSPPWriteReturned(void* pParam,int iPad,int iUserData); + static int TMSPPDeleteReturned(void* pParam,int iPad,int iUserData); + static int UploadSaveForXboxOneThreadProc( void* lpParameter ); static int LoadSaveDataReturned(void *pParam,bool bContinue); private: - HRESULT BuildSlotFile(int iIndexBeingUpdated,PBYTE pbImageData,DWORD dwImageBytes); + int BuildSlotFile(int iIndexBeingUpdated,uint8_t* pbImageData,unsigned long dwImageBytes); bool m_bIgnoreInput; bool m_bRetrievingSaveInfo; @@ -74,10 +74,10 @@ private: int m_iX; // tooltip for clearing all slots if there are saves in them LoadMenuInitData *m_params; XCONTENT_DATA m_XContentData; - PBYTE m_pbImageData; - DWORD m_dwImageBytes; + uint8_t* m_pbImageData; + unsigned long m_dwImageBytes; HXUIBRUSH m_hXuiBrush; - PBYTE m_pbSlotListFile; + uint8_t* m_pbSlotListFile; unsigned int m_uiSlotListFileBytes; SLOTDATA *m_pSlotDataA; bool m_bWaitingForWrite; diff --git a/src/client/Common/XUI/XUI_TrialExitUpsell.cpp b/src/client/Common/XUI/XUI_TrialExitUpsell.cpp index 0106dbf6..d268152a 100644 --- a/src/client/Common/XUI/XUI_TrialExitUpsell.cpp +++ b/src/client/Common/XUI/XUI_TrialExitUpsell.cpp @@ -2,7 +2,7 @@ #include "XUI_TrialExitUpsell.h" // wchImages[TRIAL_EXIT_UPSELL_IMAGE_COUNT] -WCHAR *CScene_TrialExitUpsell::wchImages[]= +wchar_t *CScene_TrialExitUpsell::wchImages[]= { L"Graphics/UpsellScreenshots/Screenshot1.png", L"Graphics/UpsellScreenshots/Screenshot2.png", @@ -17,7 +17,7 @@ WCHAR *CScene_TrialExitUpsell::wchImages[]= //---------------------------------------------------------------------------------- // Performs initialization tasks - retrieves controls. //---------------------------------------------------------------------------------- -HRESULT CScene_TrialExitUpsell::OnInit( XUIMessageInit* pInitData, BOOL& bHandled ) +int CScene_TrialExitUpsell::OnInit( XUIMessageInit* pInitData, bool& bHandled ) { m_iPad=*(int *)pInitData->pvInitData; @@ -46,14 +46,14 @@ HRESULT CScene_TrialExitUpsell::OnInit( XUIMessageInit* pInitData, BOOL& bHandle return S_OK; } -HRESULT CScene_TrialExitUpsell::OnKeyDown(XUIMessageInput* pInputData, BOOL& rfHandled) +int CScene_TrialExitUpsell::OnKeyDown(XUIMessageInput* pInputData, bool& rfHandled) { // ignore repeats if(pInputData->dwFlags&XUI_INPUT_FLAG_REPEAT) return S_OK; ui.AnimateKeyPress(pInputData->UserIndex, pInputData->dwKeyCode); - HRESULT hr=S_OK; + int hr=S_OK; // Explicitly handle B button presses switch(pInputData->dwKeyCode) @@ -83,7 +83,7 @@ HRESULT CScene_TrialExitUpsell::OnKeyDown(XUIMessageInput* pInputData, BOOL& rfH return hr; } -HRESULT CScene_TrialExitUpsell::OnTimelineEnd(HXUIOBJ hObjSource, BOOL& bHandled) +int CScene_TrialExitUpsell::OnTimelineEnd(HXUIOBJ hObjSource, bool& bHandled) { if(m_bFadeStarted) { @@ -98,7 +98,7 @@ HRESULT CScene_TrialExitUpsell::OnTimelineEnd(HXUIOBJ hObjSource, BOOL& bHandled } } -HRESULT CScene_TrialExitUpsell::OnTimer( XUIMessageTimer *pTimer, BOOL& bHandled ) +int CScene_TrialExitUpsell::OnTimer( XUIMessageTimer *pTimer, bool& bHandled ) { int nStart, nEnd; diff --git a/src/client/Common/XUI/XUI_TrialExitUpsell.h b/src/client/Common/XUI/XUI_TrialExitUpsell.h index 748b36a2..4bb010eb 100644 --- a/src/client/Common/XUI/XUI_TrialExitUpsell.h +++ b/src/client/Common/XUI/XUI_TrialExitUpsell.h @@ -9,7 +9,7 @@ class CScene_TrialExitUpsell : public CXuiSceneImpl { private: - static WCHAR *wchImages[TRIAL_EXIT_UPSELL_IMAGE_COUNT]; + static wchar_t *wchImages[TRIAL_EXIT_UPSELL_IMAGE_COUNT]; protected: CXuiImageElement m_image1, m_image2; @@ -27,10 +27,10 @@ protected: END_CONTROL_MAP() - HRESULT OnInit( XUIMessageInit* pInitData, BOOL& bHandled ); - HRESULT OnKeyDown(XUIMessageInput* pInputData, BOOL& rfHandled); - HRESULT OnTimelineEnd(HXUIOBJ hObjSource, BOOL& bHandled); - HRESULT OnTimer( XUIMessageTimer *pTimer, BOOL& bHandled ); + int OnInit( XUIMessageInit* pInitData, bool& bHandled ); + int OnKeyDown(XUIMessageInput* pInputData, bool& rfHandled); + int OnTimelineEnd(HXUIOBJ hObjSource, bool& bHandled); + int OnTimer( XUIMessageTimer *pTimer, bool& bHandled ); int m_iPad; bool m_bCanExit; diff --git a/src/client/Common/XUI/XUI_TutorialPopup.cpp b/src/client/Common/XUI/XUI_TutorialPopup.cpp index 24a6dfe6..222878b9 100644 --- a/src/client/Common/XUI/XUI_TutorialPopup.cpp +++ b/src/client/Common/XUI/XUI_TutorialPopup.cpp @@ -10,9 +10,9 @@ //---------------------------------------------------------------------------------- // Performs initialization tasks - retrieves controls. //---------------------------------------------------------------------------------- -HRESULT CScene_TutorialPopup::OnInit( XUIMessageInit* pInitData, BOOL& bHandled ) +int CScene_TutorialPopup::OnInit( XUIMessageInit* pInitData, bool& bHandled ) { - HRESULT hr = S_OK; + int hr = S_OK; tutorial = (Tutorial *)pInitData->pvInitData; m_iPad = tutorial->getPad(); @@ -39,12 +39,12 @@ HRESULT CScene_TutorialPopup::OnInit( XUIMessageInit* pInitData, BOOL& bHandled return hr; } -HRESULT CScene_TutorialPopup::OnDestroy() +int CScene_TutorialPopup::OnDestroy() { return S_OK; } -HRESULT CScene_TutorialPopup::OnTimer(XUIMessageTimer *pData,BOOL& rfHandled) +int CScene_TutorialPopup::OnTimer(XUIMessageTimer *pData,bool& rfHandled) { if( pData->nId == TUTORIAL_POPUP_FADE_TIMER_ID ) { @@ -79,8 +79,8 @@ void CScene_TutorialPopup::UpdateInteractScenePosition(bool visible) HXUICLASS brewingClass = XuiFindClass( L"CXuiSceneBrewingStand" ); HXUICLASS anvilClass = XuiFindClass( L"CXuiSceneAnvil" ); HXUICLASS tradingClass = XuiFindClass( L"CXuiSceneTrading" ); - BOOL isCraftingScene = XuiClassDerivesFrom( sceneClass, craftingClass ); - BOOL isCreativeScene = XuiClassDerivesFrom( sceneClass, creativeInventoryClass ); + bool isCraftingScene = XuiClassDerivesFrom( sceneClass, craftingClass ); + bool isCreativeScene = XuiClassDerivesFrom( sceneClass, creativeInventoryClass ); switch(Minecraft::GetInstance()->localplayers[m_iPad]->m_iScreenSection) { @@ -142,9 +142,9 @@ void CScene_TutorialPopup::UpdateInteractScenePosition(bool visible) } -HRESULT CScene_TutorialPopup::_SetDescription(CXuiScene *interactScene, LPCWSTR desc, LPCWSTR title, bool allowFade, bool isReminder) +int CScene_TutorialPopup::_SetDescription(CXuiScene *interactScene, const wchar_t* desc, const wchar_t* title, bool allowFade, bool isReminder) { - HRESULT hr = S_OK; + int hr = S_OK; m_interactScene = interactScene; if( interactScene != m_lastInteractSceneMoved ) m_lastInteractSceneMoved = NULL; if(desc == NULL) @@ -194,7 +194,7 @@ HRESULT CScene_TutorialPopup::_SetDescription(CXuiScene *interactScene, LPCWSTR D3DXVECTOR3 titlePos; hr = XuiElementGetPosition( m_title, &titlePos ); - BOOL titleShowAtStart = m_title.IsShown(); + bool titleShowAtStart = m_title.IsShown(); if( title != NULL && title[0] != 0 ) { m_title.SetText( title ); @@ -205,7 +205,7 @@ HRESULT CScene_TutorialPopup::_SetDescription(CXuiScene *interactScene, LPCWSTR m_title.SetText( L"" ); m_title.SetShow(false); } - BOOL titleShowAtEnd = m_title.IsShown(); + bool titleShowAtEnd = m_title.IsShown(); if(titleShowAtStart != titleShowAtEnd) { float fHeight, fWidth, fTitleHeight, fDescHeight, fDescWidth; @@ -246,9 +246,9 @@ HRESULT CScene_TutorialPopup::_SetDescription(CXuiScene *interactScene, LPCWSTR return hr; } -HRESULT CScene_TutorialPopup::SetDescription(int iPad, TutorialPopupInfo *info) +int CScene_TutorialPopup::SetDescription(int iPad, TutorialPopupInfo *info) { - HRESULT hr = S_OK; + int hr = S_OK; #ifdef _XBOX HXUIOBJ hObj = app.GetCurrentTutorialScene(iPad); @@ -280,11 +280,11 @@ HRESULT CScene_TutorialPopup::SetDescription(int iPad, TutorialPopupInfo *info) return hr; } -wstring CScene_TutorialPopup::_SetIcon(int icon, int iAuxVal, bool isFoil, LPCWSTR desc) +wstring CScene_TutorialPopup::_SetIcon(int icon, int iAuxVal, bool isFoil, const wchar_t* desc) { wstring temp(desc); - BOOL iconShowAtStart = m_pCraftingPic->IsShown(); + bool iconShowAtStart = m_pCraftingPic->IsShown(); if( icon != TUTORIAL_NO_ICON ) { @@ -411,7 +411,7 @@ wstring CScene_TutorialPopup::_SetIcon(int icon, int iAuxVal, bool isFoil, LPCWS } } - BOOL iconShowAtEnd = m_pCraftingPic->IsShown(); + bool iconShowAtEnd = m_pCraftingPic->IsShown(); if(iconShowAtStart != iconShowAtEnd) { float fHeight, fWidth, fIconHeight, fDescHeight, fDescWidth; @@ -439,7 +439,7 @@ wstring CScene_TutorialPopup::_SetIcon(int icon, int iAuxVal, bool isFoil, LPCWS wstring CScene_TutorialPopup::_SetImage(wstring &desc) { - BOOL imageShowAtStart = m_image.IsShown(); + bool imageShowAtStart = m_image.IsShown(); wstring openTag(L"{*IMAGE*}"); wstring closeTag(L"{*/IMAGE*}"); @@ -464,7 +464,7 @@ wstring CScene_TutorialPopup::_SetImage(wstring &desc) m_image.SetShow( false ); } - BOOL imageShowAtEnd = m_image.IsShown(); + bool imageShowAtEnd = m_image.IsShown(); if(imageShowAtStart != imageShowAtEnd) { float fHeight, fWidth, fIconHeight, fDescHeight, fDescWidth; @@ -532,9 +532,9 @@ wstring CScene_TutorialPopup::ParseDescription(int iPad, wstring &text) return app.FormatHTMLString(iPad,text); } -HRESULT CScene_TutorialPopup::_SetVisible(bool show) +int CScene_TutorialPopup::_SetVisible(bool show) { - HRESULT hr = this->SetShow( show ); + int hr = this->SetShow( show ); if( show && m_bAllowFade ) { @@ -552,9 +552,9 @@ bool CScene_TutorialPopup::_IsSceneVisible() return isVisible; } -HRESULT CScene_TutorialPopup::SetSceneVisible(int iPad, bool show) +int CScene_TutorialPopup::SetSceneVisible(int iPad, bool show) { - HRESULT hr = S_OK; + int hr = S_OK; HXUIOBJ hObj = app.GetCurrentTutorialScene(iPad); HXUICLASS thisClass = XuiFindClass( L"CScene_TutorialPopup" ); @@ -574,7 +574,7 @@ HRESULT CScene_TutorialPopup::SetSceneVisible(int iPad, bool show) } -HRESULT CScene_TutorialPopup::OnCustomMessage_Splitscreenplayer(bool bJoining, BOOL& bHandled) +int CScene_TutorialPopup::OnCustomMessage_Splitscreenplayer(bool bJoining, bool& bHandled) { bHandled=true; return app.AdjustSplitscreenScene_PlayerChanged(m_hObj,&m_OriginalPosition,m_iPad,bJoining); @@ -583,7 +583,7 @@ HRESULT CScene_TutorialPopup::OnCustomMessage_Splitscreenplayer(bool bJoining, B bool CScene_TutorialPopup::IsSceneVisible(int iPad) { bool isVisible = false; - HRESULT hr; + int hr; HXUIOBJ hObj = app.GetCurrentTutorialScene(iPad); HXUICLASS thisClass = XuiFindClass( L"CScene_TutorialPopup" ); diff --git a/src/client/Common/XUI/XUI_TutorialPopup.h b/src/client/Common/XUI/XUI_TutorialPopup.h index 65716759..47073a04 100644 --- a/src/client/Common/XUI/XUI_TutorialPopup.h +++ b/src/client/Common/XUI/XUI_TutorialPopup.h @@ -50,10 +50,10 @@ protected: END_CONTROL_MAP() - HRESULT OnInit( XUIMessageInit* pInitData, BOOL& bHandled ); - HRESULT OnTimer(XUIMessageTimer *pData,BOOL& rfHandled); - HRESULT OnDestroy(); - HRESULT OnCustomMessage_Splitscreenplayer(bool bJoining, BOOL& bHandled); + int OnInit( XUIMessageInit* pInitData, bool& bHandled ); + int OnTimer(XUIMessageTimer *pData,bool& rfHandled); + int OnDestroy(); + int OnCustomMessage_Splitscreenplayer(bool bJoining, bool& bHandled); public: // Define the class. The class name must match the ClassOverride property @@ -61,18 +61,18 @@ public: XUI_IMPLEMENT_CLASS( CScene_TutorialPopup, L"CScene_TutorialPopup", XUI_CLASS_SCENE ) private: - HRESULT _SetDescription(CXuiScene *interactScene, LPCWSTR desc, LPCWSTR title, bool allowFade, bool isReminder); - wstring _SetIcon(int icon, int iAuxVal, bool isFoil, LPCWSTR desc); + int _SetDescription(CXuiScene *interactScene, const wchar_t* desc, const wchar_t* title, bool allowFade, bool isReminder); + wstring _SetIcon(int icon, int iAuxVal, bool isFoil, const wchar_t* desc); wstring _SetImage(wstring &desc); - HRESULT _SetVisible(bool show); + int _SetVisible(bool show); bool _IsSceneVisible(); void UpdateInteractScenePosition(bool visible); public: - static HRESULT SetDescription(int iPad, TutorialPopupInfo *info); + static int SetDescription(int iPad, TutorialPopupInfo *info); static wstring ParseDescription(int iPad, wstring &text); - static HRESULT SetSceneVisible(int iPad, bool show); + static int SetSceneVisible(int iPad, bool show); static bool IsSceneVisible(int iPad); }; \ No newline at end of file diff --git a/src/client/Common/XUI/XUI_debug.cpp b/src/client/Common/XUI/XUI_debug.cpp index fb6265b2..89aa9c94 100644 --- a/src/client/Common/XUI/XUI_debug.cpp +++ b/src/client/Common/XUI/XUI_debug.cpp @@ -7,7 +7,7 @@ #include "XUI_Debug.h" #include "StatsCounter.h" -LPCWSTR CScene_Debug::m_DebugCheckboxTextA[eDebugSetting_Max+1]= +const wchar_t* CScene_Debug::m_DebugCheckboxTextA[eDebugSetting_Max+1]= { L"Load Saves From Local Folder Mode", L"Write Saves To Local Folder Mode", @@ -30,7 +30,7 @@ LPCWSTR CScene_Debug::m_DebugCheckboxTextA[eDebugSetting_Max+1]= L"", }; -LPCWSTR CScene_Debug::m_DebugButtonTextA[eDebugButton_Max+1]= +const wchar_t* CScene_Debug::m_DebugButtonTextA[eDebugButton_Max+1]= { L"Award Theme", L"Award Avatar Item 1", @@ -48,7 +48,7 @@ LPCWSTR CScene_Debug::m_DebugButtonTextA[eDebugButton_Max+1]= //---------------------------------------------------------------------------------- // Performs initialization tasks - retrieves controls. //---------------------------------------------------------------------------------- -HRESULT CScene_Debug::OnInit( XUIMessageInit* pInitData, BOOL& bHandled ) +int CScene_Debug::OnInit( XUIMessageInit* pInitData, bool& bHandled ) { m_iPad=*(int *)pInitData->pvInitData; @@ -199,11 +199,11 @@ HRESULT CScene_Debug::OnInit( XUIMessageInit* pInitData, BOOL& bHandled ) return S_OK; } -HRESULT CScene_Debug::OnKeyDown(XUIMessageInput* pInputData, BOOL& rfHandled) +int CScene_Debug::OnKeyDown(XUIMessageInput* pInputData, bool& rfHandled) { ui.AnimateKeyPress(pInputData->UserIndex, pInputData->dwKeyCode); - HRESULT hr=S_OK; + int hr=S_OK; int iCurrentBitmaskIndex=0; unsigned int uiDebugBitmask=0L; @@ -242,7 +242,7 @@ HRESULT CScene_Debug::OnKeyDown(XUIMessageInput* pInputData, BOOL& rfHandled) } -HRESULT CScene_Debug::OnControlNavigate(XUIMessageControlNavigate *pControlNavigateData, BOOL& bHandled) +int CScene_Debug::OnControlNavigate(XUIMessageControlNavigate *pControlNavigateData, bool& bHandled) { if(m_bOnCheckboxes) { @@ -315,7 +315,7 @@ HRESULT CScene_Debug::OnControlNavigate(XUIMessageControlNavigate *pControlNavig //---------------------------------------------------------------------------------- // Updates the UI when the list selection changes. //---------------------------------------------------------------------------------- -HRESULT CScene_Debug::OnNotifyValueChanged( HXUIOBJ hObjSource, XUINotifyValueChanged* pNotifyValueChanged, BOOL& bHandled ) +int CScene_Debug::OnNotifyValueChanged( HXUIOBJ hObjSource, XUINotifyValueChanged* pNotifyValueChanged, bool& bHandled ) { return S_OK; @@ -323,7 +323,7 @@ HRESULT CScene_Debug::OnNotifyValueChanged( HXUIOBJ hObjSource, XUINotifyValueCh //---------------------------------------------------------------------------------- // Updates the UI when the list selection changes. //---------------------------------------------------------------------------------- -HRESULT CScene_Debug::OnNotifySelChanged( HXUIOBJ hObjSource, XUINotifySelChanged* pNotifySelChangedData, BOOL& bHandled ) +int CScene_Debug::OnNotifySelChanged( HXUIOBJ hObjSource, XUINotifySelChanged* pNotifySelChangedData, bool& bHandled ) { @@ -333,7 +333,7 @@ HRESULT CScene_Debug::OnNotifySelChanged( HXUIOBJ hObjSource, XUINotifySelChange //---------------------------------------------------------------------------------- // Handler for the button press message. //---------------------------------------------------------------------------------- -HRESULT CScene_Debug::OnNotifyPressEx(HXUIOBJ hObjPressed, XUINotifyPress* pNotifyPressData, BOOL& rfHandled) +int CScene_Debug::OnNotifyPressEx(HXUIOBJ hObjPressed, XUINotifyPress* pNotifyPressData, bool& rfHandled) { // This assumes all buttons can only be pressed with the A button ui.AnimateKeyPress(pNotifyPressData->UserIndex, VK_PAD_A); diff --git a/src/client/Common/zlib/gzguts.h b/src/client/Common/zlib/gzguts.h index d87659d0..327620e2 100644 --- a/src/client/Common/zlib/gzguts.h +++ b/src/client/Common/zlib/gzguts.h @@ -117,7 +117,7 @@ /* get errno and strerror definition */ #if defined UNDER_CE # include -# define zstrerror() gz_strwinerror((DWORD)GetLastError()) +# define zstrerror() gz_strwinerror((unsigned long)GetLastError()) #else # ifndef NO_STRERROR # include @@ -195,7 +195,7 @@ typedef gz_state FAR *gz_statep; /* shared functions */ void ZLIB_INTERNAL gz_error OF((gz_statep, int, const char *)); #if defined UNDER_CE -char ZLIB_INTERNAL *gz_strwinerror OF((DWORD error)); +char ZLIB_INTERNAL *gz_strwinerror OF((unsigned long error)); #endif /* GT_OFF(x), where x is an unsigned value, is true if x > maximum z_off64_t diff --git a/src/client/Common/zlib/zconf.h b/src/client/Common/zlib/zconf.h index 9987a775..335e7557 100644 --- a/src/client/Common/zlib/zconf.h +++ b/src/client/Common/zlib/zconf.h @@ -485,7 +485,7 @@ typedef uLong FAR uLongf; # define z_off64_t off64_t #else # if defined(_WIN32) && !defined(__GNUC__) && !defined(Z_SOLO) -# define z_off64_t __int64 +# define z_off64_t int64_t # else # define z_off64_t z_off_t # endif diff --git a/src/client/CreateWorldScreen.cpp b/src/client/CreateWorldScreen.cpp index 23962efc..922f5ea0 100644 --- a/src/client/CreateWorldScreen.cpp +++ b/src/client/CreateWorldScreen.cpp @@ -97,14 +97,14 @@ void CreateWorldScreen::buttonClicked(Button *button) if (done) return; done = true; - __int64 seedValue = (new Random())->nextLong(); + int64_t seedValue = (new Random())->nextLong(); wstring seedString = seedEdit->getValue(); if (seedString.length() != 0) { // try to convert it to a long first // try { // 4J - removed try/catch - __int64 value = _fromString<__int64>(seedString); + int64_t value = _fromString(seedString); if (value != 0) { seedValue = value; diff --git a/src/client/DLCTexturePack.cpp b/src/client/DLCTexturePack.cpp index d5515494..81e5e575 100644 --- a/src/client/DLCTexturePack.cpp +++ b/src/client/DLCTexturePack.cpp @@ -16,7 +16,7 @@ #include "Xbox\XML\xmlFilesCallback.h" #endif -DLCTexturePack::DLCTexturePack(DWORD id, DLCPack *pack, TexturePack *fallback) : AbstractTexturePack(id, NULL, pack->getName(), fallback) +DLCTexturePack::DLCTexturePack(unsigned long id, DLCPack *pack, TexturePack *fallback) : AbstractTexturePack(id, NULL, pack->getName(), fallback) { m_dlcInfoPack = pack; m_dlcDataPack = NULL; @@ -184,16 +184,16 @@ void DLCTexturePack::loadColourTable() { DLCUIDataFile *dataFile = (DLCUIDataFile *)m_dlcDataPack->getFile(DLCManager::e_DLCType_UIData, L"TexturePack.xzp"); - DWORD dwSize = 0; - PBYTE pbData = dataFile->getData(dwSize); + unsigned long dwSize = 0; + uint8_t* pbData = dataFile->getData(dwSize); - const DWORD LOCATOR_SIZE = 256; // Use this to allocate space to hold a ResourceLocator string - WCHAR szResourceLocator[ LOCATOR_SIZE ]; + const unsigned long LOCATOR_SIZE = 256; // Use this to allocate space to hold a ResourceLocator string + wchar_t szResourceLocator[ LOCATOR_SIZE ]; // Try and load the HTMLColours.col based off the common XML first, before the deprecated xuiscene_colourtable swprintf(szResourceLocator, LOCATOR_SIZE,L"memory://%08X,%04X#HTMLColours.col",pbData, dwSize); - BYTE *data; - UINT dataLength; + uint8_t *data; + unsigned int dataLength; if(XuiResourceLoadAll(szResourceLocator, &data, &dataLength) == S_OK) { m_colourTable->loadColoursFromData(data,dataLength); @@ -205,7 +205,7 @@ void DLCTexturePack::loadColourTable() swprintf(szResourceLocator, LOCATOR_SIZE,L"memory://%08X,%04X#xuiscene_colourtable.xur",pbData, dwSize); HXUIOBJ hScene; - HRESULT hr = XuiSceneCreate(szResourceLocator,szResourceLocator, NULL, &hScene); + int hr = XuiSceneCreate(szResourceLocator,szResourceLocator, NULL, &hScene); if(HRESULT_SUCCEEDED(hr)) { @@ -267,12 +267,12 @@ void DLCTexturePack::loadData() -wstring DLCTexturePack::getFilePath(DWORD packId, wstring filename, bool bAddDataFolder) +wstring DLCTexturePack::getFilePath(unsigned long packId, wstring filename, bool bAddDataFolder) { return app.getFilePath(packId,filename,bAddDataFolder); } -int DLCTexturePack::packMounted(LPVOID pParam,int iPad,DWORD dwErr,DWORD dwLicenceMask) +int DLCTexturePack::packMounted(void* pParam,int iPad,unsigned long dwErr,unsigned long dwLicenceMask) { DLCTexturePack *texturePack = (DLCTexturePack *)pParam; texturePack->m_bLoadingData = false; @@ -286,7 +286,7 @@ int DLCTexturePack::packMounted(LPVOID pParam,int iPad,DWORD dwErr,DWORD dwLicen app.DebugPrintf("Mounted DLC for texture pack, attempting to load data\n"); texturePack->m_dlcDataPack = new DLCPack(texturePack->m_dlcInfoPack->getName(), dwLicenceMask); texturePack->setHasAudio(false); - DWORD dwFilesProcessed = 0; + unsigned long dwFilesProcessed = 0; // Load the DLC textures wstring dataFilePath = texturePack->m_dlcInfoPack->getFullDataPath(); if(!dataFilePath.empty()) @@ -306,7 +306,7 @@ int DLCTexturePack::packMounted(LPVOID pParam,int iPad,DWORD dwErr,DWORD dwLicen if(xzpPath.exists()) { const char *pchFilename=wstringtofilename(xzpPath.getPath()); - HANDLE fileHandle = CreateFile( + void* fileHandle = CreateFile( pchFilename, // file name GENERIC_READ, // access mode 0, // share mode // TODO 4J Stu - Will we need to share file? Probably not but... @@ -318,10 +318,10 @@ int DLCTexturePack::packMounted(LPVOID pParam,int iPad,DWORD dwErr,DWORD dwLicen if( fileHandle != INVALID_HANDLE_VALUE ) { - DWORD dwFileSize = xzpPath.length(); - DWORD bytesRead; - PBYTE pbData = (PBYTE) new BYTE[dwFileSize]; - BOOL success = ReadFile(fileHandle,pbData,dwFileSize,&bytesRead,NULL); + unsigned long dwFileSize = xzpPath.length(); + unsigned long bytesRead; + uint8_t* pbData = (uint8_t*) new uint8_t[dwFileSize]; + bool success = ReadFile(fileHandle,pbData,dwFileSize,&bytesRead,NULL); CloseHandle(fileHandle); if(success) { @@ -356,8 +356,8 @@ int DLCTexturePack::packMounted(LPVOID pParam,int iPad,DWORD dwErr,DWORD dwLicen { #ifdef _UNICODE wstring path = grf.getPath(); - const WCHAR *pchFilename=path.c_str(); - HANDLE fileHandle = CreateFile( + const wchar_t *pchFilename=path.c_str(); + void* fileHandle = CreateFile( pchFilename, // file name GENERIC_READ, // access mode 0, // share mode // TODO 4J Stu - Will we need to share file? Probably not but... @@ -368,7 +368,7 @@ int DLCTexturePack::packMounted(LPVOID pParam,int iPad,DWORD dwErr,DWORD dwLicen ); #else const char *pchFilename=wstringtofilename(grf.getPath()); - HANDLE fileHandle = CreateFile( + void* fileHandle = CreateFile( pchFilename, // file name GENERIC_READ, // access mode 0, // share mode // TODO 4J Stu - Will we need to share file? Probably not but... @@ -381,10 +381,10 @@ int DLCTexturePack::packMounted(LPVOID pParam,int iPad,DWORD dwErr,DWORD dwLicen if( fileHandle != INVALID_HANDLE_VALUE ) { - DWORD dwFileSize = grf.length(); - DWORD bytesRead; - PBYTE pbData = (PBYTE) new BYTE[dwFileSize]; - BOOL bSuccess = ReadFile(fileHandle,pbData,dwFileSize,&bytesRead,NULL); + unsigned long dwFileSize = grf.length(); + unsigned long bytesRead; + uint8_t* pbData = (uint8_t*) new uint8_t[dwFileSize]; + bool bSuccess = ReadFile(fileHandle,pbData,dwFileSize,&bytesRead,NULL); if(bSuccess==false) { app.FatalLoadError(); @@ -408,8 +408,8 @@ int DLCTexturePack::packMounted(LPVOID pParam,int iPad,DWORD dwErr,DWORD dwLicen { #ifdef _UNICODE wstring path = grf.getPath(); - const WCHAR *pchFilename=path.c_str(); - HANDLE fileHandle = CreateFile( + const wchar_t *pchFilename=path.c_str(); + void* fileHandle = CreateFile( pchFilename, // file name GENERIC_READ, // access mode 0, // share mode // TODO 4J Stu - Will we need to share file? Probably not but... @@ -420,7 +420,7 @@ int DLCTexturePack::packMounted(LPVOID pParam,int iPad,DWORD dwErr,DWORD dwLicen ); #else const char *pchFilename=wstringtofilename(grf.getPath()); - HANDLE fileHandle = CreateFile( + void* fileHandle = CreateFile( pchFilename, // file name GENERIC_READ, // access mode 0, // share mode // TODO 4J Stu - Will we need to share file? Probably not but... @@ -433,9 +433,9 @@ int DLCTexturePack::packMounted(LPVOID pParam,int iPad,DWORD dwErr,DWORD dwLicen if( fileHandle != INVALID_HANDLE_VALUE ) { - DWORD bytesRead,dwFileSize = GetFileSize(fileHandle,NULL); - PBYTE pbData = (PBYTE) new BYTE[dwFileSize]; - BOOL bSuccess = ReadFile(fileHandle,pbData,dwFileSize,&bytesRead,NULL); + unsigned long bytesRead,dwFileSize = GetFileSize(fileHandle,NULL); + uint8_t* pbData = (uint8_t*) new uint8_t[dwFileSize]; + bool bSuccess = ReadFile(fileHandle,pbData,dwFileSize,&bytesRead,NULL); if(bSuccess==false) { app.FatalLoadError(); @@ -517,17 +517,17 @@ void DLCTexturePack::loadUI() { DLCUIDataFile *dataFile = (DLCUIDataFile *)m_dlcDataPack->getFile(DLCManager::e_DLCType_UIData, L"TexturePack.xzp"); - DWORD dwSize = 0; - PBYTE pbData = dataFile->getData(dwSize); + unsigned long dwSize = 0; + uint8_t* pbData = dataFile->getData(dwSize); - const DWORD LOCATOR_SIZE = 256; // Use this to allocate space to hold a ResourceLocator string - WCHAR szResourceLocator[ LOCATOR_SIZE ]; + const unsigned long LOCATOR_SIZE = 256; // Use this to allocate space to hold a ResourceLocator string + wchar_t szResourceLocator[ LOCATOR_SIZE ]; swprintf(szResourceLocator, LOCATOR_SIZE,L"memory://%08X,%04X#skin_Minecraft.xur",pbData, dwSize); XuiFreeVisuals(L""); - HRESULT hr = app.LoadSkin(szResourceLocator,NULL);//L"TexturePack"); + int hr = app.LoadSkin(szResourceLocator,NULL);//L"TexturePack"); if(HRESULT_SUCCEEDED(hr)) { bUILoaded = true; @@ -591,11 +591,11 @@ wstring DLCTexturePack::getXuiRootPath() { DLCUIDataFile *dataFile = (DLCUIDataFile *)m_dlcDataPack->getFile(DLCManager::e_DLCType_UIData, L"TexturePack.xzp"); - DWORD dwSize = 0; - PBYTE pbData = dataFile->getData(dwSize); + unsigned long dwSize = 0; + uint8_t* pbData = dataFile->getData(dwSize); - const DWORD LOCATOR_SIZE = 256; // Use this to allocate space to hold a ResourceLocator string - WCHAR szResourceLocator[ LOCATOR_SIZE ]; + const unsigned long LOCATOR_SIZE = 256; // Use this to allocate space to hold a ResourceLocator string + wchar_t szResourceLocator[ LOCATOR_SIZE ]; swprintf(szResourceLocator, LOCATOR_SIZE,L"memory://%08X,%04X#",pbData, dwSize); path = szResourceLocator; } diff --git a/src/client/DLCTexturePack.h b/src/client/DLCTexturePack.h index 14e6ea23..0ac096a5 100644 --- a/src/client/DLCTexturePack.h +++ b/src/client/DLCTexturePack.h @@ -22,7 +22,7 @@ private: public: using AbstractTexturePack::getResource; - DLCTexturePack(DWORD id, DLCPack *pack, TexturePack *fallback); + DLCTexturePack(unsigned long id, DLCPack *pack, TexturePack *fallback); ~DLCTexturePack(); virtual wstring getResource(const wstring& name); @@ -54,11 +54,11 @@ public: virtual bool isLoadingData() { return m_bLoadingData; } private: - static wstring getRootPath(DWORD packId, bool allowOverride, bool bAddDataFolder); - static wstring getFilePath(DWORD packId, wstring filename, bool bAddDataFolder=true); + static wstring getRootPath(unsigned long packId, bool allowOverride, bool bAddDataFolder); + static wstring getFilePath(unsigned long packId, wstring filename, bool bAddDataFolder=true); public: - static int packMounted(LPVOID pParam,int iPad,DWORD dwErr,DWORD dwLicenceMask); + static int packMounted(void* pParam,int iPad,unsigned long dwErr,unsigned long dwLicenceMask); virtual void loadData(); virtual void loadUI(); virtual void unloadUI(); diff --git a/src/client/DefaultTexturePack.cpp b/src/client/DefaultTexturePack.cpp index f7f19169..c23f0436 100644 --- a/src/client/DefaultTexturePack.cpp +++ b/src/client/DefaultTexturePack.cpp @@ -17,14 +17,14 @@ void DefaultTexturePack::loadIcon() { #ifdef _XBOX // 4J Stu - Temporary only - const DWORD LOCATOR_SIZE = 256; // Use this to allocate space to hold a ResourceLocator string - WCHAR szResourceLocator[ LOCATOR_SIZE ]; + const unsigned long LOCATOR_SIZE = 256; // Use this to allocate space to hold a ResourceLocator string + wchar_t szResourceLocator[ LOCATOR_SIZE ]; - const ULONG_PTR c_ModuleHandle = (ULONG_PTR)GetModuleHandle(NULL); + const uintptr_t c_ModuleHandle = (uintptr_t)GetModuleHandle(NULL); swprintf(szResourceLocator, LOCATOR_SIZE ,L"section://%X,%ls#%ls",c_ModuleHandle,L"media", L"media/Graphics/TexturePackIcon.png"); - UINT size = 0; - HRESULT hr = XuiResourceLoadAllNoLoc(szResourceLocator, &m_iconData, &size); + unsigned int size = 0; + int hr = XuiResourceLoadAllNoLoc(szResourceLocator, &m_iconData, &size); m_iconSize = size; #else if(app.hasArchiveFile(L"Graphics\\TexturePackIcon.png")) diff --git a/src/client/DemoLevel.h b/src/client/DemoLevel.h index 6d2f7782..e48ece31 100644 --- a/src/client/DemoLevel.h +++ b/src/client/DemoLevel.h @@ -4,7 +4,7 @@ class DemoLevel : public Level { private: - static const __int64 DEMO_LEVEL_SEED = 0; // 4J - TODO - was "Don't Look Back".hashCode(); + static const int64_t DEMO_LEVEL_SEED = 0; // 4J - TODO - was "Don't Look Back".hashCode(); static const int DEMO_SPAWN_X = 796; static const int DEMO_SPAWN_Y = 72; static const int DEMO_SPAWN_Z = -731; diff --git a/src/client/DemoMode.cpp b/src/client/DemoMode.cpp index 0986410d..2c5b0d18 100644 --- a/src/client/DemoMode.cpp +++ b/src/client/DemoMode.cpp @@ -13,8 +13,8 @@ void DemoMode::tick() SurvivalMode::tick(); /* 4J - TODO - seems unlikely we need this demo mode anyway - __int64 time = minecraft->level->getTime(); - __int64 day = (time / Level::TICKS_PER_DAY) + 1; + int64_t time = minecraft->level->getTime(); + int64_t day = (time / Level::TICKS_PER_DAY) + 1; demoHasEnded = (time > (500 + Level::TICKS_PER_DAY * DEMO_DAYS)); if (demoHasEnded) @@ -26,7 +26,7 @@ void DemoMode::tick() { if (day <= (DEMO_DAYS + 1)) { - minecraft->gui->displayClientMessage(L"demo.day." + _toString<__int64>(day)); + minecraft->gui->displayClientMessage(L"demo.day." + _toString(day)); } } else if (day == 1) diff --git a/src/client/Durango/4JLibs/inc/4J_Input.h b/src/client/Durango/4JLibs/inc/4J_Input.h index 884f281e..916ae042 100644 --- a/src/client/Durango/4JLibs/inc/4J_Input.h +++ b/src/client/Durango/4JLibs/inc/4J_Input.h @@ -53,18 +53,18 @@ typedef struct _STRING_VERIFY_RESPONSE { - WORD wNumStrings; - HRESULT *pStringResult; + uint16_t wNumStrings; + int *pStringResult; } STRING_VERIFY_RESPONSE; class C4JStringTable { public: - LPCWSTR Lookup(LPCWSTR szId) {return NULL;} - LPCWSTR Lookup(UINT nIndex) {return NULL;} + const wchar_t* Lookup(const wchar_t* szId) {return NULL;} + const wchar_t* Lookup(unsigned int nIndex) {return NULL;} void Clear(); - HRESULT Load(LPCWSTR szId) {return S_OK;} + int Load(const wchar_t* szId) {return S_OK;} }; class C_4JInput @@ -110,7 +110,7 @@ public: void SetJoypadStickAxisMap(int iPad,unsigned int uiFrom, unsigned int uiTo); void SetJoypadStickTriggerMap(int iPad,unsigned int uiFrom, unsigned int uiTo); void SetKeyRepeatRate(float fRepeatDelaySecs,float fRepeatRateSecs); - void SetDebugSequence( const char *chSequenceA,int( *Func)(LPVOID),LPVOID lpParam ); + void SetDebugSequence( const char *chSequenceA,int( *Func)(void*),void* lpParam ); FLOAT GetIdleSeconds(int iPad); unsigned int GetConnectedGamepadCount(); bool IsPadConnected(int iPad); @@ -126,9 +126,9 @@ public: void SetMenuDisplayed(int iPad, bool bVal); -// EKeyboardResult RequestKeyboard(UINT uiTitle, UINT uiText, UINT uiDesc, DWORD dwPad, WCHAR *pwchResult, UINT uiResultSize,int( *Func)(LPVOID,const bool),LPVOID lpParam,EKeyboardMode eMode,C4JStringTable *pStringTable=NULL); -// EKeyboardResult RequestKeyboard(UINT uiTitle, LPCWSTR pwchDefault, UINT uiDesc, DWORD dwPad, WCHAR *pwchResult, UINT uiResultSize,int( *Func)(LPVOID,const bool),LPVOID lpParam, EKeyboardMode eMode,C4JStringTable *pStringTable=NULL); - EKeyboardResult RequestKeyboard(LPCWSTR Title, LPCWSTR Text, DWORD dwPad, int iMaxChars, int( *Func)(LPVOID,const bool),LPVOID lpParam,C_4JInput::EKeyboardMode eMode); +// EKeyboardResult RequestKeyboard(unsigned int uiTitle, unsigned int uiText, unsigned int uiDesc, unsigned long dwPad, wchar_t *pwchResult, unsigned int uiResultSize,int( *Func)(void*,const bool),void* lpParam,EKeyboardMode eMode,C4JStringTable *pStringTable=NULL); +// EKeyboardResult RequestKeyboard(unsigned int uiTitle, const wchar_t* pwchDefault, unsigned int uiDesc, unsigned long dwPad, wchar_t *pwchResult, unsigned int uiResultSize,int( *Func)(void*,const bool),void* lpParam, EKeyboardMode eMode,C4JStringTable *pStringTable=NULL); + EKeyboardResult RequestKeyboard(const wchar_t* Title, const wchar_t* Text, unsigned long dwPad, int iMaxChars, int( *Func)(void*,const bool),void* lpParam,C_4JInput::EKeyboardMode eMode); void DestroyKeyboard(); bool IsCircleCrossSwapped(); @@ -147,11 +147,11 @@ public: // Exemption It is not required to use the Xbox LIVE service to verify real-time text communication. An example of real-time text communication is in-game text chat. // // Intent Protect players from inappropriate language. - bool VerifyStrings(WCHAR **pwStringA,int iStringC,int( *Func)(LPVOID,STRING_VERIFY_RESPONSE *),LPVOID lpParam); - void CancelQueuedVerifyStrings(int( *Func)(LPVOID,STRING_VERIFY_RESPONSE *),LPVOID lpParam); + bool VerifyStrings(wchar_t **pwStringA,int iStringC,int( *Func)(void*,STRING_VERIFY_RESPONSE *),void* lpParam); + void CancelQueuedVerifyStrings(int( *Func)(void*,STRING_VERIFY_RESPONSE *),void* lpParam); void CancelAllVerifyInProgress(void); - //bool InputDetected(DWORD dwUserIndex,WCHAR *pwchInput); + //bool InputDetected(unsigned long dwUserIndex,wchar_t *pwchInput); void SetEnabledGtcButtons(long long llEnabledButtons); diff --git a/src/client/Durango/4JLibs/inc/4J_Profile.h b/src/client/Durango/4JLibs/inc/4J_Profile.h index dab46417..9e109b35 100644 --- a/src/client/Durango/4JLibs/inc/4J_Profile.h +++ b/src/client/Durango/4JLibs/inc/4J_Profile.h @@ -72,28 +72,28 @@ 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)(LPVOID,const bool, const int iPad),LPVOID lpParam,int iQuadrant=XUSER_INDEX_ANY); - UINT DisplayOfflineProfile(int( *Func)(LPVOID,const bool, const int iPad),LPVOID lpParam,int iQuadrant=XUSER_INDEX_ANY); - UINT RequestConvertOfflineToGuestUI(int( *Func)(LPVOID,const bool, const int iPad),LPVOID 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); - BOOL AreXUIDSEqual(PlayerUID xuid1,PlayerUID xuid2); - BOOL XUIDIsGuest(PlayerUID xuid); + bool AreXUIDSEqual(PlayerUID xuid1,PlayerUID xuid2); + bool XUIDIsGuest(PlayerUID xuid); bool AllowedToPlayMultiplayer(int iProf); void StartTrialGame(); // disables saves and leaderboard, and change state to readyforgame from pregame - void AllowedPlayerCreatedContent(int iPad, bool thisQuadrantOnly, BOOL *allAllowed, BOOL *friendsAllowed); - BOOL CanViewPlayerCreatedContent(int iPad, bool thisQuadrantOnly, PPlayerUID pXuids, DWORD dwXuidCount ); - bool GetProfileAvatar(int iPad,int( *Func)(LPVOID lpParam,PBYTE pbThumbnail,DWORD dwThumbnailBytes), LPVOID lpParam); + void AllowedPlayerCreatedContent(int iPad, bool thisQuadrantOnly, bool *allAllowed, bool *friendsAllowed); + bool CanViewPlayerCreatedContent(int iPad, bool thisQuadrantOnly, PPlayerUID pXuids, unsigned long dwXuidCount ); + bool GetProfileAvatar(int iPad,int( *Func)(void* lpParam,uint8_t* pbThumbnail,unsigned long dwThumbnailBytes), void* lpParam); void CancelProfileAvatarRequest(); void ShowProfileCard(int iPad, PlayerUID targetUid); void ShowAddFriend(int iPad, PlayerUID targetUid); - void CheckPrivilege(int iPad, bool thisQuadrantOnly, WXAMS::KnownPrivileges privilege, void( *Func)(LPVOID, bool, int),LPVOID lpParam); - void CheckPrivileges(int iPad, bool thisQuadrantOnly, const std::vector &privileges, void( *Func)(LPVOID, bool, int),LPVOID lpParam); + void CheckPrivilege(int iPad, bool thisQuadrantOnly, WXAMS::KnownPrivileges privilege, void( *Func)(void*, bool, int),void* lpParam); + void CheckPrivileges(int iPad, bool thisQuadrantOnly, const std::vector &privileges, void( *Func)(void*, bool, int),void* lpParam); // Some helper functions to wrap common combinations of privileges - void CheckMultiplayerPrivileges(int iPad, bool thisQuadrantOnly, void( *Func)(LPVOID, bool, int),LPVOID lpParam); + void CheckMultiplayerPrivileges(int iPad, bool thisQuadrantOnly, void( *Func)(void*, bool, int),void* lpParam); // SYS @@ -106,19 +106,19 @@ public: char* GetGamertag(int iPad); std::wstring GetDisplayName(int iPad); bool IsFullVersion(); - void SetSignInChangeCallback(void ( *Func)(LPVOID, bool, unsigned int),LPVOID lpParam); - void SetNotificationsCallback(void ( *Func)(LPVOID, DWORD, unsigned int),LPVOID lpParam); + void SetSignInChangeCallback(void ( *Func)(void*, bool, unsigned int),void* lpParam); + void SetNotificationsCallback(void ( *Func)(void*, unsigned long, unsigned int),void* lpParam); bool RegionIsNorthAmerica(void); bool LocaleIsUSorCanada(void); - HRESULT GetLiveConnectionStatus(); + int GetLiveConnectionStatus(); bool IsSystemUIDisplayed(); - void SetProfileReadErrorCallback(void ( *Func)(LPVOID), LPVOID lpParam); + void SetProfileReadErrorCallback(void ( *Func)(void*), void* lpParam); void CompleteDeferredSignouts(); void SetDeferredSignoutEnabled(bool enabled); // PROFILE DATA - //int SetDefaultOptionsCallback(int( *Func)(LPVOID,PROFILESETTINGS *, const int iPad),LPVOID lpParam); - //int SetOldProfileVersionCallback(int( *Func)(LPVOID,unsigned char *, const unsigned short,const int),LPVOID lpParam); + //int SetDefaultOptionsCallback(int( *Func)(void*,PROFILESETTINGS *, const int iPad),void* lpParam); + //int SetOldProfileVersionCallback(int( *Func)(void*,unsigned char *, const unsigned short,const int),void* lpParam); //PROFILESETTINGS * GetDashboardProfileSettings(int iPad); //void WriteToProfile(int iQuadrant, bool bGameDefinedDataChanged=false, bool bOverride5MinuteLimitOnProfileWrites=false); //void ForceQueuedProfileWrites(int iPad=XUSER_INDEX_ANY); @@ -126,8 +126,8 @@ public: void ResetProfileProcessState(); // after a sign out from the primary player, call this void Tick( void ); - void GetProfile(PlayerUID xuid, void (*func)(LPVOID, Microsoft::Xbox::Services::Social::XboxUserProfile^), LPVOID param); - void GetProfiles(std::vector xuids, void (*func)(LPVOID, std::vector), LPVOID param); + void GetProfile(PlayerUID xuid, void (*func)(void*, Microsoft::Xbox::Services::Social::XboxUserProfile^), void* param); + void GetProfiles(std::vector xuids, void (*func)(void*, std::vector), void* param); // ACHIEVEMENTS & AWARDS @@ -150,7 +150,7 @@ public: // PURCHASE void DisplayFullVersionPurchase(bool bRequired, int iQuadrant, int iUpsellParam = -1); - void SetUpsellCallback(void ( *Func)(LPVOID lpParam, eUpsellType type, eUpsellResponse response, int iUserData),LPVOID lpParam); + void SetUpsellCallback(void ( *Func)(void* lpParam, eUpsellType type, eUpsellResponse response, int iUserData),void* lpParam); // Debug void SetDebugFullOverride(bool bVal); // To override the license version (trail/full). Only in debug/release, not ContentPackage diff --git a/src/client/Durango/4JLibs/inc/4J_Render.h b/src/client/Durango/4JLibs/inc/4J_Render.h index 737caa98..1bf0b79a 100644 --- a/src/client/Durango/4JLibs/inc/4J_Render.h +++ b/src/client/Durango/4JLibs/inc/4J_Render.h @@ -27,10 +27,10 @@ typedef struct }D3DXIMAGE_INFO; typedef struct _XSOCIAL_PREVIEWIMAGE { - BYTE *pBytes; - DWORD Pitch; - DWORD Width; - DWORD Height; + uint8_t *pBytes; + unsigned long Pitch; + unsigned long Width; + unsigned long Height; // D3DFORMAT Format; } XSOCIAL_PREVIEWIMAGE, *PXSOCIAL_PREVIEWIMAGE; @@ -74,7 +74,7 @@ public: // Vertex data handling typedef enum { - VERTEX_TYPE_PF3_TF2_CB4_NB4_XW1, // Position 3 x float, texture 2 x float, colour 4 x byte, normal 4 x byte, padding 1 DWORD + VERTEX_TYPE_PF3_TF2_CB4_NB4_XW1, // Position 3 x float, texture 2 x float, colour 4 x byte, normal 4 x byte, padding 1 unsigned long VERTEX_TYPE_COMPRESSED, // Compressed format - see comment at top of VS_PS3_TS2_CS1.hlsl for description of layout VERTEX_TYPE_PF3_TF2_CB4_NB4_XW1_LIT, // as VERTEX_TYPE_PF3_TF2_CB4_NB4_XW1 with lighting applied, VERTEX_TYPE_PF3_TF2_CB4_NB4_XW1_TEXGEN, // as VERTEX_TYPE_PF3_TF2_CB4_NB4_XW1 with tex gen @@ -153,10 +153,10 @@ public: void TextureSetParam(int param, int value); void TextureDynamicUpdateStart(); void TextureDynamicUpdateEnd(); - HRESULT LoadTextureData(const char *szFilename,D3DXIMAGE_INFO *pSrcInfo, int **ppDataOut); - HRESULT LoadTextureData(BYTE *pbData, DWORD dwBytes,D3DXIMAGE_INFO *pSrcInfo, int **ppDataOut); - HRESULT SaveTextureData(const char *szFilename, D3DXIMAGE_INFO *pSrcInfo, int *ppDataOut); - HRESULT SaveTextureDataToMemory(void *pOutput, int outputCapacity, int *outputLength, int width, int height, int *ppDataIn); + int LoadTextureData(const char *szFilename,D3DXIMAGE_INFO *pSrcInfo, int **ppDataOut); + int LoadTextureData(uint8_t *pbData, unsigned long dwBytes,D3DXIMAGE_INFO *pSrcInfo, int **ppDataOut); + int SaveTextureData(const char *szFilename, D3DXIMAGE_INFO *pSrcInfo, int *ppDataOut); + int SaveTextureDataToMemory(void *pOutput, int outputCapacity, int *outputLength, int width, int height, int *ppDataIn); void TextureGetStats(); ID3D11ShaderResourceView *TextureGetTexture(int idx); @@ -194,7 +194,7 @@ public: void StateSetForceLOD(int LOD); // Event tracking - void BeginEvent(LPCWSTR eventName); + void BeginEvent(const wchar_t* eventName); void EndEvent(); // PLM event handling diff --git a/src/client/Durango/4JLibs/inc/4J_Storage.h b/src/client/Durango/4JLibs/inc/4J_Storage.h index be5d57fd..5d2bedc2 100644 --- a/src/client/Durango/4JLibs/inc/4J_Storage.h +++ b/src/client/Durango/4JLibs/inc/4J_Storage.h @@ -4,7 +4,7 @@ using namespace std; #define MAX_DISPLAYNAME_LENGTH 128 // SCE_SAVE_DATA_SUBTITLE_MAXSIZE on PS4 #define MAX_SAVEFILENAME_LENGTH 32 // SCE_SAVE_DATA_DIRNAME_DATA_MAXSIZE #define USER_INDEX_ANY 0x000000FF -#define RESULT LONG +#define RESULT int32_t class StringTable; @@ -21,7 +21,7 @@ typedef struct wchar_t UTF16SaveFilename[MAX_SAVEFILENAME_LENGTH]; wchar_t UTF16SaveTitle[MAX_DISPLAYNAME_LENGTH]; CONTAINER_METADATA metaData; - PBYTE thumbnailData; + uint8_t* thumbnailData; uint64 totalSize; bool needsSync; //int sizeKB; @@ -40,23 +40,23 @@ class CONTENT_DATA { public: int DeviceID; - DWORD dwContentType; - WCHAR wszDisplayName[256]; - WCHAR wszProductID[64]; + unsigned long dwContentType; + wchar_t wszDisplayName[256]; + wchar_t wszProductID[64]; bool bTrialLicense; - //WCHAR szFileName[MAX_SAVEFILENAME_LENGTH]; + //wchar_t szFileName[MAX_SAVEFILENAME_LENGTH]; }; typedef CONTENT_DATA XCONTENT_DATA, *PXCONTENT_DATA; typedef struct _MARKETPLACE_CONTENTOFFER_INFO { - WCHAR *wszProductID; - WCHAR *wszOfferName; - BOOL fUserHasPurchased; - WCHAR *wszSellText; - WCHAR *wszCurrencyPrice; - WCHAR *wszSignedOfferID; + wchar_t *wszProductID; + wchar_t *wszOfferName; + bool fUserHasPurchased; + wchar_t *wszSellText; + wchar_t *wszCurrencyPrice; + wchar_t *wszSignedOfferID; } MARKETPLACE_CONTENTOFFER_INFO, *PMARKETPLACE_CONTENTOFFER_INFO; typedef enum @@ -120,35 +120,35 @@ public: typedef struct { unsigned int uiFileSize; - DWORD dwType; - DWORD dwWchCount; // count of WCHAR in next array - WCHAR wchFile[1]; + unsigned long dwType; + unsigned long dwWchCount; // count of wchar_t in next array + wchar_t wchFile[1]; } DLC_FILE_DETAILS, *PDLC_FILE_DETAILS; typedef struct { - DWORD dwType; - DWORD dwWchCount; // count of WCHAR in next array; - WCHAR wchData[1]; // will be an array of size dwBytes + unsigned long dwType; + unsigned long dwWchCount; // count of wchar_t in next array; + wchar_t wchData[1]; // will be an array of size dwBytes } DLC_FILE_PARAM, *PDLC_FILE_PARAM; // End of DLC_Creator structs typedef struct { - DWORD dwVersion; - DWORD dwNewOffers; - DWORD dwTotalOffers; - DWORD dwInstalledTotalOffers; - BYTE bPadding[1024-sizeof(DWORD)*4]; // future expansion + unsigned long dwVersion; + unsigned long dwNewOffers; + unsigned long dwTotalOffers; + unsigned long dwInstalledTotalOffers; + uint8_t bPadding[1024-sizeof(unsigned long)*4]; // future expansion } DLC_TMS_DETAILS; typedef struct { - DWORD dwSize; - PBYTE pbData; + unsigned long dwSize; + uint8_t* pbData; } TMSPP_FILEDATA, *PTMSPP_FILEDATA; @@ -162,7 +162,7 @@ public: typedef struct { - WCHAR wchFilename[64]; + wchar_t wchFilename[64]; unsigned long ulFileSize; eTMS_FILETYPEVAL eFileTypeVal; } @@ -177,7 +177,7 @@ public: typedef struct { - PBYTE pbData; + uint8_t* pbData; unsigned long ulFileLen; } SAVETRANSFER_FILE_DETAILS; @@ -357,16 +357,16 @@ public: ///////////////////////////////////////////////////////////////////////////// Savegame data /////////////////////////////////////////////////////////////////////////////////////// // Initialisation - void Init(unsigned int uiSaveVersion,LPCWSTR pwchDefaultSaveName,char *pszSavePackName,int iMinimumSaveSize, // General manager initialisation - int( *Func)(LPVOID, const ESavingMessage, int),LPVOID lpParam, - bool(*SetRetrieveProductIDFn)(XCONTENT_DATA &Data),WCHAR *pwchSCID,WCHAR *pwchTitleId); - void SetGameSaveFolderTitle(WCHAR *wszGameSaveFolderTitle); // Sets the title to be set in the param.sfo of saves (this doesn't vary, the sub-title is used for the user cho - void SetSaveCacheFolderTitle(WCHAR *wszSaveCacheFolderTitle); // Sets the title to be set in the param.sfo of the save cache - void SetOptionsFolderTitle(WCHAR *wszOptionsFolderTitle); // Sets the title to be set in the param.sfo of the options file + void Init(unsigned int uiSaveVersion,const wchar_t* pwchDefaultSaveName,char *pszSavePackName,int iMinimumSaveSize, // General manager initialisation + int( *Func)(void*, const ESavingMessage, int),void* lpParam, + bool(*SetRetrieveProductIDFn)(XCONTENT_DATA &Data),wchar_t *pwchSCID,wchar_t *pwchTitleId); + void SetGameSaveFolderTitle(wchar_t *wszGameSaveFolderTitle); // Sets the title to be set in the param.sfo of saves (this doesn't vary, the sub-title is used for the user cho + void SetSaveCacheFolderTitle(wchar_t *wszSaveCacheFolderTitle); // Sets the title to be set in the param.sfo of the save cache + void SetOptionsFolderTitle(wchar_t *wszOptionsFolderTitle); // Sets the title to be set in the param.sfo of the options file void SetGameSaveFolderPrefix(char *szGameSaveFolderPrefix); // Sets the prefix to be added to the unique filename of each save to construct a final folder name void SetMaxSaves(int iMaxC); // Sets the maximum number of saves to be evaluated by GetSavesInfo etc. - void SetDefaultImages(PBYTE pbSaveThumbnail,DWORD dwSaveThumbnailBytes); // Sets default save thumbnail, which can be used when saving a game that hasn't generated any yet - void SetIncompleteSaveCallback(void( *Func)(LPVOID, const ESaveIncompleteType), LPVOID param); // Sets callback to be used in the event of a save method not being able to complete + void SetDefaultImages(uint8_t* pbSaveThumbnail,unsigned long dwSaveThumbnailBytes); // Sets default save thumbnail, which can be used when saving a game that hasn't generated any yet + void SetIncompleteSaveCallback(void( *Func)(void*, const ESaveIncompleteType), void* param); // Sets callback to be used in the event of a save method not being able to complete // Miscellaneous control void SetSaveDisabled(bool bDisable); // Sets saving disabled/enabled state @@ -377,16 +377,16 @@ public: C4JStorage::ESaveGameState GetSaveState(); // Get details of existing savedata - C4JStorage::ESaveGameState GetSavesInfo(int iPad,int ( *Func)(LPVOID lpParam,SAVE_DETAILS *pSaveDetails,const bool),LPVOID lpParam,char *pszSavePackName); // Start search + C4JStorage::ESaveGameState GetSavesInfo(int iPad,int ( *Func)(void* lpParam,SAVE_DETAILS *pSaveDetails,const bool),void* lpParam,char *pszSavePackName); // Start search PSAVE_DETAILS ReturnSavesInfo(); // Returns result of search (or NULL if not yet received) void ClearSavesInfo(); // Clears results - C4JStorage::ESaveGameState LoadSaveDataThumbnail(PSAVE_INFO pSaveInfo,int( *Func)(LPVOID lpParam,PBYTE pbThumbnail,DWORD dwThumbnailBytes), LPVOID lpParam, bool force=false); // Get the thumbnail for an individual save referenced by pSaveInfo + C4JStorage::ESaveGameState LoadSaveDataThumbnail(PSAVE_INFO pSaveInfo,int( *Func)(void* lpParam,uint8_t* pbThumbnail,unsigned long dwThumbnailBytes), void* lpParam, bool force=false); // Get the thumbnail for an individual save referenced by pSaveInfo // Loading savedata & obtaining information from just-loaded file - C4JStorage::ESaveGameState LoadSaveData(PSAVE_INFO pSaveInfo,int( *Func)(LPVOID lpParam,const bool, const bool), LPVOID lpParam); // Loads savedata referenced by pSaveInfo, calls callback once complete + C4JStorage::ESaveGameState LoadSaveData(PSAVE_INFO pSaveInfo,int( *Func)(void* lpParam,const bool, const bool), void* lpParam); // Loads savedata referenced by pSaveInfo, calls callback once complete unsigned int GetSaveSize(); // Obtains sizse of just-loaded save void GetSaveData(void *pvData,unsigned int *puiBytes); // Obtains pointer to, and size, of just-loaded save - bool GetSaveUniqueNumber(INT *piVal); // Gets the unique numeric portion of the folder name used for the save (encodes m + bool GetSaveUniqueNumber(int *piVal); // Gets the unique numeric portion of the folder name used for the save (encodes m bool GetSaveUniqueFilename(char *pszName); // Get the full unique "filename" used as part of the folder name for the save // Handling of sub-files (numerically indexed ) within the save @@ -395,37 +395,37 @@ public: void GetSubfileDetails(int idx, unsigned int *subfileId, unsigned char **data, unsigned int *sizeOut); // Gets details for sub-file from 0 to GetSubfileCount() - 1. Caller is responsible for data allocation after this point. void UpdateSubfile(int idx, unsigned char *data, unsigned int size); // Update internal details for a sub-file, from 0 to GetSubfileCount() - 1. int AddSubfile(unsigned int subfileId); // Adds an additional sub-file with a given subfileId, returns index - C4JStorage::ESaveGameState SaveSubfiles(int( *Func)(LPVOID ,const bool),LPVOID lpParam); // Writes all modified sub-files, calling callback on completion + C4JStorage::ESaveGameState SaveSubfiles(int( *Func)(void* ,const bool),void* lpParam); // Writes all modified sub-files, calling callback on completion // Saving savedata void SetSaveTitle(const wchar_t *UTF16String); // Sets the name which is used as a sub-title in the savedata param.sfo - PVOID AllocateSaveData(unsigned int uiBytes); // Allocate storage manager owned memory to the data which is to be saved to + void* AllocateSaveData(unsigned int uiBytes); // Allocate storage manager owned memory to the data which is to be saved to void SetSaveDataSize(unsigned int uiBytes); // Set the actual size of data to be saved - void GetDefaultSaveImage(PBYTE *ppbSaveImage,DWORD *pdwSaveImageBytes); // Get the default save thumbnail (as set by SetDefaultImages) for use on saving games t - void GetDefaultSaveThumbnail(PBYTE *ppbSaveThumbnail,DWORD *pdwSaveThumbnailBytes); // Get the default save image (as set by SetDefaultImages) for use on saving games that - 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 - C4JStorage::ESaveGameState SaveSaveData(int( *Func)(LPVOID ,const bool),LPVOID lpParam); // Save the actual data, calling callback on completion + void GetDefaultSaveImage(uint8_t* *ppbSaveImage,unsigned long *pdwSaveImageBytes); // Get the default save thumbnail (as set by SetDefaultImages) for use on saving games t + void GetDefaultSaveThumbnail(uint8_t* *ppbSaveThumbnail,unsigned long *pdwSaveThumbnailBytes); // Get the default save image (as set by SetDefaultImages) for use on saving games that + void SetSaveImages( uint8_t* pbThumbnail,unsigned long dwThumbnailBytes,uint8_t* pbImage,unsigned long dwImageBytes, uint8_t* pbTextData ,unsigned long dwTextDataBytes); // Sets the thumbnail & image for the save, optionally setting the metadata in the png + C4JStorage::ESaveGameState SaveSaveData(int( *Func)(void* ,const bool),void* lpParam); // Save the actual data, calling callback on completion // Handling of incomplete saves (either sub-files or save data). To be used after game has had callback for an incomplete save event void ContinueIncompleteOperation(); void CancelIncompleteOperation(); // Other file operations - C4JStorage::ESaveGameState DeleteSaveData(PSAVE_INFO pSaveInfo,int( *Func)(LPVOID lpParam,const bool), LPVOID lpParam); // Deletes savedata referenced by pSaveInfo, calls callback when comple - C4JStorage::ESaveGameState CopySaveData(PSAVE_INFO pSaveInfo,int( *Func)(LPVOID ,const bool,C4JStorage::ESaveGameState state),bool( *FuncProg)(LPVOID ,const int),LPVOID lpParam); // Copies savedata referenced by pSaveInfo, calls callback when complete - C4JStorage::ESaveGameState RenameSaveData(int iRenameIndex,uint16_t*pui16NewName,int( *Func)(LPVOID lpParam,const bool), LPVOID lpParam); // Renamed savedata with index from last established ReturnSavesInfo. + C4JStorage::ESaveGameState DeleteSaveData(PSAVE_INFO pSaveInfo,int( *Func)(void* lpParam,const bool), void* lpParam); // Deletes savedata referenced by pSaveInfo, calls callback when comple + C4JStorage::ESaveGameState CopySaveData(PSAVE_INFO pSaveInfo,int( *Func)(void* ,const bool,C4JStorage::ESaveGameState state),bool( *FuncProg)(void* ,const int),void* lpParam); // Copies savedata referenced by pSaveInfo, calls callback when complete + C4JStorage::ESaveGameState RenameSaveData(int iRenameIndex,uint16_t*pui16NewName,int( *Func)(void* lpParam,const bool), void* lpParam); // Renamed savedata with index from last established ReturnSavesInfo. // Internal methods - void GetSaveImage(PBYTE *ppbSaveImage, int *puiSaveImageBytes); - void GetSaveThumbnail(PBYTE *ppbSaveThumbnail, int *puiSaveThumbnailBytes); + void GetSaveImage(uint8_t* *ppbSaveImage, int *puiSaveImageBytes); + void GetSaveThumbnail(uint8_t* *ppbSaveThumbnail, int *puiSaveThumbnailBytes); void SetSaveUniqueFilename(wchar_t *szFilename); ///////////////////////////////////////////////////////////////////////////// Profile data //////////////////////////////////////////////////////////////////////////////////////// // Initialisation - void InitialiseProfileData(unsigned short usProfileVersion, UINT uiProfileValuesC, UINT uiProfileSettingsC, DWORD *pdwProfileSettingsA, int iGameDefinedDataSizeX4, unsigned int *puiGameDefinedDataChangedBitmask); // General initialisation - int SetDefaultOptionsCallback(int( *Func)(LPVOID,PROFILESETTINGS *, const int iPad),LPVOID lpParam); // Set a callback that can initialise a profile's storage to its default settings - void SetOptionsDataCallback(int( *Func)(LPVOID, int iPad, unsigned short usVersion, C4JStorage::eOptionsCallback),LPVOID lpParam); // Sets callback that is called when status of any options has changed - int SetOldProfileVersionCallback(int( *Func)(LPVOID,unsigned char *, const unsigned short,const int),LPVOID lpParam); + void InitialiseProfileData(unsigned short usProfileVersion, unsigned int uiProfileValuesC, unsigned int uiProfileSettingsC, unsigned long *pdwProfileSettingsA, int iGameDefinedDataSizeX4, unsigned int *puiGameDefinedDataChangedBitmask); // General initialisation + int SetDefaultOptionsCallback(int( *Func)(void*,PROFILESETTINGS *, const int iPad),void* lpParam); // Set a callback that can initialise a profile's storage to its default settings + void SetOptionsDataCallback(int( *Func)(void*, int iPad, unsigned short usVersion, C4JStorage::eOptionsCallback),void* lpParam); // Sets callback that is called when status of any options has changed + int SetOldProfileVersionCallback(int( *Func)(void*,unsigned char *, const unsigned short,const int),void* lpParam); // Getting and setting of profile data PROFILESETTINGS * GetDashboardProfileSettings(int iPad); // Get pointer to the standard (originally xbox dashboard) profile data for one user @@ -438,19 +438,19 @@ public: void ForceQueuedProfileWrites(int iPad=-1); // Force any queued profile writes to write now // DLC - C4JStorage::EDLCStatus GetInstalledDLC(int iPad,int( *Func)(LPVOID, int, int),LPVOID lpParam); + C4JStorage::EDLCStatus GetInstalledDLC(int iPad,int( *Func)(void*, int, int),void* lpParam); void SetLicenseChangeFn(void( *Func)(void)); - XCONTENT_DATA& GetDLC(DWORD dw); - DWORD MountInstalledDLC(int iPad,DWORD dwDLC,int( *Func)(LPVOID, int, DWORD,DWORD),LPVOID lpParam,LPWSTR szMountDrive = NULL); - DWORD UnmountInstalledDLC(LPWSTR szMountDrive = NULL); + XCONTENT_DATA& GetDLC(unsigned long dw); + unsigned long MountInstalledDLC(int iPad,unsigned long dwDLC,int( *Func)(void*, int, unsigned long,unsigned long),void* lpParam,wchar_t* szMountDrive = NULL); + unsigned long UnmountInstalledDLC(wchar_t* szMountDrive = NULL); void GetMountedDLCFileList(const char* szMountDrive, std::vector& fileList); std::wstring GetMountedPath(std::wstring szMount); - XCONTENT_DATA * GetInstalledDLC(WCHAR *wszProductID); + XCONTENT_DATA * GetInstalledDLC(wchar_t *wszProductID); - C4JStorage::EDLCStatus GetDLCOffers(int iPad,int( *Func)(LPVOID, int, DWORD, int),LPVOID lpParam, DWORD dwOfferTypesBitmaskT); - MARKETPLACE_CONTENTOFFER_INFO& GetOffer(DWORD dw); - DWORD InstallOffer(int iOfferIDC,WCHAR *pwchProductId,int( *Func)(LPVOID, int, int),LPVOID lpParam, bool bTrial=false); + C4JStorage::EDLCStatus GetDLCOffers(int iPad,int( *Func)(void*, int, unsigned long, int),void* lpParam, unsigned long dwOfferTypesBitmaskT); + MARKETPLACE_CONTENTOFFER_INFO& GetOffer(unsigned long dw); + unsigned long InstallOffer(int iOfferIDC,wchar_t *pwchProductId,int( *Func)(void*, int, int),void* lpParam, bool bTrial=false); void UpdateDLCProductIDs(); // once we have the dlc info, we can give local installed DLC their product ids @@ -464,16 +464,16 @@ public: void SetSaveDeviceSelected(unsigned int uiPad,bool bSelected) {} bool GetSaveDeviceSelected(unsigned int iPad) { return true; } void ClearDLCOffers(); -// C4JStorage::ETMSStatus 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 WriteTMSFile(int iQuadrant,eGlobalStorage eStorageFacility,LPWSTR wszFilename,BYTE *pBuffer,DWORD dwBufferSize); - bool DeleteTMSFile(int iQuadrant,eGlobalStorage eStorageFacility,LPWSTR wszFilename); +// C4JStorage::ETMSStatus ReadTMSFile(int iQuadrant,eGlobalStorage eStorageFacility,C4JStorage::eTMS_FileType eFileType, wchar_t *pwchFilename,uint8_t **ppBuffer,unsigned long *pdwBufferSize,int( *Func)(void*, wchar_t *,int, bool, int),void* lpParam, int iAction);// { return C4JStorage::ETMSStatus_Idle; } +// bool WriteTMSFile(int iQuadrant,eGlobalStorage eStorageFacility,wchar_t* wszFilename,uint8_t *pBuffer,unsigned long dwBufferSize); + bool DeleteTMSFile(int iQuadrant,eGlobalStorage eStorageFacility,wchar_t* wszFilename); // TMS++ - C4JStorage::ETMSStatus TMSPP_GetUserQuotaInfo(C4JStorage::eGlobalStorage eStorageFacility,int iPad);//,TMSCLIENT_CALLBACK Func,LPVOID lpParam, int iUserData=0); - eTitleStorageState TMSPP_WriteFile(int iQuadrant,C4JStorage::eGlobalStorage eStorageFacility,C4JStorage::eTMS_FILETYPEVAL eFileTypeVal,LPWSTR wszFilename,BYTE *pbBuffer,DWORD dwBufferSize,int( *Func)(LPVOID,int,int)=NULL,LPVOID lpParam=NULL, int iUserData=0); - eTitleStorageState TMSPP_ReadFile(int iQuadrant,C4JStorage::eGlobalStorage eStorageFacility,C4JStorage::eTMS_FILETYPEVAL eFileTypeVal,LPWSTR wszFilename,int( *Func)(LPVOID,int,int,LPVOID, WCHAR *),LPVOID lpParam, int iUserData); - eTitleStorageState TMSPP_DeleteFile(int iQuadrant,C4JStorage::eGlobalStorage eStorageFacility,C4JStorage::eTMS_FILETYPEVAL eFileTypeVal,LPWSTR wszFilename,int( *Func)(LPVOID,int,int),LPVOID lpParam, int iUserData); - eTitleStorageState TMSPP_ReadFileList(int iPad,C4JStorage::eGlobalStorage eStorageFacility,int( *Func)(LPVOID,int,int,LPVOID,WCHAR *)=NULL,LPVOID lpParam=NULL, int iUserData=0); + C4JStorage::ETMSStatus TMSPP_GetUserQuotaInfo(C4JStorage::eGlobalStorage eStorageFacility,int iPad);//,TMSCLIENT_CALLBACK Func,void* lpParam, int iUserData=0); + eTitleStorageState TMSPP_WriteFile(int iQuadrant,C4JStorage::eGlobalStorage eStorageFacility,C4JStorage::eTMS_FILETYPEVAL eFileTypeVal,wchar_t* wszFilename,uint8_t *pbBuffer,unsigned long dwBufferSize,int( *Func)(void*,int,int)=NULL,void* lpParam=NULL, int iUserData=0); + eTitleStorageState TMSPP_ReadFile(int iQuadrant,C4JStorage::eGlobalStorage eStorageFacility,C4JStorage::eTMS_FILETYPEVAL eFileTypeVal,wchar_t* wszFilename,int( *Func)(void*,int,int,void*, wchar_t *),void* lpParam, int iUserData); + eTitleStorageState TMSPP_DeleteFile(int iQuadrant,C4JStorage::eGlobalStorage eStorageFacility,C4JStorage::eTMS_FILETYPEVAL eFileTypeVal,wchar_t* wszFilename,int( *Func)(void*,int,int),void* lpParam, int iUserData); + eTitleStorageState TMSPP_ReadFileList(int iPad,C4JStorage::eGlobalStorage eStorageFacility,int( *Func)(void*,int,int,void*,wchar_t *)=NULL,void* lpParam=NULL, int iUserData=0); bool TMSPP_InFileList(eGlobalStorage eStorageFacility, int iPad,const wstring &Filename); eTitleStorageState TMSPP_GetTitleStorageState(int iPad); @@ -484,9 +484,9 @@ public: // SAVE TRANSFERS C4JStorage::eSaveTransferState SaveTransferClearState(); - C4JStorage::eSaveTransferState SaveTransferGetDetails(int iPad, eGlobalStorage source, wchar_t *file, int ( *Func)(LPVOID lpParam,C4JStorage::SAVETRANSFER_FILE_DETAILS *pSaveTransferDetails),LPVOID lpParam); - C4JStorage::eSaveTransferState SaveTransferGetData(int iPad, eGlobalStorage source, wchar_t *file,int ( *Func)(LPVOID lpParam,C4JStorage::SAVETRANSFER_FILE_DETAILS *pSaveTransferDetails),int ( *ProgressFunc)(LPVOID lpParam,unsigned long),LPVOID lpParam,LPVOID lpProgressParam); - void CancelSaveTransfer(int ( *CancelCompleteFunc)(LPVOID lpParam),LPVOID lpParam); + C4JStorage::eSaveTransferState SaveTransferGetDetails(int iPad, eGlobalStorage source, wchar_t *file, int ( *Func)(void* lpParam,C4JStorage::SAVETRANSFER_FILE_DETAILS *pSaveTransferDetails),void* lpParam); + C4JStorage::eSaveTransferState SaveTransferGetData(int iPad, eGlobalStorage source, wchar_t *file,int ( *Func)(void* lpParam,C4JStorage::SAVETRANSFER_FILE_DETAILS *pSaveTransferDetails),int ( *ProgressFunc)(void* lpParam,unsigned long),void* lpParam,void* lpProgressParam); + void CancelSaveTransfer(int ( *CancelCompleteFunc)(void* lpParam),void* lpParam); }; extern C4JStorage StorageManager; diff --git a/src/client/Durango/ApplicationView.cpp b/src/client/Durango/ApplicationView.cpp index 2af86496..775d4fab 100644 --- a/src/client/Durango/ApplicationView.cpp +++ b/src/client/Durango/ApplicationView.cpp @@ -19,23 +19,23 @@ ApplicationView::ApplicationView() m_inviteProcessed = false; } -XALLOC_ATTRIBUTES ExpandAllocAttributes( _In_ LONGLONG dwAttributes ) +XALLOC_ATTRIBUTES ExpandAllocAttributes( _In_ int64_t dwAttributes ) { XALLOC_ATTRIBUTES attr; attr = *((XALLOC_ATTRIBUTES *)&dwAttributes); return attr; } -SIZE_T totalTracked = 0; -unordered_map tracker; +size_t totalTracked = 0; +unordered_map tracker; static volatile bool memDump = false; static volatile bool memReset = false; static bool memDumpInit = false; static CRITICAL_SECTION memTrackCS; -static volatile SIZE_T memSizeComp = 0; +static volatile size_t memSizeComp = 0; static long long lastTrackTime = 0; -PVOID WINAPI XMemAllocLog( _In_ SIZE_T dwSize, _In_ ULONGLONG dwAttributes ) +void* WINAPI XMemAllocLog( _In_ size_t dwSize, _In_ uint64_t dwAttributes ) { if( !memDumpInit ) { @@ -43,7 +43,7 @@ PVOID WINAPI XMemAllocLog( _In_ SIZE_T dwSize, _In_ ULONGLONG dwAttributes ) memDumpInit = true; } - PVOID result = XMemAllocDefault(dwSize,dwAttributes); + void* result = XMemAllocDefault(dwSize,dwAttributes); XALLOC_ATTRIBUTES expanded_attributes = ExpandAllocAttributes(dwAttributes); EnterCriticalSection(&memTrackCS); tracker[(uintptr_t)result] = dwSize; @@ -53,7 +53,7 @@ PVOID WINAPI XMemAllocLog( _In_ SIZE_T dwSize, _In_ ULONGLONG dwAttributes ) return result; } -VOID WINAPI XMemFreeLog( _In_ PVOID lpAddress, _In_ ULONGLONG dwAttributes ) +void WINAPI XMemFreeLog( _In_ void* lpAddress, _In_ uint64_t dwAttributes ) { EnterCriticalSection(&memTrackCS); auto it = tracker.find((uintptr_t)lpAddress); @@ -127,7 +127,7 @@ void ApplicationView::Run() // m_game = ref new Game(); InitializeDurango(CoreWindow::GetForCurrentThread()); - // Ensure we finish activation and let the system know we’re responsive + // Ensure we finish activation and let the system know we�re responsive while (!m_activationComplete) { CoreWindow::GetForCurrentThread()->Dispatcher->ProcessEvents(CoreProcessEventsOption::ProcessAllIfPresent); diff --git a/src/client/Durango/DurangoExtras/DurangoStubs.cpp b/src/client/Durango/DurangoExtras/DurangoStubs.cpp index 43157d36..7b5859e0 100644 --- a/src/client/Durango/DurangoExtras/DurangoStubs.cpp +++ b/src/client/Durango/DurangoExtras/DurangoStubs.cpp @@ -7,11 +7,11 @@ //const char* getConsoleHomePath() { return sc_loadPath; } -DWORD GetFileSize(HANDLE fh,DWORD *pdwHigh) +unsigned long GetFileSize(void* fh,unsigned long *pdwHigh) { LARGE_INTEGER FileSize; - BOOL bRes=GetFileSizeEx(fh,&FileSize); + bool bRes=GetFileSizeEx(fh,&FileSize); if(bRes==false) { @@ -25,12 +25,12 @@ DWORD GetFileSize(HANDLE fh,DWORD *pdwHigh) } } -DWORD XGetLanguage() +unsigned long XGetLanguage() { //StringTable::eLocale eCurrentLocale=StringTable::eLocale_American; bool bLocaleFound; - WCHAR wchLocaleName[LOCALE_NAME_MAX_LENGTH]; + wchar_t wchLocaleName[LOCALE_NAME_MAX_LENGTH]; GetUserDefaultLocaleName(wchLocaleName,LOCALE_NAME_MAX_LENGTH); eMCLang eLang=(eMCLang)app.get_eMCLang(wchLocaleName); @@ -111,17 +111,17 @@ DWORD XGetLanguage() } } -DWORD XGetLocale() +unsigned long XGetLocale() { //return XC_LOCALE_SWEDEN; - WCHAR wchLocaleName[LOCALE_NAME_MAX_LENGTH]; + wchar_t wchLocaleName[LOCALE_NAME_MAX_LENGTH]; GetUserDefaultLocaleName(wchLocaleName,LOCALE_NAME_MAX_LENGTH); return app.get_xcLang(wchLocaleName); } -DWORD XEnableGuestSignin(BOOL fEnable) +unsigned long XEnableGuestSignin(bool fEnable) { return 0; } diff --git a/src/client/Durango/DurangoExtras/DurangoStubs.h b/src/client/Durango/DurangoExtras/DurangoStubs.h index 2c15b703..6fcde40c 100644 --- a/src/client/Durango/DurangoExtras/DurangoStubs.h +++ b/src/client/Durango/DurangoExtras/DurangoStubs.h @@ -2,8 +2,8 @@ //const char* getConsoleHomePath(); -DWORD GetFileSize(HANDLE fh,DWORD *pdwHigh); +unsigned long GetFileSize(void* fh,unsigned long *pdwHigh); -DWORD XGetLanguage(); -DWORD XGetLocale(); -DWORD XEnableGuestSignin(BOOL fEnable); \ No newline at end of file +unsigned long XGetLanguage(); +unsigned long XGetLocale(); +unsigned long XEnableGuestSignin(bool fEnable); \ No newline at end of file diff --git a/src/client/Durango/DurangoExtras/xcompress.h b/src/client/Durango/DurangoExtras/xcompress.h index c577ad02..533ee870 100644 --- a/src/client/Durango/DurangoExtras/xcompress.h +++ b/src/client/Durango/DurangoExtras/xcompress.h @@ -46,15 +46,15 @@ typedef enum _XMEMCODEC_TYPE * Data compression functions */ -typedef VOID* XMEMCOMPRESSION_CONTEXT; +typedef void* XMEMCOMPRESSION_CONTEXT; XBOXAPI -HRESULT +int WINAPI XMemCreateCompressionContext( __in XMEMCODEC_TYPE CodecType, - __in_opt CONST VOID* pCodecParams, - __in DWORD Flags, + __in_opt const void* pCodecParams, + __in unsigned long Flags, __deref_out XMEMCOMPRESSION_CONTEXT* pContext ); @@ -63,69 +63,69 @@ XMEMCOMPRESSION_CONTEXT WINAPI XMemInitializeCompressionContext( __in XMEMCODEC_TYPE CodecType, - __in_opt CONST VOID* pCodecParams, - __in DWORD Flags, - __out_bcount(ContextSize) VOID* pContextData, - __in SIZE_T ContextSize + __in_opt const void* pCodecParams, + __in unsigned long Flags, + __out_bcount(ContextSize) void* pContextData, + __in size_t ContextSize ); XBOXAPI -VOID +void WINAPI XMemDestroyCompressionContext( __in XMEMCOMPRESSION_CONTEXT Context ); XBOXAPI -SIZE_T +size_t WINAPI XMemGetCompressionContextSize( __in XMEMCODEC_TYPE CodecType, - __in_opt CONST VOID* pCodecParams, - __in DWORD Flags + __in_opt const void* pCodecParams, + __in unsigned long Flags ); XBOXAPI -HRESULT +int WINAPI XMemResetCompressionContext( __in XMEMCOMPRESSION_CONTEXT Context); XBOXAPI -HRESULT +int WINAPI XMemCompress( __in XMEMCOMPRESSION_CONTEXT Context, - __out_bcount_opt( *pDestSize ) VOID* pDestination, - __inout SIZE_T* pDestSize, - __in_bcount( SrcSize ) CONST VOID* pSource, - __in SIZE_T SrcSize + __out_bcount_opt( *pDestSize ) void* pDestination, + __inout size_t* pDestSize, + __in_bcount( SrcSize ) const void* pSource, + __in size_t SrcSize ); XBOXAPI -HRESULT +int WINAPI XMemCompressStream( __in XMEMCOMPRESSION_CONTEXT Context, - __out_bcount_opt( *pDestSize ) VOID* pDestination, - __inout SIZE_T* pDestSize, - __in_bcount( *pSrcSize ) CONST VOID* pSource, - __inout SIZE_T* pSrcSize + __out_bcount_opt( *pDestSize ) void* pDestination, + __inout size_t* pDestSize, + __in_bcount( *pSrcSize ) const void* pSource, + __inout size_t* pSrcSize ); /* * Data decompression functions */ -typedef VOID* XMEMDECOMPRESSION_CONTEXT; +typedef void* XMEMDECOMPRESSION_CONTEXT; XBOXAPI -HRESULT +int WINAPI XMemCreateDecompressionContext( __in XMEMCODEC_TYPE CodecType, - __in_opt CONST VOID* pCodecParams, - __in DWORD Flags, + __in_opt const void* pCodecParams, + __in unsigned long Flags, __deref_out XMEMDECOMPRESSION_CONTEXT* pContext ); @@ -134,54 +134,54 @@ XMEMDECOMPRESSION_CONTEXT WINAPI XMemInitializeDecompressionContext( __in XMEMCODEC_TYPE CodecType, - __in_opt CONST VOID* pCodecParams, - __in DWORD Flags, - __out_bcount( ContextSize ) VOID* pContextData, - __in SIZE_T ContextSize + __in_opt const void* pCodecParams, + __in unsigned long Flags, + __out_bcount( ContextSize ) void* pContextData, + __in size_t ContextSize ); XBOXAPI -VOID +void WINAPI XMemDestroyDecompressionContext( __in XMEMDECOMPRESSION_CONTEXT Context ); XBOXAPI -SIZE_T +size_t WINAPI XMemGetDecompressionContextSize( __in XMEMCODEC_TYPE CodecType, - __in_opt CONST VOID* pCodecParams, - __in DWORD Flags + __in_opt const void* pCodecParams, + __in unsigned long Flags ); XBOXAPI -HRESULT +int WINAPI XMemResetDecompressionContext( __in XMEMDECOMPRESSION_CONTEXT Context); XBOXAPI -HRESULT +int WINAPI XMemDecompress( __in XMEMDECOMPRESSION_CONTEXT Context, - __out_bcount( *pDestSize ) VOID* pDestination, - __inout SIZE_T* pDestSize, - __in_bcount( SrcSize) CONST VOID* pSource, - __in SIZE_T SrcSize + __out_bcount( *pDestSize ) void* pDestination, + __inout size_t* pDestSize, + __in_bcount( SrcSize) const void* pSource, + __in size_t SrcSize ); XBOXAPI -HRESULT +int WINAPI XMemDecompressStream( __in XMEMDECOMPRESSION_CONTEXT Context, - __out_bcount( *pDestSize ) VOID* pDestination, - __inout SIZE_T* pDestSize, - __in_bcount( *pSrcSize ) CONST VOID* pSource, - __inout SIZE_T* pSrcSize + __out_bcount( *pDestSize ) void* pDestination, + __inout size_t* pDestSize, + __in_bcount( *pSrcSize ) const void* pSource, + __inout size_t* pSrcSize ); /* @@ -190,9 +190,9 @@ XMemDecompressStream( typedef struct _XMEMCODEC_PARAMETERS_LZX { - DWORD Flags; - DWORD WindowSize; - DWORD CompressionPartitionSize; + unsigned long Flags; + unsigned long WindowSize; + unsigned long CompressionPartitionSize; } XMEMCODEC_PARAMETERS_LZX; #define XCOMPRESS_LZX_BLOCK_SIZE (32 * 1024) @@ -220,28 +220,28 @@ typedef struct _XMEMCODEC_PARAMETERS_LZX typedef struct _XCOMPRESS_FILE_HEADER { - DWORD Identifier; - WORD Version; - WORD Reserved; + unsigned long Identifier; + uint16_t Version; + uint16_t Reserved; } XCOMPRESS_FILE_HEADER; typedef struct _XCOMPRESS_FILE_HEADER_LZXNATIVE { XCOMPRESS_FILE_HEADER Common; - DWORD ContextFlags; + unsigned long ContextFlags; XMEMCODEC_PARAMETERS_LZX CodecParams; - DWORD UncompressedSizeHigh; - DWORD UncompressedSizeLow; - DWORD CompressedSizeHigh; - DWORD CompressedSizeLow; - DWORD UncompressedBlockSize; - DWORD CompressedBlockSizeMax; + unsigned long UncompressedSizeHigh; + unsigned long UncompressedSizeLow; + unsigned long CompressedSizeHigh; + unsigned long CompressedSizeLow; + unsigned long UncompressedBlockSize; + unsigned long CompressedBlockSizeMax; } XCOMPRESS_FILE_HEADER_LZXNATIVE; typedef struct _XCOMPRESS_BLOCK_HEADER_LZXNATIVE { - DWORD CompressedBlockSize; - BYTE pCompressedData[0]; + unsigned long CompressedBlockSize; + uint8_t pCompressedData[0]; } XCOMPRESS_BLOCK_HEADER_LZXNATIVE; #pragma warning(pop) diff --git a/src/client/Durango/Durango_App.cpp b/src/client/Durango/Durango_App.cpp index 69ad5c76..1958a85f 100644 --- a/src/client/Durango/Durango_App.cpp +++ b/src/client/Durango/Durango_App.cpp @@ -114,14 +114,14 @@ void CConsoleMinecraftApp::CaptureSaveThumbnail() { RenderManager.CaptureThumbnail(&m_ThumbnailBuffer); } -void CConsoleMinecraftApp::GetSaveThumbnail(PBYTE *pbData,DWORD *pdwSize) +void CConsoleMinecraftApp::GetSaveThumbnail(uint8_t* *pbData,unsigned long *pdwSize) { // on a save caused by a create world, the thumbnail capture won't have happened if(m_ThumbnailBuffer.Allocated()) { if( pbData ) { - *pbData= new BYTE [m_ThumbnailBuffer.GetBufferSize()]; + *pbData= new uint8_t [m_ThumbnailBuffer.GetBufferSize()]; *pdwSize=m_ThumbnailBuffer.GetBufferSize(); memcpy(*pbData,m_ThumbnailBuffer.GetBufferPointer(),*pdwSize); } @@ -141,23 +141,23 @@ void CConsoleMinecraftApp::ReleaseSaveThumbnail() } -void CConsoleMinecraftApp::GetScreenshot(int iPad,PBYTE *pbData,DWORD *pdwSize) +void CConsoleMinecraftApp::GetScreenshot(int iPad,uint8_t* *pbData,unsigned long *pdwSize) { } -int CConsoleMinecraftApp::GetLocalTMSFileIndex(WCHAR *wchTMSFile,bool bFilenameIncludesExtension,eFileExtensionType eEXT) +int CConsoleMinecraftApp::GetLocalTMSFileIndex(wchar_t *wchTMSFile,bool bFilenameIncludesExtension,eFileExtensionType eEXT) { return -1; } -int CConsoleMinecraftApp::LoadLocalTMSFile(WCHAR *wchTMSFile) +int CConsoleMinecraftApp::LoadLocalTMSFile(wchar_t *wchTMSFile) { return -1; } -int CConsoleMinecraftApp::LoadLocalTMSFile(WCHAR *wchTMSFile, eFileExtensionType eExt) +int CConsoleMinecraftApp::LoadLocalTMSFile(wchar_t *wchTMSFile, eFileExtensionType eExt) { return -1; } @@ -199,15 +199,15 @@ void CConsoleMinecraftApp::FreeLocalDLCImages() } -int CConsoleMinecraftApp::LoadLocalDLCImage(WCHAR *wchName,PBYTE *ppbImageData,DWORD *pdwBytes) +int CConsoleMinecraftApp::LoadLocalDLCImage(wchar_t *wchName,uint8_t* *ppbImageData,unsigned long *pdwBytes) { // load the local file - WCHAR wchFilename[64]; + wchar_t wchFilename[64]; // 4J-PB - Read the file containing the product codes. This will be different for the SCEE/SCEA/SCEJ builds swprintf(wchFilename,L"DLCImages/%s",wchName); - HANDLE hFile = CreateFile(wchFilename, GENERIC_READ, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); + void* hFile = CreateFile(wchFilename, GENERIC_READ, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); if( hFile == INVALID_HANDLE_VALUE ) { @@ -215,13 +215,13 @@ int CConsoleMinecraftApp::LoadLocalDLCImage(WCHAR *wchName,PBYTE *ppbImageData,D return false; } - DWORD dwHigh=0; + unsigned long dwHigh=0; *pdwBytes = GetFileSize(hFile,&dwHigh); if(*pdwBytes!=0) { - DWORD dwBytesRead; - PBYTE pbImageData=(PBYTE)malloc(*pdwBytes); + unsigned long dwBytesRead; + uint8_t* pbImageData=(uint8_t*)malloc(*pdwBytes); if(ReadFile(hFile,pbImageData,*pdwBytes,&dwBytesRead,NULL)==false) { @@ -269,7 +269,7 @@ void CConsoleMinecraftApp::TemporaryCreateGameStart() StorageManager.SetSaveTitle(wWorldName.c_str()); bool isFlat = false; - __int64 seedValue = BiomeSource::findSeed(isFlat?LevelType::lvl_flat:LevelType::lvl_normal); // 4J - was (new Random())->nextLong() - now trying to actually find a seed to suit our requirements + int64_t seedValue = BiomeSource::findSeed(isFlat?LevelType::lvl_flat:LevelType::lvl_normal); // 4J - was (new Random())->nextLong() - now trying to actually find a seed to suit our requirements NetworkGameInitData *param = new NetworkGameInitData(); param->seed = seedValue; @@ -299,7 +299,7 @@ void CConsoleMinecraftApp::TemporaryCreateGameStart() LoadingInputParams *loadingParams = new LoadingInputParams(); loadingParams->func = &CGameNetworkManager::RunNetworkGameThreadProc; - loadingParams->lpParam = (LPVOID)param; + loadingParams->lpParam = (void*)param; // Reset the autosave time app.SetAutosaveTimerTime(); @@ -311,10 +311,10 @@ void CConsoleMinecraftApp::TemporaryCreateGameStart() typedef struct { eDLCContentType e_DLC_Type; - //WCHAR *wchDisplayName; - WCHAR *wchProductId; - WCHAR *wchBannerName; - WCHAR *wchFirstSkin; + //wchar_t *wchDisplayName; + wchar_t *wchProductId; + wchar_t *wchBannerName; + wchar_t *wchFirstSkin; int iConfig; unsigned int uiSortIndex; } @@ -451,7 +451,7 @@ bool CConsoleMinecraftApp::TMSPP_ReadBannedList(int iPad,eTMSAction NextAction) return true; } -int CConsoleMinecraftApp::Callback_TMSPPReadBannedList(void *pParam,int iPad, int iUserData, LPVOID lpvData,WCHAR *wchFilename) +int CConsoleMinecraftApp::Callback_TMSPPReadBannedList(void *pParam,int iPad, int iUserData, void* lpvData,wchar_t *wchFilename) { app.DebugPrintf("CConsoleMinecraftApp::Callback_TMSPPReadBannedList\n"); C4JStorage::PTMSPP_FILEDATA pFileData=(C4JStorage::PTMSPP_FILEDATA)lpvData; @@ -553,7 +553,7 @@ void CConsoleMinecraftApp::TMSPP_RetrieveFileList(int iPad,C4JStorage::eGlobalSt } } -int CConsoleMinecraftApp::Callback_TMSPPRetrieveFileList(void *pParam,int iPad, int iUserData, LPVOID lpvData, WCHAR *wchFilename) +int CConsoleMinecraftApp::Callback_TMSPPRetrieveFileList(void *pParam,int iPad, int iUserData, void* lpvData, wchar_t *wchFilename) { CConsoleMinecraftApp* pClass = (CConsoleMinecraftApp*)pParam; app.DebugPrintf("CConsoleMinecraftApp::Callback_TMSPPRetrieveFileList\n"); @@ -583,7 +583,7 @@ int CConsoleMinecraftApp::Callback_TMSPPRetrieveFileList(void *pParam,int iPad, } //#define WRITE_DLCINFO 1 -int CConsoleMinecraftApp::Callback_TMSPPReadDLCFile(void *pParam,int iPad, int iUserData, LPVOID lpvData ,WCHAR *pwchFilename) +int CConsoleMinecraftApp::Callback_TMSPPReadDLCFile(void *pParam,int iPad, int iUserData, void* lpvData ,wchar_t *pwchFilename) { app.DebugPrintf("CConsoleMinecraftApp::Callback_TMSPPReadDLCFile\n"); C4JStorage::PTMSPP_FILEDATA pFileData= (C4JStorage::PTMSPP_FILEDATA)lpvData; @@ -600,7 +600,7 @@ int CConsoleMinecraftApp::Callback_TMSPPReadDLCFile(void *pParam,int iPad, int i unsigned int uiDecompSize=*(unsigned int *)pFileData->pbData; unsigned int uiCompSize=((unsigned int *)pFileData->pbData)[1]; - BYTE *pDecompressedData = new BYTE [uiDecompSize]; + uint8_t *pDecompressedData = new uint8_t [uiDecompSize]; Compression::ECompressionTypes eOriginalCompressionType=Compression::getCompression()->GetDecompressionType(); Compression::getCompression()->SetDecompressionType(Compression::eCompressionType_LZXRLE); @@ -611,7 +611,7 @@ int CConsoleMinecraftApp::Callback_TMSPPReadDLCFile(void *pParam,int iPad, int i xmlDLCInfoCallback xmlCallback; xmlParser.RegisterSAXCallbackInterface( &xmlCallback ); - xmlParser.ParseXMLBuffer((CHAR *)pDecompressedData,uiDecompSize); + xmlParser.ParseXMLBuffer((char *)pDecompressedData,uiDecompSize); pClass->m_bRead_TMS_DLCINFO_XML=true; @@ -629,16 +629,16 @@ int CConsoleMinecraftApp::Callback_TMSPPReadDLCFile(void *pParam,int iPad, int i StorageManager.TMSPP_ClearTitleStorageState(iPad); #ifdef WRITE_DLCINFO - HANDLE file; - DWORD dwHigh=0; - DWORD dwFileSize; + void* file; + unsigned long dwHigh=0; + unsigned long dwFileSize; // hack for now to upload the file // open the local file file = CreateFile(L"DLCXbox1.cmp", GENERIC_READ, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); if( file == INVALID_HANDLE_VALUE ) { - DWORD error = GetLastError(); + unsigned long error = GetLastError(); app.DebugPrintf("Failed to open DLCXbox1.cmp with error code %d (%x)\n", error, error); __debugbreak(); return 0; @@ -649,16 +649,16 @@ int CConsoleMinecraftApp::Callback_TMSPPReadDLCFile(void *pParam,int iPad, int i if(dwFileSize!=0) { - DWORD bytesRead; + unsigned long bytesRead; - PBYTE pbData= new BYTE [dwFileSize]; + uint8_t* pbData= new uint8_t [dwFileSize]; ReadFile(file,pbData,dwFileSize,&bytesRead,NULL); if(bytesRead==dwFileSize) { - //StorageManager.TMSPP_WriteFile(iPad,C4JStorage::eGlobalStorage_TitleUser,C4JStorage::TMS_FILETYPE_BINARY,L"DLCXbox1.cmp",(PBYTE) pbData, dwFileSize,NULL,NULL, 0); - StorageManager.TMSPP_WriteFile(iPad,C4JStorage::eGlobalStorage_TitleUser,C4JStorage::TMS_FILETYPE_BINARY,L"TP06.cmp",(PBYTE) pbData, dwFileSize,NULL,NULL, 0); + //StorageManager.TMSPP_WriteFile(iPad,C4JStorage::eGlobalStorage_TitleUser,C4JStorage::TMS_FILETYPE_BINARY,L"DLCXbox1.cmp",(uint8_t*) pbData, dwFileSize,NULL,NULL, 0); + StorageManager.TMSPP_WriteFile(iPad,C4JStorage::eGlobalStorage_TitleUser,C4JStorage::TMS_FILETYPE_BINARY,L"TP06.cmp",(uint8_t*) pbData, dwFileSize,NULL,NULL, 0); } Sleep(5000); } @@ -670,7 +670,7 @@ int CConsoleMinecraftApp::Callback_TMSPPReadDLCFile(void *pParam,int iPad, int i file = CreateFile(L"TP06.png", GENERIC_READ, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); if( file == INVALID_HANDLE_VALUE ) { - DWORD error = GetLastError(); + unsigned long error = GetLastError(); app.DebugPrintf("Failed to open DLCXbox1.cmp with error code %d (%x)\n", error, error); return 0; } @@ -680,15 +680,15 @@ int CConsoleMinecraftApp::Callback_TMSPPReadDLCFile(void *pParam,int iPad, int i if(dwFileSize!=0) { - DWORD bytesRead; + unsigned long bytesRead; - PBYTE pbData= new BYTE [dwFileSize]; + uint8_t* pbData= new uint8_t [dwFileSize]; ReadFile(file,pbData,dwFileSize,&bytesRead,NULL); if(bytesRead==dwFileSize) { - StorageManager.TMSPP_WriteFile(iPad,C4JStorage::eGlobalStorage_TitleUser,C4JStorage::TMS_FILETYPE_BINARY,L"TP06.png",(PBYTE) pbData, dwFileSize,NULL,NULL, 0); + StorageManager.TMSPP_WriteFile(iPad,C4JStorage::eGlobalStorage_TitleUser,C4JStorage::TMS_FILETYPE_BINARY,L"TP06.png",(uint8_t*) pbData, dwFileSize,NULL,NULL, 0); } Sleep(5000); } @@ -717,7 +717,7 @@ void CConsoleMinecraftApp::Callback_SaveGameIncomplete(void *pParam, C4JStorage: if (saveIncompleteType == C4JStorage::ESaveIncomplete_OutOfQuota) message = IDS_SAVE_INCOMPLETE_EXPLANATION_QUOTA; else message = IDS_SAVE_INCOMPLETE_EXPLANATION_LOCAL_STORAGE; - UINT uiIDA[3] = + unsigned int uiIDA[3] = { IDS_SAVE_INCOMPLETE_RETRY_SAVING, IDS_SAVE_INCOMPLETE_DISABLE_SAVING, @@ -766,7 +766,7 @@ int CConsoleMinecraftApp::Callback_SaveGameIncompleteMessageBoxReturned(void *pP void CConsoleMinecraftApp::ReadLocalDLCList(void) { char szFile[255]; - DWORD dwLength; + unsigned long dwLength; // read the local dlc list File fDLCList(L"CU/DLCXbox1.cmp") ; if(fDLCList.exists()) @@ -781,7 +781,7 @@ void CConsoleMinecraftApp::ReadLocalDLCList(void) unsigned int uiDecompSize=*(unsigned int *)data.data; unsigned int uiCompSize=((unsigned int *)data.data)[1]; - BYTE *pDecompressedData = new BYTE [uiDecompSize]; + uint8_t *pDecompressedData = new uint8_t [uiDecompSize]; Compression::ECompressionTypes eOriginalCompressionType=Compression::getCompression()->GetDecompressionType(); Compression::getCompression()->SetDecompressionType(Compression::eCompressionType_LZXRLE); @@ -792,7 +792,7 @@ void CConsoleMinecraftApp::ReadLocalDLCList(void) xmlDLCInfoCallback xmlCallback; xmlParser.RegisterSAXCallbackInterface( &xmlCallback ); - xmlParser.ParseXMLBuffer((CHAR *)pDecompressedData,uiDecompSize); + xmlParser.ParseXMLBuffer((char *)pDecompressedData,uiDecompSize); delete pDecompressedData; } diff --git a/src/client/Durango/Durango_App.h b/src/client/Durango/Durango_App.h index 6e021232..cd90836e 100644 --- a/src/client/Durango/Durango_App.h +++ b/src/client/Durango/Durango_App.h @@ -23,18 +23,18 @@ public: virtual void FatalLoadError(); virtual void CaptureSaveThumbnail(); - virtual void GetSaveThumbnail(PBYTE*,DWORD*); + virtual void GetSaveThumbnail(uint8_t**,unsigned long*); virtual void ReleaseSaveThumbnail(); - virtual void GetScreenshot(int iPad,PBYTE *pbData,DWORD *pdwSize); + virtual void GetScreenshot(int iPad,uint8_t* *pbData,unsigned long *pdwSize); - virtual int LoadLocalTMSFile(WCHAR *wchTMSFile); - virtual int LoadLocalTMSFile(WCHAR *wchTMSFile, eFileExtensionType eExt); - int LoadLocalDLCImage(WCHAR *wchName,PBYTE *ppbImageData,DWORD *pdwBytes); + virtual int LoadLocalTMSFile(wchar_t *wchTMSFile); + virtual int LoadLocalTMSFile(wchar_t *wchTMSFile, eFileExtensionType eExt); + int LoadLocalDLCImage(wchar_t *wchName,uint8_t* *ppbImageData,unsigned long *pdwBytes); int LoadLocalDLCImages(); void FreeLocalDLCImages(); virtual void FreeLocalTMSFiles(eTMSFileType eType); - virtual int GetLocalTMSFileIndex(WCHAR *wchTMSFile,bool bFilenameIncludesExtension,eFileExtensionType eEXT=eFileExtensionType_PNG); + virtual int GetLocalTMSFileIndex(wchar_t *wchTMSFile,bool bFilenameIncludesExtension,eFileExtensionType eEXT=eFileExtensionType_PNG); // BANNED LEVEL LIST virtual void ReadBannedList(int iPad, eTMSAction action=(eTMSAction)0, bool bCallback=false) {} @@ -46,11 +46,11 @@ public: void TMSPP_ReadDLCFile(int iPad,eTMSAction NextAction); bool TMSPP_ReadBannedList(int iPad,eTMSAction NextAction); - static int Callback_TMSPPRetrieveFileList(void *pParam,int iPad, int iUserData, LPVOID lpvData,WCHAR *wchFilename); -// static int Callback_TMSPPReadXuidsFile(void *pParam,int iPad, int iUserData, C4JStorage::PTMSPP_FILEDATA pFileData,LPCSTR szFilename); -// static int Callback_TMSPPReadConfigFile(void *pParam,int iPad, int iUserData, C4JStorage::PTMSPP_FILEDATA pFileData, LPCSTR szFilename); - static int Callback_TMSPPReadDLCFile(void *pParam,int iPad, int iUserData, LPVOID lpvData,WCHAR *wchFilename); - static int Callback_TMSPPReadBannedList(void *pParam,int iPad, int iUserData, LPVOID lpvData,WCHAR *wchFilename); + static int Callback_TMSPPRetrieveFileList(void *pParam,int iPad, int iUserData, void* lpvData,wchar_t *wchFilename); +// static int Callback_TMSPPReadXuidsFile(void *pParam,int iPad, int iUserData, C4JStorage::PTMSPP_FILEDATA pFileData,const char* szFilename); +// static int Callback_TMSPPReadConfigFile(void *pParam,int iPad, int iUserData, C4JStorage::PTMSPP_FILEDATA pFileData, const char* szFilename); + static int Callback_TMSPPReadDLCFile(void *pParam,int iPad, int iUserData, void* lpvData,wchar_t *wchFilename); + static int Callback_TMSPPReadBannedList(void *pParam,int iPad, int iUserData, void* lpvData,wchar_t *wchFilename); virtual bool GetTMSDLCInfoRead() { return m_bRead_TMS_DLCINFO_XML;} virtual bool GetTMSGlobalFileListRead() { return m_bTMSPP_GlobalFileListRead;} virtual bool GetTMSUserFileListRead() { return m_bTMSPP_UserFileListRead;} diff --git a/src/client/Durango/Durango_Minecraft.cpp b/src/client/Durango/Durango_Minecraft.cpp index 0e0519a8..83b657bb 100644 --- a/src/client/Durango/Durango_Minecraft.cpp +++ b/src/client/Durango/Durango_Minecraft.cpp @@ -49,7 +49,7 @@ using namespace Windows::Foundation::Collections; //#define PROFILE_VERSION 3 // new version for the interim bug fix 166 TU #define NUM_PROFILE_VALUES 5 #define NUM_PROFILE_SETTINGS 4 -DWORD dwProfileSettingsA[NUM_PROFILE_VALUES]= +unsigned long dwProfileSettingsA[NUM_PROFILE_VALUES]= { #ifdef _XBOX XPROFILE_OPTION_CONTROLLER_VIBRATION, @@ -69,7 +69,7 @@ DWORD dwProfileSettingsA[NUM_PROFILE_VALUES]= //------------------------------------------------------------------------------------- -BOOL g_bWidescreen = true; +bool g_bWidescreen = true; void DefineActions(void) @@ -235,7 +235,7 @@ void DefineActions(void) } #if 0 -HRESULT InitD3D( IDirect3DDevice9 **ppDevice, +int InitD3D( IDirect3DDevice9 **ppDevice, D3DPRESENT_PARAMETERS *pd3dPP ) { IDirect3D9 *pD3D; @@ -290,7 +290,7 @@ void MemSect(int sect) #endif -HINSTANCE g_hInst = NULL; +void* g_hInst = NULL; Platform::Agile g_window; Windows::Foundation::Rect g_windowBounds; @@ -323,7 +323,7 @@ void InitializeDurango(Windows::UI::Core::CoreWindow^ window) namespace DX { - inline void ThrowIfFailed(HRESULT hr) + inline void ThrowIfFailed(int hr) { if (FAILED(hr)) { @@ -337,7 +337,7 @@ void CreateDevice() { // This flag adds support for surfaces with a different color channel ordering than the API default. // It is recommended usage, and is required for compatibility with Direct2D. - UINT creationFlags = D3D11_CREATE_DEVICE_FAST_KICKOFFS; + unsigned int creationFlags = D3D11_CREATE_DEVICE_FAST_KICKOFFS; #ifndef _CONTENT_PACKAGE creationFlags |= D3D11_CREATE_DEVICE_VALIDATED; creationFlags |= D3D11_CREATE_DEVICE_INSTRUMENTED; @@ -582,7 +582,7 @@ void oldWinMainInit() app.ReadLocalDLCList(); // initialise the storage manager with a default save display name, a Minimum save size, and a callback for displaying the saving message - StorageManager.Init(0,app.GetString(IDS_DEFAULT_SAVENAME),"savegame.dat",FIFTY_ONE_MB,&CConsoleMinecraftApp::DisplaySavingMessage,(LPVOID)&app, app.UpdateProductId,SERVICE_CONFIG_ID,TITLE_PRODUCT_ID); + StorageManager.Init(0,app.GetString(IDS_DEFAULT_SAVENAME),"savegame.dat",FIFTY_ONE_MB,&CConsoleMinecraftApp::DisplaySavingMessage,(void*)&app, app.UpdateProductId,SERVICE_CONFIG_ID,TITLE_PRODUCT_ID); StorageManager.SetMaxSaves(99); @@ -595,21 +595,21 @@ void oldWinMainInit() app.GAME_DEFINED_PROFILE_DATA_BYTES*XUSER_MAX_COUNT, &app.uiGameDefinedDataChangedBitmask); - StorageManager.SetDefaultImages((PBYTE)baSaveThumbnail.data, baSaveThumbnail.length); + StorageManager.SetDefaultImages((uint8_t*)baSaveThumbnail.data, baSaveThumbnail.length); // Set function to be called if a save game operation can't complete due to running out of storage space etc. - StorageManager.SetIncompleteSaveCallback(CConsoleMinecraftApp::Callback_SaveGameIncomplete, (LPVOID)&app); + StorageManager.SetIncompleteSaveCallback(CConsoleMinecraftApp::Callback_SaveGameIncomplete, (void*)&app); // set a function to be called when there's a sign in change, so we can exit a level if the primary player signs out - ProfileManager.SetSignInChangeCallback(&CConsoleMinecraftApp::SignInChangeCallback,(LPVOID)&app); + ProfileManager.SetSignInChangeCallback(&CConsoleMinecraftApp::SignInChangeCallback,(void*)&app); // Set a callback for the default player options to be set - when there is no profile data for the player - StorageManager.SetDefaultOptionsCallback(&CConsoleMinecraftApp::DefaultOptionsCallback,(LPVOID)&app); - StorageManager.SetOptionsDataCallback(&CConsoleMinecraftApp::OptionsDataCallback,(LPVOID)&app); + StorageManager.SetDefaultOptionsCallback(&CConsoleMinecraftApp::DefaultOptionsCallback,(void*)&app); + StorageManager.SetOptionsDataCallback(&CConsoleMinecraftApp::OptionsDataCallback,(void*)&app); // Set a callback to deal with old profile versions needing updated to new versions - StorageManager.SetOldProfileVersionCallback(&CConsoleMinecraftApp::OldProfileVersionCallback,(LPVOID)&app); + StorageManager.SetOldProfileVersionCallback(&CConsoleMinecraftApp::OldProfileVersionCallback,(void*)&app); g_NetworkManager.Initialise(); @@ -682,7 +682,7 @@ void oldWinMainInit() app.InitialiseTips(); #if 0 - DWORD initData=0; + unsigned long initData=0; @@ -991,9 +991,9 @@ volatile size_t sizeCheckMin = 1160; volatile size_t sizeCheckMax = 1160; volatile int sectCheck = 48; CRITICAL_SECTION memCS; -DWORD tlsIdx; +unsigned long tlsIdx; -LPVOID XMemAlloc(SIZE_T dwSize, DWORD dwAllocAttributes) +void* XMemAlloc(size_t dwSize, unsigned long dwAllocAttributes) { if( !trackStarted ) { @@ -1047,7 +1047,7 @@ void operator delete (void *p) XMemFree(p,MAKE_XALLOC_ATTRIBUTES(0,false,true,false,0,XALLOC_PHYSICAL_ALIGNMENT_DEFAULT,XALLOC_MEMPROTECT_READWRITE,false,XALLOC_MEMTYPE_HEAP)); } -void WINAPI XMemFree(PVOID pAddress, DWORD dwAllocAttributes) +void WINAPI XMemFree(void* pAddress, unsigned long dwAllocAttributes) { bool special = false; if( dwAllocAttributes == 0 ) @@ -1083,9 +1083,9 @@ void WINAPI XMemFree(PVOID pAddress, DWORD dwAllocAttributes) LeaveCriticalSection(&memCS); } -SIZE_T WINAPI XMemSize( - PVOID pAddress, - DWORD dwAllocAttributes +size_t WINAPI XMemSize( + void* pAddress, + unsigned long dwAllocAttributes ) { if( trackStarted ) @@ -1141,7 +1141,7 @@ void MemSect(int section) { value = (value << 6) | section; } - TlsSetValue(tlsIdx, (LPVOID)value); + TlsSetValue(tlsIdx, (void*)value); } void MemPixStuff() diff --git a/src/client/Durango/Iggy/gdraw/gdraw_d3d11.cpp b/src/client/Durango/Iggy/gdraw/gdraw_d3d11.cpp index 0c106b3f..3f8d54d6 100644 --- a/src/client/Durango/Iggy/gdraw/gdraw_d3d11.cpp +++ b/src/client/Durango/Iggy/gdraw/gdraw_d3d11.cpp @@ -56,12 +56,12 @@ typedef ID3D11DeviceContext ID3D1XContext; typedef F32 ViewCoord; typedef gdraw_d3d11_resourcetype gdraw_resourcetype; -static void report_d3d_error(HRESULT hr, char *call, char *context); +static void report_d3d_error(int hr, char *call, char *context); static void *map_buffer(ID3D1XContext *ctx, ID3D11Buffer *buf, bool discard) { D3D11_MAPPED_SUBRESOURCE msr; - HRESULT hr = ctx->Map(buf, 0, discard ? D3D11_MAP_WRITE_DISCARD : D3D11_MAP_WRITE_NO_OVERWRITE, 0, &msr); + int hr = ctx->Map(buf, 0, discard ? D3D11_MAP_WRITE_DISCARD : D3D11_MAP_WRITE_NO_OVERWRITE, 0, &msr); if (FAILED(hr)) { report_d3d_error(hr, "Map", "of buffer"); return NULL; @@ -84,7 +84,7 @@ static RADINLINE void set_vertex_shader(ID3D11DeviceContext *ctx, ID3D11VertexSh ctx->VSSetShader(shader, NULL, 0); } -static ID3D11BlendState *create_blend_state(ID3D11Device *dev, BOOL blend, D3D11_BLEND src, D3D11_BLEND dst) +static ID3D11BlendState *create_blend_state(ID3D11Device *dev, bool blend, D3D11_BLEND src, D3D11_BLEND dst) { D3D11_BLEND_DESC desc = {}; desc.RenderTarget[0].BlendEnable = blend; @@ -97,7 +97,7 @@ static ID3D11BlendState *create_blend_state(ID3D11Device *dev, BOOL blend, D3D11 desc.RenderTarget[0].RenderTargetWriteMask = D3D11_COLOR_WRITE_ENABLE_ALL; ID3D11BlendState *res; - HRESULT hr = dev->CreateBlendState(&desc, &res); + int hr = dev->CreateBlendState(&desc, &res); if (FAILED(hr)) { report_d3d_error(hr, "CreateBlendState", ""); res = NULL; @@ -113,7 +113,7 @@ static void create_pixel_shader(ProgramWithCachedVariableLocations *p, ProgramWi { *p = *src; if(p->bytecode) { - HRESULT hr = gdraw->d3d_device->CreatePixelShader(p->bytecode, p->size, NULL, &p->pshader); + int hr = gdraw->d3d_device->CreatePixelShader(p->bytecode, p->size, NULL, &p->pshader); if (FAILED(hr)) { report_d3d_error(hr, "CreatePixelShader", ""); p->pshader = NULL; @@ -126,7 +126,7 @@ static void create_vertex_shader(ProgramWithCachedVariableLocations *p, ProgramW { *p = *src; if(p->bytecode) { - HRESULT hr = gdraw->d3d_device->CreateVertexShader(p->bytecode, p->size, NULL, &p->vshader); + int hr = gdraw->d3d_device->CreateVertexShader(p->bytecode, p->size, NULL, &p->vshader); if (FAILED(hr)) { report_d3d_error(hr, "CreateVertexShader", ""); p->vshader = NULL; diff --git a/src/client/Durango/Iggy/gdraw/gdraw_d3d11.h b/src/client/Durango/Iggy/gdraw/gdraw_d3d11.h index c8db492a..12dcdd97 100644 --- a/src/client/Durango/Iggy/gdraw/gdraw_d3d11.h +++ b/src/client/Durango/Iggy/gdraw/gdraw_d3d11.h @@ -46,7 +46,7 @@ IDOC extern GDrawFunctions * gdraw_D3D11_CreateContext(ID3D11Device *dev, ID3D11 IDOC extern void gdraw_D3D11_DestroyContext(void); /* Destroys the current GDraw context, if any. */ -IDOC extern void gdraw_D3D11_SetErrorHandler(void (__cdecl *error_handler)(HRESULT hr)); +IDOC extern void gdraw_D3D11_SetErrorHandler(void (__cdecl *error_handler)(int hr)); /* Sets the GDraw D3D error handler. This will get called with the respective D3D error code if GDraw encounters an error diff --git a/src/client/Durango/Iggy/include/rrCore.h b/src/client/Durango/Iggy/include/rrCore.h index e88b5f8c..16ed3ac2 100644 --- a/src/client/Durango/Iggy/include/rrCore.h +++ b/src/client/Durango/Iggy/include/rrCore.h @@ -917,8 +917,8 @@ #define RAD_S32 signed int // But pointers are 64 bits. #if (_MSC_VER >= 1300 && defined(_Wp64) && _Wp64 ) - #define RAD_SINTa __w64 signed __int64 - #define RAD_UINTa __w64 unsigned __int64 + #define RAD_SINTa __w64 signed int64_t + #define RAD_UINTa __w64 unsigned int64_t #else // non-vc.net compiler or /Wp64 turned off #define RAD_UINTa unsigned long long #define RAD_SINTa signed long long @@ -976,8 +976,8 @@ #define RAD_U64 unsigned long long #define RAD_S64 signed long long #elif defined(__RADX64__) || defined(__RAD32__) - #define RAD_U64 unsigned __int64 - #define RAD_S64 signed __int64 + #define RAD_U64 unsigned int64_t + #define RAD_S64 signed int64_t #else // 16-bit typedef RADSTRUCT RAD_U64 // do this so that we don't accidentally use U64s @@ -1883,7 +1883,7 @@ unsigned long __cdecl _byteswap_ulong (unsigned long _Long); #define RR_BSWAP16 _byteswap_ushort #define RR_BSWAP32 _byteswap_ulong -unsigned __int64 __cdecl _byteswap_uint64 (unsigned __int64 val); +unsigned int64_t __cdecl _byteswap_uint64 (unsigned int64_t val); #pragma intrinsic(_byteswap_uint64) #define RR_BSWAP64 _byteswap_uint64 @@ -1909,15 +1909,15 @@ RADFORCEINLINE unsigned long RR_BSWAP32 (unsigned long _Long) return _Long; } -RADFORCEINLINE unsigned __int64 RR_BSWAP64 (unsigned __int64 _Long) +RADFORCEINLINE unsigned int64_t RR_BSWAP64 (unsigned int64_t _Long) { __asm { - mov eax, DWORD PTR _Long - mov edx, DWORD PTR _Long+4 + mov eax, unsigned long PTR _Long + mov edx, unsigned long PTR _Long+4 bswap eax bswap edx - mov DWORD PTR _Long, edx - mov DWORD PTR _Long+4, eax + mov unsigned long PTR _Long, edx + mov unsigned long PTR _Long+4, eax } return _Long; } @@ -2250,10 +2250,10 @@ void __storewordbytereverse (unsigned int val, int offset, void *bas #if ( defined(_MSC_VER) && _MSC_VER >= 1300) -unsigned __int64 __cdecl _rotl64(unsigned __int64 _Val, int _Shift); +unsigned int64_t __cdecl _rotl64(unsigned int64_t _Val, int _Shift); #pragma intrinsic(_rotl64) -#define RR_ROTL64(x,k) _rotl64((unsigned __int64)(x),(int)(k)) +#define RR_ROTL64(x,k) _rotl64((unsigned int64_t)(x),(int)(k)) #elif defined(__RADCELL__) diff --git a/src/client/Durango/Leaderboards/DurangoLeaderboardManager.cpp b/src/client/Durango/Leaderboards/DurangoLeaderboardManager.cpp index 6b0983a4..661ccba4 100644 --- a/src/client/Durango/Leaderboards/DurangoLeaderboardManager.cpp +++ b/src/client/Durango/Leaderboards/DurangoLeaderboardManager.cpp @@ -103,7 +103,7 @@ void DurangoLeaderboardManager::Tick() { app.DebugPrintf("XboxUserId: %ls\n", result->XboxUserId->Data()); - for( UINT index = 0; indexServiceConfigurationStatistics->Size; index++ ) + for( unsigned int index = 0; indexServiceConfigurationStatistics->Size; index++ ) { MXS::UserStatistics::ServiceConfigurationStatistic^ configStat = result->ServiceConfigurationStatistics->GetAt(index); //app.DebugPrintf("ServiceConfigurationId: %ls\n", configStat->ServiceConfigurationId->Data()); @@ -465,7 +465,7 @@ void DurangoLeaderboardManager::runLeaderboardRequest(WF::IAsyncOperationClear(); app.DebugPrintf("[LeaderboardManager] Retrieved Scores:\n"); - for( UINT index = 0; index < lastResult->Rows->Size; index++ ) + for( unsigned int index = 0; index < lastResult->Rows->Size; index++ ) { MXSL::LeaderboardRow^ row = lastResult->Rows->GetAt(index); @@ -577,7 +577,7 @@ void DurangoLeaderboardManager::updateStatsInfo(int userIndex, int difficulty, E } } -void DurangoLeaderboardManager::GetProfilesCallback(LPVOID param, std::vector profiles) +void DurangoLeaderboardManager::GetProfilesCallback(void* param, std::vector profiles) { DurangoLeaderboardManager *dlm = (DurangoLeaderboardManager *)param; diff --git a/src/client/Durango/Leaderboards/DurangoLeaderboardManager.h b/src/client/Durango/Leaderboards/DurangoLeaderboardManager.h index 2425b949..76c7447f 100644 --- a/src/client/Durango/Leaderboards/DurangoLeaderboardManager.h +++ b/src/client/Durango/Leaderboards/DurangoLeaderboardManager.h @@ -82,7 +82,7 @@ public: //Is the leaderboard manager idle. virtual bool isIdle(); - static void GetProfilesCallback(LPVOID param, std::vector profiles); + static void GetProfilesCallback(void* param, std::vector profiles); private: void runLeaderboardRequest(WF::IAsyncOperation^ asyncOp, int difficulty, EStatsType type, unsigned int readCount, EFilterMode filter); diff --git a/src/client/Durango/Leaderboards/DurangoStatsDebugger.cpp b/src/client/Durango/Leaderboards/DurangoStatsDebugger.cpp index 73fc41dc..fcafe63f 100644 --- a/src/client/Durango/Leaderboards/DurangoStatsDebugger.cpp +++ b/src/client/Durango/Leaderboards/DurangoStatsDebugger.cpp @@ -450,7 +450,7 @@ void DurangoStatsDebugger::retrieveStats(int iPad) int userIndex = 0; for( MXS::UserStatistics::UserStatisticsResult^ result : resultList ) { - for( UINT index = 0; indexServiceConfigurationStatistics->Size; index++ ) + for( unsigned int index = 0; indexServiceConfigurationStatistics->Size; index++ ) { MXS::UserStatistics::ServiceConfigurationStatistic^ configStat = result->ServiceConfigurationStatistics->GetAt(index); diff --git a/src/client/Durango/Miles/include/mss.h b/src/client/Durango/Miles/include/mss.h index 3151336c..0214a590 100644 --- a/src/client/Durango/Miles/include/mss.h +++ b/src/client/Durango/Miles/include/mss.h @@ -319,30 +319,30 @@ RADDEFSTART #elif defined(IS_WINDOWS) - typedef char CHAR; - typedef short SHORT; - typedef int BOOL; - typedef long LONG; - typedef CHAR *LPSTR, *PSTR; + typedef char char; + typedef short int16_t; + typedef int bool; + typedef long int32_t; + typedef char *LPSTR, *PSTR; #ifdef IS_WIN64 - typedef unsigned __int64 ULONG_PTR, *PULONG_PTR; + typedef unsigned int64_t uintptr_t, *PULONG_PTR; #else #ifdef _Wp64 #if !defined(__midl) && (defined(_X86_) || defined(_M_IX86)) && _MSC_VER >= 1300 - typedef __w64 unsigned long ULONG_PTR, *PULONG_PTR; + typedef __w64 unsigned long uintptr_t, *PULONG_PTR; #else - typedef unsigned long ULONG_PTR, *PULONG_PTR; + typedef unsigned long uintptr_t, *PULONG_PTR; #endif #else - typedef unsigned long ULONG_PTR, *PULONG_PTR; + typedef unsigned long uintptr_t, *PULONG_PTR; #endif #endif - typedef ULONG_PTR DWORD_PTR, *PDWORD_PTR; - typedef unsigned long DWORD; - typedef unsigned short WORD; - typedef unsigned int UINT; + typedef uintptr_t DWORD_PTR, *PDWORD_PTR; + typedef unsigned long unsigned long; + typedef unsigned short uint16_t; + typedef unsigned int unsigned int; typedef struct HWAVE__ *HWAVE; typedef struct HWAVEIN__ *HWAVEIN; typedef struct HWAVEOUT__ *HWAVEOUT; @@ -350,7 +350,7 @@ RADDEFSTART typedef HWAVEOUT *LPHWAVEOUT; #ifndef WAVE_MAPPER - #define WAVE_MAPPER ((UINT)-1) + #define WAVE_MAPPER ((unsigned int)-1) #endif typedef struct waveformat_tag *LPWAVEFORMAT; @@ -410,9 +410,9 @@ RADDEFSTART #endif - typedef void * LPVOID; - typedef LPVOID AILLPDIRECTSOUND; - typedef LPVOID AILLPDIRECTSOUNDBUFFER; + typedef void * void*; + typedef void* AILLPDIRECTSOUND; + typedef void* AILLPDIRECTSOUNDBUFFER; #elif defined( IS_MAC ) || defined(IS_IPHONE) || defined(IS_LINUX) diff --git a/src/client/Durango/Miles/include/rrCore.h b/src/client/Durango/Miles/include/rrCore.h index e88b5f8c..16ed3ac2 100644 --- a/src/client/Durango/Miles/include/rrCore.h +++ b/src/client/Durango/Miles/include/rrCore.h @@ -917,8 +917,8 @@ #define RAD_S32 signed int // But pointers are 64 bits. #if (_MSC_VER >= 1300 && defined(_Wp64) && _Wp64 ) - #define RAD_SINTa __w64 signed __int64 - #define RAD_UINTa __w64 unsigned __int64 + #define RAD_SINTa __w64 signed int64_t + #define RAD_UINTa __w64 unsigned int64_t #else // non-vc.net compiler or /Wp64 turned off #define RAD_UINTa unsigned long long #define RAD_SINTa signed long long @@ -976,8 +976,8 @@ #define RAD_U64 unsigned long long #define RAD_S64 signed long long #elif defined(__RADX64__) || defined(__RAD32__) - #define RAD_U64 unsigned __int64 - #define RAD_S64 signed __int64 + #define RAD_U64 unsigned int64_t + #define RAD_S64 signed int64_t #else // 16-bit typedef RADSTRUCT RAD_U64 // do this so that we don't accidentally use U64s @@ -1883,7 +1883,7 @@ unsigned long __cdecl _byteswap_ulong (unsigned long _Long); #define RR_BSWAP16 _byteswap_ushort #define RR_BSWAP32 _byteswap_ulong -unsigned __int64 __cdecl _byteswap_uint64 (unsigned __int64 val); +unsigned int64_t __cdecl _byteswap_uint64 (unsigned int64_t val); #pragma intrinsic(_byteswap_uint64) #define RR_BSWAP64 _byteswap_uint64 @@ -1909,15 +1909,15 @@ RADFORCEINLINE unsigned long RR_BSWAP32 (unsigned long _Long) return _Long; } -RADFORCEINLINE unsigned __int64 RR_BSWAP64 (unsigned __int64 _Long) +RADFORCEINLINE unsigned int64_t RR_BSWAP64 (unsigned int64_t _Long) { __asm { - mov eax, DWORD PTR _Long - mov edx, DWORD PTR _Long+4 + mov eax, unsigned long PTR _Long + mov edx, unsigned long PTR _Long+4 bswap eax bswap edx - mov DWORD PTR _Long, edx - mov DWORD PTR _Long+4, eax + mov unsigned long PTR _Long, edx + mov unsigned long PTR _Long+4, eax } return _Long; } @@ -2250,10 +2250,10 @@ void __storewordbytereverse (unsigned int val, int offset, void *bas #if ( defined(_MSC_VER) && _MSC_VER >= 1300) -unsigned __int64 __cdecl _rotl64(unsigned __int64 _Val, int _Shift); +unsigned int64_t __cdecl _rotl64(unsigned int64_t _Val, int _Shift); #pragma intrinsic(_rotl64) -#define RR_ROTL64(x,k) _rotl64((unsigned __int64)(x),(int)(k)) +#define RR_ROTL64(x,k) _rotl64((unsigned int64_t)(x),(int)(k)) #elif defined(__RADCELL__) diff --git a/src/client/Durango/Minecraft_Macros.h b/src/client/Durango/Minecraft_Macros.h index 4f1f096a..347d9fa4 100644 --- a/src/client/Durango/Minecraft_Macros.h +++ b/src/client/Durango/Minecraft_Macros.h @@ -35,8 +35,8 @@ #define MAKE_SKIN_BITMASK(bDlcSkin, dwSkinId) ( (bDlcSkin?0x80000000:0) | (dwSkinId & 0x7FFFFFFF) ) #define IS_SKIN_ID_IN_RANGE(dwSkinId) (dwSkinId <= 0x7FFFFFFF) -#define GET_DLC_SKIN_ID_FROM_BITMASK(uiBitmask) (((DWORD)uiBitmask)&0x7FFFFFFF) -#define GET_UGC_SKIN_ID_FROM_BITMASK(uiBitmask) (((DWORD)uiBitmask)&0x7FFFFFE0) -#define GET_DEFAULT_SKIN_ID_FROM_BITMASK(uiBitmask) (((DWORD)uiBitmask)&0x0000001F) -#define GET_IS_DLC_SKIN_FROM_BITMASK(uiBitmask) ((((DWORD)uiBitmask)&0x80000000)?true:false) +#define GET_DLC_SKIN_ID_FROM_BITMASK(uiBitmask) (((unsigned long)uiBitmask)&0x7FFFFFFF) +#define GET_UGC_SKIN_ID_FROM_BITMASK(uiBitmask) (((unsigned long)uiBitmask)&0x7FFFFFE0) +#define GET_DEFAULT_SKIN_ID_FROM_BITMASK(uiBitmask) (((unsigned long)uiBitmask)&0x0000001F) +#define GET_IS_DLC_SKIN_FROM_BITMASK(uiBitmask) ((((unsigned long)uiBitmask)&0x80000000)?true:false) diff --git a/src/client/Durango/Network/ChatIntegrationLayer.cpp b/src/client/Durango/Network/ChatIntegrationLayer.cpp index 10ea58ed..ec48e97e 100644 --- a/src/client/Durango/Network/ChatIntegrationLayer.cpp +++ b/src/client/Durango/Network/ChatIntegrationLayer.cpp @@ -661,7 +661,7 @@ void ChatIntegrationLayer::HandleChatChannelChanged( auto chatUsers = GetChatUsers(); if (chatUsers != nullptr ) { - for (UINT chatUserIndex = 0; chatUserIndex < chatUsers->Size; chatUserIndex++) + for (unsigned int chatUserIndex = 0; chatUserIndex < chatUsers->Size; chatUserIndex++) { Microsoft::Xbox::GameChat::ChatUser^ chatUser = chatUsers->GetAt(chatUserIndex); if( chatUser != nullptr && (chatUser->XboxUserId == userBeingRemoved->XboxUserId) ) @@ -770,7 +770,7 @@ void ChatIntegrationLayer::ToggleRenderTargetVolume() auto chatUsers = GetChatUsers(); if (chatUsers != nullptr ) { - for (UINT chatUserIndex = 0; chatUserIndex < chatUsers->Size; chatUserIndex++) + for (unsigned int chatUserIndex = 0; chatUserIndex < chatUsers->Size; chatUserIndex++) { Microsoft::Xbox::GameChat::ChatUser^ chatUser = chatUsers->GetAt(chatUserIndex); if( chatUser != nullptr && chatUser->IsLocal ) diff --git a/src/client/Durango/Network/DQRNetworkManager.cpp b/src/client/Durango/Network/DQRNetworkManager.cpp index b3874970..5292969a 100644 --- a/src/client/Durango/Network/DQRNetworkManager.cpp +++ b/src/client/Durango/Network/DQRNetworkManager.cpp @@ -281,7 +281,7 @@ void DQRNetworkManager::JoinSession(int playerMask) return; } session->SetCurrentUserStatus(MXSM::MultiplayerSessionMemberStatus::Active); - HRESULT hr = S_OK; + int hr = S_OK; session = WriteSessionHelper( joiningUserXBLContext, session, MXSM::MultiplayerSessionWriteMode::UpdateExisting, hr ); HandleSessionChange(session); } @@ -316,7 +316,7 @@ void DQRNetworkManager::JoinSession(int playerMask) memcpy(&localSocketAddressStorage.sin6_addr, &in6addr_any, sizeof(in6addr_any)); - m_localSocketAddress = Platform::ArrayReference(reinterpret_cast(&localSocketAddressStorage), sizeof(localSocketAddressStorage)); + m_localSocketAddress = Platform::ArrayReference(reinterpret_cast(&localSocketAddressStorage), sizeof(localSocketAddressStorage)); m_joinCreateSessionAttempts = 0; @@ -435,7 +435,7 @@ bool DQRNetworkManager::AddUsersToSession(int playerMask, MXSM::MultiplayerSessi continue; } session->SetCurrentUserStatus(MXSM::MultiplayerSessionMemberStatus::Active); - HRESULT hr = S_OK; + int hr = S_OK; session = WriteSessionHelper( newUserXBLContext, session, MXSM::MultiplayerSessionWriteMode::UpdateExisting, hr ); HandleSessionChange(session); @@ -508,7 +508,7 @@ bool DQRNetworkManager::AddLocalPlayerByUserIndex(int userIndex) Platform::String^ secureDeviceAddress = WXN::SecureDeviceAddress::GetLocal()->GetBase64String(); currentSession->SetCurrentUserSecureDeviceAddressBase64( secureDeviceAddress ); - HRESULT result; + int result; WriteSessionHelper(newUserXBLContext, currentSession, MXSM::MultiplayerSessionWriteMode::UpdateExisting, result); // ************ WAITING ************** DQRNetworkPlayer* pPlayer = new DQRNetworkPlayer(this, DQRNetworkPlayer::DNP_TYPE_LOCAL, true, userIndex, m_XRNS_Session->LocalSessionAddress); @@ -680,7 +680,7 @@ bool DQRNetworkManager::RemoveLocalPlayerByUserIndex(int userIndex) // Then leave & update the session currentSession->Leave(); - HRESULT result; + int result; WriteSessionHelper(leavingUserXBLContext, currentSession, MXSM::MultiplayerSessionWriteMode::UpdateExisting, result); m_currentUserMask &= ~(1<(sizeof(SOCKADDR_STORAGE)); + m_remoteSocketAddress = ref new Platform::Array(sizeof(SOCKADDR_STORAGE)); m_sda->GetRemoteSocketAddressBytes(m_remoteSocketAddress); SetState(DNM_INT_STATE_JOINING_CREATE_SESSION); } @@ -1154,7 +1154,7 @@ void DQRNetworkManager::Tick_StateMachine() break; case DNM_INT_STATE_JOINING_SENDING_UNRELIABLE: { - __int64 timeNow = System::currentTimeMillis(); + int64_t timeNow = System::currentTimeMillis(); // m_firstUnreliableSendTime of 0 indicates that we haven't tried sending an unreliable packet yet so need to send one and initialise things if( m_firstUnreliableSendTime == 0 ) { @@ -1188,7 +1188,7 @@ void DQRNetworkManager::Tick_StateMachine() { // Timeout if we've been waiting for reserved slots for our joining players for too long. This is most likely because the host doesn't have room for all the slots we wanted, and we weren't able to determine this // when we went to join the game (ie someone else was joining at the same time). At this point we need to remove any local players that did already join, from both the session and the party. - __int64 timeNow = System::currentTimeMillis(); + int64_t timeNow = System::currentTimeMillis(); if( ( timeNow - m_startedWaitingForReservationsTime ) > JOIN_RESERVATION_WAIT_TIME ) { SetState(DNM_INT_STATE_JOINING_FAILED_TIDY_UP); @@ -1337,7 +1337,7 @@ void DQRNetworkManager::HandleSessionChange(MXSM::MultiplayerSession^ multiplaye } // Utility method to update a session on the server, synchronously. -MXSM::MultiplayerSession^ DQRNetworkManager::WriteSessionHelper( MXS::XboxLiveContext^ xboxLiveContext, MXSM::MultiplayerSession^ multiplayerSession, MXSM::MultiplayerSessionWriteMode writeMode, HRESULT& hr ) +MXSM::MultiplayerSession^ DQRNetworkManager::WriteSessionHelper( MXS::XboxLiveContext^ xboxLiveContext, MXSM::MultiplayerSession^ multiplayerSession, MXSM::MultiplayerSessionWriteMode writeMode, int& hr ) { if (multiplayerSession == nullptr) { @@ -1718,7 +1718,7 @@ void DQRNetworkManager::SendAddPlayerFailed(Platform::String^ xuid) void DQRNetworkManager::SendSmallId(bool reliableAndSequential, int playerMask) { // Send data with small Id setting mode - see full comment in DQRNetworkManagerEventHandlers::DataReceivedHandler - BYTE data[8]; + uint8_t data[8]; data[0] = 0x80; // Send 6 bytes, internal mode. Send on channel 0 but this is ignored. data[1] = 6; data[2] = DQR_INTERNAL_ASSIGN_SMALL_IDS; // Internal data type @@ -1740,12 +1740,12 @@ void DQRNetworkManager::SendSmallId(bool reliableAndSequential, int playerMask) if( member->XboxUserId == m_joinSessionXUIDs[j] ) { - BYTE smallId = 0; + uint8_t smallId = 0; try { Windows::Data::Json::JsonObject^ customConstant = Windows::Data::Json::JsonObject::Parse(member->MemberCustomConstantsJson); Windows::Data::Json::JsonValue^ customValue = customConstant->GetNamedValue(L"smallId"); - smallId = (BYTE)(customValue->GetNumber()); + smallId = (uint8_t)(customValue->GetNumber()); bFound = true; } catch (Platform::COMException^ ex) @@ -1778,7 +1778,7 @@ void DQRNetworkManager::SendUnassignSmallId(int playerIndex) { LogCommentFormat( L"SendUnassignSmallId, channel %d\n", playerIndex); // Send data with small Id setting mode - see full comment in DQRNetworkManagerEventHandlers::DataReceivedHandler - BYTE data[4]; + uint8_t data[4]; data[0] = 0x80 | ( playerIndex << 5 ); // Send 1 byte, internal mode data[1] = 1; data[2] = DQR_INTERNAL_UNASSIGN_SMALL_ID; // Internal data type @@ -1792,12 +1792,12 @@ int DQRNetworkManager::GetSessionIndexForSmallId(unsigned char smallId) for( unsigned int i = 0; i < m_multiplayerSession->Members->Size; i++ ) { MXSM::MultiplayerSessionMember^ member = m_multiplayerSession->Members->GetAt(i); - BYTE smallIdMember = 0; + uint8_t smallIdMember = 0; try { Windows::Data::Json::JsonObject^ customConstant = Windows::Data::Json::JsonObject::Parse(member->MemberCustomConstantsJson); Windows::Data::Json::JsonValue^ customValue = customConstant->GetNamedValue(L"smallId"); - smallIdMember = (BYTE)(customValue->GetNumber()); + smallIdMember = (uint8_t)(customValue->GetNumber()); } catch (Platform::COMException^ ex) { @@ -1830,7 +1830,7 @@ int DQRNetworkManager::GetSessionIndexAndSmallIdForHost(unsigned char *smallId) } if( smallIdMember > 255 ) { - *smallId = (BYTE)(smallIdMember); + *smallId = (uint8_t)(smallIdMember); return i; } } @@ -2013,7 +2013,7 @@ int DQRNetworkManager::HostGameThreadProc() } // This is everything now set up locally as we want to start the session. Now attempt to write the session data to the server - will return a valid new session object if we succeeeded. - HRESULT hr = S_OK; + int hr = S_OK; session = WriteSessionHelper( primaryUserXBLContext, session, MXSM::MultiplayerSessionWriteMode::UpdateOrCreateNew, hr ); // It is important to set the session as soon as we have written it, so that if we get any incoming events (such as the game session ready one) then we will be aware that we are actually already in the session @@ -2031,7 +2031,7 @@ int DQRNetworkManager::HostGameThreadProc() m_partyController->RegisterGamePlayersChangedEventHandler(); // Update session on the server - HRESULT hr = S_OK; + int hr = S_OK; session = WriteSessionHelper( primaryUserXBLContext, session, MXSM::MultiplayerSessionWriteMode::UpdateExisting, hr ); if ( FAILED(hr) ) @@ -2094,7 +2094,7 @@ int DQRNetworkManager::HostGameThreadProc() memcpy(&localSocketAddressStorage.sin6_addr, &in6addr_any, sizeof(in6addr_any)); - m_localSocketAddress = Platform::ArrayReference(reinterpret_cast(&localSocketAddressStorage), sizeof(localSocketAddressStorage)); + m_localSocketAddress = Platform::ArrayReference(reinterpret_cast(&localSocketAddressStorage), sizeof(localSocketAddressStorage)); // This shouldn't ever happen, but seems worth checking that we don't have a pre-existing session in case there's any way to get here with one already running if( m_XRNS_Session ) @@ -2141,7 +2141,7 @@ int DQRNetworkManager::HostGameThreadProc() MXSM::MultiplayerSession^ currentSession = t.get(); currentSession->SetCurrentUserStatus(MXSM::MultiplayerSessionMemberStatus::Active); - HRESULT hr = S_OK; + int hr = S_OK; session = WriteSessionHelper(extraUserXBLContext, currentSession, MXSM::MultiplayerSessionWriteMode::UpdateExisting, hr); } catch ( Platform::COMException^ ex ) @@ -2270,7 +2270,7 @@ int DQRNetworkManager::LeaveRoomThreadProc() if (currentSession != nullptr) { currentSession->Leave(); - HRESULT hr = S_OK; + int hr = S_OK; WriteSessionHelper(leavingUserXBLContext, currentSession, MXSM::MultiplayerSessionWriteMode::UpdateExisting, hr); } else @@ -2382,7 +2382,7 @@ int DQRNetworkManager::TidyUpJoinThreadProc() if( bFound ) { currentSession->Leave(); - HRESULT hr = S_OK; + int hr = S_OK; WriteSessionHelper(leavingUserXBLContext, currentSession, MXSM::MultiplayerSessionWriteMode::UpdateExisting, hr); } } @@ -2470,7 +2470,7 @@ int DQRNetworkManager::UpdateCustomSessionDataThreadProc() session->SetSessionCustomPropertyJson( L"RoomSyncData", currentXuidArray->Stringify() ); LeaveCriticalSection(&m_csRoomSyncData); - HRESULT hr = S_OK; + int hr = S_OK; WriteSessionHelper( primaryUserXBLContext, session, MXSM::MultiplayerSessionWriteMode::UpdateExisting, hr ); // If we didn't succeed, then retry later @@ -2742,7 +2742,7 @@ bool DQRNetworkManager::JoinPartyFromSearchResult(SessionSearchResult *searchRes if( sessionRef != nullptr ) { // Allow 2 seconds before we let the player cancel - __int64 allowCancelTime = System::currentTimeMillis() + (1000 * 2); + int64_t allowCancelTime = System::currentTimeMillis() + (1000 * 2); // Now leave the game session. We need to do this for each player in turn, writing each time. Consider that any of the joining // members *may* have a slot (reserved or active) depending on how far progressed the joining got. @@ -2793,7 +2793,7 @@ bool DQRNetworkManager::JoinPartyFromSearchResult(SessionSearchResult *searchRes if( bFound ) { currentSession->Leave(); - HRESULT hr = S_OK; + int hr = S_OK; WriteSessionHelper(leavingUserXBLContext, currentSession, MXSM::MultiplayerSessionWriteMode::UpdateExisting, hr); } } @@ -2814,7 +2814,7 @@ bool DQRNetworkManager::JoinPartyFromSearchResult(SessionSearchResult *searchRes break; } - __int64 currentTime = System::currentTimeMillis(); + int64_t currentTime = System::currentTimeMillis(); if( currentTime > allowCancelTime) { shownCancelScreen = true; @@ -3024,7 +3024,7 @@ void DQRNetworkManager::RequestDisplayName(DQRNetworkPlayer *player) } } -void DQRNetworkManager::GetProfileCallback(LPVOID pParam, Microsoft::Xbox::Services::Social::XboxUserProfile^ profile) +void DQRNetworkManager::GetProfileCallback(void* pParam, Microsoft::Xbox::Services::Social::XboxUserProfile^ profile) { DQRNetworkManager *dqnm = (DQRNetworkManager *)pParam; dqnm->SetDisplayName(PlayerUID(profile->XboxUserId->Data()), profile->GameDisplayName->Data()); diff --git a/src/client/Durango/Network/DQRNetworkManager.h b/src/client/Durango/Network/DQRNetworkManager.h index ddab11d5..1d6bc005 100644 --- a/src/client/Durango/Network/DQRNetworkManager.h +++ b/src/client/Durango/Network/DQRNetworkManager.h @@ -339,9 +339,9 @@ private: static const eDQRNetworkManagerState m_INTtoEXTStateMappings[DNM_INT_STATE_COUNT]; eDQRNetworkManagerInternalState m_state; eDQRNetworkManagerState m_stateExternal; - __int64 m_lastUnreliableSendTime; - __int64 m_firstUnreliableSendTime; - __int64 m_startedWaitingForReservationsTime; + int64_t m_lastUnreliableSendTime; + int64_t m_firstUnreliableSendTime; + int64_t m_startedWaitingForReservationsTime; unsigned char *m_customSessionData; unsigned int m_customSessionDataSize; int m_customDataDirtyUpdateTicks; @@ -384,8 +384,8 @@ private: Platform::Array^ m_joinSessionXUIDs; int m_joinSmallIdMask; - Platform::Array^ m_remoteSocketAddress; - Platform::Array^ m_localSocketAddress; + Platform::Array^ m_remoteSocketAddress; + Platform::Array^ m_localSocketAddress; int m_joinCreateSessionAttempts; C4JThread *m_CreateSessionThread; @@ -412,20 +412,20 @@ private: MXSM::MultiplayerSession^ WriteSessionHelper( MXS::XboxLiveContext^ xboxLiveContext, MXSM::MultiplayerSession^ multiplayerSession, MXSM::MultiplayerSessionWriteMode writeMode, - HRESULT& hr); + int& hr); MXSM::MultiplayerSessionMember^ GetUserMemberInSession( Windows::Xbox::System::User^ user, MXSM::MultiplayerSession^ session); bool IsPlayerInSession( Platform::String^ xboxUserId, MXSM::MultiplayerSession^ session, int *smallId ); WXM::MultiplayerSessionReference^ ConvertToWindowsXboxMultiplayerSessionReference( MXSM::MultiplayerSessionReference^ sessionRef); MXSM::MultiplayerSessionReference^ ConvertToMicrosoftXboxServicesMultiplayerSessionReference( WXM::MultiplayerSessionReference^ sessionRef ); - void BytesReceived(int smallId, BYTE *bytes, int byteCount); - void BytesReceivedInternal(DQRConnectionInfo *connectionInfo, unsigned int sessionAddress, BYTE *bytes, int byteCount); - void SendBytes(int smallId, BYTE *bytes, int byteCount); + void BytesReceived(int smallId, uint8_t *bytes, int byteCount); + void BytesReceivedInternal(DQRConnectionInfo *connectionInfo, unsigned int sessionAddress, uint8_t *bytes, int byteCount); + void SendBytes(int smallId, uint8_t *bytes, int byteCount); int GetQueueSizeBytes(); int GetQueueSizeMessages(); - void SendBytesRaw(int smallId, BYTE *bytes, int byteCount, bool reliableAndSequential); - void SendBytesChat(unsigned int address, BYTE *bytes, int byteCount, bool reliable, bool sequential, bool broadcast); + void SendBytesRaw(int smallId, uint8_t *bytes, int byteCount, bool reliableAndSequential); + void SendBytesChat(unsigned int address, uint8_t *bytes, int byteCount, bool reliable, bool sequential, bool broadcast); bool AddRoomSyncPlayer(DQRNetworkPlayer *pPlayer, unsigned int sessionAddress, int channel); void RemoveRoomSyncPlayersWithSessionAddress(unsigned int sessionAddress); @@ -439,12 +439,12 @@ private: int GetSessionIndexAndSmallIdForHost(unsigned char *smallId); static void LogComment( Platform::String^ strText ); - static void LogCommentFormat( LPCWSTR strMsg, ... ); - static void LogCommentWithError( Platform::String^ strTest, HRESULT hr ); + static void LogCommentFormat( const wchar_t* strMsg, ... ); + static void LogCommentWithError( Platform::String^ strTest, int hr ); - static Platform::String^ GetErrorString( HRESULT hr ); - static Platform::String^ FormatString( LPCWSTR strMsg, ... ); - static Platform::String^ ConvertHResultToErrorName( HRESULT hr ); + static Platform::String^ GetErrorString( int hr ); + static Platform::String^ FormatString( const wchar_t* strMsg, ... ); + static Platform::String^ ConvertHResultToErrorName( int hr ); Platform::String^ GetNextSmallIdAsJsonString(); static int _HostGameThreadProc( void* lpParameter ); @@ -491,7 +491,7 @@ public: void SetDisplayName(PlayerUID xuid, wstring displayName); private: - __int64 m_playersLeftPartyTime; + int64_t m_playersLeftPartyTime; int m_playersLeftParty; bool GetBestPartyUserIndex(); @@ -528,7 +528,7 @@ private: static DQRNetworkManager *s_pDQRManager; - static void GetProfileCallback(LPVOID pParam, Microsoft::Xbox::Services::Social::XboxUserProfile^ profile); + static void GetProfileCallback(void* pParam, Microsoft::Xbox::Services::Social::XboxUserProfile^ profile); // Forced signout bool m_handleForcedSignOut; diff --git a/src/client/Durango/Network/DQRNetworkManager_Log.cpp b/src/client/Durango/Network/DQRNetworkManager_Log.cpp index 2f68654c..41bbe56b 100644 --- a/src/client/Durango/Network/DQRNetworkManager_Log.cpp +++ b/src/client/Durango/Network/DQRNetworkManager_Log.cpp @@ -39,9 +39,9 @@ void DQRNetworkManager::LogComment( Platform::String^ strText ) #endif } -void DQRNetworkManager::LogCommentFormat( LPCWSTR strMsg, ... ) +void DQRNetworkManager::LogCommentFormat( const wchar_t* strMsg, ... ) { - WCHAR strBuffer[2048]; + wchar_t strBuffer[2048]; va_list args; va_start(args, strMsg); @@ -53,21 +53,21 @@ void DQRNetworkManager::LogCommentFormat( LPCWSTR strMsg, ... ) LogComment(ref new Platform::String(strBuffer)); } -void DQRNetworkManager::LogCommentWithError( Platform::String^ strTest, HRESULT hr ) +void DQRNetworkManager::LogCommentWithError( Platform::String^ strTest, int hr ) { Platform::String^ final = strTest + GetErrorString(hr); LogComment(final); } -Platform::String^ DQRNetworkManager::GetErrorString( HRESULT hr ) +Platform::String^ DQRNetworkManager::GetErrorString( int hr ) { Platform::String^ str = FormatString(L" %s [0x%0.8x]", ConvertHResultToErrorName(hr)->Data(), hr ); return str; } -Platform::String^ DQRNetworkManager::FormatString( LPCWSTR strMsg, ... ) +Platform::String^ DQRNetworkManager::FormatString( const wchar_t* strMsg, ... ) { - WCHAR strBuffer[2048]; + wchar_t strBuffer[2048]; va_list args; va_start(args, strMsg); @@ -80,7 +80,7 @@ Platform::String^ DQRNetworkManager::FormatString( LPCWSTR strMsg, ... ) return str; } -Platform::String^ DQRNetworkManager::ConvertHResultToErrorName( HRESULT hr ) +Platform::String^ DQRNetworkManager::ConvertHResultToErrorName( int hr ) { switch( hr ) { diff --git a/src/client/Durango/Network/DQRNetworkManager_SendReceive.cpp b/src/client/Durango/Network/DQRNetworkManager_SendReceive.cpp index 29063046..e59a2662 100644 --- a/src/client/Durango/Network/DQRNetworkManager_SendReceive.cpp +++ b/src/client/Durango/Network/DQRNetworkManager_SendReceive.cpp @@ -19,7 +19,7 @@ using namespace Windows::Foundation::Collections; // This method is called when bytes have been received that are to be passed on to the game itself. The data is associated with a small id so we can specify which network player // that it was received for. -void DQRNetworkManager::BytesReceived(int smallId, BYTE *bytes, int byteCount) +void DQRNetworkManager::BytesReceived(int smallId, uint8_t *bytes, int byteCount) { DQRNetworkPlayer *host = GetPlayerBySmallId(m_hostSmallId); DQRNetworkPlayer *client = GetPlayerBySmallId(smallId); @@ -44,14 +44,14 @@ void DQRNetworkManager::BytesReceived(int smallId, BYTE *bytes, int byteCount) // updates such as assigning & unassigning of small Ids, transmission of the table of players currently in the session etc. // Processing of these things is handled as a state machine so that we can receive a message split over more than one call to this method should // the underlying communcation layer split data up somehow. -void DQRNetworkManager::BytesReceivedInternal(DQRConnectionInfo *connectionInfo, unsigned int sessionAddress, BYTE *bytes, int byteCount) +void DQRNetworkManager::BytesReceivedInternal(DQRConnectionInfo *connectionInfo, unsigned int sessionAddress, uint8_t *bytes, int byteCount) { - BYTE *pNextByte = bytes; - BYTE *pEndByte = pNextByte + byteCount; + uint8_t *pNextByte = bytes; + uint8_t *pEndByte = pNextByte + byteCount; do { - BYTE byte = *pNextByte; + uint8_t byte = *pNextByte; switch( connectionInfo->m_internalDataState ) { case DQRConnectionInfo::ConnectionState_InternalHeaderByte: @@ -319,7 +319,7 @@ void DQRNetworkManager::BytesReceivedInternal(DQRConnectionInfo *connectionInfo, // This method directly sends bytes via the network communication layer, used to send both game data & data internal to the DQRNetworkManager itself. // This is used by higher level sending methods that wrap communications up with headers that can be processed at the receiving end. -void DQRNetworkManager::SendBytesRaw(int smallId, BYTE *bytes, int byteCount, bool reliableAndSequential) +void DQRNetworkManager::SendBytesRaw(int smallId, uint8_t *bytes, int byteCount, bool reliableAndSequential) { bool broadcast; unsigned int sessionAddress; @@ -350,7 +350,7 @@ void DQRNetworkManager::SendBytesRaw(int smallId, BYTE *bytes, int byteCount, bo } // This method is called by the chat integration layer to be able to send data -void DQRNetworkManager::SendBytesChat(unsigned int address, BYTE *bytes, int byteCount, bool reliable, bool sequential, bool broadcast) +void DQRNetworkManager::SendBytesChat(unsigned int address, uint8_t *bytes, int byteCount, bool reliable, bool sequential, bool broadcast) { unsigned int sessionAddress; @@ -368,13 +368,13 @@ void DQRNetworkManager::SendBytesChat(unsigned int address, BYTE *bytes, int byt } // This is the higher level sending method for sending game data - this prefixes the send with a header so that it will get routed to the correct player. -void DQRNetworkManager::SendBytes(int smallId, BYTE *bytes, int byteCount) +void DQRNetworkManager::SendBytes(int smallId, uint8_t *bytes, int byteCount) { EnterCriticalSection(&m_csSendBytes); unsigned char *tempSendBuffer = (unsigned char *)malloc(8191 + 2); - BYTE *data = bytes; - BYTE *dataEnd = bytes + byteCount; + uint8_t *data = bytes; + uint8_t *dataEnd = bytes + byteCount; // Data to be sent has a header to say which of our own internal channels it is on (2 bits), and number of bytes that are in the message. // The number of bytes has to be stored in 13 bits, and so a maximum of 8191 bytes can be send at a time. Split up longer messages into diff --git a/src/client/Durango/Network/DQRNetworkManager_XRNSEvent.cpp b/src/client/Durango/Network/DQRNetworkManager_XRNSEvent.cpp index 18d0db08..c106a8ce 100644 --- a/src/client/Durango/Network/DQRNetworkManager_XRNSEvent.cpp +++ b/src/client/Durango/Network/DQRNetworkManager_XRNSEvent.cpp @@ -277,11 +277,11 @@ void DQRNetworkManager::Process_RTS_MESSAGE_DATA_RECEIVED(RTS_Message &message) // Where: f is 0 if this is normal data send (to be passed up to the game), or is 1 if this is to be internally processed // cc is the channel number that the data belongs to (0 to 3 representing actual player indices) // sssssssssssss is the count of data bytes to follow (range 0 - 8191) - BYTE *pNextByte = message.m_pucData; - BYTE *pEndByte = pNextByte + message.m_dataSize; + uint8_t *pNextByte = message.m_pucData; + uint8_t *pEndByte = pNextByte + message.m_dataSize; do { - BYTE byte = *pNextByte; + uint8_t byte = *pNextByte; switch( connectionInfo->m_state ) { case DQRConnectionInfo::ConnectionState_HeaderByte0: @@ -343,7 +343,7 @@ void DQRNetworkManager::Process_RTS_MESSAGE_DATA_RECEIVED_CHAT(RTS_Message &mess { if( m_chat ) { - m_chat->OnIncomingChatMessage(message.m_sessionAddress, Platform::ArrayReference(message.m_pucData, message.m_dataSize) ); + m_chat->OnIncomingChatMessage(message.m_sessionAddress, Platform::ArrayReference(message.m_pucData, message.m_dataSize) ); free(message.m_pucData); } } @@ -442,7 +442,7 @@ int DQRNetworkManager::_RTSDoWorkThread(void* lpParameter) return pDQR->RTSDoWorkThread(); } -static const DWORD XRNS_TERMINATE_LOCAL_SESSION_FLAG_IMMEDIATE = 0x00000001; +static const unsigned long XRNS_TERMINATE_LOCAL_SESSION_FLAG_IMMEDIATE = 0x00000001; int DQRNetworkManager::RTSDoWorkThread() { do @@ -578,7 +578,7 @@ void DQRNetworkManager::Process_RTS_MESSAGE_SEND_DATA(RTS_Message &message) m_XRNS_Session->Send( ( message.m_flags & eRTSFlags::RTS_MESSAGE_FLAG_GAME_CHANNEL ) ? WXNRs::ChannelId::DefaultGameSend : WXNRs::ChannelId::DefaultChatSend, ( message.m_flags & eRTSFlags::RTS_MESSAGE_FLAG_BROADCAST_MODE ) ? WXNRs::SendExceptionType::ExcludedAddresses : WXNRs::SendExceptionType::IncludedAddresses, Platform::ArrayReference(&message.m_sessionAddress, 1), - Platform::ArrayReference(message.m_pucData, message.m_dataSize), + Platform::ArrayReference(message.m_pucData, message.m_dataSize), 0, ( message.m_flags & eRTSFlags::RTS_MESSAGE_FLAG_RELIABLE ) ? WXNRs::Send_Reliability::Reliable : WXNRs::Send_Reliability::NonReliable, ( message.m_flags & eRTSFlags::RTS_MESSAGE_FLAG_SEQUENTIAL ) ? WXNRs::Send_Sequence::Sequential : WXNRs::Send_Sequence::NonSequential, diff --git a/src/client/Durango/Network/DQRNetworkPlayer.cpp b/src/client/Durango/Network/DQRNetworkPlayer.cpp index e2d82a90..9adde2dc 100644 --- a/src/client/Durango/Network/DQRNetworkPlayer.cpp +++ b/src/client/Durango/Network/DQRNetworkPlayer.cpp @@ -112,7 +112,7 @@ bool DQRNetworkPlayer::HasCamera() return false; } -LPCWSTR DQRNetworkPlayer::GetGamertag() +const wchar_t* DQRNetworkPlayer::GetGamertag() { return m_name; } @@ -168,7 +168,7 @@ void DQRNetworkPlayer::SendData( DQRNetworkPlayer *pPlayerTarget, const void *da void DQRNetworkPlayer::SendInternal(const void *data, unsigned int dataSize) { - m_manager->SendBytes(m_smallId, (BYTE *)data, dataSize); + m_manager->SendBytes(m_smallId, (uint8_t *)data, dataSize); } int DQRNetworkPlayer::GetSendQueueSizeBytes() diff --git a/src/client/Durango/Network/DQRNetworkPlayer.h b/src/client/Durango/Network/DQRNetworkPlayer.h index fd140722..580ef4f4 100644 --- a/src/client/Durango/Network/DQRNetworkPlayer.h +++ b/src/client/Durango/Network/DQRNetworkPlayer.h @@ -33,7 +33,7 @@ public: bool HasVoice(); bool IsTalking(); bool HasCamera(); - LPCWSTR GetGamertag(); + const wchar_t* GetGamertag(); int GetSmallId(); void SetSmallId(unsigned char smallId); int GetSessionIndex(); diff --git a/src/client/Durango/Network/PartyController.cpp b/src/client/Durango/Network/PartyController.cpp index f21081e3..0fb6ce97 100644 --- a/src/client/Durango/Network/PartyController.cpp +++ b/src/client/Durango/Network/PartyController.cpp @@ -687,7 +687,7 @@ void PartyController::AddAvailableGamePlayers(IVectorView^ availabl { XboxLiveContext^ xboxLiveContext = m_pDQRNet->m_primaryUserXboxLiveContext; DQRNetworkManager::LogComment( L"New members found and added from related parties" ); - HRESULT hr = S_OK; + int hr = S_OK; Microsoft::Xbox::Services::Multiplayer::MultiplayerSession^ outputSession = m_pDQRNet->WriteSessionHelper( xboxLiveContext, currentSession, diff --git a/src/client/Durango/Network/PlatformNetworkManagerDurango.cpp b/src/client/Durango/Network/PlatformNetworkManagerDurango.cpp index c0eb24ac..1e275625 100644 --- a/src/client/Durango/Network/PlatformNetworkManagerDurango.cpp +++ b/src/client/Durango/Network/PlatformNetworkManagerDurango.cpp @@ -817,7 +817,7 @@ bool CPlatformNetworkManagerDurango::GetGameSessionInfo(int iPad, SessionID sess return false; } -void CPlatformNetworkManagerDurango::SetSessionsUpdatedCallback( void (*SessionsUpdatedCallback)(LPVOID pParam), LPVOID pSearchParam ) +void CPlatformNetworkManagerDurango::SetSessionsUpdatedCallback( void (*SessionsUpdatedCallback)(void* pParam), void* pSearchParam ) { m_SessionsUpdatedCallback = SessionsUpdatedCallback; m_pSearchParam = pSearchParam; } @@ -839,7 +839,7 @@ void CPlatformNetworkManagerDurango::ForceFriendsSessionRefresh() INetworkPlayer *CPlatformNetworkManagerDurango::addNetworkPlayer(DQRNetworkPlayer *pDQRPlayer) { NetworkPlayerDurango *pNetworkPlayer = new NetworkPlayerDurango(pDQRPlayer); - pDQRPlayer->SetCustomDataValue((ULONG_PTR)pNetworkPlayer); + pDQRPlayer->SetCustomDataValue((uintptr_t)pNetworkPlayer); currentNetworkPlayers.push_back( pNetworkPlayer ); return pNetworkPlayer; } @@ -915,7 +915,7 @@ void CPlatformNetworkManagerDurango::SetSessionSubTexturePackId( int id ) m_hostGameSessionData.subTexturePackId = id; } -void CPlatformNetworkManagerDurango::Notify(int ID, ULONG_PTR Param) +void CPlatformNetworkManagerDurango::Notify(int ID, uintptr_t Param) { } diff --git a/src/client/Durango/Network/PlatformNetworkManagerDurango.h b/src/client/Durango/Network/PlatformNetworkManagerDurango.h index cf49704c..0ece642d 100644 --- a/src/client/Durango/Network/PlatformNetworkManagerDurango.h +++ b/src/client/Durango/Network/PlatformNetworkManagerDurango.h @@ -69,7 +69,7 @@ private: DQRNetworkManager * m_pDQRNet; // pointer to SQRNetworkManager interface - HANDLE m_notificationListener; + void* m_notificationListener; vector m_machineDQRPrimaryPlayers; // collection of players that we deem to be the main one for that system @@ -134,8 +134,8 @@ private: int m_lastSearchPad; bool m_bSearchResultsReady; bool m_bSearchPending; - LPVOID m_pSearchParam; - void (*m_SessionsUpdatedCallback)(LPVOID pParam); + void* m_pSearchParam; + void (*m_SessionsUpdatedCallback)(void* pParam); void TickSearch(); @@ -146,12 +146,12 @@ private: virtual void SetSessionTexturePackParentId( int id ); virtual void SetSessionSubTexturePackId( int id ); - virtual void Notify(int ID, ULONG_PTR Param); + virtual void Notify(int ID, uintptr_t Param); public: virtual vector *GetSessionList(int iPad, int localPlayers, bool partyOnly); virtual bool GetGameSessionInfo(int iPad, SessionID sessionId,FriendSessionInfo *foundSession); - virtual void SetSessionsUpdatedCallback( void (*SessionsUpdatedCallback)(LPVOID pParam), LPVOID pSearchParam ); + virtual void SetSessionsUpdatedCallback( void (*SessionsUpdatedCallback)(void* pParam), void* pSearchParam ); virtual void GetFullFriendSessionInfo( FriendSessionInfo *foundSession, void (* FriendSessionUpdatedFn)(bool success, void *pParam), void *pParam ); virtual void ForceFriendsSessionRefresh(); diff --git a/src/client/Durango/Sentient/DurangoTelemetry.cpp b/src/client/Durango/Sentient/DurangoTelemetry.cpp index 9cd9f7ce..e6936f0b 100644 --- a/src/client/Durango/Sentient/DurangoTelemetry.cpp +++ b/src/client/Durango/Sentient/DurangoTelemetry.cpp @@ -20,7 +20,7 @@ CTelemetryManager *TelemetryManager = new CDurangoTelemetryManager(); GUID CDurangoTelemetryManager::ZERO_GUID = GUID(); /* -HRESULT CDurangoTelemetryManager::Init() +int CDurangoTelemetryManager::Init() { app.DebugPrintf("[CDurangoTelemetryManager] Init().\n"); @@ -36,13 +36,13 @@ CDurangoTelemetryManager::CDurangoTelemetryManager() } /* -HRESULT CDurangoTelemetryManager::Tick() +int CDurangoTelemetryManager::Tick() { app.DebugPrintf("[CDurangoTelemetryManager] Tick().\n"); return S_OK; } -HRESULT CDurangoTelemetryManager::Flush() +int CDurangoTelemetryManager::Flush() { app.DebugPrintf("[CDurangoTelemetryManager] Flush().\n"); return S_OK; @@ -66,7 +66,7 @@ bool CDurangoTelemetryManager::RecordPlayerSessionExit(int iPad, int exitStatus) if (plr != NULL && plr->level != NULL && plr->level->getLevelData() != NULL) { - ULONG hr = EventWritePlayerSessionEnd( + uint32_t hr = EventWritePlayerSessionEnd( DurangoStats::getUserId(iPad), DurangoStats::getPlayerSession(), DurangoStats::getMultiplayerCorrelationId(), @@ -124,7 +124,7 @@ bool CDurangoTelemetryManager::RecordLevelStart(int iPad, ESen_FriendOrMatch fri { CTelemetryManager::RecordLevelStart(iPad, friendsOrMatch, competeOrCoop, difficulty, numberOfLocalPlayers, numberOfOnlinePlayers); - ULONG hr = 0; + uint32_t hr = 0; // Grab player info. PlayerUID puid; shared_ptr plr; @@ -235,7 +235,7 @@ bool CDurangoTelemetryManager::RecordLevelExit(int iPad, ESen_LevelExitStatus le { CTelemetryManager::RecordLevelExit(iPad, levelExitStatus); - ULONG hr = EventWriteLevelExit( + uint32_t hr = EventWriteLevelExit( DurangoStats::getUserId(iPad), DurangoStats::getPlayerSession(), GetSecondsSinceInitialize(), @@ -280,7 +280,7 @@ bool CDurangoTelemetryManager::RecordLevelSaveOrCheckpoint(int iPad, int saveOrC { CTelemetryManager::RecordLevelSaveOrCheckpoint(iPad, saveOrCheckPointID, saveSizeInBytes); - ULONG hr = EventWriteLevelSaveOrCheckpoint( + uint32_t hr = EventWriteLevelSaveOrCheckpoint( DurangoStats::getUserId(iPad), DurangoStats::getPlayerSession(), GetSecondsSinceInitialize(), @@ -327,7 +327,7 @@ bool CDurangoTelemetryManager::RecordLevelResume(int iPad, ESen_FriendOrMatch fr { CTelemetryManager::RecordLevelResume(iPad, friendsOrMatch, competeOrCoop, difficulty, numberOfLocalPlayers, numberOfOnlinePlayers, saveOrCheckPointID); - ULONG hr = EventWriteLevelResume( + uint32_t hr = EventWriteLevelResume( DurangoStats::getUserId(iPad), DurangoStats::getPlayerSession(), GetSecondsSinceInitialize(), @@ -382,7 +382,7 @@ bool CDurangoTelemetryManager::RecordPauseOrInactive(int iPad) { CTelemetryManager::RecordPauseOrInactive(iPad); - ULONG hr = EventWritePauseOrInactive( + uint32_t hr = EventWritePauseOrInactive( DurangoStats::getUserId(iPad), DurangoStats::getPlayerSession(), GetSecondsSinceInitialize(), @@ -425,7 +425,7 @@ bool CDurangoTelemetryManager::RecordUnpauseOrActive(int iPad) { CTelemetryManager::RecordUnpauseOrActive(iPad); - ULONG hr = EventWriteUnpauseOrActive( + uint32_t hr = EventWriteUnpauseOrActive( DurangoStats::getUserId(iPad), DurangoStats::getPlayerSession(), GetSecondsSinceInitialize(), @@ -468,7 +468,7 @@ bool CDurangoTelemetryManager::RecordMenuShown(int iPad, EUIScene menuID, int op { CTelemetryManager::RecordMenuShown(iPad, menuID, optionalMenuSubID); - ULONG hr = EventWriteMenuShown( + uint32_t hr = EventWriteMenuShown( DurangoStats::getUserId(iPad), DurangoStats::getPlayerSession(), GetSecondsSinceInitialize(), @@ -515,7 +515,7 @@ bool CDurangoTelemetryManager::RecordAchievementUnlocked(int iPad, int achieveme { CTelemetryManager::RecordAchievementUnlocked(iPad, achievementID, achievementGamerscore); - ULONG hr = EventWriteAchievemntUnlocked( + uint32_t hr = EventWriteAchievemntUnlocked( DurangoStats::getUserId(iPad), DurangoStats::getPlayerSession(), GetSecondsSinceInitialize(), @@ -563,7 +563,7 @@ bool CDurangoTelemetryManager::RecordMediaShareUpload(int iPad, ESen_MediaDestin CTelemetryManager::RecordMediaShareUpload(iPad, mediaDestination, mediaType); #if 0 - ULONG hr = EventWriteRecordMediaShareUpload( + uint32_t hr = EventWriteRecordMediaShareUpload( DurangoStats::getUserId(iPad), DurangoStats::getPlayerSession(), GetSecondsSinceInitialize(), @@ -578,7 +578,7 @@ bool CDurangoTelemetryManager::RecordMediaShareUpload(int iPad, ESen_MediaDestin mediaType ); #else - ULONG hr = -1; + uint32_t hr = -1; #endif if (hr == 0) @@ -613,7 +613,7 @@ bool CDurangoTelemetryManager::RecordUpsellPresented(int iPad, ESen_UpsellID ups { //CTelemetryManager::RecordUpsellPresented(iPad, upsellId - ULONG hr = EventWriteUpsellPresented( + uint32_t hr = EventWriteUpsellPresented( DurangoStats::getUserId(iPad), DurangoStats::getPlayerSession(), GetSecondsSinceInitialize(), @@ -658,7 +658,7 @@ bool CDurangoTelemetryManager::RecordUpsellPresented(int iPad, ESen_UpsellID ups bool CDurangoTelemetryManager::RecordUpsellResponded(int iPad, ESen_UpsellID upsellId, int marketplaceOfferID, ESen_UpsellOutcome upsellOutcome) { - ULONG hr = EventWriteUpsellResponded( + uint32_t hr = EventWriteUpsellResponded( DurangoStats::getUserId(iPad), DurangoStats::getPlayerSession(), GetSecondsSinceInitialize(), @@ -705,7 +705,7 @@ bool CDurangoTelemetryManager::RecordUpsellResponded(int iPad, ESen_UpsellID ups bool CDurangoTelemetryManager::RecordPlayerDiedOrFailed(int iPad, int lowResMapX, int lowResMapY, int lowResMapZ, int mapID, int playerWeaponID, int enemyWeaponID, ETelemetryChallenges enemyTypeID) { - ULONG hr = EventWritePlayerDiedOrFailed( + uint32_t hr = EventWritePlayerDiedOrFailed( DurangoStats::getUserId(iPad), DurangoStats::getPlayerSession(), GetSecondsSinceInitialize(), @@ -760,7 +760,7 @@ bool CDurangoTelemetryManager::RecordPlayerDiedOrFailed(int iPad, int lowResMapX bool CDurangoTelemetryManager::RecordEnemyKilledOrOvercome(int iPad, int lowResMapX, int lowResMapY, int lowResMapZ, int mapID, int playerWeaponID, int enemyWeaponID, ETelemetryChallenges enemyTypeID) { - ULONG hr = -1; + uint32_t hr = -1; if (hr == 0) { @@ -798,7 +798,7 @@ bool CDurangoTelemetryManager::RecordEnemyKilledOrOvercome(int iPad, int lowResM bool CDurangoTelemetryManager::RecordTexturePackLoaded(int iPad, int texturePackId, bool purchased) { - ULONG hr = EventWriteTexturePackLoaded( + uint32_t hr = EventWriteTexturePackLoaded( DurangoStats::getUserId(iPad), DurangoStats::getPlayerSession(), GetSecondsSinceInitialize(), @@ -843,7 +843,7 @@ bool CDurangoTelemetryManager::RecordTexturePackLoaded(int iPad, int texturePack bool CDurangoTelemetryManager::RecordSkinChanged(int iPad, int dwSkinId) { - ULONG hr = EventWriteSkinChanged( + uint32_t hr = EventWriteSkinChanged( DurangoStats::getUserId(iPad), DurangoStats::getPlayerSession(), GetSecondsSinceInitialize(), @@ -886,7 +886,7 @@ bool CDurangoTelemetryManager::RecordSkinChanged(int iPad, int dwSkinId) bool CDurangoTelemetryManager::RecordBanLevel(int iPad) { - ULONG hr = EventWriteBanLevel( + uint32_t hr = EventWriteBanLevel( DurangoStats::getUserId(iPad), DurangoStats::getPlayerSession(), GetSecondsSinceInitialize(), @@ -927,7 +927,7 @@ bool CDurangoTelemetryManager::RecordBanLevel(int iPad) bool CDurangoTelemetryManager::RecordUnBanLevel(int iPad) { - ULONG hr = EventWriteUnbanLevel( + uint32_t hr = EventWriteUnbanLevel( DurangoStats::getUserId(iPad), DurangoStats::getPlayerSession(), GetSecondsSinceInitialize(), diff --git a/src/client/Durango/Sentient/DurangoTelemetry.h b/src/client/Durango/Sentient/DurangoTelemetry.h index 15319e48..9f37547a 100644 --- a/src/client/Durango/Sentient/DurangoTelemetry.h +++ b/src/client/Durango/Sentient/DurangoTelemetry.h @@ -13,9 +13,9 @@ public: CDurangoTelemetryManager(); - //virtual HRESULT Init(); - //virtual HRESULT Tick(); - //virtual HRESULT Flush(); + //virtual int Init(); + //virtual int Tick(); + //virtual int Flush(); virtual bool RecordPlayerSessionStart(int iPad); virtual bool RecordPlayerSessionExit(int iPad, int exitStatus); diff --git a/src/client/Durango/Sentient/DynamicConfigurations.h b/src/client/Durango/Sentient/DynamicConfigurations.h index 61b206eb..1119122f 100644 --- a/src/client/Durango/Sentient/DynamicConfigurations.h +++ b/src/client/Durango/Sentient/DynamicConfigurations.h @@ -30,12 +30,12 @@ private: ************************/ // 4J Stu - The first 4 bytes define a version number, that defines the structure of the data - // After reading those bytes into a DWORD, the remainder of the data should be the size of the + // After reading those bytes into a unsigned long, the remainder of the data should be the size of the // relevant struct and can be cast to the struct struct _dynamic_config_trial_data_version1 { // The time in seconds that the player can play the trial for - DWORD trialTimeSeconds; + unsigned long trialTimeSeconds; _dynamic_config_trial_data_version1() { trialTimeSeconds = DYNAMIC_CONFIG_DEFAULT_TRIAL_TIME; } }; @@ -56,13 +56,13 @@ private: public: static void Tick(); - static DWORD GetTrialTime(); + static unsigned long GetTrialTime(); private: static void UpdateAllConfigurations(); static void UpdateNextConfiguration(); static void UpdateConfiguration(EDynamic_Configs id); - static void GetSizeCompletedCallback(HRESULT taskResult, void *userCallbackData); - static void GetDataCompletedCallback(HRESULT taskResult, void *userCallbackData); + static void GetSizeCompletedCallback(int taskResult, void *userCallbackData); + static void GetDataCompletedCallback(int taskResult, void *userCallbackData); }; \ No newline at end of file diff --git a/src/client/Durango/Sentient/SentientManager.h b/src/client/Durango/Sentient/SentientManager.h index d5397249..2e6dd443 100644 --- a/src/client/Durango/Sentient/SentientManager.h +++ b/src/client/Durango/Sentient/SentientManager.h @@ -23,35 +23,35 @@ public: eTelemetry_EnemyKilledOrOvercome, }; - HRESULT Init(); - HRESULT Tick(); + int Init(); + int Tick(); - HRESULT Flush(); + int Flush(); - BOOL RecordPlayerSessionStart(DWORD dwUserId); - BOOL RecordPlayerSessionExit(DWORD dwUserId, int exitStatus); - BOOL RecordHeartBeat(DWORD dwUserId); - BOOL RecordLevelStart(DWORD dwUserId, ESen_FriendOrMatch friendsOrMatch, ESen_CompeteOrCoop competeOrCoop, int difficulty, DWORD numberOfLocalPlayers, DWORD numberOfOnlinePlayers); - BOOL RecordLevelExit(DWORD dwUserId, ESen_LevelExitStatus levelExitStatus); - BOOL RecordLevelSaveOrCheckpoint(DWORD dwUserId, INT saveOrCheckPointID, INT saveSizeInBytes); - BOOL RecordLevelResume(DWORD dwUserId, ESen_FriendOrMatch friendsOrMatch, ESen_CompeteOrCoop competeOrCoop, int difficulty, DWORD numberOfLocalPlayers, DWORD numberOfOnlinePlayers, INT saveOrCheckPointID); - BOOL RecordPauseOrInactive(DWORD dwUserId); - BOOL RecordUnpauseOrActive(DWORD dwUserId); - BOOL RecordMenuShown(DWORD dwUserId, INT menuID, INT optionalMenuSubID); - BOOL RecordAchievementUnlocked(DWORD dwUserId, INT achievementID, INT achievementGamerscore); - BOOL RecordMediaShareUpload(DWORD dwUserId, ESen_MediaDestination mediaDestination, ESen_MediaType mediaType); - BOOL RecordUpsellPresented(DWORD dwUserId, ESen_UpsellID upsellId, INT marketplaceOfferID); - BOOL RecordUpsellResponded(DWORD dwUserId, ESen_UpsellID upsellId, INT marketplaceOfferID, ESen_UpsellOutcome upsellOutcome); - BOOL RecordPlayerDiedOrFailed(DWORD dwUserId, INT lowResMapX, INT lowResMapY, INT lowResMapZ, INT mapID, INT playerWeaponID, INT enemyWeaponID, ETelemetryChallenges enemyTypeID); - BOOL RecordEnemyKilledOrOvercome(DWORD dwUserId, INT lowResMapX, INT lowResMapY, INT lowResMapZ, INT mapID, INT playerWeaponID, INT enemyWeaponID, ETelemetryChallenges enemyTypeID); + bool RecordPlayerSessionStart(unsigned long dwUserId); + bool RecordPlayerSessionExit(unsigned long dwUserId, int exitStatus); + bool RecordHeartBeat(unsigned long dwUserId); + bool RecordLevelStart(unsigned long dwUserId, ESen_FriendOrMatch friendsOrMatch, ESen_CompeteOrCoop competeOrCoop, int difficulty, unsigned long numberOfLocalPlayers, unsigned long numberOfOnlinePlayers); + bool RecordLevelExit(unsigned long dwUserId, ESen_LevelExitStatus levelExitStatus); + bool RecordLevelSaveOrCheckpoint(unsigned long dwUserId, int saveOrCheckPointID, int saveSizeInBytes); + bool RecordLevelResume(unsigned long dwUserId, ESen_FriendOrMatch friendsOrMatch, ESen_CompeteOrCoop competeOrCoop, int difficulty, unsigned long numberOfLocalPlayers, unsigned long numberOfOnlinePlayers, int saveOrCheckPointID); + bool RecordPauseOrInactive(unsigned long dwUserId); + bool RecordUnpauseOrActive(unsigned long dwUserId); + bool RecordMenuShown(unsigned long dwUserId, int menuID, int optionalMenuSubID); + bool RecordAchievementUnlocked(unsigned long dwUserId, int achievementID, int achievementGamerscore); + bool RecordMediaShareUpload(unsigned long dwUserId, ESen_MediaDestination mediaDestination, ESen_MediaType mediaType); + bool RecordUpsellPresented(unsigned long dwUserId, ESen_UpsellID upsellId, int marketplaceOfferID); + bool RecordUpsellResponded(unsigned long dwUserId, ESen_UpsellID upsellId, int marketplaceOfferID, ESen_UpsellOutcome upsellOutcome); + bool RecordPlayerDiedOrFailed(unsigned long dwUserId, int lowResMapX, int lowResMapY, int lowResMapZ, int mapID, int playerWeaponID, int enemyWeaponID, ETelemetryChallenges enemyTypeID); + bool RecordEnemyKilledOrOvercome(unsigned long dwUserId, int lowResMapX, int lowResMapY, int lowResMapZ, int mapID, int playerWeaponID, int enemyWeaponID, ETelemetryChallenges enemyTypeID); - BOOL RecordSkinChanged(DWORD dwUserId, DWORD dwSkinId); - BOOL RecordBanLevel(DWORD dwUserId); - BOOL RecordUnBanLevel(DWORD dwUserId); + bool RecordSkinChanged(unsigned long dwUserId, unsigned long dwSkinId); + bool RecordBanLevel(unsigned long dwUserId); + bool RecordUnBanLevel(unsigned long dwUserId); - INT GetMultiplayerInstanceID(); - INT GenerateMultiplayerInstanceId(); - void SetMultiplayerInstanceId(INT value); + int GetMultiplayerInstanceID(); + int GenerateMultiplayerInstanceId(); + void SetMultiplayerInstanceId(int value); private: float m_initialiseTime; @@ -60,24 +60,24 @@ private: float m_fLevelStartTime[XUSER_MAX_COUNT]; - INT m_multiplayerInstanceID; - DWORD m_levelInstanceID; + int m_multiplayerInstanceID; + unsigned long m_levelInstanceID; // Helper functions to get the various common settings - INT GetSecondsSinceInitialize(); - INT GetMode(DWORD dwUserId); - INT GetSubMode(DWORD dwUserId); - INT GetLevelId(DWORD dwUserId); - INT GetSubLevelId(DWORD dwUserId); - INT GetTitleBuildId(); - INT GetLevelInstanceID(); - INT GetSingleOrMultiplayer(); - INT GetDifficultyLevel(INT diff); - INT GetLicense(); - INT GetDefaultGameControls(); - INT GetAudioSettings(DWORD dwUserId); - INT GetLevelExitProgressStat1(); - INT GetLevelExitProgressStat2(); + int GetSecondsSinceInitialize(); + int GetMode(unsigned long dwUserId); + int GetSubMode(unsigned long dwUserId); + int GetLevelId(unsigned long dwUserId); + int GetSubLevelId(unsigned long dwUserId); + int GetTitleBuildId(); + int GetLevelInstanceID(); + int GetSingleOrMultiplayer(); + int GetDifficultyLevel(int diff); + int GetLicense(); + int GetDefaultGameControls(); + int GetAudioSettings(unsigned long dwUserId); + int GetLevelExitProgressStat1(); + int GetLevelExitProgressStat2(); }; extern CSentientManager SentientManager; \ No newline at end of file diff --git a/src/client/Durango/Sentient/SentientStats.h b/src/client/Durango/Sentient/SentientStats.h index 7115e25d..69d67c82 100644 --- a/src/client/Durango/Sentient/SentientStats.h +++ b/src/client/Durango/Sentient/SentientStats.h @@ -12,77 +12,77 @@ // PlayerSessionStart // Player signed in or joined -BOOL SenStatPlayerSessionStart ( DWORD dwUserID, INT SecondsSinceInitialize, INT ModeID, INT OptionalSubModeID, INT LevelID, INT OptionalSubLevelID, INT TitleBuildID, INT SkeletonDistanceInInches, INT EnrollmentType, INT NumberOfSkeletonsInView ); +bool SenStatPlayerSessionStart ( unsigned long dwUserID, int SecondsSinceInitialize, int ModeID, int OptionalSubModeID, int LevelID, int OptionalSubLevelID, int TitleBuildID, int SkeletonDistanceInInches, int EnrollmentType, int NumberOfSkeletonsInView ); // PlayerSessionExit // Player signed out or left -BOOL SenStatPlayerSessionExit ( DWORD dwUserID, INT SecondsSinceInitialize, INT ModeID, INT OptionalSubModeID, INT LevelID, INT OptionalSubLevelID ); +bool SenStatPlayerSessionExit ( unsigned long dwUserID, int SecondsSinceInitialize, int ModeID, int OptionalSubModeID, int LevelID, int OptionalSubLevelID ); // HeartBeat // Sent every 60 seconds by title -BOOL SenStatHeartBeat ( DWORD dwUserID, INT SecondsSinceInitialize ); +bool SenStatHeartBeat ( unsigned long dwUserID, int SecondsSinceInitialize ); // LevelStart // Level started -BOOL SenStatLevelStart ( DWORD dwUserID, INT SecondsSinceInitialize, INT ModeID, INT OptionalSubModeID, INT LevelID, INT OptionalSubLevelID, INT LevelInstanceID, INT MultiplayerInstanceID, INT SingleOrMultiplayer, INT FriendsOrMatch, INT CompeteOrCoop, INT DifficultyLevel, INT NumberOfLocalPlayers, INT NumberOfOnlinePlayers, INT License, INT DefaultGameControls, INT AudioSettings, INT SkeletonDistanceInInches, INT NumberOfSkeletonsInView ); +bool SenStatLevelStart ( unsigned long dwUserID, int SecondsSinceInitialize, int ModeID, int OptionalSubModeID, int LevelID, int OptionalSubLevelID, int LevelInstanceID, int MultiplayerInstanceID, int SingleOrMultiplayer, int FriendsOrMatch, int CompeteOrCoop, int DifficultyLevel, int NumberOfLocalPlayers, int NumberOfOnlinePlayers, int License, int DefaultGameControls, int AudioSettings, int SkeletonDistanceInInches, int NumberOfSkeletonsInView ); // LevelExit // Level exited -BOOL SenStatLevelExit ( DWORD dwUserID, INT SecondsSinceInitialize, INT ModeID, INT OptionalSubModeID, INT LevelID, INT OptionalSubLevelID, INT LevelInstanceID, INT MultiplayerInstanceID, INT LevelExitStatus, INT LevelExitProgressStat1, INT LevelExitProgressStat2, INT LevelDurationInSeconds ); +bool SenStatLevelExit ( unsigned long dwUserID, int SecondsSinceInitialize, int ModeID, int OptionalSubModeID, int LevelID, int OptionalSubLevelID, int LevelInstanceID, int MultiplayerInstanceID, int LevelExitStatus, int LevelExitProgressStat1, int LevelExitProgressStat2, int LevelDurationInSeconds ); // LevelSaveOrCheckpoint // Level saved explicitly or implicitly -BOOL SenStatLevelSaveOrCheckpoint ( DWORD dwUserID, INT SecondsSinceInitialize, INT ModeID, INT OptionalSubModeID, INT LevelID, INT OptionalSubLevelID, INT LevelInstanceID, INT MultiplayerInstanceID, INT LevelExitProgressStat1, INT LevelExitProgressStat2, INT LevelDurationInSeconds, INT SaveOrCheckPointID ); +bool SenStatLevelSaveOrCheckpoint ( unsigned long dwUserID, int SecondsSinceInitialize, int ModeID, int OptionalSubModeID, int LevelID, int OptionalSubLevelID, int LevelInstanceID, int MultiplayerInstanceID, int LevelExitProgressStat1, int LevelExitProgressStat2, int LevelDurationInSeconds, int SaveOrCheckPointID ); // LevelResume // Level resumed from a save or restarted at a checkpoint -BOOL SenStatLevelResume ( DWORD dwUserID, INT SecondsSinceInitialize, INT ModeID, INT OptionalSubModeID, INT LevelID, INT OptionalSubLevelID, INT LevelInstanceID, INT MultiplayerInstanceID, INT SingleOrMultiplayer, INT FriendsOrMatch, INT CompeteOrCoop, INT DifficultyLevel, INT NumberOfLocalPlayers, INT NumberOfOnlinePlayers, INT License, INT DefaultGameControls, INT SaveOrCheckPointID, INT AudioSettings, INT SkeletonDistanceInInches, INT NumberOfSkeletonsInView ); +bool SenStatLevelResume ( unsigned long dwUserID, int SecondsSinceInitialize, int ModeID, int OptionalSubModeID, int LevelID, int OptionalSubLevelID, int LevelInstanceID, int MultiplayerInstanceID, int SingleOrMultiplayer, int FriendsOrMatch, int CompeteOrCoop, int DifficultyLevel, int NumberOfLocalPlayers, int NumberOfOnlinePlayers, int License, int DefaultGameControls, int SaveOrCheckPointID, int AudioSettings, int SkeletonDistanceInInches, int NumberOfSkeletonsInView ); // PauseOrInactive // Player paused game or has become inactive, level and mode are for what the player is leaving -BOOL SenStatPauseOrInactive ( DWORD dwUserID, INT SecondsSinceInitialize, INT ModeID, INT OptionalSubModeID, INT LevelID, INT OptionalSubLevelID, INT LevelInstanceID, INT MultiplayerInstanceID ); +bool SenStatPauseOrInactive ( unsigned long dwUserID, int SecondsSinceInitialize, int ModeID, int OptionalSubModeID, int LevelID, int OptionalSubLevelID, int LevelInstanceID, int MultiplayerInstanceID ); // UnpauseOrActive // Player unpaused game or has become active, level and mode are for what the player is entering into -BOOL SenStatUnpauseOrActive ( DWORD dwUserID, INT SecondsSinceInitialize, INT ModeID, INT OptionalSubModeID, INT LevelID, INT OptionalSubLevelID, INT LevelInstanceID, INT MultiplayerInstanceID ); +bool SenStatUnpauseOrActive ( unsigned long dwUserID, int SecondsSinceInitialize, int ModeID, int OptionalSubModeID, int LevelID, int OptionalSubLevelID, int LevelInstanceID, int MultiplayerInstanceID ); // MenuShown // A menu screen or major menu area has been shown -BOOL SenStatMenuShown ( DWORD dwUserID, INT SecondsSinceInitialize, INT ModeID, INT OptionalSubModeID, INT LevelID, INT OptionalSubLevelID, INT MenuID, INT OptionalMenuSubID, INT LevelInstanceID, INT MultiplayerInstanceID ); +bool SenStatMenuShown ( unsigned long dwUserID, int SecondsSinceInitialize, int ModeID, int OptionalSubModeID, int LevelID, int OptionalSubLevelID, int MenuID, int OptionalMenuSubID, int LevelInstanceID, int MultiplayerInstanceID ); // AchievementUnlocked // An achievement was unlocked -BOOL SenStatAchievementUnlocked ( DWORD dwUserID, INT SecondsSinceInitialize, INT ModeID, INT OptionalSubModeID, INT LevelID, INT OptionalSubLevelID, INT LevelInstanceID, INT MultiplayerInstanceID, INT AchievementID, INT AchievementGamerscore ); +bool SenStatAchievementUnlocked ( unsigned long dwUserID, int SecondsSinceInitialize, int ModeID, int OptionalSubModeID, int LevelID, int OptionalSubLevelID, int LevelInstanceID, int MultiplayerInstanceID, int AchievementID, int AchievementGamerscore ); // MediaShareUpload // The user uploaded something to Kinect Share -BOOL SenStatMediaShareUpload ( DWORD dwUserID, INT SecondsSinceInitialize, INT ModeID, INT OptionalSubModeID, INT LevelID, INT OptionalSubLevelID, INT LevelInstanceID, INT MultiplayerInstanceID, INT MediaDestination, INT MediaType ); +bool SenStatMediaShareUpload ( unsigned long dwUserID, int SecondsSinceInitialize, int ModeID, int OptionalSubModeID, int LevelID, int OptionalSubLevelID, int LevelInstanceID, int MultiplayerInstanceID, int MediaDestination, int MediaType ); // UpsellPresented // The user is shown an upsell to purchase something -BOOL SenStatUpsellPresented ( DWORD dwUserID, INT SecondsSinceInitialize, INT ModeID, INT OptionalSubModeID, INT LevelID, INT OptionalSubLevelID, INT LevelInstanceID, INT MultiplayerInstanceID, INT UpsellID, INT MarketplaceOfferID ); +bool SenStatUpsellPresented ( unsigned long dwUserID, int SecondsSinceInitialize, int ModeID, int OptionalSubModeID, int LevelID, int OptionalSubLevelID, int LevelInstanceID, int MultiplayerInstanceID, int UpsellID, int MarketplaceOfferID ); // UpsellResponded // The user responded to the upsell -BOOL SenStatUpsellResponded ( DWORD dwUserID, INT SecondsSinceInitialize, INT ModeID, INT OptionalSubModeID, INT LevelID, INT OptionalSubLevelID, INT LevelInstanceID, INT MultiplayerInstanceID, INT UpsellID, INT MarketplaceOfferID, INT UpsellOutcome ); +bool SenStatUpsellResponded ( unsigned long dwUserID, int SecondsSinceInitialize, int ModeID, int OptionalSubModeID, int LevelID, int OptionalSubLevelID, int LevelInstanceID, int MultiplayerInstanceID, int UpsellID, int MarketplaceOfferID, int UpsellOutcome ); // PlayerDiedOrFailed // The player died or failed a challenge - can be used for many types of failure -BOOL SenStatPlayerDiedOrFailed ( DWORD dwUserID, INT ModeID, INT OptionalSubModeID, INT LevelID, INT OptionalSubLevelID, INT LevelInstanceID, INT MultiplayerInstanceID, INT LowResMapX, INT LowResMapY, INT LowResMapZ, INT MapID, INT PlayerWeaponID, INT EnemyWeaponID, INT EnemyTypeID, INT SecondsSinceInitialize, INT CopyOfSecondsSinceInitialize ); +bool SenStatPlayerDiedOrFailed ( unsigned long dwUserID, int ModeID, int OptionalSubModeID, int LevelID, int OptionalSubLevelID, int LevelInstanceID, int MultiplayerInstanceID, int LowResMapX, int LowResMapY, int LowResMapZ, int MapID, int PlayerWeaponID, int EnemyWeaponID, int EnemyTypeID, int SecondsSinceInitialize, int CopyOfSecondsSinceInitialize ); // EnemyKilledOrOvercome // The player killed an enemy or overcame or solved a major challenge -BOOL SenStatEnemyKilledOrOvercome ( DWORD dwUserID, INT ModeID, INT OptionalSubModeID, INT LevelID, INT OptionalSubLevelID, INT LevelInstanceID, INT MultiplayerInstanceID, INT LowResMapX, INT LowResMapY, INT LowResMapZ, INT MapID, INT PlayerWeaponID, INT EnemyWeaponID, INT EnemyTypeID, INT SecondsSinceInitialize, INT CopyOfSecondsSinceInitialize ); +bool SenStatEnemyKilledOrOvercome ( unsigned long dwUserID, int ModeID, int OptionalSubModeID, int LevelID, int OptionalSubLevelID, int LevelInstanceID, int MultiplayerInstanceID, int LowResMapX, int LowResMapY, int LowResMapZ, int MapID, int PlayerWeaponID, int EnemyWeaponID, int EnemyTypeID, int SecondsSinceInitialize, int CopyOfSecondsSinceInitialize ); // SkinChanged // The player has changed their skin, level and mode are for what the player is currently in -BOOL SenStatSkinChanged ( DWORD dwUserID, INT SecondsSinceInitialize, INT ModeID, INT OptionalSubModeID, INT LevelID, INT OptionalSubLevelID, INT LevelInstanceID, INT MultiplayerInstanceID, INT SkinID ); +bool SenStatSkinChanged ( unsigned long dwUserID, int SecondsSinceInitialize, int ModeID, int OptionalSubModeID, int LevelID, int OptionalSubLevelID, int LevelInstanceID, int MultiplayerInstanceID, int SkinID ); // BanLevel // The player has banned a level, level and mode are for what the player is currently in and banning -BOOL SenStatBanLevel ( DWORD dwUserID, INT SecondsSinceInitialize, INT ModeID, INT OptionalSubModeID, INT LevelID, INT OptionalSubLevelID, INT LevelInstanceID, INT MultiplayerInstanceID ); +bool SenStatBanLevel ( unsigned long dwUserID, int SecondsSinceInitialize, int ModeID, int OptionalSubModeID, int LevelID, int OptionalSubLevelID, int LevelInstanceID, int MultiplayerInstanceID ); // UnBanLevel // The player has ubbanned a level, level and mode are for what the player is currently in and unbanning -BOOL SenStatUnBanLevel ( DWORD dwUserID, INT SecondsSinceInitialize, INT ModeID, INT OptionalSubModeID, INT LevelID, INT OptionalSubLevelID, INT LevelInstanceID, INT MultiplayerInstanceID ); +bool SenStatUnBanLevel ( unsigned long dwUserID, int SecondsSinceInitialize, int ModeID, int OptionalSubModeID, int LevelID, int OptionalSubLevelID, int LevelInstanceID, int MultiplayerInstanceID ); diff --git a/src/client/Durango/ServiceConfig/Events-XBLA.8-149E11AEEvents.h b/src/client/Durango/ServiceConfig/Events-XBLA.8-149E11AEEvents.h index f15b8c55..3c1a748d 100644 --- a/src/client/Durango/ServiceConfig/Events-XBLA.8-149E11AEEvents.h +++ b/src/client/Durango/ServiceConfig/Events-XBLA.8-149E11AEEvents.h @@ -185,7 +185,7 @@ Remarks: // Entry point to log the event AchievementGet // __inline -ULONG +uint32_t EventWriteAchievementGet(__in_opt PCWSTR UserId, __in LPCGUID PlayerSessionId, __in const signed int AchievementId) { #define ARGUMENT_COUNT_XBLA_149E11AE_AchievementGet 4 @@ -195,7 +195,7 @@ EventWriteAchievementGet(__in_opt PCWSTR UserId, __in LPCGUID PlayerSessionId, _ EtxFillCommonFields_v7(&EventData[0], scratch, 64); - EventDataDescCreate(&EventData[1], (UserId != NULL) ? UserId : L"", (UserId != NULL) ? (ULONG)((wcslen(UserId) + 1) * sizeof(WCHAR)) : (ULONG)sizeof(L"")); + EventDataDescCreate(&EventData[1], (UserId != NULL) ? UserId : L"", (UserId != NULL) ? (uint32_t)((wcslen(UserId) + 1) * sizeof(wchar_t)) : (uint32_t)sizeof(L"")); EventDataDescCreate(&EventData[2], PlayerSessionId, sizeof(GUID)); EventDataDescCreate(&EventData[3], &AchievementId, sizeof(AchievementId)); @@ -206,7 +206,7 @@ EventWriteAchievementGet(__in_opt PCWSTR UserId, __in LPCGUID PlayerSessionId, _ // Entry point to log the event AchievemntUnlocked // __inline -ULONG +uint32_t EventWriteAchievemntUnlocked(__in_opt PCWSTR UserId, __in LPCGUID PlayerSessionId, __in const signed int SecondsSinceInitialize, __in const signed int Mode, __in const signed int SubMode, __in const signed int LevelId, __in const signed int SubLevelId, __in const signed int LeveInstanceId, __in LPCGUID PlayerSession, __in LPCGUID MultiplayerCorrelationId, __in const signed int AchievementId, __in const signed int AchievementGamerscore) { #define ARGUMENT_COUNT_XBLA_149E11AE_AchievemntUnlocked 13 @@ -216,7 +216,7 @@ EventWriteAchievemntUnlocked(__in_opt PCWSTR UserId, __in LPCGUID PlayerSessionI EtxFillCommonFields_v7(&EventData[0], scratch, 64); - EventDataDescCreate(&EventData[1], (UserId != NULL) ? UserId : L"", (UserId != NULL) ? (ULONG)((wcslen(UserId) + 1) * sizeof(WCHAR)) : (ULONG)sizeof(L"")); + EventDataDescCreate(&EventData[1], (UserId != NULL) ? UserId : L"", (UserId != NULL) ? (uint32_t)((wcslen(UserId) + 1) * sizeof(wchar_t)) : (uint32_t)sizeof(L"")); EventDataDescCreate(&EventData[2], PlayerSessionId, sizeof(GUID)); EventDataDescCreate(&EventData[3], &SecondsSinceInitialize, sizeof(SecondsSinceInitialize)); EventDataDescCreate(&EventData[4], &Mode, sizeof(Mode)); @@ -236,7 +236,7 @@ EventWriteAchievemntUnlocked(__in_opt PCWSTR UserId, __in LPCGUID PlayerSessionI // Entry point to log the event BanLevel // __inline -ULONG +uint32_t EventWriteBanLevel(__in_opt PCWSTR UserId, __in LPCGUID PlayerSessionId, __in const signed int SecondsSinceInitialize, __in const signed int Mode, __in const signed int SubMode, __in const signed int LevelId, __in const signed int SubLevelId, __in const signed int LeveInstanceId, __in LPCGUID PlayerSession, __in LPCGUID MultiplayerCorrelationId) { #define ARGUMENT_COUNT_XBLA_149E11AE_BanLevel 11 @@ -246,7 +246,7 @@ EventWriteBanLevel(__in_opt PCWSTR UserId, __in LPCGUID PlayerSessionId, __in co EtxFillCommonFields_v7(&EventData[0], scratch, 64); - EventDataDescCreate(&EventData[1], (UserId != NULL) ? UserId : L"", (UserId != NULL) ? (ULONG)((wcslen(UserId) + 1) * sizeof(WCHAR)) : (ULONG)sizeof(L"")); + EventDataDescCreate(&EventData[1], (UserId != NULL) ? UserId : L"", (UserId != NULL) ? (uint32_t)((wcslen(UserId) + 1) * sizeof(wchar_t)) : (uint32_t)sizeof(L"")); EventDataDescCreate(&EventData[2], PlayerSessionId, sizeof(GUID)); EventDataDescCreate(&EventData[3], &SecondsSinceInitialize, sizeof(SecondsSinceInitialize)); EventDataDescCreate(&EventData[4], &Mode, sizeof(Mode)); @@ -264,8 +264,8 @@ EventWriteBanLevel(__in_opt PCWSTR UserId, __in LPCGUID PlayerSessionId, __in co // Entry point to log the event BlockBroken // __inline -ULONG -EventWriteBlockBroken(__in_opt PCWSTR UserId, __in LPCGUID PlayerSessionId, __in const signed int DifficultyLevelId, __in const signed int BlockId, __in const signed int BlockAux, __in const unsigned __int64 BlockCount) +uint32_t +EventWriteBlockBroken(__in_opt PCWSTR UserId, __in LPCGUID PlayerSessionId, __in const signed int DifficultyLevelId, __in const signed int BlockId, __in const signed int BlockAux, __in const unsigned int64_t BlockCount) { #define ARGUMENT_COUNT_XBLA_149E11AE_BlockBroken 7 @@ -274,7 +274,7 @@ EventWriteBlockBroken(__in_opt PCWSTR UserId, __in LPCGUID PlayerSessionId, __in EtxFillCommonFields_v7(&EventData[0], scratch, 64); - EventDataDescCreate(&EventData[1], (UserId != NULL) ? UserId : L"", (UserId != NULL) ? (ULONG)((wcslen(UserId) + 1) * sizeof(WCHAR)) : (ULONG)sizeof(L"")); + EventDataDescCreate(&EventData[1], (UserId != NULL) ? UserId : L"", (UserId != NULL) ? (uint32_t)((wcslen(UserId) + 1) * sizeof(wchar_t)) : (uint32_t)sizeof(L"")); EventDataDescCreate(&EventData[2], PlayerSessionId, sizeof(GUID)); EventDataDescCreate(&EventData[3], &DifficultyLevelId, sizeof(DifficultyLevelId)); EventDataDescCreate(&EventData[4], &BlockId, sizeof(BlockId)); @@ -288,8 +288,8 @@ EventWriteBlockBroken(__in_opt PCWSTR UserId, __in LPCGUID PlayerSessionId, __in // Entry point to log the event BlockPlaced // __inline -ULONG -EventWriteBlockPlaced(__in_opt PCWSTR UserId, __in LPCGUID PlayerSessionId, __in const signed int DifficultyLevelId, __in const signed int BlockId, __in const signed int BlockAux, __in const unsigned __int64 BlockCount) +uint32_t +EventWriteBlockPlaced(__in_opt PCWSTR UserId, __in LPCGUID PlayerSessionId, __in const signed int DifficultyLevelId, __in const signed int BlockId, __in const signed int BlockAux, __in const unsigned int64_t BlockCount) { #define ARGUMENT_COUNT_XBLA_149E11AE_BlockPlaced 7 @@ -298,7 +298,7 @@ EventWriteBlockPlaced(__in_opt PCWSTR UserId, __in LPCGUID PlayerSessionId, __in EtxFillCommonFields_v7(&EventData[0], scratch, 64); - EventDataDescCreate(&EventData[1], (UserId != NULL) ? UserId : L"", (UserId != NULL) ? (ULONG)((wcslen(UserId) + 1) * sizeof(WCHAR)) : (ULONG)sizeof(L"")); + EventDataDescCreate(&EventData[1], (UserId != NULL) ? UserId : L"", (UserId != NULL) ? (uint32_t)((wcslen(UserId) + 1) * sizeof(wchar_t)) : (uint32_t)sizeof(L"")); EventDataDescCreate(&EventData[2], PlayerSessionId, sizeof(GUID)); EventDataDescCreate(&EventData[3], &DifficultyLevelId, sizeof(DifficultyLevelId)); EventDataDescCreate(&EventData[4], &BlockId, sizeof(BlockId)); @@ -312,7 +312,7 @@ EventWriteBlockPlaced(__in_opt PCWSTR UserId, __in LPCGUID PlayerSessionId, __in // Entry point to log the event ChestfulOfCobblestone // __inline -ULONG +uint32_t EventWriteChestfulOfCobblestone(__in_opt PCWSTR UserId, __in LPCGUID PlayerSessionId, __in const signed int Cobblecount) { #define ARGUMENT_COUNT_XBLA_149E11AE_ChestfulOfCobblestone 4 @@ -322,7 +322,7 @@ EventWriteChestfulOfCobblestone(__in_opt PCWSTR UserId, __in LPCGUID PlayerSessi EtxFillCommonFields_v7(&EventData[0], scratch, 64); - EventDataDescCreate(&EventData[1], (UserId != NULL) ? UserId : L"", (UserId != NULL) ? (ULONG)((wcslen(UserId) + 1) * sizeof(WCHAR)) : (ULONG)sizeof(L"")); + EventDataDescCreate(&EventData[1], (UserId != NULL) ? UserId : L"", (UserId != NULL) ? (uint32_t)((wcslen(UserId) + 1) * sizeof(wchar_t)) : (uint32_t)sizeof(L"")); EventDataDescCreate(&EventData[2], PlayerSessionId, sizeof(GUID)); EventDataDescCreate(&EventData[3], &Cobblecount, sizeof(Cobblecount)); @@ -333,7 +333,7 @@ EventWriteChestfulOfCobblestone(__in_opt PCWSTR UserId, __in LPCGUID PlayerSessi // Entry point to log the event EnteredNewBiome // __inline -ULONG +uint32_t EventWriteEnteredNewBiome(__in_opt PCWSTR UserId, __in LPCGUID PlayerSessionId, __in const signed int BiomeId) { #define ARGUMENT_COUNT_XBLA_149E11AE_EnteredNewBiome 4 @@ -343,7 +343,7 @@ EventWriteEnteredNewBiome(__in_opt PCWSTR UserId, __in LPCGUID PlayerSessionId, EtxFillCommonFields_v7(&EventData[0], scratch, 64); - EventDataDescCreate(&EventData[1], (UserId != NULL) ? UserId : L"", (UserId != NULL) ? (ULONG)((wcslen(UserId) + 1) * sizeof(WCHAR)) : (ULONG)sizeof(L"")); + EventDataDescCreate(&EventData[1], (UserId != NULL) ? UserId : L"", (UserId != NULL) ? (uint32_t)((wcslen(UserId) + 1) * sizeof(wchar_t)) : (uint32_t)sizeof(L"")); EventDataDescCreate(&EventData[2], PlayerSessionId, sizeof(GUID)); EventDataDescCreate(&EventData[3], &BiomeId, sizeof(BiomeId)); @@ -354,7 +354,7 @@ EventWriteEnteredNewBiome(__in_opt PCWSTR UserId, __in LPCGUID PlayerSessionId, // Entry point to log the event GameProgress // __inline -ULONG +uint32_t EventWriteGameProgress(__in_opt PCWSTR UserId, __in LPCGUID PlayerSessionId, __in const float CompletionPercent) { #define ARGUMENT_COUNT_XBLA_149E11AE_GameProgress 4 @@ -364,7 +364,7 @@ EventWriteGameProgress(__in_opt PCWSTR UserId, __in LPCGUID PlayerSessionId, __i EtxFillCommonFields_v7(&EventData[0], scratch, 64); - EventDataDescCreate(&EventData[1], (UserId != NULL) ? UserId : L"", (UserId != NULL) ? (ULONG)((wcslen(UserId) + 1) * sizeof(WCHAR)) : (ULONG)sizeof(L"")); + EventDataDescCreate(&EventData[1], (UserId != NULL) ? UserId : L"", (UserId != NULL) ? (uint32_t)((wcslen(UserId) + 1) * sizeof(wchar_t)) : (uint32_t)sizeof(L"")); EventDataDescCreate(&EventData[2], PlayerSessionId, sizeof(GUID)); EventDataDescCreate(&EventData[3], &CompletionPercent, sizeof(CompletionPercent)); @@ -375,8 +375,8 @@ EventWriteGameProgress(__in_opt PCWSTR UserId, __in LPCGUID PlayerSessionId, __i // Entry point to log the event IncDistanceTravelled // __inline -ULONG -EventWriteIncDistanceTravelled(__in_opt PCWSTR UserId, __in LPCGUID PlayerSessionId, __in const signed int DifficultyLevelId, __in const unsigned __int64 Distance, __in const signed int TravelMethodId) +uint32_t +EventWriteIncDistanceTravelled(__in_opt PCWSTR UserId, __in LPCGUID PlayerSessionId, __in const signed int DifficultyLevelId, __in const unsigned int64_t Distance, __in const signed int TravelMethodId) { #define ARGUMENT_COUNT_XBLA_149E11AE_IncDistanceTravelled 6 @@ -385,7 +385,7 @@ EventWriteIncDistanceTravelled(__in_opt PCWSTR UserId, __in LPCGUID PlayerSessio EtxFillCommonFields_v7(&EventData[0], scratch, 64); - EventDataDescCreate(&EventData[1], (UserId != NULL) ? UserId : L"", (UserId != NULL) ? (ULONG)((wcslen(UserId) + 1) * sizeof(WCHAR)) : (ULONG)sizeof(L"")); + EventDataDescCreate(&EventData[1], (UserId != NULL) ? UserId : L"", (UserId != NULL) ? (uint32_t)((wcslen(UserId) + 1) * sizeof(wchar_t)) : (uint32_t)sizeof(L"")); EventDataDescCreate(&EventData[2], PlayerSessionId, sizeof(GUID)); EventDataDescCreate(&EventData[3], &DifficultyLevelId, sizeof(DifficultyLevelId)); EventDataDescCreate(&EventData[4], &Distance, sizeof(Distance)); @@ -398,8 +398,8 @@ EventWriteIncDistanceTravelled(__in_opt PCWSTR UserId, __in LPCGUID PlayerSessio // Entry point to log the event IncTimePlayed // __inline -ULONG -EventWriteIncTimePlayed(__in_opt PCWSTR UserId, __in LPCGUID PlayerSessionId, __in const signed int DifficultyLevelId, __in const unsigned __int64 TimePlayed) +uint32_t +EventWriteIncTimePlayed(__in_opt PCWSTR UserId, __in LPCGUID PlayerSessionId, __in const signed int DifficultyLevelId, __in const unsigned int64_t TimePlayed) { #define ARGUMENT_COUNT_XBLA_149E11AE_IncTimePlayed 5 @@ -408,7 +408,7 @@ EventWriteIncTimePlayed(__in_opt PCWSTR UserId, __in LPCGUID PlayerSessionId, __ EtxFillCommonFields_v7(&EventData[0], scratch, 64); - EventDataDescCreate(&EventData[1], (UserId != NULL) ? UserId : L"", (UserId != NULL) ? (ULONG)((wcslen(UserId) + 1) * sizeof(WCHAR)) : (ULONG)sizeof(L"")); + EventDataDescCreate(&EventData[1], (UserId != NULL) ? UserId : L"", (UserId != NULL) ? (uint32_t)((wcslen(UserId) + 1) * sizeof(wchar_t)) : (uint32_t)sizeof(L"")); EventDataDescCreate(&EventData[2], PlayerSessionId, sizeof(GUID)); EventDataDescCreate(&EventData[3], &DifficultyLevelId, sizeof(DifficultyLevelId)); EventDataDescCreate(&EventData[4], &TimePlayed, sizeof(TimePlayed)); @@ -420,7 +420,7 @@ EventWriteIncTimePlayed(__in_opt PCWSTR UserId, __in LPCGUID PlayerSessionId, __ // Entry point to log the event LeaderboardTotals // __inline -ULONG +uint32_t EventWriteLeaderboardTotals(__in_opt PCWSTR UserId, __in LPCGUID PlayerSessionId, __in const signed int DifficultyLevelId, __in const signed int LeaderboardId, __in const signed int Count) { #define ARGUMENT_COUNT_XBLA_149E11AE_LeaderboardTotals 6 @@ -430,7 +430,7 @@ EventWriteLeaderboardTotals(__in_opt PCWSTR UserId, __in LPCGUID PlayerSessionId EtxFillCommonFields_v7(&EventData[0], scratch, 64); - EventDataDescCreate(&EventData[1], (UserId != NULL) ? UserId : L"", (UserId != NULL) ? (ULONG)((wcslen(UserId) + 1) * sizeof(WCHAR)) : (ULONG)sizeof(L"")); + EventDataDescCreate(&EventData[1], (UserId != NULL) ? UserId : L"", (UserId != NULL) ? (uint32_t)((wcslen(UserId) + 1) * sizeof(wchar_t)) : (uint32_t)sizeof(L"")); EventDataDescCreate(&EventData[2], PlayerSessionId, sizeof(GUID)); EventDataDescCreate(&EventData[3], &DifficultyLevelId, sizeof(DifficultyLevelId)); EventDataDescCreate(&EventData[4], &LeaderboardId, sizeof(LeaderboardId)); @@ -443,7 +443,7 @@ EventWriteLeaderboardTotals(__in_opt PCWSTR UserId, __in LPCGUID PlayerSessionId // Entry point to log the event LevelExit // __inline -ULONG +uint32_t EventWriteLevelExit(__in_opt PCWSTR UserId, __in LPCGUID PlayerSessionId, __in const signed int SecondsSinceInitialize, __in const signed int Mode, __in const signed int SubMode, __in const signed int LevelId, __in const signed int SubLevelId, __in const signed int LeveInstanceId, __in LPCGUID MultiplayerCorrelationId, __in const signed int LevelExitStatus, __in LPCGUID PlayerSession) { #define ARGUMENT_COUNT_XBLA_149E11AE_LevelExit 12 @@ -453,7 +453,7 @@ EventWriteLevelExit(__in_opt PCWSTR UserId, __in LPCGUID PlayerSessionId, __in c EtxFillCommonFields_v7(&EventData[0], scratch, 64); - EventDataDescCreate(&EventData[1], (UserId != NULL) ? UserId : L"", (UserId != NULL) ? (ULONG)((wcslen(UserId) + 1) * sizeof(WCHAR)) : (ULONG)sizeof(L"")); + EventDataDescCreate(&EventData[1], (UserId != NULL) ? UserId : L"", (UserId != NULL) ? (uint32_t)((wcslen(UserId) + 1) * sizeof(wchar_t)) : (uint32_t)sizeof(L"")); EventDataDescCreate(&EventData[2], PlayerSessionId, sizeof(GUID)); EventDataDescCreate(&EventData[3], &SecondsSinceInitialize, sizeof(SecondsSinceInitialize)); EventDataDescCreate(&EventData[4], &Mode, sizeof(Mode)); @@ -472,7 +472,7 @@ EventWriteLevelExit(__in_opt PCWSTR UserId, __in LPCGUID PlayerSessionId, __in c // Entry point to log the event LevelResume // __inline -ULONG +uint32_t EventWriteLevelResume(__in_opt PCWSTR UserId, __in LPCGUID PlayerSessionId, __in const signed int SecondsSinceInitialize, __in const signed int Mode, __in const signed int SubMode, __in const signed int LevelId, __in const signed int SubLevelId, __in const signed int LeveInstanceId, __in LPCGUID PlayerSession, __in LPCGUID MultiplayerCorrelationId, __in const signed int FriendsOrMatch, __in const signed int CompeteOrCoop, __in const signed int DifficultyId, __in const signed int NumberOfLocalPlayers, __in const signed int NumberOfOnlinePlayers, __in const signed int SaveOrCheckpointId) { #define ARGUMENT_COUNT_XBLA_149E11AE_LevelResume 17 @@ -482,7 +482,7 @@ EventWriteLevelResume(__in_opt PCWSTR UserId, __in LPCGUID PlayerSessionId, __in EtxFillCommonFields_v7(&EventData[0], scratch, 64); - EventDataDescCreate(&EventData[1], (UserId != NULL) ? UserId : L"", (UserId != NULL) ? (ULONG)((wcslen(UserId) + 1) * sizeof(WCHAR)) : (ULONG)sizeof(L"")); + EventDataDescCreate(&EventData[1], (UserId != NULL) ? UserId : L"", (UserId != NULL) ? (uint32_t)((wcslen(UserId) + 1) * sizeof(wchar_t)) : (uint32_t)sizeof(L"")); EventDataDescCreate(&EventData[2], PlayerSessionId, sizeof(GUID)); EventDataDescCreate(&EventData[3], &SecondsSinceInitialize, sizeof(SecondsSinceInitialize)); EventDataDescCreate(&EventData[4], &Mode, sizeof(Mode)); @@ -506,7 +506,7 @@ EventWriteLevelResume(__in_opt PCWSTR UserId, __in LPCGUID PlayerSessionId, __in // Entry point to log the event LevelSaveOrCheckpoint // __inline -ULONG +uint32_t EventWriteLevelSaveOrCheckpoint(__in_opt PCWSTR UserId, __in LPCGUID PlayerSessionId, __in const signed int SecondsSinceInitialize, __in const signed int Mode, __in const signed int SubMode, __in const signed int LevelId, __in const signed int SubLevelId, __in const signed int LeveInstanceId, __in LPCGUID PlayerSession, __in LPCGUID MultiplayerCorrelationId, __in const signed int SaveOrCheckpointId, __in const signed int SaveSizeInBytes) { #define ARGUMENT_COUNT_XBLA_149E11AE_LevelSaveOrCheckpoint 13 @@ -516,7 +516,7 @@ EventWriteLevelSaveOrCheckpoint(__in_opt PCWSTR UserId, __in LPCGUID PlayerSessi EtxFillCommonFields_v7(&EventData[0], scratch, 64); - EventDataDescCreate(&EventData[1], (UserId != NULL) ? UserId : L"", (UserId != NULL) ? (ULONG)((wcslen(UserId) + 1) * sizeof(WCHAR)) : (ULONG)sizeof(L"")); + EventDataDescCreate(&EventData[1], (UserId != NULL) ? UserId : L"", (UserId != NULL) ? (uint32_t)((wcslen(UserId) + 1) * sizeof(wchar_t)) : (uint32_t)sizeof(L"")); EventDataDescCreate(&EventData[2], PlayerSessionId, sizeof(GUID)); EventDataDescCreate(&EventData[3], &SecondsSinceInitialize, sizeof(SecondsSinceInitialize)); EventDataDescCreate(&EventData[4], &Mode, sizeof(Mode)); @@ -536,7 +536,7 @@ EventWriteLevelSaveOrCheckpoint(__in_opt PCWSTR UserId, __in LPCGUID PlayerSessi // Entry point to log the event LevelStart // __inline -ULONG +uint32_t EventWriteLevelStart(__in_opt PCWSTR UserId, __in LPCGUID PlayerSessionId, __in const signed int SecondsSinceInitialize, __in const signed int Mode, __in const signed int SubMode, __in const signed int LevelId, __in const signed int SubLevelId, __in const signed int LeveInstanceId, __in LPCGUID MultiplayerCorrelationId, __in const signed int FriendsOrMatch, __in const signed int CompeteOrCoop, __in const signed int DifficultyId, __in const signed int NumberOfLocalPlayers, __in const signed int NumberOfOnlinePlayers, __in LPCGUID PlayerSession) { #define ARGUMENT_COUNT_XBLA_149E11AE_LevelStart 16 @@ -546,7 +546,7 @@ EventWriteLevelStart(__in_opt PCWSTR UserId, __in LPCGUID PlayerSessionId, __in EtxFillCommonFields_v7(&EventData[0], scratch, 64); - EventDataDescCreate(&EventData[1], (UserId != NULL) ? UserId : L"", (UserId != NULL) ? (ULONG)((wcslen(UserId) + 1) * sizeof(WCHAR)) : (ULONG)sizeof(L"")); + EventDataDescCreate(&EventData[1], (UserId != NULL) ? UserId : L"", (UserId != NULL) ? (uint32_t)((wcslen(UserId) + 1) * sizeof(wchar_t)) : (uint32_t)sizeof(L"")); EventDataDescCreate(&EventData[2], PlayerSessionId, sizeof(GUID)); EventDataDescCreate(&EventData[3], &SecondsSinceInitialize, sizeof(SecondsSinceInitialize)); EventDataDescCreate(&EventData[4], &Mode, sizeof(Mode)); @@ -569,8 +569,8 @@ EventWriteLevelStart(__in_opt PCWSTR UserId, __in LPCGUID PlayerSessionId, __in // Entry point to log the event McItemAcquired // __inline -ULONG -EventWriteMcItemAcquired(__in_opt PCWSTR UserId, __in const signed int SectionId, __in LPCGUID PlayerSessionId, __in_opt PCWSTR MultiplayerCorrelationId, __in const signed int GameplayModeId, __in const signed int DifficultyLevelId, __in const signed int ItemId, __in const signed int AcquisitionMethodId, __in const float LocationX, __in const float LocationY, __in const float LocationZ, __in const signed int ItemAux, __in const unsigned __int64 ItemCount) +uint32_t +EventWriteMcItemAcquired(__in_opt PCWSTR UserId, __in const signed int SectionId, __in LPCGUID PlayerSessionId, __in_opt PCWSTR MultiplayerCorrelationId, __in const signed int GameplayModeId, __in const signed int DifficultyLevelId, __in const signed int ItemId, __in const signed int AcquisitionMethodId, __in const float LocationX, __in const float LocationY, __in const float LocationZ, __in const signed int ItemAux, __in const unsigned int64_t ItemCount) { #define ARGUMENT_COUNT_XBLA_149E11AE_McItemAcquired 14 @@ -579,10 +579,10 @@ EventWriteMcItemAcquired(__in_opt PCWSTR UserId, __in const signed int SectionId EtxFillCommonFields_v7(&EventData[0], scratch, 64); - EventDataDescCreate(&EventData[1], (UserId != NULL) ? UserId : L"", (UserId != NULL) ? (ULONG)((wcslen(UserId) + 1) * sizeof(WCHAR)) : (ULONG)sizeof(L"")); + EventDataDescCreate(&EventData[1], (UserId != NULL) ? UserId : L"", (UserId != NULL) ? (uint32_t)((wcslen(UserId) + 1) * sizeof(wchar_t)) : (uint32_t)sizeof(L"")); EventDataDescCreate(&EventData[2], &SectionId, sizeof(SectionId)); EventDataDescCreate(&EventData[3], PlayerSessionId, sizeof(GUID)); - EventDataDescCreate(&EventData[4], (MultiplayerCorrelationId != NULL) ? MultiplayerCorrelationId : L"", (MultiplayerCorrelationId != NULL) ? (ULONG)((wcslen(MultiplayerCorrelationId) + 1) * sizeof(WCHAR)) : (ULONG)sizeof(L"")); + EventDataDescCreate(&EventData[4], (MultiplayerCorrelationId != NULL) ? MultiplayerCorrelationId : L"", (MultiplayerCorrelationId != NULL) ? (uint32_t)((wcslen(MultiplayerCorrelationId) + 1) * sizeof(wchar_t)) : (uint32_t)sizeof(L"")); EventDataDescCreate(&EventData[5], &GameplayModeId, sizeof(GameplayModeId)); EventDataDescCreate(&EventData[6], &DifficultyLevelId, sizeof(DifficultyLevelId)); EventDataDescCreate(&EventData[7], &ItemId, sizeof(ItemId)); @@ -600,8 +600,8 @@ EventWriteMcItemAcquired(__in_opt PCWSTR UserId, __in const signed int SectionId // Entry point to log the event McItemUsed // __inline -ULONG -EventWriteMcItemUsed(__in_opt PCWSTR UserId, __in const signed int SectionId, __in LPCGUID PlayerSessionId, __in_opt PCWSTR MultiplayerCorrelationId, __in const signed int GameplayModeId, __in const signed int DifficultyLevelId, __in const signed int ItemId, __in const float LocationX, __in const float LocationY, __in const float LocationZ, __in const signed int ItemAux, __in const unsigned __int64 ItemCount, __in const signed int Hunger) +uint32_t +EventWriteMcItemUsed(__in_opt PCWSTR UserId, __in const signed int SectionId, __in LPCGUID PlayerSessionId, __in_opt PCWSTR MultiplayerCorrelationId, __in const signed int GameplayModeId, __in const signed int DifficultyLevelId, __in const signed int ItemId, __in const float LocationX, __in const float LocationY, __in const float LocationZ, __in const signed int ItemAux, __in const unsigned int64_t ItemCount, __in const signed int Hunger) { #define ARGUMENT_COUNT_XBLA_149E11AE_McItemUsed 14 @@ -610,10 +610,10 @@ EventWriteMcItemUsed(__in_opt PCWSTR UserId, __in const signed int SectionId, __ EtxFillCommonFields_v7(&EventData[0], scratch, 64); - EventDataDescCreate(&EventData[1], (UserId != NULL) ? UserId : L"", (UserId != NULL) ? (ULONG)((wcslen(UserId) + 1) * sizeof(WCHAR)) : (ULONG)sizeof(L"")); + EventDataDescCreate(&EventData[1], (UserId != NULL) ? UserId : L"", (UserId != NULL) ? (uint32_t)((wcslen(UserId) + 1) * sizeof(wchar_t)) : (uint32_t)sizeof(L"")); EventDataDescCreate(&EventData[2], &SectionId, sizeof(SectionId)); EventDataDescCreate(&EventData[3], PlayerSessionId, sizeof(GUID)); - EventDataDescCreate(&EventData[4], (MultiplayerCorrelationId != NULL) ? MultiplayerCorrelationId : L"", (MultiplayerCorrelationId != NULL) ? (ULONG)((wcslen(MultiplayerCorrelationId) + 1) * sizeof(WCHAR)) : (ULONG)sizeof(L"")); + EventDataDescCreate(&EventData[4], (MultiplayerCorrelationId != NULL) ? MultiplayerCorrelationId : L"", (MultiplayerCorrelationId != NULL) ? (uint32_t)((wcslen(MultiplayerCorrelationId) + 1) * sizeof(wchar_t)) : (uint32_t)sizeof(L"")); EventDataDescCreate(&EventData[5], &GameplayModeId, sizeof(GameplayModeId)); EventDataDescCreate(&EventData[6], &DifficultyLevelId, sizeof(DifficultyLevelId)); EventDataDescCreate(&EventData[7], &ItemId, sizeof(ItemId)); @@ -631,7 +631,7 @@ EventWriteMcItemUsed(__in_opt PCWSTR UserId, __in const signed int SectionId, __ // Entry point to log the event MenuShown // __inline -ULONG +uint32_t EventWriteMenuShown(__in_opt PCWSTR UserId, __in LPCGUID PlayerSessionId, __in const signed int SecondsSinceInitialize, __in const signed int Mode, __in const signed int SubMode, __in const signed int LevelId, __in const signed int SubLevelId, __in const signed int LeveInstanceId, __in LPCGUID PlayerSession, __in LPCGUID MultiplayerCorrelationId, __in const signed int MenuId, __in const signed int SubMenuId) { #define ARGUMENT_COUNT_XBLA_149E11AE_MenuShown 13 @@ -641,7 +641,7 @@ EventWriteMenuShown(__in_opt PCWSTR UserId, __in LPCGUID PlayerSessionId, __in c EtxFillCommonFields_v7(&EventData[0], scratch, 64); - EventDataDescCreate(&EventData[1], (UserId != NULL) ? UserId : L"", (UserId != NULL) ? (ULONG)((wcslen(UserId) + 1) * sizeof(WCHAR)) : (ULONG)sizeof(L"")); + EventDataDescCreate(&EventData[1], (UserId != NULL) ? UserId : L"", (UserId != NULL) ? (uint32_t)((wcslen(UserId) + 1) * sizeof(wchar_t)) : (uint32_t)sizeof(L"")); EventDataDescCreate(&EventData[2], PlayerSessionId, sizeof(GUID)); EventDataDescCreate(&EventData[3], &SecondsSinceInitialize, sizeof(SecondsSinceInitialize)); EventDataDescCreate(&EventData[4], &Mode, sizeof(Mode)); @@ -661,7 +661,7 @@ EventWriteMenuShown(__in_opt PCWSTR UserId, __in LPCGUID PlayerSessionId, __in c // Entry point to log the event MobInteract // __inline -ULONG +uint32_t EventWriteMobInteract(__in_opt PCWSTR UserId, __in LPCGUID PlayerSessionId, __in const signed int MobId, __in const signed int InteractionId) { #define ARGUMENT_COUNT_XBLA_149E11AE_MobInteract 5 @@ -671,7 +671,7 @@ EventWriteMobInteract(__in_opt PCWSTR UserId, __in LPCGUID PlayerSessionId, __in EtxFillCommonFields_v7(&EventData[0], scratch, 64); - EventDataDescCreate(&EventData[1], (UserId != NULL) ? UserId : L"", (UserId != NULL) ? (ULONG)((wcslen(UserId) + 1) * sizeof(WCHAR)) : (ULONG)sizeof(L"")); + EventDataDescCreate(&EventData[1], (UserId != NULL) ? UserId : L"", (UserId != NULL) ? (uint32_t)((wcslen(UserId) + 1) * sizeof(wchar_t)) : (uint32_t)sizeof(L"")); EventDataDescCreate(&EventData[2], PlayerSessionId, sizeof(GUID)); EventDataDescCreate(&EventData[3], &MobId, sizeof(MobId)); EventDataDescCreate(&EventData[4], &InteractionId, sizeof(InteractionId)); @@ -683,7 +683,7 @@ EventWriteMobInteract(__in_opt PCWSTR UserId, __in LPCGUID PlayerSessionId, __in // Entry point to log the event MobKilled // __inline -ULONG +uint32_t EventWriteMobKilled(__in_opt PCWSTR UserId, __in const signed int SectionId, __in LPCGUID PlayerSessionId, __in_opt PCWSTR MultiplayerCorrelationId, __in const signed int GameplayModeId, __in const signed int DifficultyLevelId, __in LPCGUID RoundId, __in const signed int PlayerRoleId, __in const signed int PlayerWeaponId, __in const signed int EnemyRoleId, __in const signed int KillTypeId, __in const float LocationX, __in const float LocationY, __in const float LocationZ, __in const signed int EnemyWeaponId, __in const signed int Distance, __in const signed int MobId) { #define ARGUMENT_COUNT_XBLA_149E11AE_MobKilled 18 @@ -693,10 +693,10 @@ EventWriteMobKilled(__in_opt PCWSTR UserId, __in const signed int SectionId, __i EtxFillCommonFields_v7(&EventData[0], scratch, 64); - EventDataDescCreate(&EventData[1], (UserId != NULL) ? UserId : L"", (UserId != NULL) ? (ULONG)((wcslen(UserId) + 1) * sizeof(WCHAR)) : (ULONG)sizeof(L"")); + EventDataDescCreate(&EventData[1], (UserId != NULL) ? UserId : L"", (UserId != NULL) ? (uint32_t)((wcslen(UserId) + 1) * sizeof(wchar_t)) : (uint32_t)sizeof(L"")); EventDataDescCreate(&EventData[2], &SectionId, sizeof(SectionId)); EventDataDescCreate(&EventData[3], PlayerSessionId, sizeof(GUID)); - EventDataDescCreate(&EventData[4], (MultiplayerCorrelationId != NULL) ? MultiplayerCorrelationId : L"", (MultiplayerCorrelationId != NULL) ? (ULONG)((wcslen(MultiplayerCorrelationId) + 1) * sizeof(WCHAR)) : (ULONG)sizeof(L"")); + EventDataDescCreate(&EventData[4], (MultiplayerCorrelationId != NULL) ? MultiplayerCorrelationId : L"", (MultiplayerCorrelationId != NULL) ? (uint32_t)((wcslen(MultiplayerCorrelationId) + 1) * sizeof(wchar_t)) : (uint32_t)sizeof(L"")); EventDataDescCreate(&EventData[5], &GameplayModeId, sizeof(GameplayModeId)); EventDataDescCreate(&EventData[6], &DifficultyLevelId, sizeof(DifficultyLevelId)); EventDataDescCreate(&EventData[7], RoundId, sizeof(GUID)); @@ -718,7 +718,7 @@ EventWriteMobKilled(__in_opt PCWSTR UserId, __in const signed int SectionId, __i // Entry point to log the event MultiplayerRoundEnd // __inline -ULONG +uint32_t EventWriteMultiplayerRoundEnd(__in_opt PCWSTR UserId, __in LPCGUID RoundId, __in const signed int SectionId, __in LPCGUID PlayerSessionId, __in_opt PCWSTR MultiplayerCorrelationId, __in const signed int GameplayModeId, __in const signed int MatchTypeId, __in const signed int DifficultyLevelId, __in const float TimeInSeconds, __in const signed int ExitStatusId) { #define ARGUMENT_COUNT_XBLA_149E11AE_MultiplayerRoundEnd 11 @@ -728,11 +728,11 @@ EventWriteMultiplayerRoundEnd(__in_opt PCWSTR UserId, __in LPCGUID RoundId, __in EtxFillCommonFields_v7(&EventData[0], scratch, 64); - EventDataDescCreate(&EventData[1], (UserId != NULL) ? UserId : L"", (UserId != NULL) ? (ULONG)((wcslen(UserId) + 1) * sizeof(WCHAR)) : (ULONG)sizeof(L"")); + EventDataDescCreate(&EventData[1], (UserId != NULL) ? UserId : L"", (UserId != NULL) ? (uint32_t)((wcslen(UserId) + 1) * sizeof(wchar_t)) : (uint32_t)sizeof(L"")); EventDataDescCreate(&EventData[2], RoundId, sizeof(GUID)); EventDataDescCreate(&EventData[3], &SectionId, sizeof(SectionId)); EventDataDescCreate(&EventData[4], PlayerSessionId, sizeof(GUID)); - EventDataDescCreate(&EventData[5], (MultiplayerCorrelationId != NULL) ? MultiplayerCorrelationId : L"", (MultiplayerCorrelationId != NULL) ? (ULONG)((wcslen(MultiplayerCorrelationId) + 1) * sizeof(WCHAR)) : (ULONG)sizeof(L"")); + EventDataDescCreate(&EventData[5], (MultiplayerCorrelationId != NULL) ? MultiplayerCorrelationId : L"", (MultiplayerCorrelationId != NULL) ? (uint32_t)((wcslen(MultiplayerCorrelationId) + 1) * sizeof(wchar_t)) : (uint32_t)sizeof(L"")); EventDataDescCreate(&EventData[6], &GameplayModeId, sizeof(GameplayModeId)); EventDataDescCreate(&EventData[7], &MatchTypeId, sizeof(MatchTypeId)); EventDataDescCreate(&EventData[8], &DifficultyLevelId, sizeof(DifficultyLevelId)); @@ -746,7 +746,7 @@ EventWriteMultiplayerRoundEnd(__in_opt PCWSTR UserId, __in LPCGUID RoundId, __in // Entry point to log the event MultiplayerRoundStart // __inline -ULONG +uint32_t EventWriteMultiplayerRoundStart(__in_opt PCWSTR UserId, __in LPCGUID RoundId, __in const signed int SectionId, __in LPCGUID PlayerSessionId, __in_opt PCWSTR MultiplayerCorrelationId, __in const signed int GameplayModeId, __in const signed int MatchTypeId, __in const signed int DifficultyLevelId) { #define ARGUMENT_COUNT_XBLA_149E11AE_MultiplayerRoundStart 9 @@ -756,11 +756,11 @@ EventWriteMultiplayerRoundStart(__in_opt PCWSTR UserId, __in LPCGUID RoundId, __ EtxFillCommonFields_v7(&EventData[0], scratch, 64); - EventDataDescCreate(&EventData[1], (UserId != NULL) ? UserId : L"", (UserId != NULL) ? (ULONG)((wcslen(UserId) + 1) * sizeof(WCHAR)) : (ULONG)sizeof(L"")); + EventDataDescCreate(&EventData[1], (UserId != NULL) ? UserId : L"", (UserId != NULL) ? (uint32_t)((wcslen(UserId) + 1) * sizeof(wchar_t)) : (uint32_t)sizeof(L"")); EventDataDescCreate(&EventData[2], RoundId, sizeof(GUID)); EventDataDescCreate(&EventData[3], &SectionId, sizeof(SectionId)); EventDataDescCreate(&EventData[4], PlayerSessionId, sizeof(GUID)); - EventDataDescCreate(&EventData[5], (MultiplayerCorrelationId != NULL) ? MultiplayerCorrelationId : L"", (MultiplayerCorrelationId != NULL) ? (ULONG)((wcslen(MultiplayerCorrelationId) + 1) * sizeof(WCHAR)) : (ULONG)sizeof(L"")); + EventDataDescCreate(&EventData[5], (MultiplayerCorrelationId != NULL) ? MultiplayerCorrelationId : L"", (MultiplayerCorrelationId != NULL) ? (uint32_t)((wcslen(MultiplayerCorrelationId) + 1) * sizeof(wchar_t)) : (uint32_t)sizeof(L"")); EventDataDescCreate(&EventData[6], &GameplayModeId, sizeof(GameplayModeId)); EventDataDescCreate(&EventData[7], &MatchTypeId, sizeof(MatchTypeId)); EventDataDescCreate(&EventData[8], &DifficultyLevelId, sizeof(DifficultyLevelId)); @@ -772,7 +772,7 @@ EventWriteMultiplayerRoundStart(__in_opt PCWSTR UserId, __in LPCGUID RoundId, __ // Entry point to log the event OnARail // __inline -ULONG +uint32_t EventWriteOnARail(__in_opt PCWSTR UserId, __in LPCGUID PlayerSessionId, __in const signed int Distance) { #define ARGUMENT_COUNT_XBLA_149E11AE_OnARail 4 @@ -782,7 +782,7 @@ EventWriteOnARail(__in_opt PCWSTR UserId, __in LPCGUID PlayerSessionId, __in con EtxFillCommonFields_v7(&EventData[0], scratch, 64); - EventDataDescCreate(&EventData[1], (UserId != NULL) ? UserId : L"", (UserId != NULL) ? (ULONG)((wcslen(UserId) + 1) * sizeof(WCHAR)) : (ULONG)sizeof(L"")); + EventDataDescCreate(&EventData[1], (UserId != NULL) ? UserId : L"", (UserId != NULL) ? (uint32_t)((wcslen(UserId) + 1) * sizeof(wchar_t)) : (uint32_t)sizeof(L"")); EventDataDescCreate(&EventData[2], PlayerSessionId, sizeof(GUID)); EventDataDescCreate(&EventData[3], &Distance, sizeof(Distance)); @@ -793,7 +793,7 @@ EventWriteOnARail(__in_opt PCWSTR UserId, __in LPCGUID PlayerSessionId, __in con // Entry point to log the event Overkill // __inline -ULONG +uint32_t EventWriteOverkill(__in_opt PCWSTR UserId, __in LPCGUID PlayerSessionId, __in const signed int Damage) { #define ARGUMENT_COUNT_XBLA_149E11AE_Overkill 4 @@ -803,7 +803,7 @@ EventWriteOverkill(__in_opt PCWSTR UserId, __in LPCGUID PlayerSessionId, __in co EtxFillCommonFields_v7(&EventData[0], scratch, 64); - EventDataDescCreate(&EventData[1], (UserId != NULL) ? UserId : L"", (UserId != NULL) ? (ULONG)((wcslen(UserId) + 1) * sizeof(WCHAR)) : (ULONG)sizeof(L"")); + EventDataDescCreate(&EventData[1], (UserId != NULL) ? UserId : L"", (UserId != NULL) ? (uint32_t)((wcslen(UserId) + 1) * sizeof(wchar_t)) : (uint32_t)sizeof(L"")); EventDataDescCreate(&EventData[2], PlayerSessionId, sizeof(GUID)); EventDataDescCreate(&EventData[3], &Damage, sizeof(Damage)); @@ -814,7 +814,7 @@ EventWriteOverkill(__in_opt PCWSTR UserId, __in LPCGUID PlayerSessionId, __in co // Entry point to log the event PauseOrInactive // __inline -ULONG +uint32_t EventWritePauseOrInactive(__in_opt PCWSTR UserId, __in LPCGUID PlayerSessionId, __in const signed int SecondsSinceInitialize, __in const signed int Mode, __in const signed int SubMode, __in const signed int LevelId, __in const signed int SubLevelId, __in const signed int LeveInstanceId, __in LPCGUID PlayerSession, __in LPCGUID MultiplayerCorrelationId) { #define ARGUMENT_COUNT_XBLA_149E11AE_PauseOrInactive 11 @@ -824,7 +824,7 @@ EventWritePauseOrInactive(__in_opt PCWSTR UserId, __in LPCGUID PlayerSessionId, EtxFillCommonFields_v7(&EventData[0], scratch, 64); - EventDataDescCreate(&EventData[1], (UserId != NULL) ? UserId : L"", (UserId != NULL) ? (ULONG)((wcslen(UserId) + 1) * sizeof(WCHAR)) : (ULONG)sizeof(L"")); + EventDataDescCreate(&EventData[1], (UserId != NULL) ? UserId : L"", (UserId != NULL) ? (uint32_t)((wcslen(UserId) + 1) * sizeof(wchar_t)) : (uint32_t)sizeof(L"")); EventDataDescCreate(&EventData[2], PlayerSessionId, sizeof(GUID)); EventDataDescCreate(&EventData[3], &SecondsSinceInitialize, sizeof(SecondsSinceInitialize)); EventDataDescCreate(&EventData[4], &Mode, sizeof(Mode)); @@ -842,7 +842,7 @@ EventWritePauseOrInactive(__in_opt PCWSTR UserId, __in LPCGUID PlayerSessionId, // Entry point to log the event PlayedMusicDisc // __inline -ULONG +uint32_t EventWritePlayedMusicDisc(__in_opt PCWSTR UserId, __in LPCGUID PlayerSessionId, __in const signed int DiscId) { #define ARGUMENT_COUNT_XBLA_149E11AE_PlayedMusicDisc 4 @@ -852,7 +852,7 @@ EventWritePlayedMusicDisc(__in_opt PCWSTR UserId, __in LPCGUID PlayerSessionId, EtxFillCommonFields_v7(&EventData[0], scratch, 64); - EventDataDescCreate(&EventData[1], (UserId != NULL) ? UserId : L"", (UserId != NULL) ? (ULONG)((wcslen(UserId) + 1) * sizeof(WCHAR)) : (ULONG)sizeof(L"")); + EventDataDescCreate(&EventData[1], (UserId != NULL) ? UserId : L"", (UserId != NULL) ? (uint32_t)((wcslen(UserId) + 1) * sizeof(wchar_t)) : (uint32_t)sizeof(L"")); EventDataDescCreate(&EventData[2], PlayerSessionId, sizeof(GUID)); EventDataDescCreate(&EventData[3], &DiscId, sizeof(DiscId)); @@ -863,7 +863,7 @@ EventWritePlayedMusicDisc(__in_opt PCWSTR UserId, __in LPCGUID PlayerSessionId, // Entry point to log the event PlayerDiedOrFailed // __inline -ULONG +uint32_t EventWritePlayerDiedOrFailed(__in_opt PCWSTR UserId, __in LPCGUID PlayerSessionId, __in const signed int SecondsSinceInitialize, __in const signed int Mode, __in const signed int SubMode, __in const signed int LevelId, __in const signed int SubLevelId, __in const signed int LeveInstanceId, __in LPCGUID PlayerSession, __in LPCGUID MultiplayerCorrelationId, __in const signed int LowResMapX, __in const signed int LowResMapY, __in const signed int LowResMapZ, __in const signed int MapId, __in const signed int PlayerWeaponId, __in const signed int EnemyWeaponId, __in const signed int EnemyTypeId) { #define ARGUMENT_COUNT_XBLA_149E11AE_PlayerDiedOrFailed 18 @@ -873,7 +873,7 @@ EventWritePlayerDiedOrFailed(__in_opt PCWSTR UserId, __in LPCGUID PlayerSessionI EtxFillCommonFields_v7(&EventData[0], scratch, 64); - EventDataDescCreate(&EventData[1], (UserId != NULL) ? UserId : L"", (UserId != NULL) ? (ULONG)((wcslen(UserId) + 1) * sizeof(WCHAR)) : (ULONG)sizeof(L"")); + EventDataDescCreate(&EventData[1], (UserId != NULL) ? UserId : L"", (UserId != NULL) ? (uint32_t)((wcslen(UserId) + 1) * sizeof(wchar_t)) : (uint32_t)sizeof(L"")); EventDataDescCreate(&EventData[2], PlayerSessionId, sizeof(GUID)); EventDataDescCreate(&EventData[3], &SecondsSinceInitialize, sizeof(SecondsSinceInitialize)); EventDataDescCreate(&EventData[4], &Mode, sizeof(Mode)); @@ -898,7 +898,7 @@ EventWritePlayerDiedOrFailed(__in_opt PCWSTR UserId, __in LPCGUID PlayerSessionI // Entry point to log the event PlayerSessionEnd // __inline -ULONG +uint32_t EventWritePlayerSessionEnd(__in_opt PCWSTR UserId, __in LPCGUID PlayerSessionId, __in_opt PCWSTR MultiplayerCorrelationId, __in const signed int GameplayModeId, __in const signed int DifficultyLevelId, __in const signed int ExitStatusId) { #define ARGUMENT_COUNT_XBLA_149E11AE_PlayerSessionEnd 7 @@ -908,9 +908,9 @@ EventWritePlayerSessionEnd(__in_opt PCWSTR UserId, __in LPCGUID PlayerSessionId, EtxFillCommonFields_v7(&EventData[0], scratch, 64); - EventDataDescCreate(&EventData[1], (UserId != NULL) ? UserId : L"", (UserId != NULL) ? (ULONG)((wcslen(UserId) + 1) * sizeof(WCHAR)) : (ULONG)sizeof(L"")); + EventDataDescCreate(&EventData[1], (UserId != NULL) ? UserId : L"", (UserId != NULL) ? (uint32_t)((wcslen(UserId) + 1) * sizeof(wchar_t)) : (uint32_t)sizeof(L"")); EventDataDescCreate(&EventData[2], PlayerSessionId, sizeof(GUID)); - EventDataDescCreate(&EventData[3], (MultiplayerCorrelationId != NULL) ? MultiplayerCorrelationId : L"", (MultiplayerCorrelationId != NULL) ? (ULONG)((wcslen(MultiplayerCorrelationId) + 1) * sizeof(WCHAR)) : (ULONG)sizeof(L"")); + EventDataDescCreate(&EventData[3], (MultiplayerCorrelationId != NULL) ? MultiplayerCorrelationId : L"", (MultiplayerCorrelationId != NULL) ? (uint32_t)((wcslen(MultiplayerCorrelationId) + 1) * sizeof(wchar_t)) : (uint32_t)sizeof(L"")); EventDataDescCreate(&EventData[4], &GameplayModeId, sizeof(GameplayModeId)); EventDataDescCreate(&EventData[5], &DifficultyLevelId, sizeof(DifficultyLevelId)); EventDataDescCreate(&EventData[6], &ExitStatusId, sizeof(ExitStatusId)); @@ -922,7 +922,7 @@ EventWritePlayerSessionEnd(__in_opt PCWSTR UserId, __in LPCGUID PlayerSessionId, // Entry point to log the event PlayerSessionPause // __inline -ULONG +uint32_t EventWritePlayerSessionPause(__in_opt PCWSTR UserId, __in LPCGUID PlayerSessionId, __in_opt PCWSTR MultiplayerCorrelationId) { #define ARGUMENT_COUNT_XBLA_149E11AE_PlayerSessionPause 4 @@ -932,9 +932,9 @@ EventWritePlayerSessionPause(__in_opt PCWSTR UserId, __in LPCGUID PlayerSessionI EtxFillCommonFields_v7(&EventData[0], scratch, 64); - EventDataDescCreate(&EventData[1], (UserId != NULL) ? UserId : L"", (UserId != NULL) ? (ULONG)((wcslen(UserId) + 1) * sizeof(WCHAR)) : (ULONG)sizeof(L"")); + EventDataDescCreate(&EventData[1], (UserId != NULL) ? UserId : L"", (UserId != NULL) ? (uint32_t)((wcslen(UserId) + 1) * sizeof(wchar_t)) : (uint32_t)sizeof(L"")); EventDataDescCreate(&EventData[2], PlayerSessionId, sizeof(GUID)); - EventDataDescCreate(&EventData[3], (MultiplayerCorrelationId != NULL) ? MultiplayerCorrelationId : L"", (MultiplayerCorrelationId != NULL) ? (ULONG)((wcslen(MultiplayerCorrelationId) + 1) * sizeof(WCHAR)) : (ULONG)sizeof(L"")); + EventDataDescCreate(&EventData[3], (MultiplayerCorrelationId != NULL) ? MultiplayerCorrelationId : L"", (MultiplayerCorrelationId != NULL) ? (uint32_t)((wcslen(MultiplayerCorrelationId) + 1) * sizeof(wchar_t)) : (uint32_t)sizeof(L"")); return EtxEventWrite(&XBLA_149E11AEEvents[28], &XBLA_149E11AEProvider, XBLA_149E11AEHandle, ARGUMENT_COUNT_XBLA_149E11AE_PlayerSessionPause, EventData); } @@ -943,7 +943,7 @@ EventWritePlayerSessionPause(__in_opt PCWSTR UserId, __in LPCGUID PlayerSessionI // Entry point to log the event PlayerSessionResume // __inline -ULONG +uint32_t EventWritePlayerSessionResume(__in_opt PCWSTR UserId, __in LPCGUID PlayerSessionId, __in_opt PCWSTR MultiplayerCorrelationId, __in const signed int GameplayModeId, __in const signed int DifficultyLevelId) { #define ARGUMENT_COUNT_XBLA_149E11AE_PlayerSessionResume 6 @@ -953,9 +953,9 @@ EventWritePlayerSessionResume(__in_opt PCWSTR UserId, __in LPCGUID PlayerSession EtxFillCommonFields_v7(&EventData[0], scratch, 64); - EventDataDescCreate(&EventData[1], (UserId != NULL) ? UserId : L"", (UserId != NULL) ? (ULONG)((wcslen(UserId) + 1) * sizeof(WCHAR)) : (ULONG)sizeof(L"")); + EventDataDescCreate(&EventData[1], (UserId != NULL) ? UserId : L"", (UserId != NULL) ? (uint32_t)((wcslen(UserId) + 1) * sizeof(wchar_t)) : (uint32_t)sizeof(L"")); EventDataDescCreate(&EventData[2], PlayerSessionId, sizeof(GUID)); - EventDataDescCreate(&EventData[3], (MultiplayerCorrelationId != NULL) ? MultiplayerCorrelationId : L"", (MultiplayerCorrelationId != NULL) ? (ULONG)((wcslen(MultiplayerCorrelationId) + 1) * sizeof(WCHAR)) : (ULONG)sizeof(L"")); + EventDataDescCreate(&EventData[3], (MultiplayerCorrelationId != NULL) ? MultiplayerCorrelationId : L"", (MultiplayerCorrelationId != NULL) ? (uint32_t)((wcslen(MultiplayerCorrelationId) + 1) * sizeof(wchar_t)) : (uint32_t)sizeof(L"")); EventDataDescCreate(&EventData[4], &GameplayModeId, sizeof(GameplayModeId)); EventDataDescCreate(&EventData[5], &DifficultyLevelId, sizeof(DifficultyLevelId)); @@ -966,7 +966,7 @@ EventWritePlayerSessionResume(__in_opt PCWSTR UserId, __in LPCGUID PlayerSession // Entry point to log the event PlayerSessionStart // __inline -ULONG +uint32_t EventWritePlayerSessionStart(__in_opt PCWSTR UserId, __in LPCGUID PlayerSessionId, __in_opt PCWSTR MultiplayerCorrelationId, __in const signed int GameplayModeId, __in const signed int DifficultyLevelId) { #define ARGUMENT_COUNT_XBLA_149E11AE_PlayerSessionStart 6 @@ -976,9 +976,9 @@ EventWritePlayerSessionStart(__in_opt PCWSTR UserId, __in LPCGUID PlayerSessionI EtxFillCommonFields_v7(&EventData[0], scratch, 64); - EventDataDescCreate(&EventData[1], (UserId != NULL) ? UserId : L"", (UserId != NULL) ? (ULONG)((wcslen(UserId) + 1) * sizeof(WCHAR)) : (ULONG)sizeof(L"")); + EventDataDescCreate(&EventData[1], (UserId != NULL) ? UserId : L"", (UserId != NULL) ? (uint32_t)((wcslen(UserId) + 1) * sizeof(wchar_t)) : (uint32_t)sizeof(L"")); EventDataDescCreate(&EventData[2], PlayerSessionId, sizeof(GUID)); - EventDataDescCreate(&EventData[3], (MultiplayerCorrelationId != NULL) ? MultiplayerCorrelationId : L"", (MultiplayerCorrelationId != NULL) ? (ULONG)((wcslen(MultiplayerCorrelationId) + 1) * sizeof(WCHAR)) : (ULONG)sizeof(L"")); + EventDataDescCreate(&EventData[3], (MultiplayerCorrelationId != NULL) ? MultiplayerCorrelationId : L"", (MultiplayerCorrelationId != NULL) ? (uint32_t)((wcslen(MultiplayerCorrelationId) + 1) * sizeof(wchar_t)) : (uint32_t)sizeof(L"")); EventDataDescCreate(&EventData[4], &GameplayModeId, sizeof(GameplayModeId)); EventDataDescCreate(&EventData[5], &DifficultyLevelId, sizeof(DifficultyLevelId)); @@ -989,7 +989,7 @@ EventWritePlayerSessionStart(__in_opt PCWSTR UserId, __in LPCGUID PlayerSessionI // Entry point to log the event RecordMediaShareUpload // __inline -ULONG +uint32_t EventWriteRecordMediaShareUpload(__in_opt PCWSTR UserId, __in LPCGUID PlayerSessionId, __in const signed int SecondsSinceInitialize, __in const signed int Mode, __in const signed int SubMode, __in const signed int LevelId, __in const signed int SubLevelId, __in const signed int LeveInstanceId, __in LPCGUID PlayerSession, __in LPCGUID MultiplayerCorrelationId) { #define ARGUMENT_COUNT_XBLA_149E11AE_RecordMediaShareUpload 11 @@ -999,7 +999,7 @@ EventWriteRecordMediaShareUpload(__in_opt PCWSTR UserId, __in LPCGUID PlayerSess EtxFillCommonFields_v7(&EventData[0], scratch, 64); - EventDataDescCreate(&EventData[1], (UserId != NULL) ? UserId : L"", (UserId != NULL) ? (ULONG)((wcslen(UserId) + 1) * sizeof(WCHAR)) : (ULONG)sizeof(L"")); + EventDataDescCreate(&EventData[1], (UserId != NULL) ? UserId : L"", (UserId != NULL) ? (uint32_t)((wcslen(UserId) + 1) * sizeof(wchar_t)) : (uint32_t)sizeof(L"")); EventDataDescCreate(&EventData[2], PlayerSessionId, sizeof(GUID)); EventDataDescCreate(&EventData[3], &SecondsSinceInitialize, sizeof(SecondsSinceInitialize)); EventDataDescCreate(&EventData[4], &Mode, sizeof(Mode)); @@ -1017,7 +1017,7 @@ EventWriteRecordMediaShareUpload(__in_opt PCWSTR UserId, __in LPCGUID PlayerSess // Entry point to log the event RichPresenceState // __inline -ULONG +uint32_t EventWriteRichPresenceState(__in_opt PCWSTR UserId, __in LPCGUID PlayerSessionId, __in const signed int ContextID) { #define ARGUMENT_COUNT_XBLA_149E11AE_RichPresenceState 4 @@ -1027,7 +1027,7 @@ EventWriteRichPresenceState(__in_opt PCWSTR UserId, __in LPCGUID PlayerSessionId EtxFillCommonFields_v7(&EventData[0], scratch, 64); - EventDataDescCreate(&EventData[1], (UserId != NULL) ? UserId : L"", (UserId != NULL) ? (ULONG)((wcslen(UserId) + 1) * sizeof(WCHAR)) : (ULONG)sizeof(L"")); + EventDataDescCreate(&EventData[1], (UserId != NULL) ? UserId : L"", (UserId != NULL) ? (uint32_t)((wcslen(UserId) + 1) * sizeof(wchar_t)) : (uint32_t)sizeof(L"")); EventDataDescCreate(&EventData[2], PlayerSessionId, sizeof(GUID)); EventDataDescCreate(&EventData[3], &ContextID, sizeof(ContextID)); @@ -1038,7 +1038,7 @@ EventWriteRichPresenceState(__in_opt PCWSTR UserId, __in LPCGUID PlayerSessionId // Entry point to log the event SkinChanged // __inline -ULONG +uint32_t EventWriteSkinChanged(__in_opt PCWSTR UserId, __in LPCGUID PlayerSessionId, __in const signed int SecondsSinceInitialize, __in const signed int Mode, __in const signed int SubMode, __in const signed int LevelId, __in const signed int SubLevelId, __in const signed int LeveInstanceId, __in LPCGUID PlayerSession, __in LPCGUID MultiplayerCorrelationId, __in const signed int SkinId) { #define ARGUMENT_COUNT_XBLA_149E11AE_SkinChanged 12 @@ -1048,7 +1048,7 @@ EventWriteSkinChanged(__in_opt PCWSTR UserId, __in LPCGUID PlayerSessionId, __in EtxFillCommonFields_v7(&EventData[0], scratch, 64); - EventDataDescCreate(&EventData[1], (UserId != NULL) ? UserId : L"", (UserId != NULL) ? (ULONG)((wcslen(UserId) + 1) * sizeof(WCHAR)) : (ULONG)sizeof(L"")); + EventDataDescCreate(&EventData[1], (UserId != NULL) ? UserId : L"", (UserId != NULL) ? (uint32_t)((wcslen(UserId) + 1) * sizeof(wchar_t)) : (uint32_t)sizeof(L"")); EventDataDescCreate(&EventData[2], PlayerSessionId, sizeof(GUID)); EventDataDescCreate(&EventData[3], &SecondsSinceInitialize, sizeof(SecondsSinceInitialize)); EventDataDescCreate(&EventData[4], &Mode, sizeof(Mode)); @@ -1067,8 +1067,8 @@ EventWriteSkinChanged(__in_opt PCWSTR UserId, __in LPCGUID PlayerSessionId, __in // Entry point to log the event TexturePackLoaded // __inline -ULONG -EventWriteTexturePackLoaded(__in_opt PCWSTR UserId, __in LPCGUID PlayerSessionId, __in const signed int SecondsSinceInitialize, __in const signed int Mode, __in const signed int SubMode, __in const signed int LevelId, __in const signed int SubLevelId, __in const signed int LeveInstanceId, __in LPCGUID PlayerSession, __in LPCGUID MultiplayerCorrelationId, __in const signed int TexturePackId, __in const BOOL Purchased) +uint32_t +EventWriteTexturePackLoaded(__in_opt PCWSTR UserId, __in LPCGUID PlayerSessionId, __in const signed int SecondsSinceInitialize, __in const signed int Mode, __in const signed int SubMode, __in const signed int LevelId, __in const signed int SubLevelId, __in const signed int LeveInstanceId, __in LPCGUID PlayerSession, __in LPCGUID MultiplayerCorrelationId, __in const signed int TexturePackId, __in const bool Purchased) { #define ARGUMENT_COUNT_XBLA_149E11AE_TexturePackLoaded 13 @@ -1077,7 +1077,7 @@ EventWriteTexturePackLoaded(__in_opt PCWSTR UserId, __in LPCGUID PlayerSessionId EtxFillCommonFields_v7(&EventData[0], scratch, 64); - EventDataDescCreate(&EventData[1], (UserId != NULL) ? UserId : L"", (UserId != NULL) ? (ULONG)((wcslen(UserId) + 1) * sizeof(WCHAR)) : (ULONG)sizeof(L"")); + EventDataDescCreate(&EventData[1], (UserId != NULL) ? UserId : L"", (UserId != NULL) ? (uint32_t)((wcslen(UserId) + 1) * sizeof(wchar_t)) : (uint32_t)sizeof(L"")); EventDataDescCreate(&EventData[2], PlayerSessionId, sizeof(GUID)); EventDataDescCreate(&EventData[3], &SecondsSinceInitialize, sizeof(SecondsSinceInitialize)); EventDataDescCreate(&EventData[4], &Mode, sizeof(Mode)); @@ -1097,7 +1097,7 @@ EventWriteTexturePackLoaded(__in_opt PCWSTR UserId, __in LPCGUID PlayerSessionId // Entry point to log the event UnbanLevel // __inline -ULONG +uint32_t EventWriteUnbanLevel(__in_opt PCWSTR UserId, __in LPCGUID PlayerSessionId, __in const signed int SecondsSinceInitialize, __in const signed int Mode, __in const signed int SubMode, __in const signed int LevelId, __in const signed int SubLevelId, __in const signed int LeveInstanceId, __in LPCGUID PlayerSession, __in LPCGUID MultiplayerCorrelationId) { #define ARGUMENT_COUNT_XBLA_149E11AE_UnbanLevel 11 @@ -1107,7 +1107,7 @@ EventWriteUnbanLevel(__in_opt PCWSTR UserId, __in LPCGUID PlayerSessionId, __in EtxFillCommonFields_v7(&EventData[0], scratch, 64); - EventDataDescCreate(&EventData[1], (UserId != NULL) ? UserId : L"", (UserId != NULL) ? (ULONG)((wcslen(UserId) + 1) * sizeof(WCHAR)) : (ULONG)sizeof(L"")); + EventDataDescCreate(&EventData[1], (UserId != NULL) ? UserId : L"", (UserId != NULL) ? (uint32_t)((wcslen(UserId) + 1) * sizeof(wchar_t)) : (uint32_t)sizeof(L"")); EventDataDescCreate(&EventData[2], PlayerSessionId, sizeof(GUID)); EventDataDescCreate(&EventData[3], &SecondsSinceInitialize, sizeof(SecondsSinceInitialize)); EventDataDescCreate(&EventData[4], &Mode, sizeof(Mode)); @@ -1125,7 +1125,7 @@ EventWriteUnbanLevel(__in_opt PCWSTR UserId, __in LPCGUID PlayerSessionId, __in // Entry point to log the event UnpauseOrActive // __inline -ULONG +uint32_t EventWriteUnpauseOrActive(__in_opt PCWSTR UserId, __in LPCGUID PlayerSessionId, __in const signed int SecondsSinceInitialize, __in const signed int Mode, __in const signed int SubMode, __in const signed int LevelId, __in const signed int SubLevelId, __in const signed int LeveInstanceId, __in LPCGUID PlayerSession, __in LPCGUID MultiplayerCorrelationId) { #define ARGUMENT_COUNT_XBLA_149E11AE_UnpauseOrActive 11 @@ -1135,7 +1135,7 @@ EventWriteUnpauseOrActive(__in_opt PCWSTR UserId, __in LPCGUID PlayerSessionId, EtxFillCommonFields_v7(&EventData[0], scratch, 64); - EventDataDescCreate(&EventData[1], (UserId != NULL) ? UserId : L"", (UserId != NULL) ? (ULONG)((wcslen(UserId) + 1) * sizeof(WCHAR)) : (ULONG)sizeof(L"")); + EventDataDescCreate(&EventData[1], (UserId != NULL) ? UserId : L"", (UserId != NULL) ? (uint32_t)((wcslen(UserId) + 1) * sizeof(wchar_t)) : (uint32_t)sizeof(L"")); EventDataDescCreate(&EventData[2], PlayerSessionId, sizeof(GUID)); EventDataDescCreate(&EventData[3], &SecondsSinceInitialize, sizeof(SecondsSinceInitialize)); EventDataDescCreate(&EventData[4], &Mode, sizeof(Mode)); @@ -1153,7 +1153,7 @@ EventWriteUnpauseOrActive(__in_opt PCWSTR UserId, __in LPCGUID PlayerSessionId, // Entry point to log the event UpsellPresented // __inline -ULONG +uint32_t EventWriteUpsellPresented(__in_opt PCWSTR UserId, __in LPCGUID PlayerSessionId, __in const signed int SecondsSinceInitialize, __in const signed int Mode, __in const signed int SubMode, __in const signed int LevelId, __in const signed int SubLevelId, __in const signed int LeveInstanceId, __in LPCGUID PlayerSession, __in LPCGUID MultiplayerCorrelationId, __in const signed int UpsellId, __in const signed int MarketplaceOfferId) { #define ARGUMENT_COUNT_XBLA_149E11AE_UpsellPresented 13 @@ -1163,7 +1163,7 @@ EventWriteUpsellPresented(__in_opt PCWSTR UserId, __in LPCGUID PlayerSessionId, EtxFillCommonFields_v7(&EventData[0], scratch, 64); - EventDataDescCreate(&EventData[1], (UserId != NULL) ? UserId : L"", (UserId != NULL) ? (ULONG)((wcslen(UserId) + 1) * sizeof(WCHAR)) : (ULONG)sizeof(L"")); + EventDataDescCreate(&EventData[1], (UserId != NULL) ? UserId : L"", (UserId != NULL) ? (uint32_t)((wcslen(UserId) + 1) * sizeof(wchar_t)) : (uint32_t)sizeof(L"")); EventDataDescCreate(&EventData[2], PlayerSessionId, sizeof(GUID)); EventDataDescCreate(&EventData[3], &SecondsSinceInitialize, sizeof(SecondsSinceInitialize)); EventDataDescCreate(&EventData[4], &Mode, sizeof(Mode)); @@ -1183,7 +1183,7 @@ EventWriteUpsellPresented(__in_opt PCWSTR UserId, __in LPCGUID PlayerSessionId, // Entry point to log the event UpsellResponded // __inline -ULONG +uint32_t EventWriteUpsellResponded(__in_opt PCWSTR UserId, __in LPCGUID PlayerSessionId, __in const signed int SecondsSinceInitialize, __in const signed int Mode, __in const signed int SubMode, __in const signed int LevelId, __in const signed int SubLevelId, __in const signed int LeveInstanceId, __in LPCGUID PlayerSession, __in LPCGUID MultiplayerCorrelationId, __in const signed int UpsellId, __in const signed int MarketplaceOfferId, __in const signed int UpsellOutcome) { #define ARGUMENT_COUNT_XBLA_149E11AE_UpsellResponded 14 @@ -1193,7 +1193,7 @@ EventWriteUpsellResponded(__in_opt PCWSTR UserId, __in LPCGUID PlayerSessionId, EtxFillCommonFields_v7(&EventData[0], scratch, 64); - EventDataDescCreate(&EventData[1], (UserId != NULL) ? UserId : L"", (UserId != NULL) ? (ULONG)((wcslen(UserId) + 1) * sizeof(WCHAR)) : (ULONG)sizeof(L"")); + EventDataDescCreate(&EventData[1], (UserId != NULL) ? UserId : L"", (UserId != NULL) ? (uint32_t)((wcslen(UserId) + 1) * sizeof(wchar_t)) : (uint32_t)sizeof(L"")); EventDataDescCreate(&EventData[2], PlayerSessionId, sizeof(GUID)); EventDataDescCreate(&EventData[3], &SecondsSinceInitialize, sizeof(SecondsSinceInitialize)); EventDataDescCreate(&EventData[4], &Mode, sizeof(Mode)); diff --git a/src/client/Durango/Social/SocialManager.h b/src/client/Durango/Social/SocialManager.h index 0b6f2b2d..37b9a8ef 100644 --- a/src/client/Durango/Social/SocialManager.h +++ b/src/client/Durango/Social/SocialManager.h @@ -33,18 +33,18 @@ private: static CSocialManager* m_pInstance; // Bitset of title posting capability flags ( XSOCIAL_CAPABILITY_POSTIMAGE, XSOCIAL_CAPABILITY_POSTLINK ). - DWORD m_dwSocialPostingCapability; + unsigned long m_dwSocialPostingCapability; // Index of user who made current active request. - DWORD m_dwCurrRequestUser; + unsigned long m_dwCurrRequestUser; // WESTY : Not sure if we even need to get social access key! /* // Size of the social network access key text buffer. - DWORD m_dwAccessKeyTextSize; + unsigned long m_dwAccessKeyTextSize; // Pointer to the social network access key text buffer. - LPWSTR m_pAccessKeyText; + wchar_t* m_pAccessKeyText; */ // The various states of the manager. @@ -63,7 +63,7 @@ private: // For xsocial asyncronous operations. XOVERLAPPED m_Overlapped; - DWORD m_dwOverlappedResultCode; + unsigned long m_dwOverlappedResultCode; // Social post preview image struct. XSOCIAL_PREVIEWIMAGE m_PostPreviewImage; @@ -78,14 +78,14 @@ private: // Image details for posting an image to social network. unsigned char* m_pMainImageBuffer; - DWORD m_dwMainImageBufferSize; + unsigned long m_dwMainImageBufferSize; void DestroyMainPostImage(); void DestroyPreviewPostImage(); // WESTY : Not sure if we even need to get social access key! /* - bool GetSocialNetworkAccessKey( ESocialNetwork eSocialNetwork, DWORD dwUserIndex, bool bUsingKinect, DWORD dwUserTrackingIndex, bool bShowNetworkSignin ); + bool GetSocialNetworkAccessKey( ESocialNetwork eSocialNetwork, unsigned long dwUserIndex, bool bUsingKinect, unsigned long dwUserTrackingIndex, bool bShowNetworkSignin ); */ public: @@ -114,23 +114,23 @@ public: bool AreAllUsersAllowedToPostImages(); // Post a test link to social network. - bool PostLinkToSocialNetwork( ESocialNetwork eSocialNetwork, DWORD dwUserIndex, bool bUsingKinect ); + bool PostLinkToSocialNetwork( ESocialNetwork eSocialNetwork, unsigned long dwUserIndex, bool bUsingKinect ); // Post a test image to social network. - bool PostImageToSocialNetwork( ESocialNetwork eSocialNetwork, DWORD dwUserIndex, bool bUsingKinect ); + bool PostImageToSocialNetwork( ESocialNetwork eSocialNetwork, unsigned long dwUserIndex, bool bUsingKinect ); - void SetSocialPostText(LPCWSTR Title, LPCWSTR Caption, LPCWSTR Desc); + void SetSocialPostText(const wchar_t* Title, const wchar_t* Caption, const wchar_t* Desc); // WESTY : Not sure if we even need to get social access key! /* // We do not currently know what this is used for. We may not even need it? - bool ObtainSocialNetworkAccessKey( ESocialNetwork eSocialNetwork, DWORD dwUserIndex, bool bUsingKinect ); + bool ObtainSocialNetworkAccessKey( ESocialNetwork eSocialNetwork, unsigned long dwUserIndex, bool bUsingKinect ); */ private: - WCHAR m_wchTitleA[MAX_SOCIALPOST_CAPTION+1]; - WCHAR m_wchCaptionA[MAX_SOCIALPOST_CAPTION+1]; - WCHAR m_wchDescA[MAX_SOCIALPOST_DESC+1]; + wchar_t m_wchTitleA[MAX_SOCIALPOST_CAPTION+1]; + wchar_t m_wchCaptionA[MAX_SOCIALPOST_CAPTION+1]; + wchar_t m_wchDescA[MAX_SOCIALPOST_DESC+1]; }; diff --git a/src/client/Durango/XML/ATGXmlParser.cpp b/src/client/Durango/XML/ATGXmlParser.cpp index 2c8c0e64..feeea3ff 100644 --- a/src/client/Durango/XML/ATGXmlParser.cpp +++ b/src/client/Durango/XML/ATGXmlParser.cpp @@ -43,9 +43,9 @@ XMLParser::~XMLParser() // Name: XMLParser::FillBuffer // Desc: Reads a block from the current open file //------------------------------------------------------------------------------------- -VOID XMLParser::FillBuffer() +void XMLParser::FillBuffer() { - DWORD NChars; + unsigned long NChars; m_pReadPtr = m_pReadBuf; @@ -69,8 +69,8 @@ VOID XMLParser::FillBuffer() } m_dwCharsConsumed += NChars; - __int64 iProgress = m_dwCharsTotal ? (( (__int64)m_dwCharsConsumed * 1000 ) / (__int64)m_dwCharsTotal) : 0; - m_pISAXCallback->SetParseProgress( (DWORD)iProgress ); + int64_t iProgress = m_dwCharsTotal ? (( (int64_t)m_dwCharsConsumed * 1000 ) / (int64_t)m_dwCharsTotal) : 0; + m_pISAXCallback->SetParseProgress( (unsigned long)iProgress ); m_pReadBuf[ NChars ] = '\0'; m_pReadBuf[ NChars + 1] = '\0'; @@ -81,7 +81,7 @@ VOID XMLParser::FillBuffer() // Name: XMLParser::SkipNextAdvance // Desc: Puts the last character read back on the input stream //------------------------------------------------------------------------------------- -VOID XMLParser::SkipNextAdvance() +void XMLParser::SkipNextAdvance() { m_bSkipNextAdvance = true; } @@ -91,9 +91,9 @@ VOID XMLParser::SkipNextAdvance() // Name: XMLParser::ConsumeSpace // Desc: Skips spaces in the current stream //------------------------------------------------------------------------------------- -HRESULT XMLParser::ConsumeSpace() +int XMLParser::ConsumeSpace() { - HRESULT hr; + int hr; // Skip spaces if( FAILED( hr = AdvanceCharacter() ) ) @@ -114,10 +114,10 @@ HRESULT XMLParser::ConsumeSpace() // Name: XMLParser::ConvertEscape // Desc: Copies and converts an escape sequence into m_pWriteBuf //------------------------------------------------------------------------------------- -HRESULT XMLParser::ConvertEscape() +int XMLParser::ConvertEscape() { - HRESULT hr; - WCHAR wVal = 0; + int hr; + wchar_t wVal = 0; if( FAILED( hr = AdvanceCharacter() ) ) return hr; @@ -191,14 +191,14 @@ HRESULT XMLParser::ConvertEscape() // must be an entity reference - WCHAR *pEntityRefVal = m_pWritePtr; - UINT EntityRefLen; + wchar_t *pEntityRefVal = m_pWritePtr; + unsigned int EntityRefLen; SkipNextAdvance(); if( FAILED( hr = AdvanceName() ) ) return hr; - EntityRefLen = (UINT)( m_pWritePtr - pEntityRefVal ); + EntityRefLen = (unsigned int)( m_pWritePtr - pEntityRefVal ); m_pWritePtr = pEntityRefVal; if ( EntityRefLen == 0 ) @@ -241,10 +241,10 @@ HRESULT XMLParser::ConvertEscape() // Name: XMLParser::AdvanceAttrVal // Desc: Copies an attribute value into m_pWrite buf, skipping surrounding quotes //------------------------------------------------------------------------------------- -HRESULT XMLParser::AdvanceAttrVal() +int XMLParser::AdvanceAttrVal() { - HRESULT hr; - WCHAR wQuoteChar; + int hr; + wchar_t wQuoteChar; if( FAILED( hr = AdvanceCharacter() ) ) return hr; @@ -295,9 +295,9 @@ HRESULT XMLParser::AdvanceAttrVal() // Desc: Copies a name into the m_pWriteBuf - returns true on success, false on failure // Ignores leading whitespace. Currently does not support unicode names //------------------------------------------------------------------------------------- -HRESULT XMLParser::AdvanceName() +int XMLParser::AdvanceName() { - HRESULT hr; + int hr; if( FAILED( hr = AdvanceCharacter() ) ) return hr; @@ -342,7 +342,7 @@ HRESULT XMLParser::AdvanceName() // and getting another chunk of the file if needed // Returns S_OK if there are more characters, E_ABORT for no characters to read //------------------------------------------------------------------------------------- -HRESULT XMLParser::AdvanceCharacter( BOOL bOkToFail ) +int XMLParser::AdvanceCharacter( bool bOkToFail ) { if( m_bSkipNextAdvance ) { @@ -376,12 +376,12 @@ HRESULT XMLParser::AdvanceCharacter( BOOL bOkToFail ) if( m_bUnicode == false ) { - m_Ch = *((CHAR *)m_pReadPtr); + m_Ch = *((char *)m_pReadPtr); m_pReadPtr++; } else // if( m_bUnicode == true ) { - m_Ch = *((WCHAR *)m_pReadPtr); + m_Ch = *((wchar_t *)m_pReadPtr); if( m_bReverseBytes ) { @@ -407,9 +407,9 @@ HRESULT XMLParser::AdvanceCharacter( BOOL bOkToFail ) // Name: XMLParser::AdvanceElement // Desc: Builds data, calls callback //------------------------------------------------------------------------------------- -HRESULT XMLParser::AdvanceElement() +int XMLParser::AdvanceElement() { - HRESULT hr; + int hr; // write ptr at the beginning of the buffer m_pWritePtr = m_pWriteBuf; @@ -492,13 +492,13 @@ HRESULT XMLParser::AdvanceElement() } else if( m_Ch == '/' ) { - WCHAR *pEntityRefVal = m_pWritePtr; + wchar_t *pEntityRefVal = m_pWritePtr; if( FAILED( hr = AdvanceName() ) ) return hr; if( FAILED( m_pISAXCallback->ElementEnd( pEntityRefVal, - (UINT) ( m_pWritePtr - pEntityRefVal ) ) ) ) + (unsigned int) ( m_pWritePtr - pEntityRefVal ) ) ) ) return E_ABORT; if( FAILED( hr = ConsumeSpace() ) ) @@ -528,10 +528,10 @@ HRESULT XMLParser::AdvanceElement() else { XMLAttribute Attributes[ XML_MAX_ATTRIBUTES_PER_ELEMENT ]; - UINT NumAttrs; + unsigned int NumAttrs; - WCHAR *pEntityRefVal = m_pWritePtr; - UINT EntityRefLen; + wchar_t *pEntityRefVal = m_pWritePtr; + unsigned int EntityRefLen; NumAttrs = 0; @@ -541,7 +541,7 @@ HRESULT XMLParser::AdvanceElement() if( FAILED( hr = AdvanceName() ) ) return hr; - EntityRefLen = (UINT)( m_pWritePtr - pEntityRefVal ); + EntityRefLen = (unsigned int)( m_pWritePtr - pEntityRefVal ); if( FAILED( hr = ConsumeSpace() ) ) return hr; @@ -566,7 +566,7 @@ HRESULT XMLParser::AdvanceElement() if( FAILED( hr = AdvanceName() ) ) return hr; - Attributes[ NumAttrs ].NameLen = (UINT)( m_pWritePtr - Attributes[ NumAttrs ].strName ); + Attributes[ NumAttrs ].NameLen = (unsigned int)( m_pWritePtr - Attributes[ NumAttrs ].strName ); if( FAILED( hr = ConsumeSpace() ) ) return hr; @@ -588,7 +588,7 @@ HRESULT XMLParser::AdvanceElement() if( FAILED( hr = AdvanceAttrVal() ) ) return hr; - Attributes[ NumAttrs ].ValueLen = (UINT)( m_pWritePtr - + Attributes[ NumAttrs ].ValueLen = (unsigned int)( m_pWritePtr - Attributes[ NumAttrs ].strValue ); ++NumAttrs; @@ -633,10 +633,10 @@ HRESULT XMLParser::AdvanceElement() // Name: XMLParser::AdvanceCDATA // Desc: Read a CDATA section //------------------------------------------------------------------------------------- -HRESULT XMLParser::AdvanceCDATA() +int XMLParser::AdvanceCDATA() { - HRESULT hr; - WORD wStage = 0; + int hr; + uint16_t wStage = 0; if( FAILED( m_pISAXCallback->CDATABegin() ) ) return E_ABORT; @@ -663,13 +663,13 @@ HRESULT XMLParser::AdvanceCDATA() if( m_pWritePtr - m_pWriteBuf >= XML_WRITE_BUFFER_SIZE ) { - if( FAILED( m_pISAXCallback->CDATAData( m_pWriteBuf, (UINT)( m_pWritePtr - m_pWriteBuf ), true ) ) ) + if( FAILED( m_pISAXCallback->CDATAData( m_pWriteBuf, (unsigned int)( m_pWritePtr - m_pWriteBuf ), true ) ) ) return E_ABORT; m_pWritePtr = m_pWriteBuf; } } - if( FAILED( m_pISAXCallback->CDATAData( m_pWriteBuf, (UINT)( m_pWritePtr - m_pWriteBuf ), false ) ) ) + if( FAILED( m_pISAXCallback->CDATAData( m_pWriteBuf, (unsigned int)( m_pWritePtr - m_pWriteBuf ), false ) ) ) return E_ABORT; m_pWritePtr = m_pWriteBuf; @@ -684,10 +684,10 @@ HRESULT XMLParser::AdvanceCDATA() // Name: XMLParser::AdvanceComment // Desk: Skips over a comment //------------------------------------------------------------------------------------- -HRESULT XMLParser::AdvanceComment() +int XMLParser::AdvanceComment() { - HRESULT hr; - WORD wStage; + int hr; + uint16_t wStage; wStage = 0; for( ;; ) @@ -713,7 +713,7 @@ HRESULT XMLParser::AdvanceComment() // Name: XMLParser::RegisterSAXCallbackInterface // Desc: Registers callback interface //------------------------------------------------------------------------------------- -VOID XMLParser::RegisterSAXCallbackInterface( ISAXCallback *pISAXCallback ) +void XMLParser::RegisterSAXCallbackInterface( ISAXCallback *pISAXCallback ) { m_pISAXCallback = pISAXCallback; } @@ -733,10 +733,10 @@ ISAXCallback* XMLParser::GetSAXCallbackInterface() // Name: XMLParser::MainParseLoop // Desc: Main Loop to Parse Data - source agnostic //------------------------------------------------------------------------------------- -HRESULT XMLParser::MainParseLoop() +int XMLParser::MainParseLoop() { - BOOL bWhiteSpaceOnly = true; - HRESULT hr = S_OK; + bool bWhiteSpaceOnly = true; + int hr = S_OK; if( FAILED( m_pISAXCallback->StartDocument() ) ) return E_ABORT; @@ -745,24 +745,24 @@ HRESULT XMLParser::MainParseLoop() FillBuffer(); - if ( *((WCHAR *) m_pReadBuf ) == 0xFEFF ) + if ( *((wchar_t *) m_pReadBuf ) == 0xFEFF ) { m_bUnicode = true; m_bReverseBytes = false; m_pReadPtr += 2; } - else if ( *((WCHAR *) m_pReadBuf ) == 0xFFFE ) + else if ( *((wchar_t *) m_pReadBuf ) == 0xFFFE ) { m_bUnicode = true; m_bReverseBytes = true; m_pReadPtr += 2; } - else if ( *((WCHAR *) m_pReadBuf ) == 0x003C ) + else if ( *((wchar_t *) m_pReadBuf ) == 0x003C ) { m_bUnicode = true; m_bReverseBytes = false; } - else if ( *((WCHAR *) m_pReadBuf ) == 0x3C00 ) + else if ( *((wchar_t *) m_pReadBuf ) == 0x3C00 ) { m_bUnicode = true; m_bReverseBytes = true; @@ -782,9 +782,9 @@ HRESULT XMLParser::MainParseLoop() { if( FAILED( AdvanceCharacter( true ) ) ) { - if ( ( (UINT) ( m_pWritePtr - m_pWriteBuf ) != 0 ) && ( !bWhiteSpaceOnly ) ) + if ( ( (unsigned int) ( m_pWritePtr - m_pWriteBuf ) != 0 ) && ( !bWhiteSpaceOnly ) ) { - if( FAILED( m_pISAXCallback->ElementContent( m_pWriteBuf, (UINT)( m_pWritePtr - m_pWriteBuf ), false ) ) ) + if( FAILED( m_pISAXCallback->ElementContent( m_pWriteBuf, (unsigned int)( m_pWritePtr - m_pWriteBuf ), false ) ) ) return E_ABORT; bWhiteSpaceOnly = true; @@ -798,9 +798,9 @@ HRESULT XMLParser::MainParseLoop() if( m_Ch == '<' ) { - if( ( (UINT) ( m_pWritePtr - m_pWriteBuf ) != 0 ) && ( !bWhiteSpaceOnly ) ) + if( ( (unsigned int) ( m_pWritePtr - m_pWriteBuf ) != 0 ) && ( !bWhiteSpaceOnly ) ) { - if( FAILED( m_pISAXCallback->ElementContent( m_pWriteBuf, (UINT)( m_pWritePtr - m_pWriteBuf ), false ) ) ) + if( FAILED( m_pISAXCallback->ElementContent( m_pWriteBuf, (unsigned int)( m_pWritePtr - m_pWriteBuf ), false ) ) ) return E_ABORT; bWhiteSpaceOnly = true; @@ -838,7 +838,7 @@ HRESULT XMLParser::MainParseLoop() if( !bWhiteSpaceOnly ) { if( FAILED( m_pISAXCallback->ElementContent( m_pWriteBuf, - ( UINT ) ( m_pWritePtr - m_pWriteBuf ), + ( unsigned int ) ( m_pWritePtr - m_pWriteBuf ), true ) ) ) { return E_ABORT; @@ -857,9 +857,9 @@ HRESULT XMLParser::MainParseLoop() // Name: XMLParser::ParseXMLFile // Desc: Builds element data //------------------------------------------------------------------------------------- -HRESULT XMLParser::ParseXMLFile( CONST CHAR *strFilename ) +int XMLParser::ParseXMLFile( const char *strFilename ) { - HRESULT hr; + int hr; if( m_pISAXCallback == NULL ) return E_NOINTERFACE; @@ -877,7 +877,7 @@ HRESULT XMLParser::ParseXMLFile( CONST CHAR *strFilename ) m_pInXMLBuffer = NULL; m_uInXMLBufferCharsLeft = 0; - WCHAR wchFilename[ 64 ]; + wchar_t wchFilename[ 64 ]; swprintf_s(wchFilename,64,L"%s",strFilename); @@ -893,7 +893,7 @@ HRESULT XMLParser::ParseXMLFile( CONST CHAR *strFilename ) { LARGE_INTEGER iFileSize; GetFileSizeEx( m_hFile, &iFileSize ); - m_dwCharsTotal = (DWORD)iFileSize.QuadPart; + m_dwCharsTotal = (unsigned long)iFileSize.QuadPart; m_dwCharsConsumed = 0; hr = MainParseLoop(); } @@ -913,9 +913,9 @@ HRESULT XMLParser::ParseXMLFile( CONST CHAR *strFilename ) // Name: XMLParser::ParseXMLFile // Desc: Builds element data //------------------------------------------------------------------------------------- -HRESULT XMLParser::ParseXMLBuffer( CONST CHAR *strBuffer, UINT uBufferSize ) +int XMLParser::ParseXMLBuffer( const char *strBuffer, unsigned int uBufferSize ) { - HRESULT hr; + int hr; if( m_pISAXCallback == NULL ) return E_NOINTERFACE; @@ -949,13 +949,13 @@ HRESULT XMLParser::ParseXMLBuffer( CONST CHAR *strBuffer, UINT uBufferSize ) // Logs an error through the callback interface //------------------------------------------------------------------------------------- #ifdef _Printf_format_string_ // VC++ 2008 and later support this annotation -VOID XMLParser::Error( HRESULT hErr, _In_z_ _Printf_format_string_ CONST CHAR* strFormat, ... ) +void XMLParser::Error( int hErr, _In_z_ _Printf_format_string_ const char* strFormat, ... ) #else -VOID XMLParser::Error( HRESULT hErr, CONST CHAR* strFormat, ... ) +void XMLParser::Error( int hErr, const char* strFormat, ... ) #endif { - CONST INT MAX_OUTPUT_STR = 160; - CHAR strBuffer[ MAX_OUTPUT_STR ]; + const int MAX_OUTPUT_STR = 160; + char strBuffer[ MAX_OUTPUT_STR ]; va_list pArglist; va_start( pArglist, strFormat ); diff --git a/src/client/Durango/XML/ATGXmlParser.h b/src/client/Durango/XML/ATGXmlParser.h index 2da6fe48..7c0babd4 100644 --- a/src/client/Durango/XML/ATGXmlParser.h +++ b/src/client/Durango/XML/ATGXmlParser.h @@ -28,10 +28,10 @@ namespace ATG #define E_INVALID_XML_SYNTAX MAKE_HRESULT(1, _ATGFAC, 0x0002 ) -CONST UINT XML_MAX_ATTRIBUTES_PER_ELEMENT = 32; -CONST UINT XML_MAX_NAME_LENGTH = 128; -CONST UINT XML_READ_BUFFER_SIZE = 2048; -CONST UINT XML_WRITE_BUFFER_SIZE = 2048; +const unsigned int XML_MAX_ATTRIBUTES_PER_ELEMENT = 32; +const unsigned int XML_MAX_NAME_LENGTH = 128; +const unsigned int XML_READ_BUFFER_SIZE = 2048; +const unsigned int XML_WRITE_BUFFER_SIZE = 2048; // No tag can be longer than XML_WRITE_BUFFER_SIZE - an error will be returned if // it is @@ -39,10 +39,10 @@ CONST UINT XML_WRITE_BUFFER_SIZE = 2048; //------------------------------------------------------------------------------------- struct XMLAttribute { - WCHAR* strName; - UINT NameLen; - WCHAR* strValue; - UINT ValueLen; + wchar_t* strName; + unsigned int NameLen; + wchar_t* strValue; + unsigned int ValueLen; }; //------------------------------------------------------------------------------------- @@ -53,30 +53,30 @@ public: ISAXCallback() {}; virtual ~ISAXCallback() {}; - virtual HRESULT StartDocument() = 0; - virtual HRESULT EndDocument() = 0; + virtual int StartDocument() = 0; + virtual int EndDocument() = 0; - virtual HRESULT ElementBegin( CONST WCHAR* strName, UINT NameLen, - CONST XMLAttribute *pAttributes, UINT NumAttributes ) = 0; - virtual HRESULT ElementContent( CONST WCHAR *strData, UINT DataLen, BOOL More ) = 0; - virtual HRESULT ElementEnd( CONST WCHAR *strName, UINT NameLen ) = 0; + virtual int ElementBegin( const wchar_t* strName, unsigned int NameLen, + const XMLAttribute *pAttributes, unsigned int NumAttributes ) = 0; + virtual int ElementContent( const wchar_t *strData, unsigned int DataLen, bool More ) = 0; + virtual int ElementEnd( const wchar_t *strName, unsigned int NameLen ) = 0; - virtual HRESULT CDATABegin( ) = 0; - virtual HRESULT CDATAData( CONST WCHAR *strCDATA, UINT CDATALen, BOOL bMore ) = 0; - virtual HRESULT CDATAEnd( ) = 0; + virtual int CDATABegin( ) = 0; + virtual int CDATAData( const wchar_t *strCDATA, unsigned int CDATALen, bool bMore ) = 0; + virtual int CDATAEnd( ) = 0; - virtual VOID Error( HRESULT hError, CONST CHAR *strMessage ) = 0; + virtual void Error( int hError, const char *strMessage ) = 0; - virtual VOID SetParseProgress( DWORD dwProgress ) { } + virtual void SetParseProgress( unsigned long dwProgress ) { } - const CHAR* GetFilename() { return m_strFilename; } - UINT GetLineNumber() { return m_LineNum; } - UINT GetLinePosition() { return m_LinePos; } + const char* GetFilename() { return m_strFilename; } + unsigned int GetLineNumber() { return m_LineNum; } + unsigned int GetLinePosition() { return m_LinePos; } private: - CONST CHAR *m_strFilename; - UINT m_LineNum; - UINT m_LinePos; + const char *m_strFilename; + unsigned int m_LineNum; + unsigned int m_LinePos; }; @@ -88,7 +88,7 @@ public: ~XMLParser(); // Register an interface inheiriting from ISAXCallback - VOID RegisterSAXCallbackInterface( ISAXCallback *pISAXCallback ); + void RegisterSAXCallbackInterface( ISAXCallback *pISAXCallback ); // Get the registered interface ISAXCallback* GetSAXCallbackInterface(); @@ -100,55 +100,55 @@ public: // E_ABORT - callback returned a fail code // S_OK - file parsed and completed - HRESULT ParseXMLFile( CONST CHAR *strFilename ); + int ParseXMLFile( const char *strFilename ); - // Parses from a buffer- if you pass a WCHAR buffer (and cast it), it will + // Parses from a buffer- if you pass a wchar_t buffer (and cast it), it will // correctly detect it and use unicode instead. Return codes are the // same as for ParseXMLFile - HRESULT ParseXMLBuffer( CONST CHAR* strBuffer, UINT uBufferSize ); + int ParseXMLBuffer( const char* strBuffer, unsigned int uBufferSize ); private: - HRESULT MainParseLoop(); + int MainParseLoop(); - HRESULT AdvanceCharacter( BOOL bOkToFail = false ); - VOID SkipNextAdvance(); + int AdvanceCharacter( bool bOkToFail = false ); + void SkipNextAdvance(); - HRESULT ConsumeSpace(); - HRESULT ConvertEscape(); - HRESULT AdvanceElement(); - HRESULT AdvanceName(); - HRESULT AdvanceAttrVal(); - HRESULT AdvanceCDATA(); - HRESULT AdvanceComment(); + int ConsumeSpace(); + int ConvertEscape(); + int AdvanceElement(); + int AdvanceName(); + int AdvanceAttrVal(); + int AdvanceCDATA(); + int AdvanceComment(); - VOID FillBuffer(); + void FillBuffer(); #ifdef _Printf_format_string_ // VC++ 2008 and later support this annotation - VOID Error( HRESULT hRet, _In_z_ _Printf_format_string_ CONST CHAR* strFormat, ... ); + void Error( int hRet, _In_z_ _Printf_format_string_ const char* strFormat, ... ); #else - VOID Error( HRESULT hRet, CONST CHAR* strFormat, ... ); + void Error( int hRet, const char* strFormat, ... ); #endif ISAXCallback* m_pISAXCallback; - HANDLE m_hFile; - CONST CHAR* m_pInXMLBuffer; - UINT m_uInXMLBufferCharsLeft; - DWORD m_dwCharsTotal; - DWORD m_dwCharsConsumed; + void* m_hFile; + const char* m_pInXMLBuffer; + unsigned int m_uInXMLBufferCharsLeft; + unsigned long m_dwCharsTotal; + unsigned long m_dwCharsConsumed; - BYTE m_pReadBuf[ XML_READ_BUFFER_SIZE + 2 ]; // room for a trailing NULL - WCHAR m_pWriteBuf[ XML_WRITE_BUFFER_SIZE ]; + uint8_t m_pReadBuf[ XML_READ_BUFFER_SIZE + 2 ]; // room for a trailing NULL + wchar_t m_pWriteBuf[ XML_WRITE_BUFFER_SIZE ]; - BYTE* m_pReadPtr; - WCHAR* m_pWritePtr; // write pointer within m_pBuf + uint8_t* m_pReadPtr; + wchar_t* m_pWritePtr; // write pointer within m_pBuf - BOOL m_bUnicode; // true = 16-bits, false = 8-bits - BOOL m_bReverseBytes; // true = reverse bytes, false = don't reverse + bool m_bUnicode; // true = 16-bits, false = 8-bits + bool m_bReverseBytes; // true = reverse bytes, false = don't reverse - BOOL m_bSkipNextAdvance; - WCHAR m_Ch; // Current character being parsed + bool m_bSkipNextAdvance; + wchar_t m_Ch; // Current character being parsed }; } // namespace ATG diff --git a/src/client/Durango/XML/xmlFilesCallback.h b/src/client/Durango/XML/xmlFilesCallback.h index deba843d..3a9a506c 100644 --- a/src/client/Durango/XML/xmlFilesCallback.h +++ b/src/client/Durango/XML/xmlFilesCallback.h @@ -9,16 +9,16 @@ using namespace ATG; class xmlMojangCallback : public ATG::ISAXCallback { public: - virtual HRESULT StartDocument() { return S_OK; }; - virtual HRESULT EndDocument() { return S_OK; }; + virtual int StartDocument() { return S_OK; }; + virtual int EndDocument() { return S_OK; }; - virtual HRESULT ElementBegin( CONST WCHAR* strName, UINT NameLen, CONST XMLAttribute *pAttributes, UINT NumAttributes ) + virtual int ElementBegin( const wchar_t* strName, unsigned int NameLen, const XMLAttribute *pAttributes, unsigned int NumAttributes ) { - WCHAR wTemp[35] = L""; - WCHAR wAttName[32] = L""; - WCHAR wNameXUID[32] = L""; - WCHAR wNameSkin[32] = L""; - WCHAR wNameCloak[32] = L""; + wchar_t wTemp[35] = L""; + wchar_t wAttName[32] = L""; + wchar_t wNameXUID[32] = L""; + wchar_t wNameSkin[32] = L""; + wchar_t wNameCloak[32] = L""; PlayerUID xuid=0LL; @@ -33,7 +33,7 @@ public: } else if ( _wcsicmp(wAttName,L"data") == 0) { - for(UINT i = 0; i < NumAttributes; i++) + for(unsigned int i = 0; i < NumAttributes; i++) { wcsncpy_s( wAttName, pAttributes[i].strName, pAttributes[i].NameLen); if (_wcsicmp(wAttName,L"name")==0) @@ -45,7 +45,7 @@ public: { if (pAttributes[i].ValueLen <= 32) { - ZeroMemory(wTemp,sizeof(WCHAR)*35); + ZeroMemory(wTemp,sizeof(wchar_t)*35); wcsncpy_s( wTemp, pAttributes[i].strValue, pAttributes[i].ValueLen); xuid=_wcstoui64(wTemp,NULL,10); } @@ -80,32 +80,32 @@ public: } }; - virtual HRESULT ElementContent( CONST WCHAR *strData, UINT DataLen, BOOL More ) { return S_OK; }; + virtual int ElementContent( const wchar_t *strData, unsigned int DataLen, bool More ) { return S_OK; }; - virtual HRESULT ElementEnd( CONST WCHAR *strName, UINT NameLen ){ return S_OK; }; + virtual int ElementEnd( const wchar_t *strName, unsigned int NameLen ){ return S_OK; }; - virtual HRESULT CDATABegin( ) { return S_OK; }; + virtual int CDATABegin( ) { return S_OK; }; - virtual HRESULT CDATAData( CONST WCHAR *strCDATA, UINT CDATALen, BOOL bMore ){ return S_OK; }; + virtual int CDATAData( const wchar_t *strCDATA, unsigned int CDATALen, bool bMore ){ return S_OK; }; - virtual HRESULT CDATAEnd( ){ return S_OK; }; + virtual int CDATAEnd( ){ return S_OK; }; - virtual VOID Error( HRESULT hError, CONST CHAR *strMessage ) { app.DebugPrintf("Error when Parsing xuids.XML\n"); }; + virtual void Error( int hError, const char *strMessage ) { app.DebugPrintf("Error when Parsing xuids.XML\n"); }; }; */ class xmlConfigCallback : public ATG::ISAXCallback { public: - virtual HRESULT StartDocument() { return S_OK; }; - virtual HRESULT EndDocument() { return S_OK; }; + virtual int StartDocument() { return S_OK; }; + virtual int EndDocument() { return S_OK; }; - virtual HRESULT ElementBegin( CONST WCHAR* strName, UINT NameLen, CONST XMLAttribute *pAttributes, UINT NumAttributes ) + virtual int ElementBegin( const wchar_t* strName, unsigned int NameLen, const XMLAttribute *pAttributes, unsigned int NumAttributes ) { - WCHAR wTemp[35] = L""; - WCHAR wType[32] = L""; - WCHAR wAttName[32] = L""; - WCHAR wValue[32] = L""; + wchar_t wTemp[35] = L""; + wchar_t wType[32] = L""; + wchar_t wAttName[32] = L""; + wchar_t wValue[32] = L""; int iValue=-1; if (NameLen >31) @@ -119,7 +119,7 @@ public: } else if ( _wcsicmp(wAttName,L"data") == 0) { - for(UINT i = 0; i < NumAttributes; i++) + for(unsigned int i = 0; i < NumAttributes; i++) { wcsncpy_s( wAttName, pAttributes[i].strName, pAttributes[i].NameLen); if (_wcsicmp(wAttName,L"Type")==0) @@ -165,37 +165,37 @@ public: } - virtual HRESULT ElementContent( CONST WCHAR *strData, UINT DataLen, BOOL More ) { return S_OK; }; + virtual int ElementContent( const wchar_t *strData, unsigned int DataLen, bool More ) { return S_OK; }; - virtual HRESULT ElementEnd( CONST WCHAR *strName, UINT NameLen ){ return S_OK; }; + virtual int ElementEnd( const wchar_t *strName, unsigned int NameLen ){ return S_OK; }; - virtual HRESULT CDATABegin( ) { return S_OK; }; + virtual int CDATABegin( ) { return S_OK; }; - virtual HRESULT CDATAData( CONST WCHAR *strCDATA, UINT CDATALen, BOOL bMore ){ return S_OK; }; + virtual int CDATAData( const wchar_t *strCDATA, unsigned int CDATALen, bool bMore ){ return S_OK; }; - virtual HRESULT CDATAEnd( ){ return S_OK; }; + virtual int CDATAEnd( ){ return S_OK; }; - virtual VOID Error( HRESULT hError, CONST CHAR *strMessage ) { app.DebugPrintf("Error when Parsing xuids.XML\n"); }; + virtual void Error( int hError, const char *strMessage ) { app.DebugPrintf("Error when Parsing xuids.XML\n"); }; }; class xmlDLCInfoCallback : public ATG::ISAXCallback { public: - virtual HRESULT StartDocument() { return S_OK; }; - virtual HRESULT EndDocument() { return S_OK; }; + virtual int StartDocument() { return S_OK; }; + virtual int EndDocument() { return S_OK; }; - virtual HRESULT ElementBegin( CONST WCHAR* strName, UINT NameLen, CONST XMLAttribute *pAttributes, UINT NumAttributes ) + virtual int ElementBegin( const wchar_t* strName, unsigned int NameLen, const XMLAttribute *pAttributes, unsigned int NumAttributes ) { - WCHAR wTemp[35] = L""; - WCHAR wAttName[32] = L""; - WCHAR wNameBanner[32] = L""; - WCHAR wDataFile[32] = L""; - WCHAR wType[32] = L""; - WCHAR wFirstSkin[32] = L""; - WCHAR wConfig[32] = L""; - WCHAR wUID[64] = L""; - WCHAR wName[64] = L""; + wchar_t wTemp[35] = L""; + wchar_t wAttName[32] = L""; + wchar_t wNameBanner[32] = L""; + wchar_t wDataFile[32] = L""; + wchar_t wType[32] = L""; + wchar_t wFirstSkin[32] = L""; + wchar_t wConfig[32] = L""; + wchar_t wUID[64] = L""; + wchar_t wName[64] = L""; unsigned int uiSortIndex=0L; int iGender=0; int iConfig=0; @@ -211,14 +211,14 @@ public: } else if ( _wcsicmp(wAttName,L"data") == 0) { - for(UINT i = 0; i < NumAttributes; i++) + for(unsigned int i = 0; i < NumAttributes; i++) { wcsncpy_s( wAttName, pAttributes[i].strName, pAttributes[i].NameLen); if (_wcsicmp(wAttName,L"SortIndex")==0) { if (pAttributes[i].ValueLen <= 32) { - ZeroMemory(wTemp,sizeof(WCHAR)*35); + ZeroMemory(wTemp,sizeof(wchar_t)*35); wcsncpy_s( wTemp, pAttributes[i].strValue, pAttributes[i].ValueLen); uiSortIndex=wcstoul(wTemp,NULL,10); } @@ -234,7 +234,7 @@ public: { if (pAttributes[i].ValueLen <= 64) { - ZeroMemory(wUID,sizeof(WCHAR)*64); + ZeroMemory(wUID,sizeof(wchar_t)*64); wcsncpy_s( wUID, pAttributes[i].strValue, pAttributes[i].ValueLen); } } @@ -242,7 +242,7 @@ public: { if (pAttributes[i].ValueLen <= 64) { - ZeroMemory(wName,sizeof(WCHAR)*64); + ZeroMemory(wName,sizeof(wchar_t)*64); wcsncpy_s( wName, pAttributes[i].strValue, pAttributes[i].ValueLen); } } @@ -319,17 +319,17 @@ public: } }; - virtual HRESULT ElementContent( CONST WCHAR *strData, UINT DataLen, BOOL More ) { return S_OK; }; + virtual int ElementContent( const wchar_t *strData, unsigned int DataLen, bool More ) { return S_OK; }; - virtual HRESULT ElementEnd( CONST WCHAR *strName, UINT NameLen ){ return S_OK; }; + virtual int ElementEnd( const wchar_t *strName, unsigned int NameLen ){ return S_OK; }; - virtual HRESULT CDATABegin( ) { return S_OK; }; + virtual int CDATABegin( ) { return S_OK; }; - virtual HRESULT CDATAData( CONST WCHAR *strCDATA, UINT CDATALen, BOOL bMore ){ return S_OK; }; + virtual int CDATAData( const wchar_t *strCDATA, unsigned int CDATALen, bool bMore ){ return S_OK; }; - virtual HRESULT CDATAEnd( ){ return S_OK; }; + virtual int CDATAEnd( ){ return S_OK; }; - virtual VOID Error( HRESULT hError, CONST CHAR *strMessage ) { app.DebugPrintf("Error when Parsing DLC.XML\n"); }; + virtual void Error( int hError, const char *strMessage ) { app.DebugPrintf("Error when Parsing DLC.XML\n"); }; }; diff --git a/src/client/Durango/Xbox_Utils.cpp b/src/client/Durango/Xbox_Utils.cpp index ab6186b6..dc4829c0 100644 --- a/src/client/Durango/Xbox_Utils.cpp +++ b/src/client/Durango/Xbox_Utils.cpp @@ -5,12 +5,12 @@ // Desc: Internal helper function //-------------------------------------------------------------------------------------- #ifndef _CONTENT_PACKAGE -static VOID DebugSpewV( const CHAR* strFormat, const va_list pArgList ) +static void DebugSpewV( const char* strFormat, const va_list pArgList ) { #ifdef __PS3__ assert(0); #else - CHAR str[2048]; + char str[2048]; // Use the secure CRT to avoid buffer overruns. Specify a count of // _TRUNCATE so that too long strings will be silently truncated // rather than triggering an error. @@ -25,9 +25,9 @@ static VOID DebugSpewV( const CHAR* strFormat, const va_list pArgList ) // Desc: Prints formatted debug spew //-------------------------------------------------------------------------------------- #ifdef _Printf_format_string_ // VC++ 2008 and later support this annotation -VOID CDECL DebugSpew( _In_z_ _Printf_format_string_ const CHAR* strFormat, ... ) +void CDECL DebugSpew( _In_z_ _Printf_format_string_ const char* strFormat, ... ) #else -VOID CDECL DebugPrintf( const CHAR* strFormat, ... ) +void CDECL DebugPrintf( const char* strFormat, ... ) #endif { #ifndef _CONTENT_PACKAGE diff --git a/src/client/Extrax64Stubs.cpp b/src/client/Extrax64Stubs.cpp index 334f0123..80a8bc82 100644 --- a/src/client/Extrax64Stubs.cpp +++ b/src/client/Extrax64Stubs.cpp @@ -46,25 +46,25 @@ CXuiStringTable StringTable; #ifndef _XBOX_ONE ATG::XMLParser::XMLParser() {} ATG::XMLParser::~XMLParser() {} -HRESULT ATG::XMLParser::ParseXMLBuffer( CONST CHAR* strBuffer, UINT uBufferSize ) { return S_OK; } -VOID ATG::XMLParser::RegisterSAXCallbackInterface( ISAXCallback *pISAXCallback ) {} +int ATG::XMLParser::ParseXMLBuffer( const char* strBuffer, unsigned int uBufferSize ) { return S_OK; } +void ATG::XMLParser::RegisterSAXCallbackInterface( ISAXCallback *pISAXCallback ) {} #endif bool CSocialManager::IsTitleAllowedToPostAnything() { return false; } bool CSocialManager::AreAllUsersAllowedToPostImages() { return false; } bool CSocialManager::IsTitleAllowedToPostImages() { return false; } -bool CSocialManager::PostLinkToSocialNetwork( ESocialNetwork eSocialNetwork, DWORD dwUserIndex, bool bUsingKinect ) { return false; } -bool CSocialManager::PostImageToSocialNetwork( ESocialNetwork eSocialNetwork, DWORD dwUserIndex, bool bUsingKinect ) { return false; } +bool CSocialManager::PostLinkToSocialNetwork( ESocialNetwork eSocialNetwork, unsigned long dwUserIndex, bool bUsingKinect ) { return false; } +bool CSocialManager::PostImageToSocialNetwork( ESocialNetwork eSocialNetwork, unsigned long dwUserIndex, bool bUsingKinect ) { return false; } CSocialManager *CSocialManager::Instance() { return NULL; } -void CSocialManager::SetSocialPostText(LPCWSTR Title, LPCWSTR Caption, LPCWSTR Desc) {}; +void CSocialManager::SetSocialPostText(const wchar_t* Title, const wchar_t* Caption, const wchar_t* Desc) {}; -DWORD XShowPartyUI(DWORD dwUserIndex) { return 0; } -DWORD XShowFriendsUI(DWORD dwUserIndex) { return 0; } -HRESULT XPartyGetUserList(XPARTY_USER_LIST *pUserList) { return S_OK; } -DWORD XContentGetThumbnail(DWORD dwUserIndex, const XCONTENT_DATA *pContentData, PBYTE pbThumbnail, PDWORD pcbThumbnail, PXOVERLAPPED *pOverlapped) { return 0; } +unsigned long XShowPartyUI(unsigned long dwUserIndex) { return 0; } +unsigned long XShowFriendsUI(unsigned long dwUserIndex) { return 0; } +int XPartyGetUserList(XPARTY_USER_LIST *pUserList) { return S_OK; } +unsigned long XContentGetThumbnail(unsigned long dwUserIndex, const XCONTENT_DATA *pContentData, uint8_t* pbThumbnail, PDWORD pcbThumbnail, PXOVERLAPPED *pOverlapped) { return 0; } void XShowAchievementsUI(int i) {} -DWORD XBackgroundDownloadSetMode(XBACKGROUND_DOWNLOAD_MODE Mode) { return 0; } +unsigned long XBackgroundDownloadSetMode(XBACKGROUND_DOWNLOAD_MODE Mode) { return 0; } #ifndef _DURANGO void PIXAddNamedCounter(int a, char *b, ...) {} @@ -178,36 +178,36 @@ bool IsEqualXUID(PlayerUID a, PlayerUID b) void XMemCpy(void *a, const void *b, size_t s) { memcpy(a, b, s); } void XMemSet(void *a, int t, size_t s) { memset(a, t, s); } void XMemSet128(void *a, int t, size_t s) { memset(a, t, s); } -void *XPhysicalAlloc(SIZE_T a, ULONG_PTR b, ULONG_PTR c, DWORD d) { return malloc(a); } +void *XPhysicalAlloc(size_t a, uintptr_t b, uintptr_t c, unsigned long d) { return malloc(a); } void XPhysicalFree(void *a) { free(a); } D3DXVECTOR3::D3DXVECTOR3() {} D3DXVECTOR3::D3DXVECTOR3(float x,float y,float z) : x(x), y(y), z(z) {} -D3DXVECTOR3& D3DXVECTOR3::operator += ( CONST D3DXVECTOR3& add ) { x += add.x; y += add.y; z += add.z; return *this; } +D3DXVECTOR3& D3DXVECTOR3::operator += ( const D3DXVECTOR3& add ) { x += add.x; y += add.y; z += add.z; return *this; } -BYTE IQNetPlayer::GetSmallId() { return 0; } -void IQNetPlayer::SendData(IQNetPlayer *player, const void *pvData, DWORD dwDataSize, DWORD dwFlags) +uint8_t IQNetPlayer::GetSmallId() { return 0; } +void IQNetPlayer::SendData(IQNetPlayer *player, const void *pvData, unsigned long dwDataSize, unsigned long dwFlags) { app.DebugPrintf("Sending from 0x%x to 0x%x %d bytes\n",this,player,dwDataSize); } bool IQNetPlayer::IsSameSystem(IQNetPlayer *player) { return true; } -DWORD IQNetPlayer::GetSendQueueSize( IQNetPlayer *player, DWORD dwFlags ) { return 0; } -DWORD IQNetPlayer::GetCurrentRtt() { return 0; } +unsigned long IQNetPlayer::GetSendQueueSize( IQNetPlayer *player, unsigned long dwFlags ) { return 0; } +unsigned long IQNetPlayer::GetCurrentRtt() { return 0; } bool IQNetPlayer::IsHost() { return this == &IQNet::m_player[0]; } bool IQNetPlayer::IsGuest() { return false; } bool IQNetPlayer::IsLocal() { return true; } PlayerUID IQNetPlayer::GetXuid() { return INVALID_XUID; } -LPCWSTR IQNetPlayer::GetGamertag() { static const wchar_t *test = L"stub"; return test; } +const wchar_t* IQNetPlayer::GetGamertag() { static const wchar_t *test = L"stub"; return test; } int IQNetPlayer::GetSessionIndex() { return 0; } bool IQNetPlayer::IsTalking() { return false; } -bool IQNetPlayer::IsMutedByLocalUser(DWORD dwUserIndex) { return false; } +bool IQNetPlayer::IsMutedByLocalUser(unsigned long dwUserIndex) { return false; } bool IQNetPlayer::HasVoice() { return false; } bool IQNetPlayer::HasCamera() { return false; } int IQNetPlayer::GetUserIndex() { return this - &IQNet::m_player[0]; } -void IQNetPlayer::SetCustomDataValue(ULONG_PTR ulpCustomDataValue) { +void IQNetPlayer::SetCustomDataValue(uintptr_t ulpCustomDataValue) { m_customData = ulpCustomDataValue; } -ULONG_PTR IQNetPlayer::GetCustomDataValue() { +uintptr_t IQNetPlayer::GetCustomDataValue() { return m_customData; } @@ -215,50 +215,50 @@ IQNetPlayer IQNet::m_player[4]; bool _bQNetStubGameRunning = false; -HRESULT IQNet::AddLocalPlayerByUserIndex(DWORD dwUserIndex){ return S_OK; } +int IQNet::AddLocalPlayerByUserIndex(unsigned long dwUserIndex){ return S_OK; } IQNetPlayer *IQNet::GetHostPlayer() { return &m_player[0]; } -IQNetPlayer *IQNet::GetLocalPlayerByUserIndex(DWORD dwUserIndex) { return &m_player[dwUserIndex]; } -IQNetPlayer *IQNet::GetPlayerByIndex(DWORD dwPlayerIndex) { return &m_player[0]; } -IQNetPlayer *IQNet::GetPlayerBySmallId(BYTE SmallId){ return &m_player[0]; } +IQNetPlayer *IQNet::GetLocalPlayerByUserIndex(unsigned long dwUserIndex) { return &m_player[dwUserIndex]; } +IQNetPlayer *IQNet::GetPlayerByIndex(unsigned long dwPlayerIndex) { return &m_player[0]; } +IQNetPlayer *IQNet::GetPlayerBySmallId(uint8_t SmallId){ return &m_player[0]; } IQNetPlayer *IQNet::GetPlayerByXuid(PlayerUID xuid){ return &m_player[0]; } -DWORD IQNet::GetPlayerCount() { return 1; } +unsigned long IQNet::GetPlayerCount() { return 1; } QNET_STATE IQNet::GetState() { return _bQNetStubGameRunning ? QNET_STATE_GAME_PLAY : QNET_STATE_IDLE; } bool IQNet::IsHost() { return true; } -HRESULT IQNet::JoinGameFromInviteInfo(DWORD dwUserIndex, DWORD dwUserMask, const INVITE_INFO *pInviteInfo) { return S_OK; } +int IQNet::JoinGameFromInviteInfo(unsigned long dwUserIndex, unsigned long dwUserMask, const INVITE_INFO *pInviteInfo) { return S_OK; } void IQNet::HostGame() { _bQNetStubGameRunning = true; } void IQNet::EndGame() { _bQNetStubGameRunning = false; } -DWORD MinecraftDynamicConfigurations::GetTrialTime() { return DYNAMIC_CONFIG_DEFAULT_TRIAL_TIME; } +unsigned long MinecraftDynamicConfigurations::GetTrialTime() { return DYNAMIC_CONFIG_DEFAULT_TRIAL_TIME; } -void XSetThreadProcessor(HANDLE a, int b) {} +void XSetThreadProcessor(void* a, int b) {} // #if !(defined __PS3__) && !(defined __ORBIS__) -// BOOL XCloseHandle(HANDLE a) { return CloseHandle(a); } +// bool XCloseHandle(void* a) { return CloseHandle(a); } // #endif // __PS3__ -DWORD XUserGetSigninInfo( - DWORD dwUserIndex, - DWORD dwFlags, +unsigned long XUserGetSigninInfo( + unsigned long dwUserIndex, + unsigned long dwFlags, PXUSER_SIGNIN_INFO pSigninInfo ) { return 0; } -LPCWSTR CXuiStringTable::Lookup(LPCWSTR szId) { return szId; } -LPCWSTR CXuiStringTable::Lookup(UINT nIndex) { return L"String"; } +const wchar_t* CXuiStringTable::Lookup(const wchar_t* szId) { return szId; } +const wchar_t* CXuiStringTable::Lookup(unsigned int nIndex) { return L"String"; } void CXuiStringTable::Clear() {} -HRESULT CXuiStringTable::Load(LPCWSTR szId) { return S_OK; } +int CXuiStringTable::Load(const wchar_t* szId) { return S_OK; } -DWORD XUserAreUsersFriends( DWORD dwUserIndex, PPlayerUID pXuids, DWORD dwXuidCount, PBOOL pfResult, void *pOverlapped) { return 0; } +unsigned long XUserAreUsersFriends( unsigned long dwUserIndex, PPlayerUID pXuids, unsigned long dwXuidCount, PBOOL pfResult, void *pOverlapped) { return 0; } #if defined __ORBIS__ || defined __PS3__ || defined _XBOX_ONE #else -HRESULT XMemDecompress( +int XMemDecompress( XMEMDECOMPRESSION_CONTEXT Context, - VOID *pDestination, - SIZE_T *pDestSize, - CONST VOID *pSource, - SIZE_T SrcSize + void *pDestination, + size_t *pDestSize, + const void *pSource, + size_t SrcSize ) { memcpy(pDestination, pSource, SrcSize); @@ -284,12 +284,12 @@ HRESULT XMemDecompress( } } -HRESULT XMemCompress( +int XMemCompress( XMEMCOMPRESSION_CONTEXT Context, - VOID *pDestination, - SIZE_T *pDestSize, - CONST VOID *pSource, - SIZE_T SrcSize + void *pDestination, + size_t *pDestSize, + const void *pSource, + size_t SrcSize ) { memcpy(pDestination, pSource, SrcSize); @@ -315,17 +315,17 @@ HRESULT XMemCompress( } } -HRESULT XMemCreateCompressionContext( +int XMemCreateCompressionContext( XMEMCODEC_TYPE CodecType, - CONST VOID *pCodecParams, - DWORD Flags, + const void *pCodecParams, + unsigned long Flags, XMEMCOMPRESSION_CONTEXT *pContext ) { /* COMPRESSOR_HANDLE Compressor = NULL; - HRESULT hr = CreateCompressor( + int hr = CreateCompressor( COMPRESS_ALGORITHM_XPRESS_HUFF, // Compression Algorithm NULL, // Optional allocation routine &Compressor); // Handle @@ -336,17 +336,17 @@ HRESULT XMemCreateCompressionContext( return 0; } -HRESULT XMemCreateDecompressionContext( +int XMemCreateDecompressionContext( XMEMCODEC_TYPE CodecType, - CONST VOID *pCodecParams, - DWORD Flags, + const void *pCodecParams, + unsigned long Flags, XMEMDECOMPRESSION_CONTEXT *pContext ) { /* DECOMPRESSOR_HANDLE Decompressor = NULL; - HRESULT hr = CreateDecompressor( + int hr = CreateDecompressor( COMPRESS_ALGORITHM_XPRESS_HUFF, // Compression Algorithm NULL, // Optional allocation routine &Decompressor); // Handle @@ -372,9 +372,9 @@ void XMemDestroyDecompressionContext(XMEMDECOMPRESSION_CONTEXT Context) //#ifndef __PS3__ #if !(defined _DURANGO || defined __PS3__ || defined __ORBIS__ || defined __PSVITA__) -DWORD XGetLanguage() { return 1; } -DWORD XGetLocale() { return 0; } -DWORD XEnableGuestSignin(BOOL fEnable) { return 0; } +unsigned long XGetLanguage() { return 1; } +unsigned long XGetLocale() { return 0; } +unsigned long XEnableGuestSignin(bool fEnable) { return 0; } #endif @@ -383,12 +383,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( unsigned long dwTitleID, + unsigned long dwOfferID, unsigned short usProfileVersion, - UINT uiProfileValuesC, - UINT uiProfileSettingsC, - DWORD *pdwProfileSettingsA, + unsigned int uiProfileValuesC, + unsigned int uiProfileSettingsC, + unsigned long *pdwProfileSettingsA, int iGameDefinedDataSizeX4, unsigned int *puiGameDefinedDataChangedBitmask) { @@ -455,14 +455,14 @@ 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)(LPVOID,const bool, const int iPad),LPVOID lpParam,int iQuadrant) { return 0; } -UINT C_4JProfile::DisplayOfflineProfile(int( *Func)(LPVOID,const bool, const int iPad),LPVOID lpParam,int iQuadrant) { return 0; } -UINT C_4JProfile::RequestConvertOfflineToGuestUI(int( *Func)(LPVOID,const bool, const int iPad),LPVOID 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; } -BOOL C_4JProfile::AreXUIDSEqual(PlayerUID xuid1,PlayerUID xuid2) { return false; } -BOOL C_4JProfile::XUIDIsGuest(PlayerUID xuid) { return false; } +bool C_4JProfile::AreXUIDSEqual(PlayerUID xuid1,PlayerUID xuid2) { return false; } +bool C_4JProfile::XUIDIsGuest(PlayerUID xuid) { return false; } bool C_4JProfile::AllowedToPlayMultiplayer(int iProf) { return true; } #if defined(__ORBIS__) @@ -476,9 +476,9 @@ bool C_4JProfile::GetChatAndContentRestrictions(int iPad, bool thisQuadrantOn #endif void C_4JProfile::StartTrialGame() {} -void C_4JProfile::AllowedPlayerCreatedContent(int iPad, bool thisQuadrantOnly, BOOL *allAllowed, BOOL *friendsAllowed) {} -BOOL C_4JProfile::CanViewPlayerCreatedContent(int iPad, bool thisQuadrantOnly, PPlayerUID pXuids, DWORD dwXuidCount ) { return true; } -bool C_4JProfile::GetProfileAvatar(int iPad,int( *Func)(LPVOID lpParam,PBYTE pbThumbnail,DWORD dwThumbnailBytes), LPVOID lpParam) { return false; } +void C_4JProfile::AllowedPlayerCreatedContent(int iPad, bool thisQuadrantOnly, bool *allAllowed, bool *friendsAllowed) {} +bool C_4JProfile::CanViewPlayerCreatedContent(int iPad, bool thisQuadrantOnly, PPlayerUID pXuids, unsigned long dwXuidCount ) { return true; } +bool C_4JProfile::GetProfileAvatar(int iPad,int( *Func)(void* lpParam,uint8_t* pbThumbnail,unsigned long dwThumbnailBytes), void* lpParam) { return false; } void C_4JProfile::CancelProfileAvatarRequest() {} int C_4JProfile::GetPrimaryPad() { return 0; } void C_4JProfile::SetPrimaryPad(int iPad) {} @@ -491,22 +491,22 @@ char* C_4JProfile::GetGamertag(int iPad){ return "PlayerName"; } wstring C_4JProfile::GetDisplayName(int iPad){ return L"PlayerName"; } #endif bool C_4JProfile::IsFullVersion() { return s_bProfileIsFullVersion; } -void C_4JProfile::SetSignInChangeCallback(void ( *Func)(LPVOID, bool, unsigned int),LPVOID lpParam) {} -void C_4JProfile::SetNotificationsCallback(void ( *Func)(LPVOID, DWORD, unsigned int),LPVOID lpParam) {} +void C_4JProfile::SetSignInChangeCallback(void ( *Func)(void*, bool, unsigned int),void* lpParam) {} +void C_4JProfile::SetNotificationsCallback(void ( *Func)(void*, unsigned long, unsigned int),void* lpParam) {} bool C_4JProfile::RegionIsNorthAmerica(void) { return false; } bool C_4JProfile::LocaleIsUSorCanada(void) { return false; } -HRESULT C_4JProfile::GetLiveConnectionStatus() { return S_OK; } +int C_4JProfile::GetLiveConnectionStatus() { return S_OK; } bool C_4JProfile::IsSystemUIDisplayed() { return false; } -void C_4JProfile::SetProfileReadErrorCallback(void ( *Func)(LPVOID), LPVOID lpParam) {} -int( *defaultOptionsCallback)(LPVOID,C_4JProfile::PROFILESETTINGS *, const int iPad) = NULL; -LPVOID lpProfileParam = NULL; -int C_4JProfile::SetDefaultOptionsCallback(int( *Func)(LPVOID,PROFILESETTINGS *, const int iPad),LPVOID lpParam) +void C_4JProfile::SetProfileReadErrorCallback(void ( *Func)(void*), void* lpParam) {} +int( *defaultOptionsCallback)(void*,C_4JProfile::PROFILESETTINGS *, const int iPad) = NULL; +void* lpProfileParam = NULL; +int C_4JProfile::SetDefaultOptionsCallback(int( *Func)(void*,PROFILESETTINGS *, const int iPad),void* lpParam) { defaultOptionsCallback = Func; lpProfileParam = lpParam; return 0; } -int C_4JProfile::SetOldProfileVersionCallback(int( *Func)(LPVOID,unsigned char *, const unsigned short,const int),LPVOID lpParam) { return 0; } +int C_4JProfile::SetOldProfileVersionCallback(int( *Func)(void*,unsigned char *, const unsigned short,const int),void* lpParam) { return 0; } // To store the dashboard preferences for controller flipped, etc. C_4JProfile::PROFILESETTINGS ProfileSettingsA[XUSER_MAX_COUNT]; @@ -536,7 +536,7 @@ void C_4JProfile::RegisterRichPresenceContext(int iGameConfigContextID) {} void C_4JProfile::SetRichPresenceContextValue(int iPad,int iContextID, int iVal) {} void C_4JProfile::SetCurrentGameActivity(int iPad,int iNewPresence, bool bSetOthersToIdle) {} void C_4JProfile::DisplayFullVersionPurchase(bool bRequired, int iQuadrant, int iUpsellParam) {} -void C_4JProfile::SetUpsellCallback(void ( *Func)(LPVOID lpParam, eUpsellType type, eUpsellResponse response, int iUserData),LPVOID lpParam) {} +void C_4JProfile::SetUpsellCallback(void ( *Func)(void* lpParam, eUpsellType type, eUpsellResponse response, int iUserData),void* lpParam) {} void C_4JProfile::SetDebugFullOverride(bool bVal) {s_bProfileIsFullVersion = bVal;} void C_4JProfile::ShowProfileCard(int iPad, PlayerUID targetUid) {} @@ -545,109 +545,88 @@ void C_4JProfile::ShowProfileCard(int iPad, PlayerUID targetUid) {} #if 0 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 long dwPad, int( *Func)(void*,int,const C4JStorage::EMessageResult),void* lpParam, C4JStringTable *pStringTable, wchar_t *pwchFormatString,unsigned long dwFocusButton) { 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) {} +bool C4JStorage::SetSaveDevice(int( *Func)(void*,const bool),void* lpParam, bool bForceResetOfSaveDevice) { return true; } +void C4JStorage::Init(const wchar_t* pwchDefaultSaveName,char *pszSavePackName,int iMinimumSaveSize, int( *Func)(void*, const ESavingMessage, int),void* lpParam) {} void C4JStorage::ResetSaveData() {} -void C4JStorage::SetDefaultSaveNameForKeyboardDisplay(LPCWSTR pwchDefaultSaveName) {} -void C4JStorage::SetSaveTitle(LPCWSTR pwchDefaultSaveName) {} -LPCWSTR C4JStorage::GetSaveTitle() { return L""; } -bool C4JStorage::GetSaveUniqueNumber(INT *piVal) { return true; } +void C4JStorage::SetDefaultSaveNameForKeyboardDisplay(const wchar_t* pwchDefaultSaveName) {} +void C4JStorage::SetSaveTitle(const wchar_t* pwchDefaultSaveName) {} +const wchar_t* C4JStorage::GetSaveTitle() { return L""; } +bool C4JStorage::GetSaveUniqueNumber(int *piVal) { return true; } bool C4JStorage::GetSaveUniqueFilename(char *pszName) { return true; } void C4JStorage::SetSaveUniqueFilename(char *szFilename) { } -void C4JStorage::SetState(ESaveGameControlState eControlState,int( *Func)(LPVOID,const bool),LPVOID lpParam) {} +void C4JStorage::SetState(ESaveGameControlState eControlState,int( *Func)(void*,const bool),void* lpParam) {} void C4JStorage::SetSaveDisabled(bool bDisable) {} bool C4JStorage::GetSaveDisabled(void) { return false; } 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::AllocateSaveData(unsigned int ulBytes) { return new char[ulBytes]; } +void C4JStorage::SaveSaveData(unsigned int ulBytes,uint8_t* pbThumbnail,unsigned long cbThumbnail,uint8_t* pbTextData, unsigned long dwTextLen) {} +void C4JStorage::CopySaveDataToNewSave(uint8_t* pbThumbnail,unsigned long cbThumbnail,wchar_t *wchNewName,int ( *Func)(void* lpParam, bool), void* 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; } bool C4JStorage::EnoughSpaceForAMinSaveGame() { return true; } 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; } +//C4JStorage::ESGIStatus C4JStorage::GetSavesInfo(int iPad,bool ( *Func)(void*, int, CACHEINFOSTRUCT *, int, int),void* lpParam,char *pszSavePackName) { return C4JStorage::ESGIStatus_Idle; } +C4JStorage::ESaveGameState C4JStorage::GetSavesInfo(int iPad,int ( *Func)(void* lpParam,SAVE_DETAILS *pSaveDetails,const bool),void* lpParam,char *pszSavePackName) { return C4JStorage::ESaveGame_Idle; } -void C4JStorage::GetSaveCacheFileInfo(DWORD dwFile,XCONTENT_DATA &xContentData) {} -void C4JStorage::GetSaveCacheFileInfo(DWORD dwFile, PBYTE *ppbImageData, DWORD *pdwImageBytes) {} -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; } +void C4JStorage::GetSaveCacheFileInfo(unsigned long dwFile,XCONTENT_DATA &xContentData) {} +void C4JStorage::GetSaveCacheFileInfo(unsigned long dwFile, uint8_t* *ppbImageData, unsigned long *pdwImageBytes) {} +C4JStorage::ESaveGameState C4JStorage::LoadSaveData(PSAVE_INFO pSaveInfo,int( *Func)(void* lpParam,const bool, const bool), void* lpParam) {return C4JStorage::ESaveGame_Idle;} +C4JStorage::EDeleteGameStatus C4JStorage::DeleteSaveData(PSAVE_INFO pSaveInfo,int( *Func)(void* lpParam,const bool), void* 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::RegisterMarketplaceCountsCallback(int ( *Func)(void* lpParam, C4JStorage::DLC_TMS_DETAILS *, int), void* lpParam ) {} void C4JStorage::SetDLCPackageRoot(char *pszDLCRoot) {} -C4JStorage::EDLCStatus C4JStorage::GetDLCOffers(int iPad,int( *Func)(LPVOID, int, DWORD, int),LPVOID lpParam, DWORD dwOfferTypesBitmaskT) { return C4JStorage::EDLC_Idle; } -DWORD C4JStorage::CancelGetDLCOffers() { return 0; } +C4JStorage::EDLCStatus C4JStorage::GetDLCOffers(int iPad,int( *Func)(void*, int, unsigned long, int),void* lpParam, unsigned long dwOfferTypesBitmaskT) { return C4JStorage::EDLC_Idle; } +unsigned long 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 long 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; } -C4JStorage::EDLCStatus C4JStorage::GetInstalledDLC(int iPad,int( *Func)(LPVOID, int, int),LPVOID lpParam) { return C4JStorage::EDLC_Idle; } -DWORD C4JStorage::MountInstalledDLC(int iPad,DWORD dwDLC,int( *Func)(LPVOID, int, DWORD,DWORD),LPVOID 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; } -bool C4JStorage::DeleteTMSFile(int iQuadrant,eGlobalStorage eStorageFacility,WCHAR *pwchFilename) { return true; } -void C4JStorage::StoreTMSPathName(WCHAR *pwchName) {} +unsigned long C4JStorage::InstallOffer(int iOfferIDC,uint64_t *ullOfferIDA,int( *Func)(void*, int, int),void* lpParam, bool bTrial) { return 0; } +unsigned long C4JStorage::GetAvailableDLCCount( int iPad) { return 0; } +XCONTENT_DATA& C4JStorage::GetDLC(unsigned long dw) { static XCONTENT_DATA retval = {0}; return retval; } +C4JStorage::EDLCStatus C4JStorage::GetInstalledDLC(int iPad,int( *Func)(void*, int, int),void* lpParam) { return C4JStorage::EDLC_Idle; } +unsigned long C4JStorage::MountInstalledDLC(int iPad,unsigned long dwDLC,int( *Func)(void*, int, unsigned long,unsigned long),void* lpParam,const char* szMountDrive) { return 0; } +unsigned long C4JStorage::UnmountInstalledDLC(const char* szMountDrive) { return 0; } +C4JStorage::ETMSStatus C4JStorage::ReadTMSFile(int iQuadrant,eGlobalStorage eStorageFacility,C4JStorage::eTMS_FileType eFileType, wchar_t *pwchFilename,uint8_t **ppBuffer,unsigned long *pdwBufferSize,int( *Func)(void*, wchar_t *,int, bool, int),void* lpParam, int iAction) { return C4JStorage::ETMSStatus_Idle; } +bool C4JStorage::WriteTMSFile(int iQuadrant,eGlobalStorage eStorageFacility,wchar_t *pwchFilename,uint8_t *pBuffer,unsigned long dwBufferSize) { return true; } +bool C4JStorage::DeleteTMSFile(int iQuadrant,eGlobalStorage eStorageFacility,wchar_t *pwchFilename) { return true; } +void C4JStorage::StoreTMSPathName(wchar_t *pwchName) {} unsigned int C4JStorage::CRC(unsigned char *buf, int len) { return 0; } struct PTMSPP_FILEDATA; -C4JStorage::ETMSStatus C4JStorage::TMSPP_ReadFile(int iPad,C4JStorage::eGlobalStorage eStorageFacility,C4JStorage::eTMS_FILETYPEVAL eFileTypeVal,LPCSTR szFilename,int( *Func)(LPVOID,int,int,PTMSPP_FILEDATA, LPCSTR)/*=NULL*/,LPVOID lpParam/*=NULL*/, int iUserData/*=0*/) {return C4JStorage::ETMSStatus_Idle;} +C4JStorage::ETMSStatus C4JStorage::TMSPP_ReadFile(int iPad,C4JStorage::eGlobalStorage eStorageFacility,C4JStorage::eTMS_FILETYPEVAL eFileTypeVal,const char* szFilename,int( *Func)(void*,int,int,PTMSPP_FILEDATA, const char*)/*=NULL*/,void* lpParam/*=NULL*/, int iUserData/*=0*/) {return C4JStorage::ETMSStatus_Idle;} #endif // _WINDOWS64 #endif // __PS3__ /////////////////////////////////////////////////////// Sentient manager -HRESULT CSentientManager::Init() { return S_OK; } -HRESULT CSentientManager::Tick() { return S_OK; } -HRESULT CSentientManager::Flush() { return S_OK; } -BOOL CSentientManager::RecordPlayerSessionStart(DWORD dwUserId) { return true; } -BOOL CSentientManager::RecordPlayerSessionExit(DWORD dwUserId, int exitStatus) { return true; } -BOOL CSentientManager::RecordHeartBeat(DWORD dwUserId) { return true; } -BOOL CSentientManager::RecordLevelStart(DWORD dwUserId, ESen_FriendOrMatch friendsOrMatch, ESen_CompeteOrCoop competeOrCoop, int difficulty, DWORD numberOfLocalPlayers, DWORD numberOfOnlinePlayers) { return true; } -BOOL CSentientManager::RecordLevelExit(DWORD dwUserId, ESen_LevelExitStatus levelExitStatus) { return true; } -BOOL CSentientManager::RecordLevelSaveOrCheckpoint(DWORD dwUserId, INT saveOrCheckPointID, INT saveSizeInBytes) { return true; } -BOOL CSentientManager::RecordLevelResume(DWORD dwUserId, ESen_FriendOrMatch friendsOrMatch, ESen_CompeteOrCoop competeOrCoop, int difficulty, DWORD numberOfLocalPlayers, DWORD numberOfOnlinePlayers, INT saveOrCheckPointID) { return true; } -BOOL CSentientManager::RecordPauseOrInactive(DWORD dwUserId) { return true; } -BOOL CSentientManager::RecordUnpauseOrActive(DWORD dwUserId) { return true; } -BOOL CSentientManager::RecordMenuShown(DWORD dwUserId, INT menuID, INT optionalMenuSubID) { return true; } -BOOL CSentientManager::RecordAchievementUnlocked(DWORD dwUserId, INT achievementID, INT achievementGamerscore) { return true; } -BOOL CSentientManager::RecordMediaShareUpload(DWORD dwUserId, ESen_MediaDestination mediaDestination, ESen_MediaType mediaType) { return true; } -BOOL CSentientManager::RecordUpsellPresented(DWORD dwUserId, ESen_UpsellID upsellId, INT marketplaceOfferID) { return true; } -BOOL CSentientManager::RecordUpsellResponded(DWORD dwUserId, ESen_UpsellID upsellId, INT marketplaceOfferID, ESen_UpsellOutcome upsellOutcome) { return true; } -BOOL CSentientManager::RecordPlayerDiedOrFailed(DWORD dwUserId, INT lowResMapX, INT lowResMapY, INT lowResMapZ, INT mapID, INT playerWeaponID, INT enemyWeaponID, ETelemetryChallenges enemyTypeID) { return true; } -BOOL CSentientManager::RecordEnemyKilledOrOvercome(DWORD dwUserId, INT lowResMapX, INT lowResMapY, INT lowResMapZ, INT mapID, INT playerWeaponID, INT enemyWeaponID, ETelemetryChallenges enemyTypeID) { return true; } -BOOL CSentientManager::RecordSkinChanged(DWORD dwUserId, DWORD dwSkinId) { return true; } -BOOL CSentientManager::RecordBanLevel(DWORD dwUserId) { return true; } -BOOL CSentientManager::RecordUnBanLevel(DWORD dwUserId) { return true; } -INT CSentientManager::GetMultiplayerInstanceID() { return 0; } -INT CSentientManager::GenerateMultiplayerInstanceId() { return 0; } -void CSentientManager::SetMultiplayerInstanceId(INT value) {} - -//////////////////////////////////////////////////////// Stats counter - -/* -StatsCounter::StatsCounter() {} -void StatsCounter::award(Stat *stat, unsigned int difficulty, unsigned int count) {} -bool StatsCounter::hasTaken(Achievement *ach) { return true; } -bool StatsCounter::canTake(Achievement *ach) { return true; } -unsigned int StatsCounter::getValue(Stat *stat, unsigned int difficulty) { return 0; } -unsigned int StatsCounter::getTotalValue(Stat *stat) { return 0; } -void StatsCounter::tick(int player) {} -void StatsCounter::parse(void* data) {} -void StatsCounter::clear() {} -void StatsCounter::save(int player, bool force) {} -void StatsCounter::flushLeaderboards() {} -void StatsCounter::saveLeaderboards() {} -void StatsCounter::setupStatBoards() {} -#ifdef _DEBUG -void StatsCounter::WipeLeaderboards() {} -#endif -*/ +int CSentientManager::Init() { return S_OK; } +int CSentientManager::Tick() { return S_OK; } +int CSentientManager::Flush() { return S_OK; } +bool CSentientManager::RecordPlayerSessionStart(unsigned long dwUserId) { return true; } +bool CSentientManager::RecordPlayerSessionExit(unsigned long dwUserId, int exitStatus) { return true; } +bool CSentientManager::RecordHeartBeat(unsigned long dwUserId) { return true; } +bool CSentientManager::RecordLevelStart(unsigned long dwUserId, ESen_FriendOrMatch friendsOrMatch, ESen_CompeteOrCoop competeOrCoop, int difficulty, unsigned long numberOfLocalPlayers, unsigned long numberOfOnlinePlayers) { return true; } +bool CSentientManager::RecordLevelExit(unsigned long dwUserId, ESen_LevelExitStatus levelExitStatus) { return true; } +bool CSentientManager::RecordLevelSaveOrCheckpoint(unsigned long dwUserId, int saveOrCheckPointID, int saveSizeInBytes) { return true; } +bool CSentientManager::RecordLevelResume(unsigned long dwUserId, ESen_FriendOrMatch friendsOrMatch, ESen_CompeteOrCoop competeOrCoop, int difficulty, unsigned long numberOfLocalPlayers, unsigned long numberOfOnlinePlayers, int saveOrCheckPointID) { return true; } +bool CSentientManager::RecordPauseOrInactive(unsigned long dwUserId) { return true; } +bool CSentientManager::RecordUnpauseOrActive(unsigned long dwUserId) { return true; } +bool CSentientManager::RecordMenuShown(unsigned long dwUserId, int menuID, int optionalMenuSubID) { return true; } +bool CSentientManager::RecordAchievementUnlocked(unsigned long dwUserId, int achievementID, int achievementGamerscore) { return true; } +bool CSentientManager::RecordMediaShareUpload(unsigned long dwUserId, ESen_MediaDestination mediaDestination, ESen_MediaType mediaType) { return true; } +bool CSentientManager::RecordUpsellPresented(unsigned long dwUserId, ESen_UpsellID upsellId, int marketplaceOfferID) { return true; } +bool CSentientManager::RecordUpsellResponded(unsigned long dwUserId, ESen_UpsellID upsellId, int marketplaceOfferID, ESen_UpsellOutcome upsellOutcome) { return true; } +bool CSentientManager::RecordPlayerDiedOrFailed(unsigned long dwUserId, int lowResMapX, int lowResMapY, int lowResMapZ, int mapID, int playerWeaponID, int enemyWeaponID, ETelemetryChallenges enemyTypeID) { return true; } +bool CSentientManager::RecordEnemyKilledOrOvercome(unsigned long dwUserId, int lowResMapX, int lowResMapY, int lowResMapZ, int mapID, int playerWeaponID, int enemyWeaponID, ETelemetryChallenges enemyTypeID) { return true; } +bool CSentientManager::RecordSkinChanged(unsigned long dwUserId, unsigned long dwSkinId) { return true; } +bool CSentientManager::RecordBanLevel(unsigned long dwUserId) { return true; } +bool CSentientManager::RecordUnBanLevel(unsigned long dwUserId) { return true; } +int CSentientManager::GetMultiplayerInstanceID() { return 0; } +int CSentientManager::GenerateMultiplayerInstanceId() { return 0; } +void CSentientManager::SetMultiplayerInstanceId(int value) {} \ No newline at end of file diff --git a/src/client/FileTexturePack.cpp b/src/client/FileTexturePack.cpp index af58dc1e..fb02f3fb 100644 --- a/src/client/FileTexturePack.cpp +++ b/src/client/FileTexturePack.cpp @@ -1,7 +1,7 @@ #include "stdafx.h" #include "FileTexturePack.h" -FileTexturePack::FileTexturePack(DWORD id, File *file, TexturePack *fallback) : AbstractTexturePack(id, file, file->getName(), fallback) +FileTexturePack::FileTexturePack(unsigned long id, File *file, TexturePack *fallback) : AbstractTexturePack(id, file, file->getName(), fallback) { // 4J Stu - These calls need to be in the most derived version of the class loadIcon(); diff --git a/src/client/FileTexturePack.h b/src/client/FileTexturePack.h index 85221d11..10ba162e 100644 --- a/src/client/FileTexturePack.h +++ b/src/client/FileTexturePack.h @@ -12,7 +12,7 @@ private: //ZipFile *zipFile; public: - FileTexturePack(DWORD id, File *file, TexturePack *fallback); + FileTexturePack(unsigned long id, File *file, TexturePack *fallback); //@Override void unload(Textures *textures); diff --git a/src/client/FolderTexturePack.cpp b/src/client/FolderTexturePack.cpp index 45475688..f7449256 100644 --- a/src/client/FolderTexturePack.cpp +++ b/src/client/FolderTexturePack.cpp @@ -1,7 +1,7 @@ #include "stdafx.h" #include "FolderTexturePack.h" -FolderTexturePack::FolderTexturePack(DWORD id, const wstring &name, File *folder, TexturePack *fallback) : AbstractTexturePack(id, folder, name, fallback) +FolderTexturePack::FolderTexturePack(unsigned long id, const wstring &name, File *folder, TexturePack *fallback) : AbstractTexturePack(id, folder, name, fallback) { // 4J Stu - These calls need to be in the most derived version of the class loadIcon(); @@ -79,8 +79,8 @@ void FolderTexturePack::loadUI() // Load new skin if(hasFile(L"TexturePack.xzp")) { - const DWORD LOCATOR_SIZE = 256; // Use this to allocate space to hold a ResourceLocator string - WCHAR szResourceLocator[ LOCATOR_SIZE ]; + const unsigned long LOCATOR_SIZE = 256; // Use this to allocate space to hold a ResourceLocator string + wchar_t szResourceLocator[ LOCATOR_SIZE ]; swprintf(szResourceLocator, LOCATOR_SIZE,L"file://%lsTexturePack.xzp#skin_Minecraft.xur",getPath().c_str()); diff --git a/src/client/FolderTexturePack.h b/src/client/FolderTexturePack.h index fff4abf5..626f435f 100644 --- a/src/client/FolderTexturePack.h +++ b/src/client/FolderTexturePack.h @@ -8,7 +8,7 @@ private: bool bUILoaded; public: - FolderTexturePack(DWORD id, const wstring &name, File *folder, TexturePack *fallback); + FolderTexturePack(unsigned long id, const wstring &name, File *folder, TexturePack *fallback); protected: //@Override diff --git a/src/client/GameRenderer.cpp b/src/client/GameRenderer.cpp index d089d810..d559f13e 100644 --- a/src/client/GameRenderer.cpp +++ b/src/client/GameRenderer.cpp @@ -1135,7 +1135,7 @@ void GameRenderer::FinishedReassigning() LeaveCriticalSection(&m_csDeleteStack); } -int GameRenderer::runUpdate(LPVOID lpParam) +int GameRenderer::runUpdate(void* lpParam) { Minecraft *minecraft = Minecraft::GetInstance(); Vec3::CreateNewThreadStorage(); @@ -1252,7 +1252,7 @@ void GameRenderer::DisableUpdateThread() #endif } -void GameRenderer::renderLevel(float a, __int64 until) +void GameRenderer::renderLevel(float a, int64_t until) { // if (updateLightTexture) updateLightTexture(); // 4J - TODO - Java 1.0.1 has this line enabled, should check why - don't want to put it in now in case it breaks split-screen @@ -1335,7 +1335,7 @@ void GameRenderer::renderLevel(float a, __int64 until) if (until == 0) break; - __int64 diff = until - System::nanoTime(); + int64_t diff = until - System::nanoTime(); if (diff < 0) break; if (diff > 1000000000) break; } while (true); diff --git a/src/client/GameRenderer.h b/src/client/GameRenderer.h index dba2647f..a6568b49 100644 --- a/src/client/GameRenderer.h +++ b/src/client/GameRenderer.h @@ -94,8 +94,8 @@ public: void setupCamera(float a, int eye); private: void renderItemInHand(float a, int eye); - __int64 lastActiveTime; - __int64 lastNsTime; + int64_t lastActiveTime; + int64_t lastNsTime; // 4J - changes brought forward from 1.8.2 bool _updateLightTexture; public: @@ -112,7 +112,7 @@ private: public: void render(float a, bool bFirst); // 4J added bFirst void renderLevel(float a); - void renderLevel(float a, __int64 until); + void renderLevel(float a, int64_t until); private: Random *random; int rainSoundTime; @@ -145,7 +145,7 @@ public: #ifdef MULTITHREAD_ENABLE static C4JThread* m_updateThread; - static int runUpdate(LPVOID lpParam); + static int runUpdate(void* lpParam); static C4JThread::EventArray* m_updateEvents; enum EUpdateEvents { diff --git a/src/client/Gui.cpp b/src/client/Gui.cpp index 2904a15c..54a30543 100644 --- a/src/client/Gui.cpp +++ b/src/client/Gui.cpp @@ -784,7 +784,7 @@ void Gui::render(float a, bool mouseFree, int xMouse, int yMouse) glPushMatrix(); if (Minecraft::warezTime > 0) glTranslatef(0, 32, 0); font->drawShadow(ClientConstants::VERSION_STRING + L" (" + minecraft->fpsString + L")", iSafezoneXHalf+2, 20, 0xffffff); - font->drawShadow(L"Seed: " + _toString<__int64>(minecraft->level->getLevelData()->getSeed() ), iSafezoneXHalf+2, 32 + 00, 0xffffff); + font->drawShadow(L"Seed: " + _toString(minecraft->level->getLevelData()->getSeed() ), iSafezoneXHalf+2, 32 + 00, 0xffffff); font->drawShadow(minecraft->gatherStats1(), iSafezoneXHalf+2, 32 + 10, 0xffffff); font->drawShadow(minecraft->gatherStats2(), iSafezoneXHalf+2, 32 + 20, 0xffffff); font->drawShadow(minecraft->gatherStats3(), iSafezoneXHalf+2, 32 + 30, 0xffffff); @@ -1348,7 +1348,7 @@ void Gui::addMessage(const wstring& _string,int iPad,bool bIsDeathMessage) } // 4J Added -float Gui::getOpacity(int iPad, DWORD index) +float Gui::getOpacity(int iPad, unsigned long index) { float opacityPercentage = 0; if (guiMessages[iPad].size() > index && guiMessages[iPad][index].ticks < 20 * 10) @@ -1391,7 +1391,7 @@ void Gui::displayClientMessage(int messageId, int iPad) } // 4J Added -void Gui::renderGraph(int dataLength, int dataPos, __int64 *dataA, float dataAScale, int dataAWarning, __int64 *dataB, float dataBScale, int dataBWarning) +void Gui::renderGraph(int dataLength, int dataPos, int64_t *dataA, float dataAScale, int dataAWarning, int64_t *dataB, float dataBScale, int dataBWarning) { int height = minecraft->height; // This causes us to cover xScale*dataLength pixels in the horizontal @@ -1430,7 +1430,7 @@ void Gui::renderGraph(int dataLength, int dataPos, __int64 *dataA, float dataASc t->color(0xff000000 + cc * 256); } - __int64 aVal = dataA[i] / dataAScale; + int64_t aVal = dataA[i] / dataAScale; t->vertex((float)(xScale*i + 0.5f), (float)( height - aVal + 0.5f), (float)( 0)); t->vertex((float)(xScale*i + 0.5f), (float)( height + 0.5f), (float)( 0)); @@ -1447,7 +1447,7 @@ void Gui::renderGraph(int dataLength, int dataPos, __int64 *dataA, float dataASc t->color(0xff808080 + cc/2 * 256); } - __int64 bVal = dataB[i] / dataBScale; + int64_t bVal = dataB[i] / dataBScale; t->vertex((float)(xScale*i + (xScale - 1) + 0.5f), (float)( height - bVal + 0.5f), (float)( 0)); t->vertex((float)(xScale*i + (xScale - 1) + 0.5f), (float)( height + 0.5f), (float)( 0)); @@ -1458,7 +1458,7 @@ void Gui::renderGraph(int dataLength, int dataPos, __int64 *dataA, float dataASc glEnable(GL_TEXTURE_2D); } -void Gui::renderStackedGraph(int dataPos, int dataLength, int dataSources, __int64 (*func)(unsigned int dataPos, unsigned int dataSource) ) +void Gui::renderStackedGraph(int dataPos, int dataLength, int dataSources, int64_t (*func)(unsigned int dataPos, unsigned int dataSource) ) { int height = minecraft->height; @@ -1475,8 +1475,8 @@ void Gui::renderStackedGraph(int dataPos, int dataLength, int dataSources, __int Tesselator *t = Tesselator::getInstance(); t->begin(GL_LINES); - __int64 thisVal = 0; - __int64 topVal = 0; + int64_t thisVal = 0; + int64_t topVal = 0; for (int i = 0; i < dataLength; i++) { thisVal = 0; diff --git a/src/client/Gui.h b/src/client/Gui.h index 41762016..6402a146 100644 --- a/src/client/Gui.h +++ b/src/client/Gui.h @@ -55,14 +55,14 @@ public: void displayClientMessage(int messageId, int iPad); // 4J Added - DWORD getMessagesCount(int iPad) { return (int)guiMessages[iPad].size(); } - wstring getMessage(int iPad, DWORD index) { return guiMessages[iPad].at(index).string; } - float getOpacity(int iPad, DWORD index); + unsigned long getMessagesCount(int iPad) { return (int)guiMessages[iPad].size(); } + wstring getMessage(int iPad, unsigned long index) { return guiMessages[iPad].at(index).string; } + float getOpacity(int iPad, unsigned long index); wstring getJukeboxMessage(int iPad) { return overlayMessageString; } float getJukeboxOpacity(int iPad); // 4J Added - void renderGraph(int dataLength, int dataPos, __int64 *dataA, float dataAScale, int dataAWarning, __int64 *dataB, float dataBScale, int dataBWarning); - void renderStackedGraph(int dataPos, int dataLength, int dataSources, __int64 (*func)(unsigned int dataPos, unsigned int dataSource) ); + void renderGraph(int dataLength, int dataPos, int64_t *dataA, float dataAScale, int dataAWarning, int64_t *dataB, float dataBScale, int dataBWarning); + void renderStackedGraph(int dataPos, int dataLength, int dataSources, int64_t (*func)(unsigned int dataPos, unsigned int dataSource) ); }; diff --git a/src/client/LevelRenderer.cpp b/src/client/LevelRenderer.cpp index ea05a2a2..2a056ab0 100644 --- a/src/client/LevelRenderer.cpp +++ b/src/client/LevelRenderer.cpp @@ -2061,9 +2061,9 @@ bool LevelRenderer::updateDirtyChunks() if( bAtomic || (index == 0) ) { //PIXBeginNamedEvent(0,"Rebuilding near chunk %d %d %d",chunk->x, chunk->y, chunk->z); - // static __int64 totalTime = 0; - // static __int64 countTime = 0; - // __int64 startTime = System::currentTimeMillis(); + // static int64_t totalTime = 0; + // static int64_t countTime = 0; + // int64_t startTime = System::currentTimeMillis(); //app.DebugPrintf("Rebuilding permaChunk %d\n", index); @@ -2072,7 +2072,7 @@ bool LevelRenderer::updateDirtyChunks() if(index !=0) s_rebuildCompleteEvents->Set(index-1); // MGH - this rebuild happening on the main thread instead, mark the thread it should have been running on as complete - // __int64 endTime = System::currentTimeMillis(); + // int64_t endTime = System::currentTimeMillis(); // totalTime += (endTime - startTime); // countTime++; // printf("%d : %f\n", countTime, (float)totalTime / (float)countTime); @@ -2111,11 +2111,11 @@ bool LevelRenderer::updateDirtyChunks() static Chunk permaChunk; permaChunk.makeCopyForRebuild(chunk); LeaveCriticalSection(&m_csDirtyChunks); - // static __int64 totalTime = 0; - // static __int64 countTime = 0; - // __int64 startTime = System::currentTimeMillis(); + // static int64_t totalTime = 0; + // static int64_t countTime = 0; + // int64_t startTime = System::currentTimeMillis(); permaChunk.rebuild(); - // __int64 endTime = System::currentTimeMillis(); + // int64_t endTime = System::currentTimeMillis(); // totalTime += (endTime - startTime); // countTime++; // printf("%d : %f\n", countTime, (float)totalTime / (float)countTime); @@ -3609,7 +3609,7 @@ void LevelRenderer::staticCtor() } } -int LevelRenderer::rebuildChunkThreadProc(LPVOID lpParam) +int LevelRenderer::rebuildChunkThreadProc(void* lpParam) { Vec3::CreateNewThreadStorage(); AABB::CreateNewThreadStorage(); diff --git a/src/client/LevelRenderer.h b/src/client/LevelRenderer.h index 729553d6..bb1dacf0 100644 --- a/src/client/LevelRenderer.h +++ b/src/client/LevelRenderer.h @@ -258,7 +258,7 @@ public: XLockFreeStack dirtyChunksLockFreeStack; bool dirtyChunkPresent; - __int64 lastDirtyChunkFound; + int64_t lastDirtyChunkFound; static const int FORCE_DIRTY_CHUNK_CHECK_PERIOD_MS = 250; #ifdef _LARGE_WORLDS @@ -269,7 +269,7 @@ public: static C4JThread::EventArray *s_rebuildCompleteEvents; static C4JThread::Event *s_activationEventA[MAX_CHUNK_REBUILD_THREADS]; static void staticCtor(); - static int rebuildChunkThreadProc(LPVOID lpParam); + static int rebuildChunkThreadProc(void* lpParam); CRITICAL_SECTION m_csChunkFlags; #endif diff --git a/src/client/LocalPlayer.cpp b/src/client/LocalPlayer.cpp index c6fee887..0278d1f4 100644 --- a/src/client/LocalPlayer.cpp +++ b/src/client/LocalPlayer.cpp @@ -1139,12 +1139,12 @@ void LocalPlayer::onCrafted(shared_ptr item) } } -void LocalPlayer::setAndBroadcastCustomSkin(DWORD skinId) +void LocalPlayer::setAndBroadcastCustomSkin(unsigned long skinId) { setCustomSkin(skinId); } -void LocalPlayer::setAndBroadcastCustomCape(DWORD capeId) +void LocalPlayer::setAndBroadcastCustomCape(unsigned long capeId) { setCustomCape(capeId); } diff --git a/src/client/LocalPlayer.h b/src/client/LocalPlayer.h index 95d55c23..3445d908 100644 --- a/src/client/LocalPlayer.h +++ b/src/client/LocalPlayer.h @@ -50,12 +50,12 @@ public: int m_iScreenSection; // assuming 4player splitscreen for now, or -1 for single player - __uint64 ullButtonsPressed; // Stores the button presses, since the inputmanager can be ticked faster than the minecraft + uint64_t ullButtonsPressed; // Stores the button presses, since the inputmanager can be ticked faster than the minecraft // player tick, and a button press and release combo can be missed in the minecraft::tick - __uint64 ullDpad_last; - __uint64 ullDpad_this; - __uint64 ullDpad_filtered; + uint64_t ullDpad_last; + uint64_t ullDpad_this; + uint64_t ullDpad_filtered; // 4J-PB - moved these in from the minecraft structure, since they are per player things for splitscreen //int ticks; @@ -161,8 +161,8 @@ public: // 4J Stu - Added to allow callback to tutorial to stay within Minecraft.Client virtual void onCrafted(shared_ptr item); - virtual void setAndBroadcastCustomSkin(DWORD skinId); - virtual void setAndBroadcastCustomCape(DWORD capeId); + virtual void setAndBroadcastCustomSkin(unsigned long skinId); + virtual void setAndBroadcastCustomCape(unsigned long capeId); private: bool isSolidBlock(int x, int y, int z); diff --git a/src/client/MemTexture.cpp b/src/client/MemTexture.cpp index f587e82f..92797015 100644 --- a/src/client/MemTexture.cpp +++ b/src/client/MemTexture.cpp @@ -1,7 +1,7 @@ #include "stdafx.h" #include "MemTexture.h" -MemTexture::MemTexture(const wstring& _url, PBYTE pbData,DWORD dwBytes, MemTextureProcessor *processor) +MemTexture::MemTexture(const wstring& _url, uint8_t* pbData,unsigned long dwBytes, MemTextureProcessor *processor) { // 4J - added count = 1; diff --git a/src/client/MemTexture.h b/src/client/MemTexture.h index d11d68b1..f2e85121 100644 --- a/src/client/MemTexture.h +++ b/src/client/MemTexture.h @@ -12,6 +12,6 @@ public: int ticksSinceLastUse; static const int UNUSED_TICKS_TO_FREE = 20; - MemTexture(const wstring& _name, PBYTE pbData, DWORD dwBytes, MemTextureProcessor *processor); + MemTexture(const wstring& _name, uint8_t* pbData, unsigned long dwBytes, MemTextureProcessor *processor); ~MemTexture(); }; \ No newline at end of file diff --git a/src/client/MinecartRenderer.cpp b/src/client/MinecartRenderer.cpp index 8e1b6922..16a8bd0f 100644 --- a/src/client/MinecartRenderer.cpp +++ b/src/client/MinecartRenderer.cpp @@ -17,7 +17,7 @@ void MinecartRenderer::render(shared_ptr _cart, double x, double y, doub glPushMatrix(); - __int64 seed = cart->entityId * 493286711l; + int64_t seed = cart->entityId * 493286711l; seed = seed * seed * 4392167121l + seed * 98761; float xo = ((((seed >> 16) & 0x7) + 0.5f) / 8.0f - 0.5f) * 0.004f; diff --git a/src/client/Minecraft.cpp b/src/client/Minecraft.cpp index 020c7244..0414d47e 100644 --- a/src/client/Minecraft.cpp +++ b/src/client/Minecraft.cpp @@ -82,10 +82,10 @@ #define DISABLE_LEVELTICK_THREAD Minecraft *Minecraft::m_instance = NULL; -__int64 Minecraft::frameTimes[512]; -__int64 Minecraft::tickTimes[512]; +int64_t Minecraft::frameTimes[512]; +int64_t Minecraft::tickTimes[512]; int Minecraft::frameTimePos = 0; -__int64 Minecraft::warezTime = 0; +int64_t Minecraft::warezTime = 0; File Minecraft::workDir = File(L""); #ifdef __PSVITA__ @@ -680,7 +680,7 @@ void Minecraft::run() return; } - __int64 lastTime = System::currentTimeMillis(); + int64_t lastTime = System::currentTimeMillis(); int frames = 0; while (running) @@ -705,7 +705,7 @@ void Minecraft::run() timer->advanceTime(); } - __int64 beforeTickTime = System::nanoTime(); + int64_t beforeTickTime = System::nanoTime(); for (int i = 0; i < timer->ticks; i++) { ticks++; @@ -717,7 +717,7 @@ void Minecraft::run() // setScreen(new LevelConflictScreen()); // } } - __int64 tickDuraction = System::nanoTime() - beforeTickTime; + int64_t tickDuraction = System::nanoTime() - beforeTickTime; checkGlError(L"Pre render"); TileRenderer::fancy = options->fancyGraphics; @@ -1225,7 +1225,7 @@ void Minecraft::createPrimaryLocalPlayer(int iPad) void Minecraft::run_middle() { - static __int64 lastTime = 0; + static int64_t lastTime = 0; static bool bFirstTimeIntoGame = true; static bool bAutosaveTimerSet=false; static unsigned int uiAutosaveTimer=0; @@ -1415,7 +1415,7 @@ void Minecraft::run_middle() } else { - UINT uiIDA[1] = { IDS_OK }; + unsigned int uiIDA[1] = { IDS_OK }; ui.RequestMessageBox( IDS_CANTJOIN_TITLE, IDS_NO_PLAYSTATIONPLUS, uiIDA, 1, i, NULL, NULL, app.GetStringTable() ); } } @@ -1610,14 +1610,14 @@ void Minecraft::run_middle() // Check if PSN is unavailable because of age restriction if (npAvailability == SCE_NP_ERROR_AGE_RESTRICTION) { - UINT uiIDA[1]; + unsigned int uiIDA[1]; uiIDA[0] = IDS_OK; ui.RequestMessageBox(IDS_ONLINE_SERVICE_TITLE, IDS_CONTENT_RESTRICTION, uiIDA, 1, i, NULL, NULL, app.GetStringTable()); } else if (ProfileManager.IsSignedIn(i) && !ProfileManager.IsSignedInLive(i)) { // You're not signed in to PSN! - UINT uiIDA[2]; + unsigned int uiIDA[2]; uiIDA[0] = IDS_PRO_NOTONLINE_ACCEPT; uiIDA[1] = IDS_CANCEL; ui.RequestMessageBox(IDS_PRO_NOTONLINE_TITLE, IDS_PRO_NOTONLINE_TEXT, uiIDA, 2, i,&Minecraft::MustSignInReturnedPSN, this, app.GetStringTable(), NULL, 0, false); @@ -1625,7 +1625,7 @@ void Minecraft::run_middle() else #endif { - UINT uiIDA[1]; + unsigned int uiIDA[1]; uiIDA[0]=IDS_CONFIRM_OK; ui.RequestMessageBox(IDS_NO_MULTIPLAYER_PRIVILEGE_TITLE, IDS_NO_MULTIPLAYER_PRIVILEGE_JOIN_TEXT, uiIDA, 1, i, NULL, NULL, app.GetStringTable()); } @@ -1704,7 +1704,7 @@ void Minecraft::run_middle() timer->advanceTime(); } - //__int64 beforeTickTime = System::nanoTime(); + //int64_t beforeTickTime = System::nanoTime(); for (int i = 0; i < timer->ticks; i++) { bool bLastTimerTick = ( i == ( timer->ticks - 1 ) ); @@ -1790,7 +1790,7 @@ void Minecraft::run_middle() // CompressedTileStorage::tick(); // 4J added // SparseDataStorage::tick(); // 4J added } - //__int64 tickDuraction = System::nanoTime() - beforeTickTime; + //int64_t tickDuraction = System::nanoTime() - beforeTickTime; MemSect(31); checkGlError(L"Pre render"); MemSect(0); @@ -1992,14 +1992,14 @@ void Minecraft::emergencySave() setLevel(NULL); } -void Minecraft::renderFpsMeter(__int64 tickTime) +void Minecraft::renderFpsMeter(int64_t tickTime) { int nsPer60Fps = 1000000000l / 60; if (lastTimer == -1) { lastTimer = System::nanoTime(); } - __int64 now = System::nanoTime(); + int64_t now = System::nanoTime(); Minecraft::tickTimes[(Minecraft::frameTimePos) & (Minecraft::frameTimes_length - 1)] = tickTime; Minecraft::frameTimes[(Minecraft::frameTimePos++) & (Minecraft::frameTimes_length - 1)] = now - lastTimer; lastTimer = now; @@ -2031,7 +2031,7 @@ void Minecraft::renderFpsMeter(__int64 tickTime) t->vertex((float)(Minecraft::frameTimes_length), (float)( height - hh1 * 2), (float)( 0)); t->end(); - __int64 totalTime = 0; + int64_t totalTime = 0; for (int i = 0; i < Minecraft::frameTimes_length; i++) { totalTime += Minecraft::frameTimes[i]; @@ -2061,8 +2061,8 @@ void Minecraft::renderFpsMeter(__int64 tickTime) t->color(0xff000000 + cc * 256); } - __int64 time = Minecraft::frameTimes[i] / 200000; - __int64 time2 = Minecraft::tickTimes[i] / 200000; + int64_t time = Minecraft::frameTimes[i] / 200000; + int64_t time2 = Minecraft::tickTimes[i] / 200000; t->vertex((float)(i + 0.5f), (float)( height - time + 0.5f), (float)( 0)); t->vertex((float)(i + 0.5f), (float)( height + 0.5f), (float)( 0)); @@ -3408,7 +3408,7 @@ void Minecraft::tick(bool bFirst, bool bUpdateTextures) player->drop(); } - __uint64 ullButtonsPressed=player->ullButtonsPressed; + uint64_t ullButtonsPressed=player->ullButtonsPressed; bool selected = false; #ifdef __PSVITA__ @@ -3455,7 +3455,7 @@ void Minecraft::tick(bool bFirst, bool bUpdateTextures) // #ifndef _CONTENT_PACKAGE // if(!(ui.GetMenuDisplayed(iPad))) // { - // WCHAR wchInput; + // wchar_t wchInput; // if(InputManager.InputDetected(iPad,&wchInput)) // { // printf("Input Detected!\n"); @@ -3463,7 +3463,7 @@ void Minecraft::tick(bool bFirst, bool bUpdateTextures) // // see if we can react to this // if(app.GetXuiAction(iPad)==eAppAction_Idle) // { - // app.SetAction(iPad,eAppAction_DebugText,(LPVOID)wchInput); + // app.SetAction(iPad,eAppAction_DebugText,(void*)wchInput); // } // } // } @@ -3870,7 +3870,7 @@ void Minecraft::setLevel(MultiPlayerLevel *level, int message /*=-1*/, shared_pt // The level renderer needs to have it's stored level set to NULL so that it doesn't break next time we set one if (levelRenderer != NULL) { - for(DWORD p = 0; p < XUSER_MAX_COUNT; ++p) + for(unsigned long p = 0; p < XUSER_MAX_COUNT; ++p) { levelRenderer->setLevel(p, NULL); } @@ -4201,7 +4201,7 @@ void Minecraft::respawnPlayer(int iPad, int dimension, int newEntityId) } // Set the animation override if the skin has one - DWORD dwSkinID=app.getSkinIdFromPath(player->customTextureUrl); + unsigned long dwSkinID=app.getSkinIdFromPath(player->customTextureUrl); if(GET_IS_DLC_SKIN_FROM_BITMASK(dwSkinID)) { player->setAnimOverrideBitmask(player->getSkinAnimOverrideBitmask(dwSkinID)); @@ -4399,7 +4399,7 @@ void Minecraft::main() // 4J-PB - Can't call this for the first 5 seconds of a game - MS rule //if (ProfileManager.IsFullVersion()) { - name = L"Player" + _toString<__int64>(System::currentTimeMillis() % 1000); + name = L"Player" + _toString(System::currentTimeMillis() % 1000); sessionId = L"-"; /* 4J - TODO - get a session ID from somewhere? if (args.length > 0) name = args[0]; @@ -4504,7 +4504,7 @@ void Minecraft::delayTextureReload() reloadTextures = true; } -__int64 Minecraft::currentTimeMillis() +int64_t Minecraft::currentTimeMillis() { return System::currentTimeMillis();//(Sys.getTime() * 1000) / Sys.getTimerResolution(); } @@ -4679,7 +4679,7 @@ void Minecraft::playerLeftTutorial(int iPad) // 4J Stu -This telemetry event means something different on XboxOne, so we don't call it for simple state changes like this #ifndef _XBOX_ONE - for(DWORD idx = 0; idx < XUSER_MAX_COUNT; ++idx) + for(unsigned long idx = 0; idx < XUSER_MAX_COUNT; ++idx) { if(localplayers[idx] != NULL) { @@ -4691,7 +4691,7 @@ void Minecraft::playerLeftTutorial(int iPad) } #ifdef _DURANGO -void Minecraft::inGameSignInCheckAllPrivilegesCallback(LPVOID lpParam, bool hasPrivileges, int iPad) +void Minecraft::inGameSignInCheckAllPrivilegesCallback(void* lpParam, bool hasPrivileges, int iPad) { Minecraft* pClass = (Minecraft*)lpParam; @@ -4703,7 +4703,7 @@ void Minecraft::inGameSignInCheckAllPrivilegesCallback(LPVOID lpParam, bool hasP { if( !g_NetworkManager.SessionHasSpace() ) { - UINT uiIDA[1]; + unsigned int uiIDA[1]; uiIDA[0]=IDS_OK; ui.RequestMessageBox(IDS_MULTIPLAYER_FULL_TITLE, IDS_MULTIPLAYER_FULL_TEXT, uiIDA, 1); ProfileManager.RemoveGamepadFromGame(iPad); @@ -4760,7 +4760,7 @@ int Minecraft::InGame_SignInReturned(void *pParam,bool bContinue, int iPad) #endif if( !g_NetworkManager.SessionHasSpace() ) { - UINT uiIDA[1]; + unsigned int uiIDA[1]; uiIDA[0]=IDS_OK; ui.RequestMessageBox(IDS_MULTIPLAYER_FULL_TITLE, IDS_MULTIPLAYER_FULL_TEXT, uiIDA, 1); #ifdef _DURANGO @@ -4804,7 +4804,7 @@ int Minecraft::InGame_SignInReturned(void *pParam,bool bContinue, int iPad) // 4J Stu - Don't allow converting to guests as we don't allow any guest sign-in while in the game // Fix for #66516 - TCR #124: MPS Guest Support ; #001: BAS Game Stability: TU8: The game crashes when second Guest signs-in on console which takes part in Xbox LIVE multiplayer session. //ProfileManager.RequestConvertOfflineToGuestUI( &Minecraft::InGame_SignInReturned, pMinecraftClass,iPad); - UINT uiIDA[1]; + unsigned int uiIDA[1]; uiIDA[0]=IDS_CONFIRM_OK; ui.RequestMessageBox( IDS_NO_MULTIPLAYER_PRIVILEGE_TITLE, IDS_NO_MULTIPLAYER_PRIVILEGE_JOIN_TEXT, uiIDA,1,iPad,NULL,NULL, app.GetStringTable()); #ifdef _DURANGO diff --git a/src/client/Minecraft.h b/src/client/Minecraft.h index 84d2500e..1f522798 100644 --- a/src/client/Minecraft.h +++ b/src/client/Minecraft.h @@ -85,7 +85,7 @@ private: bool reloadTextures; public: Level *oldLevel; // 4J Stu added to keep a handle on an old level so we can delete it - //HANDLE m_hPlayerRespawned; // 4J Added so we can wait in menus until it is done (for async in multiplayer) + //void* m_hPlayerRespawned; // 4J Added so we can wait in menus until it is done (for async in multiplayer) public: MultiPlayerLevel *level; @@ -165,11 +165,11 @@ private: LevelStorageSource *levelSource; public: static const int frameTimes_length = 512; - static __int64 frameTimes[frameTimes_length]; + static int64_t frameTimes[frameTimes_length]; static const int tickTimes_length = 512; - static __int64 tickTimes[tickTimes_length]; + static int64_t tickTimes[tickTimes_length]; static int frameTimePos; - static __int64 warezTime; + static int64_t warezTime; private: int rightClickDelay; public: @@ -227,9 +227,9 @@ private: // String grabHugeScreenshot(File workDir2, int width, int height, int ssWidth, int ssHeight); // 4J - removed // 4J - per player thing? - __int64 lastTimer; + int64_t lastTimer; - void renderFpsMeter(__int64 tickTime); + void renderFpsMeter(int64_t tickTime); public: void stop(); // 4J removed @@ -250,7 +250,7 @@ public: //bool isRaining ; // 4J - Moved to per player - //__int64 lastTickTime; + //int64_t lastTickTime; private: // 4J- per player? @@ -298,10 +298,10 @@ public: static int maxSupportedTextureSize(); void delayTextureReload(); - static __int64 currentTimeMillis(); + static int64_t currentTimeMillis(); #ifdef _DURANGO - static void inGameSignInCheckAllPrivilegesCallback(LPVOID lpParam, bool hasPrivileges, int iPad); + static void inGameSignInCheckAllPrivilegesCallback(void* lpParam, bool hasPrivileges, int iPad); #endif static int InGame_SignInReturned(void *pParam,bool bContinue, int iPad); // 4J-PB @@ -313,7 +313,7 @@ public: CRITICAL_SECTION m_setLevelCS; private: // A bit field that store whether a particular quadrant is in the full tutorial or not - BYTE m_inFullTutorialBits; + uint8_t m_inFullTutorialBits; public: bool isTutorial(); void playerStartedTutorial(int iPad); diff --git a/src/client/MinecraftServer.cpp b/src/client/MinecraftServer.cpp index b6005445..0ddd3518 100644 --- a/src/client/MinecraftServer.cpp +++ b/src/client/MinecraftServer.cpp @@ -54,9 +54,9 @@ //4J Added MinecraftServer *MinecraftServer::server = NULL; bool MinecraftServer::setTimeAtEndOfTick = false; -__int64 MinecraftServer::setTime = 0; +int64_t MinecraftServer::setTime = 0; bool MinecraftServer::setTimeOfDayAtEndOfTick = false; -__int64 MinecraftServer::setTimeOfDay = 0; +int64_t MinecraftServer::setTimeOfDay = 0; bool MinecraftServer::m_bPrimaryPlayerSignedOut=false; bool MinecraftServer::s_bServerHalted=false; bool MinecraftServer::s_bSaveOnExitAnswered=false; @@ -99,7 +99,7 @@ MinecraftServer::~MinecraftServer() { } -bool MinecraftServer::initServer(__int64 seed, NetworkGameInitData *initData, DWORD initSettings, bool findSeed) +bool MinecraftServer::initServer(int64_t seed, NetworkGameInitData *initData, unsigned long initSettings, bool findSeed) { // 4J - removed #if 0 @@ -201,7 +201,7 @@ bool MinecraftServer::initServer(__int64 seed, NetworkGameInitData *initData, DW // TODO: Stop loading, add error message. } - __int64 levelNanoTime = System::nanoTime(); + int64_t levelNanoTime = System::nanoTime(); wstring levelName = settings->getString(L"level-name", L"world"); wstring levelTypeString; @@ -245,10 +245,10 @@ bool MinecraftServer::initServer(__int64 seed, NetworkGameInitData *initData, DW #if 0 wstring levelSeedString = settings->getString(L"level-seed", L""); - __int64 levelSeed = (new Random())->nextLong(); + int64_t levelSeed = (new Random())->nextLong(); if (levelSeedString.length() > 0) { - long newSeed = _fromString<__int64>(levelSeedString); + long newSeed = _fromString(levelSeedString); if (newSeed != 0) { levelSeed = newSeed; } @@ -346,7 +346,7 @@ void MinecraftServer::addPostProcessRequest(ChunkSource *chunkSource, int x, int void MinecraftServer::postProcessTerminate(ProgressRenderer *mcprogress) { - DWORD status = 0; + unsigned long status = 0; EnterCriticalSection(&server->m_postProcessCS); size_t postProcessItemCount = server->m_postProcessRequests.size(); @@ -375,7 +375,7 @@ void MinecraftServer::postProcessTerminate(ProgressRenderer *mcprogress) DeleteCriticalSection(&m_postProcessCS); } -bool MinecraftServer::loadLevel(LevelStorageSource *storageSource, const wstring& name, __int64 levelSeed, LevelType *pLevelType, NetworkGameInitData *initData) +bool MinecraftServer::loadLevel(LevelStorageSource *storageSource, const wstring& name, int64_t levelSeed, LevelType *pLevelType, NetworkGameInitData *initData) { // 4J - TODO - do with new save stuff // if (storageSource->requiresConversion(name)) @@ -423,8 +423,8 @@ bool MinecraftServer::loadLevel(LevelStorageSource *storageSource, const wstring LevelGenerationOptions *levelGen = app.getLevelGenerationOptions(); if( levelGen != NULL && levelGen->requiresBaseSave()) { - DWORD fileSize = 0; - LPVOID pvSaveData = levelGen->getBaseSaveData(fileSize); + unsigned long fileSize = 0; + void* pvSaveData = levelGen->getBaseSaveData(fileSize); if(pvSaveData && fileSize != 0) bLevelGenBaseSave = true; } ConsoleSaveFileSplit *newFormatSave = NULL; @@ -518,7 +518,7 @@ bool MinecraftServer::loadLevel(LevelStorageSource *storageSource, const wstring m_postUpdateThread->SetPriority(THREAD_PRIORITY_ABOVE_NORMAL); m_postUpdateThread->Run(); - __int64 startTime = System::currentTimeMillis(); + int64_t startTime = System::currentTimeMillis(); // 4J Stu - Added this to temporarily make starting games on vita faster #ifdef __PSVITA__ @@ -532,13 +532,13 @@ bool MinecraftServer::loadLevel(LevelStorageSource *storageSource, const wstring ConsoleSaveFile *csf = getLevel(0)->getLevelStorage()->getSaveFile(); if( csf->doesFileExist(filepath) ) { - DWORD numberOfBytesRead; + unsigned long numberOfBytesRead; byteArray ba_gameRules; FileEntry *fe = csf->createFile(filepath); ba_gameRules.length = fe->getFileSize(); - ba_gameRules.data = new BYTE[ ba_gameRules.length ]; + ba_gameRules.data = new uint8_t[ ba_gameRules.length ]; csf->setFilePointer(fe,0,NULL,FILE_BEGIN); csf->readFile(fe, ba_gameRules.data, ba_gameRules.length, &numberOfBytesRead); @@ -548,7 +548,7 @@ bool MinecraftServer::loadLevel(LevelStorageSource *storageSource, const wstring csf->closeHandle(fe); } - __int64 lastTime = System::currentTimeMillis(); + int64_t lastTime = System::currentTimeMillis(); // 4J Stu - This loop is changed in 1.0.1 to only process the first level (ie the overworld), but I think we still want to do them all int i = 0; @@ -564,7 +564,7 @@ bool MinecraftServer::loadLevel(LevelStorageSource *storageSource, const wstring } #if 0 - __int64 lastStorageTickTime = System::currentTimeMillis(); + int64_t lastStorageTickTime = System::currentTimeMillis(); // Test code to enable full creation of levels at start up int halfsidelen = ( i == 0 ) ? 27 : 9; @@ -587,7 +587,7 @@ bool MinecraftServer::loadLevel(LevelStorageSource *storageSource, const wstring } } #else - __int64 lastStorageTickTime = System::currentTimeMillis(); + int64_t lastStorageTickTime = System::currentTimeMillis(); Pos *spawnPos = level->getSharedSpawnPos(); int twoRPlusOne = r*2 + 1; @@ -604,7 +604,7 @@ bool MinecraftServer::loadLevel(LevelStorageSource *storageSource, const wstring return false; } // printf(">>>%d %d %d\n",i,x,z); -// __int64 now = System::currentTimeMillis(); +// int64_t now = System::currentTimeMillis(); // if (now < lastTime) lastTime = now; // if (now > lastTime + 1000) { @@ -797,7 +797,7 @@ void MinecraftServer::saveGameRules() ConsoleSaveFile *csf = getLevel(0)->getLevelStorage()->getSaveFile(); FileEntry *fe = csf->createFile(ConsoleSavePath(GAME_RULE_SAVENAME)); csf->setFilePointer(fe, 0, NULL, FILE_BEGIN); - DWORD length; + unsigned long length; csf->writeFile(fe, ba.data, ba.length, &length ); delete [] ba.data; @@ -1044,10 +1044,10 @@ CommandDispatcher *MinecraftServer::getCommandDispatcher() } extern int c0a, c0b, c1a, c1b, c1c, c2a, c2b; -void MinecraftServer::run(__int64 seed, void *lpParameter) +void MinecraftServer::run(int64_t seed, void *lpParameter) { NetworkGameInitData *initData = NULL; - DWORD initSettings = 0; + unsigned long initSettings = 0; bool findSeed = false; if(lpParameter != NULL) { @@ -1075,18 +1075,18 @@ void MinecraftServer::run(__int64 seed, void *lpParameter) } } - __int64 lastTime = System::currentTimeMillis(); - __int64 unprocessedTime = 0; + int64_t lastTime = System::currentTimeMillis(); + int64_t unprocessedTime = 0; while (running && !s_bServerHalted) { - __int64 now = System::currentTimeMillis(); + int64_t now = System::currentTimeMillis(); // 4J Stu - When we pause the server, we don't want to count that as time passed // 4J Stu - TU-1 hotifx - Remove this line. We want to make sure that we tick connections at the proper rate when paused //Fix for #13191 - The host of a game can get a message informing them that the connection to the server has been lost //if(m_isServerPaused) lastTime = now; - __int64 passedTime = now - lastTime; + int64_t passedTime = now - lastTime; if (passedTime > MS_PER_TICK * 40) { // logger.warning("Can't keep up! Did the system time change, or is the server overloaded?"); @@ -1112,13 +1112,13 @@ void MinecraftServer::run(__int64 seed, void *lpParameter) else { // int tickcount = 0; -// __int64 beforeall = System::currentTimeMillis(); +// int64_t beforeall = System::currentTimeMillis(); while (unprocessedTime > MS_PER_TICK) { unprocessedTime -= MS_PER_TICK; -// __int64 before = System::currentTimeMillis(); +// int64_t before = System::currentTimeMillis(); tick(); -// __int64 after = System::currentTimeMillis(); +// int64_t after = System::currentTimeMillis(); // PIXReportCounter(L"Server time",(float)(after-before)); // 4J Ensure that the slow queue owner keeps cycling if it's not been used in a while @@ -1135,7 +1135,7 @@ void MinecraftServer::run(__int64 seed, void *lpParameter) // app.DebugPrintf("Not considering cycling: %d - %d -> %d > %d\n",time, s_slowQueueLastTime, (time - s_slowQueueLastTime), (2*MINECRAFT_SERVER_SLOW_QUEUE_DELAY)); // } } -// __int64 afterall = System::currentTimeMillis(); +// int64_t afterall = System::currentTimeMillis(); // PIXReportCounter(L"Server time all",(float)(afterall-beforeall)); // PIXReportCounter(L"Server ticks",(float)tickcount); } @@ -1181,7 +1181,7 @@ void MinecraftServer::run(__int64 seed, void *lpParameter) // Process delayed actions eXuiServerAction eAction; - LPVOID param; + void* param; for(int i=0;ibroadcastAll( shared_ptr( new SetTimePacket(level->getTime() ) ), level->dimension->id); } // #ifndef __PS3__ - static __int64 stc = 0; - __int64 st0 = System::currentTimeMillis(); + static int64_t stc = 0; + int64_t st0 = System::currentTimeMillis(); PIXBeginNamedEvent(0,"Level tick %d",i); ((Level *)level)->tick(); - __int64 st1 = System::currentTimeMillis(); + int64_t st1 = System::currentTimeMillis(); PIXEndNamedEvent(); PIXBeginNamedEvent(0,"Update lights %d",i); // 4J - used to be in a while loop, but we don't want the server locking up for a big chunk of time (could end up trying to process 1,000,000 lights...) @@ -1491,7 +1491,7 @@ void MinecraftServer::tick() // printf("lights: %d\n",level->getLightsToUpdate()); while(level->updateLights() ) ; - __int64 st2 = System::currentTimeMillis(); + int64_t st2 = System::currentTimeMillis(); PIXEndNamedEvent(); PIXBeginNamedEvent(0,"Entity tick %d",i); // 4J added to stop ticking entities in levels when players are not in those levels. @@ -1519,7 +1519,7 @@ void MinecraftServer::tick() level->getTracker()->tick(); PIXEndNamedEvent(); - __int64 st3 = System::currentTimeMillis(); + int64_t st3 = System::currentTimeMillis(); // printf(">>>>>>>>>>>>>>>>>>>>>> Tick %d %d %d : %d\n", st1 - st0, st2 - st1, st3 - st2, st0 - stc ); stc = st0; // #endif// __PS3__ @@ -1564,7 +1564,7 @@ void MinecraftServer::handleConsoleInputs() } } -void MinecraftServer::main(__int64 seed, void *lpParameter) +void MinecraftServer::main(int64_t seed, void *lpParameter) { #if __PS3__ ShutdownManager::HasStarted(ShutdownManager::eServerThread ); @@ -1640,7 +1640,7 @@ void MinecraftServer::cycleSlowQueueIndex() int startingIndex = s_slowQueuePlayerIndex; INetworkPlayer *currentPlayer = NULL; - DWORD currentPlayerCount = 0; + unsigned long currentPlayerCount = 0; do { currentPlayerCount = g_NetworkManager.GetPlayerCount(); diff --git a/src/client/MinecraftServer.h b/src/client/MinecraftServer.h index 46156978..1e116122 100644 --- a/src/client/MinecraftServer.h +++ b/src/client/MinecraftServer.h @@ -22,19 +22,19 @@ class CommandDispatcher; typedef struct _LoadSaveDataThreadParam { - LPVOID data; - __int64 fileSize; + void* data; + int64_t fileSize; const wstring saveName; - _LoadSaveDataThreadParam(LPVOID data, __int64 filesize, const wstring &saveName) : data( data ), fileSize( filesize ), saveName( saveName ) {} + _LoadSaveDataThreadParam(void* data, int64_t filesize, const wstring &saveName) : data( data ), fileSize( filesize ), saveName( saveName ) {} } LoadSaveDataThreadParam; typedef struct _NetworkGameInitData { - __int64 seed; + int64_t seed; LoadSaveDataThreadParam *saveData; - DWORD settings; + unsigned long settings; LevelGenerationOptions *levelGen; - DWORD texturePackId; + unsigned long texturePackId; bool findSeed; unsigned int xzSize; unsigned char hellScale; @@ -115,19 +115,19 @@ private: public: // 4J Stu - This value should be incremented every time the list of players with friends-only UGC settings changes // It is sent with PreLoginPacket and compared when it comes back in the LoginPacket - DWORD m_ugcPlayersVersion; + unsigned long m_ugcPlayersVersion; // This value is used to store the texture pack id for the currently loaded world - DWORD m_texturePackId; + unsigned long m_texturePackId; public: MinecraftServer(); ~MinecraftServer(); private: // 4J Added - LoadSaveDataThreadParam - bool initServer(__int64 seed, NetworkGameInitData *initData, DWORD initSettings, bool findSeed); + bool initServer(int64_t seed, NetworkGameInitData *initData, unsigned long initSettings, bool findSeed); void postProcessTerminate(ProgressRenderer *mcprogress); - bool loadLevel(LevelStorageSource *storageSource, const wstring& name, __int64 levelSeed, LevelType *pLevelType, NetworkGameInitData *initData); + bool loadLevel(LevelStorageSource *storageSource, const wstring& name, int64_t levelSeed, LevelType *pLevelType, NetworkGameInitData *initData); void setProgress(const wstring& status, int progress); void endProgress(); void saveAllChunks(); @@ -154,7 +154,7 @@ public: public: void halt(); - void run(__int64 seed, void *lpParameter); + void run(int64_t seed, void *lpParameter); void broadcastStartSavingPacket(); void broadcastStopSavingPacket(); @@ -165,7 +165,7 @@ public: void handleConsoleInput(const wstring& msg, ConsoleInputSource *source); void handleConsoleInputs(); // void addTickable(Tickable tickable); // 4J removed - static void main(__int64 seed, void *lpParameter); + static void main(int64_t seed, void *lpParameter); static void HaltServer(bool bPrimaryPlayerSignedOut=false); File *getFile(const wstring& name); @@ -185,9 +185,9 @@ private: static MinecraftServer *server; static bool setTimeOfDayAtEndOfTick; - static __int64 setTimeOfDay; + static int64_t setTimeOfDay; static bool setTimeAtEndOfTick; - static __int64 setTime; + static int64_t setTime; static bool m_bPrimaryPlayerSignedOut; // 4J-PB added to tell the stopserver not to save the game - another player may have signed in in their place, so ProfileManager.IsSignedIn isn't enough static bool s_bServerHalted; // 4J Stu Added so that we can halt the server even before it's been created properly @@ -211,8 +211,8 @@ public: public: static PlayerList *getPlayerList() { if( server != NULL ) return server->players; else return NULL; } - static void SetTimeOfDay(__int64 time) { setTimeOfDayAtEndOfTick = true; setTimeOfDay = time; } - static void SetTime(__int64 time) { setTimeAtEndOfTick = true; setTime = time; } + static void SetTimeOfDay(int64_t time) { setTimeOfDayAtEndOfTick = true; setTimeOfDay = time; } + static void SetTime(int64_t time) { setTimeAtEndOfTick = true; setTime = time; } C4JThread::Event* m_serverPausedEvent; private: diff --git a/src/client/MobRenderer.cpp b/src/client/MobRenderer.cpp index ead7318d..511c5c87 100644 --- a/src/client/MobRenderer.cpp +++ b/src/client/MobRenderer.cpp @@ -400,7 +400,7 @@ void MobRenderer::renderNameTag(shared_ptr mob, const wstring& OriginalName if (player != NULL && app.isXuidDeadmau5( player->getXuid() ) ) offs = -10; wstring playerName; - WCHAR wchName[2]; + wchar_t wchName[2]; #if defined(__PS3__) || defined(__ORBIS__) // Check we have all the font characters for this player name @@ -414,7 +414,7 @@ void MobRenderer::renderNameTag(shared_ptr mob, const wstring& OriginalName } else { - memset(wchName,0,sizeof(WCHAR)*2); + memset(wchName,0,sizeof(wchar_t)*2); swprintf(wchName, 2, L"%d",player->getPlayerIndex()+1); playerName=wchName; player->SetPlayerNameValidState(false); @@ -424,7 +424,7 @@ void MobRenderer::renderNameTag(shared_ptr mob, const wstring& OriginalName playerName=OriginalName; break; case Player::ePlayerNameValid_False: - memset(wchName,0,sizeof(WCHAR)*2); + memset(wchName,0,sizeof(wchar_t)*2); swprintf(wchName, 2, L"%d",player->getPlayerIndex()+1); playerName=wchName; break; diff --git a/src/client/MultiPlayerChunkCache.cpp b/src/client/MultiPlayerChunkCache.cpp index 3fdaa647..74cd7f06 100644 --- a/src/client/MultiPlayerChunkCache.cpp +++ b/src/client/MultiPlayerChunkCache.cpp @@ -204,7 +204,7 @@ LevelChunk *MultiPlayerChunkCache::create(int x, int z) #if ( defined _WIN64 || defined __LP64__ ) if( InterlockedCompareExchangeRelease64((LONG64 *)&cache[idx],(LONG64)chunk,(LONG64)lastChunk) == (LONG64)lastChunk ) #else - if( InterlockedCompareExchangeRelease((LONG *)&cache[idx],(LONG)chunk,(LONG)lastChunk) == (LONG)lastChunk ) + if( InterlockedCompareExchangeRelease((int32_t *)&cache[idx],(int32_t)chunk,(int32_t)lastChunk) == (int32_t)lastChunk ) #endif // _DURANGO { // If we're sharing with the server, we'll need to calculate our heightmap now, which isn't shared. If we aren't sharing with the server, diff --git a/src/client/MultiPlayerLocalPlayer.cpp b/src/client/MultiPlayerLocalPlayer.cpp index ccf198f3..552194a8 100644 --- a/src/client/MultiPlayerLocalPlayer.cpp +++ b/src/client/MultiPlayerLocalPlayer.cpp @@ -348,9 +348,9 @@ void MultiplayerLocalPlayer::StopSleeping() } // 4J Added -void MultiplayerLocalPlayer::setAndBroadcastCustomSkin(DWORD skinId) +void MultiplayerLocalPlayer::setAndBroadcastCustomSkin(unsigned long skinId) { - DWORD oldSkinIndex = getCustomSkin(); + unsigned long oldSkinIndex = getCustomSkin(); LocalPlayer::setCustomSkin(skinId); #ifndef _CONTENT_PACKAGE wprintf(L"Skin for local player %ls has changed to %ls (%d)\n", name.c_str(), customTextureUrl.c_str(), getPlayerDefaultSkin() ); @@ -358,9 +358,9 @@ void MultiplayerLocalPlayer::setAndBroadcastCustomSkin(DWORD skinId) if(getCustomSkin() != oldSkinIndex) connection->send( shared_ptr( new TextureAndGeometryChangePacket( shared_from_this(), app.GetPlayerSkinName(GetXboxPad()) ) ) ); } -void MultiplayerLocalPlayer::setAndBroadcastCustomCape(DWORD capeId) +void MultiplayerLocalPlayer::setAndBroadcastCustomCape(unsigned long capeId) { - DWORD oldCapeIndex = getCustomCape(); + unsigned long oldCapeIndex = getCustomCape(); LocalPlayer::setCustomCape(capeId); #ifndef _CONTENT_PACKAGE wprintf(L"Cape for local player %ls has changed to %ls\n", name.c_str(), customTextureUrl2.c_str()); diff --git a/src/client/MultiPlayerLocalPlayer.h b/src/client/MultiPlayerLocalPlayer.h index 3826c9e5..70fec629 100644 --- a/src/client/MultiPlayerLocalPlayer.h +++ b/src/client/MultiPlayerLocalPlayer.h @@ -59,7 +59,7 @@ public: bool isLocalPlayer(); // 4J - send the custom skin texture data if there is one - //void CustomSkin(PBYTE pbData, DWORD dwBytes); + //void CustomSkin(uint8_t* pbData, unsigned long dwBytes); // 4J Overriding this so we can flag an event for the tutorial virtual void ride(shared_ptr e); @@ -68,6 +68,6 @@ public: virtual void StopSleeping(); // 4J Added - virtual void setAndBroadcastCustomSkin(DWORD skinId); - virtual void setAndBroadcastCustomCape(DWORD capeId); + virtual void setAndBroadcastCustomSkin(unsigned long skinId); + virtual void setAndBroadcastCustomCape(unsigned long capeId); }; diff --git a/src/client/PendingConnection.cpp b/src/client/PendingConnection.cpp index 0917bded..27d14427 100644 --- a/src/client/PendingConnection.cpp +++ b/src/client/PendingConnection.cpp @@ -93,9 +93,9 @@ void PendingConnection::sendPreLoginResponse() { // 4J Stu - Calculate the players with UGC privileges set PlayerUID *ugcXuids = new PlayerUID[MINECRAFT_NET_MAX_PLAYERS]; - DWORD ugcXuidCount = 0; - DWORD hostIndex = 0; - BYTE ugcFriendsOnlyBits = 0; + unsigned long ugcXuidCount = 0; + unsigned long hostIndex = 0; + uint8_t ugcFriendsOnlyBits = 0; char szUniqueMapName[14]; StorageManager.GetSaveUniqueFilename(szUniqueMapName); diff --git a/src/client/PlayerChunkMap.cpp b/src/client/PlayerChunkMap.cpp index 0e967ac9..73cc142c 100644 --- a/src/client/PlayerChunkMap.cpp +++ b/src/client/PlayerChunkMap.cpp @@ -93,7 +93,7 @@ void PlayerChunkMap::PlayerChunk::remove(shared_ptr player) players.erase(it); if (players.size() == 0) { - __int64 id = (pos.x + 0x7fffffffLL) | ((pos.z + 0x7fffffffLL) << 32); + int64_t id = (pos.x + 0x7fffffffLL) | ((pos.z + 0x7fffffffLL) << 32); AUTO_VAR(it, parent->chunks.find(id)); if( it != parent->chunks.end() ) { @@ -433,13 +433,13 @@ void PlayerChunkMap::tick() bool PlayerChunkMap::hasChunk(int x, int z) { - __int64 id = (x + 0x7fffffffLL) | ((z + 0x7fffffffLL) << 32); + int64_t id = (x + 0x7fffffffLL) | ((z + 0x7fffffffLL) << 32); return chunks.find(id) != chunks.end(); } PlayerChunkMap::PlayerChunk *PlayerChunkMap::getChunk(int x, int z, bool create) { - __int64 id = (x + 0x7fffffffLL) | ((z + 0x7fffffffLL) << 32); + int64_t id = (x + 0x7fffffffLL) | ((z + 0x7fffffffLL) << 32); AUTO_VAR(it, chunks.find(id)); PlayerChunk *chunk = NULL; @@ -460,7 +460,7 @@ PlayerChunkMap::PlayerChunk *PlayerChunkMap::getChunk(int x, int z, bool create) // queue a request for it to be created. void PlayerChunkMap::getChunkAndAddPlayer(int x, int z, shared_ptr player) { - __int64 id = (x + 0x7fffffffLL) | ((z + 0x7fffffffLL) << 32); + int64_t id = (x + 0x7fffffffLL) | ((z + 0x7fffffffLL) << 32); AUTO_VAR(it, chunks.find(id)); if( it != chunks.end() ) @@ -487,7 +487,7 @@ void PlayerChunkMap::getChunkAndRemovePlayer(int x, int z, shared_ptr > players; void flagEntitiesToBeRemoved(unsigned int *flags, bool *removedFound); // 4J added private: - unordered_map<__int64,PlayerChunk *,LongKeyHash,LongKeyEq> chunks; // 4J - was LongHashMap + unordered_map chunks; // 4J - was LongHashMap vector changedChunks; vector addRequests; // 4J added void tickAddRequests(shared_ptr player); // 4J added diff --git a/src/client/PlayerConnection.cpp b/src/client/PlayerConnection.cpp index dcf6d829..496b61e8 100644 --- a/src/client/PlayerConnection.cpp +++ b/src/client/PlayerConnection.cpp @@ -802,8 +802,8 @@ void PlayerConnection::handleTexture(shared_ptr packet) #ifndef _CONTENT_PACKAGE wprintf(L"Server received request for custom texture %ls\n",packet->textureName.c_str()); #endif - PBYTE pbData=NULL; - DWORD dwBytes=0; + uint8_t* pbData=NULL; + unsigned long dwBytes=0; app.GetMemFileDetails(packet->textureName,&pbData,&dwBytes); if(dwBytes!=0) @@ -836,8 +836,8 @@ void PlayerConnection::handleTextureAndGeometry(shared_ptrtextureName.c_str()); #endif - PBYTE pbData=NULL; - DWORD dwTextureBytes=0; + uint8_t* pbData=NULL; + unsigned long dwTextureBytes=0; app.GetMemFileDetails(packet->textureName,&pbData,&dwTextureBytes); DLCSkinFile *pDLCSkinFile = app.m_dlcManager.getSkinFile(packet->textureName); @@ -900,8 +900,8 @@ void PlayerConnection::handleTextureReceived(const wstring &textureName) AUTO_VAR(it, find( m_texturesRequested.begin(), m_texturesRequested.end(), textureName )); if( it != m_texturesRequested.end() ) { - PBYTE pbData=NULL; - DWORD dwBytes=0; + uint8_t* pbData=NULL; + unsigned long dwBytes=0; app.GetMemFileDetails(textureName,&pbData,&dwBytes); if(dwBytes!=0) @@ -918,8 +918,8 @@ void PlayerConnection::handleTextureAndGeometryReceived(const wstring &textureNa AUTO_VAR(it, find( m_texturesRequested.begin(), m_texturesRequested.end(), textureName )); if( it != m_texturesRequested.end() ) { - PBYTE pbData=NULL; - DWORD dwTextureBytes=0; + uint8_t* pbData=NULL; + unsigned long dwTextureBytes=0; app.GetMemFileDetails(textureName,&pbData,&dwTextureBytes); DLCSkinFile *pDLCSkinFile=app.m_dlcManager.getSkinFile(textureName); @@ -932,7 +932,7 @@ void PlayerConnection::handleTextureAndGeometryReceived(const wstring &textureNa else { // get the data from the app - DWORD dwSkinID = app.getSkinIdFromPath(textureName); + unsigned long dwSkinID = app.getSkinIdFromPath(textureName); vector *pvSkinBoxes = app.GetAdditionalSkinBoxes(dwSkinID); unsigned int uiAnimOverrideBitmask= app.GetAnimOverrideBitmask(dwSkinID); diff --git a/src/client/PlayerConnection.h b/src/client/PlayerConnection.h index 85d8c0da..4997dff1 100644 --- a/src/client/PlayerConnection.h +++ b/src/client/PlayerConnection.h @@ -30,9 +30,9 @@ private: bool didTick; int lastKeepAliveId; - __int64 lastKeepAliveTime; + int64_t lastKeepAliveTime; static Random random; - __int64 lastKeepAliveTick; + int64_t lastKeepAliveTick; int chatSpamTickCount; int dropSpamTickCount; diff --git a/src/client/PlayerList.cpp b/src/client/PlayerList.cpp index bf095c67..82b3a3b9 100644 --- a/src/client/PlayerList.cpp +++ b/src/client/PlayerList.cpp @@ -105,7 +105,7 @@ void PlayerList::placeNewPlayer(Connection *connection, shared_ptr ServerLevel *level = server->getLevel(player->dimension); - DWORD playerIndex = 0; + unsigned long playerIndex = 0; { bool usedIndexes[MINECRAFT_NET_MAX_PLAYERS]; ZeroMemory( &usedIndexes, MINECRAFT_NET_MAX_PLAYERS * sizeof(bool) ); @@ -211,7 +211,7 @@ void PlayerList::placeNewPlayer(Connection *connection, shared_ptr playerConnection->send( shared_ptr( new LoginPacket(L"", player->entityId, level->getLevelData()->getGenerator(), level->getSeed(), player->gameMode->getGameModeForPlayer()->getId(), (byte) level->dimension->id, (byte) level->getMaxBuildHeight(), (byte) getMaxPlayers(), - level->difficulty, TelemetryManager->GetMultiplayerInstanceID(), (BYTE)playerIndex, level->useNewSeaLevel(), player->getAllPlayerGamePrivileges(), + level->difficulty, TelemetryManager->GetMultiplayerInstanceID(), (uint8_t)playerIndex, level->useNewSeaLevel(), player->getAllPlayerGamePrivileges(), level->getLevelData()->getXZSize(), level->getLevelData()->getHellScale() ) ) ); playerConnection->send( shared_ptr( new SetSpawnPositionPacket(spawnPos->x, spawnPos->y, spawnPos->z) ) ); playerConnection->send( shared_ptr( new PlayerAbilitiesPacket(&player->abilities)) ); @@ -535,7 +535,7 @@ shared_ptr PlayerList::respawn(shared_ptr serverPlay serverPlayer->dimension = targetDimension; EDefaultSkins skin = serverPlayer->getPlayerDefaultSkin(); - DWORD playerIndex = serverPlayer->getPlayerIndex(); + unsigned long playerIndex = serverPlayer->getPlayerIndex(); PlayerUID playerXuid = serverPlayer->getXuid(); PlayerUID playerOnlineXuid = serverPlayer->getOnlineXuid(); @@ -846,7 +846,7 @@ void PlayerList::tick() EnterCriticalSection(&m_closePlayersCS); while(!m_smallIdsToClose.empty()) { - BYTE smallId = m_smallIdsToClose.front(); + uint8_t smallId = m_smallIdsToClose.front(); m_smallIdsToClose.pop_front(); shared_ptr player = nullptr; @@ -872,7 +872,7 @@ void PlayerList::tick() EnterCriticalSection(&m_kickPlayersCS); while(!m_smallIdsToKick.empty()) { - BYTE smallId = m_smallIdsToKick.front(); + uint8_t smallId = m_smallIdsToKick.front(); m_smallIdsToKick.pop_front(); INetworkPlayer *selectedPlayer = g_NetworkManager.GetPlayerBySmallId(smallId); if( selectedPlayer != NULL ) @@ -1415,14 +1415,14 @@ bool PlayerList::canReceiveAllPackets(shared_ptr player) return false; } -void PlayerList::kickPlayerByShortId(BYTE networkSmallId) +void PlayerList::kickPlayerByShortId(uint8_t networkSmallId) { EnterCriticalSection(&m_kickPlayersCS); m_smallIdsToKick.push_back(networkSmallId); LeaveCriticalSection(&m_kickPlayersCS); } -void PlayerList::closePlayerConnectionBySmallId(BYTE networkSmallId) +void PlayerList::closePlayerConnectionBySmallId(uint8_t networkSmallId) { EnterCriticalSection(&m_closePlayersCS); m_smallIdsToClose.push_back(networkSmallId); diff --git a/src/client/PlayerList.h b/src/client/PlayerList.h index d0dcd7f8..fb819799 100644 --- a/src/client/PlayerList.h +++ b/src/client/PlayerList.h @@ -30,9 +30,9 @@ private: // 4J Added vector m_bannedXuids; - deque m_smallIdsToKick; + deque m_smallIdsToKick; CRITICAL_SECTION m_kickPlayersCS; - deque m_smallIdsToClose; + deque m_smallIdsToClose; CRITICAL_SECTION m_closePlayersCS; /* 4J - removed Set bans = new HashSet(); @@ -119,8 +119,8 @@ public: void setAllowCheatsForAllPlayers(bool allowCommands); // 4J Added - void kickPlayerByShortId(BYTE networkSmallId); - void closePlayerConnectionBySmallId(BYTE networkSmallId); + void kickPlayerByShortId(uint8_t networkSmallId); + void closePlayerConnectionBySmallId(uint8_t networkSmallId); bool isXuidBanned(PlayerUID xuid); // AP added for Vita so the range can be increased once the level starts void setViewDistance(int newViewDistance); diff --git a/src/client/PreStitchedTextureMap.cpp b/src/client/PreStitchedTextureMap.cpp index 1f02047b..e3267f26 100644 --- a/src/client/PreStitchedTextureMap.cpp +++ b/src/client/PreStitchedTextureMap.cpp @@ -178,7 +178,7 @@ void PreStitchedTextureMap::stitch() #ifdef __PSVITA__ // AP - alpha cut out is expensive on vita so we mark which icons actually require it - DWORD *data = (DWORD*) this->getStitchedTexture()->getData()->getBuffer(); + unsigned long *data = (unsigned long*) this->getStitchedTexture()->getData()->getBuffer(); int Width = this->getStitchedTexture()->getWidth(); int Height = this->getStitchedTexture()->getHeight(); for(AUTO_VAR(it, texturesByName.begin()); it != texturesByName.end(); ++it) diff --git a/src/client/ProgressRenderer.cpp b/src/client/ProgressRenderer.cpp index 3e036939..ccf78b4b 100644 --- a/src/client/ProgressRenderer.cpp +++ b/src/client/ProgressRenderer.cpp @@ -88,7 +88,7 @@ void ProgressRenderer::progressStagePercentage(int i) } - __int64 now = System::currentTimeMillis(); + int64_t now = System::currentTimeMillis(); if (now - lastTime < 20) return; lastTime = now; diff --git a/src/client/ProgressRenderer.h b/src/client/ProgressRenderer.h index 2a3f2e68..e8c19647 100644 --- a/src/client/ProgressRenderer.h +++ b/src/client/ProgressRenderer.h @@ -25,7 +25,7 @@ private: int status; Minecraft *minecraft; int title; - __int64 lastTime; + int64_t lastTime; bool noAbort; wstring m_wstrText; eProgressStringType m_eType; diff --git a/src/client/SDL/4JLibs/4J_Input.cpp b/src/client/SDL/4JLibs/4J_Input.cpp index d348e38a..31e71b40 100644 --- a/src/client/SDL/4JLibs/4J_Input.cpp +++ b/src/client/SDL/4JLibs/4J_Input.cpp @@ -161,7 +161,7 @@ void C_4JInput::SetKeyRepeatRate(float fRepeatDelaySecs, float fRepeatRateSecs) { } -void C_4JInput::SetDebugSequence(const char* chSequenceA, int(*Func)(LPVOID), LPVOID lpParam) +void C_4JInput::SetDebugSequence(const char* chSequenceA, int(*Func)(void*), void* lpParam) { } @@ -237,7 +237,7 @@ void C_4JInput::SetMenuDisplayed(int iPad, bool bVal) } -EKeyboardResult C_4JInput::RequestKeyboard(LPCWSTR Title, LPCWSTR Text, DWORD dwPad, UINT uiMaxChars, int( *Func)(LPVOID,const bool),LPVOID lpParam,C_4JInput::EKeyboardMode eMode) +EKeyboardResult C_4JInput::RequestKeyboard(const wchar_t* Title, const wchar_t* Text, unsigned long dwPad, unsigned int uiMaxChars, int( *Func)(void*,const bool),void* lpParam,C_4JInput::EKeyboardMode eMode) { return EKeyboard_Pending; } @@ -247,17 +247,17 @@ void C_4JInput::GetText(uint16_t* UTF16String) } bool C_4JInput::VerifyStrings( - WCHAR** pwStringA, + wchar_t** pwStringA, int iStringC, - int(*Func)(LPVOID, STRING_VERIFY_RESPONSE*), - LPVOID lpParam) + int(*Func)(void*, STRING_VERIFY_RESPONSE*), + void* lpParam) { return false; } void C_4JInput::CancelQueuedVerifyStrings( - int(*Func)(LPVOID, STRING_VERIFY_RESPONSE*), - LPVOID lpParam) + int(*Func)(void*, STRING_VERIFY_RESPONSE*), + void* lpParam) { } diff --git a/src/client/SDL/4JLibs/4J_Input.h b/src/client/SDL/4JLibs/4J_Input.h index 120e9c7b..88164e1e 100644 --- a/src/client/SDL/4JLibs/4J_Input.h +++ b/src/client/SDL/4JLibs/4J_Input.h @@ -84,8 +84,8 @@ public: void SetJoypadStickAxisMap(int iPad,unsigned int uiFrom, unsigned int uiTo); void SetJoypadStickTriggerMap(int iPad,unsigned int uiFrom, unsigned int uiTo); void SetKeyRepeatRate(float fRepeatDelaySecs,float fRepeatRateSecs); - void SetDebugSequence( const char *chSequenceA,int( *Func)(LPVOID),LPVOID lpParam ); - FLOAT GetIdleSeconds(int iPad); + void SetDebugSequence( const char *chSequenceA,int( *Func)(void*),void* lpParam ); + float GetIdleSeconds(int iPad); bool IsPadConnected(int iPad); // In-Game values which may have been remapped due to Southpaw, swap triggers, etc @@ -98,8 +98,8 @@ public: void SetMenuDisplayed(int iPad, bool bVal); - EKeyboardResult RequestKeyboard(UINT uiTitle, UINT uiText, UINT uiDesc, DWORD dwPad, WCHAR *pwchResult, UINT uiResultSize,int( *Func)(LPVOID,const bool),LPVOID lpParam,EKeyboardMode eMode,CXuiStringTable *pStringTable=NULL); - EKeyboardResult RequestKeyboard(UINT uiTitle, LPCWSTR pwchDefault, UINT uiDesc, DWORD dwPad, WCHAR *pwchResult, UINT uiResultSize,int( *Func)(LPVOID,const bool),LPVOID lpParam, EKeyboardMode eMode,CXuiStringTable *pStringTable=NULL); + EKeyboardResult RequestKeyboard(unsigned int uiTitle, unsigned int uiText, unsigned int uiDesc, unsigned long dwPad, wchar_t *pwchResult, unsigned int uiResultSize,int( *Func)(void*,const bool),void* lpParam,EKeyboardMode eMode,CXuiStringTable *pStringTable=NULL); + EKeyboardResult RequestKeyboard(unsigned int uiTitle, const wchar_t* pwchDefault, unsigned int uiDesc, unsigned long dwPad, wchar_t *pwchResult, unsigned int uiResultSize,int( *Func)(void*,const bool),void* lpParam, EKeyboardMode eMode,CXuiStringTable *pStringTable=NULL); // Online check strings against offensive list - TCR 92 // TCR # 092 CMTV Player Text String Verification @@ -116,11 +116,11 @@ public: // // Intent Protect players from inappropriate language. /* -bool VerifyStrings(WCHAR **pwStringA,int iStringC,int( *Func)(LPVOID,STRING_VERIFY_RESPONSE *),LPVOID lpParam); - void CancelQueuedVerifyStrings(int( *Func)(LPVOID,STRING_VERIFY_RESPONSE *),LPVOID lpParam); +bool VerifyStrings(wchar_t **pwStringA,int iStringC,int( *Func)(void*,STRING_VERIFY_RESPONSE *),void* lpParam); + void CancelQueuedVerifyStrings(int( *Func)(void*,STRING_VERIFY_RESPONSE *),void* lpParam); void CancelAllVerifyInProgress(void); */ - //bool InputDetected(DWORD dwUserIndex,WCHAR *pwchInput); + //bool InputDetected(unsigned long dwUserIndex,wchar_t *pwchInput); }; // Singleton diff --git a/src/client/SDL/4JLibs/4J_Profile.cpp b/src/client/SDL/4JLibs/4J_Profile.cpp new file mode 100644 index 00000000..0c956d41 --- /dev/null +++ b/src/client/SDL/4JLibs/4J_Profile.cpp @@ -0,0 +1,99 @@ +#include "C_4JProfile.h" +#include +#include + +static void *profileData[4]; +static bool s_bProfileIsFullVersion = false; +C_4JProfile::PROFILESETTINGS ProfileSettingsA[XUSER_MAX_COUNT]; + +int (*defaultOptionsCallback)(void*, C_4JProfile::PROFILESETTINGS *, const int iPad) = nullptr; +void* lpProfileParam = nullptr; + +void C_4JProfile::Initialise(unsigned long dwTitleID, + unsigned long dwOfferID, + unsigned short usProfileVersion, + unsigned int uiProfileValuesC, + unsigned int uiProfileSettingsC, + unsigned long *pdwProfileSettingsA, + int iGameDefinedDataSizeX4, + unsigned int *puiGameDefinedDataChangedBitmask) +{ + for (int i = 0; i < 4; i++) + { + profileData[i] = new byte[iGameDefinedDataSizeX4 / 4]; + memset(profileData[i], 0, sizeof(byte) * iGameDefinedDataSizeX4 / 4); + + PROFILESETTINGS *pGameSettings = (PROFILESETTINGS *)profileData[i]; + pGameSettings->iYAxisInversion = 0; + pGameSettings->iControllerSensitivity = 100; + pGameSettings->iVibration = 100; + pGameSettings->bSwapSticks = false; + } +} + +void C_4JProfile::SetTrialTextStringTable(CXuiStringTable *pStringTable,int iAccept,int iReject) {} +void C_4JProfile::SetTrialAwardText(eAwardType AwardType,int iTitle,int iText) {} +int C_4JProfile::GetLockedProfile() { return 0; } +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; } +unsigned int C_4JProfile::RequestSignInUI(bool, bool, bool, bool, bool, int (*)(void*,const bool,const int), void*, int) { return 0; } +unsigned int C_4JProfile::DisplayOfflineProfile(int (*)(void*,const bool,const int), void*, int) { return 0; } +unsigned int C_4JProfile::RequestConvertOfflineToGuestUI(int (*)(void*,const bool,const int), void*, int) { return 0; } +void C_4JProfile::SetPrimaryPlayerChanged(bool) {} +bool C_4JProfile::QuerySigninStatus() { return true; } +void C_4JProfile::GetXUID(int iPad, XUID *pXuid, bool) { *pXuid = 0xe000d45248242f2e; } +bool C_4JProfile::AreXUIDSEqual(XUID, XUID) { return false; } +bool C_4JProfile::XUIDIsGuest(XUID) { return false; } +bool C_4JProfile::AllowedToPlayMultiplayer(int) { return true; } +void C_4JProfile::StartTrialGame() {} +void C_4JProfile::AllowedPlayerCreatedContent(int, bool, bool*, bool*) {} +bool C_4JProfile::CanViewPlayerCreatedContent(int, bool, PXUID, unsigned long) { return true; } + +int C_4JProfile::GetPrimaryPad() { return 0; } +void C_4JProfile::SetPrimaryPad(int iPad) {} +char* C_4JProfile::GetGamertag(int iPad) { return "PlayerName"; } +wstring C_4JProfile::GetDisplayName(int iPad) { return L"PlayerName"; } +bool C_4JProfile::IsFullVersion() { return s_bProfileIsFullVersion; } +void C_4JProfile::SetSignInChangeCallback(void (*Func)(void*,bool,unsigned int), void* lpParam) {} +void C_4JProfile::SetNotificationsCallback(void (*Func)(void*,unsigned long,unsigned int), void* lpParam) {} +bool C_4JProfile::RegionIsNorthAmerica() { return false; } +bool C_4JProfile::LocaleIsUSorCanada() { return false; } +int C_4JProfile::GetLiveConnectionStatus() { return S_OK; } +bool C_4JProfile::IsSystemUIDisplayed() { return false; } +void C_4JProfile::SetProfileReadErrorCallback(void (*Func)(void*), void* lpParam) {} + +int C_4JProfile::SetDefaultOptionsCallback(int (*Func)(void*,PROFILESETTINGS*,const int), void* lpParam) +{ + defaultOptionsCallback = Func; + ::lpProfileParam = lpParam; + return 0; +} + +int C_4JProfile::SetOldProfileVersionCallback(int (*Func)(void*,unsigned char*,const unsigned short,const int), void* lpParam) { return 0; } +C_4JProfile::PROFILESETTINGS* C_4JProfile::GetDashboardProfileSettings(int iPad) { return &ProfileSettingsA[iPad]; } +void C_4JProfile::WriteToProfile(int, bool, bool) {} +void C_4JProfile::ForceQueuedProfileWrites(int) {} +void* C_4JProfile::GetGameDefinedProfileData(int iQuadrant) { return profileData[iQuadrant]; } +void C_4JProfile::ResetProfileProcessState() {} +void C_4JProfile::Tick() {} + +void C_4JProfile::RegisterAward(int, int, eAwardType, bool, CXuiStringTable*, int, int, int, char*, unsigned int) {} +int C_4JProfile::GetAwardId(int) { return 0; } +eAwardType C_4JProfile::GetAwardType(int) { return eAwardType_Achievement; } +bool C_4JProfile::CanBeAwarded(int, int) { return false; } +void C_4JProfile::Award(int, int, bool) {} +bool C_4JProfile::IsAwardsFlagSet(int, int) { return false; } + +void C_4JProfile::RichPresenceInit(int, int) {} +void C_4JProfile::RegisterRichPresenceContext(int) {} +void C_4JProfile::SetRichPresenceContextValue(int, int, int) {} +void C_4JProfile::SetCurrentGameActivity(int, int, bool) {} + +void C_4JProfile::DisplayFullVersionPurchase(bool, int, int) {} +void C_4JProfile::SetUpsellCallback(void (*Func)(void*,eUpsellType,eUpsellResponse,int), void* lpParam) {} + +void C_4JProfile::SetDebugFullOverride(bool bVal) { s_bProfileIsFullVersion = bVal; } + +C_4JProfile ProfileManager; \ No newline at end of file diff --git a/src/client/SDL/4JLibs/4J_Profile.h b/src/client/SDL/4JLibs/4J_Profile.h index 28e717e8..a4650b01 100644 --- a/src/client/SDL/4JLibs/4J_Profile.h +++ b/src/client/SDL/4JLibs/4J_Profile.h @@ -39,12 +39,12 @@ 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, + void Initialise( unsigned long dwTitleID, + unsigned long dwOfferID, unsigned short usProfileVersion, - UINT uiProfileValuesC, - UINT uiProfileSettingsC, - DWORD *pdwProfileSettingsA, + unsigned int uiProfileValuesC, + unsigned int uiProfileSettingsC, + unsigned long *pdwProfileSettingsA, int iGameDefinedDataSizeX4, unsigned int *puiGameDefinedDataChangedBitmask); void SetTrialTextStringTable(CXuiStringTable *pStringTable,int iAccept,int iReject); @@ -54,38 +54,42 @@ 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)(LPVOID,const bool, const int iPad),LPVOID lpParam,int iQuadrant=XUSER_INDEX_ANY); - UINT DisplayOfflineProfile(int( *Func)(LPVOID,const bool, const int iPad),LPVOID lpParam,int iQuadrant=XUSER_INDEX_ANY); - UINT RequestConvertOfflineToGuestUI(int( *Func)(LPVOID,const bool, const int iPad),LPVOID 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, XUID *pXuid,bool bOnlineXuid); - BOOL AreXUIDSEqual(XUID xuid1,XUID xuid2); - BOOL XUIDIsGuest(XUID xuid); + void GetXUID(int iPad, PlayerUID *pXuid,bool bOnlineXuid); + bool AreXUIDSEqual(PlayerUID xuid1,PlayerUID xuid2); + bool XUIDIsGuest(PlayerUID xuid); bool AllowedToPlayMultiplayer(int iProf); + bool GetChatAndContentRestrictions(int iPad,bool *pbChatRestricted,bool *pbContentRestricted,int *piAge); void StartTrialGame(); // disables saves and leaderboard, and change state to readyforgame from pregame - void AllowedPlayerCreatedContent(int iPad, bool thisQuadrantOnly, BOOL *allAllowed, BOOL *friendsAllowed); - BOOL CanViewPlayerCreatedContent(int iPad, bool thisQuadrantOnly, PXUID pXuids, DWORD dwXuidCount ); + void AllowedPlayerCreatedContent(int iPad, bool thisQuadrantOnly, bool *allAllowed, bool *friendsAllowed); + bool CanViewPlayerCreatedContent(int iPad, bool thisQuadrantOnly, PPlayerUID pXuids, unsigned long dwXuidCount ); + void ShowProfileCard(int iPad, PlayerUID targetUid); + bool GetProfileAvatar(int iPad,int( *Func)(void* lpParam,uint8_t* pbThumbnail,unsigned long dwThumbnailBytes), void* lpParam); + void CancelProfileAvatarRequest(); // SYS int GetPrimaryPad(); void SetPrimaryPad(int iPad); char* GetGamertag(int iPad); - wchar_t* GetDisplayName(int iPad); + wstring GetDisplayName(int iPad); bool IsFullVersion(); - void SetSignInChangeCallback(void ( *Func)(LPVOID, bool, unsigned int),LPVOID lpParam); - void SetNotificationsCallback(void ( *Func)(LPVOID, DWORD, unsigned int),LPVOID lpParam); + void SetSignInChangeCallback(void ( *Func)(void*, bool, unsigned int),void* lpParam); + void SetNotificationsCallback(void ( *Func)(void*, unsigned long, unsigned int),void* lpParam); bool RegionIsNorthAmerica(void); bool LocaleIsUSorCanada(void); - HRESULT GetLiveConnectionStatus(); + int GetLiveConnectionStatus(); bool IsSystemUIDisplayed(); - void SetProfileReadErrorCallback(void ( *Func)(LPVOID), LPVOID lpParam); + void SetProfileReadErrorCallback(void ( *Func)(void*), void* lpParam); // PROFILE DATA - int SetDefaultOptionsCallback(int( *Func)(LPVOID,PROFILESETTINGS *, const int iPad),LPVOID lpParam); - int SetOldProfileVersionCallback(int( *Func)(LPVOID,unsigned char *, const unsigned short,const int),LPVOID lpParam); + int SetDefaultOptionsCallback(int( *Func)(void*,PROFILESETTINGS *, const int iPad),void* lpParam); + int SetOldProfileVersionCallback(int( *Func)(void*,unsigned char *, const unsigned short,const int),void* lpParam); PROFILESETTINGS * GetDashboardProfileSettings(int iPad); void WriteToProfile(int iQuadrant, bool bGameDefinedDataChanged=false, bool bOverride5MinuteLimitOnProfileWrites=false); void ForceQueuedProfileWrites(int iPad=XUSER_INDEX_ANY); @@ -112,7 +116,7 @@ public: // PURCHASE void DisplayFullVersionPurchase(bool bRequired, int iQuadrant, int iUpsellParam = -1); - void SetUpsellCallback(void ( *Func)(LPVOID lpParam, eUpsellType type, eUpsellResponse response, int iUserData),LPVOID lpParam); + void SetUpsellCallback(void ( *Func)(void* lpParam, eUpsellType type, eUpsellResponse response, int iUserData),void* lpParam); // Debug void SetDebugFullOverride(bool bVal); // To override the license version (trail/full). Only in debug/release, not ContentPackage diff --git a/src/client/SDL/4JLibs/4J_Render.h b/src/client/SDL/4JLibs/4J_Render.h index 5f113d5d..67f0c55a 100644 --- a/src/client/SDL/4JLibs/4J_Render.h +++ b/src/client/SDL/4JLibs/4J_Render.h @@ -1,5 +1,243 @@ #pragma once -#include + +// STUBS + +typedef void ID3D11Device; +typedef void ID3D11SwapChain; +typedef void ID3D11Buffer; +typedef void ID3D11ShaderResourceView; +typedef void IDXGISwapChain; + +typedef struct D3D11_RECT { + int32_t left; + int32_t top; + int32_t right; + int32_t bottom; +} D3D11_RECT; + +#define D3D11_BLEND_ZERO 0 +#define D3D11_BLEND_ONE 1 +#define D3D11_BLEND_SRC_ALPHA 2 +#define D3D11_BLEND_INV_SRC_ALPHA 3 +#define D3D11_BLEND_DEST_ALPHA 4 +#define D3D11_BLEND_SRC_COLOR 5 +#define D3D11_BLEND_DEST_COLOR 6 +#define D3D11_BLEND_INV_DEST_COLOR 7 +#define D3D11_BLEND_INV_SRC_COLOR 8 +#define D3D11_BLEND_BLEND_FACTOR 14 +#define D3D11_BLEND_INV_BLEND_FACTOR 15 + +#define D3D11_COMPARISON_GREATER 0 +#define D3D11_COMPARISON_EQUAL 1 +#define D3D11_COMPARISON_LESS_EQUAL 2 +#define D3D11_COMPARISON_GREATER_EQUAL 3 +#define D3D11_COMPARISON_ALWAYS 4 + +// STUBS + +class ImageFileBuffer +{ +public: + enum EImageType + { + e_typePNG, + e_typeJPG + }; + + EImageType m_type; + void* m_pBuffer; + int m_bufferSize; + + int GetType() { return m_type; } + void *GetBufferPointer() { return m_pBuffer; } + int GetBufferSize() { return m_bufferSize; } + void Release() { free(m_pBuffer); m_pBuffer = NULL; } + bool Allocated() { return m_pBuffer != NULL; } +}; + +typedef struct +{ + int Width; + int Height; +}D3DXIMAGE_INFO; + +typedef struct _XSOCIAL_PREVIEWIMAGE { + uint8_t *pBytes; + unsigned long Pitch; + unsigned long Width; + unsigned long Height; +// D3DFORMAT Format; +} XSOCIAL_PREVIEWIMAGE, *PXSOCIAL_PREVIEWIMAGE; + +class C4JRender +{ +public: + void Tick(); + void UpdateGamma(unsigned short usGamma); + + // Matrix stack + void MatrixMode(int type); + void MatrixSetIdentity(); + void MatrixTranslate(float x,float y,float z); + void MatrixRotate(float angle, float x, float y, float z); + void MatrixScale(float x, float y, float z); + void MatrixPerspective(float fovy, float aspect, float zNear, float zFar); + void MatrixOrthogonal(float left,float right,float bottom,float top,float zNear,float zFar); + void MatrixPop(); + void MatrixPush(); + void MatrixMult(float *mat); + const float *MatrixGet(int type); + void Set_matrixDirty(); + + // Core + void Initialise(ID3D11Device *pDevice, IDXGISwapChain *pSwapChain); + void InitialiseContext(); + void StartFrame(); + void DoScreenGrabOnNextPresent(); + void Present(); + void Clear(int flags, D3D11_RECT *pRect = NULL); + void SetClearColour(const float colourRGBA[4]); + bool IsWidescreen(); + bool IsHiDef(); + void CaptureThumbnail(ImageFileBuffer *pngOut); + void CaptureScreen(ImageFileBuffer *jpgOut, XSOCIAL_PREVIEWIMAGE *previewOut); + void BeginConditionalSurvey(int identifier); + void EndConditionalSurvey(); + void BeginConditionalRendering(int identifier); + void EndConditionalRendering(); + + // Vertex data handling + typedef enum + { + VERTEX_TYPE_PF3_TF2_CB4_NB4_XW1, // Position 3 x float, texture 2 x float, colour 4 x byte, normal 4 x byte, padding 1 unsigned long + VERTEX_TYPE_COMPRESSED, // Compressed format - see comment at top of VS_PS3_TS2_CS1.hlsl for description of layout + VERTEX_TYPE_PF3_TF2_CB4_NB4_XW1_LIT, // as VERTEX_TYPE_PF3_TF2_CB4_NB4_XW1 with lighting applied, + VERTEX_TYPE_PF3_TF2_CB4_NB4_XW1_TEXGEN, // as VERTEX_TYPE_PF3_TF2_CB4_NB4_XW1 with tex gen + VERTEX_TYPE_COUNT + } eVertexType; + + // Pixel shader + typedef enum + { + PIXEL_SHADER_TYPE_STANDARD, + PIXEL_SHADER_TYPE_PROJECTION, + PIXEL_SHADER_TYPE_FORCELOD, + PIXEL_SHADER_COUNT + } ePixelShaderType; + + typedef enum + { + VIEWPORT_TYPE_FULLSCREEN, + VIEWPORT_TYPE_SPLIT_TOP, + VIEWPORT_TYPE_SPLIT_BOTTOM, + VIEWPORT_TYPE_SPLIT_LEFT, + VIEWPORT_TYPE_SPLIT_RIGHT, + VIEWPORT_TYPE_QUADRANT_TOP_LEFT, + VIEWPORT_TYPE_QUADRANT_TOP_RIGHT, + VIEWPORT_TYPE_QUADRANT_BOTTOM_LEFT, + VIEWPORT_TYPE_QUADRANT_BOTTOM_RIGHT, + } eViewportType; + + typedef enum + { + PRIMITIVE_TYPE_TRIANGLE_LIST, + PRIMITIVE_TYPE_TRIANGLE_STRIP, + PRIMITIVE_TYPE_TRIANGLE_FAN, + PRIMITIVE_TYPE_QUAD_LIST, + PRIMITIVE_TYPE_LINE_LIST, + PRIMITIVE_TYPE_LINE_STRIP, + PRIMITIVE_TYPE_COUNT + } ePrimitiveType; + + void DrawVertices(ePrimitiveType PrimitiveType, int count, void *dataIn, eVertexType vType, C4JRender::ePixelShaderType psType); + void DrawVertexBuffer(ePrimitiveType PrimitiveType, int count, ID3D11Buffer *buffer, C4JRender::eVertexType vType, C4JRender::ePixelShaderType psType); + + // Command buffers + void CBuffLockStaticCreations(); + int CBuffCreate(int count); + void CBuffDelete(int first, int count); + void CBuffStart(int index, bool full = false); + void CBuffClear(int index); + int CBuffSize(int index); + void CBuffEnd(); + bool CBuffCall(int index, bool full = true); + void CBuffTick(); + void CBuffDeferredModeStart(); + void CBuffDeferredModeEnd(); + + typedef enum + { + TEXTURE_FORMAT_RxGyBzAw, // Normal 32-bit RGBA texture, 8 bits per component + /* Don't think these are all directly available on D3D 11 - leaving for now + TEXTURE_FORMAT_R0G0B0Ax, // One 8-bit component mapped to alpha channel, R=G=B=0 + TEXTURE_FORMAT_R1G1B1Ax, // One 8-bit component mapped to alpha channel, R=G=B=1 + TEXTURE_FORMAT_RxGxBxAx, // One 8-bit component mapped to all channels + */ + MAX_TEXTURE_FORMATS + } eTextureFormat; + + // Textures + int TextureCreate(); + void TextureFree(int idx); + void TextureBind(int idx); + void TextureBindVertex(int idx); + void TextureSetTextureLevels(int levels); + int TextureGetTextureLevels(); + void TextureData(int width, int height, void *data, int level, eTextureFormat format = TEXTURE_FORMAT_RxGyBzAw); + void TextureDataUpdate(int xoffset, int yoffset, int width, int height, void *data, int level); + void TextureSetParam(int param, int value); + void TextureDynamicUpdateStart(); + void TextureDynamicUpdateEnd(); + int LoadTextureData(const char *szFilename,D3DXIMAGE_INFO *pSrcInfo, int **ppDataOut); + int LoadTextureData(uint8_t *pbData, unsigned long dwBytes,D3DXIMAGE_INFO *pSrcInfo, int **ppDataOut); + int SaveTextureData(const char *szFilename, D3DXIMAGE_INFO *pSrcInfo, int *ppDataOut); + int SaveTextureDataToMemory(void *pOutput, int outputCapacity, int *outputLength, int width, int height, int *ppDataIn); + void TextureGetStats(); + ID3D11ShaderResourceView *TextureGetTexture(int idx); + + // State control + void StateSetColour(float r, float g, float b, float a); + void StateSetDepthMask(bool enable); + void StateSetBlendEnable(bool enable); + void StateSetBlendFunc(int src, int dst); + void StateSetBlendFactor(unsigned int colour); + void StateSetAlphaFunc(int func, float param); + void StateSetDepthFunc(int func); + void StateSetFaceCull(bool enable); + void StateSetFaceCullCW(bool enable); + void StateSetLineWidth(float width); + void StateSetWriteEnable(bool red, bool green, bool blue, bool alpha); + void StateSetDepthTestEnable(bool enable); + void StateSetAlphaTestEnable(bool enable); + void StateSetDepthSlopeAndBias(float slope, float bias); + void StateSetFogEnable(bool enable); + void StateSetFogMode(int mode); + void StateSetFogNearDistance(float dist); + void StateSetFogFarDistance(float dist); + void StateSetFogDensity(float density); + void StateSetFogColour(float red, float green, float blue); + void StateSetLightingEnable(bool enable); + void StateSetVertexTextureUV( float u, float v); + void StateSetLightColour(int light, float red, float green, float blue); + void StateSetLightAmbientColour(float red, float green, float blue); + void StateSetLightDirection(int light, float x, float y, float z); + void StateSetLightEnable(int light, bool enable); + void StateSetViewport(eViewportType viewportType); + void StateSetEnableViewportClipPlanes(bool enable); + void StateSetTexGenCol(int col, float x, float y, float z, float w, bool eyeSpace); + void StateSetStencil(int Function, uint8_t stencil_ref, uint8_t stencil_func_mask, uint8_t stencil_write_mask); + void StateSetForceLOD(int LOD); + + // Event tracking + void BeginEvent(const wchar_t* eventName); + void EndEvent(); + + // PLM event handling + void Suspend(); + bool Suspended(); + void Resume(); +}; + const int GL_MODELVIEW_MATRIX = 0; const int GL_PROJECTION_MATRIX = 1; @@ -37,33 +275,29 @@ const int GL_LIGHTING = 7; const int GL_LIGHT0 = 8; const int GL_LIGHT1 = 9; +const int CLEAR_DEPTH_FLAG = 1; +const int CLEAR_COLOUR_FLAG = 2; -const int GL_DEPTH_BUFFER_BIT = D3DCLEAR_ZBUFFER; -const int GL_COLOR_BUFFER_BIT = D3DCLEAR_TARGET; +const int GL_DEPTH_BUFFER_BIT = CLEAR_DEPTH_FLAG; +const int GL_COLOR_BUFFER_BIT = CLEAR_COLOUR_FLAG; -const int GL_QUADS = D3DPT_QUADLIST; -const int GL_TRIANGLES = D3DPT_TRIANGLELIST; -const int GL_LINE_STRIP = D3DPT_LINESTRIP; -const int GL_TRIANGLE_STRIP = D3DPT_TRIANGLESTRIP; -const int GL_TRIANGLE_FAN = D3DPT_TRIANGLEFAN; -const int GL_LINES=D3DPT_LINELIST; -const int GL_SRC_ALPHA = D3DBLEND_SRCALPHA; -const int GL_ONE_MINUS_SRC_ALPHA = D3DBLEND_INVSRCALPHA; -const int GL_ONE = D3DBLEND_ONE; -const int GL_ZERO = D3DBLEND_ZERO; -const int GL_DST_ALPHA = D3DBLEND_DESTALPHA; -const int GL_SRC_COLOR = D3DBLEND_SRCCOLOR; -const int GL_DST_COLOR = D3DBLEND_DESTCOLOR; -const int GL_ONE_MINUS_DST_COLOR = D3DBLEND_INVDESTCOLOR; -const int GL_ONE_MINUS_SRC_COLOR = D3DBLEND_INVSRCCOLOR; -const int GL_CONSTANT_ALPHA = D3DBLEND_CONSTANTALPHA; -const int GL_ONE_MINUS_CONSTANT_ALPHA = D3DBLEND_INVCONSTANTALPHA; +const int GL_SRC_ALPHA = D3D11_BLEND_SRC_ALPHA; +const int GL_ONE_MINUS_SRC_ALPHA = D3D11_BLEND_INV_SRC_ALPHA; +const int GL_ONE = D3D11_BLEND_ONE; +const int GL_ZERO = D3D11_BLEND_ZERO; +const int GL_DST_ALPHA = D3D11_BLEND_DEST_ALPHA; +const int GL_SRC_COLOR = D3D11_BLEND_SRC_COLOR; +const int GL_DST_COLOR = D3D11_BLEND_DEST_COLOR; +const int GL_ONE_MINUS_DST_COLOR = D3D11_BLEND_INV_DEST_COLOR; +const int GL_ONE_MINUS_SRC_COLOR = D3D11_BLEND_INV_SRC_COLOR; +const int GL_CONSTANT_ALPHA = D3D11_BLEND_BLEND_FACTOR; +const int GL_ONE_MINUS_CONSTANT_ALPHA = D3D11_BLEND_INV_BLEND_FACTOR; -const int GL_GREATER = D3DCMP_GREATER; -const int GL_EQUAL = D3DCMP_EQUAL; -const int GL_LEQUAL = D3DCMP_LESSEQUAL; -const int GL_GEQUAL = D3DCMP_GREATEREQUAL; -const int GL_ALWAYS = D3DCMP_ALWAYS; +const int GL_GREATER = D3D11_COMPARISON_GREATER; +const int GL_EQUAL = D3D11_COMPARISON_EQUAL; +const int GL_LEQUAL = D3D11_COMPARISON_LESS_EQUAL; +const int GL_GEQUAL = D3D11_COMPARISON_GREATER_EQUAL; +const int GL_ALWAYS = D3D11_COMPARISON_ALWAYS; const int GL_TEXTURE_MIN_FILTER = 1; const int GL_TEXTURE_MAG_FILTER = 2; @@ -91,148 +325,13 @@ const int GL_SPECULAR = 4; const int GL_LIGHT_MODEL_AMBIENT = 1; - -class C4JRender -{ -public: - void Tick(); - void UpdateGamma(unsigned short usGamma); - - // Matrix stack - void MatrixMode(int type); - void MatrixSetIdentity(); - void MatrixTranslate(float x,float y,float z); - void MatrixRotate(float angle, float x, float y, float z); - void MatrixScale(float x, float y, float z); - void MatrixPerspective(float fovy, float aspect, float zNear, float zFar); - void MatrixOrthogonal(float left,float right,float bottom,float top,float zNear,float zFar); - void MatrixPop(); - void MatrixPush(); - void MatrixMult(float *mat); - const float *MatrixGet(int type); - void Set_matrixDirty(); - - // Core - void Initialise(IDirect3DDevice9 *pDevice); - void InitialiseContext(); - void Present(); - void Clear(int flags, D3DRECT *pRect = NULL); - void SetClearColour(D3DCOLOR colour); - bool IsWidescreen(); - bool IsHiDef(); - void CaptureThumbnail(LPD3DXBUFFER *pngOut); - void CaptureScreen(LPD3DXBUFFER *jpgOut, XSOCIAL_PREVIEWIMAGE *previewOut); - void BeginConditionalSurvey(int identifier); - void EndConditionalSurvey(); - void BeginConditionalRendering(int identifier); - void EndConditionalRendering(); - - // Vertex data handling - typedef enum - { - VERTEX_TYPE_PF3_TF2_CB4_NB4_XW1, // Position 3 x float, texture 2 x float, colour 4 x byte, normal 4 x byte, padding 1 DWORD - VERTEX_TYPE_PS3_TS2_CS1, // Position 3 x short, texture 2 x short, colour 4 x byte, padding 1 DWORD - VERTEX_TYPE_PF3_TF2_CB4_NB4_XW1_LIT, // as VERTEX_TYPE_PF3_TF2_CB4_NB4_XW1 with lighting applied, - VERTEX_TYPE_PF3_TF2_CB4_NB4_XW1_TEXGEN, // as VERTEX_TYPE_PF3_TF2_CB4_NB4_XW1 with tex gen - VERTEX_TYPE_COUNT - } eVertexType; - - // Pixel shader - typedef enum - { - PIXEL_SHADER_TYPE_STANDARD, - PIXEL_SHADER_TYPE_PROJECTION, - PIXEL_SHADER_TYPE_LOD_FORCE, - PIXEL_SHADER_COUNT - } ePixelShaderType; - - typedef enum - { - VIEWPORT_TYPE_FULLSCREEN, - VIEWPORT_TYPE_SPLIT_TOP, - VIEWPORT_TYPE_SPLIT_BOTTOM, - VIEWPORT_TYPE_SPLIT_LEFT, - VIEWPORT_TYPE_SPLIT_RIGHT, - VIEWPORT_TYPE_QUADRANT_TOP_LEFT, - VIEWPORT_TYPE_QUADRANT_TOP_RIGHT, - VIEWPORT_TYPE_QUADRANT_BOTTOM_LEFT, - VIEWPORT_TYPE_QUADRANT_BOTTOM_RIGHT, - } eViewportType; - - void DrawVertices(D3DPRIMITIVETYPE PrimitiveType, int count, void *dataIn, eVertexType vType, C4JRender::ePixelShaderType psType); - void DrawVertexBuffer(D3DPRIMITIVETYPE PrimitiveType, int count, IDirect3DVertexBuffer9 *buffer, C4JRender::eVertexType vType, C4JRender::ePixelShaderType psType); - - // Command buffers - void CBuffLockStaticCreations(); - int CBuffCreate(int count); - void CBuffDelete(int first, int count); - void CBuffStart(int index); - void CBuffClear(int index); - int CBuffSize(int index); - void CBuffEnd(int vertexCount); - bool CBuffCall(int index, bool full = true); - void CBuffTick(); - void CBuffDeferredModeStart(); - void CBuffDeferredModeEnd(); - - typedef enum - { - TEXTURE_FORMAT_RxGyBzAw, // Normal 32-bit RGBA texture, 8 bits per component - TEXTURE_FORMAT_R0G0B0Ax, // One 8-bit component mapped to alpha channel, R=G=B=0 - TEXTURE_FORMAT_R1G1B1Ax, // One 8-bit component mapped to alpha channel, R=G=B=1 - TEXTURE_FORMAT_RxGxBxAx, // One 8-bit component mapped to all channels - MAX_TEXTURE_FORMATS - } eTextureFormat; - - // Textures - int TextureCreate(); - void TextureFree(int idx); - void TextureBind(int idx); - void TextureBindVertex(int idx); - void TextureSetTextureLevels(int levels); - int TextureGetTextureLevels(); - void TextureData(int width, int height, void *data, int level, eTextureFormat format = TEXTURE_FORMAT_RxGyBzAw); - void TextureDataUpdate(void *data, int level); - void TextureSetParam(int param, int value); - HRESULT LoadTextureData(const char *szFilename,D3DXIMAGE_INFO *pSrcInfo, int **ppDataOut); - HRESULT LoadTextureData(BYTE *pbData, DWORD dwBytes,D3DXIMAGE_INFO *pSrcInfo, int **ppDataOut); - HRESULT SaveTextureData(const char *szFilename, D3DXIMAGE_INFO *pSrcInfo, int *ppDataOut); - void TextureGetStats(); - - // State control - void StateSetColour(float r, float g, float b, float a); - void StateSetDepthMask(bool enable); - void StateSetBlendEnable(bool enable); - void StateSetBlendFunc(int src, int dst); - void StateSetBlendFactor(unsigned int colour); - void StateSetAlphaFunc(int func, float param); - void StateSetDepthFunc(int func); - void StateSetFaceCull(bool enable); - void StateSetFaceCullCW(bool cw); - void StateSetLineWidth(float width); - void StateSetWriteEnable(bool red, bool green, bool blue, bool alpha); - void StateSetDepthTestEnable(bool enable); - void StateSetAlphaTestEnable(bool enable); - void StateSetDepthSlopeAndBias(float slope, float bias); - void StateSetFogEnable(bool enable); - void StateSetFogMode(int mode); - void StateSetFogNearDistance(float dist); - void StateSetFogFarDistance(float dist); - void StateSetFogDensity(float density); - void StateSetFogColour(float red, float green, float blue); - void StateSetLightingEnable(bool enable); - void StateSetVertexTextureUV( float u, float v); - void StateSetLightColour(int light, float red, float green, float blue); - void StateSetLightAmbientColour(float red, float green, float blue); - void StateSetLightDirection(int light, float x, float y, float z); - void StateSetLightEnable(int light, bool enable); - void StateSetViewport(eViewportType viewportType); - void StateSetEnableViewportClipPlanes(bool enable); - void StateSetTexGenCol(int col, float x, float y, float z, float w, bool eyeSpace); - void StateSetForceLOD(int LOD); -}; - +const int GL_LINES = C4JRender::PRIMITIVE_TYPE_LINE_LIST; +const int GL_LINE_STRIP = C4JRender::PRIMITIVE_TYPE_LINE_STRIP; +const int GL_QUADS = C4JRender::PRIMITIVE_TYPE_QUAD_LIST; +const int GL_TRIANGLE_FAN = C4JRender::PRIMITIVE_TYPE_TRIANGLE_FAN; +const int GL_TRIANGLE_STRIP = C4JRender::PRIMITIVE_TYPE_TRIANGLE_STRIP; // Singleton extern C4JRender RenderManager; + diff --git a/src/client/SDL/4JLibs/4J_Storage.cpp b/src/client/SDL/4JLibs/4J_Storage.cpp new file mode 100644 index 00000000..a00f8c60 --- /dev/null +++ b/src/client/SDL/4JLibs/4J_Storage.cpp @@ -0,0 +1,176 @@ +#include "C4JStorage.h" +#include +#include + +C4JStorage StorageManager; + +C4JStorage::C4JStorage() +{ + m_pStringTable = nullptr; +} + +void C4JStorage::Tick(void) +{ +} + +C4JStorage::EMessageResult C4JStorage::RequestMessageBox(unsigned int uiTitle, unsigned int uiText, unsigned int *uiOptionA, unsigned int uiOptionC, unsigned long dwPad, + int (*Func)(void*, int, const C4JStorage::EMessageResult), void* lpParam, CXuiStringTable *pStringTable, wchar_t *pwchFormatString, unsigned long dwFocusButton) +{ + return EMessage_Undefined; +} + +void C4JStorage::CancelMessageBoxRequest() +{ +} + +C4JStorage::EMessageResult C4JStorage::GetMessageBoxResult() +{ + return EMessage_Undefined; +} + +bool C4JStorage::SetSaveDevice(int (*Func)(void*, const bool), void* lpParam, bool bForceResetOfSaveDevice) +{ + return true; +} + +void C4JStorage::Init(const wchar_t* pwchDefaultSaveName, char *pszSavePackName, int iMinimumSaveSize, + int (*Func)(void*, const ESavingMessage, int), void* lpParam, const char* szGroupID) +{ +} + +void C4JStorage::ResetSaveData() +{ +} + +void C4JStorage::SetDefaultSaveNameForKeyboardDisplay(const wchar_t* pwchDefaultSaveName) {} +void C4JStorage::SetSaveTitle(const wchar_t* pwchDefaultSaveName) {} +const wchar_t* C4JStorage::GetSaveTitle() { return L""; } +bool C4JStorage::GetSaveUniqueNumber(int *piVal) { return false; } +bool C4JStorage::GetSaveUniqueFilename(char *pszName) { return false; } +void C4JStorage::SetState(ESaveGameControlState eControlState, int (*Func)(void*, const bool), void* lpParam) {} +void C4JStorage::SetSaveDisabled(bool bDisable) {} +bool C4JStorage::GetSaveDisabled(void) { return false; } +unsigned int C4JStorage::GetSaveSize() { return 0; } +void C4JStorage::GetSaveData(void *pvData, unsigned int *puiBytes) {} +void* C4JStorage::AllocateSaveData(unsigned int uiBytes) { return nullptr; } +void C4JStorage::SaveSaveData(unsigned int uiBytes, uint8_t* pbThumbnail, unsigned long cbThumbnail, uint8_t* pbTextData, unsigned long dwTextLen) {} +void C4JStorage::CopySaveDataToNewSave(uint8_t* pbThumbnail, unsigned long cbThumbnail, wchar_t *wchNewName, int (*Func)(void* lpParam, bool), void* lpParam) {} +void C4JStorage::SetSaveDeviceSelected(unsigned int uiPad, bool bSelected) {} +bool C4JStorage::GetSaveDeviceSelected(unsigned int iPad) { return false; } +C4JStorage::ELoadGameStatus C4JStorage::DoesSaveExist(bool *pbExists) { *pbExists = false; return ELoadGame_Idle; } +bool C4JStorage::EnoughSpaceForAMinSaveGame() { return true; } +void C4JStorage::SetSaveMessageVPosition(float fY) {} + +C4JStorage::ESGIStatus C4JStorage::GetSavesInfo(int iPad, bool (*Func)(void*, int, CACHEINFOSTRUCT *, int, int), void* lpParam, char *pszSavePackName) +{ + return ESGIStatus_Idle; +} + +void C4JStorage::GetSaveCacheFileInfo(unsigned long dwFile, XCONTENT_DATA &xContentData) {} +void C4JStorage::GetSaveCacheFileInfo(unsigned long dwFile, uint8_t* *ppbImageData, unsigned long *pdwImageBytes) {} + +C4JStorage::ELoadGameStatus C4JStorage::LoadSaveData(XCONTENT_DATA *pContentData, int (*Func)(void* lpParam, const bool), void* lpParam) +{ + return ELoadGame_Idle; +} + +C4JStorage::EDeleteGameStatus C4JStorage::DeleteSaveData(XCONTENT_DATA *pContentData, int (*Func)(void* lpParam, const bool), void* lpParam) +{ + return EDeleteGame_Idle; +} + +void C4JStorage::RegisterMarketplaceCountsCallback(int (*Func)(void* lpParam, C4JStorage::DLC_TMS_DETAILS *, int), void* lpParam) {} +void C4JStorage::SetDLCPackageRoot(char *pszDLCRoot) {} +C4JStorage::EDLCStatus C4JStorage::GetDLCOffers(int iPad, int (*Func)(void*, int, unsigned long, int), void* lpParam, unsigned long dwOfferTypesBitmask) +{ + return EDLC_Idle; +} + +unsigned long C4JStorage::CancelGetDLCOffers() { return 0; } +void C4JStorage::ClearDLCOffers() {} +XMARKETPLACE_CURRENCY_CONTENTOFFER_INFO& C4JStorage::GetOffer(unsigned long dw) +{ + static XMARKETPLACE_CURRENCY_CONTENTOFFER_INFO dummy; + return dummy; +} +int C4JStorage::GetOfferCount() { return 0; } +unsigned long C4JStorage::InstallOffer(int iOfferIDC, unsigned int64_t *ullOfferIDA, int (*Func)(void*, int, int), void* lpParam, bool bTrial) { return 0; } +unsigned long C4JStorage::GetAvailableDLCCount(int iPad) { return 0; } +C4JStorage::EDLCStatus C4JStorage::GetInstalledDLC(int iPad, int (*Func)(void*, int, int), void* lpParam) { return EDLC_Idle; } +XCONTENT_DATA& C4JStorage::GetDLC(unsigned long dw) { static XCONTENT_DATA dummy; return dummy; } +unsigned long C4JStorage::MountInstalledDLC(int iPad, unsigned long dwDLC, int (*Func)(void*, int, unsigned long, unsigned long), void* lpParam, const char* szMountDrive) { return 0; } +unsigned long C4JStorage::UnmountInstalledDLC(const char* szMountDrive) { return 0; } + +C4JStorage::ETMSStatus C4JStorage::ReadTMSFile(int iQuadrant, eGlobalStorage eStorageFacility, C4JStorage::eTMS_FileType eFileType, + wchar_t *pwchFilename, uint8_t **ppBuffer, unsigned long *pdwBufferSize, int (*Func)(void*, wchar_t *, int, bool, int), void* lpParam, int iAction) +{ + return ETMSStatus_Idle; +} + +bool C4JStorage::WriteTMSFile(int iQuadrant, eGlobalStorage eStorageFacility, wchar_t *pwchFilename, uint8_t *pBuffer, unsigned long dwBufferSize) +{ + return false; +} + +bool C4JStorage::DeleteTMSFile(int iQuadrant, eGlobalStorage eStorageFacility, wchar_t *pwchFilename) +{ + return false; +} + +void C4JStorage::StoreTMSPathName(wchar_t *pwchName) {} + +C4JStorage::ETMSStatus C4JStorage::TMSPP_WriteFile(int iPad, eGlobalStorage eStorageFacility, eTMS_FILETYPEVAL eFileTypeVal, + eTMS_UGCTYPE eUGCType, char *pchFilePath, char *pchBuffer, unsigned long dwBufferSize, int (*Func)(void*, int, int), void* lpParam, int iUserData) +{ + return ETMSStatus_Idle; +} + +C4JStorage::ETMSStatus C4JStorage::TMSPP_GetUserQuotaInfo(int iPad, TMSCLIENT_CALLBACK Func, void* lpParam, int iUserData) +{ + return ETMSStatus_Idle; +} + +C4JStorage::ETMSStatus C4JStorage::TMSPP_ReadFile(int iPad, eGlobalStorage eStorageFacility, eTMS_FILETYPEVAL eFileTypeVal, const char* szFilename, + int (*Func)(void*, int, int, PTMSPP_FILEDATA, const char*), void* lpParam, int iUserData) +{ + return ETMSStatus_Idle; +} + +C4JStorage::ETMSStatus C4JStorage::TMSPP_ReadFileList(int iPad, eGlobalStorage eStorageFacility, char *pchFilePath, + int (*Func)(void*, int, int, PTMSPP_FILE_LIST), void* lpParam, int iUserData) +{ + return ETMSStatus_Idle; +} + +C4JStorage::ETMSStatus C4JStorage::TMSPP_DeleteFile(int iPad, const char* szFilePath, eTMS_FILETYPEVAL eFileTypeVal, + int (*Func)(void*, int, int), void* lpParam, int iUserData) +{ + return ETMSStatus_Idle; +} + +bool C4JStorage::TMSPP_InFileList(eGlobalStorage eStorageFacility, int iPad, const std::wstring &Filename) +{ + return false; +} + +unsigned int C4JStorage::CRC(unsigned char *buf, int len) +{ + unsigned int crc = 0; + for(int i = 0; i < len; ++i) crc += buf[i]; + return crc; +} + +C4JStorage::ETMSStatus C4JStorage::TMSPP_WriteFileWithProgress(int iPad, eGlobalStorage eStorageFacility, eTMS_FILETYPEVAL eFileTypeVal, + eTMS_UGCTYPE eUGCType, char *pchFilePath, char *pchBuffer, unsigned long dwBufferSize, + int (*Func)(void*, int, int), void* lpParam, int iUserData, + int (*CompletionFunc)(void*, float), void* lpCompletionParam) +{ + return ETMSStatus_Idle; +} + +void C4JStorage::TMSPP_CancelWriteFileWithProgress(int iPad) {} + +int C4JStorage::TMSPP_SetTitleGroupID(const char* szGroupID) +{ + return S_OK; +} \ No newline at end of file diff --git a/src/client/SDL/4JLibs/4J_Storage.h b/src/client/SDL/4JLibs/4J_Storage.h index 2988dc2c..ffc07424 100644 --- a/src/client/SDL/4JLibs/4J_Storage.h +++ b/src/client/SDL/4JLibs/4J_Storage.h @@ -1,28 +1,37 @@ #pragma once -using namespace std; #include +//#include +class C4JStringTable; +#define MAX_DISPLAYNAME_LENGTH 128 // CELL_SAVEDATA_SYSP_SUBTITLE_SIZE on PS3 +#define MAX_DETAILS_LENGTH 128 // CELL_SAVEDATA_SYSP_SUBTITLE_SIZE on PS3 +#define MAX_SAVEFILENAME_LENGTH 32 // CELL_SAVEDATA_DIRNAME_SIZE -class CXuiStringTable; +typedef struct +{ + time_t modifiedTime; + unsigned int dataSize; + unsigned int thumbnailSize; +} +CONTAINER_METADATA; typedef struct { - FILETIME fTime; - XCONTENT_DATA Content; - bool bSaveIsDamaged; + char UTF8SaveFilename[MAX_SAVEFILENAME_LENGTH]; + char UTF8SaveTitle[MAX_DISPLAYNAME_LENGTH]; + CONTAINER_METADATA metaData; + uint8_t* thumbnailData; +} +SAVE_INFO,*PSAVE_INFO; + +typedef struct +{ + int iSaveC; + PSAVE_INFO SaveInfoA; } SAVE_DETAILS,*PSAVE_DETAILS; - -typedef - VOID - (CALLBACK * TMSCLIENT_PROG_CALLBACK)( - __in float progress, - __in_opt void* userCallbackData - ); - -//typedef std::vector OfferDataArray; -typedef std::vector OfferDataArray; +typedef std::vector OfferDataArray; typedef std::vector XContentDataArray; //typedef std::vector SaveDetailsArray; @@ -37,38 +46,38 @@ public: typedef struct { unsigned int uiFileSize; - DWORD dwType; - DWORD dwWchCount; // count of WCHAR in next array - WCHAR wchFile[1]; + unsigned long dwType; + unsigned long dwWchCount; // count of wchar_t in next array + wchar_t wchFile[1]; } DLC_FILE_DETAILS, *PDLC_FILE_DETAILS; typedef struct { - DWORD dwType; - DWORD dwWchCount; // count of WCHAR in next array; - WCHAR wchData[1]; // will be an array of size dwBytes + unsigned long dwType; + unsigned long dwWchCount; // count of wchar_t in next array; + wchar_t wchData[1]; // will be an array of size dwBytes } DLC_FILE_PARAM, *PDLC_FILE_PARAM; // End of DLC_Creator structs typedef struct { - WCHAR wchDisplayName[XCONTENT_MAX_DISPLAYNAME_LENGTH]; - CHAR szFileName[XCONTENT_MAX_FILENAME_LENGTH]; - DWORD dwImageOffset; - DWORD dwImageBytes; + wchar_t wchDisplayName[XCONTENT_MAX_DISPLAYNAME_LENGTH]; + char szFileName[XCONTENT_MAX_FILENAME_LENGTH]; + unsigned long dwImageOffset; + unsigned long 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 + unsigned long dwVersion; + unsigned long dwNewOffers; + unsigned long dwTotalOffers; + unsigned long dwInstalledTotalOffers; + uint8_t bPadding[1024-sizeof(unsigned long)*4]; // future expansion } DLC_TMS_DETAILS; @@ -110,6 +119,23 @@ public: ESaveGameControl_CopyingSave, }; + enum ESaveGameState + { + ESaveGame_Idle=0, + ESaveGame_Save, + ESaveGame_InternalRequestingDevice, + ESaveGame_InternalGetSaveName, + ESaveGame_InternalSaving, + ESaveGame_CopySave, + ESaveGame_CopyingSave, + ESaveGame_Load, + ESaveGame_GetSavesInfo, + ESaveGame_Rename, + ESaveGame_Delete, + + ESaveGame_GetSaveThumbnail // Not used as an actual state in the PS4, but the game expects this to be returned to indicate success when getting a thumbnail + + }; enum ELoadGameStatus { ELoadGame_Idle=0, @@ -158,14 +184,8 @@ public: { ETMSStatus_Idle=0, ETMSStatus_Fail, - ETMSStatus_ReadInProgress, - ETMSStatus_ReadFileListInProgress, - ETMSStatus_WriteInProgress, ETMSStatus_Fail_ReadInProgress, - ETMSStatus_Fail_ReadFileListInProgress, - ETMSStatus_Fail_ReadDetailsNotRetrieved, ETMSStatus_Fail_WriteInProgress, - ETMSStatus_DeleteInProgress, ETMSStatus_Pending, }; @@ -177,10 +197,10 @@ public: enum eTMS_FILETYPEVAL { - TMS_FILETYPE_BINARY=0, - TMS_FILETYPE_CONFIG=1, - TMS_FILETYPE_JSON=2, - TMS_FILETYPE_MAX, + TMS_FILETYPE_BINARY, + TMS_FILETYPE_CONFIG, + TMS_FILETYPE_JSON, + TMS_FILETYPE_MAX }; enum eTMS_UGCTYPE { @@ -189,9 +209,10 @@ public: TMS_UGCTYPE_MAX }; + typedef struct { - CHAR szFilename[256]; + char szFilename[256]; int iFileSize; eTMS_FILETYPEVAL eFileTypeVal; } @@ -206,101 +227,118 @@ public: typedef struct { - DWORD dwSize; - PBYTE pbData; + unsigned long dwSize; + uint8_t* pbData; } TMSPP_FILEDATA, *PTMSPP_FILEDATA; + C4JStorage(); void Tick(void); // Messages - C4JStorage::EMessageResult RequestMessageBox(UINT uiTitle, UINT uiText, UINT *uiOptionA,UINT uiOptionC, DWORD dwPad=XUSER_INDEX_ANY, - int( *Func)(LPVOID,int,const C4JStorage::EMessageResult)=NULL,LPVOID lpParam=NULL, CXuiStringTable *pStringTable=NULL, WCHAR *pwchFormatString=NULL,DWORD dwFocusButton=0); - void CancelMessageBoxRequest(); + C4JStorage::EMessageResult RequestMessageBox(unsigned int uiTitle, unsigned int uiText, unsigned int *uiOptionA,unsigned int uiOptionC, unsigned long dwPad=XUSER_INDEX_ANY, + int( *Func)(void*,int,const C4JStorage::EMessageResult)=NULL,void* lpParam=NULL, C4JStringTable *pStringTable=NULL, wchar_t *pwchFormatString=NULL,unsigned long dwFocusButton=0); + C4JStorage::EMessageResult GetMessageBoxResult(); // save device - bool SetSaveDevice(int( *Func)(LPVOID,const bool),LPVOID lpParam, bool bForceResetOfSaveDevice=false); + bool SetSaveDevice(int( *Func)(void*,const bool),void* lpParam, bool bForceResetOfSaveDevice=false); // savegame - void Init(LPCWSTR pwchDefaultSaveName,char *pszSavePackName,int iMinimumSaveSize, int( *Func)(LPVOID, const ESavingMessage, int),LPVOID lpParam,LPCSTR szGroupID); + void Init(unsigned int uiSaveVersion,const wchar_t* pwchDefaultSaveName,char *pszSavePackName,int iMinimumSaveSize,int( *Func)(void*, const ESavingMessage, int),void* lpParam,const char* szGroupID); void ResetSaveData(); // Call before a new save to clear out stored save file name - void SetDefaultSaveNameForKeyboardDisplay(LPCWSTR pwchDefaultSaveName); - void SetSaveTitle(LPCWSTR pwchDefaultSaveName); - LPCWSTR GetSaveTitle(); - bool GetSaveUniqueNumber(INT *piVal); + void SetDefaultSaveNameForKeyboardDisplay(const wchar_t* pwchDefaultSaveName); + void SetSaveTitle(const wchar_t* pwchDefaultSaveName); + bool GetSaveUniqueNumber(int *piVal); bool GetSaveUniqueFilename(char *pszName); - void SetState(ESaveGameControlState eControlState,int( *Func)(LPVOID,const bool),LPVOID lpParam); + void SetSaveUniqueFilename(char *szFilename); + void SetState(ESaveGameControlState eControlState,int( *Func)(void*,const bool),void* lpParam); void SetSaveDisabled(bool bDisable); bool GetSaveDisabled(void); unsigned int GetSaveSize(); void GetSaveData(void *pvData,unsigned int *puiBytes); - PVOID AllocateSaveData(unsigned int uiBytes); - void SaveSaveData(unsigned int uiBytes,PBYTE pbThumbnail=NULL,DWORD cbThumbnail=0,PBYTE pbTextData=NULL, DWORD dwTextLen=0); - void CopySaveDataToNewSave(PBYTE pbThumbnail,DWORD cbThumbnail,WCHAR *wchNewName,int ( *Func)(LPVOID lpParam, bool), LPVOID lpParam); + void* AllocateSaveData(unsigned int uiBytes); + void SetSaveImages( uint8_t* pbThumbnail,unsigned long dwThumbnailBytes,uint8_t* pbImage,unsigned long dwImageBytes, uint8_t* pbTextData ,unsigned long dwTextDataBytes); // 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(uint8_t* pbThumbnail,unsigned long cbThumbnail,wchar_t *wchNewName,int ( *Func)(void* lpParam, bool), void* lpParam); void SetSaveDeviceSelected(unsigned int uiPad,bool bSelected); bool GetSaveDeviceSelected(unsigned int iPad); - C4JStorage::ELoadGameStatus DoesSaveExist(bool *pbExists); + C4JStorage::ESaveGameState DoesSaveExist(bool *pbExists); bool EnoughSpaceForAMinSaveGame(); void SetSaveMessageVPosition(float fY); // The 'Saving' message will display at a default position unless changed // Get the info for the saves - C4JStorage::ESGIStatus GetSavesInfo(int iPad,bool ( *Func)(LPVOID, int, CACHEINFOSTRUCT *, int, HRESULT),LPVOID lpParam,char *pszSavePackName); + C4JStorage::ESaveGameState GetSavesInfo(int iPad,int ( *Func)(void* lpParam,SAVE_DETAILS *pSaveDetails,const bool),void* lpParam,char *pszSavePackName); + PSAVE_DETAILS ReturnSavesInfo(); + void ClearSavesInfo(); // Clears results + C4JStorage::ESaveGameState LoadSaveDataThumbnail(PSAVE_INFO pSaveInfo,int( *Func)(void* lpParam,uint8_t* pbThumbnail,unsigned long dwThumbnailBytes), 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 long dwFile,XCONTENT_DATA &xContentData); + void GetSaveCacheFileInfo(unsigned long dwFile, uint8_t* *ppbImageData, unsigned long *pdwImageBytes); // Load the save. Need to call GetSaveData once the callback is called - C4JStorage::ELoadGameStatus LoadSaveData(XCONTENT_DATA *pContentData,int( *Func)(LPVOID lpParam,const bool), LPVOID lpParam); - C4JStorage::EDeleteGameStatus DeleteSaveData(XCONTENT_DATA *pContentData,int( *Func)(LPVOID lpParam,const bool), LPVOID lpParam); + C4JStorage::ESaveGameState LoadSaveData(PSAVE_INFO pSaveInfo,int( *Func)(void* lpParam,const bool, const bool), void* lpParam); + C4JStorage::ESaveGameState DeleteSaveData(PSAVE_INFO pSaveInfo,int( *Func)(void* lpParam,const bool), void* lpParam); // DLC - void RegisterMarketplaceCountsCallback(int ( *Func)(LPVOID lpParam, C4JStorage::DLC_TMS_DETAILS *, int), LPVOID lpParam ); + void RegisterMarketplaceCountsCallback(int ( *Func)(void* lpParam, C4JStorage::DLC_TMS_DETAILS *, int), void* lpParam ); void SetDLCPackageRoot(char *pszDLCRoot); - C4JStorage::EDLCStatus GetDLCOffers(int iPad,int( *Func)(LPVOID, int, DWORD, int),LPVOID lpParam, DWORD dwOfferTypesBitmask=XMARKETPLACE_OFFERING_TYPE_CONTENT); - DWORD CancelGetDLCOffers(); + C4JStorage::EDLCStatus GetDLCOffers(int iPad,int( *Func)(void*, int, unsigned long, int),void* lpParam, unsigned long dwOfferTypesBitmask=XMARKETPLACE_OFFERING_TYPE_CONTENT); + unsigned long CancelGetDLCOffers(); void ClearDLCOffers(); - //XMARKETPLACE_CONTENTOFFER_INFO& GetOffer(DWORD dw); - XMARKETPLACE_CURRENCY_CONTENTOFFER_INFO& GetOffer(DWORD dw); + XMARKETPLACE_CONTENTOFFER_INFO& GetOffer(unsigned long dw); int GetOfferCount(); - DWORD InstallOffer(int iOfferIDC,unsigned __int64 *ullOfferIDA,int( *Func)(LPVOID, int, int),LPVOID lpParam, bool bTrial=false); - DWORD GetAvailableDLCCount( int iPad); + unsigned long InstallOffer(int iOfferIDC, uint64_t *ullOfferIDA,int( *Func)(void*, int, int),void* lpParam, bool bTrial=false); + unsigned long GetAvailableDLCCount( int iPad); - C4JStorage::EDLCStatus GetInstalledDLC(int iPad,int( *Func)(LPVOID, int, int),LPVOID lpParam); - XCONTENT_DATA& GetDLC(DWORD dw); - DWORD MountInstalledDLC(int iPad,DWORD dwDLC,int( *Func)(LPVOID, int, DWORD,DWORD),LPVOID lpParam,LPCSTR szMountDrive=NULL); - DWORD UnmountInstalledDLC(LPCSTR szMountDrive=NULL); + C4JStorage::EDLCStatus GetInstalledDLC(int iPad,int( *Func)(void*, int, int),void* lpParam); + XCONTENT_DATA& GetDLC(unsigned long dw); + unsigned long MountInstalledDLC(int iPad,unsigned long dwDLC,int( *Func)(void*, int, unsigned long,unsigned long),void* lpParam,const char* szMountDrive=NULL); + unsigned long UnmountInstalledDLC(const char* szMountDrive = NULL); + void GetMountedDLCFileList(const char* szMountDrive, std::vector& fileList); + std::string GetMountedPath(std::string szMount); // Global title storage C4JStorage::ETMSStatus ReadTMSFile(int iQuadrant,eGlobalStorage eStorageFacility,C4JStorage::eTMS_FileType eFileType, - WCHAR *pwchFilename,BYTE **ppBuffer,DWORD *pdwBufferSize,int( *Func)(LPVOID, WCHAR *,int, bool, int)=NULL,LPVOID lpParam=NULL, int iAction=0); - bool WriteTMSFile(int iQuadrant,eGlobalStorage eStorageFacility,WCHAR *pwchFilename,BYTE *pBuffer,DWORD dwBufferSize); - bool DeleteTMSFile(int iQuadrant,eGlobalStorage eStorageFacility,WCHAR *pwchFilename); - void StoreTMSPathName(WCHAR *pwchName=NULL); + wchar_t *pwchFilename,uint8_t **ppBuffer,unsigned long *pdwBufferSize,int( *Func)(void*, wchar_t *,int, bool, int)=NULL,void* lpParam=NULL, int iAction=0); + bool WriteTMSFile(int iQuadrant,eGlobalStorage eStorageFacility,wchar_t *pwchFilename,uint8_t *pBuffer,unsigned long dwBufferSize); + bool DeleteTMSFile(int iQuadrant,eGlobalStorage eStorageFacility,wchar_t *pwchFilename); + void StoreTMSPathName(wchar_t *pwchName=NULL); // TMS++ - C4JStorage::ETMSStatus TMSPP_WriteFile(int iPad,C4JStorage::eGlobalStorage eStorageFacility,C4JStorage::eTMS_FILETYPEVAL eFileTypeVal,C4JStorage::eTMS_UGCTYPE eUGCType,CHAR *pchFilePath,CHAR *pchBuffer,DWORD dwBufferSize,int( *Func)(LPVOID,int,int)=NULL,LPVOID lpParam=NULL, int iUserData=0); - C4JStorage::ETMSStatus TMSPP_GetUserQuotaInfo(int iPad,TMSCLIENT_CALLBACK Func,LPVOID lpParam, int iUserData=0); - C4JStorage::ETMSStatus TMSPP_ReadFile(int iPad,C4JStorage::eGlobalStorage eStorageFacility,C4JStorage::eTMS_FILETYPEVAL eFileTypeVal,LPCSTR szFilename,int( *Func)(LPVOID,int,int,PTMSPP_FILEDATA, LPCSTR)=NULL,LPVOID lpParam=NULL, int iUserData=0); - C4JStorage::ETMSStatus TMSPP_ReadFileList(int iPad,C4JStorage::eGlobalStorage eStorageFacility,CHAR *pchFilePath,int( *Func)(LPVOID,int,int,PTMSPP_FILE_LIST)=NULL,LPVOID lpParam=NULL, int iUserData=0); - C4JStorage::ETMSStatus TMSPP_DeleteFile(int iPad,LPCSTR szFilePath,C4JStorage::eTMS_FILETYPEVAL eFileTypeVal,int( *Func)(LPVOID,int,int),LPVOID lpParam=NULL, int iUserData=0); - bool TMSPP_InFileList(eGlobalStorage eStorageFacility, int iPad,const wstring &Filename); +#ifdef _XBOX + C4JStorage::ETMSStatus WriteTMSFile(int iPad,C4JStorage::eGlobalStorage eStorageFacility,C4JStorage::eTMS_FileType eFileType,char *pchFilePath,char *pchBuffer,unsigned long dwBufferSize,TMSCLIENT_CALLBACK Func,void* lpParam); + int GetUserQuotaInfo(int iPad,TMSCLIENT_CALLBACK Func,void* lpParam); +#endif + + // C4JStorage::ETMSStatus TMSPP_WriteFile(int iPad,C4JStorage::eGlobalStorage eStorageFacility,C4JStorage::eTMS_FILETYPEVAL eFileTypeVal,C4JStorage::eTMS_UGCTYPE eUGCType,char *pchFilePath,char *pchBuffer,unsigned long dwBufferSize,int( *Func)(void*,int,int)=NULL,void* lpParam=NULL, int iUserData=0); + // C4JStorage::ETMSStatus TMSPP_GetUserQuotaInfo(int iPad,TMSCLIENT_CALLBACK Func,void* lpParam, int iUserData=0); + C4JStorage::ETMSStatus TMSPP_ReadFile(int iPad,C4JStorage::eGlobalStorage eStorageFacility,C4JStorage::eTMS_FILETYPEVAL eFileTypeVal,const char* szFilename,int( *Func)(void*,int,int,PTMSPP_FILEDATA, const char*)=NULL,void* lpParam=NULL, int iUserData=0); + // C4JStorage::ETMSStatus TMSPP_ReadFileList(int iPad,C4JStorage::eGlobalStorage eStorageFacility,char *pchFilePath,int( *Func)(void*,int,int,PTMSPP_FILE_LIST)=NULL,void* lpParam=NULL, int iUserData=0); + // C4JStorage::ETMSStatus TMSPP_DeleteFile(int iPad,const char* szFilePath,C4JStorage::eTMS_FILETYPEVAL eFileTypeVal,int( *Func)(void*,int,int),void* lpParam=NULL, int iUserData=0); + // bool TMSPP_InFileList(eGlobalStorage eStorageFacility, int iPad,const wstring &Filename); + // unsigned int CRC(unsigned char *buf, int len); + +// enum eXBLWS +// { +// eXBLWS_GET, +// eXBLWS_POST, +// eXBLWS_PUT, +// eXBLWS_DELETE, +// }; + //bool XBLWS_Command(eXBLWS eCommand); + + unsigned int CRC(unsigned char *buf, int len); - C4JStorage::ETMSStatus TMSPP_WriteFileWithProgress(int iPad,C4JStorage::eGlobalStorage eStorageFacility,C4JStorage::eTMS_FILETYPEVAL eFileTypeVal,C4JStorage::eTMS_UGCTYPE eUGCType,CHAR *pchFilePath,CHAR *pchBuffer,DWORD dwBufferSize,int( *Func)(LPVOID,int,int)=NULL,LPVOID lpParam=NULL, int iUserData=0, - int( *CompletionFunc)(LPVOID,float fComplete)=NULL,LPVOID lpCompletionParam=NULL); - void TMSPP_CancelWriteFileWithProgress(int iPad); - - HRESULT TMSPP_SetTitleGroupID(LPCSTR szGroupID); - // #ifdef _DEBUG // void SetSaveName(int i); // #endif // string table for all the Storage problems. Loaded by the application - CXuiStringTable *m_pStringTable; + C4JStringTable *m_pStringTable; }; extern C4JStorage StorageManager; diff --git a/src/client/SDL/4JLibs/4J_xtms.h b/src/client/SDL/4JLibs/4J_xtms.h deleted file mode 100644 index ea35da4b..00000000 --- a/src/client/SDL/4JLibs/4J_xtms.h +++ /dev/null @@ -1,55 +0,0 @@ -/*++ - -Copyright (c) Microsoft Corporation. All rights reserved. - -Module Name: - - xsgx_xtms.h - ---*/ -#include "xtms.h" - -#pragma once - -#if defined(__cplusplus) -extern "C" { -#endif - -#ifndef XSGX_MOD1 - -typedef -VOID -(CALLBACK * TMSCLIENT_PROG_CALLBACK)( - __in float progress, - __in_opt void* userCallbackData - ); - - -XBOXAPI -HRESULT -WINAPI -XSGX_XTmsPutUserFile( - __in HTMSCLIENT tmsClient, - __in XUID xuid, - __in_z LPCSTR filePath, - __in_z LPCSTR fileType, - __in_z LPCSTR displayName, - __in_z LPCSTR ugcContentType, - __in_bcount(fileSize) CONST CHAR* fileBuffer, - __in DWORD fileSize, - __in_opt DWORD bufferSize, - __in_z_opt LPCSTR etag, - __in ETAGFLAG etagFlag, - __in TMSCLIENT_CALLBACK clientCallback, - __in_opt PVOID userCallbackData, - __in TMSCLIENT_PROG_CALLBACK clientProgCallback, - __in_opt PVOID progCallbackData - ); - -void XSGX_XTmsCancelPutUserFile(__in HTMSCLIENT tmsClient); - -#endif - -#if defined(__cplusplus) -} -#endif diff --git a/src/client/SDL/Sentient/DynamicConfigurations.h b/src/client/SDL/Sentient/DynamicConfigurations.h new file mode 100644 index 00000000..1119122f --- /dev/null +++ b/src/client/SDL/Sentient/DynamicConfigurations.h @@ -0,0 +1,68 @@ +#pragma once + +// 4J Stu - This file defines the id's for the dynamic configurations that we are currently using +// as well as the format of the data in them + +/*********************** +* +* TRIAL TIMER +* +************************/ + +#define DYNAMIC_CONFIG_TRIAL_ID 0 +#define DYNAMIC_CONFIG_TRIAL_VERSION 1 +#define DYNAMIC_CONFIG_DEFAULT_TRIAL_TIME 2400 //40 mins 1200 // 20 mins //300; // 5 minutes + +class MinecraftDynamicConfigurations +{ +private: + enum EDynamic_Configs + { + eDynamic_Config_Trial, + + eDynamic_Config_Max, + }; + + /*********************** + * + * TRIAL TIMER + * + ************************/ + + // 4J Stu - The first 4 bytes define a version number, that defines the structure of the data + // After reading those bytes into a unsigned long, the remainder of the data should be the size of the + // relevant struct and can be cast to the struct + struct _dynamic_config_trial_data_version1 + { + // The time in seconds that the player can play the trial for + unsigned long trialTimeSeconds; + + _dynamic_config_trial_data_version1() { trialTimeSeconds = DYNAMIC_CONFIG_DEFAULT_TRIAL_TIME; } + }; + + typedef _dynamic_config_trial_data_version1 Dynamic_Config_Trial_Data; + + // Stored configurations + static Dynamic_Config_Trial_Data trialData; + + static bool s_bFirstUpdateStarted; + static bool s_bUpdatedConfigs[eDynamic_Config_Max]; + static EDynamic_Configs s_eCurrentConfig; + static size_t s_currentConfigSize; + + static size_t s_dataWrittenSize; + static byte *s_dataWritten; + +public: + static void Tick(); + + static unsigned long GetTrialTime(); + +private: + static void UpdateAllConfigurations(); + static void UpdateNextConfiguration(); + static void UpdateConfiguration(EDynamic_Configs id); + + static void GetSizeCompletedCallback(int taskResult, void *userCallbackData); + static void GetDataCompletedCallback(int taskResult, void *userCallbackData); +}; \ No newline at end of file diff --git a/src/client/SDL/Sentient/MinecraftTelemetry.h b/src/client/SDL/Sentient/MinecraftTelemetry.h new file mode 100644 index 00000000..26ef1092 --- /dev/null +++ b/src/client/SDL/Sentient/MinecraftTelemetry.h @@ -0,0 +1,3 @@ +#include "SentientTelemetryCommon.h" +#include "TelemetryEnum.h" +#include "SentientStats.h" \ No newline at end of file diff --git a/src/client/SDL/Sentient/SentientManager.h b/src/client/SDL/Sentient/SentientManager.h new file mode 100644 index 00000000..2e6dd443 --- /dev/null +++ b/src/client/SDL/Sentient/SentientManager.h @@ -0,0 +1,83 @@ +#pragma once +#include "MinecraftTelemetry.h" + +class CSentientManager +{ +public: + enum ETelemetryEvent + { + eTelemetry_PlayerSessionStart, + eTelemetry_PlayerSessionExit, + eTelemetry_HeartBeat, + eTelemetry_LevelStart, + eTelemetry_LevelExit, + eTelemetry_LevelSaveOrCheckpoint, + eTelemetry_PauseOrInactive, + eTelemetry_UnpauseOrActive, + eTelemetry_MenuShown, + eTelemetry_AchievementUnlocked, + eTelemetry_MediaShareUpload, + eTelemetry_UpsellPresented, + eTelemetry_UpsellResponded, + eTelemetry_PlayerDiedOrFailed, + eTelemetry_EnemyKilledOrOvercome, + }; + + int Init(); + int Tick(); + + int Flush(); + + bool RecordPlayerSessionStart(unsigned long dwUserId); + bool RecordPlayerSessionExit(unsigned long dwUserId, int exitStatus); + bool RecordHeartBeat(unsigned long dwUserId); + bool RecordLevelStart(unsigned long dwUserId, ESen_FriendOrMatch friendsOrMatch, ESen_CompeteOrCoop competeOrCoop, int difficulty, unsigned long numberOfLocalPlayers, unsigned long numberOfOnlinePlayers); + bool RecordLevelExit(unsigned long dwUserId, ESen_LevelExitStatus levelExitStatus); + bool RecordLevelSaveOrCheckpoint(unsigned long dwUserId, int saveOrCheckPointID, int saveSizeInBytes); + bool RecordLevelResume(unsigned long dwUserId, ESen_FriendOrMatch friendsOrMatch, ESen_CompeteOrCoop competeOrCoop, int difficulty, unsigned long numberOfLocalPlayers, unsigned long numberOfOnlinePlayers, int saveOrCheckPointID); + bool RecordPauseOrInactive(unsigned long dwUserId); + bool RecordUnpauseOrActive(unsigned long dwUserId); + bool RecordMenuShown(unsigned long dwUserId, int menuID, int optionalMenuSubID); + bool RecordAchievementUnlocked(unsigned long dwUserId, int achievementID, int achievementGamerscore); + bool RecordMediaShareUpload(unsigned long dwUserId, ESen_MediaDestination mediaDestination, ESen_MediaType mediaType); + bool RecordUpsellPresented(unsigned long dwUserId, ESen_UpsellID upsellId, int marketplaceOfferID); + bool RecordUpsellResponded(unsigned long dwUserId, ESen_UpsellID upsellId, int marketplaceOfferID, ESen_UpsellOutcome upsellOutcome); + bool RecordPlayerDiedOrFailed(unsigned long dwUserId, int lowResMapX, int lowResMapY, int lowResMapZ, int mapID, int playerWeaponID, int enemyWeaponID, ETelemetryChallenges enemyTypeID); + bool RecordEnemyKilledOrOvercome(unsigned long dwUserId, int lowResMapX, int lowResMapY, int lowResMapZ, int mapID, int playerWeaponID, int enemyWeaponID, ETelemetryChallenges enemyTypeID); + + bool RecordSkinChanged(unsigned long dwUserId, unsigned long dwSkinId); + bool RecordBanLevel(unsigned long dwUserId); + bool RecordUnBanLevel(unsigned long dwUserId); + + int GetMultiplayerInstanceID(); + int GenerateMultiplayerInstanceId(); + void SetMultiplayerInstanceId(int value); + +private: + float m_initialiseTime; + float m_lastHeartbeat; + bool m_bFirstFlush; + + float m_fLevelStartTime[XUSER_MAX_COUNT]; + + int m_multiplayerInstanceID; + unsigned long m_levelInstanceID; + + // Helper functions to get the various common settings + int GetSecondsSinceInitialize(); + int GetMode(unsigned long dwUserId); + int GetSubMode(unsigned long dwUserId); + int GetLevelId(unsigned long dwUserId); + int GetSubLevelId(unsigned long dwUserId); + int GetTitleBuildId(); + int GetLevelInstanceID(); + int GetSingleOrMultiplayer(); + int GetDifficultyLevel(int diff); + int GetLicense(); + int GetDefaultGameControls(); + int GetAudioSettings(unsigned long dwUserId); + int GetLevelExitProgressStat1(); + int GetLevelExitProgressStat2(); +}; + +extern CSentientManager SentientManager; \ No newline at end of file diff --git a/src/client/SDL/Sentient/SentientStats.h b/src/client/SDL/Sentient/SentientStats.h new file mode 100644 index 00000000..69d67c82 --- /dev/null +++ b/src/client/SDL/Sentient/SentientStats.h @@ -0,0 +1,88 @@ +/************************************************************************/ +/* THIS FILE WAS AUTOMATICALLY GENERATED */ +/* PLEASE DO NOT MODIFY */ +/************************************************************************/ +// Generated from Version: 20, on (6/19/2012 9:21:23 AM) + +#pragma once + +/************************************************************************/ +/* STATS */ +/************************************************************************/ + +// PlayerSessionStart +// Player signed in or joined +bool SenStatPlayerSessionStart ( unsigned long dwUserID, int SecondsSinceInitialize, int ModeID, int OptionalSubModeID, int LevelID, int OptionalSubLevelID, int TitleBuildID, int SkeletonDistanceInInches, int EnrollmentType, int NumberOfSkeletonsInView ); + +// PlayerSessionExit +// Player signed out or left +bool SenStatPlayerSessionExit ( unsigned long dwUserID, int SecondsSinceInitialize, int ModeID, int OptionalSubModeID, int LevelID, int OptionalSubLevelID ); + +// HeartBeat +// Sent every 60 seconds by title +bool SenStatHeartBeat ( unsigned long dwUserID, int SecondsSinceInitialize ); + +// LevelStart +// Level started +bool SenStatLevelStart ( unsigned long dwUserID, int SecondsSinceInitialize, int ModeID, int OptionalSubModeID, int LevelID, int OptionalSubLevelID, int LevelInstanceID, int MultiplayerInstanceID, int SingleOrMultiplayer, int FriendsOrMatch, int CompeteOrCoop, int DifficultyLevel, int NumberOfLocalPlayers, int NumberOfOnlinePlayers, int License, int DefaultGameControls, int AudioSettings, int SkeletonDistanceInInches, int NumberOfSkeletonsInView ); + +// LevelExit +// Level exited +bool SenStatLevelExit ( unsigned long dwUserID, int SecondsSinceInitialize, int ModeID, int OptionalSubModeID, int LevelID, int OptionalSubLevelID, int LevelInstanceID, int MultiplayerInstanceID, int LevelExitStatus, int LevelExitProgressStat1, int LevelExitProgressStat2, int LevelDurationInSeconds ); + +// LevelSaveOrCheckpoint +// Level saved explicitly or implicitly +bool SenStatLevelSaveOrCheckpoint ( unsigned long dwUserID, int SecondsSinceInitialize, int ModeID, int OptionalSubModeID, int LevelID, int OptionalSubLevelID, int LevelInstanceID, int MultiplayerInstanceID, int LevelExitProgressStat1, int LevelExitProgressStat2, int LevelDurationInSeconds, int SaveOrCheckPointID ); + +// LevelResume +// Level resumed from a save or restarted at a checkpoint +bool SenStatLevelResume ( unsigned long dwUserID, int SecondsSinceInitialize, int ModeID, int OptionalSubModeID, int LevelID, int OptionalSubLevelID, int LevelInstanceID, int MultiplayerInstanceID, int SingleOrMultiplayer, int FriendsOrMatch, int CompeteOrCoop, int DifficultyLevel, int NumberOfLocalPlayers, int NumberOfOnlinePlayers, int License, int DefaultGameControls, int SaveOrCheckPointID, int AudioSettings, int SkeletonDistanceInInches, int NumberOfSkeletonsInView ); + +// PauseOrInactive +// Player paused game or has become inactive, level and mode are for what the player is leaving +bool SenStatPauseOrInactive ( unsigned long dwUserID, int SecondsSinceInitialize, int ModeID, int OptionalSubModeID, int LevelID, int OptionalSubLevelID, int LevelInstanceID, int MultiplayerInstanceID ); + +// UnpauseOrActive +// Player unpaused game or has become active, level and mode are for what the player is entering into +bool SenStatUnpauseOrActive ( unsigned long dwUserID, int SecondsSinceInitialize, int ModeID, int OptionalSubModeID, int LevelID, int OptionalSubLevelID, int LevelInstanceID, int MultiplayerInstanceID ); + +// MenuShown +// A menu screen or major menu area has been shown +bool SenStatMenuShown ( unsigned long dwUserID, int SecondsSinceInitialize, int ModeID, int OptionalSubModeID, int LevelID, int OptionalSubLevelID, int MenuID, int OptionalMenuSubID, int LevelInstanceID, int MultiplayerInstanceID ); + +// AchievementUnlocked +// An achievement was unlocked +bool SenStatAchievementUnlocked ( unsigned long dwUserID, int SecondsSinceInitialize, int ModeID, int OptionalSubModeID, int LevelID, int OptionalSubLevelID, int LevelInstanceID, int MultiplayerInstanceID, int AchievementID, int AchievementGamerscore ); + +// MediaShareUpload +// The user uploaded something to Kinect Share +bool SenStatMediaShareUpload ( unsigned long dwUserID, int SecondsSinceInitialize, int ModeID, int OptionalSubModeID, int LevelID, int OptionalSubLevelID, int LevelInstanceID, int MultiplayerInstanceID, int MediaDestination, int MediaType ); + +// UpsellPresented +// The user is shown an upsell to purchase something +bool SenStatUpsellPresented ( unsigned long dwUserID, int SecondsSinceInitialize, int ModeID, int OptionalSubModeID, int LevelID, int OptionalSubLevelID, int LevelInstanceID, int MultiplayerInstanceID, int UpsellID, int MarketplaceOfferID ); + +// UpsellResponded +// The user responded to the upsell +bool SenStatUpsellResponded ( unsigned long dwUserID, int SecondsSinceInitialize, int ModeID, int OptionalSubModeID, int LevelID, int OptionalSubLevelID, int LevelInstanceID, int MultiplayerInstanceID, int UpsellID, int MarketplaceOfferID, int UpsellOutcome ); + +// PlayerDiedOrFailed +// The player died or failed a challenge - can be used for many types of failure +bool SenStatPlayerDiedOrFailed ( unsigned long dwUserID, int ModeID, int OptionalSubModeID, int LevelID, int OptionalSubLevelID, int LevelInstanceID, int MultiplayerInstanceID, int LowResMapX, int LowResMapY, int LowResMapZ, int MapID, int PlayerWeaponID, int EnemyWeaponID, int EnemyTypeID, int SecondsSinceInitialize, int CopyOfSecondsSinceInitialize ); + +// EnemyKilledOrOvercome +// The player killed an enemy or overcame or solved a major challenge +bool SenStatEnemyKilledOrOvercome ( unsigned long dwUserID, int ModeID, int OptionalSubModeID, int LevelID, int OptionalSubLevelID, int LevelInstanceID, int MultiplayerInstanceID, int LowResMapX, int LowResMapY, int LowResMapZ, int MapID, int PlayerWeaponID, int EnemyWeaponID, int EnemyTypeID, int SecondsSinceInitialize, int CopyOfSecondsSinceInitialize ); + +// SkinChanged +// The player has changed their skin, level and mode are for what the player is currently in +bool SenStatSkinChanged ( unsigned long dwUserID, int SecondsSinceInitialize, int ModeID, int OptionalSubModeID, int LevelID, int OptionalSubLevelID, int LevelInstanceID, int MultiplayerInstanceID, int SkinID ); + +// BanLevel +// The player has banned a level, level and mode are for what the player is currently in and banning +bool SenStatBanLevel ( unsigned long dwUserID, int SecondsSinceInitialize, int ModeID, int OptionalSubModeID, int LevelID, int OptionalSubLevelID, int LevelInstanceID, int MultiplayerInstanceID ); + +// UnBanLevel +// The player has ubbanned a level, level and mode are for what the player is currently in and unbanning +bool SenStatUnBanLevel ( unsigned long dwUserID, int SecondsSinceInitialize, int ModeID, int OptionalSubModeID, int LevelID, int OptionalSubLevelID, int LevelInstanceID, int MultiplayerInstanceID ); + diff --git a/src/client/SDL/Sentient/SentientTelemetryCommon.h b/src/client/SDL/Sentient/SentientTelemetryCommon.h new file mode 100644 index 00000000..0b9c0e87 --- /dev/null +++ b/src/client/SDL/Sentient/SentientTelemetryCommon.h @@ -0,0 +1,190 @@ +#pragma once +// 4J Stu - Enums as defined by the common Sentient telemetry format + +//################################## +// DO NOT CHANGE ANY OF THESE VALUES +//################################## + + +/************************************* + AudioSettings + ************************************* + Are players changing default audio settings? + */ +enum ESen_AudioSettings +{ + eSen_AudioSettings_Undefined = 0, + eSen_AudioSettings_Off = 1, + eSen_AudioSettings_On_Default = 2, + eSen_AudioSettings_On_CustomSetting = 3, +}; + +/************************************* + CompeteOrCoop + ************************************* + Indicates whether players are playing a cooperative mode or a competitive mode. + */ +enum ESen_CompeteOrCoop +{ + eSen_CompeteOrCoop_Undefined = 0, + eSen_CompeteOrCoop_Cooperative = 1, + eSen_CompeteOrCoop_Competitive = 2, + eSen_CompeteOrCoop_Coop_and_Competitive = 3, +}; + +/************************************* + DefaultGameControls + ************************************* + This is intended to capture whether players played using default control scheme or customized the control scheme. + */ +enum ESen_DefaultGameControls +{ + eSen_DefaultGameControls_Undefined = 0, + eSen_DefaultGameControls_Default_controls = 1, + eSen_DefaultGameControls_Custom_controls = 2, +}; + +/************************************* + DifficultyLevel + ************************************* + An in-game setting that differentiates the challenge imposed on the user. Normalized to a standard 5-point scale. + */ +enum ESen_DifficultyLevel +{ + eSen_DifficultyLevel_Undefined = 0, + eSen_DifficultyLevel_Easiest = 1, + eSen_DifficultyLevel_Easier = 2, + eSen_DifficultyLevel_Normal = 3, + eSen_DifficultyLevel_Harder = 4, + eSen_DifficultyLevel_Hardest = 5, +}; + +/************************************* + GameInputType + ************************************* + Used to determine the different modes of input used in the game. For gamepad/keyboard/mouse usage, it is not necessary to call this for every single input. + Also, if polling is used, calling this event occasionally may also work. + */ +enum ESen_GameInputType +{ + eSen_GameInputType_Undefined = 0, + eSen_GameInputType_Xbox_Controller = 1, + eSen_GameInputType_Gesture = 2, + eSen_GameInputType_Voice = 3, + eSen_GameInputType_Voice_and_Gesture_Together = 4, + eSen_GameInputType_Touch = 5, + eSen_GameInputType_Keyboard = 6, + eSen_GameInputType_Mouse = 7, +}; + +/************************************* + LevelExitStatus + ************************************* + Indicates whether the player successfully completed the level. Critical for understanding the difficulty of a game with checkpoints or saves. + */ +enum ESen_LevelExitStatus +{ + eSen_LevelExitStatus_Undefined = 0, + eSen_LevelExitStatus_Exited = 1, + eSen_LevelExitStatus_Succeeded = 2, + eSen_LevelExitStatus_Failed = 3, +}; + +/************************************* + License + ************************************* + Differentiates trial/demo from full purchased titles + */ +enum ESen_License +{ + eSen_License_Undefined = 0, + eSen_License_Trial_or_Demo = 1, + eSen_License_Full_Purchased_Title = 2, +}; + +/************************************* + MediaDestination + ************************************* + Tracks where media is uploaded to (like facebook) + */ +enum ESen_MediaDestination +{ + ESen_MediaDestination_Undefined = 0, + ESen_MediaDestination_Kinect_Share = 1, + ESen_MediaDestination_Facebook = 2, + ESen_MediaDestination_YouTube = 3, + ESen_MediaDestination_Other = 4 +}; + +/************************************* + MediaType + ************************************* + Used to capture the type of media players are uploading to KinectShare + */ +enum ESen_MediaType +{ + eSen_MediaType_Undefined = 0, + eSen_MediaType_Picture = 1, + eSen_MediaType_Video = 2, + eSen_MediaType_Other_UGC = 3, +}; + +/************************************* + SingleOrMultiplayer + ************************************* + Indicates whether the game is being played in single or multiplayer mode and whether multiplayer is being played locally or over live. + */ +enum ESen_SingleOrMultiplayer +{ + eSen_SingleOrMultiplayer_Undefined = 0, + eSen_SingleOrMultiplayer_Single_Player = 1, + eSen_SingleOrMultiplayer_Multiplayer_Local = 2, + eSen_SingleOrMultiplayer_Multiplayer_Live = 3, + eSen_SingleOrMultiplayer_Multiplayer_Both_Local_and_Live = 4, +}; + +/************************************* + FriendOrMatch + ************************************* + Are players playing with friends or were they matched? + */ +enum ESen_FriendOrMatch +{ + eSen_FriendOrMatch_Undefined = 0, // (use if a single player game) + eSen_FriendOrMatch_Playing_With_Invited_Friends = 1, + eSen_FriendOrMatch_Playing_With_Match_Made_Opponents = 2, + eSen_FriendOrMatch_Playing_With_Both_Friends_And_Matched_Opponents = 3, + eSen_FriendOrMatch_Joined_Through_An_Xbox_Live_Party = 4, + eSen_FriendOrMatch_Joined_Through_An_In_Game_Party = 5, +}; + +/************************************* + UpsellID + ************************************* + Which upsell has been presented? + */ +enum ESen_UpsellID +{ + eSen_UpsellID_Undefined = 0, + eSen_UpsellID_Full_Version_Of_Game = 1, + + // Added TU3 + eSet_UpsellID_Skin_DLC = 2, + eSet_UpsellID_Texture_DLC = 3, + + //2-max= Up to game +}; + +/************************************* + UpsellOutcome + ************************************* + What was the outcome of the upsell? + */ +enum ESen_UpsellOutcome +{ + eSen_UpsellOutcome_Undefined = 0, + eSen_UpsellOutcome_Accepted = 1, + eSen_UpsellOutcome_Declined = 2, + eSen_UpsellOutcome_Went_To_Guide = 3, + eSen_UpsellOutcome_Other = 4, +}; diff --git a/src/client/SDL/Sentient/TelemetryEnum.h b/src/client/SDL/Sentient/TelemetryEnum.h new file mode 100644 index 00000000..77d39a39 --- /dev/null +++ b/src/client/SDL/Sentient/TelemetryEnum.h @@ -0,0 +1,229 @@ +#pragma once + +/* +AchievementGamerscore Value in gamerscore of the achievement +AchievementID ID of achievement unlocked +EnemyTypeID What type of enemy or challenge was the player facing? To prevent data-loss by overflowing the buffer, we recommend enemy type. +EnemyWeaponID What weapon the enemy is holding or what counter/AI the enemy is taking to overcome a challenge +EnrollmentType How did players enroll? (Using Kinect) +LandscapeOrPortrait Are you currently showing in landscape or portrait mode? (Win8 only) +LevelDurationInSeconds How long, total, has the user been playing in this level - whatever best represents this duration for attempting the level you'd like to track. +LevelExitProgressStat1 Refers to the highest level performance metric for your game.  For example, a performance metric could points earned, race time, total kills, etc. This is entirely up to you and will help us understand how well the player performed, or how far the player progressed  in the level before exiting. +LevelExitProgressStat2 Refers to the highest level performance metric for your game.  For example, a performance metric could points earned, race time, total kills, etc. This is entirely up to you and will help us understand how well the player performed, or how far the player progressed  in the level before exiting. +LevelID This is a more granular view of mode, allowing teams to get a sense of the levels or maps players are playing and providing some insight into how players progress through a game. Teams will have to provide the game mappings that correspond to the integers. The intent is that a level is highest level at which modes can be dissected and provides an indication of player progression in a game. The intent is that level start and ends do not occur more than every 2 minutes or so, otherwise the data reported will be difficult to understand. Levels are unique only within a given modeID - so you can have a ModeID =1, LevelID =1 and a different ModeID=2, LevelID = 1 indicate two completely different levels. LevelID = 0 means undefined or unknown. +LevelInstanceID Generated by the game every time LevelStart or LevelResume is called. This should be a unique ID (can be sequential) within a session. +LowResMapX Player position normalized to 0-255 +LowResMapY Player position normalized to 0-255 +LowResMapZ Player position normalized to 0-255 +MapID Unique ID for the current map the player is on +MarketplaceOfferID Unique ID for the Xbox LIVE marketplace offer that the upsell links to +MicroGoodTypeID Describes the type of consumable or microgood +MultiplayerInstanceID multiplayerinstanceID is a title-generated value that is the same for all players in the same multiplayer session.  +NumberOfLocalPlayers the number of players that are playing together in the game locally in the current session (on the same piece of hardware) +NumberOfOnlinePlayers the number of players that are playing together in the game online in the current session (not on the same piece of hardware) +NumberOfSkeletonsInView the max and min of skeletons that were in view, regardless of enrollment +OptionalSubLevelID Used when a title has more heirarchy required. OptionalSubLevel ID = 0 means undefined or unknown. +OptionalSubModeID Used when a title has more heirarchy required. OptionalSubMode ID = 0 means undefined or unknown. +PlayerLevelUpProgressStat1 Refers to a performance metric for your player when they level or rank up. This is entirely up to you and will help us understand how well the player performed, or how far the player has progressed. +PlayerLevelUpProgressStat2 Refers to a performance metric for your player when they level or rank up. This is entirely up to you and will help us understand how well the player performed, or how far the player has progressed. +PlayerWeaponID What weapon the player is holding or what approach/tact the player is taking to overcome a challenge +PlayspaceFeedbackWarningDirection identifies which side of the playspace players are getting too close to that results in the playspace feedback +SaveOrCheckpointID It is important that you also generate and save a unique SaveOrCheckpointID that can be read and reported when the player resumes from this save file or checkpoint. These IDs should be completely unique across the player’s experience, even if they play the same level multiple times. These IDs are critical to allowing us to re-stitch a player’s experience in your title and provide an accurate measure of time in level. +SecondsSinceInitialize Number of seconds elapsed since Sentient initialize. +SecondsSinceInitializeMax Number of seconds elapsed since Sentient initialize. +SecondsSinceInitializeMin Number of seconds elapsed since Sentient initialize. +SkeletonDistanceInInches Identifies the distance of the skeleton from the Kinect sensor +TitleBuildID Build version of the title, used to track changes in development as well as patches/title updates +*/ + +/* +ModeID +An in-game setting that significantly differentiates the play style of the game. +(This should be captured as an integer and correspond to mode specific to the game.) +Teams will have to provide the game mappings that correspond to the integers. +The intent is to allow teams to capture data on the highest level categories of gameplay in their game. +For example, a game mode could be the name of the specific mini game (eg: golf vs darts) or a specific multiplayer mode (eg: hoard vs beast.) ModeID = 0 means undefined or unknown. +*/ +enum ETelem_ModeId +{ + eTelem_ModeId_Undefined = 0, + eTelem_ModeId_Survival, + eTelem_ModeId_Creative, // Unused in current game version +}; + +/* +OptionalSubModeID +Used when a title has more heirarchy required. +OptionalSubMode ID = 0 means undefined or unknown. +*/ +enum ETelem_SubModeId +{ + eTelem_SubModeId_Undefined = 0, + eTelem_SubModeId_Normal, + eTelem_SubModeId_Tutorial, +}; + +/* +LevelID +This is a more granular view of mode, allowing teams to get a sense of the levels or maps players are playing and providing some insight into how players progress through a game. +Teams will have to provide the game mappings that correspond to the integers. +The intent is that a level is highest level at which modes can be dissected and provides an indication of player progression in a game. +The intent is that level start and ends do not occur more than every 2 minutes or so, otherwise the data reported will be difficult to understand. +Levels are unique only within a given modeID - so you can have a ModeID =1, LevelID =1 and a different ModeID=2, LevelID = 1 indicate two completely different levels. +LevelID = 0 means undefined or unknown. +*/ +enum ETelem_LevelId +{ + eTelem_LevelId_Undefined = 0, + eTelem_LevelId_PlayerGeneratedLevel = 1, + // 4J Stu - We currently do not have any specific levels (other than the tutorial which is tracked as a mode) so this is unused at the moment +}; + +/* +OptionalSubLevelID +Used when a title has more heirarchy required. OptionalSubLevel ID = 0 means undefined or unknown. +*/ +enum ETelem_SubLevelId +{ + eTelem_SubLevelId_Undefined = 0, + eTelem_SubLevelId_Overworld, + eTelem_SubLevelId_Nether, + eTelem_SubLevelId_End, +}; + +/* +MenuID +Describes the specific menu seen. MenuID = 0 means undefined or unknown. +*/ +// 4J Stu - FOR REFERENCE ONLY - Should map 1:1 with the CConsoleMinecraftApp:EUIScene enum +// Values that are commented out here are not currently reported +enum ETelem_MenuId +{ + //eTelemMenuId_PartnernetPassword = 0, + //eTelemMenuId_Intro = 1, + //eTelemMenuId_SaveMessage = 2, + //eTelemMenuId_Main = 3, + //eTelemMenuId_FullscreenProgress = 4, + eTelemMenuId_Pause = 5, + //eTelemMenuId_CraftingPanel_2x2 = 6, + //eTelemMenuId_CraftingPanel_3x3 = 7, + //eTelemMenuId_Furnace = 8, + //eTelemMenuId_Container = 9, + //eTelemMenuId_Largecontainer_small = 10,// for splitscreen + //eTelemMenuId_Inventory = 11, + //eTelemMenuId_Trap = 12, + //eTelemMenuId_Debug = 13, + //eTelemMenuId_DebugTips = 14, + //eTelemMenuId_HelpAndOptions = 15, + eTelemMenuId_HowToPlay = 16, + //eTelemMenuId_HowToPlayMenu = 17, + //eTelemMenuId_Controls = 18, + //eTelemMenuId_Settings_Menu = 19, + //eTelemMenuId_Settings_All = 20, + //eTelemMenuId_Leaderboards = 21, + //eTelemMenuId_Credits = 22, + //eTelemMenuId_Death = 23, + //eTelemMenuId_TutorialPopup = 24, + eTelemMenuId_MultiGameCreate = 25, + //eTelemMenuId_MultiGameJoinLoad = 26, + eTelemMenuId_MultiGameInfo = 27, + //eTelemMenuId_SignEntry = 28, + //eTelemMenuId_InGameInfo = 29, + //eTelemMenuId_ConnectingProgress = 30, + eTelemMenuId_DLCOffers = 31, + eTelemMenuId_SocialPost = 32, + //eTelemMenuId_TrialExitUpsell = 33, + eTelemMenuId_LoadSettings = 34, + //eTelemMenuId_Chat = 35, + //eTelemMenuId_Reinstall = 36, +}; + +/* +OptionalSubMenuID +Used when a title has more heirarchy required. OptionalSubMenuID = 0 means undefined or unknown. +*/ +enum ETelemetry_HowToPlay_SubMenuId +{ + eTelemetryHowToPlay_Basics = 0, + eTelemetryHowToPlay_HUD, + eTelemetryHowToPlay_Inventory, + eTelemetryHowToPlay_Chest, + eTelemetryHowToPlay_LargeChest, + eTelemetryHowToPlay_InventoryCrafting, + eTelemetryHowToPlay_CraftTable, + eTelemetryHowToPlay_Furnace, + eTelemetryHowToPlay_Dispenser, + eTelemetryHowToPlay_NetherPortal, +}; + +/* +EnemyTypeID What type of enemy or challenge was the player facing? +To prevent data-loss by overflowing the buffer, we recommend enemy type. +*/ +enum ETelemetryChallenges +{ + eTelemetryChallenges_Unknown = 0, + + eTelemetryTutorial_TrialStart, + eTelemetryTutorial_Halfway, + eTelemetryTutorial_Complete, + + eTelemetryTutorial_Inventory, + eTelemetryTutorial_Crafting, + eTelemetryTutorial_Furnace, + eTelemetryTutorial_Fishing, + eTelemetryTutorial_Minecart, + eTelemetryTutorial_Boat, + eTelemetryTutorial_Bed, + + eTelemetryTutorial_Redstone_And_Pistons, + eTelemetryTutorial_Portal, + eTelemetryTutorial_FoodBar, + eTelemetryTutorial_CreativeMode, + eTelemetryTutorial_BrewingMenu, + + eTelemetryInGame_Ride_Minecart, + eTelemetryInGame_Ride_Boat, + eTelemetryInGame_Ride_Pig, + eTelemetryInGame_UseBed, + + eTelemetryTutorial_CreativeInventory, // Added TU5 + + eTelemetryTutorial_EnchantingMenu, + eTelemetryTutorial_Brewing, + eTelemetryTutorial_Enchanting, + eTelemetryTutorial_Farming, + + eTelemetryPlayerDeathSource_Fall, + eTelemetryPlayerDeathSource_Lava, + eTelemetryPlayerDeathSource_Fire, + eTelemetryPlayerDeathSource_Water, + eTelemetryPlayerDeathSource_Suffocate, + eTelemetryPlayerDeathSource_OutOfWorld, + eTelemetryPlayerDeathSource_Cactus, + + eTelemetryPlayerDeathSource_Player_Weapon, + eTelemetryPlayerDeathSource_Player_Arrow, + + eTelemetryPlayerDeathSource_Explosion_Tnt, + eTelemetryPlayerDeathSource_Explosion_Creeper, + + eTelemetryPlayerDeathSource_Wolf, + eTelemetryPlayerDeathSource_Zombie, + eTelemetryPlayerDeathSource_Skeleton, + eTelemetryPlayerDeathSource_Spider, + eTelemetryPlayerDeathSource_Slime, + eTelemetryPlayerDeathSource_Ghast, + eTelemetryPlayerDeathSource_ZombiePigman, + + eTelemetryTutorial_Breeding, + eTelemetryTutorial_Golem, + + eTelemetryTutorial_Anvil, // Added TU14 + eTelemetryTutorial_AnvilMenu, + eTelemetryTutorial_Trading, + eTelemetryTutorial_TradingMenu, + eTelemetryTutorial_Enderchest, + + // Sent over network as a byte +}; \ No newline at end of file diff --git a/src/client/SDLMedia/strings.h b/src/client/SDLMedia/strings.h new file mode 100644 index 00000000..f4047769 --- /dev/null +++ b/src/client/SDLMedia/strings.h @@ -0,0 +1,1925 @@ +#pragma once +#define IDS_ACHIEVEMENTS 0 +#define IDS_ACTION_BAN_LEVEL_DESCRIPTION 1 +#define IDS_ACTION_BAN_LEVEL_TITLE 2 +#define IDS_ALLOWFRIENDSOFFRIENDS 3 +#define IDS_ANY_WOOL 4 +#define IDS_AUDIO 5 +#define IDS_AUTOSAVE_COUNTDOWN 6 +#define IDS_AWARD_AVATAR1 7 +#define IDS_AWARD_AVATAR2 8 +#define IDS_AWARD_AVATAR3 9 +#define IDS_AWARD_GAMERPIC1 10 +#define IDS_AWARD_GAMERPIC2 11 +#define IDS_AWARD_THEME 12 +#define IDS_AWARD_TITLE 13 +#define IDS_BACK 14 +#define IDS_BACK_BUTTON 15 +#define IDS_BANNED_LEVEL_TITLE 16 +#define IDS_BLAZE 17 +#define IDS_BONUS_CHEST 18 +#define IDS_BOSS_ENDERDRAGON_HEALTH 19 +#define IDS_BREWING_STAND 20 +#define IDS_BUTTON_REMOVE_FROM_BAN_LIST 21 +#define IDS_CAN_ATTACK_ANIMALS 22 +#define IDS_CAN_ATTACK_PLAYERS 23 +#define IDS_CAN_BUILD_AND_MINE 24 +#define IDS_CAN_DISABLE_EXHAUSTION 25 +#define IDS_CAN_FLY 26 +#define IDS_CAN_INVISIBLE 27 +#define IDS_CAN_OPEN_CONTAINERS 28 +#define IDS_CAN_USE_DOORS_AND_SWITCHES 29 +#define IDS_CANCEL 30 +#define IDS_CANT_PLACE_NEAR_SPAWN_TEXT 31 +#define IDS_CANT_PLACE_NEAR_SPAWN_TITLE 32 +#define IDS_CANT_SHEAR_MOOSHROOM 33 +#define IDS_CANT_SPAWN_IN_PEACEFUL 34 +#define IDS_CANTJOIN_TITLE 35 +#define IDS_CARROTS 36 +#define IDS_CAVE_SPIDER 37 +#define IDS_CHANGE_SKIN 38 +#define IDS_CHECKBOX_ANIMATED_CHARACTER 39 +#define IDS_CHECKBOX_CUSTOM_SKIN_ANIM 40 +#define IDS_CHECKBOX_DEATH_MESSAGES 41 +#define IDS_CHECKBOX_DISPLAY_HAND 42 +#define IDS_CHECKBOX_DISPLAY_HUD 43 +#define IDS_CHECKBOX_DISPLAY_SPLITSCREENGAMERTAGS 44 +#define IDS_CHECKBOX_RENDER_BEDROCKFOG 45 +#define IDS_CHECKBOX_RENDER_CLOUDS 46 +#define IDS_CHECKBOX_VERTICAL_SPLIT_SCREEN 47 +#define IDS_CHEST 48 +#define IDS_CHEST_LARGE 49 +#define IDS_CHICKEN 50 +#define IDS_COMMAND_TELEPORT_ME 51 +#define IDS_COMMAND_TELEPORT_SUCCESS 52 +#define IDS_COMMAND_TELEPORT_TO_ME 53 +#define IDS_CONFIRM_CANCEL 54 +#define IDS_CONFIRM_DECLINE_SAVE_GAME 55 +#define IDS_CONFIRM_EXIT_GAME 56 +#define IDS_CONFIRM_EXIT_GAME_CONFIRM_DISCONNECT_SAVE 57 +#define IDS_CONFIRM_EXIT_GAME_PROGRESS_LOST 58 +#define IDS_CONFIRM_LEAVE_VIA_INVITE 59 +#define IDS_CONFIRM_OK 60 +#define IDS_CONFIRM_SAVE_GAME 61 +#define IDS_CONFIRM_START_CREATIVE 62 +#define IDS_CONFIRM_START_HOST_PRIVILEGES 63 +#define IDS_CONFIRM_START_SAVEDINCREATIVE 64 +#define IDS_CONFIRM_START_SAVEDINCREATIVE_CONTINUE 65 +#define IDS_CONNECTION_FAILED 66 +#define IDS_CONNECTION_FAILED_NO_SD_SPLITSCREEN 67 +#define IDS_CONNECTION_LOST 68 +#define IDS_CONNECTION_LOST_LIVE 69 +#define IDS_CONNECTION_LOST_LIVE_NO_EXIT 70 +#define IDS_CONNECTION_LOST_SERVER 71 +#define IDS_CONTROL 72 +#define IDS_CONTROLLER_A 73 +#define IDS_CONTROLLER_B 74 +#define IDS_CONTROLLER_BACK 75 +#define IDS_CONTROLLER_DPAD_D 76 +#define IDS_CONTROLLER_DPAD_L 77 +#define IDS_CONTROLLER_DPAD_R 78 +#define IDS_CONTROLLER_DPAD_U 79 +#define IDS_CONTROLLER_LEFT_BUMPER 80 +#define IDS_CONTROLLER_LEFT_STICK 81 +#define IDS_CONTROLLER_LEFT_THUMBSTICK 82 +#define IDS_CONTROLLER_LEFT_TRIGGER 83 +#define IDS_CONTROLLER_RIGHT_BUMPER 84 +#define IDS_CONTROLLER_RIGHT_STICK 85 +#define IDS_CONTROLLER_RIGHT_THUMBSTICK 86 +#define IDS_CONTROLLER_RIGHT_TRIGGER 87 +#define IDS_CONTROLLER_START 88 +#define IDS_CONTROLLER_X 89 +#define IDS_CONTROLLER_Y 90 +#define IDS_CONTROLS 91 +#define IDS_CONTROLS_ACTION 92 +#define IDS_CONTROLS_CRAFTING 93 +#define IDS_CONTROLS_DPAD 94 +#define IDS_CONTROLS_DROP 95 +#define IDS_CONTROLS_HELDITEM 96 +#define IDS_CONTROLS_INVENTORY 97 +#define IDS_CONTROLS_JUMP 98 +#define IDS_CONTROLS_JUMPFLY 99 +#define IDS_CONTROLS_LAYOUT 100 +#define IDS_CONTROLS_LOOK 101 +#define IDS_CONTROLS_MOVE 102 +#define IDS_CONTROLS_PAUSE 103 +#define IDS_CONTROLS_PLAYERS 104 +#define IDS_CONTROLS_SCHEME0 105 +#define IDS_CONTROLS_SCHEME1 106 +#define IDS_CONTROLS_SCHEME2 107 +#define IDS_CONTROLS_SNEAK 108 +#define IDS_CONTROLS_SNEAKFLY 109 +#define IDS_CONTROLS_THIRDPERSON 110 +#define IDS_CONTROLS_USE 111 +#define IDS_CORRUPT_DLC 112 +#define IDS_CORRUPT_DLC_MULTIPLE 113 +#define IDS_CORRUPT_DLC_TITLE 114 +#define IDS_CORRUPT_OR_DAMAGED_SAVE_TEXT 115 +#define IDS_CORRUPT_OR_DAMAGED_SAVE_TITLE 116 +#define IDS_CORRUPTSAVE_TEXT 117 +#define IDS_CORRUPTSAVE_TITLE 118 +#define IDS_COW 119 +#define IDS_CREATE_NEW_WORLD 120 +#define IDS_CREATE_NEW_WORLD_RANDOM_SEED 121 +#define IDS_CREATE_NEW_WORLD_SEED 122 +#define IDS_CREATE_NEW_WORLD_SEEDTEXT 123 +#define IDS_CREATEANEWSAVE 124 +#define IDS_CREATED_IN_CREATIVE 125 +#define IDS_CREATED_IN_SURVIVAL 126 +#define IDS_CREATIVE 127 +#define IDS_CREDITS 128 +#define IDS_CREDITS_ADDITIONALSTE 129 +#define IDS_CREDITS_ART 130 +#define IDS_CREDITS_ARTDEVELOPER 131 +#define IDS_CREDITS_ASIALOC 132 +#define IDS_CREDITS_BIZDEV 133 +#define IDS_CREDITS_BULLYCOORD 134 +#define IDS_CREDITS_CEO 135 +#define IDS_CREDITS_CHIEFARCHITECT 136 +#define IDS_CREDITS_CODENINJA 137 +#define IDS_CREDITS_COMMUNITYMANAGER 138 +#define IDS_CREDITS_CONCEPTART 139 +#define IDS_CREDITS_CRUNCHER 140 +#define IDS_CREDITS_CUSTOMERSUPPORT 141 +#define IDS_CREDITS_DESIGNTEAM 142 +#define IDS_CREDITS_DESPROG 143 +#define IDS_CREDITS_DEVELOPER 144 +#define IDS_CREDITS_DEVELOPMENTTEAM 145 +#define IDS_CREDITS_DOF 146 +#define IDS_CREDITS_EUROPELOC 147 +#define IDS_CREDITS_EXECPRODUCER 148 +#define IDS_CREDITS_EXPLODANIM 149 +#define IDS_CREDITS_GAMECRAFTER 150 +#define IDS_CREDITS_JON_KAGSTROM 151 +#define IDS_CREDITS_LEADPC 152 +#define IDS_CREDITS_LEADPRODUCER 153 +#define IDS_CREDITS_LEADTESTER 154 +#define IDS_CREDITS_MARKETING 155 +#define IDS_CREDITS_MGSCENTRAL 156 +#define IDS_CREDITS_MILESTONEACCEPT 157 +#define IDS_CREDITS_MUSICANDSOUNDS 158 +#define IDS_CREDITS_OFFICEDJ 159 +#define IDS_CREDITS_ORIGINALDESIGN 160 +#define IDS_CREDITS_PMPROD 161 +#define IDS_CREDITS_PORTFOLIODIRECTOR 162 +#define IDS_CREDITS_PRODUCER 163 +#define IDS_CREDITS_PRODUCTMANAGER 164 +#define IDS_CREDITS_PROGRAMMING 165 +#define IDS_CREDITS_PROJECT 166 +#define IDS_CREDITS_QA 167 +#define IDS_CREDITS_REDMONDLOC 168 +#define IDS_CREDITS_RELEASEMANAGEMENT 169 +#define IDS_CREDITS_RESTOFMOJANG 170 +#define IDS_CREDITS_RISE_LUGO 171 +#define IDS_CREDITS_SDET 172 +#define IDS_CREDITS_SPECIALTHANKS 173 +#define IDS_CREDITS_SRTESTLEAD 174 +#define IDS_CREDITS_TESTASSOCIATES 175 +#define IDS_CREDITS_TESTLEAD 176 +#define IDS_CREDITS_TESTMANAGER 177 +#define IDS_CREDITS_TOBIAS_MOLLSTAM 178 +#define IDS_CREDITS_USERRESEARCH 179 +#define IDS_CREDITS_WCW 180 +#define IDS_CREDITS_XBLADIRECTOR 181 +#define IDS_CREEPER 182 +#define IDS_CURRENT_LAYOUT 183 +#define IDS_DEATH_ARROW 184 +#define IDS_DEATH_CACTUS 185 +#define IDS_DEATH_DRAGON_BREATH 186 +#define IDS_DEATH_DROWN 187 +#define IDS_DEATH_EXPLOSION 188 +#define IDS_DEATH_FALL 189 +#define IDS_DEATH_FALLING_ANVIL 190 +#define IDS_DEATH_FALLING_TILE 191 +#define IDS_DEATH_FIREBALL 192 +#define IDS_DEATH_GENERIC 193 +#define IDS_DEATH_INDIRECT_MAGIC 194 +#define IDS_DEATH_INFIRE 195 +#define IDS_DEATH_INWALL 196 +#define IDS_DEATH_LAVA 197 +#define IDS_DEATH_MAGIC 198 +#define IDS_DEATH_MOB 199 +#define IDS_DEATH_ONFIRE 200 +#define IDS_DEATH_OUTOFWORLD 201 +#define IDS_DEATH_PLAYER 202 +#define IDS_DEATH_STARVE 203 +#define IDS_DEATH_THORNS 204 +#define IDS_DEATH_THROWN 205 +#define IDS_DEBUG_SETTINGS 206 +#define IDS_DEFAULT_SAVENAME 207 +#define IDS_DEFAULT_SKINS 208 +#define IDS_DEFAULT_TEXTUREPACK 209 +#define IDS_DEFAULT_WORLD_NAME 210 +#define IDS_DEFAULTS_TEXT 211 +#define IDS_DEFAULTS_TITLE 212 +#define IDS_DESC_ANVIL 213 +#define IDS_DESC_APPLE 214 +#define IDS_DESC_ARROW 215 +#define IDS_DESC_BED 216 +#define IDS_DESC_BEDROCK 217 +#define IDS_DESC_BEEF_COOKED 218 +#define IDS_DESC_BEEF_RAW 219 +#define IDS_DESC_BLAZE 220 +#define IDS_DESC_BLAZE_POWDER 221 +#define IDS_DESC_BLAZE_ROD 222 +#define IDS_DESC_BLOCK 223 +#define IDS_DESC_BLOCK_DIAMOND 224 +#define IDS_DESC_BLOCK_GOLD 225 +#define IDS_DESC_BLOCK_IRON 226 +#define IDS_DESC_BLOCK_LAPIS 227 +#define IDS_DESC_BOAT 228 +#define IDS_DESC_BONE 229 +#define IDS_DESC_BOOK 230 +#define IDS_DESC_BOOKSHELF 231 +#define IDS_DESC_BOOTS 232 +#define IDS_DESC_BOOTS_CHAIN 233 +#define IDS_DESC_BOOTS_DIAMOND 234 +#define IDS_DESC_BOOTS_GOLD 235 +#define IDS_DESC_BOOTS_IRON 236 +#define IDS_DESC_BOOTS_LEATHER 237 +#define IDS_DESC_BOW 238 +#define IDS_DESC_BOWL 239 +#define IDS_DESC_BREAD 240 +#define IDS_DESC_BREWING_STAND 241 +#define IDS_DESC_BRICK 242 +#define IDS_DESC_BUCKET 243 +#define IDS_DESC_BUCKET_LAVA 244 +#define IDS_DESC_BUCKET_MILK 245 +#define IDS_DESC_BUCKET_WATER 246 +#define IDS_DESC_BUTTON 247 +#define IDS_DESC_CACTUS 248 +#define IDS_DESC_CAKE 249 +#define IDS_DESC_CARPET 250 +#define IDS_DESC_CARROT_GOLDEN 251 +#define IDS_DESC_CARROT_ON_A_STICK 252 +#define IDS_DESC_CARROTS 253 +#define IDS_DESC_CAULDRON 254 +#define IDS_DESC_CAVE_SPIDER 255 +#define IDS_DESC_CHEST 256 +#define IDS_DESC_CHESTPLATE 257 +#define IDS_DESC_CHESTPLATE_CHAIN 258 +#define IDS_DESC_CHESTPLATE_DIAMOND 259 +#define IDS_DESC_CHESTPLATE_GOLD 260 +#define IDS_DESC_CHESTPLATE_IRON 261 +#define IDS_DESC_CHESTPLATE_LEATHER 262 +#define IDS_DESC_CHICKEN 263 +#define IDS_DESC_CHICKEN_COOKED 264 +#define IDS_DESC_CHICKEN_RAW 265 +#define IDS_DESC_CLAY 266 +#define IDS_DESC_CLAY_TILE 267 +#define IDS_DESC_CLOCK 268 +#define IDS_DESC_COAL 269 +#define IDS_DESC_COBBLESTONE_WALL 270 +#define IDS_DESC_COCOA 271 +#define IDS_DESC_COMPASS 272 +#define IDS_DESC_COOKIE 273 +#define IDS_DESC_COW 274 +#define IDS_DESC_CRAFTINGTABLE 275 +#define IDS_DESC_CREEPER 276 +#define IDS_DESC_CROPS 277 +#define IDS_DESC_DEAD_BUSH 278 +#define IDS_DESC_DETECTORRAIL 279 +#define IDS_DESC_DIAMONDS 280 +#define IDS_DESC_DIRT 281 +#define IDS_DESC_DISPENSER 282 +#define IDS_DESC_DOOR_IRON 283 +#define IDS_DESC_DOOR_WOOD 284 +#define IDS_DESC_DRAGONEGG 285 +#define IDS_DESC_DYE_BLACK 286 +#define IDS_DESC_DYE_BLUE 287 +#define IDS_DESC_DYE_BROWN 288 +#define IDS_DESC_DYE_CYAN 289 +#define IDS_DESC_DYE_GRAY 290 +#define IDS_DESC_DYE_GREEN 291 +#define IDS_DESC_DYE_LIGHTBLUE 292 +#define IDS_DESC_DYE_LIGHTGRAY 293 +#define IDS_DESC_DYE_LIME 294 +#define IDS_DESC_DYE_MAGENTA 295 +#define IDS_DESC_DYE_ORANGE 296 +#define IDS_DESC_DYE_PINK 297 +#define IDS_DESC_DYE_PURPLE 298 +#define IDS_DESC_DYE_RED 299 +#define IDS_DESC_DYE_SILVER 300 +#define IDS_DESC_DYE_WHITE 301 +#define IDS_DESC_DYE_YELLOW 302 +#define IDS_DESC_EGG 303 +#define IDS_DESC_EMERALD 304 +#define IDS_DESC_EMERALDBLOCK 305 +#define IDS_DESC_EMERALDORE 306 +#define IDS_DESC_ENCHANTED_BOOK 307 +#define IDS_DESC_ENCHANTED_GOLDENAPPLE 308 +#define IDS_DESC_ENCHANTMENTTABLE 309 +#define IDS_DESC_END_PORTAL 310 +#define IDS_DESC_ENDER_PEARL 311 +#define IDS_DESC_ENDERCHEST 312 +#define IDS_DESC_ENDERDRAGON 313 +#define IDS_DESC_ENDERMAN 314 +#define IDS_DESC_ENDPORTALFRAME 315 +#define IDS_DESC_EXP_BOTTLE 316 +#define IDS_DESC_EYE_OF_ENDER 317 +#define IDS_DESC_FARMLAND 318 +#define IDS_DESC_FEATHER 319 +#define IDS_DESC_FENCE 320 +#define IDS_DESC_FENCE_GATE 321 +#define IDS_DESC_FERMENTED_SPIDER_EYE 322 +#define IDS_DESC_FIREBALL 323 +#define IDS_DESC_FISH_COOKED 324 +#define IDS_DESC_FISH_RAW 325 +#define IDS_DESC_FISHINGROD 326 +#define IDS_DESC_FLINT 327 +#define IDS_DESC_FLINTANDSTEEL 328 +#define IDS_DESC_FLOWER 329 +#define IDS_DESC_FLOWERPOT 330 +#define IDS_DESC_FURNACE 331 +#define IDS_DESC_GHAST 332 +#define IDS_DESC_GHAST_TEAR 333 +#define IDS_DESC_GLASS 334 +#define IDS_DESC_GLASS_BOTTLE 335 +#define IDS_DESC_GLOWSTONE 336 +#define IDS_DESC_GOLD_NUGGET 337 +#define IDS_DESC_GOLDENAPPLE 338 +#define IDS_DESC_GRASS 339 +#define IDS_DESC_GRAVEL 340 +#define IDS_DESC_HALFSLAB 341 +#define IDS_DESC_HATCHET 342 +#define IDS_DESC_HELL_ROCK 343 +#define IDS_DESC_HELL_SAND 344 +#define IDS_DESC_HELMET 345 +#define IDS_DESC_HELMET_CHAIN 346 +#define IDS_DESC_HELMET_DIAMOND 347 +#define IDS_DESC_HELMET_GOLD 348 +#define IDS_DESC_HELMET_IRON 349 +#define IDS_DESC_HELMET_LEATHER 350 +#define IDS_DESC_HOE 351 +#define IDS_DESC_ICE 352 +#define IDS_DESC_INGOT 353 +#define IDS_DESC_IRON_FENCE 354 +#define IDS_DESC_IRONGOLEM 355 +#define IDS_DESC_ITEM_NETHERBRICK 356 +#define IDS_DESC_ITEMFRAME 357 +#define IDS_DESC_JACKOLANTERN 358 +#define IDS_DESC_JUKEBOX 359 +#define IDS_DESC_LADDER 360 +#define IDS_DESC_LAVA 361 +#define IDS_DESC_LAVA_SLIME 362 +#define IDS_DESC_LEATHER 363 +#define IDS_DESC_LEAVES 364 +#define IDS_DESC_LEGGINGS 365 +#define IDS_DESC_LEGGINGS_CHAIN 366 +#define IDS_DESC_LEGGINGS_DIAMOND 367 +#define IDS_DESC_LEGGINGS_GOLD 368 +#define IDS_DESC_LEGGINGS_IRON 369 +#define IDS_DESC_LEGGINGS_LEATHER 370 +#define IDS_DESC_LEVER 371 +#define IDS_DESC_LOG 372 +#define IDS_DESC_MAGMA_CREAM 373 +#define IDS_DESC_MAP 374 +#define IDS_DESC_MELON_BLOCK 375 +#define IDS_DESC_MELON_SEEDS 376 +#define IDS_DESC_MELON_SLICE 377 +#define IDS_DESC_MINECART 378 +#define IDS_DESC_MINECARTWITHCHEST 379 +#define IDS_DESC_MINECARTWITHFURNACE 380 +#define IDS_DESC_MOB_SPAWNER 381 +#define IDS_DESC_MONSTER_SPAWNER 382 +#define IDS_DESC_MOSS_STONE 383 +#define IDS_DESC_MUSHROOM 384 +#define IDS_DESC_MUSHROOM_COW 385 +#define IDS_DESC_MUSHROOMSTEW 386 +#define IDS_DESC_MYCEL 387 +#define IDS_DESC_NETHER_QUARTZ 388 +#define IDS_DESC_NETHER_QUARTZ_ORE 389 +#define IDS_DESC_NETHER_STALK_SEEDS 390 +#define IDS_DESC_NETHERBRICK 391 +#define IDS_DESC_NETHERFENCE 392 +#define IDS_DESC_NETHERSTALK 393 +#define IDS_DESC_NOTEBLOCK 394 +#define IDS_DESC_OBSIDIAN 395 +#define IDS_DESC_ORE_COAL 396 +#define IDS_DESC_ORE_DIAMOND 397 +#define IDS_DESC_ORE_GOLD 398 +#define IDS_DESC_ORE_IRON 399 +#define IDS_DESC_ORE_LAPIS 400 +#define IDS_DESC_ORE_REDSTONE 401 +#define IDS_DESC_OZELOT 402 +#define IDS_DESC_PAPER 403 +#define IDS_DESC_PICKAXE 404 +#define IDS_DESC_PICTURE 405 +#define IDS_DESC_PIG 406 +#define IDS_DESC_PIGZOMBIE 407 +#define IDS_DESC_PISTON 408 +#define IDS_DESC_PORKCHOP_COOKED 409 +#define IDS_DESC_PORKCHOP_RAW 410 +#define IDS_DESC_PORTAL 411 +#define IDS_DESC_POTATO 412 +#define IDS_DESC_POTATO_BAKED 413 +#define IDS_DESC_POTATO_POISONOUS 414 +#define IDS_DESC_POTION 415 +#define IDS_DESC_POWEREDRAIL 416 +#define IDS_DESC_PRESSUREPLATE 417 +#define IDS_DESC_PUMPKIN 418 +#define IDS_DESC_PUMPKIN_PIE 419 +#define IDS_DESC_PUMPKIN_SEEDS 420 +#define IDS_DESC_QUARTZ_BLOCK 421 +#define IDS_DESC_RAIL 422 +#define IDS_DESC_RECORD 423 +#define IDS_DESC_REDSTONE_DUST 424 +#define IDS_DESC_REDSTONE_LIGHT 425 +#define IDS_DESC_REDSTONEREPEATER 426 +#define IDS_DESC_REDSTONETORCH 427 +#define IDS_DESC_REEDS 428 +#define IDS_DESC_ROTTEN_FLESH 429 +#define IDS_DESC_SADDLE 430 +#define IDS_DESC_SAND 431 +#define IDS_DESC_SANDSTONE 432 +#define IDS_DESC_SAPLING 433 +#define IDS_DESC_SHEARS 434 +#define IDS_DESC_SHEEP 435 +#define IDS_DESC_SHOVEL 436 +#define IDS_DESC_SIGN 437 +#define IDS_DESC_SILVERFISH 438 +#define IDS_DESC_SKELETON 439 +#define IDS_DESC_SKULL 440 +#define IDS_DESC_SLAB 441 +#define IDS_DESC_SLIME 442 +#define IDS_DESC_SLIMEBALL 443 +#define IDS_DESC_SNOW 444 +#define IDS_DESC_SNOWBALL 445 +#define IDS_DESC_SNOWMAN 446 +#define IDS_DESC_SPECKLED_MELON 447 +#define IDS_DESC_SPIDER 448 +#define IDS_DESC_SPIDER_EYE 449 +#define IDS_DESC_SPONGE 450 +#define IDS_DESC_SQUID 451 +#define IDS_DESC_STAIRS 452 +#define IDS_DESC_STICK 453 +#define IDS_DESC_STICKY_PISTON 454 +#define IDS_DESC_STONE 455 +#define IDS_DESC_STONE_BRICK 456 +#define IDS_DESC_STONE_BRICK_SMOOTH 457 +#define IDS_DESC_STONE_SILVERFISH 458 +#define IDS_DESC_STONESLAB 459 +#define IDS_DESC_STRING 460 +#define IDS_DESC_STRUCTBLOCK 461 +#define IDS_DESC_SUGAR 462 +#define IDS_DESC_SULPHUR 463 +#define IDS_DESC_SWORD 464 +#define IDS_DESC_TALL_GRASS 465 +#define IDS_DESC_THIN_GLASS 466 +#define IDS_DESC_TNT 467 +#define IDS_DESC_TOP_SNOW 468 +#define IDS_DESC_TORCH 469 +#define IDS_DESC_TRAPDOOR 470 +#define IDS_DESC_TRIPWIRE 471 +#define IDS_DESC_TRIPWIRE_SOURCE 472 +#define IDS_DESC_VILLAGER 473 +#define IDS_DESC_VINE 474 +#define IDS_DESC_WATER 475 +#define IDS_DESC_WATERLILY 476 +#define IDS_DESC_WEB 477 +#define IDS_DESC_WHEAT 478 +#define IDS_DESC_WHEAT_SEEDS 479 +#define IDS_DESC_WHITESTONE 480 +#define IDS_DESC_WOLF 481 +#define IDS_DESC_WOODENPLANKS 482 +#define IDS_DESC_WOODSLAB 483 +#define IDS_DESC_WOOL 484 +#define IDS_DESC_WOOLSTRING 485 +#define IDS_DESC_YELLOW_DUST 486 +#define IDS_DESC_ZOMBIE 487 +#define IDS_DEVICEGONE_TEXT 488 +#define IDS_DEVICEGONE_TITLE 489 +#define IDS_DIFFICULTY_EASY 490 +#define IDS_DIFFICULTY_HARD 491 +#define IDS_DIFFICULTY_NORMAL 492 +#define IDS_DIFFICULTY_PEACEFUL 493 +#define IDS_DIFFICULTY_TITLE_EASY 494 +#define IDS_DIFFICULTY_TITLE_HARD 495 +#define IDS_DIFFICULTY_TITLE_NORMAL 496 +#define IDS_DIFFICULTY_TITLE_PEACEFUL 497 +#define IDS_DISABLE_EXHAUSTION 498 +#define IDS_DISABLE_SAVING 499 +#define IDS_DISCONNECTED 500 +#define IDS_DISCONNECTED_BANNED 501 +#define IDS_DISCONNECTED_CLIENT_OLD 502 +#define IDS_DISCONNECTED_FLYING 503 +#define IDS_DISCONNECTED_KICKED 504 +#define IDS_DISCONNECTED_LOGIN_TOO_LONG 505 +#define IDS_DISCONNECTED_NO_FRIENDS_IN_GAME 506 +#define IDS_DISCONNECTED_SERVER_FULL 507 +#define IDS_DISCONNECTED_SERVER_OLD 508 +#define IDS_DISCONNECTED_SERVER_QUIT 509 +#define IDS_DISPENSER 510 +#define IDS_DLC_COST 511 +#define IDS_DLC_MENU_AVATARITEMS 512 +#define IDS_DLC_MENU_GAMERPICS 513 +#define IDS_DLC_MENU_MASHUPPACKS 514 +#define IDS_DLC_MENU_SKINPACKS 515 +#define IDS_DLC_MENU_TEXTUREPACKS 516 +#define IDS_DLC_MENU_THEMES 517 +#define IDS_DLC_TEXTUREPACK_GET_FULL_TITLE 518 +#define IDS_DLC_TEXTUREPACK_GET_TRIAL_TITLE 519 +#define IDS_DLC_TEXTUREPACK_NOT_PRESENT 520 +#define IDS_DLC_TEXTUREPACK_NOT_PRESENT_TITLE 521 +#define IDS_DLC_TEXTUREPACK_UNLOCK_TITLE 522 +#define IDS_DONE 523 +#define IDS_DONT_RESET_NETHER 524 +#define IDS_DOWNLOADABLE_CONTENT_OFFERS 525 +#define IDS_DOWNLOADABLECONTENT 526 +#define IDS_EDIT_SIGN_MESSAGE 527 +#define IDS_ENABLE_TELEPORT 528 +#define IDS_ENCHANT 529 +#define IDS_ENCHANTMENT_ARROW_DAMAGE 530 +#define IDS_ENCHANTMENT_ARROW_FIRE 531 +#define IDS_ENCHANTMENT_ARROW_INFINITE 532 +#define IDS_ENCHANTMENT_ARROW_KNOCKBACK 533 +#define IDS_ENCHANTMENT_DAMAGE_ALL 534 +#define IDS_ENCHANTMENT_DAMAGE_ARTHROPODS 535 +#define IDS_ENCHANTMENT_DAMAGE_UNDEAD 536 +#define IDS_ENCHANTMENT_DIGGING 537 +#define IDS_ENCHANTMENT_DURABILITY 538 +#define IDS_ENCHANTMENT_FIRE 539 +#define IDS_ENCHANTMENT_KNOCKBACK 540 +#define IDS_ENCHANTMENT_LEVEL_1 541 +#define IDS_ENCHANTMENT_LEVEL_10 542 +#define IDS_ENCHANTMENT_LEVEL_2 543 +#define IDS_ENCHANTMENT_LEVEL_3 544 +#define IDS_ENCHANTMENT_LEVEL_4 545 +#define IDS_ENCHANTMENT_LEVEL_5 546 +#define IDS_ENCHANTMENT_LEVEL_6 547 +#define IDS_ENCHANTMENT_LEVEL_7 548 +#define IDS_ENCHANTMENT_LEVEL_8 549 +#define IDS_ENCHANTMENT_LEVEL_9 550 +#define IDS_ENCHANTMENT_LOOT_BONUS 551 +#define IDS_ENCHANTMENT_LOOT_BONUS_DIGGER 552 +#define IDS_ENCHANTMENT_OXYGEN 553 +#define IDS_ENCHANTMENT_PROTECT_ALL 554 +#define IDS_ENCHANTMENT_PROTECT_EXPLOSION 555 +#define IDS_ENCHANTMENT_PROTECT_FALL 556 +#define IDS_ENCHANTMENT_PROTECT_FIRE 557 +#define IDS_ENCHANTMENT_PROTECT_PROJECTILE 558 +#define IDS_ENCHANTMENT_THORNS 559 +#define IDS_ENCHANTMENT_UNTOUCHING 560 +#define IDS_ENCHANTMENT_WATER_WORKER 561 +#define IDS_ENDERDRAGON 562 +#define IDS_ENDERMAN 563 +#define IDS_ERROR_NETWORK 564 +#define IDS_ERROR_NETWORK_TITLE 565 +#define IDS_EXIT_GAME 566 +#define IDS_EXIT_GAME_NO_SAVE 567 +#define IDS_EXIT_GAME_SAVE 568 +#define IDS_EXITING_GAME 569 +#define IDS_FAILED_TO_CREATE_GAME_TITLE 570 +#define IDS_FAILED_TO_LOADSAVE_TEXT 571 +#define IDS_FAILED_TO_SAVE_TEXT 572 +#define IDS_FAILED_TO_SAVE_TITLE 573 +#define IDS_FATAL_ERROR_TEXT 574 +#define IDS_FATAL_ERROR_TITLE 575 +#define IDS_FAVORITES_SKIN_PACK 576 +#define IDS_FIRE_SPREADS 577 +#define IDS_FLOWERPOT 578 +#define IDS_FUEL 579 +#define IDS_FURNACE 580 +#define IDS_GAME_HOST_NAME 581 +#define IDS_GAME_HOST_NAME_UNKNOWN 582 +#define IDS_GAME_MODE_CHANGED 583 +#define IDS_GAME_OPTIONS 584 +#define IDS_GAMEMODE_CREATIVE 585 +#define IDS_GAMEMODE_SURVIVAL 586 +#define IDS_GAMEOPTION_ALLOWFOF 587 +#define IDS_GAMEOPTION_BONUS_CHEST 588 +#define IDS_GAMEOPTION_DISABLE_SAVING 589 +#define IDS_GAMEOPTION_FIRE_SPREADS 590 +#define IDS_GAMEOPTION_HOST_PRIVILEGES 591 +#define IDS_GAMEOPTION_INVITEONLY 592 +#define IDS_GAMEOPTION_ONLINE 593 +#define IDS_GAMEOPTION_PVP 594 +#define IDS_GAMEOPTION_RESET_NETHER 595 +#define IDS_GAMEOPTION_SEED 596 +#define IDS_GAMEOPTION_STRUCTURES 597 +#define IDS_GAMEOPTION_SUPERFLAT 598 +#define IDS_GAMEOPTION_TNT_EXPLODES 599 +#define IDS_GAMEOPTION_TRUST 600 +#define IDS_GAMEOPTION_WORLD_SIZE 601 +#define IDS_GAMERPICS 602 +#define IDS_GENERATE_STRUCTURES 603 +#define IDS_GENERIC_ERROR 604 +#define IDS_GHAST 605 +#define IDS_GRAPHICS 606 +#define IDS_GROUPNAME_ARMOUR 607 +#define IDS_GROUPNAME_BUILDING_BLOCKS 608 +#define IDS_GROUPNAME_DECORATIONS 609 +#define IDS_GROUPNAME_FOOD 610 +#define IDS_GROUPNAME_MATERIALS 611 +#define IDS_GROUPNAME_MECHANISMS 612 +#define IDS_GROUPNAME_MISCELLANEOUS 613 +#define IDS_GROUPNAME_POTIONS 614 +#define IDS_GROUPNAME_POTIONS_480 615 +#define IDS_GROUPNAME_REDSTONE_AND_TRANSPORT 616 +#define IDS_GROUPNAME_STRUCTURES 617 +#define IDS_GROUPNAME_TOOLS 618 +#define IDS_GROUPNAME_TOOLS_WEAPONS_ARMOR 619 +#define IDS_GROUPNAME_TRANSPORT 620 +#define IDS_GROUPNAME_WEAPONS 621 +#define IDS_GUEST_ORDER_CHANGED_TEXT 622 +#define IDS_GUEST_ORDER_CHANGED_TITLE 623 +#define IDS_HELP_AND_OPTIONS 624 +#define IDS_HINTS 625 +#define IDS_HOST_OPTION_DISABLES_ACHIEVEMENTS 626 +#define IDS_HOST_OPTIONS 627 +#define IDS_HOST_PRIVILEGES 628 +#define IDS_HOW_TO_PLAY 629 +#define IDS_HOW_TO_PLAY_ANVIL 630 +#define IDS_HOW_TO_PLAY_BANLIST 631 +#define IDS_HOW_TO_PLAY_BASICS 632 +#define IDS_HOW_TO_PLAY_BREEDANIMALS 633 +#define IDS_HOW_TO_PLAY_BREWING 634 +#define IDS_HOW_TO_PLAY_CHEST 635 +#define IDS_HOW_TO_PLAY_CRAFT_TABLE 636 +#define IDS_HOW_TO_PLAY_CRAFTING 637 +#define IDS_HOW_TO_PLAY_CREATIVE 638 +#define IDS_HOW_TO_PLAY_DISPENSER 639 +#define IDS_HOW_TO_PLAY_ENCHANTMENT 640 +#define IDS_HOW_TO_PLAY_ENDERCHEST 641 +#define IDS_HOW_TO_PLAY_FARMANIMALS 642 +#define IDS_HOW_TO_PLAY_FURNACE 643 +#define IDS_HOW_TO_PLAY_HOSTOPTIONS 644 +#define IDS_HOW_TO_PLAY_HUD 645 +#define IDS_HOW_TO_PLAY_INVENTORY 646 +#define IDS_HOW_TO_PLAY_LARGECHEST 647 +#define IDS_HOW_TO_PLAY_MENU_ANVIL 648 +#define IDS_HOW_TO_PLAY_MENU_BANLIST 649 +#define IDS_HOW_TO_PLAY_MENU_BASICS 650 +#define IDS_HOW_TO_PLAY_MENU_BREEDANIMALS 651 +#define IDS_HOW_TO_PLAY_MENU_BREWING 652 +#define IDS_HOW_TO_PLAY_MENU_CHESTS 653 +#define IDS_HOW_TO_PLAY_MENU_CRAFTING 654 +#define IDS_HOW_TO_PLAY_MENU_CREATIVE 655 +#define IDS_HOW_TO_PLAY_MENU_DISPENSER 656 +#define IDS_HOW_TO_PLAY_MENU_ENCHANTMENT 657 +#define IDS_HOW_TO_PLAY_MENU_FARMANIMALS 658 +#define IDS_HOW_TO_PLAY_MENU_FURNACE 659 +#define IDS_HOW_TO_PLAY_MENU_HOSTOPTIONS 660 +#define IDS_HOW_TO_PLAY_MENU_HUD 661 +#define IDS_HOW_TO_PLAY_MENU_INVENTORY 662 +#define IDS_HOW_TO_PLAY_MENU_MULTIPLAYER 663 +#define IDS_HOW_TO_PLAY_MENU_NETHERPORTAL 664 +#define IDS_HOW_TO_PLAY_MENU_SOCIALMEDIA 665 +#define IDS_HOW_TO_PLAY_MENU_SPRINT 666 +#define IDS_HOW_TO_PLAY_MENU_THEEND 667 +#define IDS_HOW_TO_PLAY_MENU_TRADING 668 +#define IDS_HOW_TO_PLAY_MENU_WHATSNEW 669 +#define IDS_HOW_TO_PLAY_MULTIPLAYER 670 +#define IDS_HOW_TO_PLAY_NETHERPORTAL 671 +#define IDS_HOW_TO_PLAY_NEXT 672 +#define IDS_HOW_TO_PLAY_PREV 673 +#define IDS_HOW_TO_PLAY_SOCIALMEDIA 674 +#define IDS_HOW_TO_PLAY_THEEND 675 +#define IDS_HOW_TO_PLAY_TRADING 676 +#define IDS_HOW_TO_PLAY_WHATSNEW 677 +#define IDS_ICON_SHANK_01 678 +#define IDS_ICON_SHANK_03 679 +#define IDS_IN_GAME_GAMERTAGS 680 +#define IDS_IN_GAME_TOOLTIPS 681 +#define IDS_INGREDIENT 682 +#define IDS_INGREDIENTS 683 +#define IDS_INVENTORY 684 +#define IDS_INVERT_LOOK 685 +#define IDS_INVISIBLE 686 +#define IDS_INVITE_ONLY 687 +#define IDS_IRONGOLEM 688 +#define IDS_ITEM_APPLE 689 +#define IDS_ITEM_APPLE_GOLD 690 +#define IDS_ITEM_ARROW 691 +#define IDS_ITEM_BED 692 +#define IDS_ITEM_BEEF_COOKED 693 +#define IDS_ITEM_BEEF_RAW 694 +#define IDS_ITEM_BLAZE_POWDER 695 +#define IDS_ITEM_BLAZE_ROD 696 +#define IDS_ITEM_BOAT 697 +#define IDS_ITEM_BONE 698 +#define IDS_ITEM_BOOK 699 +#define IDS_ITEM_BOOTS_CHAIN 700 +#define IDS_ITEM_BOOTS_CLOTH 701 +#define IDS_ITEM_BOOTS_DIAMOND 702 +#define IDS_ITEM_BOOTS_GOLD 703 +#define IDS_ITEM_BOOTS_IRON 704 +#define IDS_ITEM_BOW 705 +#define IDS_ITEM_BOWL 706 +#define IDS_ITEM_BREAD 707 +#define IDS_ITEM_BREWING_STAND 708 +#define IDS_ITEM_BRICK 709 +#define IDS_ITEM_BUCKET 710 +#define IDS_ITEM_BUCKET_LAVA 711 +#define IDS_ITEM_BUCKET_MILK 712 +#define IDS_ITEM_BUCKET_WATER 713 +#define IDS_ITEM_CAKE 714 +#define IDS_ITEM_CARROT_GOLDEN 715 +#define IDS_ITEM_CARROT_ON_A_STICK 716 +#define IDS_ITEM_CAULDRON 717 +#define IDS_ITEM_CHARCOAL 718 +#define IDS_ITEM_CHESTPLATE_CHAIN 719 +#define IDS_ITEM_CHESTPLATE_CLOTH 720 +#define IDS_ITEM_CHESTPLATE_DIAMOND 721 +#define IDS_ITEM_CHESTPLATE_GOLD 722 +#define IDS_ITEM_CHESTPLATE_IRON 723 +#define IDS_ITEM_CHICKEN_COOKED 724 +#define IDS_ITEM_CHICKEN_RAW 725 +#define IDS_ITEM_CLAY 726 +#define IDS_ITEM_CLOCK 727 +#define IDS_ITEM_COAL 728 +#define IDS_ITEM_COMPASS 729 +#define IDS_ITEM_COOKIE 730 +#define IDS_ITEM_DIAMOND 731 +#define IDS_ITEM_DIODE 732 +#define IDS_ITEM_DOOR_IRON 733 +#define IDS_ITEM_DOOR_WOOD 734 +#define IDS_ITEM_DYE_POWDER 735 +#define IDS_ITEM_DYE_POWDER_BLACK 736 +#define IDS_ITEM_DYE_POWDER_BLUE 737 +#define IDS_ITEM_DYE_POWDER_BROWN 738 +#define IDS_ITEM_DYE_POWDER_CYAN 739 +#define IDS_ITEM_DYE_POWDER_GRAY 740 +#define IDS_ITEM_DYE_POWDER_GREEN 741 +#define IDS_ITEM_DYE_POWDER_LIGHT_BLUE 742 +#define IDS_ITEM_DYE_POWDER_LIME 743 +#define IDS_ITEM_DYE_POWDER_MAGENTA 744 +#define IDS_ITEM_DYE_POWDER_ORANGE 745 +#define IDS_ITEM_DYE_POWDER_PINK 746 +#define IDS_ITEM_DYE_POWDER_PURPLE 747 +#define IDS_ITEM_DYE_POWDER_RED 748 +#define IDS_ITEM_DYE_POWDER_SILVER 749 +#define IDS_ITEM_DYE_POWDER_WHITE 750 +#define IDS_ITEM_DYE_POWDER_YELLOW 751 +#define IDS_ITEM_EGG 752 +#define IDS_ITEM_EMERALD 753 +#define IDS_ITEM_ENCHANTED_BOOK 754 +#define IDS_ITEM_ENDER_PEARL 755 +#define IDS_ITEM_EXP_BOTTLE 756 +#define IDS_ITEM_EYE_OF_ENDER 757 +#define IDS_ITEM_FEATHER 758 +#define IDS_ITEM_FERMENTED_SPIDER_EYE 759 +#define IDS_ITEM_FIREBALL 760 +#define IDS_ITEM_FIREBALLCHARCOAL 761 +#define IDS_ITEM_FIREBALLCOAL 762 +#define IDS_ITEM_FISH_COOKED 763 +#define IDS_ITEM_FISH_RAW 764 +#define IDS_ITEM_FISHING_ROD 765 +#define IDS_ITEM_FLINT 766 +#define IDS_ITEM_FLINT_AND_STEEL 767 +#define IDS_ITEM_GHAST_TEAR 768 +#define IDS_ITEM_GLASS_BOTTLE 769 +#define IDS_ITEM_GOLD_NUGGET 770 +#define IDS_ITEM_HATCHET_DIAMOND 771 +#define IDS_ITEM_HATCHET_GOLD 772 +#define IDS_ITEM_HATCHET_IRON 773 +#define IDS_ITEM_HATCHET_STONE 774 +#define IDS_ITEM_HATCHET_WOOD 775 +#define IDS_ITEM_HELMET_CHAIN 776 +#define IDS_ITEM_HELMET_CLOTH 777 +#define IDS_ITEM_HELMET_DIAMOND 778 +#define IDS_ITEM_HELMET_GOLD 779 +#define IDS_ITEM_HELMET_IRON 780 +#define IDS_ITEM_HOE_DIAMOND 781 +#define IDS_ITEM_HOE_GOLD 782 +#define IDS_ITEM_HOE_IRON 783 +#define IDS_ITEM_HOE_STONE 784 +#define IDS_ITEM_HOE_WOOD 785 +#define IDS_ITEM_INGOT_GOLD 786 +#define IDS_ITEM_INGOT_IRON 787 +#define IDS_ITEM_ITEMFRAME 788 +#define IDS_ITEM_LEATHER 789 +#define IDS_ITEM_LEGGINGS_CHAIN 790 +#define IDS_ITEM_LEGGINGS_CLOTH 791 +#define IDS_ITEM_LEGGINGS_DIAMOND 792 +#define IDS_ITEM_LEGGINGS_GOLD 793 +#define IDS_ITEM_LEGGINGS_IRON 794 +#define IDS_ITEM_MAGMA_CREAM 795 +#define IDS_ITEM_MAP 796 +#define IDS_ITEM_MELON_SEEDS 797 +#define IDS_ITEM_MELON_SLICE 798 +#define IDS_ITEM_MINECART 799 +#define IDS_ITEM_MINECART_CHEST 800 +#define IDS_ITEM_MINECART_FURNACE 801 +#define IDS_ITEM_MONSTER_SPAWNER 802 +#define IDS_ITEM_MUSHROOM_STEW 803 +#define IDS_ITEM_NETHER_QUARTZ 804 +#define IDS_ITEM_NETHER_STALK_SEEDS 805 +#define IDS_ITEM_NETHERBRICK 806 +#define IDS_ITEM_PAINTING 807 +#define IDS_ITEM_PAPER 808 +#define IDS_ITEM_PICKAXE_DIAMOND 809 +#define IDS_ITEM_PICKAXE_GOLD 810 +#define IDS_ITEM_PICKAXE_IRON 811 +#define IDS_ITEM_PICKAXE_STONE 812 +#define IDS_ITEM_PICKAXE_WOOD 813 +#define IDS_ITEM_PORKCHOP_COOKED 814 +#define IDS_ITEM_PORKCHOP_RAW 815 +#define IDS_ITEM_POTATO_BAKED 816 +#define IDS_ITEM_POTATO_POISONOUS 817 +#define IDS_ITEM_POTION 818 +#define IDS_ITEM_PUMPKIN_PIE 819 +#define IDS_ITEM_PUMPKIN_SEEDS 820 +#define IDS_ITEM_RECORD_01 821 +#define IDS_ITEM_RECORD_02 822 +#define IDS_ITEM_RECORD_03 823 +#define IDS_ITEM_RECORD_04 824 +#define IDS_ITEM_RECORD_05 825 +#define IDS_ITEM_RECORD_06 826 +#define IDS_ITEM_RECORD_07 827 +#define IDS_ITEM_RECORD_08 828 +#define IDS_ITEM_RECORD_09 829 +#define IDS_ITEM_RECORD_10 830 +#define IDS_ITEM_RECORD_11 831 +#define IDS_ITEM_RECORD_12 832 +#define IDS_ITEM_REDSTONE 833 +#define IDS_ITEM_REEDS 834 +#define IDS_ITEM_ROTTEN_FLESH 835 +#define IDS_ITEM_SADDLE 836 +#define IDS_ITEM_SHEARS 837 +#define IDS_ITEM_SHOVEL_DIAMOND 838 +#define IDS_ITEM_SHOVEL_GOLD 839 +#define IDS_ITEM_SHOVEL_IRON 840 +#define IDS_ITEM_SHOVEL_STONE 841 +#define IDS_ITEM_SHOVEL_WOOD 842 +#define IDS_ITEM_SIGN 843 +#define IDS_ITEM_SKULL 844 +#define IDS_ITEM_SKULL_CHARACTER 845 +#define IDS_ITEM_SKULL_CREEPER 846 +#define IDS_ITEM_SKULL_PLAYER 847 +#define IDS_ITEM_SKULL_SKELETON 848 +#define IDS_ITEM_SKULL_WITHER 849 +#define IDS_ITEM_SKULL_ZOMBIE 850 +#define IDS_ITEM_SLIMEBALL 851 +#define IDS_ITEM_SNOWBALL 852 +#define IDS_ITEM_SPECKLED_MELON 853 +#define IDS_ITEM_SPIDER_EYE 854 +#define IDS_ITEM_STICK 855 +#define IDS_ITEM_STRING 856 +#define IDS_ITEM_SUGAR 857 +#define IDS_ITEM_SULPHUR 858 +#define IDS_ITEM_SWORD_DIAMOND 859 +#define IDS_ITEM_SWORD_GOLD 860 +#define IDS_ITEM_SWORD_IRON 861 +#define IDS_ITEM_SWORD_STONE 862 +#define IDS_ITEM_SWORD_WOOD 863 +#define IDS_ITEM_WATER_BOTTLE 864 +#define IDS_ITEM_WHEAT 865 +#define IDS_ITEM_WHEAT_SEEDS 866 +#define IDS_ITEM_YELLOW_DUST 867 +#define IDS_JOIN_GAME 868 +#define IDS_KEYBOARDUI_SAVEGAME_TEXT 869 +#define IDS_KEYBOARDUI_SAVEGAME_TITLE 870 +#define IDS_KICK_PLAYER 871 +#define IDS_KICK_PLAYER_DESCRIPTION 872 +#define IDS_LABEL_DIFFICULTY 873 +#define IDS_LABEL_FIRE_SPREADS 874 +#define IDS_LABEL_GAME_TYPE 875 +#define IDS_LABEL_GAMERTAGS 876 +#define IDS_LABEL_LEVEL_TYPE 877 +#define IDS_LABEL_PvP 878 +#define IDS_LABEL_STRUCTURES 879 +#define IDS_LABEL_TNT 880 +#define IDS_LABEL_TRUST 881 +#define IDS_LAVA_SLIME 882 +#define IDS_LEADERBOARD_ENTRIES 883 +#define IDS_LEADERBOARD_FARMING_EASY 884 +#define IDS_LEADERBOARD_FARMING_HARD 885 +#define IDS_LEADERBOARD_FARMING_NORMAL 886 +#define IDS_LEADERBOARD_FARMING_PEACEFUL 887 +#define IDS_LEADERBOARD_FILTER 888 +#define IDS_LEADERBOARD_FILTER_FRIENDS 889 +#define IDS_LEADERBOARD_FILTER_MYSCORE 890 +#define IDS_LEADERBOARD_FILTER_OVERALL 891 +#define IDS_LEADERBOARD_GAMERTAG 892 +#define IDS_LEADERBOARD_KILLS_EASY 893 +#define IDS_LEADERBOARD_KILLS_HARD 894 +#define IDS_LEADERBOARD_KILLS_NORMAL 895 +#define IDS_LEADERBOARD_LOADING 896 +#define IDS_LEADERBOARD_MINING_BLOCKS_EASY 897 +#define IDS_LEADERBOARD_MINING_BLOCKS_HARD 898 +#define IDS_LEADERBOARD_MINING_BLOCKS_NORMAL 899 +#define IDS_LEADERBOARD_MINING_BLOCKS_PEACEFUL 900 +#define IDS_LEADERBOARD_NORESULTS 901 +#define IDS_LEADERBOARD_RANK 902 +#define IDS_LEADERBOARD_TRAVELLING_EASY 903 +#define IDS_LEADERBOARD_TRAVELLING_HARD 904 +#define IDS_LEADERBOARD_TRAVELLING_NORMAL 905 +#define IDS_LEADERBOARD_TRAVELLING_PEACEFUL 906 +#define IDS_LEADERBOARDS 907 +#define IDS_LEVELTYPE_NORMAL 908 +#define IDS_LEVELTYPE_SUPERFLAT 909 +#define IDS_LOAD 910 +#define IDS_LOAD_SAVED_WORLD 911 +#define IDS_MAX_BOATS 912 +#define IDS_MAX_CHICKENS_BRED 913 +#define IDS_MAX_CHICKENS_SPAWNED 914 +#define IDS_MAX_ENEMIES_SPAWNED 915 +#define IDS_MAX_HANGINGENTITIES 916 +#define IDS_MAX_MOOSHROOMS_SPAWNED 917 +#define IDS_MAX_MUSHROOMCOWS_BRED 918 +#define IDS_MAX_PIGS_SHEEP_COWS_CATS_BRED 919 +#define IDS_MAX_PIGS_SHEEP_COWS_CATS_SPAWNED 920 +#define IDS_MAX_SKULL_TILES 921 +#define IDS_MAX_SQUID_SPAWNED 922 +#define IDS_MAX_VILLAGERS_SPAWNED 923 +#define IDS_MAX_WOLVES_BRED 924 +#define IDS_MAX_WOLVES_SPAWNED 925 +#define IDS_MINUTES 926 +#define IDS_MODERATOR 927 +#define IDS_MORE_OPTIONS 928 +#define IDS_MULTIPLAYER_FULL_TEXT 929 +#define IDS_MULTIPLAYER_FULL_TITLE 930 +#define IDS_MUSHROOM_COW 931 +#define IDS_MUST_SIGN_IN_TEXT 932 +#define IDS_MUST_SIGN_IN_TITLE 933 +#define IDS_NAME_CAPTION 934 +#define IDS_NAME_CAPTION_TEXT 935 +#define IDS_NAME_DESC 936 +#define IDS_NAME_DESC_TEXT 937 +#define IDS_NAME_TITLE 938 +#define IDS_NAME_TITLE_TEXT 939 +#define IDS_NAME_WORLD 940 +#define IDS_NAME_WORLD_TEXT 941 +#define IDS_NO 942 +#define IDS_NO_DLCOFFERS 943 +#define IDS_NO_GAMES_FOUND 944 +#define IDS_NO_MULTIPLAYER_PRIVILEGE_HOST_TEXT 945 +#define IDS_NO_MULTIPLAYER_PRIVILEGE_JOIN_TEXT 946 +#define IDS_NO_MULTIPLAYER_PRIVILEGE_TITLE 947 +#define IDS_NO_SKIN_PACK 948 +#define IDS_NO_USER_CREATED_CONTENT_PRIVILEGE_ALL_LOCAL 949 +#define IDS_NO_USER_CREATED_CONTENT_PRIVILEGE_CREATE 950 +#define IDS_NO_USER_CREATED_CONTENT_PRIVILEGE_REMOTE 951 +#define IDS_NO_USER_CREATED_CONTENT_PRIVILEGE_SINGLE_LOCAL 952 +#define IDS_NODEVICE_ACCEPT 953 +#define IDS_NODEVICE_DECLINE 954 +#define IDS_NODEVICE_TEXT 955 +#define IDS_NODEVICE_TITLE 956 +#define IDS_NOFREESPACE_TEXT 957 +#define IDS_NOFREESPACE_TITLE 958 +#define IDS_NOTALLOWED_FRIENDSOFFRIENDS 959 +#define IDS_NOWPLAYING 960 +#define IDS_NULL 961 +#define IDS_OFF 962 +#define IDS_OK 963 +#define IDS_ON 964 +#define IDS_ONLINE_GAME 965 +#define IDS_OPTIONS 966 +#define IDS_OVERWRITESAVE_NO 967 +#define IDS_OVERWRITESAVE_TEXT 968 +#define IDS_OVERWRITESAVE_TITLE 969 +#define IDS_OVERWRITESAVE_YES 970 +#define IDS_OZELOT 971 +#define IDS_PIG 972 +#define IDS_PIGZOMBIE 973 +#define IDS_PLATFORM_NAME 974 +#define IDS_PLAY_GAME 975 +#define IDS_PLAY_TUTORIAL 976 +#define IDS_PLAYER_BANNED_LEVEL 977 +#define IDS_PLAYER_ENTERED_END 978 +#define IDS_PLAYER_JOINED 979 +#define IDS_PLAYER_KICKED 980 +#define IDS_PLAYER_LEFT 981 +#define IDS_PLAYER_LEFT_END 982 +#define IDS_PLAYER_VS_PLAYER 983 +#define IDS_PLAYERS 984 +#define IDS_PLAYERS_INVITE 985 +#define IDS_PLAYWITHOUTSAVING 986 +#define IDS_POTATO 987 +#define IDS_POTION_BLINDNESS 988 +#define IDS_POTION_BLINDNESS_POSTFIX 989 +#define IDS_POTION_CONFUSION 990 +#define IDS_POTION_CONFUSION_POSTFIX 991 +#define IDS_POTION_DAMAGEBOOST 992 +#define IDS_POTION_DAMAGEBOOST_POSTFIX 993 +#define IDS_POTION_DESC_DAMAGEBOOST 994 +#define IDS_POTION_DESC_EMPTY 995 +#define IDS_POTION_DESC_FIRERESISTANCE 996 +#define IDS_POTION_DESC_HARM 997 +#define IDS_POTION_DESC_HEAL 998 +#define IDS_POTION_DESC_INVISIBILITY 999 +#define IDS_POTION_DESC_MOVESLOWDOWN 1000 +#define IDS_POTION_DESC_MOVESPEED 1001 +#define IDS_POTION_DESC_NIGHTVISION 1002 +#define IDS_POTION_DESC_POISON 1003 +#define IDS_POTION_DESC_REGENERATION 1004 +#define IDS_POTION_DESC_WATER_BOTTLE 1005 +#define IDS_POTION_DESC_WEAKNESS 1006 +#define IDS_POTION_DIGSLOWDOWN 1007 +#define IDS_POTION_DIGSLOWDOWN_POSTFIX 1008 +#define IDS_POTION_DIGSPEED 1009 +#define IDS_POTION_DIGSPEED_POSTFIX 1010 +#define IDS_POTION_EMPTY 1011 +#define IDS_POTION_FIRERESISTANCE 1012 +#define IDS_POTION_FIRERESISTANCE_POSTFIX 1013 +#define IDS_POTION_HARM 1014 +#define IDS_POTION_HARM_POSTFIX 1015 +#define IDS_POTION_HEAL 1016 +#define IDS_POTION_HEAL_POSTFIX 1017 +#define IDS_POTION_HUNGER 1018 +#define IDS_POTION_HUNGER_POSTFIX 1019 +#define IDS_POTION_INVISIBILITY 1020 +#define IDS_POTION_INVISIBILITY_POSTFIX 1021 +#define IDS_POTION_JUMP 1022 +#define IDS_POTION_JUMP_POSTFIX 1023 +#define IDS_POTION_MOVESLOWDOWN 1024 +#define IDS_POTION_MOVESLOWDOWN_POSTFIX 1025 +#define IDS_POTION_MOVESPEED 1026 +#define IDS_POTION_MOVESPEED_POSTFIX 1027 +#define IDS_POTION_NIGHTVISION 1028 +#define IDS_POTION_NIGHTVISION_POSTFIX 1029 +#define IDS_POTION_POISON 1030 +#define IDS_POTION_POISON_POSTFIX 1031 +#define IDS_POTION_POTENCY_0 1032 +#define IDS_POTION_POTENCY_1 1033 +#define IDS_POTION_POTENCY_2 1034 +#define IDS_POTION_POTENCY_3 1035 +#define IDS_POTION_PREFIX_ACRID 1036 +#define IDS_POTION_PREFIX_ARTLESS 1037 +#define IDS_POTION_PREFIX_AWKWARD 1038 +#define IDS_POTION_PREFIX_BLAND 1039 +#define IDS_POTION_PREFIX_BULKY 1040 +#define IDS_POTION_PREFIX_BUNGLING 1041 +#define IDS_POTION_PREFIX_BUTTERED 1042 +#define IDS_POTION_PREFIX_CHARMING 1043 +#define IDS_POTION_PREFIX_CLEAR 1044 +#define IDS_POTION_PREFIX_CORDIAL 1045 +#define IDS_POTION_PREFIX_DASHING 1046 +#define IDS_POTION_PREFIX_DEBONAIR 1047 +#define IDS_POTION_PREFIX_DIFFUSE 1048 +#define IDS_POTION_PREFIX_ELEGANT 1049 +#define IDS_POTION_PREFIX_FANCY 1050 +#define IDS_POTION_PREFIX_FLAT 1051 +#define IDS_POTION_PREFIX_FOUL 1052 +#define IDS_POTION_PREFIX_GRENADE 1053 +#define IDS_POTION_PREFIX_GROSS 1054 +#define IDS_POTION_PREFIX_HARSH 1055 +#define IDS_POTION_PREFIX_MILKY 1056 +#define IDS_POTION_PREFIX_MUNDANE 1057 +#define IDS_POTION_PREFIX_ODORLESS 1058 +#define IDS_POTION_PREFIX_POTENT 1059 +#define IDS_POTION_PREFIX_RANK 1060 +#define IDS_POTION_PREFIX_REFINED 1061 +#define IDS_POTION_PREFIX_SMOOTH 1062 +#define IDS_POTION_PREFIX_SPARKLING 1063 +#define IDS_POTION_PREFIX_STINKY 1064 +#define IDS_POTION_PREFIX_SUAVE 1065 +#define IDS_POTION_PREFIX_THICK 1066 +#define IDS_POTION_PREFIX_THIN 1067 +#define IDS_POTION_PREFIX_UNINTERESTING 1068 +#define IDS_POTION_REGENERATION 1069 +#define IDS_POTION_REGENERATION_POSTFIX 1070 +#define IDS_POTION_RESISTANCE 1071 +#define IDS_POTION_RESISTANCE_POSTFIX 1072 +#define IDS_POTION_WATERBREATHING 1073 +#define IDS_POTION_WATERBREATHING_POSTFIX 1074 +#define IDS_POTION_WEAKNESS 1075 +#define IDS_POTION_WEAKNESS_POSTFIX 1076 +#define IDS_PRESS_START_TO_JOIN 1077 +#define IDS_PRIV_ATTACK_ANIMAL_TOGGLE_OFF 1078 +#define IDS_PRIV_ATTACK_ANIMAL_TOGGLE_ON 1079 +#define IDS_PRIV_ATTACK_MOB_TOGGLE_OFF 1080 +#define IDS_PRIV_ATTACK_MOB_TOGGLE_ON 1081 +#define IDS_PRIV_ATTACK_PLAYER_TOGGLE_OFF 1082 +#define IDS_PRIV_ATTACK_PLAYER_TOGGLE_ON 1083 +#define IDS_PRIV_BUILD_TOGGLE_OFF 1084 +#define IDS_PRIV_BUILD_TOGGLE_ON 1085 +#define IDS_PRIV_CAN_EXHAUSTION_TOGGLE_OFF 1086 +#define IDS_PRIV_CAN_EXHAUSTION_TOGGLE_ON 1087 +#define IDS_PRIV_CAN_FLY_TOGGLE_OFF 1088 +#define IDS_PRIV_CAN_FLY_TOGGLE_ON 1089 +#define IDS_PRIV_CAN_INVISIBLE_TOGGLE_OFF 1090 +#define IDS_PRIV_CAN_INVISIBLE_TOGGLE_ON 1091 +#define IDS_PRIV_CAN_TELEPORT_TOGGLE_OFF 1092 +#define IDS_PRIV_CAN_TELEPORT_TOGGLE_ON 1093 +#define IDS_PRIV_EXHAUSTION_TOGGLE_OFF 1094 +#define IDS_PRIV_EXHAUSTION_TOGGLE_ON 1095 +#define IDS_PRIV_FLY_TOGGLE_OFF 1096 +#define IDS_PRIV_FLY_TOGGLE_ON 1097 +#define IDS_PRIV_INVISIBLE_TOGGLE_OFF 1098 +#define IDS_PRIV_INVISIBLE_TOGGLE_ON 1099 +#define IDS_PRIV_INVULNERABLE_TOGGLE_OFF 1100 +#define IDS_PRIV_INVULNERABLE_TOGGLE_ON 1101 +#define IDS_PRIV_MINE_TOGGLE_OFF 1102 +#define IDS_PRIV_MINE_TOGGLE_ON 1103 +#define IDS_PRIV_MODERATOR_TOGGLE_OFF 1104 +#define IDS_PRIV_MODERATOR_TOGGLE_ON 1105 +#define IDS_PRIV_USE_CONTAINERS_TOGGLE_OFF 1106 +#define IDS_PRIV_USE_CONTAINERS_TOGGLE_ON 1107 +#define IDS_PRIV_USE_DOORS_TOGGLE_OFF 1108 +#define IDS_PRIV_USE_DOORS_TOGGLE_ON 1109 +#define IDS_PRO_ACHIEVEMENTPROBLEM_TEXT 1110 +#define IDS_PRO_ACHIEVEMENTPROBLEM_TITLE 1111 +#define IDS_PRO_GUESTPROFILE_TEXT 1112 +#define IDS_PRO_GUESTPROFILE_TITLE 1113 +#define IDS_PRO_NOPROFILE_TITLE 1114 +#define IDS_PRO_NOPROFILEOPTIONS_TEXT 1115 +#define IDS_PRO_NOTONLINE_ACCEPT 1116 +#define IDS_PRO_NOTONLINE_DECLINE 1117 +#define IDS_PRO_NOTONLINE_TEXT 1118 +#define IDS_PRO_NOTONLINE_TITLE 1119 +#define IDS_PRO_PROFILEPROBLEM_TEXT 1120 +#define IDS_PRO_RETURNEDTOMENU_ACCEPT 1121 +#define IDS_PRO_RETURNEDTOMENU_TEXT 1122 +#define IDS_PRO_RETURNEDTOMENU_TITLE 1123 +#define IDS_PRO_RETURNEDTOTITLESCREEN_TEXT 1124 +#define IDS_PRO_UNLOCKGAME_TEXT 1125 +#define IDS_PRO_UNLOCKGAME_TITLE 1126 +#define IDS_PRO_XBOXLIVE_NOTIFICATION 1127 +#define IDS_PROGRESS_AUTOSAVING_LEVEL 1128 +#define IDS_PROGRESS_BUILDING_TERRAIN 1129 +#define IDS_PROGRESS_CONNECTING 1130 +#define IDS_PROGRESS_CONVERTING_TO_OFFLINE_GAME 1131 +#define IDS_PROGRESS_DOWNLOADING_TERRAIN 1132 +#define IDS_PROGRESS_ENTERING_END 1133 +#define IDS_PROGRESS_ENTERING_NETHER 1134 +#define IDS_PROGRESS_GENERATING_LEVEL 1135 +#define IDS_PROGRESS_GENERATING_SPAWN_AREA 1136 +#define IDS_PROGRESS_HOST_SAVING 1137 +#define IDS_PROGRESS_INITIALISING_SERVER 1138 +#define IDS_PROGRESS_LEAVING_END 1139 +#define IDS_PROGRESS_LEAVING_NETHER 1140 +#define IDS_PROGRESS_LOADING_LEVEL 1141 +#define IDS_PROGRESS_LOADING_SPAWN_AREA 1142 +#define IDS_PROGRESS_NEW_WORLD_SEED 1143 +#define IDS_PROGRESS_RESPAWNING 1144 +#define IDS_PROGRESS_SAVING_CHUNKS 1145 +#define IDS_PROGRESS_SAVING_LEVEL 1146 +#define IDS_PROGRESS_SAVING_PLAYERS 1147 +#define IDS_PROGRESS_SAVING_TO_DISC 1148 +#define IDS_PROGRESS_SIMULATING_WORLD 1149 +#define IDS_REINSTALL_AVATAR_ITEM_1 1150 +#define IDS_REINSTALL_AVATAR_ITEM_2 1151 +#define IDS_REINSTALL_AVATAR_ITEM_3 1152 +#define IDS_REINSTALL_CONTENT 1153 +#define IDS_REINSTALL_GAMERPIC_1 1154 +#define IDS_REINSTALL_GAMERPIC_2 1155 +#define IDS_REINSTALL_THEME 1156 +#define IDS_RENAME_WORLD_TEXT 1157 +#define IDS_RENAME_WORLD_TITLE 1158 +#define IDS_REPAIR_AND_NAME 1159 +#define IDS_REPAIR_COST 1160 +#define IDS_REPAIR_EXPENSIVE 1161 +#define IDS_REQUIRED_ITEMS_FOR_TRADE 1162 +#define IDS_RESET_NETHER 1163 +#define IDS_RESET_TO_DEFAULTS 1164 +#define IDS_RESETNETHER_TEXT 1165 +#define IDS_RESETNETHER_TITLE 1166 +#define IDS_RESPAWN 1167 +#define IDS_RESUME_GAME 1168 +#define IDS_RETURNEDTOMENU_TITLE 1169 +#define IDS_RETURNEDTOTITLESCREEN_TEXT 1170 +#define IDS_SAVE_GAME 1171 +#define IDS_SAVE_ICON_MESSAGE 1172 +#define IDS_SEED 1173 +#define IDS_SELECTAGAIN 1174 +#define IDS_SELECTANEWDEVICE 1175 +#define IDS_SELECTED 1176 +#define IDS_SELECTED_SKIN 1177 +#define IDS_SETTINGS 1178 +#define IDS_SHEEP 1179 +#define IDS_SIGN_TITLE 1180 +#define IDS_SIGN_TITLE_TEXT 1181 +#define IDS_SILVERFISH 1182 +#define IDS_SKELETON 1183 +#define IDS_SKINS 1184 +#define IDS_SLIDER_AUTOSAVE 1185 +#define IDS_SLIDER_AUTOSAVE_OFF 1186 +#define IDS_SLIDER_DIFFICULTY 1187 +#define IDS_SLIDER_GAMMA 1188 +#define IDS_SLIDER_INTERFACEOPACITY 1189 +#define IDS_SLIDER_MUSIC 1190 +#define IDS_SLIDER_SENSITIVITY_INGAME 1191 +#define IDS_SLIDER_SENSITIVITY_INMENU 1192 +#define IDS_SLIDER_SOUND 1193 +#define IDS_SLIDER_UISIZE 1194 +#define IDS_SLIDER_UISIZESPLITSCREEN 1195 +#define IDS_SLIME 1196 +#define IDS_SNOWMAN 1197 +#define IDS_SOCIAL_DEFAULT_CAPTION 1198 +#define IDS_SOCIAL_DEFAULT_DESCRIPTION 1199 +#define IDS_SOCIAL_LABEL_CAPTION 1200 +#define IDS_SOCIAL_LABEL_DESCRIPTION 1201 +#define IDS_SOCIAL_TEXT 1202 +#define IDS_SOUTHPAW 1203 +#define IDS_SPIDER 1204 +#define IDS_SQUID 1205 +#define IDS_START_GAME 1206 +#define IDS_STO_SAVING_LONG 1207 +#define IDS_STO_SAVING_SHORT 1208 +#define IDS_STORAGEDEVICEPROBLEM_TITLE 1209 +#define IDS_STRINGVERIFY_AWAITING_APPROVAL 1210 +#define IDS_STRINGVERIFY_CENSORED 1211 +#define IDS_SUPERFLAT_WORLD 1212 +#define IDS_SURVIVAL 1213 +#define IDS_TELEPORT 1214 +#define IDS_TELEPORT_TO_ME 1215 +#define IDS_TELEPORT_TO_PLAYER 1216 +#define IDS_TEXT_DELETE_SAVE 1217 +#define IDS_TEXT_SAVEOPTIONS 1218 +#define IDS_TEXTURE_PACK_TRIALVERSION 1219 +#define IDS_TEXTUREPACK_FULLVERSION 1220 +#define IDS_THEMES 1221 +#define IDS_TILE_ANVIL 1222 +#define IDS_TILE_ANVIL_INTACT 1223 +#define IDS_TILE_ANVIL_SLIGHTLYDAMAGED 1224 +#define IDS_TILE_ANVIL_VERYDAMAGED 1225 +#define IDS_TILE_BED 1226 +#define IDS_TILE_BED_MESLEEP 1227 +#define IDS_TILE_BED_NO_SLEEP 1228 +#define IDS_TILE_BED_NOT_VALID 1229 +#define IDS_TILE_BED_NOTSAFE 1230 +#define IDS_TILE_BED_OCCUPIED 1231 +#define IDS_TILE_BED_PLAYERSLEEP 1232 +#define IDS_TILE_BEDROCK 1233 +#define IDS_TILE_BIRCH 1234 +#define IDS_TILE_BIRCHWOOD_PLANKS 1235 +#define IDS_TILE_BLOCK_DIAMOND 1236 +#define IDS_TILE_BLOCK_GOLD 1237 +#define IDS_TILE_BLOCK_IRON 1238 +#define IDS_TILE_BLOCK_LAPIS 1239 +#define IDS_TILE_BOOKSHELF 1240 +#define IDS_TILE_BREWINGSTAND 1241 +#define IDS_TILE_BRICK 1242 +#define IDS_TILE_BUTTON 1243 +#define IDS_TILE_CACTUS 1244 +#define IDS_TILE_CAKE 1245 +#define IDS_TILE_CARPET 1246 +#define IDS_TILE_CARPET_BLACK 1247 +#define IDS_TILE_CARPET_BLUE 1248 +#define IDS_TILE_CARPET_BROWN 1249 +#define IDS_TILE_CARPET_CYAN 1250 +#define IDS_TILE_CARPET_GRAY 1251 +#define IDS_TILE_CARPET_GREEN 1252 +#define IDS_TILE_CARPET_LIGHT_BLUE 1253 +#define IDS_TILE_CARPET_LIME 1254 +#define IDS_TILE_CARPET_MAGENTA 1255 +#define IDS_TILE_CARPET_ORANGE 1256 +#define IDS_TILE_CARPET_PINK 1257 +#define IDS_TILE_CARPET_PURPLE 1258 +#define IDS_TILE_CARPET_RED 1259 +#define IDS_TILE_CARPET_SILVER 1260 +#define IDS_TILE_CARPET_WHITE 1261 +#define IDS_TILE_CARPET_YELLOW 1262 +#define IDS_TILE_CARROTS 1263 +#define IDS_TILE_CAULDRON 1264 +#define IDS_TILE_CHEST 1265 +#define IDS_TILE_CLAY 1266 +#define IDS_TILE_CLOTH 1267 +#define IDS_TILE_CLOTH_BLACK 1268 +#define IDS_TILE_CLOTH_BLUE 1269 +#define IDS_TILE_CLOTH_BROWN 1270 +#define IDS_TILE_CLOTH_CYAN 1271 +#define IDS_TILE_CLOTH_GRAY 1272 +#define IDS_TILE_CLOTH_GREEN 1273 +#define IDS_TILE_CLOTH_LIGHT_BLUE 1274 +#define IDS_TILE_CLOTH_LIME 1275 +#define IDS_TILE_CLOTH_MAGENTA 1276 +#define IDS_TILE_CLOTH_ORANGE 1277 +#define IDS_TILE_CLOTH_PINK 1278 +#define IDS_TILE_CLOTH_PURPLE 1279 +#define IDS_TILE_CLOTH_RED 1280 +#define IDS_TILE_CLOTH_SILVER 1281 +#define IDS_TILE_CLOTH_WHITE 1282 +#define IDS_TILE_CLOTH_YELLOW 1283 +#define IDS_TILE_COBBLESTONE_WALL 1284 +#define IDS_TILE_COBBLESTONE_WALL_MOSSY 1285 +#define IDS_TILE_COCOA 1286 +#define IDS_TILE_CROPS 1287 +#define IDS_TILE_DEAD_BUSH 1288 +#define IDS_TILE_DETECTOR_RAIL 1289 +#define IDS_TILE_DIODE 1290 +#define IDS_TILE_DIRT 1291 +#define IDS_TILE_DISPENSER 1292 +#define IDS_TILE_DOOR_IRON 1293 +#define IDS_TILE_DOOR_WOOD 1294 +#define IDS_TILE_DRAGONEGG 1295 +#define IDS_TILE_EMERALDBLOCK 1296 +#define IDS_TILE_EMERALDORE 1297 +#define IDS_TILE_ENCHANTMENTTABLE 1298 +#define IDS_TILE_END_PORTAL 1299 +#define IDS_TILE_ENDERCHEST 1300 +#define IDS_TILE_ENDPORTALFRAME 1301 +#define IDS_TILE_FARMLAND 1302 +#define IDS_TILE_FENCE 1303 +#define IDS_TILE_FENCE_GATE 1304 +#define IDS_TILE_FERN 1305 +#define IDS_TILE_FIRE 1306 +#define IDS_TILE_FLOWER 1307 +#define IDS_TILE_FLOWERPOT 1308 +#define IDS_TILE_FURNACE 1309 +#define IDS_TILE_GLASS 1310 +#define IDS_TILE_GOLDEN_RAIL 1311 +#define IDS_TILE_GRASS 1312 +#define IDS_TILE_GRAVEL 1313 +#define IDS_TILE_HELL_ROCK 1314 +#define IDS_TILE_HELL_SAND 1315 +#define IDS_TILE_HUGE_MUSHROOM_1 1316 +#define IDS_TILE_HUGE_MUSHROOM_2 1317 +#define IDS_TILE_ICE 1318 +#define IDS_TILE_IRON_FENCE 1319 +#define IDS_TILE_JUKEBOX 1320 +#define IDS_TILE_JUNGLE_PLANKS 1321 +#define IDS_TILE_LADDER 1322 +#define IDS_TILE_LAVA 1323 +#define IDS_TILE_LEAVES 1324 +#define IDS_TILE_LEAVES_BIRCH 1325 +#define IDS_TILE_LEAVES_JUNGLE 1326 +#define IDS_TILE_LEAVES_OAK 1327 +#define IDS_TILE_LEAVES_SPRUCE 1328 +#define IDS_TILE_LEVER 1329 +#define IDS_TILE_LIGHT_GEM 1330 +#define IDS_TILE_LIT_PUMPKIN 1331 +#define IDS_TILE_LOCKED_CHEST 1332 +#define IDS_TILE_LOG 1333 +#define IDS_TILE_LOG_BIRCH 1334 +#define IDS_TILE_LOG_JUNGLE 1335 +#define IDS_TILE_LOG_OAK 1336 +#define IDS_TILE_LOG_SPRUCE 1337 +#define IDS_TILE_MELON 1338 +#define IDS_TILE_MELON_STEM 1339 +#define IDS_TILE_MOB_SPAWNER 1340 +#define IDS_TILE_MONSTER_STONE_EGG 1341 +#define IDS_TILE_MUSHROOM 1342 +#define IDS_TILE_MUSIC_BLOCK 1343 +#define IDS_TILE_MYCEL 1344 +#define IDS_TILE_NETHER_QUARTZ 1345 +#define IDS_TILE_NETHERBRICK 1346 +#define IDS_TILE_NETHERFENCE 1347 +#define IDS_TILE_NETHERSTALK 1348 +#define IDS_TILE_NOT_GATE 1349 +#define IDS_TILE_OAK 1350 +#define IDS_TILE_OAKWOOD_PLANKS 1351 +#define IDS_TILE_OBSIDIAN 1352 +#define IDS_TILE_ORE_COAL 1353 +#define IDS_TILE_ORE_DIAMOND 1354 +#define IDS_TILE_ORE_GOLD 1355 +#define IDS_TILE_ORE_IRON 1356 +#define IDS_TILE_ORE_LAPIS 1357 +#define IDS_TILE_ORE_REDSTONE 1358 +#define IDS_TILE_PISTON_BASE 1359 +#define IDS_TILE_PISTON_STICK_BASE 1360 +#define IDS_TILE_PORTAL 1361 +#define IDS_TILE_POTATOES 1362 +#define IDS_TILE_PRESSURE_PLATE 1363 +#define IDS_TILE_PUMPKIN 1364 +#define IDS_TILE_PUMPKIN_STEM 1365 +#define IDS_TILE_QUARTZ_BLOCK 1366 +#define IDS_TILE_QUARTZ_BLOCK_CHISELED 1367 +#define IDS_TILE_QUARTZ_BLOCK_LINES 1368 +#define IDS_TILE_RAIL 1369 +#define IDS_TILE_REDSTONE_DUST 1370 +#define IDS_TILE_REDSTONE_LIGHT 1371 +#define IDS_TILE_REEDS 1372 +#define IDS_TILE_ROSE 1373 +#define IDS_TILE_SAND 1374 +#define IDS_TILE_SANDSTONE 1375 +#define IDS_TILE_SANDSTONE_CHISELED 1376 +#define IDS_TILE_SANDSTONE_SMOOTH 1377 +#define IDS_TILE_SAPLING 1378 +#define IDS_TILE_SAPLING_BIRCH 1379 +#define IDS_TILE_SAPLING_JUNGLE 1380 +#define IDS_TILE_SAPLING_OAK 1381 +#define IDS_TILE_SAPLING_SPRUCE 1382 +#define IDS_TILE_SHRUB 1383 +#define IDS_TILE_SIGN 1384 +#define IDS_TILE_SKULL 1385 +#define IDS_TILE_SNOW 1386 +#define IDS_TILE_SPONGE 1387 +#define IDS_TILE_SPRUCE 1388 +#define IDS_TILE_SPRUCEWOOD_PLANKS 1389 +#define IDS_TILE_STAIRS_BIRCHWOOD 1390 +#define IDS_TILE_STAIRS_BRICKS 1391 +#define IDS_TILE_STAIRS_JUNGLEWOOD 1392 +#define IDS_TILE_STAIRS_NETHERBRICK 1393 +#define IDS_TILE_STAIRS_QUARTZ 1394 +#define IDS_TILE_STAIRS_SANDSTONE 1395 +#define IDS_TILE_STAIRS_SPRUCEWOOD 1396 +#define IDS_TILE_STAIRS_STONE 1397 +#define IDS_TILE_STAIRS_STONE_BRICKS_SMOOTH 1398 +#define IDS_TILE_STAIRS_WOOD 1399 +#define IDS_TILE_STONE 1400 +#define IDS_TILE_STONE_BRICK 1401 +#define IDS_TILE_STONE_BRICK_SMOOTH 1402 +#define IDS_TILE_STONE_BRICK_SMOOTH_CHISELED 1403 +#define IDS_TILE_STONE_BRICK_SMOOTH_CRACKED 1404 +#define IDS_TILE_STONE_BRICK_SMOOTH_MOSSY 1405 +#define IDS_TILE_STONE_MOSS 1406 +#define IDS_TILE_STONE_SILVERFISH 1407 +#define IDS_TILE_STONE_SILVERFISH_COBBLESTONE 1408 +#define IDS_TILE_STONE_SILVERFISH_STONE_BRICK 1409 +#define IDS_TILE_STONESLAB 1410 +#define IDS_TILE_STONESLAB_BIRCH 1411 +#define IDS_TILE_STONESLAB_BRICK 1412 +#define IDS_TILE_STONESLAB_COBBLE 1413 +#define IDS_TILE_STONESLAB_JUNGLE 1414 +#define IDS_TILE_STONESLAB_NETHERBRICK 1415 +#define IDS_TILE_STONESLAB_OAK 1416 +#define IDS_TILE_STONESLAB_QUARTZ 1417 +#define IDS_TILE_STONESLAB_SAND 1418 +#define IDS_TILE_STONESLAB_SMOOTHBRICK 1419 +#define IDS_TILE_STONESLAB_SPRUCE 1420 +#define IDS_TILE_STONESLAB_STONE 1421 +#define IDS_TILE_STONESLAB_WOOD 1422 +#define IDS_TILE_TALL_GRASS 1423 +#define IDS_TILE_THIN_GLASS 1424 +#define IDS_TILE_TNT 1425 +#define IDS_TILE_TORCH 1426 +#define IDS_TILE_TORCHCHARCOAL 1427 +#define IDS_TILE_TORCHCOAL 1428 +#define IDS_TILE_TRAPDOOR 1429 +#define IDS_TILE_TRIPWIRE 1430 +#define IDS_TILE_TRIPWIRE_SOURCE 1431 +#define IDS_TILE_VINE 1432 +#define IDS_TILE_WATER 1433 +#define IDS_TILE_WATERLILY 1434 +#define IDS_TILE_WEB 1435 +#define IDS_TILE_WHITESTONE 1436 +#define IDS_TILE_WORKBENCH 1437 +#define IDS_TIPS_GAMETIP_0 1438 +#define IDS_TIPS_GAMETIP_1 1439 +#define IDS_TIPS_GAMETIP_10 1440 +#define IDS_TIPS_GAMETIP_11 1441 +#define IDS_TIPS_GAMETIP_12 1442 +#define IDS_TIPS_GAMETIP_13 1443 +#define IDS_TIPS_GAMETIP_14 1444 +#define IDS_TIPS_GAMETIP_15 1445 +#define IDS_TIPS_GAMETIP_16 1446 +#define IDS_TIPS_GAMETIP_17 1447 +#define IDS_TIPS_GAMETIP_18 1448 +#define IDS_TIPS_GAMETIP_19 1449 +#define IDS_TIPS_GAMETIP_2 1450 +#define IDS_TIPS_GAMETIP_20 1451 +#define IDS_TIPS_GAMETIP_21 1452 +#define IDS_TIPS_GAMETIP_22 1453 +#define IDS_TIPS_GAMETIP_23 1454 +#define IDS_TIPS_GAMETIP_24 1455 +#define IDS_TIPS_GAMETIP_25 1456 +#define IDS_TIPS_GAMETIP_26 1457 +#define IDS_TIPS_GAMETIP_27 1458 +#define IDS_TIPS_GAMETIP_28 1459 +#define IDS_TIPS_GAMETIP_29 1460 +#define IDS_TIPS_GAMETIP_3 1461 +#define IDS_TIPS_GAMETIP_30 1462 +#define IDS_TIPS_GAMETIP_31 1463 +#define IDS_TIPS_GAMETIP_32 1464 +#define IDS_TIPS_GAMETIP_33 1465 +#define IDS_TIPS_GAMETIP_34 1466 +#define IDS_TIPS_GAMETIP_35 1467 +#define IDS_TIPS_GAMETIP_36 1468 +#define IDS_TIPS_GAMETIP_37 1469 +#define IDS_TIPS_GAMETIP_38 1470 +#define IDS_TIPS_GAMETIP_39 1471 +#define IDS_TIPS_GAMETIP_4 1472 +#define IDS_TIPS_GAMETIP_40 1473 +#define IDS_TIPS_GAMETIP_41 1474 +#define IDS_TIPS_GAMETIP_42 1475 +#define IDS_TIPS_GAMETIP_43 1476 +#define IDS_TIPS_GAMETIP_44 1477 +#define IDS_TIPS_GAMETIP_45 1478 +#define IDS_TIPS_GAMETIP_46 1479 +#define IDS_TIPS_GAMETIP_47 1480 +#define IDS_TIPS_GAMETIP_48 1481 +#define IDS_TIPS_GAMETIP_49 1482 +#define IDS_TIPS_GAMETIP_5 1483 +#define IDS_TIPS_GAMETIP_50 1484 +#define IDS_TIPS_GAMETIP_6 1485 +#define IDS_TIPS_GAMETIP_7 1486 +#define IDS_TIPS_GAMETIP_8 1487 +#define IDS_TIPS_GAMETIP_9 1488 +#define IDS_TIPS_GAMETIP_NEWDLC 1489 +#define IDS_TIPS_GAMETIP_SKINPACKS 1490 +#define IDS_TIPS_TRIVIA_1 1491 +#define IDS_TIPS_TRIVIA_10 1492 +#define IDS_TIPS_TRIVIA_11 1493 +#define IDS_TIPS_TRIVIA_12 1494 +#define IDS_TIPS_TRIVIA_13 1495 +#define IDS_TIPS_TRIVIA_14 1496 +#define IDS_TIPS_TRIVIA_15 1497 +#define IDS_TIPS_TRIVIA_16 1498 +#define IDS_TIPS_TRIVIA_17 1499 +#define IDS_TIPS_TRIVIA_18 1500 +#define IDS_TIPS_TRIVIA_19 1501 +#define IDS_TIPS_TRIVIA_2 1502 +#define IDS_TIPS_TRIVIA_20 1503 +#define IDS_TIPS_TRIVIA_3 1504 +#define IDS_TIPS_TRIVIA_4 1505 +#define IDS_TIPS_TRIVIA_5 1506 +#define IDS_TIPS_TRIVIA_6 1507 +#define IDS_TIPS_TRIVIA_7 1508 +#define IDS_TIPS_TRIVIA_8 1509 +#define IDS_TIPS_TRIVIA_9 1510 +#define IDS_TITLE_DECLINE_SAVE_GAME 1511 +#define IDS_TITLE_RENAME 1512 +#define IDS_TITLE_RENAMESAVE 1513 +#define IDS_TITLE_SAVE_GAME 1514 +#define IDS_TITLE_START_GAME 1515 +#define IDS_TITLE_UPDATE_NAME 1516 +#define IDS_TITLEUPDATE 1517 +#define IDS_TNT_EXPLODES 1518 +#define IDS_TOOLTIPS_ACCEPT 1519 +#define IDS_TOOLTIPS_ALL_GAMES 1520 +#define IDS_TOOLTIPS_BACK 1521 +#define IDS_TOOLTIPS_BANLEVEL 1522 +#define IDS_TOOLTIPS_BLOCK 1523 +#define IDS_TOOLTIPS_CANCEL 1524 +#define IDS_TOOLTIPS_CANCEL_JOIN 1525 +#define IDS_TOOLTIPS_CHANGE_FILTER 1526 +#define IDS_TOOLTIPS_CHANGE_GROUP 1527 +#define IDS_TOOLTIPS_CHANGEDEVICE 1528 +#define IDS_TOOLTIPS_CHANGEPITCH 1529 +#define IDS_TOOLTIPS_CLEAR_QUICK_SELECT 1530 +#define IDS_TOOLTIPS_CLEARSLOTS 1531 +#define IDS_TOOLTIPS_COLLECT 1532 +#define IDS_TOOLTIPS_CONTINUE 1533 +#define IDS_TOOLTIPS_CRAFTING 1534 +#define IDS_TOOLTIPS_CREATE 1535 +#define IDS_TOOLTIPS_CREATIVE 1536 +#define IDS_TOOLTIPS_CURE 1537 +#define IDS_TOOLTIPS_DELETE 1538 +#define IDS_TOOLTIPS_DELETESAVE 1539 +#define IDS_TOOLTIPS_DETONATE 1540 +#define IDS_TOOLTIPS_DRAW_BOW 1541 +#define IDS_TOOLTIPS_DRINK 1542 +#define IDS_TOOLTIPS_DROP_ALL 1543 +#define IDS_TOOLTIPS_DROP_GENERIC 1544 +#define IDS_TOOLTIPS_DROP_ONE 1545 +#define IDS_TOOLTIPS_DYE 1546 +#define IDS_TOOLTIPS_DYECOLLAR 1547 +#define IDS_TOOLTIPS_EAT 1548 +#define IDS_TOOLTIPS_EJECT 1549 +#define IDS_TOOLTIPS_EMPTY 1550 +#define IDS_TOOLTIPS_EQUIP 1551 +#define IDS_TOOLTIPS_EXECUTE_COMMAND 1552 +#define IDS_TOOLTIPS_EXIT 1553 +#define IDS_TOOLTIPS_FEED 1554 +#define IDS_TOOLTIPS_FOLLOWME 1555 +#define IDS_TOOLTIPS_GROW 1556 +#define IDS_TOOLTIPS_HANG 1557 +#define IDS_TOOLTIPS_HARVEST 1558 +#define IDS_TOOLTIPS_HEAL 1559 +#define IDS_TOOLTIPS_HIDE 1560 +#define IDS_TOOLTIPS_HIT 1561 +#define IDS_TOOLTIPS_IGNITE 1562 +#define IDS_TOOLTIPS_INSTALL 1563 +#define IDS_TOOLTIPS_INSTALL_FULL 1564 +#define IDS_TOOLTIPS_INSTALL_TRIAL 1565 +#define IDS_TOOLTIPS_INVITE_FRIENDS 1566 +#define IDS_TOOLTIPS_INVITE_PARTY 1567 +#define IDS_TOOLTIPS_KICK 1568 +#define IDS_TOOLTIPS_LOVEMODE 1569 +#define IDS_TOOLTIPS_MILK 1570 +#define IDS_TOOLTIPS_MINE 1571 +#define IDS_TOOLTIPS_NAVIGATE 1572 +#define IDS_TOOLTIPS_NEXT 1573 +#define IDS_TOOLTIPS_OPEN 1574 +#define IDS_TOOLTIPS_OPTIONS 1575 +#define IDS_TOOLTIPS_PAGE_DOWN 1576 +#define IDS_TOOLTIPS_PAGE_UP 1577 +#define IDS_TOOLTIPS_PAGEDOWN 1578 +#define IDS_TOOLTIPS_PAGEUP 1579 +#define IDS_TOOLTIPS_PARTY_GAMES 1580 +#define IDS_TOOLTIPS_PICKUP_ALL 1581 +#define IDS_TOOLTIPS_PICKUP_GENERIC 1582 +#define IDS_TOOLTIPS_PICKUP_HALF 1583 +#define IDS_TOOLTIPS_PICKUPPLACE 1584 +#define IDS_TOOLTIPS_PLACE 1585 +#define IDS_TOOLTIPS_PLACE_ALL 1586 +#define IDS_TOOLTIPS_PLACE_GENERIC 1587 +#define IDS_TOOLTIPS_PLACE_ONE 1588 +#define IDS_TOOLTIPS_PLANT 1589 +#define IDS_TOOLTIPS_PLAY 1590 +#define IDS_TOOLTIPS_PREVIOUS 1591 +#define IDS_TOOLTIPS_PRIVILEGES 1592 +#define IDS_TOOLTIPS_QUICK_MOVE 1593 +#define IDS_TOOLTIPS_QUICK_MOVE_ARMOR 1594 +#define IDS_TOOLTIPS_QUICK_MOVE_FUEL 1595 +#define IDS_TOOLTIPS_QUICK_MOVE_INGREDIENT 1596 +#define IDS_TOOLTIPS_QUICK_MOVE_TOOL 1597 +#define IDS_TOOLTIPS_QUICK_MOVE_WEAPON 1598 +#define IDS_TOOLTIPS_READ 1599 +#define IDS_TOOLTIPS_REFRESH 1600 +#define IDS_TOOLTIPS_REINSTALL 1601 +#define IDS_TOOLTIPS_RELEASE_BOW 1602 +#define IDS_TOOLTIPS_REPAIR 1603 +#define IDS_TOOLTIPS_RIDE 1604 +#define IDS_TOOLTIPS_ROTATE 1605 +#define IDS_TOOLTIPS_SADDLE 1606 +#define IDS_TOOLTIPS_SAIL 1607 +#define IDS_TOOLTIPS_SAVEOPTIONS 1608 +#define IDS_TOOLTIPS_SELECT 1609 +#define IDS_TOOLTIPS_SELECT_SKIN 1610 +#define IDS_TOOLTIPS_SELECTDEVICE 1611 +#define IDS_TOOLTIPS_SEND_FRIEND_REQUEST 1612 +#define IDS_TOOLTIPS_SHARE 1613 +#define IDS_TOOLTIPS_SHEAR 1614 +#define IDS_TOOLTIPS_SHOW_DESCRIPTION 1615 +#define IDS_TOOLTIPS_SHOW_INGREDIENTS 1616 +#define IDS_TOOLTIPS_SHOW_INVENTORY 1617 +#define IDS_TOOLTIPS_SIT 1618 +#define IDS_TOOLTIPS_SLEEP 1619 +#define IDS_TOOLTIPS_SWAP 1620 +#define IDS_TOOLTIPS_SWIMUP 1621 +#define IDS_TOOLTIPS_TAME 1622 +#define IDS_TOOLTIPS_THROW 1623 +#define IDS_TOOLTIPS_TILL 1624 +#define IDS_TOOLTIPS_TRADE 1625 +#define IDS_TOOLTIPS_UNLOCKFULLVERSION 1626 +#define IDS_TOOLTIPS_USE 1627 +#define IDS_TOOLTIPS_VIEW_GAMERCARD 1628 +#define IDS_TOOLTIPS_VIEW_GAMERPROFILE 1629 +#define IDS_TOOLTIPS_WAKEUP 1630 +#define IDS_TOOLTIPS_WHAT_IS_THIS 1631 +#define IDS_TRIALOVER_TEXT 1632 +#define IDS_TRIALOVER_TITLE 1633 +#define IDS_TRUST_PLAYERS 1634 +#define IDS_TUTORIAL_BREEDING_OVERVIEW 1635 +#define IDS_TUTORIAL_COMPLETED 1636 +#define IDS_TUTORIAL_COMPLETED_EXPLORE 1637 +#define IDS_TUTORIAL_CONSTRAINT_TUTORIAL_AREA 1638 +#define IDS_TUTORIAL_CREATIVE_OVERVIEW 1639 +#define IDS_TUTORIAL_FARMING_OVERVIEW 1640 +#define IDS_TUTORIAL_FEATURES_IN_THIS_AREA 1641 +#define IDS_TUTORIAL_FEATURES_OUTSIDE_THIS_AREA 1642 +#define IDS_TUTORIAL_GOLEM_OVERVIEW 1643 +#define IDS_TUTORIAL_HINT_ATTACK_WITH_TOOL 1644 +#define IDS_TUTORIAL_HINT_BOAT 1645 +#define IDS_TUTORIAL_HINT_CRAFT_NO_INGREDIENTS 1646 +#define IDS_TUTORIAL_HINT_DIGGER_ITEM_HATCHET 1647 +#define IDS_TUTORIAL_HINT_DIGGER_ITEM_PICKAXE 1648 +#define IDS_TUTORIAL_HINT_DIGGER_ITEM_SHOVEL 1649 +#define IDS_TUTORIAL_HINT_FISHING 1650 +#define IDS_TUTORIAL_HINT_HOLD_TO_MINE 1651 +#define IDS_TUTORIAL_HINT_INV_DROP 1652 +#define IDS_TUTORIAL_HINT_MINECART 1653 +#define IDS_TUTORIAL_HINT_PISTON_SELF_REPAIRING_BRIDGE 1654 +#define IDS_TUTORIAL_HINT_SWIM_UP 1655 +#define IDS_TUTORIAL_HINT_TOOL_DAMAGED 1656 +#define IDS_TUTORIAL_HTML_EXIT_PICTURE 1657 +#define IDS_TUTORIAL_NEW_FEATURES_CHOICE 1658 +#define IDS_TUTORIAL_PORTAL_OVERVIEW 1659 +#define IDS_TUTORIAL_PROMPT_ANVIL_MENU_OVERVIEW 1660 +#define IDS_TUTORIAL_PROMPT_ANVIL_OVERVIEW 1661 +#define IDS_TUTORIAL_PROMPT_BASIC_COMPLETE 1662 +#define IDS_TUTORIAL_PROMPT_BED_OVERVIEW 1663 +#define IDS_TUTORIAL_PROMPT_BOAT_OVERVIEW 1664 +#define IDS_TUTORIAL_PROMPT_BREEDING_OVERVIEW 1665 +#define IDS_TUTORIAL_PROMPT_BREWING_MENU_OVERVIEW 1666 +#define IDS_TUTORIAL_PROMPT_BREWING_OVERVIEW 1667 +#define IDS_TUTORIAL_PROMPT_CRAFT_OVERVIEW 1668 +#define IDS_TUTORIAL_PROMPT_CREATIVE_INV_OVERVIEW 1669 +#define IDS_TUTORIAL_PROMPT_CREATIVE_OVERVIEW 1670 +#define IDS_TUTORIAL_PROMPT_ENCHANTING_MENU_OVERVIEW 1671 +#define IDS_TUTORIAL_PROMPT_ENCHANTING_OVERVIEW 1672 +#define IDS_TUTORIAL_PROMPT_ENDERCHEST_OVERVIEW 1673 +#define IDS_TUTORIAL_PROMPT_FARMING_OVERVIEW 1674 +#define IDS_TUTORIAL_PROMPT_FISHING_OVERVIEW 1675 +#define IDS_TUTORIAL_PROMPT_FOOD_BAR_OVERVIEW 1676 +#define IDS_TUTORIAL_PROMPT_FURNACE_OVERVIEW 1677 +#define IDS_TUTORIAL_PROMPT_GOLEM_OVERVIEW 1678 +#define IDS_TUTORIAL_PROMPT_INV_OVERVIEW 1679 +#define IDS_TUTORIAL_PROMPT_MINECART_OVERVIEW 1680 +#define IDS_TUTORIAL_PROMPT_NEW_FEATURES_CHOICE 1681 +#define IDS_TUTORIAL_PROMPT_PORTAL_OVERVIEW 1682 +#define IDS_TUTORIAL_PROMPT_PRESS_A_TO_CONTINUE 1683 +#define IDS_TUTORIAL_PROMPT_PRESS_X_TO_TOGGLE_DESCRIPTION 1684 +#define IDS_TUTORIAL_PROMPT_PRESS_X_TO_TOGGLE_INGREDIENTS 1685 +#define IDS_TUTORIAL_PROMPT_PRESS_X_TO_TOGGLE_INVENTORY 1686 +#define IDS_TUTORIAL_PROMPT_REDSTONE_OVERVIEW 1687 +#define IDS_TUTORIAL_PROMPT_START_TUTORIAL 1688 +#define IDS_TUTORIAL_PROMPT_TRADING_MENU_OVERVIEW 1689 +#define IDS_TUTORIAL_PROMPT_TRADING_OVERVIEW 1690 +#define IDS_TUTORIAL_REDSTONE_OVERVIEW 1691 +#define IDS_TUTORIAL_REMINDER 1692 +#define IDS_TUTORIAL_TASK_ACTIVATE_PORTAL 1693 +#define IDS_TUTORIAL_TASK_ANVIL_COST 1694 +#define IDS_TUTORIAL_TASK_ANVIL_COST2 1695 +#define IDS_TUTORIAL_TASK_ANVIL_ENCHANTED_BOOKS 1696 +#define IDS_TUTORIAL_TASK_ANVIL_MENU_COST 1697 +#define IDS_TUTORIAL_TASK_ANVIL_MENU_ENCHANT 1698 +#define IDS_TUTORIAL_TASK_ANVIL_MENU_OVERVIEW 1699 +#define IDS_TUTORIAL_TASK_ANVIL_MENU_RENAMING 1700 +#define IDS_TUTORIAL_TASK_ANVIL_MENU_REPAIR 1701 +#define IDS_TUTORIAL_TASK_ANVIL_MENU_SACRIFICE 1702 +#define IDS_TUTORIAL_TASK_ANVIL_MENU_SMITH 1703 +#define IDS_TUTORIAL_TASK_ANVIL_MENU_START 1704 +#define IDS_TUTORIAL_TASK_ANVIL_OVERVIEW 1705 +#define IDS_TUTORIAL_TASK_ANVIL_RENAMING 1706 +#define IDS_TUTORIAL_TASK_ANVIL_SUMMARY 1707 +#define IDS_TUTORIAL_TASK_ANVIL_USE_CHESTS 1708 +#define IDS_TUTORIAL_TASK_BASIC_COMPLETE 1709 +#define IDS_TUTORIAL_TASK_BED_MULTIPLAYER 1710 +#define IDS_TUTORIAL_TASK_BED_OVERVIEW 1711 +#define IDS_TUTORIAL_TASK_BED_PLACEMENT 1712 +#define IDS_TUTORIAL_TASK_BOAT_OVERVIEW 1713 +#define IDS_TUTORIAL_TASK_BOAT_STEER 1714 +#define IDS_TUTORIAL_TASK_BREEDING_BABY 1715 +#define IDS_TUTORIAL_TASK_BREEDING_COMPLETE 1716 +#define IDS_TUTORIAL_TASK_BREEDING_DELAY 1717 +#define IDS_TUTORIAL_TASK_BREEDING_FEED 1718 +#define IDS_TUTORIAL_TASK_BREEDING_FEED_FOOD 1719 +#define IDS_TUTORIAL_TASK_BREEDING_FOLLOW 1720 +#define IDS_TUTORIAL_TASK_BREEDING_RIDING_PIGS 1721 +#define IDS_TUTORIAL_TASK_BREEDING_WOLF_COLLAR 1722 +#define IDS_TUTORIAL_TASK_BREEDING_WOLF_TAMING 1723 +#define IDS_TUTORIAL_TASK_BREWING_CREATE_FIRE_POTION 1724 +#define IDS_TUTORIAL_TASK_BREWING_DRINK_FIRE_POTION 1725 +#define IDS_TUTORIAL_TASK_BREWING_FILL_CAULDRON 1726 +#define IDS_TUTORIAL_TASK_BREWING_FILL_GLASS_BOTTLE 1727 +#define IDS_TUTORIAL_TASK_BREWING_GET_GLASS_BOTTLE 1728 +#define IDS_TUTORIAL_TASK_BREWING_MENU_BASIC_INGREDIENTS 1729 +#define IDS_TUTORIAL_TASK_BREWING_MENU_CREATE_FIRE_POTION 1730 +#define IDS_TUTORIAL_TASK_BREWING_MENU_EXIT 1731 +#define IDS_TUTORIAL_TASK_BREWING_MENU_EXTENDED_INGREDIENTS 1732 +#define IDS_TUTORIAL_TASK_BREWING_MENU_EXTENDED_INGREDIENTS_2 1733 +#define IDS_TUTORIAL_TASK_BREWING_MENU_METHOD 1734 +#define IDS_TUTORIAL_TASK_BREWING_MENU_OVERVIEW 1735 +#define IDS_TUTORIAL_TASK_BREWING_OVERVIEW 1736 +#define IDS_TUTORIAL_TASK_BREWING_USE_EFFECTS 1737 +#define IDS_TUTORIAL_TASK_BREWING_USE_POTION 1738 +#define IDS_TUTORIAL_TASK_BUILD_PORTAL 1739 +#define IDS_TUTORIAL_TASK_CHOP_WOOD 1740 +#define IDS_TUTORIAL_TASK_COLLECT_RESOURCES 1741 +#define IDS_TUTORIAL_TASK_CRAFT_CRAFT_TABLE 1742 +#define IDS_TUTORIAL_TASK_CRAFT_CREATE 1743 +#define IDS_TUTORIAL_TASK_CRAFT_CREATE_FURNACE 1744 +#define IDS_TUTORIAL_TASK_CRAFT_CREATE_PLANKS 1745 +#define IDS_TUTORIAL_TASK_CRAFT_DESCRIPTION 1746 +#define IDS_TUTORIAL_TASK_CRAFT_EXIT_AND_PLACE_FURNACE 1747 +#define IDS_TUTORIAL_TASK_CRAFT_EXIT_AND_PLACE_TABLE 1748 +#define IDS_TUTORIAL_TASK_CRAFT_INGREDIENTS 1749 +#define IDS_TUTORIAL_TASK_CRAFT_INVENTORY 1750 +#define IDS_TUTORIAL_TASK_CRAFT_NAV 1751 +#define IDS_TUTORIAL_TASK_CRAFT_OVERVIEW 1752 +#define IDS_TUTORIAL_TASK_CRAFT_SELECT_CRAFTING_TABLE 1753 +#define IDS_TUTORIAL_TASK_CRAFT_SELECT_STRUCTURES 1754 +#define IDS_TUTORIAL_TASK_CRAFT_SELECT_TOOLS 1755 +#define IDS_TUTORIAL_TASK_CRAFT_SELECT_WOODEN_SHOVEL 1756 +#define IDS_TUTORIAL_TASK_CRAFT_TOOLS_BUILT 1757 +#define IDS_TUTORIAL_TASK_CRAFTING 1758 +#define IDS_TUTORIAL_TASK_CREATE_CHARCOAL 1759 +#define IDS_TUTORIAL_TASK_CREATE_CRAFTING_TABLE 1760 +#define IDS_TUTORIAL_TASK_CREATE_FURNACE 1761 +#define IDS_TUTORIAL_TASK_CREATE_GLASS 1762 +#define IDS_TUTORIAL_TASK_CREATE_PLANKS 1763 +#define IDS_TUTORIAL_TASK_CREATE_STICKS 1764 +#define IDS_TUTORIAL_TASK_CREATE_TORCH 1765 +#define IDS_TUTORIAL_TASK_CREATE_WOODEN_DOOR 1766 +#define IDS_TUTORIAL_TASK_CREATE_WOODEN_HATCHET 1767 +#define IDS_TUTORIAL_TASK_CREATE_WOODEN_PICKAXE 1768 +#define IDS_TUTORIAL_TASK_CREATE_WOODEN_SHOVEL 1769 +#define IDS_TUTORIAL_TASK_CREATIVE_COMPLETE 1770 +#define IDS_TUTORIAL_TASK_CREATIVE_EXIT 1771 +#define IDS_TUTORIAL_TASK_CREATIVE_INV_DROP 1772 +#define IDS_TUTORIAL_TASK_CREATIVE_INV_EXIT 1773 +#define IDS_TUTORIAL_TASK_CREATIVE_INV_INFO 1774 +#define IDS_TUTORIAL_TASK_CREATIVE_INV_MOVE 1775 +#define IDS_TUTORIAL_TASK_CREATIVE_INV_NAV 1776 +#define IDS_TUTORIAL_TASK_CREATIVE_INV_OVERVIEW 1777 +#define IDS_TUTORIAL_TASK_CREATIVE_INV_PICK_UP 1778 +#define IDS_TUTORIAL_TASK_CREATIVE_MODE 1779 +#define IDS_TUTORIAL_TASK_ENCHANTING_BOOKCASES 1780 +#define IDS_TUTORIAL_TASK_ENCHANTING_BOOKS 1781 +#define IDS_TUTORIAL_TASK_ENCHANTING_BOTTLE_O_ENCHANTING 1782 +#define IDS_TUTORIAL_TASK_ENCHANTING_EXPERIENCE 1783 +#define IDS_TUTORIAL_TASK_ENCHANTING_MENU_BETTER_ENCHANTMENTS 1784 +#define IDS_TUTORIAL_TASK_ENCHANTING_MENU_COST 1785 +#define IDS_TUTORIAL_TASK_ENCHANTING_MENU_ENCHANT 1786 +#define IDS_TUTORIAL_TASK_ENCHANTING_MENU_ENCHANTMENTS 1787 +#define IDS_TUTORIAL_TASK_ENCHANTING_MENU_OVERVIEW 1788 +#define IDS_TUTORIAL_TASK_ENCHANTING_MENU_START 1789 +#define IDS_TUTORIAL_TASK_ENCHANTING_OVERVIEW 1790 +#define IDS_TUTORIAL_TASK_ENCHANTING_SUMMARY 1791 +#define IDS_TUTORIAL_TASK_ENCHANTING_USE_CHESTS 1792 +#define IDS_TUTORIAL_TASK_ENDERCHEST_FUNCTION 1793 +#define IDS_TUTORIAL_TASK_ENDERCHEST_OVERVIEW 1794 +#define IDS_TUTORIAL_TASK_ENDERCHEST_PLAYERS 1795 +#define IDS_TUTORIAL_TASK_ENDERCHEST_SUMMARY 1796 +#define IDS_TUTORIAL_TASK_FARMING_BONEMEAL 1797 +#define IDS_TUTORIAL_TASK_FARMING_CACTUS 1798 +#define IDS_TUTORIAL_TASK_FARMING_CARROTS_AND_POTATOES 1799 +#define IDS_TUTORIAL_TASK_FARMING_COMPLETE 1800 +#define IDS_TUTORIAL_TASK_FARMING_FARMLAND 1801 +#define IDS_TUTORIAL_TASK_FARMING_MUSHROOM 1802 +#define IDS_TUTORIAL_TASK_FARMING_PUMPKIN_AND_MELON 1803 +#define IDS_TUTORIAL_TASK_FARMING_SEEDS 1804 +#define IDS_TUTORIAL_TASK_FARMING_SUGARCANE 1805 +#define IDS_TUTORIAL_TASK_FARMING_WHEAT 1806 +#define IDS_TUTORIAL_TASK_FISHING_CAST 1807 +#define IDS_TUTORIAL_TASK_FISHING_FISH 1808 +#define IDS_TUTORIAL_TASK_FISHING_OVERVIEW 1809 +#define IDS_TUTORIAL_TASK_FISHING_USES 1810 +#define IDS_TUTORIAL_TASK_FLY 1811 +#define IDS_TUTORIAL_TASK_FOOD_BAR_DEPLETE 1812 +#define IDS_TUTORIAL_TASK_FOOD_BAR_EAT_STEAK 1813 +#define IDS_TUTORIAL_TASK_FOOD_BAR_FEED 1814 +#define IDS_TUTORIAL_TASK_FOOD_BAR_HEAL 1815 +#define IDS_TUTORIAL_TASK_FOOD_BAR_OVERVIEW 1816 +#define IDS_TUTORIAL_TASK_FURNACE_CHARCOAL_USES 1817 +#define IDS_TUTORIAL_TASK_FURNACE_CREATE_CHARCOAL 1818 +#define IDS_TUTORIAL_TASK_FURNACE_CREATE_GLASS 1819 +#define IDS_TUTORIAL_TASK_FURNACE_FUELS 1820 +#define IDS_TUTORIAL_TASK_FURNACE_INGREDIENTS 1821 +#define IDS_TUTORIAL_TASK_FURNACE_METHOD 1822 +#define IDS_TUTORIAL_TASK_FURNACE_OVERVIEW 1823 +#define IDS_TUTORIAL_TASK_GOLEM_IRON 1824 +#define IDS_TUTORIAL_TASK_GOLEM_IRON_VILLAGE 1825 +#define IDS_TUTORIAL_TASK_GOLEM_PUMPKIN 1826 +#define IDS_TUTORIAL_TASK_GOLEM_SNOW 1827 +#define IDS_TUTORIAL_TASK_INV_DROP 1828 +#define IDS_TUTORIAL_TASK_INV_EXIT 1829 +#define IDS_TUTORIAL_TASK_INV_INFO 1830 +#define IDS_TUTORIAL_TASK_INV_MOVE 1831 +#define IDS_TUTORIAL_TASK_INV_OVERVIEW 1832 +#define IDS_TUTORIAL_TASK_INV_PICK_UP 1833 +#define IDS_TUTORIAL_TASK_INVENTORY 1834 +#define IDS_TUTORIAL_TASK_JUMP 1835 +#define IDS_TUTORIAL_TASK_LOOK 1836 +#define IDS_TUTORIAL_TASK_MINE 1837 +#define IDS_TUTORIAL_TASK_MINE_STONE 1838 +#define IDS_TUTORIAL_TASK_MINECART_OVERVIEW 1839 +#define IDS_TUTORIAL_TASK_MINECART_POWERED_RAILS 1840 +#define IDS_TUTORIAL_TASK_MINECART_PUSHING 1841 +#define IDS_TUTORIAL_TASK_MINECART_RAILS 1842 +#define IDS_TUTORIAL_TASK_MOVE 1843 +#define IDS_TUTORIAL_TASK_NEARBY_SHELTER 1844 +#define IDS_TUTORIAL_TASK_NETHER 1845 +#define IDS_TUTORIAL_TASK_NETHER_FAST_TRAVEL 1846 +#define IDS_TUTORIAL_TASK_NIGHT_DANGER 1847 +#define IDS_TUTORIAL_TASK_OPEN_CONTAINER 1848 +#define IDS_TUTORIAL_TASK_OPEN_CREATIVE_INVENTORY 1849 +#define IDS_TUTORIAL_TASK_OPEN_WORKBENCH 1850 +#define IDS_TUTORIAL_TASK_OVERVIEW 1851 +#define IDS_TUTORIAL_TASK_PISTONS 1852 +#define IDS_TUTORIAL_TASK_PLACE_AND_OPEN_FURNACE 1853 +#define IDS_TUTORIAL_TASK_PLACE_DOOR 1854 +#define IDS_TUTORIAL_TASK_PLACE_WORKBENCH 1855 +#define IDS_TUTORIAL_TASK_REDSTONE_DUST 1856 +#define IDS_TUTORIAL_TASK_REDSTONE_POWER_SOURCES 1857 +#define IDS_TUTORIAL_TASK_REDSTONE_POWER_SOURCES_POSITION 1858 +#define IDS_TUTORIAL_TASK_REDSTONE_REPEATER 1859 +#define IDS_TUTORIAL_TASK_REDSTONE_TRIPWIRE 1860 +#define IDS_TUTORIAL_TASK_SCROLL 1861 +#define IDS_TUTORIAL_TASK_SPRINT 1862 +#define IDS_TUTORIAL_TASK_TRADING_DECREASE_TRADES 1863 +#define IDS_TUTORIAL_TASK_TRADING_INCREASE_TRADES 1864 +#define IDS_TUTORIAL_TASK_TRADING_MENU_DETAILS 1865 +#define IDS_TUTORIAL_TASK_TRADING_MENU_INVENTORY 1866 +#define IDS_TUTORIAL_TASK_TRADING_MENU_OVERVIEW 1867 +#define IDS_TUTORIAL_TASK_TRADING_MENU_START 1868 +#define IDS_TUTORIAL_TASK_TRADING_MENU_TRADE 1869 +#define IDS_TUTORIAL_TASK_TRADING_MENU_UNAVAILABLE 1870 +#define IDS_TUTORIAL_TASK_TRADING_OVERVIEW 1871 +#define IDS_TUTORIAL_TASK_TRADING_SUMMARY 1872 +#define IDS_TUTORIAL_TASK_TRADING_TRADES 1873 +#define IDS_TUTORIAL_TASK_TRADING_USE_CHESTS 1874 +#define IDS_TUTORIAL_TASK_TRY_IT 1875 +#define IDS_TUTORIAL_TASK_USE 1876 +#define IDS_TUTORIAL_TASK_USE_PORTAL 1877 +#define IDS_TUTORIALSAVENAME 1878 +#define IDS_UNHIDE_MASHUP_WORLDS 1879 +#define IDS_UNLOCK_ACCEPT_INVITE 1880 +#define IDS_UNLOCK_ACHIEVEMENT_TEXT 1881 +#define IDS_UNLOCK_AVATAR_TEXT 1882 +#define IDS_UNLOCK_DLC_SKIN 1883 +#define IDS_UNLOCK_DLC_TEXTUREPACK_TEXT 1884 +#define IDS_UNLOCK_DLC_TEXTUREPACK_TITLE 1885 +#define IDS_UNLOCK_DLC_TITLE 1886 +#define IDS_UNLOCK_FULL_GAME 1887 +#define IDS_UNLOCK_GAMERPIC_TEXT 1888 +#define IDS_UNLOCK_GUEST_TEXT 1889 +#define IDS_UNLOCK_KICK_PLAYER 1890 +#define IDS_UNLOCK_KICK_PLAYER_TITLE 1891 +#define IDS_UNLOCK_THEME_TEXT 1892 +#define IDS_UNLOCK_TITLE 1893 +#define IDS_UNLOCK_TOSAVE_TEXT 1894 +#define IDS_USER_INTERFACE 1895 +#define IDS_USING_TRIAL_TEXUREPACK_WARNING 1896 +#define IDS_VIEW_BOBBING 1897 +#define IDS_VILLAGER 1898 +#define IDS_VILLAGER_BUTCHER 1899 +#define IDS_VILLAGER_FARMER 1900 +#define IDS_VILLAGER_LIBRARIAN 1901 +#define IDS_VILLAGER_OFFERS_ITEM 1902 +#define IDS_VILLAGER_PRIEST 1903 +#define IDS_VILLAGER_SMITH 1904 +#define IDS_WARNING_ARCADE_TEXT 1905 +#define IDS_WARNING_ARCADE_TITLE 1906 +#define IDS_WARNING_DLC_TRIALTEXTUREPACK_TEXT 1907 +#define IDS_WARNING_DLC_TRIALTEXTUREPACK_TITLE 1908 +#define IDS_WIN_TEXT 1909 +#define IDS_WIN_TEXT_PART_2 1910 +#define IDS_WIN_TEXT_PART_3 1911 +#define IDS_WOLF 1912 +#define IDS_WORLD_NAME 1913 +#define IDS_WORLD_OPTIONS 1914 +#define IDS_WORLD_SIZE 1915 +#define IDS_WORLD_SIZE_TITLE_CLASSIC 1916 +#define IDS_WORLD_SIZE_TITLE_LARGE 1917 +#define IDS_WORLD_SIZE_TITLE_MEDIUM 1918 +#define IDS_WORLD_SIZE_TITLE_SMALL 1919 +#define IDS_YES 1920 +#define IDS_YOU_DIED 1921 +#define IDS_YOU_HAVE 1922 +#define IDS_ZOMBIE 1923 diff --git a/src/client/ScrolledSelectionList.h b/src/client/ScrolledSelectionList.h index 77ec1fd8..59080709 100644 --- a/src/client/ScrolledSelectionList.h +++ b/src/client/ScrolledSelectionList.h @@ -28,7 +28,7 @@ private: float yo; int lastSelection; - __int64 lastSelectionTime ; + int64_t lastSelectionTime ; bool renderSelection; bool _renderHeader; diff --git a/src/client/SelectWorldScreen.cpp b/src/client/SelectWorldScreen.cpp index e3d146a7..09484c6d 100644 --- a/src/client/SelectWorldScreen.cpp +++ b/src/client/SelectWorldScreen.cpp @@ -294,7 +294,7 @@ void SelectWorldScreen::WorldSelectionList::renderItem(int i, int x, int y, int swprintf(buffer,20,L"%d/%d/%d %d:%02d",time.wDay, time.wMonth, time.wYear, time.wHour, time.wMinute); // 4J - TODO Localise this id = id + L" (" + buffer; - __int64 size = levelSummary->getSizeOnDisk(); + int64_t size = levelSummary->getSizeOnDisk(); id = id + L", " + _toString(size / 1024 * 100 / 1024 / 100.0f) + L" MB)"; wstring info; diff --git a/src/client/ServerChunkCache.cpp b/src/client/ServerChunkCache.cpp index 7f15e810..e711a731 100644 --- a/src/client/ServerChunkCache.cpp +++ b/src/client/ServerChunkCache.cpp @@ -172,7 +172,7 @@ LevelChunk *ServerChunkCache::create(int x, int z, bool asyncPostProcess) // 4J #if ( defined _WIN64 || defined __LP64__ ) if( InterlockedCompareExchangeRelease64((LONG64 *)&cache[idx],(LONG64)chunk,(LONG64)lastChunk) == (LONG64)lastChunk ) #else - if( InterlockedCompareExchangeRelease((LONG *)&cache[idx],(LONG)chunk,(LONG)lastChunk) == (LONG)lastChunk ) + if( InterlockedCompareExchangeRelease((int32_t *)&cache[idx],(int32_t)chunk,(int32_t)lastChunk) == (int32_t)lastChunk ) #endif // _DURANGO { // Successfully updated the cache @@ -664,7 +664,7 @@ bool ServerChunkCache::save(bool force, ProgressListener *progressListener) C4JThread::Event *wakeEvent[3]; // This sets off the threads that are waiting to continue C4JThread::Event *notificationEvent[3]; // These are signalled by the threads to let us know they are complete C4JThread *saveThreads[3]; - DWORD threadId[3]; + unsigned long threadId[3]; SaveThreadData threadData[3]; ZeroMemory(&threadData[0], sizeof(SaveThreadData)); ZeroMemory(&threadData[1], sizeof(SaveThreadData)); @@ -912,7 +912,7 @@ TilePos *ServerChunkCache::findNearestMapFeature(Level *level, const wstring &fe return source->findNearestMapFeature(level, featureName, x, y, z); } -int ServerChunkCache::runSaveThreadProc(LPVOID lpParam) +int ServerChunkCache::runSaveThreadProc(void* lpParam) { SaveThreadData *params = (SaveThreadData *)lpParam; diff --git a/src/client/ServerChunkCache.h b/src/client/ServerChunkCache.h index 55441643..90a20213 100644 --- a/src/client/ServerChunkCache.h +++ b/src/client/ServerChunkCache.h @@ -97,5 +97,5 @@ private: } SaveThreadData; public: - static int runSaveThreadProc(LPVOID lpParam); + static int runSaveThreadProc(void* lpParam); }; diff --git a/src/client/ServerLevel.cpp b/src/client/ServerLevel.cpp index 76af3943..a6fa2d1a 100644 --- a/src/client/ServerLevel.cpp +++ b/src/client/ServerLevel.cpp @@ -192,7 +192,7 @@ void ServerLevel::tick() if (!somebodyWokeUp) { // skip time until new day - __int64 newTime = levelData->getTime() + TICKS_PER_DAY; + int64_t newTime = levelData->getTime() + TICKS_PER_DAY; // 4J : WESTY : Changed so that time update goes through stats tracking update code. //levelData->setTime(newTime - (newTime % TICKS_PER_DAY)); @@ -230,7 +230,7 @@ void ServerLevel::tick() //4J - temporarily disabling saves as they are causing gameplay to generally stutter quite a lot - __int64 time = levelData->getTime() + 1; + int64_t time = levelData->getTime() + 1; // 4J Stu - Putting this back in, but I have reduced the number of chunks that save when not forced #ifdef _LARGE_WORLDS if (time % (saveInterval) == (dimension->id + 1)) @@ -1139,9 +1139,9 @@ EntityTracker *ServerLevel::getTracker() return tracker; } -void ServerLevel::setTimeAndAdjustTileTicks(__int64 newTime) +void ServerLevel::setTimeAndAdjustTileTicks(int64_t newTime) { - __int64 delta = newTime - levelData->getTime(); + int64_t delta = newTime - levelData->getTime(); // 4J - can't directly adjust m_delay in a set as it has a const interator, since changing values in here might change the ordering of the elements in the set. // Instead move to a vector, do the adjustment, put back in the set. vector temp; diff --git a/src/client/ServerLevel.h b/src/client/ServerLevel.h index 9e8f75ed..a9e3999b 100644 --- a/src/client/ServerLevel.h +++ b/src/client/ServerLevel.h @@ -114,7 +114,7 @@ protected: public: MinecraftServer *getServer(); EntityTracker *getTracker(); - void setTimeAndAdjustTileTicks(__int64 newTime); + void setTimeAndAdjustTileTicks(int64_t newTime); PlayerChunkMap *getChunkMap(); void queueSendTileUpdate(int x, int y, int z); // 4J Added diff --git a/src/client/ServerPlayer.cpp b/src/client/ServerPlayer.cpp index 171a41e7..4af29aea 100644 --- a/src/client/ServerPlayer.cpp +++ b/src/client/ServerPlayer.cpp @@ -369,9 +369,9 @@ void ServerPlayer::doChunkSendingTick(bool dontDelayChunks) okToSend = true; MinecraftServer::s_slowQueuePacketSent = true; -// static unordered_map mapLastTime; -// __int64 thisTime = System::currentTimeMillis(); -// __int64 lastTime = mapLastTime[connection->getNetworkPlayer()->GetUID().toString()]; +// static unordered_map mapLastTime; +// int64_t thisTime = System::currentTimeMillis(); +// int64_t lastTime = mapLastTime[connection->getNetworkPlayer()->GetUID().toString()]; // app.DebugPrintf(" - OK to send (%d ms since last)\n", thisTime - lastTime); // mapLastTime[connection->getNetworkPlayer()->GetUID().toString()] = thisTime; } @@ -1491,7 +1491,7 @@ int ServerPlayer::getPlayerViewDistanceModifier() if( player != NULL ) { - DWORD rtt = player->GetCurrentRtt(); + unsigned long rtt = player->GetCurrentRtt(); value = rtt >> 6; diff --git a/src/client/SignRenderer.cpp b/src/client/SignRenderer.cpp index 374755bb..e5ee584f 100644 --- a/src/client/SignRenderer.cpp +++ b/src/client/SignRenderer.cpp @@ -63,7 +63,7 @@ void SignRenderer::render(shared_ptr _sign, double x, double y, doub wstring msg; // need to send the new data // Get the current language setting from the console - DWORD dwLanguage = XGetLanguage( ); + unsigned long dwLanguage = XGetLanguage( ); for (int i = 0; i < MAX_SIGN_LINES; i++) // 4J - was sign.messages.length { diff --git a/src/client/StatsCounter.cpp b/src/client/StatsCounter.cpp index a11b1185..b03e6c7f 100644 --- a/src/client/StatsCounter.cpp +++ b/src/client/StatsCounter.cpp @@ -142,7 +142,7 @@ void StatsCounter::parse(void* data) assert( stats.size() == 0 ); //Pointer to current position in stat array - PBYTE pbData=(PBYTE)data; + uint8_t* pbData=(uint8_t*)data; pbData+=sizeof(GAME_SETTINGS); unsigned short* statData = (unsigned short*)pbData;//data + (STAT_DATA_OFFSET/sizeof(unsigned short)); @@ -215,9 +215,9 @@ void StatsCounter::save(int player, bool force) //Retrieve the data pointer from the profile #if ( defined __PS3__ || defined __ORBIS__ || defined _DURANGO || defined __PSVITA__ ) - PBYTE pbData = (PBYTE)StorageManager.GetGameDefinedProfileData(player); + uint8_t* pbData = (uint8_t*)StorageManager.GetGameDefinedProfileData(player); #else - PBYTE pbData = (PBYTE)ProfileManager.GetGameDefinedProfileData(player); + uint8_t* pbData = (uint8_t*)ProfileManager.GetGameDefinedProfileData(player); #endif pbData+=sizeof(GAME_SETTINGS); @@ -283,7 +283,7 @@ void StatsCounter::save(int player, bool force) } #ifdef _XBOX -void StatsCounter::setLeaderboardProperty(XUSER_PROPERTY* prop, DWORD id, unsigned int value) +void StatsCounter::setLeaderboardProperty(XUSER_PROPERTY* prop, unsigned long id, unsigned int value) { app.DebugPrintf("Setting property id: %d to value %d\n", id, value); prop->dwPropertyId = id; @@ -291,7 +291,7 @@ void StatsCounter::setLeaderboardProperty(XUSER_PROPERTY* prop, DWORD id, unsign prop->value.nData = (int)(value&0x7FFFFFFF); // Just making sure we clamp the unsigned int to the max val for a signed int } -void StatsCounter::setLeaderboardRating(XUSER_PROPERTY* prop, LONGLONG value) +void StatsCounter::setLeaderboardRating(XUSER_PROPERTY* prop, int64_t value) { prop->dwPropertyId = PROPERTY_RATING; prop->value.type = XUSER_DATA_TYPE_INT64; @@ -778,7 +778,7 @@ void StatsCounter::writeStats() #elif defined _XBOX - LONGLONG rating; + int64_t rating; XSESSION_VIEW_PROPERTIES views[24]; @@ -823,7 +823,7 @@ void StatsCounter::writeStats() setLeaderboardProperty( &killsEasyProperties[LeaderboardManager::eProperty_Kills_SpiderJockey ], PROPERTY_KILLS_SPIDERJOCKEY, getValue(Stats::killsSpiderJockey, eDifficulty_Easy) ); // 4J-PB - this could overflow //setLeaderboardProperty( &killsEasyProperties[LeaderboardManager::eProperty_Kills_ZombiePigman ], PROPERTY_KILLS_ZOMBIEPIGMAN, getValue(Stats::killsZombiePigman, eDifficulty_Easy) + getValue(Stats::killsNetherZombiePigman, eDifficulty_Easy) ); - ULONGLONG ulTemp=getValue(Stats::killsZombiePigman, eDifficulty_Easy) + getValue(Stats::killsNetherZombiePigman, eDifficulty_Easy); + uint64_t ulTemp=getValue(Stats::killsZombiePigman, eDifficulty_Easy) + getValue(Stats::killsNetherZombiePigman, eDifficulty_Easy); setLeaderboardProperty( &killsEasyProperties[LeaderboardManager::eProperty_Kills_ZombiePigman ], PROPERTY_KILLS_ZOMBIEPIGMAN, (ulTemp>0xFFFFFFFFLL)?0xFFFFFFFF:(unsigned int)ulTemp ); setLeaderboardProperty( &killsEasyProperties[LeaderboardManager::eProperty_Kills_Slime ], PROPERTY_KILLS_SLIME, getValue(Stats::killsSlime, eDifficulty_Easy) ); @@ -855,7 +855,7 @@ void StatsCounter::writeStats() setLeaderboardProperty( &killsNormalProperties[LeaderboardManager::eProperty_Kills_Spider ], PROPERTY_KILLS_SPIDER, getValue(Stats::killsSpider, eDifficulty_Normal) ); setLeaderboardProperty( &killsNormalProperties[LeaderboardManager::eProperty_Kills_SpiderJockey ], PROPERTY_KILLS_SPIDERJOCKEY, getValue(Stats::killsSpiderJockey, eDifficulty_Normal) ); // 4J-PB - this could overflow - ULONGLONG ulTemp=getValue(Stats::killsZombiePigman, eDifficulty_Normal) + getValue(Stats::killsNetherZombiePigman, eDifficulty_Normal); + uint64_t ulTemp=getValue(Stats::killsZombiePigman, eDifficulty_Normal) + getValue(Stats::killsNetherZombiePigman, eDifficulty_Normal); //setLeaderboardProperty( &killsNormalProperties[LeaderboardManager::eProperty_Kills_ZombiePigman ], PROPERTY_KILLS_ZOMBIEPIGMAN, getValue(Stats::killsZombiePigman, eDifficulty_Normal) + getValue(Stats::killsNetherZombiePigman, eDifficulty_Normal) ); setLeaderboardProperty( &killsNormalProperties[LeaderboardManager::eProperty_Kills_ZombiePigman ], PROPERTY_KILLS_ZOMBIEPIGMAN, (ulTemp>0xFFFFFFFFLL)?0xFFFFFFFF:(unsigned int)ulTemp ); @@ -888,7 +888,7 @@ void StatsCounter::writeStats() setLeaderboardProperty( &killsHardProperties[LeaderboardManager::eProperty_Kills_Spider ], PROPERTY_KILLS_SPIDER, getValue(Stats::killsSpider, eDifficulty_Hard) ); setLeaderboardProperty( &killsHardProperties[LeaderboardManager::eProperty_Kills_SpiderJockey ], PROPERTY_KILLS_SPIDERJOCKEY, getValue(Stats::killsSpiderJockey, eDifficulty_Hard) ); // 4J-PB - this could overflow - ULONGLONG ulTemp=getValue(Stats::killsZombiePigman, eDifficulty_Hard) + getValue(Stats::killsNetherZombiePigman, eDifficulty_Hard); + uint64_t ulTemp=getValue(Stats::killsZombiePigman, eDifficulty_Hard) + getValue(Stats::killsNetherZombiePigman, eDifficulty_Hard); //setLeaderboardProperty( &killsHardProperties[LeaderboardManager::eProperty_Kills_ZombiePigman ], PROPERTY_KILLS_ZOMBIEPIGMAN, getValue(Stats::killsZombiePigman, eDifficulty_Hard) + getValue(Stats::killsNetherZombiePigman, eDifficulty_Hard) ); setLeaderboardProperty( &killsHardProperties[LeaderboardManager::eProperty_Kills_ZombiePigman ], PROPERTY_KILLS_ZOMBIEPIGMAN, (ulTemp>0xFFFFFFFFLL)?0xFFFFFFFF:(unsigned int)ulTemp ); diff --git a/src/client/StatsCounter.h b/src/client/StatsCounter.h index e292ccf2..a756ecba 100644 --- a/src/client/StatsCounter.h +++ b/src/client/StatsCounter.h @@ -95,8 +95,8 @@ private: void dumpStatsToTTY(); #ifdef _XBOX - static void setLeaderboardProperty(XUSER_PROPERTY* prop, DWORD id, unsigned int value); - static void setLeaderboardRating(XUSER_PROPERTY* prop, LONGLONG value); + static void setLeaderboardProperty(XUSER_PROPERTY* prop, unsigned long id, unsigned int value); + static void setLeaderboardRating(XUSER_PROPERTY* prop, int64_t value); #endif void writeStats(); diff --git a/src/client/StringTable.cpp b/src/client/StringTable.cpp index b0c46a7b..4e7f45a6 100644 --- a/src/client/StringTable.cpp +++ b/src/client/StringTable.cpp @@ -7,7 +7,7 @@ StringTable::StringTable(void) } // Load string table from a binary blob, filling out with the current localisation data only -StringTable::StringTable(PBYTE pbData, DWORD dwSize) +StringTable::StringTable(uint8_t* pbData, unsigned long dwSize) { src = byteArray(pbData, dwSize); @@ -30,7 +30,7 @@ StringTable::StringTable(PBYTE pbData, DWORD dwSize) app.getLocale(locales); bool foundLang = false; - __int64 bytesToSkip = 0; + int64_t bytesToSkip = 0; int dataSize = 0; // @@ -119,13 +119,13 @@ StringTable::~StringTable(void) // delete src.data; TODO 4J-JEV: ? } -void StringTable::getData(PBYTE *ppData, UINT *pSize) +void StringTable::getData(uint8_t* *ppData, unsigned int *pSize) { *ppData = src.data; *pSize = src.length; } -LPCWSTR StringTable::getString(const wstring &id) +const wchar_t* StringTable::getString(const wstring &id) { #ifndef _CONTENT_PACKAGE if (isStatic) @@ -147,7 +147,7 @@ LPCWSTR StringTable::getString(const wstring &id) } } -LPCWSTR StringTable::getString(int id) +const wchar_t* StringTable::getString(int id) { #ifndef _CONTENT_PACKAGE if (!isStatic) @@ -159,7 +159,7 @@ LPCWSTR StringTable::getString(int id) if (id < m_stringsVec.size()) { - LPCWSTR pwchString=m_stringsVec.at(id).c_str(); + const wchar_t* pwchString=m_stringsVec.at(id).c_str(); return pwchString; } else diff --git a/src/client/StringTable.h b/src/client/StringTable.h index 9e27d65c..51ef23b7 100644 --- a/src/client/StringTable.h +++ b/src/client/StringTable.h @@ -59,20 +59,20 @@ public: // }; StringTable(void); - StringTable(PBYTE pbData, DWORD dwSize); + StringTable(uint8_t* pbData, unsigned long dwSize); ~StringTable(void); - void getData(PBYTE *ppbData, UINT *pdwSize); + void getData(uint8_t* *ppbData, unsigned int *pdwSize); - LPCWSTR getString(const wstring &id); - LPCWSTR getString(int id); + const wchar_t* getString(const wstring &id); + const wchar_t* getString(int id); - //static LPCWSTR m_wchLocaleCode[LOCALE_COUNT]; + //static const wchar_t* m_wchLocaleCode[LOCALE_COUNT]; private: - //wstring getLangId(DWORD dwLanguage=0); + //wstring getLangId(unsigned long dwLanguage=0); }; diff --git a/src/client/Tesselator.cpp b/src/client/Tesselator.cpp index 772d8716..c5598beb 100644 --- a/src/client/Tesselator.cpp +++ b/src/client/Tesselator.cpp @@ -24,7 +24,7 @@ int normal; */ -DWORD Tesselator::tlsIdx = TlsAlloc(); +unsigned long Tesselator::tlsIdx = TlsAlloc(); Tesselator *Tesselator::getInstance() { diff --git a/src/client/Tesselator.h b/src/client/Tesselator.h index 72a458c2..78f52633 100644 --- a/src/client/Tesselator.h +++ b/src/client/Tesselator.h @@ -38,7 +38,7 @@ private: public: static void CreateNewThreadStorage(int bytes); private: - static DWORD tlsIdx; + static unsigned long tlsIdx; public: static Tesselator *getInstance(); diff --git a/src/client/Texture.cpp b/src/client/Texture.cpp index fa5170d2..ef8f633c 100644 --- a/src/client/Texture.cpp +++ b/src/client/Texture.cpp @@ -224,10 +224,10 @@ void Texture::fill(const Rect2i *rect, int color) int line = y * width * 4; for (int x = myRect->getX(); x < (myRect->getX() + myRect->getWidth()); x++) { - data[0]->put(line + x * 4 + 0, (BYTE)((color >> 24) & 0x000000ff)); - data[0]->put(line + x * 4 + 1, (BYTE)((color >> 16) & 0x000000ff)); - data[0]->put(line + x * 4 + 2, (BYTE)((color >> 8) & 0x000000ff)); - data[0]->put(line + x * 4 + 3, (BYTE)((color >> 0) & 0x000000ff)); + data[0]->put(line + x * 4 + 0, (uint8_t)((color >> 24) & 0x000000ff)); + data[0]->put(line + x * 4 + 1, (uint8_t)((color >> 16) & 0x000000ff)); + data[0]->put(line + x * 4 + 2, (uint8_t)((color >> 8) & 0x000000ff)); + data[0]->put(line + x * 4 + 3, (uint8_t)((color >> 0) & 0x000000ff)); } } delete myRect; diff --git a/src/client/TexturePack.h b/src/client/TexturePack.h index c83be285..ce610d8a 100644 --- a/src/client/TexturePack.h +++ b/src/client/TexturePack.h @@ -21,7 +21,7 @@ public: virtual void load(Textures *textures) = 0; virtual InputStream *getResource(const wstring &name, bool allowFallback) = 0;// throws IOException; //virtual InputStream *getResource(const wstring &name) = 0;// throws IOException; - virtual DWORD getId() = 0; + virtual unsigned long getId() = 0; virtual wstring getName() = 0; virtual wstring getDesc1() = 0; virtual wstring getDesc2() = 0; @@ -46,8 +46,8 @@ public: virtual void loadUI() = 0; virtual void unloadUI() = 0; virtual wstring getXuiRootPath() = 0; - virtual PBYTE getPackIcon(DWORD &dwImageBytes) = 0; - virtual PBYTE getPackComparison(DWORD &dwImageBytes) = 0; + virtual uint8_t* getPackIcon(unsigned long &dwImageBytes) = 0; + virtual uint8_t* getPackComparison(unsigned long &dwImageBytes) = 0; virtual unsigned int getDLCParentPackId() = 0; virtual unsigned char getDLCSubPackId() = 0; virtual ColourTable *getColourTable() = 0; diff --git a/src/client/TexturePackRepository.cpp b/src/client/TexturePackRepository.cpp index baaf123b..32db9cc5 100644 --- a/src/client/TexturePackRepository.cpp +++ b/src/client/TexturePackRepository.cpp @@ -59,7 +59,7 @@ void TexturePackRepository::addDebugPacks() { wprintf(L"Pack \"%ls\" is not installed, so adding it\n", L"DLCTestPack"); pack = new DLCPack(L"DLCTestPack",0xffffffff); - DWORD dwFilesProcessed = 0; + unsigned long dwFilesProcessed = 0; if( app.m_dlcManager.readDLCDataFile(dwFilesProcessed, "GAME:\\DummyTexturePack\\TexturePack.pck",pack)) { // 4J Stu - Don't need to do this, as the readDLCDataFile now adds texture packs @@ -291,19 +291,19 @@ bool TexturePackRepository::canUseWebSkin() return false; } -vector< pair > *TexturePackRepository::getTexturePackIdNames() +vector< pair > *TexturePackRepository::getTexturePackIdNames() { - vector< pair > *packList = new vector< pair >(); + vector< pair > *packList = new vector< pair >(); for(AUTO_VAR(it,texturePacks->begin()); it != texturePacks->end(); ++it) { TexturePack *pack = *it; - packList->push_back( pair(pack->getId(),pack->getName()) ); + packList->push_back( pair(pack->getId(),pack->getName()) ); } return packList; } -bool TexturePackRepository::selectTexturePackById(DWORD id) +bool TexturePackRepository::selectTexturePackById(unsigned long id) { bool bDidSelect = false; @@ -352,7 +352,7 @@ bool TexturePackRepository::selectTexturePackById(DWORD id) return bDidSelect; } -TexturePack *TexturePackRepository::getTexturePackById(DWORD id) +TexturePack *TexturePackRepository::getTexturePackById(unsigned long id) { AUTO_VAR(it, cacheById.find(id)); if(it != cacheById.end()) @@ -363,12 +363,12 @@ TexturePack *TexturePackRepository::getTexturePackById(DWORD id) return NULL; } -TexturePack *TexturePackRepository::addTexturePackFromDLC(DLCPack *dlcPack, DWORD id) +TexturePack *TexturePackRepository::addTexturePackFromDLC(DLCPack *dlcPack, unsigned long id) { TexturePack *newPack = NULL; // 4J-PB - The City texture pack went out with a child id for the texture pack of 1 instead of zero // we need to mask off the child id here to deal with this - DWORD dwParentID=id&0xFFFFFF; // child id is <<24 and Or'd with parent + unsigned long dwParentID=id&0xFFFFFF; // child id is <<24 and Or'd with parent if(dlcPack != NULL) { @@ -398,7 +398,7 @@ void TexturePackRepository::clearInvalidTexturePacks() } } -void TexturePackRepository::removeTexturePackById(DWORD id) +void TexturePackRepository::removeTexturePackById(unsigned long id) { AUTO_VAR(it, cacheById.find(id)); if(it != cacheById.end()) diff --git a/src/client/TexturePackRepository.h b/src/client/TexturePackRepository.h index 2b66df43..198ce239 100644 --- a/src/client/TexturePackRepository.h +++ b/src/client/TexturePackRepository.h @@ -7,9 +7,9 @@ class Minecraft; class TexturePackRepository { public: - static const DWORD DEFAULT_TEXTURE_PACK_ID = 0; - static const DWORD FOLDER_TEST_TEXTURE_PACK_ID = 1; - static const DWORD DLC_TEST_TEXTURE_PACK_ID = 2; + static const unsigned long DEFAULT_TEXTURE_PACK_ID = 0; + static const unsigned long FOLDER_TEST_TEXTURE_PACK_ID = 1; + static const unsigned long DLC_TEST_TEXTURE_PACK_ID = 2; private: static TexturePack *DEFAULT_TEXTURE_PACK; TexturePack *m_dummyTexturePack; @@ -21,7 +21,7 @@ private: vector *texturePacks; vector m_texturePacksToDelete; - unordered_map cacheById; + unordered_map cacheById; TexturePack *selected; TexturePack *lastSelected; @@ -60,16 +60,16 @@ public: bool isUsingDefaultSkin() { return selected == DEFAULT_TEXTURE_PACK; } // 4J Added TexturePack *getDefault() { return DEFAULT_TEXTURE_PACK; } // 4J Added - vector< pair > *getTexturePackIdNames(); - bool selectTexturePackById(DWORD id); // 4J Added - TexturePack *getTexturePackById(DWORD id); // 4J Added + vector< pair > *getTexturePackIdNames(); + bool selectTexturePackById(unsigned long id); // 4J Added + TexturePack *getTexturePackById(unsigned long id); // 4J Added - TexturePack *addTexturePackFromDLC(DLCPack *dlcPack, DWORD id); + TexturePack *addTexturePackFromDLC(DLCPack *dlcPack, unsigned long id); void clearInvalidTexturePacks(); void updateUI(); bool needsUIUpdate(); private: - void removeTexturePackById(DWORD id); + void removeTexturePackById(unsigned long id); public: unsigned int getTexturePackCount(); TexturePack *getTexturePackByIndex(unsigned int index); diff --git a/src/client/Textures.cpp b/src/client/Textures.cpp index c5825526..5b633998 100644 --- a/src/client/Textures.cpp +++ b/src/client/Textures.cpp @@ -1007,8 +1007,8 @@ MemTexture *Textures::addMemTexture(const wstring& name,MemTextureProcessor *pro if(texture == NULL) { // can we find it in the app mem files? - PBYTE pbData=NULL; - DWORD dwBytes=0; + uint8_t* pbData=NULL; + unsigned long dwBytes=0; app.GetMemFileDetails(name,&pbData,&dwBytes); if(dwBytes!=0) diff --git a/src/client/TileRenderer.cpp b/src/client/TileRenderer.cpp index 95f48e67..42350fad 100644 --- a/src/client/TileRenderer.cpp +++ b/src/client/TileRenderer.cpp @@ -3582,7 +3582,7 @@ bool TileRenderer::tesselateCrossInWorld( Tile* tt, int x, int y, int z ) if (tt == Tile::tallgrass) { - __int64 seed = (x * 3129871) ^ (z * 116129781l) ^ (y); + int64_t seed = (x * 3129871) ^ (z * 116129781l) ^ (y); seed = seed * seed * 42317861 + seed * 11; xt += ((((seed >> 16) & 0xf) / 15.0f) - 0.5f) * 0.5f; @@ -3821,7 +3821,7 @@ bool TileRenderer::tesselateLilypadInWorld(Tile *tt, int x, int y, int z) float u1 = tex->getU1(true); float v1 = tex->getV1(true); - __int64 seed = (x * 3129871) ^ (z * 116129781l) ^ (y); + int64_t seed = (x * 3129871) ^ (z * 116129781l) ^ (y); seed = seed * seed * 42317861 + seed * 11; int dir = (int) ((seed >> 16) & 0x3); diff --git a/src/client/Timer.cpp b/src/client/Timer.cpp index 2fee3fb7..7f29e6ff 100644 --- a/src/client/Timer.cpp +++ b/src/client/Timer.cpp @@ -20,9 +20,9 @@ Timer::Timer(float ticksPerSecond) void Timer::advanceTime() { - __int64 nowMs = System::currentTimeMillis(); - __int64 passedMs = nowMs - lastMs; - __int64 msSysTime = System::nanoTime() / 1000000; + int64_t nowMs = System::currentTimeMillis(); + int64_t passedMs = nowMs - lastMs; + int64_t msSysTime = System::nanoTime() / 1000000; double now = msSysTime / 1000.0; @@ -39,7 +39,7 @@ void Timer::advanceTime() accumMs += passedMs; if (accumMs > 1000) { - __int64 passedMsSysTime = msSysTime - lastMsSysTime; + int64_t passedMsSysTime = msSysTime - lastMsSysTime; double adjustTimeT = accumMs / (double) passedMsSysTime; adjustTime += (adjustTimeT - adjustTime) * 0.2f; @@ -88,9 +88,9 @@ void Timer::advanceTimeQuickly() void Timer::skipTime() { - __int64 nowMs = System::currentTimeMillis(); - __int64 passedMs = nowMs - lastMs; - __int64 msSysTime = System::nanoTime() / 1000000; + int64_t nowMs = System::currentTimeMillis(); + int64_t passedMs = nowMs - lastMs; + int64_t msSysTime = System::nanoTime() / 1000000; double now = msSysTime / 1000.0; @@ -107,7 +107,7 @@ void Timer::skipTime() accumMs += passedMs; if (accumMs > 1000) { - __int64 passedMsSysTime = msSysTime - lastMsSysTime; + int64_t passedMsSysTime = msSysTime - lastMsSysTime; double adjustTimeT = accumMs / (double) passedMsSysTime; adjustTime += (adjustTimeT - adjustTime) * 0.2f; diff --git a/src/client/Timer.h b/src/client/Timer.h index f9737eb0..8bea39d4 100644 --- a/src/client/Timer.h +++ b/src/client/Timer.h @@ -17,9 +17,9 @@ public: float passedTime; private: - __int64 lastMs; - __int64 lastMsSysTime; - __int64 accumMs; + int64_t lastMs; + int64_t lastMsSysTime; + int64_t accumMs; double adjustTime; diff --git a/src/client/Windows64/4JLibs/inc/4J_Input.h b/src/client/Windows64/4JLibs/inc/4J_Input.h index 9ac5c55d..c80ee20d 100644 --- a/src/client/Windows64/4JLibs/inc/4J_Input.h +++ b/src/client/Windows64/4JLibs/inc/4J_Input.h @@ -55,8 +55,8 @@ enum EKeyboardResult typedef struct _STRING_VERIFY_RESPONSE { - WORD wNumStrings; - HRESULT *pStringResult; + uint16_t wNumStrings; + int *pStringResult; } STRING_VERIFY_RESPONSE; @@ -93,7 +93,7 @@ public: void SetJoypadStickAxisMap(int iPad,unsigned int uiFrom, unsigned int uiTo); void SetJoypadStickTriggerMap(int iPad,unsigned int uiFrom, unsigned int uiTo); void SetKeyRepeatRate(float fRepeatDelaySecs,float fRepeatRateSecs); - void SetDebugSequence( const char *chSequenceA,int( *Func)(LPVOID),LPVOID lpParam ); + void SetDebugSequence( const char *chSequenceA,int( *Func)(void*),void* lpParam ); FLOAT GetIdleSeconds(int iPad); bool IsPadConnected(int iPad); @@ -107,9 +107,9 @@ public: void SetMenuDisplayed(int iPad, bool bVal); -// EKeyboardResult RequestKeyboard(UINT uiTitle, UINT uiText, UINT uiDesc, DWORD dwPad, WCHAR *pwchResult, UINT uiResultSize,int( *Func)(LPVOID,const bool),LPVOID lpParam,EKeyboardMode eMode,C4JStringTable *pStringTable=NULL); -// EKeyboardResult RequestKeyboard(UINT uiTitle, LPCWSTR pwchDefault, UINT uiDesc, DWORD dwPad, WCHAR *pwchResult, UINT uiResultSize,int( *Func)(LPVOID,const bool),LPVOID lpParam, EKeyboardMode eMode,C4JStringTable *pStringTable=NULL); - EKeyboardResult RequestKeyboard(LPCWSTR Title, LPCWSTR Text, DWORD dwPad, UINT uiMaxChars, int( *Func)(LPVOID,const bool),LPVOID lpParam,C_4JInput::EKeyboardMode eMode); +// EKeyboardResult RequestKeyboard(unsigned int uiTitle, unsigned int uiText, unsigned int uiDesc, unsigned long dwPad, wchar_t *pwchResult, unsigned int uiResultSize,int( *Func)(void*,const bool),void* lpParam,EKeyboardMode eMode,C4JStringTable *pStringTable=NULL); +// EKeyboardResult RequestKeyboard(unsigned int uiTitle, const wchar_t* pwchDefault, unsigned int uiDesc, unsigned long dwPad, wchar_t *pwchResult, unsigned int uiResultSize,int( *Func)(void*,const bool),void* lpParam, EKeyboardMode eMode,C4JStringTable *pStringTable=NULL); + EKeyboardResult RequestKeyboard(const wchar_t* Title, const wchar_t* Text, unsigned long dwPad, unsigned int uiMaxChars, int( *Func)(void*,const bool),void* lpParam,C_4JInput::EKeyboardMode eMode); void GetText(uint16_t *UTF16String); // Online check strings against offensive list - TCR 92 @@ -126,11 +126,11 @@ public: // Exemption It is not required to use the Xbox LIVE service to verify real-time text communication. An example of real-time text communication is in-game text chat. // // Intent Protect players from inappropriate language. - bool VerifyStrings(WCHAR **pwStringA,int iStringC,int( *Func)(LPVOID,STRING_VERIFY_RESPONSE *),LPVOID lpParam); - void CancelQueuedVerifyStrings(int( *Func)(LPVOID,STRING_VERIFY_RESPONSE *),LPVOID lpParam); + bool VerifyStrings(wchar_t **pwStringA,int iStringC,int( *Func)(void*,STRING_VERIFY_RESPONSE *),void* lpParam); + void CancelQueuedVerifyStrings(int( *Func)(void*,STRING_VERIFY_RESPONSE *),void* lpParam); void CancelAllVerifyInProgress(void); - //bool InputDetected(DWORD dwUserIndex,WCHAR *pwchInput); + //bool InputDetected(unsigned long dwUserIndex,wchar_t *pwchInput); }; // Singleton diff --git a/src/client/Windows64/4JLibs/inc/4J_Profile.h b/src/client/Windows64/4JLibs/inc/4J_Profile.h index f1bd85bb..a4650b01 100644 --- a/src/client/Windows64/4JLibs/inc/4J_Profile.h +++ b/src/client/Windows64/4JLibs/inc/4J_Profile.h @@ -39,12 +39,12 @@ 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, + void Initialise( unsigned long dwTitleID, + unsigned long dwOfferID, unsigned short usProfileVersion, - UINT uiProfileValuesC, - UINT uiProfileSettingsC, - DWORD *pdwProfileSettingsA, + unsigned int uiProfileValuesC, + unsigned int uiProfileSettingsC, + unsigned long *pdwProfileSettingsA, int iGameDefinedDataSizeX4, unsigned int *puiGameDefinedDataChangedBitmask); void SetTrialTextStringTable(CXuiStringTable *pStringTable,int iAccept,int iReject); @@ -54,21 +54,21 @@ 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)(LPVOID,const bool, const int iPad),LPVOID lpParam,int iQuadrant=XUSER_INDEX_ANY); - UINT DisplayOfflineProfile(int( *Func)(LPVOID,const bool, const int iPad),LPVOID lpParam,int iQuadrant=XUSER_INDEX_ANY); - UINT RequestConvertOfflineToGuestUI(int( *Func)(LPVOID,const bool, const int iPad),LPVOID 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); - BOOL AreXUIDSEqual(PlayerUID xuid1,PlayerUID xuid2); - BOOL XUIDIsGuest(PlayerUID xuid); + bool AreXUIDSEqual(PlayerUID xuid1,PlayerUID xuid2); + bool XUIDIsGuest(PlayerUID xuid); bool AllowedToPlayMultiplayer(int iProf); bool GetChatAndContentRestrictions(int iPad,bool *pbChatRestricted,bool *pbContentRestricted,int *piAge); void StartTrialGame(); // disables saves and leaderboard, and change state to readyforgame from pregame - void AllowedPlayerCreatedContent(int iPad, bool thisQuadrantOnly, BOOL *allAllowed, BOOL *friendsAllowed); - BOOL CanViewPlayerCreatedContent(int iPad, bool thisQuadrantOnly, PPlayerUID pXuids, DWORD dwXuidCount ); + void AllowedPlayerCreatedContent(int iPad, bool thisQuadrantOnly, bool *allAllowed, bool *friendsAllowed); + bool CanViewPlayerCreatedContent(int iPad, bool thisQuadrantOnly, PPlayerUID pXuids, unsigned long dwXuidCount ); void ShowProfileCard(int iPad, PlayerUID targetUid); - bool GetProfileAvatar(int iPad,int( *Func)(LPVOID lpParam,PBYTE pbThumbnail,DWORD dwThumbnailBytes), LPVOID lpParam); + bool GetProfileAvatar(int iPad,int( *Func)(void* lpParam,uint8_t* pbThumbnail,unsigned long dwThumbnailBytes), void* lpParam); void CancelProfileAvatarRequest(); @@ -78,18 +78,18 @@ public: char* GetGamertag(int iPad); wstring GetDisplayName(int iPad); bool IsFullVersion(); - void SetSignInChangeCallback(void ( *Func)(LPVOID, bool, unsigned int),LPVOID lpParam); - void SetNotificationsCallback(void ( *Func)(LPVOID, DWORD, unsigned int),LPVOID lpParam); + void SetSignInChangeCallback(void ( *Func)(void*, bool, unsigned int),void* lpParam); + void SetNotificationsCallback(void ( *Func)(void*, unsigned long, unsigned int),void* lpParam); bool RegionIsNorthAmerica(void); bool LocaleIsUSorCanada(void); - HRESULT GetLiveConnectionStatus(); + int GetLiveConnectionStatus(); bool IsSystemUIDisplayed(); - void SetProfileReadErrorCallback(void ( *Func)(LPVOID), LPVOID lpParam); + void SetProfileReadErrorCallback(void ( *Func)(void*), void* lpParam); // PROFILE DATA - int SetDefaultOptionsCallback(int( *Func)(LPVOID,PROFILESETTINGS *, const int iPad),LPVOID lpParam); - int SetOldProfileVersionCallback(int( *Func)(LPVOID,unsigned char *, const unsigned short,const int),LPVOID lpParam); + int SetDefaultOptionsCallback(int( *Func)(void*,PROFILESETTINGS *, const int iPad),void* lpParam); + int SetOldProfileVersionCallback(int( *Func)(void*,unsigned char *, const unsigned short,const int),void* lpParam); PROFILESETTINGS * GetDashboardProfileSettings(int iPad); void WriteToProfile(int iQuadrant, bool bGameDefinedDataChanged=false, bool bOverride5MinuteLimitOnProfileWrites=false); void ForceQueuedProfileWrites(int iPad=XUSER_INDEX_ANY); @@ -116,7 +116,7 @@ public: // PURCHASE void DisplayFullVersionPurchase(bool bRequired, int iQuadrant, int iUpsellParam = -1); - void SetUpsellCallback(void ( *Func)(LPVOID lpParam, eUpsellType type, eUpsellResponse response, int iUserData),LPVOID lpParam); + void SetUpsellCallback(void ( *Func)(void* lpParam, eUpsellType type, eUpsellResponse response, int iUserData),void* lpParam); // Debug void SetDebugFullOverride(bool bVal); // To override the license version (trail/full). Only in debug/release, not ContentPackage diff --git a/src/client/Windows64/4JLibs/inc/4J_Render.h b/src/client/Windows64/4JLibs/inc/4J_Render.h index 737caa98..1bf0b79a 100644 --- a/src/client/Windows64/4JLibs/inc/4J_Render.h +++ b/src/client/Windows64/4JLibs/inc/4J_Render.h @@ -27,10 +27,10 @@ typedef struct }D3DXIMAGE_INFO; typedef struct _XSOCIAL_PREVIEWIMAGE { - BYTE *pBytes; - DWORD Pitch; - DWORD Width; - DWORD Height; + uint8_t *pBytes; + unsigned long Pitch; + unsigned long Width; + unsigned long Height; // D3DFORMAT Format; } XSOCIAL_PREVIEWIMAGE, *PXSOCIAL_PREVIEWIMAGE; @@ -74,7 +74,7 @@ public: // Vertex data handling typedef enum { - VERTEX_TYPE_PF3_TF2_CB4_NB4_XW1, // Position 3 x float, texture 2 x float, colour 4 x byte, normal 4 x byte, padding 1 DWORD + VERTEX_TYPE_PF3_TF2_CB4_NB4_XW1, // Position 3 x float, texture 2 x float, colour 4 x byte, normal 4 x byte, padding 1 unsigned long VERTEX_TYPE_COMPRESSED, // Compressed format - see comment at top of VS_PS3_TS2_CS1.hlsl for description of layout VERTEX_TYPE_PF3_TF2_CB4_NB4_XW1_LIT, // as VERTEX_TYPE_PF3_TF2_CB4_NB4_XW1 with lighting applied, VERTEX_TYPE_PF3_TF2_CB4_NB4_XW1_TEXGEN, // as VERTEX_TYPE_PF3_TF2_CB4_NB4_XW1 with tex gen @@ -153,10 +153,10 @@ public: void TextureSetParam(int param, int value); void TextureDynamicUpdateStart(); void TextureDynamicUpdateEnd(); - HRESULT LoadTextureData(const char *szFilename,D3DXIMAGE_INFO *pSrcInfo, int **ppDataOut); - HRESULT LoadTextureData(BYTE *pbData, DWORD dwBytes,D3DXIMAGE_INFO *pSrcInfo, int **ppDataOut); - HRESULT SaveTextureData(const char *szFilename, D3DXIMAGE_INFO *pSrcInfo, int *ppDataOut); - HRESULT SaveTextureDataToMemory(void *pOutput, int outputCapacity, int *outputLength, int width, int height, int *ppDataIn); + int LoadTextureData(const char *szFilename,D3DXIMAGE_INFO *pSrcInfo, int **ppDataOut); + int LoadTextureData(uint8_t *pbData, unsigned long dwBytes,D3DXIMAGE_INFO *pSrcInfo, int **ppDataOut); + int SaveTextureData(const char *szFilename, D3DXIMAGE_INFO *pSrcInfo, int *ppDataOut); + int SaveTextureDataToMemory(void *pOutput, int outputCapacity, int *outputLength, int width, int height, int *ppDataIn); void TextureGetStats(); ID3D11ShaderResourceView *TextureGetTexture(int idx); @@ -194,7 +194,7 @@ public: void StateSetForceLOD(int LOD); // Event tracking - void BeginEvent(LPCWSTR eventName); + void BeginEvent(const wchar_t* eventName); void EndEvent(); // PLM event handling diff --git a/src/client/Windows64/4JLibs/inc/4J_Storage.h b/src/client/Windows64/4JLibs/inc/4J_Storage.h index 896f730a..ffc07424 100644 --- a/src/client/Windows64/4JLibs/inc/4J_Storage.h +++ b/src/client/Windows64/4JLibs/inc/4J_Storage.h @@ -20,7 +20,7 @@ typedef struct char UTF8SaveFilename[MAX_SAVEFILENAME_LENGTH]; char UTF8SaveTitle[MAX_DISPLAYNAME_LENGTH]; CONTAINER_METADATA metaData; - PBYTE thumbnailData; + uint8_t* thumbnailData; } SAVE_INFO,*PSAVE_INFO; @@ -46,38 +46,38 @@ public: typedef struct { unsigned int uiFileSize; - DWORD dwType; - DWORD dwWchCount; // count of WCHAR in next array - WCHAR wchFile[1]; + unsigned long dwType; + unsigned long dwWchCount; // count of wchar_t in next array + wchar_t wchFile[1]; } DLC_FILE_DETAILS, *PDLC_FILE_DETAILS; typedef struct { - DWORD dwType; - DWORD dwWchCount; // count of WCHAR in next array; - WCHAR wchData[1]; // will be an array of size dwBytes + unsigned long dwType; + unsigned long dwWchCount; // count of wchar_t in next array; + wchar_t wchData[1]; // will be an array of size dwBytes } DLC_FILE_PARAM, *PDLC_FILE_PARAM; // End of DLC_Creator structs typedef struct { - WCHAR wchDisplayName[XCONTENT_MAX_DISPLAYNAME_LENGTH]; - CHAR szFileName[XCONTENT_MAX_FILENAME_LENGTH]; - DWORD dwImageOffset; - DWORD dwImageBytes; + wchar_t wchDisplayName[XCONTENT_MAX_DISPLAYNAME_LENGTH]; + char szFileName[XCONTENT_MAX_FILENAME_LENGTH]; + unsigned long dwImageOffset; + unsigned long 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 + unsigned long dwVersion; + unsigned long dwNewOffers; + unsigned long dwTotalOffers; + unsigned long dwInstalledTotalOffers; + uint8_t bPadding[1024-sizeof(unsigned long)*4]; // future expansion } DLC_TMS_DETAILS; @@ -212,7 +212,7 @@ public: typedef struct { - CHAR szFilename[256]; + char szFilename[256]; int iFileSize; eTMS_FILETYPEVAL eFileTypeVal; } @@ -227,8 +227,8 @@ public: typedef struct { - DWORD dwSize; - PBYTE pbData; + unsigned long dwSize; + uint8_t* pbData; } TMSPP_FILEDATA, *PTMSPP_FILEDATA; @@ -238,32 +238,32 @@ public: void Tick(void); // Messages - C4JStorage::EMessageResult RequestMessageBox(UINT uiTitle, UINT uiText, UINT *uiOptionA,UINT uiOptionC, DWORD dwPad=XUSER_INDEX_ANY, - int( *Func)(LPVOID,int,const C4JStorage::EMessageResult)=NULL,LPVOID lpParam=NULL, C4JStringTable *pStringTable=NULL, WCHAR *pwchFormatString=NULL,DWORD dwFocusButton=0); + C4JStorage::EMessageResult RequestMessageBox(unsigned int uiTitle, unsigned int uiText, unsigned int *uiOptionA,unsigned int uiOptionC, unsigned long dwPad=XUSER_INDEX_ANY, + int( *Func)(void*,int,const C4JStorage::EMessageResult)=NULL,void* lpParam=NULL, C4JStringTable *pStringTable=NULL, wchar_t *pwchFormatString=NULL,unsigned long dwFocusButton=0); C4JStorage::EMessageResult GetMessageBoxResult(); // save device - bool SetSaveDevice(int( *Func)(LPVOID,const bool),LPVOID lpParam, bool bForceResetOfSaveDevice=false); + bool SetSaveDevice(int( *Func)(void*,const bool),void* lpParam, bool bForceResetOfSaveDevice=false); // savegame - void Init(unsigned int uiSaveVersion,LPCWSTR pwchDefaultSaveName,char *pszSavePackName,int iMinimumSaveSize,int( *Func)(LPVOID, const ESavingMessage, int),LPVOID lpParam,LPCSTR szGroupID); + void Init(unsigned int uiSaveVersion,const wchar_t* pwchDefaultSaveName,char *pszSavePackName,int iMinimumSaveSize,int( *Func)(void*, const ESavingMessage, int),void* lpParam,const char* szGroupID); void ResetSaveData(); // Call before a new save to clear out stored save file name - void SetDefaultSaveNameForKeyboardDisplay(LPCWSTR pwchDefaultSaveName); - void SetSaveTitle(LPCWSTR pwchDefaultSaveName); - bool GetSaveUniqueNumber(INT *piVal); + void SetDefaultSaveNameForKeyboardDisplay(const wchar_t* pwchDefaultSaveName); + void SetSaveTitle(const wchar_t* pwchDefaultSaveName); + bool GetSaveUniqueNumber(int *piVal); bool GetSaveUniqueFilename(char *pszName); void SetSaveUniqueFilename(char *szFilename); - void SetState(ESaveGameControlState eControlState,int( *Func)(LPVOID,const bool),LPVOID lpParam); + void SetState(ESaveGameControlState eControlState,int( *Func)(void*,const bool),void* lpParam); void SetSaveDisabled(bool bDisable); bool GetSaveDisabled(void); unsigned int GetSaveSize(); 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 - C4JStorage::ESaveGameState SaveSaveData(int( *Func)(LPVOID ,const bool),LPVOID lpParam); - void CopySaveDataToNewSave(PBYTE pbThumbnail,DWORD cbThumbnail,WCHAR *wchNewName,int ( *Func)(LPVOID lpParam, bool), LPVOID lpParam); + void* AllocateSaveData(unsigned int uiBytes); + void SetSaveImages( uint8_t* pbThumbnail,unsigned long dwThumbnailBytes,uint8_t* pbImage,unsigned long dwImageBytes, uint8_t* pbTextData ,unsigned long dwTextDataBytes); // 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(uint8_t* pbThumbnail,unsigned long cbThumbnail,wchar_t *wchNewName,int ( *Func)(void* lpParam, bool), void* lpParam); void SetSaveDeviceSelected(unsigned int uiPad,bool bSelected); bool GetSaveDeviceSelected(unsigned int iPad); C4JStorage::ESaveGameState DoesSaveExist(bool *pbExists); @@ -271,54 +271,54 @@ public: void SetSaveMessageVPosition(float fY); // The 'Saving' message will display at a default position unless changed // Get the info for the saves - C4JStorage::ESaveGameState GetSavesInfo(int iPad,int ( *Func)(LPVOID lpParam,SAVE_DETAILS *pSaveDetails,const bool),LPVOID lpParam,char *pszSavePackName); + C4JStorage::ESaveGameState GetSavesInfo(int iPad,int ( *Func)(void* lpParam,SAVE_DETAILS *pSaveDetails,const bool),void* lpParam,char *pszSavePackName); PSAVE_DETAILS ReturnSavesInfo(); void ClearSavesInfo(); // Clears results - C4JStorage::ESaveGameState LoadSaveDataThumbnail(PSAVE_INFO pSaveInfo,int( *Func)(LPVOID lpParam,PBYTE pbThumbnail,DWORD dwThumbnailBytes), LPVOID lpParam); // Get the thumbnail for an individual save referenced by pSaveInfo + C4JStorage::ESaveGameState LoadSaveDataThumbnail(PSAVE_INFO pSaveInfo,int( *Func)(void* lpParam,uint8_t* pbThumbnail,unsigned long dwThumbnailBytes), 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 long dwFile,XCONTENT_DATA &xContentData); + void GetSaveCacheFileInfo(unsigned long dwFile, uint8_t* *ppbImageData, unsigned long *pdwImageBytes); // Load the save. Need to call GetSaveData once the callback is called - C4JStorage::ESaveGameState LoadSaveData(PSAVE_INFO pSaveInfo,int( *Func)(LPVOID lpParam,const bool, const bool), LPVOID lpParam); - C4JStorage::ESaveGameState DeleteSaveData(PSAVE_INFO pSaveInfo,int( *Func)(LPVOID lpParam,const bool), LPVOID lpParam); + C4JStorage::ESaveGameState LoadSaveData(PSAVE_INFO pSaveInfo,int( *Func)(void* lpParam,const bool, const bool), void* lpParam); + C4JStorage::ESaveGameState DeleteSaveData(PSAVE_INFO pSaveInfo,int( *Func)(void* lpParam,const bool), void* lpParam); // DLC - void RegisterMarketplaceCountsCallback(int ( *Func)(LPVOID lpParam, C4JStorage::DLC_TMS_DETAILS *, int), LPVOID lpParam ); + void RegisterMarketplaceCountsCallback(int ( *Func)(void* lpParam, C4JStorage::DLC_TMS_DETAILS *, int), void* lpParam ); void SetDLCPackageRoot(char *pszDLCRoot); - C4JStorage::EDLCStatus GetDLCOffers(int iPad,int( *Func)(LPVOID, int, DWORD, int),LPVOID lpParam, DWORD dwOfferTypesBitmask=XMARKETPLACE_OFFERING_TYPE_CONTENT); - DWORD CancelGetDLCOffers(); + C4JStorage::EDLCStatus GetDLCOffers(int iPad,int( *Func)(void*, int, unsigned long, int),void* lpParam, unsigned long dwOfferTypesBitmask=XMARKETPLACE_OFFERING_TYPE_CONTENT); + unsigned long CancelGetDLCOffers(); void ClearDLCOffers(); - XMARKETPLACE_CONTENTOFFER_INFO& GetOffer(DWORD dw); + XMARKETPLACE_CONTENTOFFER_INFO& GetOffer(unsigned long dw); int GetOfferCount(); - DWORD InstallOffer(int iOfferIDC, __uint64 *ullOfferIDA,int( *Func)(LPVOID, int, int),LPVOID lpParam, bool bTrial=false); - DWORD GetAvailableDLCCount( int iPad); + unsigned long InstallOffer(int iOfferIDC, uint64_t *ullOfferIDA,int( *Func)(void*, int, int),void* lpParam, bool bTrial=false); + unsigned long GetAvailableDLCCount( int iPad); - C4JStorage::EDLCStatus GetInstalledDLC(int iPad,int( *Func)(LPVOID, int, int),LPVOID lpParam); - XCONTENT_DATA& GetDLC(DWORD dw); - DWORD MountInstalledDLC(int iPad,DWORD dwDLC,int( *Func)(LPVOID, int, DWORD,DWORD),LPVOID lpParam,LPCSTR szMountDrive=NULL); - DWORD UnmountInstalledDLC(LPCSTR szMountDrive = NULL); + C4JStorage::EDLCStatus GetInstalledDLC(int iPad,int( *Func)(void*, int, int),void* lpParam); + XCONTENT_DATA& GetDLC(unsigned long dw); + unsigned long MountInstalledDLC(int iPad,unsigned long dwDLC,int( *Func)(void*, int, unsigned long,unsigned long),void* lpParam,const char* szMountDrive=NULL); + unsigned long UnmountInstalledDLC(const char* szMountDrive = NULL); void GetMountedDLCFileList(const char* szMountDrive, std::vector& fileList); std::string GetMountedPath(std::string szMount); // Global title storage C4JStorage::ETMSStatus ReadTMSFile(int iQuadrant,eGlobalStorage eStorageFacility,C4JStorage::eTMS_FileType eFileType, - WCHAR *pwchFilename,BYTE **ppBuffer,DWORD *pdwBufferSize,int( *Func)(LPVOID, WCHAR *,int, bool, int)=NULL,LPVOID lpParam=NULL, int iAction=0); - bool WriteTMSFile(int iQuadrant,eGlobalStorage eStorageFacility,WCHAR *pwchFilename,BYTE *pBuffer,DWORD dwBufferSize); - bool DeleteTMSFile(int iQuadrant,eGlobalStorage eStorageFacility,WCHAR *pwchFilename); - void StoreTMSPathName(WCHAR *pwchName=NULL); + wchar_t *pwchFilename,uint8_t **ppBuffer,unsigned long *pdwBufferSize,int( *Func)(void*, wchar_t *,int, bool, int)=NULL,void* lpParam=NULL, int iAction=0); + bool WriteTMSFile(int iQuadrant,eGlobalStorage eStorageFacility,wchar_t *pwchFilename,uint8_t *pBuffer,unsigned long dwBufferSize); + bool DeleteTMSFile(int iQuadrant,eGlobalStorage eStorageFacility,wchar_t *pwchFilename); + void StoreTMSPathName(wchar_t *pwchName=NULL); // TMS++ #ifdef _XBOX - C4JStorage::ETMSStatus WriteTMSFile(int iPad,C4JStorage::eGlobalStorage eStorageFacility,C4JStorage::eTMS_FileType eFileType,CHAR *pchFilePath,CHAR *pchBuffer,DWORD dwBufferSize,TMSCLIENT_CALLBACK Func,LPVOID lpParam); - HRESULT GetUserQuotaInfo(int iPad,TMSCLIENT_CALLBACK Func,LPVOID lpParam); + C4JStorage::ETMSStatus WriteTMSFile(int iPad,C4JStorage::eGlobalStorage eStorageFacility,C4JStorage::eTMS_FileType eFileType,char *pchFilePath,char *pchBuffer,unsigned long dwBufferSize,TMSCLIENT_CALLBACK Func,void* lpParam); + int GetUserQuotaInfo(int iPad,TMSCLIENT_CALLBACK Func,void* lpParam); #endif - // C4JStorage::ETMSStatus TMSPP_WriteFile(int iPad,C4JStorage::eGlobalStorage eStorageFacility,C4JStorage::eTMS_FILETYPEVAL eFileTypeVal,C4JStorage::eTMS_UGCTYPE eUGCType,CHAR *pchFilePath,CHAR *pchBuffer,DWORD dwBufferSize,int( *Func)(LPVOID,int,int)=NULL,LPVOID lpParam=NULL, int iUserData=0); - // C4JStorage::ETMSStatus TMSPP_GetUserQuotaInfo(int iPad,TMSCLIENT_CALLBACK Func,LPVOID lpParam, int iUserData=0); - C4JStorage::ETMSStatus TMSPP_ReadFile(int iPad,C4JStorage::eGlobalStorage eStorageFacility,C4JStorage::eTMS_FILETYPEVAL eFileTypeVal,LPCSTR szFilename,int( *Func)(LPVOID,int,int,PTMSPP_FILEDATA, LPCSTR)=NULL,LPVOID lpParam=NULL, int iUserData=0); - // C4JStorage::ETMSStatus TMSPP_ReadFileList(int iPad,C4JStorage::eGlobalStorage eStorageFacility,CHAR *pchFilePath,int( *Func)(LPVOID,int,int,PTMSPP_FILE_LIST)=NULL,LPVOID lpParam=NULL, int iUserData=0); - // C4JStorage::ETMSStatus TMSPP_DeleteFile(int iPad,LPCSTR szFilePath,C4JStorage::eTMS_FILETYPEVAL eFileTypeVal,int( *Func)(LPVOID,int,int),LPVOID lpParam=NULL, int iUserData=0); + // C4JStorage::ETMSStatus TMSPP_WriteFile(int iPad,C4JStorage::eGlobalStorage eStorageFacility,C4JStorage::eTMS_FILETYPEVAL eFileTypeVal,C4JStorage::eTMS_UGCTYPE eUGCType,char *pchFilePath,char *pchBuffer,unsigned long dwBufferSize,int( *Func)(void*,int,int)=NULL,void* lpParam=NULL, int iUserData=0); + // C4JStorage::ETMSStatus TMSPP_GetUserQuotaInfo(int iPad,TMSCLIENT_CALLBACK Func,void* lpParam, int iUserData=0); + C4JStorage::ETMSStatus TMSPP_ReadFile(int iPad,C4JStorage::eGlobalStorage eStorageFacility,C4JStorage::eTMS_FILETYPEVAL eFileTypeVal,const char* szFilename,int( *Func)(void*,int,int,PTMSPP_FILEDATA, const char*)=NULL,void* lpParam=NULL, int iUserData=0); + // C4JStorage::ETMSStatus TMSPP_ReadFileList(int iPad,C4JStorage::eGlobalStorage eStorageFacility,char *pchFilePath,int( *Func)(void*,int,int,PTMSPP_FILE_LIST)=NULL,void* lpParam=NULL, int iUserData=0); + // C4JStorage::ETMSStatus TMSPP_DeleteFile(int iPad,const char* szFilePath,C4JStorage::eTMS_FILETYPEVAL eFileTypeVal,int( *Func)(void*,int,int),void* lpParam=NULL, int iUserData=0); // bool TMSPP_InFileList(eGlobalStorage eStorageFacility, int iPad,const wstring &Filename); // unsigned int CRC(unsigned char *buf, int len); diff --git a/src/client/Windows64/Iggy/gdraw/gdraw_d3d.cpp b/src/client/Windows64/Iggy/gdraw/gdraw_d3d.cpp index 88872f15..6ee2b451 100644 --- a/src/client/Windows64/Iggy/gdraw/gdraw_d3d.cpp +++ b/src/client/Windows64/Iggy/gdraw/gdraw_d3d.cpp @@ -78,7 +78,7 @@ typedef struct struct ProgramWithCachedVariableLocations { - DWORD *bytecode; + unsigned long *bytecode; union { IDirect3DPixelShader9 *pshader; IDirect3DVertexShader9 *vshader; @@ -172,7 +172,7 @@ typedef struct U64 frame_counter; // error reporting - void (__cdecl *error_handler)(HRESULT hr); + void (__cdecl *error_handler)(int hr); } GDraw; static GDraw *gdraw; @@ -186,7 +186,7 @@ static U16 quad_ib[QUAD_IB_COUNT*6]; // Error handling // -static void report_d3d_error(HRESULT hr, char *call, char *context) +static void report_d3d_error(int hr, char *call, char *context) { if (hr == E_OUTOFMEMORY) IggyGDrawSendWarning(NULL, "GDraw D3D out of memory in %s%s", call, context); @@ -304,7 +304,7 @@ static rrbool RADLINK gdraw_MakeTextureBegin(void *owner, S32 width, S32 height, if (!t) return NULL; - HRESULT hr = gdraw->d3d_device->CreateTexture(width, height, (flags & GDRAW_MAKETEXTURE_FLAGS_mipmap) ? 0 : 1, + int hr = gdraw->d3d_device->CreateTexture(width, height, (flags & GDRAW_MAKETEXTURE_FLAGS_mipmap) ? 0 : 1, 0, d3dfmt, D3DPOOL_MANAGED, &t->handle.tex.d3d, NULL); if (FAILED(hr)) { @@ -380,7 +380,7 @@ static rrbool RADLINK gdraw_MakeTextureMore(GDraw_MakeTexture_ProcessingInfo *p) do { // upload data for this miplevel D3DLOCKED_RECT z; - HRESULT hr = t->handle.tex.d3d->LockRect(level, &z, NULL, 0); + int hr = t->handle.tex.d3d->LockRect(level, &z, NULL, 0); if (FAILED(hr)) return false; @@ -427,7 +427,7 @@ static void RADLINK gdraw_UpdateTextureRect(GDrawTexture *t, void * /*unique_id* S32 i, bpl = (format == GDRAW_TEXTURE_FORMAT_font ? 1 : 4) * w; D3DLOCKED_RECT lr; - HRESULT hr = s->handle.tex.d3d->LockRect(0, &lr, &rdest, 0); + int hr = s->handle.tex.d3d->LockRect(0, &lr, &rdest, 0); if (FAILED(hr)) { IggyGDrawSendWarning(0, "GDraw LockRect() for texture update failed; D3D error 0x%08x", hr); return; @@ -474,7 +474,7 @@ static void RADLINK gdraw_DescribeTexture(GDrawTexture *tex, GDraw_Texture_Descr static void RADLINK gdraw_SetAntialiasTexture(S32 width, U8 *rgba) { - HRESULT hr; + int hr; D3DLOCKED_RECT lr; S32 i; U8 *d; @@ -517,7 +517,7 @@ static rrbool RADLINK gdraw_MakeVertexBufferBegin(void *unique_id, gdraw_vformat vb->handle.vbuf.base = NULL; vb->handle.vbuf.indices = NULL; - HRESULT hr; + int hr; hr = gdraw->d3d_device->CreateVertexBuffer(vbuf_size, D3DUSAGE_WRITEONLY, 0, D3DPOOL_MANAGED, &vb->handle.vbuf.base, NULL); failed_call = "CreateVertexBuffer"; if (!FAILED(hr)) { @@ -612,7 +612,7 @@ static GDrawHandle *get_color_rendertarget(GDrawStats *stats) return t; } - HRESULT hr = gdraw->d3d_device->CreateTexture(gdraw->frametex_width, gdraw->frametex_height, 1, D3DUSAGE_RENDERTARGET, + int hr = gdraw->d3d_device->CreateTexture(gdraw->frametex_width, gdraw->frametex_height, 1, D3DUSAGE_RENDERTARGET, D3DFMT_A8R8G8B8, D3DPOOL_DEFAULT, &t->handle.tex.d3d, NULL); if (FAILED(hr)) { report_d3d_error(hr, "CreateTexture", " creating rendertarget"); @@ -631,7 +631,7 @@ static GDrawHandle *get_color_rendertarget(GDrawStats *stats) static IDirect3DSurface9 *get_rendertarget_depthbuffer(GDrawStats *stats) { if (!gdraw->rt_depthbuffer) { - HRESULT hr = gdraw->d3d_device->CreateDepthStencilSurface(gdraw->frametex_width, gdraw->frametex_height, D3DFMT_D24S8, D3DMULTISAMPLE_NONE, 0, true, &gdraw->rt_depthbuffer, NULL); + int hr = gdraw->d3d_device->CreateDepthStencilSurface(gdraw->frametex_width, gdraw->frametex_height, D3DFMT_D24S8, D3DMULTISAMPLE_NONE, 0, true, &gdraw->rt_depthbuffer, NULL); if (FAILED(hr)) IggyGDrawSendWarning(NULL, "GDraw D3D error in CreateDepthStencilSurface: 0x%08x", hr); else { @@ -1084,7 +1084,7 @@ static rrbool RADLINK gdraw_TextureDrawBufferBegin(gswf_recti *region, gdraw_tex return false; else { IDirect3DTexture9 * tex; - HRESULT hr = gdraw->d3d_device->CreateTexture(w,h,1, + int hr = gdraw->d3d_device->CreateTexture(w,h,1, D3DUSAGE_RENDERTARGET, D3DFMT_A8R8G8B8, D3DPOOL_DEFAULT, &tex, NULL); @@ -1335,7 +1335,7 @@ static int set_renderstate_full(S32 vertex_format, GDrawRenderState *r, GDrawSta int tex0mode = r->tex0_mode; static struct gdraw_d3d_blendspec { - BOOL enable; + bool enable; D3DBLEND src; D3DBLEND dest; } blends[ASSERT_COUNT(GDRAW_BLEND__count, 6)] = { @@ -1526,7 +1526,7 @@ static void RADLINK gdraw_DrawIndexedTriangles(GDrawRenderState *r, GDrawPrimiti gdraw->d3d_device->DrawIndexedPrimitiveUP(D3DPT_TRIANGLELIST, 0, p->num_vertices, p->num_indices/3, p->indices, D3DFMT_INDEX16, p->vertices, vertsize[vfmt]); } else { // dynamic quads assert(p->num_vertices % 4 == 0); - UINT stride = vertsize[vfmt]; + unsigned int stride = vertsize[vfmt]; S32 pos = 0; while (pos < p->num_vertices) { S32 vert_count = RR_MIN(p->num_vertices - pos, QUAD_IB_COUNT * 4); @@ -1742,7 +1742,7 @@ static void RADLINK gdraw_FilterQuad(GDrawRenderState *r, S32 x0, S32 y0, S32 x1 (blend_tex = get_color_rendertarget(stats)) != NULL) { IDirect3DSurface9 *src; - HRESULT hr = d3d->GetRenderTarget(0, &src); + int hr = d3d->GetRenderTarget(0, &src); if (!FAILED(hr)) { IDirect3DSurface9 *dest; hr = blend_tex->handle.tex.d3d->GetSurfaceLevel(0, &dest); @@ -1801,7 +1801,7 @@ static void create_pixel_shader(ProgramWithCachedVariableLocations *p, ProgramWi { *p = *src; if(p->bytecode) { - HRESULT hr = gdraw->d3d_device->CreatePixelShader(p->bytecode, &p->pshader); + int hr = gdraw->d3d_device->CreatePixelShader(p->bytecode, &p->pshader); if (FAILED(hr)) { IggyGDrawSendWarning(NULL, "GDraw D3D error creating pixel shader: 0x%08x", hr); p->pshader = NULL; @@ -1813,7 +1813,7 @@ static void create_vertex_shader(ProgramWithCachedVariableLocations *p, ProgramW { *p = *src; if(p->bytecode) { - HRESULT hr = gdraw->d3d_device->CreateVertexShader(p->bytecode, &p->vshader); + int hr = gdraw->d3d_device->CreateVertexShader(p->bytecode, &p->vshader); if (FAILED(hr)) { IggyGDrawSendWarning(NULL, "GDraw D3D error creating vertex shader: 0x%08x", hr); p->vshader = NULL; @@ -1838,7 +1838,7 @@ static void create_all_shaders(void) create_pixel_shader(&gdraw->manual_clear, pshader_manual_clear_arr); for (i=0; i < GDRAW_vformat__count; i++) { - HRESULT hr = gdraw->d3d_device->CreateVertexDeclaration(vformats[i], &gdraw->vdec[i]); + int hr = gdraw->d3d_device->CreateVertexDeclaration(vformats[i], &gdraw->vdec[i]); if (FAILED(hr)) IggyGDrawSendWarning(NULL, "GDraw D3D error in CreateVertexDeclaration: 0x%08x", hr); @@ -2058,7 +2058,7 @@ void gdraw_D3D_DestroyContext(void) free_gdraw(); } -void gdraw_D3D_SetErrorHandler(void (__cdecl *error_handler)(HRESULT hr)) +void gdraw_D3D_SetErrorHandler(void (__cdecl *error_handler)(int hr)) { if (gdraw) gdraw->error_handler = error_handler; @@ -2150,7 +2150,7 @@ GDrawTexture * RADLINK gdraw_D3D_MakeTextureFromResource(U8 *resource_file, S32 default: size=0; d3dfmt=D3DFMT_UNKNOWN; break; } - HRESULT hr = gdraw->d3d_device->CreateTexture(width, height, mipmaps, + int hr = gdraw->d3d_device->CreateTexture(width, height, mipmaps, 0, d3dfmt, D3DPOOL_MANAGED, &tex, NULL); if (FAILED(hr)) { if (size >= 8 && ((width & 3) || (height & 3))) diff --git a/src/client/Windows64/Iggy/gdraw/gdraw_d3d10.cpp b/src/client/Windows64/Iggy/gdraw/gdraw_d3d10.cpp index 225f2581..b667926d 100644 --- a/src/client/Windows64/Iggy/gdraw/gdraw_d3d10.cpp +++ b/src/client/Windows64/Iggy/gdraw/gdraw_d3d10.cpp @@ -54,7 +54,7 @@ typedef ID3D10Device ID3D1XContext; typedef S32 ViewCoord; typedef gdraw_d3d10_resourcetype gdraw_resourcetype; -static void report_d3d_error(HRESULT hr, char *call, char *context); +static void report_d3d_error(int hr, char *call, char *context); static void *map_buffer(ID3D1XContext *, ID3D10Buffer *buf, bool discard) { @@ -80,7 +80,7 @@ static RADINLINE void set_vertex_shader(ID3D10Device *ctx, ID3D10VertexShader *s ctx->VSSetShader(shader); } -static ID3D10BlendState *create_blend_state(ID3D10Device *dev, BOOL blend, D3D10_BLEND src, D3D10_BLEND dst) +static ID3D10BlendState *create_blend_state(ID3D10Device *dev, bool blend, D3D10_BLEND src, D3D10_BLEND dst) { D3D10_BLEND_DESC desc = {}; desc.BlendEnable[0] = blend; @@ -93,7 +93,7 @@ static ID3D10BlendState *create_blend_state(ID3D10Device *dev, BOOL blend, D3D10 desc.RenderTargetWriteMask[0] = D3D10_COLOR_WRITE_ENABLE_ALL; ID3D10BlendState *res; - HRESULT hr = dev->CreateBlendState(&desc, &res); + int hr = dev->CreateBlendState(&desc, &res); if (FAILED(hr)) { report_d3d_error(hr, "CreateBlendState", ""); res = NULL; @@ -109,7 +109,7 @@ static void create_pixel_shader(ProgramWithCachedVariableLocations *p, ProgramWi { *p = *src; if(p->bytecode) { - HRESULT hr = gdraw->d3d_device->CreatePixelShader(p->bytecode, p->size, &p->pshader); + int hr = gdraw->d3d_device->CreatePixelShader(p->bytecode, p->size, &p->pshader); if (FAILED(hr)) { report_d3d_error(hr, "CreatePixelShader", ""); p->pshader = NULL; @@ -122,7 +122,7 @@ static void create_vertex_shader(ProgramWithCachedVariableLocations *p, ProgramW { *p = *src; if(p->bytecode) { - HRESULT hr = gdraw->d3d_device->CreateVertexShader(p->bytecode, p->size, &p->vshader); + int hr = gdraw->d3d_device->CreateVertexShader(p->bytecode, p->size, &p->vshader); if (FAILED(hr)) { report_d3d_error(hr, "CreateVertexShader", ""); p->vshader = NULL; diff --git a/src/client/Windows64/Iggy/gdraw/gdraw_d3d10.h b/src/client/Windows64/Iggy/gdraw/gdraw_d3d10.h index 929146b2..a70d67ef 100644 --- a/src/client/Windows64/Iggy/gdraw/gdraw_d3d10.h +++ b/src/client/Windows64/Iggy/gdraw/gdraw_d3d10.h @@ -45,7 +45,7 @@ IDOC extern GDrawFunctions * gdraw_D3D10_CreateContext(ID3D10Device *dev, S32 w, IDOC extern void gdraw_D3D10_DestroyContext(void); /* Destroys the current GDraw context, if any. */ -IDOC extern void gdraw_D3D10_SetErrorHandler(void (__cdecl *error_handler)(HRESULT hr)); +IDOC extern void gdraw_D3D10_SetErrorHandler(void (__cdecl *error_handler)(int hr)); /* Sets the GDraw D3D error handler. This will get called with the respective D3D error code if GDraw encounters an error diff --git a/src/client/Windows64/Iggy/gdraw/gdraw_d3d11.cpp b/src/client/Windows64/Iggy/gdraw/gdraw_d3d11.cpp index dea9e315..c912da64 100644 --- a/src/client/Windows64/Iggy/gdraw/gdraw_d3d11.cpp +++ b/src/client/Windows64/Iggy/gdraw/gdraw_d3d11.cpp @@ -56,12 +56,12 @@ typedef ID3D11DeviceContext ID3D1XContext; typedef F32 ViewCoord; typedef gdraw_d3d11_resourcetype gdraw_resourcetype; -static void report_d3d_error(HRESULT hr, char *call, char *context); +static void report_d3d_error(int hr, char *call, char *context); static void *map_buffer(ID3D1XContext *ctx, ID3D11Buffer *buf, bool discard) { D3D11_MAPPED_SUBRESOURCE msr; - HRESULT hr = ctx->Map(buf, 0, discard ? D3D11_MAP_WRITE_DISCARD : D3D11_MAP_WRITE_NO_OVERWRITE, 0, &msr); + int hr = ctx->Map(buf, 0, discard ? D3D11_MAP_WRITE_DISCARD : D3D11_MAP_WRITE_NO_OVERWRITE, 0, &msr); if (FAILED(hr)) { report_d3d_error(hr, "Map", "of buffer"); return NULL; @@ -84,7 +84,7 @@ static RADINLINE void set_vertex_shader(ID3D11DeviceContext *ctx, ID3D11VertexSh ctx->VSSetShader(shader, NULL, 0); } -static ID3D11BlendState *create_blend_state(ID3D11Device *dev, BOOL blend, D3D11_BLEND src, D3D11_BLEND dst) +static ID3D11BlendState *create_blend_state(ID3D11Device *dev, bool blend, D3D11_BLEND src, D3D11_BLEND dst) { D3D11_BLEND_DESC desc = {}; desc.RenderTarget[0].BlendEnable = blend; @@ -97,7 +97,7 @@ static ID3D11BlendState *create_blend_state(ID3D11Device *dev, BOOL blend, D3D11 desc.RenderTarget[0].RenderTargetWriteMask = D3D11_COLOR_WRITE_ENABLE_ALL; ID3D11BlendState *res; - HRESULT hr = dev->CreateBlendState(&desc, &res); + int hr = dev->CreateBlendState(&desc, &res); if (FAILED(hr)) { report_d3d_error(hr, "CreateBlendState", ""); res = NULL; @@ -113,7 +113,7 @@ static void create_pixel_shader(ProgramWithCachedVariableLocations *p, ProgramWi { *p = *src; if(p->bytecode) { - HRESULT hr = gdraw->d3d_device->CreatePixelShader(p->bytecode, p->size, NULL, &p->pshader); + int hr = gdraw->d3d_device->CreatePixelShader(p->bytecode, p->size, NULL, &p->pshader); if (FAILED(hr)) { report_d3d_error(hr, "CreatePixelShader", ""); p->pshader = NULL; @@ -126,7 +126,7 @@ static void create_vertex_shader(ProgramWithCachedVariableLocations *p, ProgramW { *p = *src; if(p->bytecode) { - HRESULT hr = gdraw->d3d_device->CreateVertexShader(p->bytecode, p->size, NULL, &p->vshader); + int hr = gdraw->d3d_device->CreateVertexShader(p->bytecode, p->size, NULL, &p->vshader); if (FAILED(hr)) { report_d3d_error(hr, "CreateVertexShader", ""); p->vshader = NULL; diff --git a/src/client/Windows64/Iggy/gdraw/gdraw_d3d11.h b/src/client/Windows64/Iggy/gdraw/gdraw_d3d11.h index 7fd7012f..4bae2d50 100644 --- a/src/client/Windows64/Iggy/gdraw/gdraw_d3d11.h +++ b/src/client/Windows64/Iggy/gdraw/gdraw_d3d11.h @@ -47,7 +47,7 @@ IDOC extern GDrawFunctions * gdraw_D3D11_CreateContext(ID3D11Device *dev, ID3D11 IDOC extern void gdraw_D3D11_DestroyContext(void); /* Destroys the current GDraw context, if any. */ -IDOC extern void gdraw_D3D11_SetErrorHandler(void (__cdecl *error_handler)(HRESULT hr)); +IDOC extern void gdraw_D3D11_SetErrorHandler(void (__cdecl *error_handler)(int hr)); /* Sets the GDraw D3D error handler. This will get called with the respective D3D error code if GDraw encounters an error diff --git a/src/client/Windows64/Iggy/include/rrCore.h b/src/client/Windows64/Iggy/include/rrCore.h index e88b5f8c..16ed3ac2 100644 --- a/src/client/Windows64/Iggy/include/rrCore.h +++ b/src/client/Windows64/Iggy/include/rrCore.h @@ -917,8 +917,8 @@ #define RAD_S32 signed int // But pointers are 64 bits. #if (_MSC_VER >= 1300 && defined(_Wp64) && _Wp64 ) - #define RAD_SINTa __w64 signed __int64 - #define RAD_UINTa __w64 unsigned __int64 + #define RAD_SINTa __w64 signed int64_t + #define RAD_UINTa __w64 unsigned int64_t #else // non-vc.net compiler or /Wp64 turned off #define RAD_UINTa unsigned long long #define RAD_SINTa signed long long @@ -976,8 +976,8 @@ #define RAD_U64 unsigned long long #define RAD_S64 signed long long #elif defined(__RADX64__) || defined(__RAD32__) - #define RAD_U64 unsigned __int64 - #define RAD_S64 signed __int64 + #define RAD_U64 unsigned int64_t + #define RAD_S64 signed int64_t #else // 16-bit typedef RADSTRUCT RAD_U64 // do this so that we don't accidentally use U64s @@ -1883,7 +1883,7 @@ unsigned long __cdecl _byteswap_ulong (unsigned long _Long); #define RR_BSWAP16 _byteswap_ushort #define RR_BSWAP32 _byteswap_ulong -unsigned __int64 __cdecl _byteswap_uint64 (unsigned __int64 val); +unsigned int64_t __cdecl _byteswap_uint64 (unsigned int64_t val); #pragma intrinsic(_byteswap_uint64) #define RR_BSWAP64 _byteswap_uint64 @@ -1909,15 +1909,15 @@ RADFORCEINLINE unsigned long RR_BSWAP32 (unsigned long _Long) return _Long; } -RADFORCEINLINE unsigned __int64 RR_BSWAP64 (unsigned __int64 _Long) +RADFORCEINLINE unsigned int64_t RR_BSWAP64 (unsigned int64_t _Long) { __asm { - mov eax, DWORD PTR _Long - mov edx, DWORD PTR _Long+4 + mov eax, unsigned long PTR _Long + mov edx, unsigned long PTR _Long+4 bswap eax bswap edx - mov DWORD PTR _Long, edx - mov DWORD PTR _Long+4, eax + mov unsigned long PTR _Long, edx + mov unsigned long PTR _Long+4, eax } return _Long; } @@ -2250,10 +2250,10 @@ void __storewordbytereverse (unsigned int val, int offset, void *bas #if ( defined(_MSC_VER) && _MSC_VER >= 1300) -unsigned __int64 __cdecl _rotl64(unsigned __int64 _Val, int _Shift); +unsigned int64_t __cdecl _rotl64(unsigned int64_t _Val, int _Shift); #pragma intrinsic(_rotl64) -#define RR_ROTL64(x,k) _rotl64((unsigned __int64)(x),(int)(k)) +#define RR_ROTL64(x,k) _rotl64((unsigned int64_t)(x),(int)(k)) #elif defined(__RADCELL__) diff --git a/src/client/Windows64/Miles/include/imssapi.h b/src/client/Windows64/Miles/include/imssapi.h index d87272e4..c8e95800 100644 --- a/src/client/Windows64/Miles/include/imssapi.h +++ b/src/client/Windows64/Miles/include/imssapi.h @@ -149,11 +149,11 @@ extern void AILCALL OutMilesMutex(void); #ifdef NTAPI extern HWND AILCALL AIL_API_HWND (void); -void AILEXPORT API_timer (UINT IDEvent, - UINT uReserved, - DWORD dwUser, - DWORD dwReserved1, - DWORD dwReserved2); +void AILEXPORT API_timer (unsigned int IDEvent, + unsigned int uReserved, + unsigned long dwUser, + unsigned long dwReserved1, + unsigned long dwReserved2); #endif @@ -2693,25 +2693,25 @@ extern "C" { #ifdef IS_XENON -typedef void *PVOID; -typedef int INT; -typedef unsigned long ULONG_PTR; -typedef ULONG_PTR SIZE_T; +typedef void *void*; +typedef int int; +typedef unsigned long uintptr_t; +typedef uintptr_t size_t; -PVOID +void* __stdcall XMemSet( - PVOID pDest, - INT c, - SIZE_T count + void* pDest, + int c, + size_t count ); -PVOID +void* __stdcall XMemCpy( - PVOID pDest, + void* pDest, const void* pSrc, - SIZE_T count + size_t count ); char * __cdecl strcpy( char *_Dest, const char * _Source); diff --git a/src/client/Windows64/Miles/include/mss.h b/src/client/Windows64/Miles/include/mss.h index 3151336c..0214a590 100644 --- a/src/client/Windows64/Miles/include/mss.h +++ b/src/client/Windows64/Miles/include/mss.h @@ -319,30 +319,30 @@ RADDEFSTART #elif defined(IS_WINDOWS) - typedef char CHAR; - typedef short SHORT; - typedef int BOOL; - typedef long LONG; - typedef CHAR *LPSTR, *PSTR; + typedef char char; + typedef short int16_t; + typedef int bool; + typedef long int32_t; + typedef char *LPSTR, *PSTR; #ifdef IS_WIN64 - typedef unsigned __int64 ULONG_PTR, *PULONG_PTR; + typedef unsigned int64_t uintptr_t, *PULONG_PTR; #else #ifdef _Wp64 #if !defined(__midl) && (defined(_X86_) || defined(_M_IX86)) && _MSC_VER >= 1300 - typedef __w64 unsigned long ULONG_PTR, *PULONG_PTR; + typedef __w64 unsigned long uintptr_t, *PULONG_PTR; #else - typedef unsigned long ULONG_PTR, *PULONG_PTR; + typedef unsigned long uintptr_t, *PULONG_PTR; #endif #else - typedef unsigned long ULONG_PTR, *PULONG_PTR; + typedef unsigned long uintptr_t, *PULONG_PTR; #endif #endif - typedef ULONG_PTR DWORD_PTR, *PDWORD_PTR; - typedef unsigned long DWORD; - typedef unsigned short WORD; - typedef unsigned int UINT; + typedef uintptr_t DWORD_PTR, *PDWORD_PTR; + typedef unsigned long unsigned long; + typedef unsigned short uint16_t; + typedef unsigned int unsigned int; typedef struct HWAVE__ *HWAVE; typedef struct HWAVEIN__ *HWAVEIN; typedef struct HWAVEOUT__ *HWAVEOUT; @@ -350,7 +350,7 @@ RADDEFSTART typedef HWAVEOUT *LPHWAVEOUT; #ifndef WAVE_MAPPER - #define WAVE_MAPPER ((UINT)-1) + #define WAVE_MAPPER ((unsigned int)-1) #endif typedef struct waveformat_tag *LPWAVEFORMAT; @@ -410,9 +410,9 @@ RADDEFSTART #endif - typedef void * LPVOID; - typedef LPVOID AILLPDIRECTSOUND; - typedef LPVOID AILLPDIRECTSOUNDBUFFER; + typedef void * void*; + typedef void* AILLPDIRECTSOUND; + typedef void* AILLPDIRECTSOUNDBUFFER; #elif defined( IS_MAC ) || defined(IS_IPHONE) || defined(IS_LINUX) diff --git a/src/client/Windows64/Miles/include/rrcore.h b/src/client/Windows64/Miles/include/rrcore.h index e88b5f8c..16ed3ac2 100644 --- a/src/client/Windows64/Miles/include/rrcore.h +++ b/src/client/Windows64/Miles/include/rrcore.h @@ -917,8 +917,8 @@ #define RAD_S32 signed int // But pointers are 64 bits. #if (_MSC_VER >= 1300 && defined(_Wp64) && _Wp64 ) - #define RAD_SINTa __w64 signed __int64 - #define RAD_UINTa __w64 unsigned __int64 + #define RAD_SINTa __w64 signed int64_t + #define RAD_UINTa __w64 unsigned int64_t #else // non-vc.net compiler or /Wp64 turned off #define RAD_UINTa unsigned long long #define RAD_SINTa signed long long @@ -976,8 +976,8 @@ #define RAD_U64 unsigned long long #define RAD_S64 signed long long #elif defined(__RADX64__) || defined(__RAD32__) - #define RAD_U64 unsigned __int64 - #define RAD_S64 signed __int64 + #define RAD_U64 unsigned int64_t + #define RAD_S64 signed int64_t #else // 16-bit typedef RADSTRUCT RAD_U64 // do this so that we don't accidentally use U64s @@ -1883,7 +1883,7 @@ unsigned long __cdecl _byteswap_ulong (unsigned long _Long); #define RR_BSWAP16 _byteswap_ushort #define RR_BSWAP32 _byteswap_ulong -unsigned __int64 __cdecl _byteswap_uint64 (unsigned __int64 val); +unsigned int64_t __cdecl _byteswap_uint64 (unsigned int64_t val); #pragma intrinsic(_byteswap_uint64) #define RR_BSWAP64 _byteswap_uint64 @@ -1909,15 +1909,15 @@ RADFORCEINLINE unsigned long RR_BSWAP32 (unsigned long _Long) return _Long; } -RADFORCEINLINE unsigned __int64 RR_BSWAP64 (unsigned __int64 _Long) +RADFORCEINLINE unsigned int64_t RR_BSWAP64 (unsigned int64_t _Long) { __asm { - mov eax, DWORD PTR _Long - mov edx, DWORD PTR _Long+4 + mov eax, unsigned long PTR _Long + mov edx, unsigned long PTR _Long+4 bswap eax bswap edx - mov DWORD PTR _Long, edx - mov DWORD PTR _Long+4, eax + mov unsigned long PTR _Long, edx + mov unsigned long PTR _Long+4, eax } return _Long; } @@ -2250,10 +2250,10 @@ void __storewordbytereverse (unsigned int val, int offset, void *bas #if ( defined(_MSC_VER) && _MSC_VER >= 1300) -unsigned __int64 __cdecl _rotl64(unsigned __int64 _Val, int _Shift); +unsigned int64_t __cdecl _rotl64(unsigned int64_t _Val, int _Shift); #pragma intrinsic(_rotl64) -#define RR_ROTL64(x,k) _rotl64((unsigned __int64)(x),(int)(k)) +#define RR_ROTL64(x,k) _rotl64((unsigned int64_t)(x),(int)(k)) #elif defined(__RADCELL__) diff --git a/src/client/Windows64/Minecraft_Macros.h b/src/client/Windows64/Minecraft_Macros.h index 3dc8b792..30ef555e 100644 --- a/src/client/Windows64/Minecraft_Macros.h +++ b/src/client/Windows64/Minecraft_Macros.h @@ -35,7 +35,7 @@ #define MAKE_SKIN_BITMASK(bDlcSkin, dwSkinId) ( (bDlcSkin?0x80000000:0) | (dwSkinId & 0x7FFFFFFF) ) #define IS_SKIN_ID_IN_RANGE(dwSkinId) (dwSkinId <= 0x7FFFFFFF) -#define GET_DLC_SKIN_ID_FROM_BITMASK(uiBitmask) (((DWORD)uiBitmask)&0x7FFFFFFF) -#define GET_UGC_SKIN_ID_FROM_BITMASK(uiBitmask) (((DWORD)uiBitmask)&0x7FFFFFE0) -#define GET_DEFAULT_SKIN_ID_FROM_BITMASK(uiBitmask) (((DWORD)uiBitmask)&0x0000001F) -#define GET_IS_DLC_SKIN_FROM_BITMASK(uiBitmask) ((((DWORD)uiBitmask)&0x80000000)?true:false) +#define GET_DLC_SKIN_ID_FROM_BITMASK(uiBitmask) (((unsigned long)uiBitmask)&0x7FFFFFFF) +#define GET_UGC_SKIN_ID_FROM_BITMASK(uiBitmask) (((unsigned long)uiBitmask)&0x7FFFFFE0) +#define GET_DEFAULT_SKIN_ID_FROM_BITMASK(uiBitmask) (((unsigned long)uiBitmask)&0x0000001F) +#define GET_IS_DLC_SKIN_FROM_BITMASK(uiBitmask) ((((unsigned long)uiBitmask)&0x80000000)?true:false) diff --git a/src/client/Windows64/Sentient/DynamicConfigurations.h b/src/client/Windows64/Sentient/DynamicConfigurations.h index 61b206eb..1119122f 100644 --- a/src/client/Windows64/Sentient/DynamicConfigurations.h +++ b/src/client/Windows64/Sentient/DynamicConfigurations.h @@ -30,12 +30,12 @@ private: ************************/ // 4J Stu - The first 4 bytes define a version number, that defines the structure of the data - // After reading those bytes into a DWORD, the remainder of the data should be the size of the + // After reading those bytes into a unsigned long, the remainder of the data should be the size of the // relevant struct and can be cast to the struct struct _dynamic_config_trial_data_version1 { // The time in seconds that the player can play the trial for - DWORD trialTimeSeconds; + unsigned long trialTimeSeconds; _dynamic_config_trial_data_version1() { trialTimeSeconds = DYNAMIC_CONFIG_DEFAULT_TRIAL_TIME; } }; @@ -56,13 +56,13 @@ private: public: static void Tick(); - static DWORD GetTrialTime(); + static unsigned long GetTrialTime(); private: static void UpdateAllConfigurations(); static void UpdateNextConfiguration(); static void UpdateConfiguration(EDynamic_Configs id); - static void GetSizeCompletedCallback(HRESULT taskResult, void *userCallbackData); - static void GetDataCompletedCallback(HRESULT taskResult, void *userCallbackData); + static void GetSizeCompletedCallback(int taskResult, void *userCallbackData); + static void GetDataCompletedCallback(int taskResult, void *userCallbackData); }; \ No newline at end of file diff --git a/src/client/Windows64/Sentient/SentientManager.h b/src/client/Windows64/Sentient/SentientManager.h index d5397249..2e6dd443 100644 --- a/src/client/Windows64/Sentient/SentientManager.h +++ b/src/client/Windows64/Sentient/SentientManager.h @@ -23,35 +23,35 @@ public: eTelemetry_EnemyKilledOrOvercome, }; - HRESULT Init(); - HRESULT Tick(); + int Init(); + int Tick(); - HRESULT Flush(); + int Flush(); - BOOL RecordPlayerSessionStart(DWORD dwUserId); - BOOL RecordPlayerSessionExit(DWORD dwUserId, int exitStatus); - BOOL RecordHeartBeat(DWORD dwUserId); - BOOL RecordLevelStart(DWORD dwUserId, ESen_FriendOrMatch friendsOrMatch, ESen_CompeteOrCoop competeOrCoop, int difficulty, DWORD numberOfLocalPlayers, DWORD numberOfOnlinePlayers); - BOOL RecordLevelExit(DWORD dwUserId, ESen_LevelExitStatus levelExitStatus); - BOOL RecordLevelSaveOrCheckpoint(DWORD dwUserId, INT saveOrCheckPointID, INT saveSizeInBytes); - BOOL RecordLevelResume(DWORD dwUserId, ESen_FriendOrMatch friendsOrMatch, ESen_CompeteOrCoop competeOrCoop, int difficulty, DWORD numberOfLocalPlayers, DWORD numberOfOnlinePlayers, INT saveOrCheckPointID); - BOOL RecordPauseOrInactive(DWORD dwUserId); - BOOL RecordUnpauseOrActive(DWORD dwUserId); - BOOL RecordMenuShown(DWORD dwUserId, INT menuID, INT optionalMenuSubID); - BOOL RecordAchievementUnlocked(DWORD dwUserId, INT achievementID, INT achievementGamerscore); - BOOL RecordMediaShareUpload(DWORD dwUserId, ESen_MediaDestination mediaDestination, ESen_MediaType mediaType); - BOOL RecordUpsellPresented(DWORD dwUserId, ESen_UpsellID upsellId, INT marketplaceOfferID); - BOOL RecordUpsellResponded(DWORD dwUserId, ESen_UpsellID upsellId, INT marketplaceOfferID, ESen_UpsellOutcome upsellOutcome); - BOOL RecordPlayerDiedOrFailed(DWORD dwUserId, INT lowResMapX, INT lowResMapY, INT lowResMapZ, INT mapID, INT playerWeaponID, INT enemyWeaponID, ETelemetryChallenges enemyTypeID); - BOOL RecordEnemyKilledOrOvercome(DWORD dwUserId, INT lowResMapX, INT lowResMapY, INT lowResMapZ, INT mapID, INT playerWeaponID, INT enemyWeaponID, ETelemetryChallenges enemyTypeID); + bool RecordPlayerSessionStart(unsigned long dwUserId); + bool RecordPlayerSessionExit(unsigned long dwUserId, int exitStatus); + bool RecordHeartBeat(unsigned long dwUserId); + bool RecordLevelStart(unsigned long dwUserId, ESen_FriendOrMatch friendsOrMatch, ESen_CompeteOrCoop competeOrCoop, int difficulty, unsigned long numberOfLocalPlayers, unsigned long numberOfOnlinePlayers); + bool RecordLevelExit(unsigned long dwUserId, ESen_LevelExitStatus levelExitStatus); + bool RecordLevelSaveOrCheckpoint(unsigned long dwUserId, int saveOrCheckPointID, int saveSizeInBytes); + bool RecordLevelResume(unsigned long dwUserId, ESen_FriendOrMatch friendsOrMatch, ESen_CompeteOrCoop competeOrCoop, int difficulty, unsigned long numberOfLocalPlayers, unsigned long numberOfOnlinePlayers, int saveOrCheckPointID); + bool RecordPauseOrInactive(unsigned long dwUserId); + bool RecordUnpauseOrActive(unsigned long dwUserId); + bool RecordMenuShown(unsigned long dwUserId, int menuID, int optionalMenuSubID); + bool RecordAchievementUnlocked(unsigned long dwUserId, int achievementID, int achievementGamerscore); + bool RecordMediaShareUpload(unsigned long dwUserId, ESen_MediaDestination mediaDestination, ESen_MediaType mediaType); + bool RecordUpsellPresented(unsigned long dwUserId, ESen_UpsellID upsellId, int marketplaceOfferID); + bool RecordUpsellResponded(unsigned long dwUserId, ESen_UpsellID upsellId, int marketplaceOfferID, ESen_UpsellOutcome upsellOutcome); + bool RecordPlayerDiedOrFailed(unsigned long dwUserId, int lowResMapX, int lowResMapY, int lowResMapZ, int mapID, int playerWeaponID, int enemyWeaponID, ETelemetryChallenges enemyTypeID); + bool RecordEnemyKilledOrOvercome(unsigned long dwUserId, int lowResMapX, int lowResMapY, int lowResMapZ, int mapID, int playerWeaponID, int enemyWeaponID, ETelemetryChallenges enemyTypeID); - BOOL RecordSkinChanged(DWORD dwUserId, DWORD dwSkinId); - BOOL RecordBanLevel(DWORD dwUserId); - BOOL RecordUnBanLevel(DWORD dwUserId); + bool RecordSkinChanged(unsigned long dwUserId, unsigned long dwSkinId); + bool RecordBanLevel(unsigned long dwUserId); + bool RecordUnBanLevel(unsigned long dwUserId); - INT GetMultiplayerInstanceID(); - INT GenerateMultiplayerInstanceId(); - void SetMultiplayerInstanceId(INT value); + int GetMultiplayerInstanceID(); + int GenerateMultiplayerInstanceId(); + void SetMultiplayerInstanceId(int value); private: float m_initialiseTime; @@ -60,24 +60,24 @@ private: float m_fLevelStartTime[XUSER_MAX_COUNT]; - INT m_multiplayerInstanceID; - DWORD m_levelInstanceID; + int m_multiplayerInstanceID; + unsigned long m_levelInstanceID; // Helper functions to get the various common settings - INT GetSecondsSinceInitialize(); - INT GetMode(DWORD dwUserId); - INT GetSubMode(DWORD dwUserId); - INT GetLevelId(DWORD dwUserId); - INT GetSubLevelId(DWORD dwUserId); - INT GetTitleBuildId(); - INT GetLevelInstanceID(); - INT GetSingleOrMultiplayer(); - INT GetDifficultyLevel(INT diff); - INT GetLicense(); - INT GetDefaultGameControls(); - INT GetAudioSettings(DWORD dwUserId); - INT GetLevelExitProgressStat1(); - INT GetLevelExitProgressStat2(); + int GetSecondsSinceInitialize(); + int GetMode(unsigned long dwUserId); + int GetSubMode(unsigned long dwUserId); + int GetLevelId(unsigned long dwUserId); + int GetSubLevelId(unsigned long dwUserId); + int GetTitleBuildId(); + int GetLevelInstanceID(); + int GetSingleOrMultiplayer(); + int GetDifficultyLevel(int diff); + int GetLicense(); + int GetDefaultGameControls(); + int GetAudioSettings(unsigned long dwUserId); + int GetLevelExitProgressStat1(); + int GetLevelExitProgressStat2(); }; extern CSentientManager SentientManager; \ No newline at end of file diff --git a/src/client/Windows64/Sentient/SentientStats.h b/src/client/Windows64/Sentient/SentientStats.h index 7115e25d..69d67c82 100644 --- a/src/client/Windows64/Sentient/SentientStats.h +++ b/src/client/Windows64/Sentient/SentientStats.h @@ -12,77 +12,77 @@ // PlayerSessionStart // Player signed in or joined -BOOL SenStatPlayerSessionStart ( DWORD dwUserID, INT SecondsSinceInitialize, INT ModeID, INT OptionalSubModeID, INT LevelID, INT OptionalSubLevelID, INT TitleBuildID, INT SkeletonDistanceInInches, INT EnrollmentType, INT NumberOfSkeletonsInView ); +bool SenStatPlayerSessionStart ( unsigned long dwUserID, int SecondsSinceInitialize, int ModeID, int OptionalSubModeID, int LevelID, int OptionalSubLevelID, int TitleBuildID, int SkeletonDistanceInInches, int EnrollmentType, int NumberOfSkeletonsInView ); // PlayerSessionExit // Player signed out or left -BOOL SenStatPlayerSessionExit ( DWORD dwUserID, INT SecondsSinceInitialize, INT ModeID, INT OptionalSubModeID, INT LevelID, INT OptionalSubLevelID ); +bool SenStatPlayerSessionExit ( unsigned long dwUserID, int SecondsSinceInitialize, int ModeID, int OptionalSubModeID, int LevelID, int OptionalSubLevelID ); // HeartBeat // Sent every 60 seconds by title -BOOL SenStatHeartBeat ( DWORD dwUserID, INT SecondsSinceInitialize ); +bool SenStatHeartBeat ( unsigned long dwUserID, int SecondsSinceInitialize ); // LevelStart // Level started -BOOL SenStatLevelStart ( DWORD dwUserID, INT SecondsSinceInitialize, INT ModeID, INT OptionalSubModeID, INT LevelID, INT OptionalSubLevelID, INT LevelInstanceID, INT MultiplayerInstanceID, INT SingleOrMultiplayer, INT FriendsOrMatch, INT CompeteOrCoop, INT DifficultyLevel, INT NumberOfLocalPlayers, INT NumberOfOnlinePlayers, INT License, INT DefaultGameControls, INT AudioSettings, INT SkeletonDistanceInInches, INT NumberOfSkeletonsInView ); +bool SenStatLevelStart ( unsigned long dwUserID, int SecondsSinceInitialize, int ModeID, int OptionalSubModeID, int LevelID, int OptionalSubLevelID, int LevelInstanceID, int MultiplayerInstanceID, int SingleOrMultiplayer, int FriendsOrMatch, int CompeteOrCoop, int DifficultyLevel, int NumberOfLocalPlayers, int NumberOfOnlinePlayers, int License, int DefaultGameControls, int AudioSettings, int SkeletonDistanceInInches, int NumberOfSkeletonsInView ); // LevelExit // Level exited -BOOL SenStatLevelExit ( DWORD dwUserID, INT SecondsSinceInitialize, INT ModeID, INT OptionalSubModeID, INT LevelID, INT OptionalSubLevelID, INT LevelInstanceID, INT MultiplayerInstanceID, INT LevelExitStatus, INT LevelExitProgressStat1, INT LevelExitProgressStat2, INT LevelDurationInSeconds ); +bool SenStatLevelExit ( unsigned long dwUserID, int SecondsSinceInitialize, int ModeID, int OptionalSubModeID, int LevelID, int OptionalSubLevelID, int LevelInstanceID, int MultiplayerInstanceID, int LevelExitStatus, int LevelExitProgressStat1, int LevelExitProgressStat2, int LevelDurationInSeconds ); // LevelSaveOrCheckpoint // Level saved explicitly or implicitly -BOOL SenStatLevelSaveOrCheckpoint ( DWORD dwUserID, INT SecondsSinceInitialize, INT ModeID, INT OptionalSubModeID, INT LevelID, INT OptionalSubLevelID, INT LevelInstanceID, INT MultiplayerInstanceID, INT LevelExitProgressStat1, INT LevelExitProgressStat2, INT LevelDurationInSeconds, INT SaveOrCheckPointID ); +bool SenStatLevelSaveOrCheckpoint ( unsigned long dwUserID, int SecondsSinceInitialize, int ModeID, int OptionalSubModeID, int LevelID, int OptionalSubLevelID, int LevelInstanceID, int MultiplayerInstanceID, int LevelExitProgressStat1, int LevelExitProgressStat2, int LevelDurationInSeconds, int SaveOrCheckPointID ); // LevelResume // Level resumed from a save or restarted at a checkpoint -BOOL SenStatLevelResume ( DWORD dwUserID, INT SecondsSinceInitialize, INT ModeID, INT OptionalSubModeID, INT LevelID, INT OptionalSubLevelID, INT LevelInstanceID, INT MultiplayerInstanceID, INT SingleOrMultiplayer, INT FriendsOrMatch, INT CompeteOrCoop, INT DifficultyLevel, INT NumberOfLocalPlayers, INT NumberOfOnlinePlayers, INT License, INT DefaultGameControls, INT SaveOrCheckPointID, INT AudioSettings, INT SkeletonDistanceInInches, INT NumberOfSkeletonsInView ); +bool SenStatLevelResume ( unsigned long dwUserID, int SecondsSinceInitialize, int ModeID, int OptionalSubModeID, int LevelID, int OptionalSubLevelID, int LevelInstanceID, int MultiplayerInstanceID, int SingleOrMultiplayer, int FriendsOrMatch, int CompeteOrCoop, int DifficultyLevel, int NumberOfLocalPlayers, int NumberOfOnlinePlayers, int License, int DefaultGameControls, int SaveOrCheckPointID, int AudioSettings, int SkeletonDistanceInInches, int NumberOfSkeletonsInView ); // PauseOrInactive // Player paused game or has become inactive, level and mode are for what the player is leaving -BOOL SenStatPauseOrInactive ( DWORD dwUserID, INT SecondsSinceInitialize, INT ModeID, INT OptionalSubModeID, INT LevelID, INT OptionalSubLevelID, INT LevelInstanceID, INT MultiplayerInstanceID ); +bool SenStatPauseOrInactive ( unsigned long dwUserID, int SecondsSinceInitialize, int ModeID, int OptionalSubModeID, int LevelID, int OptionalSubLevelID, int LevelInstanceID, int MultiplayerInstanceID ); // UnpauseOrActive // Player unpaused game or has become active, level and mode are for what the player is entering into -BOOL SenStatUnpauseOrActive ( DWORD dwUserID, INT SecondsSinceInitialize, INT ModeID, INT OptionalSubModeID, INT LevelID, INT OptionalSubLevelID, INT LevelInstanceID, INT MultiplayerInstanceID ); +bool SenStatUnpauseOrActive ( unsigned long dwUserID, int SecondsSinceInitialize, int ModeID, int OptionalSubModeID, int LevelID, int OptionalSubLevelID, int LevelInstanceID, int MultiplayerInstanceID ); // MenuShown // A menu screen or major menu area has been shown -BOOL SenStatMenuShown ( DWORD dwUserID, INT SecondsSinceInitialize, INT ModeID, INT OptionalSubModeID, INT LevelID, INT OptionalSubLevelID, INT MenuID, INT OptionalMenuSubID, INT LevelInstanceID, INT MultiplayerInstanceID ); +bool SenStatMenuShown ( unsigned long dwUserID, int SecondsSinceInitialize, int ModeID, int OptionalSubModeID, int LevelID, int OptionalSubLevelID, int MenuID, int OptionalMenuSubID, int LevelInstanceID, int MultiplayerInstanceID ); // AchievementUnlocked // An achievement was unlocked -BOOL SenStatAchievementUnlocked ( DWORD dwUserID, INT SecondsSinceInitialize, INT ModeID, INT OptionalSubModeID, INT LevelID, INT OptionalSubLevelID, INT LevelInstanceID, INT MultiplayerInstanceID, INT AchievementID, INT AchievementGamerscore ); +bool SenStatAchievementUnlocked ( unsigned long dwUserID, int SecondsSinceInitialize, int ModeID, int OptionalSubModeID, int LevelID, int OptionalSubLevelID, int LevelInstanceID, int MultiplayerInstanceID, int AchievementID, int AchievementGamerscore ); // MediaShareUpload // The user uploaded something to Kinect Share -BOOL SenStatMediaShareUpload ( DWORD dwUserID, INT SecondsSinceInitialize, INT ModeID, INT OptionalSubModeID, INT LevelID, INT OptionalSubLevelID, INT LevelInstanceID, INT MultiplayerInstanceID, INT MediaDestination, INT MediaType ); +bool SenStatMediaShareUpload ( unsigned long dwUserID, int SecondsSinceInitialize, int ModeID, int OptionalSubModeID, int LevelID, int OptionalSubLevelID, int LevelInstanceID, int MultiplayerInstanceID, int MediaDestination, int MediaType ); // UpsellPresented // The user is shown an upsell to purchase something -BOOL SenStatUpsellPresented ( DWORD dwUserID, INT SecondsSinceInitialize, INT ModeID, INT OptionalSubModeID, INT LevelID, INT OptionalSubLevelID, INT LevelInstanceID, INT MultiplayerInstanceID, INT UpsellID, INT MarketplaceOfferID ); +bool SenStatUpsellPresented ( unsigned long dwUserID, int SecondsSinceInitialize, int ModeID, int OptionalSubModeID, int LevelID, int OptionalSubLevelID, int LevelInstanceID, int MultiplayerInstanceID, int UpsellID, int MarketplaceOfferID ); // UpsellResponded // The user responded to the upsell -BOOL SenStatUpsellResponded ( DWORD dwUserID, INT SecondsSinceInitialize, INT ModeID, INT OptionalSubModeID, INT LevelID, INT OptionalSubLevelID, INT LevelInstanceID, INT MultiplayerInstanceID, INT UpsellID, INT MarketplaceOfferID, INT UpsellOutcome ); +bool SenStatUpsellResponded ( unsigned long dwUserID, int SecondsSinceInitialize, int ModeID, int OptionalSubModeID, int LevelID, int OptionalSubLevelID, int LevelInstanceID, int MultiplayerInstanceID, int UpsellID, int MarketplaceOfferID, int UpsellOutcome ); // PlayerDiedOrFailed // The player died or failed a challenge - can be used for many types of failure -BOOL SenStatPlayerDiedOrFailed ( DWORD dwUserID, INT ModeID, INT OptionalSubModeID, INT LevelID, INT OptionalSubLevelID, INT LevelInstanceID, INT MultiplayerInstanceID, INT LowResMapX, INT LowResMapY, INT LowResMapZ, INT MapID, INT PlayerWeaponID, INT EnemyWeaponID, INT EnemyTypeID, INT SecondsSinceInitialize, INT CopyOfSecondsSinceInitialize ); +bool SenStatPlayerDiedOrFailed ( unsigned long dwUserID, int ModeID, int OptionalSubModeID, int LevelID, int OptionalSubLevelID, int LevelInstanceID, int MultiplayerInstanceID, int LowResMapX, int LowResMapY, int LowResMapZ, int MapID, int PlayerWeaponID, int EnemyWeaponID, int EnemyTypeID, int SecondsSinceInitialize, int CopyOfSecondsSinceInitialize ); // EnemyKilledOrOvercome // The player killed an enemy or overcame or solved a major challenge -BOOL SenStatEnemyKilledOrOvercome ( DWORD dwUserID, INT ModeID, INT OptionalSubModeID, INT LevelID, INT OptionalSubLevelID, INT LevelInstanceID, INT MultiplayerInstanceID, INT LowResMapX, INT LowResMapY, INT LowResMapZ, INT MapID, INT PlayerWeaponID, INT EnemyWeaponID, INT EnemyTypeID, INT SecondsSinceInitialize, INT CopyOfSecondsSinceInitialize ); +bool SenStatEnemyKilledOrOvercome ( unsigned long dwUserID, int ModeID, int OptionalSubModeID, int LevelID, int OptionalSubLevelID, int LevelInstanceID, int MultiplayerInstanceID, int LowResMapX, int LowResMapY, int LowResMapZ, int MapID, int PlayerWeaponID, int EnemyWeaponID, int EnemyTypeID, int SecondsSinceInitialize, int CopyOfSecondsSinceInitialize ); // SkinChanged // The player has changed their skin, level and mode are for what the player is currently in -BOOL SenStatSkinChanged ( DWORD dwUserID, INT SecondsSinceInitialize, INT ModeID, INT OptionalSubModeID, INT LevelID, INT OptionalSubLevelID, INT LevelInstanceID, INT MultiplayerInstanceID, INT SkinID ); +bool SenStatSkinChanged ( unsigned long dwUserID, int SecondsSinceInitialize, int ModeID, int OptionalSubModeID, int LevelID, int OptionalSubLevelID, int LevelInstanceID, int MultiplayerInstanceID, int SkinID ); // BanLevel // The player has banned a level, level and mode are for what the player is currently in and banning -BOOL SenStatBanLevel ( DWORD dwUserID, INT SecondsSinceInitialize, INT ModeID, INT OptionalSubModeID, INT LevelID, INT OptionalSubLevelID, INT LevelInstanceID, INT MultiplayerInstanceID ); +bool SenStatBanLevel ( unsigned long dwUserID, int SecondsSinceInitialize, int ModeID, int OptionalSubModeID, int LevelID, int OptionalSubLevelID, int LevelInstanceID, int MultiplayerInstanceID ); // UnBanLevel // The player has ubbanned a level, level and mode are for what the player is currently in and unbanning -BOOL SenStatUnBanLevel ( DWORD dwUserID, INT SecondsSinceInitialize, INT ModeID, INT OptionalSubModeID, INT LevelID, INT OptionalSubLevelID, INT LevelInstanceID, INT MultiplayerInstanceID ); +bool SenStatUnBanLevel ( unsigned long dwUserID, int SecondsSinceInitialize, int ModeID, int OptionalSubModeID, int LevelID, int OptionalSubLevelID, int LevelInstanceID, int MultiplayerInstanceID ); diff --git a/src/client/Windows64/Social/SocialManager.h b/src/client/Windows64/Social/SocialManager.h index 0b6f2b2d..37b9a8ef 100644 --- a/src/client/Windows64/Social/SocialManager.h +++ b/src/client/Windows64/Social/SocialManager.h @@ -33,18 +33,18 @@ private: static CSocialManager* m_pInstance; // Bitset of title posting capability flags ( XSOCIAL_CAPABILITY_POSTIMAGE, XSOCIAL_CAPABILITY_POSTLINK ). - DWORD m_dwSocialPostingCapability; + unsigned long m_dwSocialPostingCapability; // Index of user who made current active request. - DWORD m_dwCurrRequestUser; + unsigned long m_dwCurrRequestUser; // WESTY : Not sure if we even need to get social access key! /* // Size of the social network access key text buffer. - DWORD m_dwAccessKeyTextSize; + unsigned long m_dwAccessKeyTextSize; // Pointer to the social network access key text buffer. - LPWSTR m_pAccessKeyText; + wchar_t* m_pAccessKeyText; */ // The various states of the manager. @@ -63,7 +63,7 @@ private: // For xsocial asyncronous operations. XOVERLAPPED m_Overlapped; - DWORD m_dwOverlappedResultCode; + unsigned long m_dwOverlappedResultCode; // Social post preview image struct. XSOCIAL_PREVIEWIMAGE m_PostPreviewImage; @@ -78,14 +78,14 @@ private: // Image details for posting an image to social network. unsigned char* m_pMainImageBuffer; - DWORD m_dwMainImageBufferSize; + unsigned long m_dwMainImageBufferSize; void DestroyMainPostImage(); void DestroyPreviewPostImage(); // WESTY : Not sure if we even need to get social access key! /* - bool GetSocialNetworkAccessKey( ESocialNetwork eSocialNetwork, DWORD dwUserIndex, bool bUsingKinect, DWORD dwUserTrackingIndex, bool bShowNetworkSignin ); + bool GetSocialNetworkAccessKey( ESocialNetwork eSocialNetwork, unsigned long dwUserIndex, bool bUsingKinect, unsigned long dwUserTrackingIndex, bool bShowNetworkSignin ); */ public: @@ -114,23 +114,23 @@ public: bool AreAllUsersAllowedToPostImages(); // Post a test link to social network. - bool PostLinkToSocialNetwork( ESocialNetwork eSocialNetwork, DWORD dwUserIndex, bool bUsingKinect ); + bool PostLinkToSocialNetwork( ESocialNetwork eSocialNetwork, unsigned long dwUserIndex, bool bUsingKinect ); // Post a test image to social network. - bool PostImageToSocialNetwork( ESocialNetwork eSocialNetwork, DWORD dwUserIndex, bool bUsingKinect ); + bool PostImageToSocialNetwork( ESocialNetwork eSocialNetwork, unsigned long dwUserIndex, bool bUsingKinect ); - void SetSocialPostText(LPCWSTR Title, LPCWSTR Caption, LPCWSTR Desc); + void SetSocialPostText(const wchar_t* Title, const wchar_t* Caption, const wchar_t* Desc); // WESTY : Not sure if we even need to get social access key! /* // We do not currently know what this is used for. We may not even need it? - bool ObtainSocialNetworkAccessKey( ESocialNetwork eSocialNetwork, DWORD dwUserIndex, bool bUsingKinect ); + bool ObtainSocialNetworkAccessKey( ESocialNetwork eSocialNetwork, unsigned long dwUserIndex, bool bUsingKinect ); */ private: - WCHAR m_wchTitleA[MAX_SOCIALPOST_CAPTION+1]; - WCHAR m_wchCaptionA[MAX_SOCIALPOST_CAPTION+1]; - WCHAR m_wchDescA[MAX_SOCIALPOST_DESC+1]; + wchar_t m_wchTitleA[MAX_SOCIALPOST_CAPTION+1]; + wchar_t m_wchCaptionA[MAX_SOCIALPOST_CAPTION+1]; + wchar_t m_wchDescA[MAX_SOCIALPOST_DESC+1]; }; diff --git a/src/client/Windows64/Windows64_App.cpp b/src/client/Windows64/Windows64_App.cpp index 472b288a..16b19c32 100644 --- a/src/client/Windows64/Windows64_App.cpp +++ b/src/client/Windows64/Windows64_App.cpp @@ -34,14 +34,14 @@ void CConsoleMinecraftApp::FatalLoadError() void CConsoleMinecraftApp::CaptureSaveThumbnail() { } -void CConsoleMinecraftApp::GetSaveThumbnail(PBYTE *pbData,DWORD *pdwSize) +void CConsoleMinecraftApp::GetSaveThumbnail(uint8_t* *pbData,unsigned long *pdwSize) { } void CConsoleMinecraftApp::ReleaseSaveThumbnail() { } -void CConsoleMinecraftApp::GetScreenshot(int iPad,PBYTE *pbData,DWORD *pdwSize) +void CConsoleMinecraftApp::GetScreenshot(int iPad,uint8_t* *pbData,unsigned long *pdwSize) { } @@ -74,7 +74,7 @@ void CConsoleMinecraftApp::TemporaryCreateGameStart() StorageManager.SetSaveTitle(wWorldName.c_str()); bool isFlat = false; - __int64 seedValue = 0; // BiomeSource::findSeed(isFlat?LevelType::lvl_flat:LevelType::lvl_normal); // 4J - was (new Random())->nextLong() - now trying to actually find a seed to suit our requirements + int64_t seedValue = 0; // BiomeSource::findSeed(isFlat?LevelType::lvl_flat:LevelType::lvl_normal); // 4J - was (new Random())->nextLong() - now trying to actually find a seed to suit our requirements NetworkGameInitData *param = new NetworkGameInitData(); param->seed = seedValue; @@ -104,7 +104,7 @@ void CConsoleMinecraftApp::TemporaryCreateGameStart() LoadingInputParams *loadingParams = new LoadingInputParams(); loadingParams->func = &CGameNetworkManager::RunNetworkGameThreadProc; - loadingParams->lpParam = (LPVOID)param; + loadingParams->lpParam = (void*)param; // Reset the autosave time app.SetAutosaveTimerTime(); @@ -113,17 +113,17 @@ void CConsoleMinecraftApp::TemporaryCreateGameStart() thread->Run(); } -int CConsoleMinecraftApp::GetLocalTMSFileIndex(WCHAR *wchTMSFile,bool bFilenameIncludesExtension,eFileExtensionType eEXT) +int CConsoleMinecraftApp::GetLocalTMSFileIndex(wchar_t *wchTMSFile,bool bFilenameIncludesExtension,eFileExtensionType eEXT) { return -1; } -int CConsoleMinecraftApp::LoadLocalTMSFile(WCHAR *wchTMSFile) +int CConsoleMinecraftApp::LoadLocalTMSFile(wchar_t *wchTMSFile) { return -1; } -int CConsoleMinecraftApp::LoadLocalTMSFile(WCHAR *wchTMSFile, eFileExtensionType eExt) +int CConsoleMinecraftApp::LoadLocalTMSFile(wchar_t *wchTMSFile, eFileExtensionType eExt) { return -1; } diff --git a/src/client/Windows64/Windows64_App.h b/src/client/Windows64/Windows64_App.h index 39351d55..b77b5c48 100644 --- a/src/client/Windows64/Windows64_App.h +++ b/src/client/Windows64/Windows64_App.h @@ -12,15 +12,15 @@ public: virtual void FatalLoadError(); virtual void CaptureSaveThumbnail(); - virtual void GetSaveThumbnail(PBYTE*,DWORD*); + virtual void GetSaveThumbnail(uint8_t**,unsigned long*); virtual void ReleaseSaveThumbnail(); - virtual void GetScreenshot(int iPad,PBYTE *pbData,DWORD *pdwSize); + virtual void GetScreenshot(int iPad,uint8_t* *pbData,unsigned long *pdwSize); - virtual int LoadLocalTMSFile(WCHAR *wchTMSFile); - virtual int LoadLocalTMSFile(WCHAR *wchTMSFile, eFileExtensionType eExt); + virtual int LoadLocalTMSFile(wchar_t *wchTMSFile); + virtual int LoadLocalTMSFile(wchar_t *wchTMSFile, eFileExtensionType eExt); virtual void FreeLocalTMSFiles(eTMSFileType eType); - virtual int GetLocalTMSFileIndex(WCHAR *wchTMSFile,bool bFilenameIncludesExtension,eFileExtensionType eEXT=eFileExtensionType_PNG); + virtual int GetLocalTMSFileIndex(wchar_t *wchTMSFile,bool bFilenameIncludesExtension,eFileExtensionType eEXT=eFileExtensionType_PNG); // BANNED LEVEL LIST virtual void ReadBannedList(int iPad, eTMSAction action=(eTMSAction)0, bool bCallback=false) {} diff --git a/src/client/Windows64/Windows64_Minecraft.cpp b/src/client/Windows64/Windows64_Minecraft.cpp index 4fab3d8d..c16024fd 100644 --- a/src/client/Windows64/Windows64_Minecraft.cpp +++ b/src/client/Windows64/Windows64_Minecraft.cpp @@ -39,8 +39,8 @@ #include "Xbox/resource.h" -HINSTANCE hMyInst; -LRESULT CALLBACK DlgProc(HWND hWndDlg, UINT Msg, WPARAM wParam, LPARAM lParam); +void* hMyInst; +LRESULT CALLBACK DlgProc(void* hWndDlg, unsigned int Msg, WPARAM wParam, LPARAM lParam); char chGlobalText[256]; uint16_t ui16GlobalText[256]; @@ -55,7 +55,7 @@ uint16_t ui16GlobalText[256]; //#define PROFILE_VERSION 3 // new version for the interim bug fix 166 TU #define NUM_PROFILE_VALUES 5 #define NUM_PROFILE_SETTINGS 4 -DWORD dwProfileSettingsA[NUM_PROFILE_VALUES]= +unsigned long dwProfileSettingsA[NUM_PROFILE_VALUES]= { #ifdef _XBOX XPROFILE_OPTION_CONTROLLER_VIBRATION, @@ -74,7 +74,7 @@ DWORD dwProfileSettingsA[NUM_PROFILE_VALUES]= // for a long time. //------------------------------------------------------------------------------------- -BOOL g_bWidescreen = true; +bool g_bWidescreen = true; int g_iScreenWidth = 1920; int g_iScreenHeight = 1080; @@ -234,7 +234,7 @@ void DefineActions(void) } #if 0 -HRESULT InitD3D( IDirect3DDevice9 **ppDevice, +int InitD3D( IDirect3DDevice9 **ppDevice, D3DPRESENT_PARAMETERS *pd3dPP ) { IDirect3D9 *pD3D; @@ -288,8 +288,8 @@ void MemSect(int sect) } #endif -HINSTANCE g_hInst = NULL; -HWND g_hWnd = NULL; +void* g_hInst = NULL; +void* g_hWnd = NULL; D3D_DRIVER_TYPE g_driverType = D3D_DRIVER_TYPE_NULL; D3D_FEATURE_LEVEL g_featureLevel = D3D_FEATURE_LEVEL_11_0; ID3D11Device* g_pd3dDevice = NULL; @@ -300,7 +300,7 @@ ID3D11DepthStencilView* g_pDepthStencilView = NULL; ID3D11Texture2D* g_pDepthStencilBuffer = NULL; // -// FUNCTION: WndProc(HWND, UINT, WPARAM, LPARAM) +// FUNCTION: WndProc(void*, unsigned int, WPARAM, LPARAM) // // PURPOSE: Processes messages for the main window. // @@ -309,11 +309,11 @@ ID3D11Texture2D* g_pDepthStencilBuffer = NULL; // WM_DESTROY - post a quit message and return // // -LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) +LRESULT CALLBACK WndProc(void* hWnd, unsigned int message, WPARAM wParam, LPARAM lParam) { int wmId, wmEvent; PAINTSTRUCT ps; - HDC hdc; + void* hdc; switch (message) { @@ -350,7 +350,7 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) // // PURPOSE: Registers the window class. // -ATOM MyRegisterClass(HINSTANCE hInstance) +ATOM MyRegisterClass(void* hInstance) { WNDCLASSEX wcex; @@ -372,7 +372,7 @@ ATOM MyRegisterClass(HINSTANCE hInstance) } // -// FUNCTION: InitInstance(HINSTANCE, int) +// FUNCTION: InitInstance(void*, int) // // PURPOSE: Saves instance handle and creates main window // @@ -381,7 +381,7 @@ ATOM MyRegisterClass(HINSTANCE hInstance) // In this function, we save the instance handle in a global variable and // create and display the main program window. // -BOOL InitInstance(HINSTANCE hInstance, int nCmdShow) +bool InitInstance(void* hInstance, int nCmdShow) { g_hInst = hInstance; // Store instance handle in our global variable @@ -437,7 +437,7 @@ void SeedEditBox() //--------------------------------------------------------------------------- -LRESULT CALLBACK DlgProc(HWND hWndDlg, UINT Msg, WPARAM wParam, LPARAM lParam) +LRESULT CALLBACK DlgProc(void* hWndDlg, unsigned int Msg, WPARAM wParam, LPARAM lParam) { switch(Msg) { @@ -462,20 +462,20 @@ LRESULT CALLBACK DlgProc(HWND hWndDlg, UINT Msg, WPARAM wParam, LPARAM lParam) //-------------------------------------------------------------------------------------- // Create Direct3D device and swap chain //-------------------------------------------------------------------------------------- -HRESULT InitDevice() +int InitDevice() { - HRESULT hr = S_OK; + int hr = S_OK; RECT rc; GetClientRect( g_hWnd, &rc ); - UINT width = rc.right - rc.left; - UINT height = rc.bottom - rc.top; + unsigned int width = rc.right - rc.left; + unsigned int height = rc.bottom - rc.top; //app.DebugPrintf("width: %d, height: %d\n", width, height); width = g_iScreenWidth; height = g_iScreenHeight; app.DebugPrintf("width: %d, height: %d\n", width, height); - UINT createDeviceFlags = 0; + unsigned int createDeviceFlags = 0; #ifdef _DEBUG createDeviceFlags |= D3D11_CREATE_DEVICE_DEBUG; #endif @@ -486,7 +486,7 @@ app.DebugPrintf("width: %d, height: %d\n", width, height); D3D_DRIVER_TYPE_WARP, D3D_DRIVER_TYPE_REFERENCE, }; - UINT numDriverTypes = ARRAYSIZE( driverTypes ); + unsigned int numDriverTypes = ARRAYSIZE( driverTypes ); D3D_FEATURE_LEVEL featureLevels[] = { @@ -494,7 +494,7 @@ app.DebugPrintf("width: %d, height: %d\n", width, height); D3D_FEATURE_LEVEL_10_1, D3D_FEATURE_LEVEL_10_0, }; - UINT numFeatureLevels = ARRAYSIZE( featureLevels ); + unsigned int numFeatureLevels = ARRAYSIZE( featureLevels ); DXGI_SWAP_CHAIN_DESC sd; ZeroMemory( &sd, sizeof( sd ) ); @@ -510,7 +510,7 @@ app.DebugPrintf("width: %d, height: %d\n", width, height); sd.SampleDesc.Quality = 0; sd.Windowed = true; - for( UINT driverTypeIndex = 0; driverTypeIndex < numDriverTypes; driverTypeIndex++ ) + for( unsigned int driverTypeIndex = 0; driverTypeIndex < numDriverTypes; driverTypeIndex++ ) { g_driverType = driverTypes[driverTypeIndex]; hr = D3D11CreateDeviceAndSwapChain( NULL, g_driverType, NULL, createDeviceFlags, featureLevels, numFeatureLevels, @@ -523,7 +523,7 @@ app.DebugPrintf("width: %d, height: %d\n", width, height); // Create a render target view ID3D11Texture2D* pBackBuffer = NULL; - hr = g_pSwapChain->GetBuffer( 0, __uuidof( ID3D11Texture2D ), ( LPVOID* )&pBackBuffer ); + hr = g_pSwapChain->GetBuffer( 0, __uuidof( ID3D11Texture2D ), ( void** )&pBackBuffer ); if( FAILED( hr ) ) return hr; @@ -599,8 +599,8 @@ void CleanupDevice() -int APIENTRY _tWinMain(_In_ HINSTANCE hInstance, - _In_opt_ HINSTANCE hPrevInstance, +int APIENTRY _tWinMain(_In_ void* hInstance, + _In_opt_ void* hPrevInstance, _In_ LPTSTR lpCmdLine, _In_ int nCmdShow) { @@ -767,25 +767,25 @@ int APIENTRY _tWinMain(_In_ HINSTANCE hInstance, ProfileManager.RegisterRichPresenceContext(CONTEXT_GAME_STATE); // initialise the storage manager with a default save display name, a Minimum save size, and a callback for displaying the saving message - StorageManager.Init(app.GetString(IDS_DEFAULT_SAVENAME),"savegame.dat",FIFTY_ONE_MB,&CConsoleMinecraftApp::DisplaySavingMessage,(LPVOID)&app); + StorageManager.Init(app.GetString(IDS_DEFAULT_SAVENAME),"savegame.dat",FIFTY_ONE_MB,&CConsoleMinecraftApp::DisplaySavingMessage,(void*)&app); // Set up the global title storage path StorageManager.StoreTMSPathName(); // set a function to be called when there's a sign in change, so we can exit a level if the primary player signs out - ProfileManager.SetSignInChangeCallback(&CConsoleMinecraftApp::SignInChangeCallback,(LPVOID)&app); + ProfileManager.SetSignInChangeCallback(&CConsoleMinecraftApp::SignInChangeCallback,(void*)&app); // set a function to be called when the ethernet is disconnected, so we can back out if required - ProfileManager.SetNotificationsCallback(&CConsoleMinecraftApp::NotificationsCallback,(LPVOID)&app); + ProfileManager.SetNotificationsCallback(&CConsoleMinecraftApp::NotificationsCallback,(void*)&app); #endif // Set a callback for the default player options to be set - when there is no profile data for the player - ProfileManager.SetDefaultOptionsCallback(&CConsoleMinecraftApp::DefaultOptionsCallback,(LPVOID)&app); + ProfileManager.SetDefaultOptionsCallback(&CConsoleMinecraftApp::DefaultOptionsCallback,(void*)&app); #if 0 // Set a callback to deal with old profile versions needing updated to new versions - ProfileManager.SetOldProfileVersionCallback(&CConsoleMinecraftApp::OldProfileVersionCallback,(LPVOID)&app); + ProfileManager.SetOldProfileVersionCallback(&CConsoleMinecraftApp::OldProfileVersionCallback,(void*)&app); // Set a callback for when there is a read error on profile data - ProfileManager.SetProfileReadErrorCallback(&CConsoleMinecraftApp::ProfileReadErrorCallback,(LPVOID)&app); + ProfileManager.SetProfileReadErrorCallback(&CConsoleMinecraftApp::ProfileReadErrorCallback,(void*)&app); #endif // QNet needs to be setup after profile manager, as we do not want its Notify listener to handle @@ -804,7 +804,7 @@ int APIENTRY _tWinMain(_In_ HINSTANCE hInstance, #if 0 //ProfileManager.AddDLC(2); StorageManager.SetDLCPackageRoot("DLCDrive"); - StorageManager.RegisterMarketplaceCountsCallback(&CConsoleMinecraftApp::MarketplaceCountsCallback,(LPVOID)&app); + StorageManager.RegisterMarketplaceCountsCallback(&CConsoleMinecraftApp::MarketplaceCountsCallback,(void*)&app); // Kinect ! if(XNuiGetHardwareStatus()!=0) @@ -866,7 +866,7 @@ int APIENTRY _tWinMain(_In_ HINSTANCE hInstance, app.InitialiseTips(); #if 0 - DWORD initData=0; + unsigned long initData=0; #ifndef _FINAL_BUILD #ifndef _DEBUG @@ -1175,9 +1175,9 @@ volatile size_t sizeCheckMin = 1160; volatile size_t sizeCheckMax = 1160; volatile int sectCheck = 48; CRITICAL_SECTION memCS; -DWORD tlsIdx; +unsigned long tlsIdx; -LPVOID XMemAlloc(SIZE_T dwSize, DWORD dwAllocAttributes) +void* XMemAlloc(size_t dwSize, unsigned long dwAllocAttributes) { if( !trackStarted ) { @@ -1231,7 +1231,7 @@ void operator delete (void *p) XMemFree(p,MAKE_XALLOC_ATTRIBUTES(0,false,true,false,0,XALLOC_PHYSICAL_ALIGNMENT_DEFAULT,XALLOC_MEMPROTECT_READWRITE,false,XALLOC_MEMTYPE_HEAP)); } -void WINAPI XMemFree(PVOID pAddress, DWORD dwAllocAttributes) +void WINAPI XMemFree(void* pAddress, unsigned long dwAllocAttributes) { bool special = false; if( dwAllocAttributes == 0 ) @@ -1266,9 +1266,9 @@ void WINAPI XMemFree(PVOID pAddress, DWORD dwAllocAttributes) LeaveCriticalSection(&memCS); } -SIZE_T WINAPI XMemSize( - PVOID pAddress, - DWORD dwAllocAttributes +size_t WINAPI XMemSize( + void* pAddress, + unsigned long dwAllocAttributes ) { if( trackStarted ) @@ -1323,7 +1323,7 @@ void MemSect(int section) { value = (value << 6) | section; } - TlsSetValue(tlsIdx, (LPVOID)value); + TlsSetValue(tlsIdx, (void*)value); } void MemPixStuff() diff --git a/src/client/Windows64/XML/ATGXmlParser.h b/src/client/Windows64/XML/ATGXmlParser.h index 2da6fe48..7c0babd4 100644 --- a/src/client/Windows64/XML/ATGXmlParser.h +++ b/src/client/Windows64/XML/ATGXmlParser.h @@ -28,10 +28,10 @@ namespace ATG #define E_INVALID_XML_SYNTAX MAKE_HRESULT(1, _ATGFAC, 0x0002 ) -CONST UINT XML_MAX_ATTRIBUTES_PER_ELEMENT = 32; -CONST UINT XML_MAX_NAME_LENGTH = 128; -CONST UINT XML_READ_BUFFER_SIZE = 2048; -CONST UINT XML_WRITE_BUFFER_SIZE = 2048; +const unsigned int XML_MAX_ATTRIBUTES_PER_ELEMENT = 32; +const unsigned int XML_MAX_NAME_LENGTH = 128; +const unsigned int XML_READ_BUFFER_SIZE = 2048; +const unsigned int XML_WRITE_BUFFER_SIZE = 2048; // No tag can be longer than XML_WRITE_BUFFER_SIZE - an error will be returned if // it is @@ -39,10 +39,10 @@ CONST UINT XML_WRITE_BUFFER_SIZE = 2048; //------------------------------------------------------------------------------------- struct XMLAttribute { - WCHAR* strName; - UINT NameLen; - WCHAR* strValue; - UINT ValueLen; + wchar_t* strName; + unsigned int NameLen; + wchar_t* strValue; + unsigned int ValueLen; }; //------------------------------------------------------------------------------------- @@ -53,30 +53,30 @@ public: ISAXCallback() {}; virtual ~ISAXCallback() {}; - virtual HRESULT StartDocument() = 0; - virtual HRESULT EndDocument() = 0; + virtual int StartDocument() = 0; + virtual int EndDocument() = 0; - virtual HRESULT ElementBegin( CONST WCHAR* strName, UINT NameLen, - CONST XMLAttribute *pAttributes, UINT NumAttributes ) = 0; - virtual HRESULT ElementContent( CONST WCHAR *strData, UINT DataLen, BOOL More ) = 0; - virtual HRESULT ElementEnd( CONST WCHAR *strName, UINT NameLen ) = 0; + virtual int ElementBegin( const wchar_t* strName, unsigned int NameLen, + const XMLAttribute *pAttributes, unsigned int NumAttributes ) = 0; + virtual int ElementContent( const wchar_t *strData, unsigned int DataLen, bool More ) = 0; + virtual int ElementEnd( const wchar_t *strName, unsigned int NameLen ) = 0; - virtual HRESULT CDATABegin( ) = 0; - virtual HRESULT CDATAData( CONST WCHAR *strCDATA, UINT CDATALen, BOOL bMore ) = 0; - virtual HRESULT CDATAEnd( ) = 0; + virtual int CDATABegin( ) = 0; + virtual int CDATAData( const wchar_t *strCDATA, unsigned int CDATALen, bool bMore ) = 0; + virtual int CDATAEnd( ) = 0; - virtual VOID Error( HRESULT hError, CONST CHAR *strMessage ) = 0; + virtual void Error( int hError, const char *strMessage ) = 0; - virtual VOID SetParseProgress( DWORD dwProgress ) { } + virtual void SetParseProgress( unsigned long dwProgress ) { } - const CHAR* GetFilename() { return m_strFilename; } - UINT GetLineNumber() { return m_LineNum; } - UINT GetLinePosition() { return m_LinePos; } + const char* GetFilename() { return m_strFilename; } + unsigned int GetLineNumber() { return m_LineNum; } + unsigned int GetLinePosition() { return m_LinePos; } private: - CONST CHAR *m_strFilename; - UINT m_LineNum; - UINT m_LinePos; + const char *m_strFilename; + unsigned int m_LineNum; + unsigned int m_LinePos; }; @@ -88,7 +88,7 @@ public: ~XMLParser(); // Register an interface inheiriting from ISAXCallback - VOID RegisterSAXCallbackInterface( ISAXCallback *pISAXCallback ); + void RegisterSAXCallbackInterface( ISAXCallback *pISAXCallback ); // Get the registered interface ISAXCallback* GetSAXCallbackInterface(); @@ -100,55 +100,55 @@ public: // E_ABORT - callback returned a fail code // S_OK - file parsed and completed - HRESULT ParseXMLFile( CONST CHAR *strFilename ); + int ParseXMLFile( const char *strFilename ); - // Parses from a buffer- if you pass a WCHAR buffer (and cast it), it will + // Parses from a buffer- if you pass a wchar_t buffer (and cast it), it will // correctly detect it and use unicode instead. Return codes are the // same as for ParseXMLFile - HRESULT ParseXMLBuffer( CONST CHAR* strBuffer, UINT uBufferSize ); + int ParseXMLBuffer( const char* strBuffer, unsigned int uBufferSize ); private: - HRESULT MainParseLoop(); + int MainParseLoop(); - HRESULT AdvanceCharacter( BOOL bOkToFail = false ); - VOID SkipNextAdvance(); + int AdvanceCharacter( bool bOkToFail = false ); + void SkipNextAdvance(); - HRESULT ConsumeSpace(); - HRESULT ConvertEscape(); - HRESULT AdvanceElement(); - HRESULT AdvanceName(); - HRESULT AdvanceAttrVal(); - HRESULT AdvanceCDATA(); - HRESULT AdvanceComment(); + int ConsumeSpace(); + int ConvertEscape(); + int AdvanceElement(); + int AdvanceName(); + int AdvanceAttrVal(); + int AdvanceCDATA(); + int AdvanceComment(); - VOID FillBuffer(); + void FillBuffer(); #ifdef _Printf_format_string_ // VC++ 2008 and later support this annotation - VOID Error( HRESULT hRet, _In_z_ _Printf_format_string_ CONST CHAR* strFormat, ... ); + void Error( int hRet, _In_z_ _Printf_format_string_ const char* strFormat, ... ); #else - VOID Error( HRESULT hRet, CONST CHAR* strFormat, ... ); + void Error( int hRet, const char* strFormat, ... ); #endif ISAXCallback* m_pISAXCallback; - HANDLE m_hFile; - CONST CHAR* m_pInXMLBuffer; - UINT m_uInXMLBufferCharsLeft; - DWORD m_dwCharsTotal; - DWORD m_dwCharsConsumed; + void* m_hFile; + const char* m_pInXMLBuffer; + unsigned int m_uInXMLBufferCharsLeft; + unsigned long m_dwCharsTotal; + unsigned long m_dwCharsConsumed; - BYTE m_pReadBuf[ XML_READ_BUFFER_SIZE + 2 ]; // room for a trailing NULL - WCHAR m_pWriteBuf[ XML_WRITE_BUFFER_SIZE ]; + uint8_t m_pReadBuf[ XML_READ_BUFFER_SIZE + 2 ]; // room for a trailing NULL + wchar_t m_pWriteBuf[ XML_WRITE_BUFFER_SIZE ]; - BYTE* m_pReadPtr; - WCHAR* m_pWritePtr; // write pointer within m_pBuf + uint8_t* m_pReadPtr; + wchar_t* m_pWritePtr; // write pointer within m_pBuf - BOOL m_bUnicode; // true = 16-bits, false = 8-bits - BOOL m_bReverseBytes; // true = reverse bytes, false = don't reverse + bool m_bUnicode; // true = 16-bits, false = 8-bits + bool m_bReverseBytes; // true = reverse bytes, false = don't reverse - BOOL m_bSkipNextAdvance; - WCHAR m_Ch; // Current character being parsed + bool m_bSkipNextAdvance; + wchar_t m_Ch; // Current character being parsed }; } // namespace ATG diff --git a/src/client/WstringLookup.cpp b/src/client/WstringLookup.cpp index 93b189f7..24a39a35 100644 --- a/src/client/WstringLookup.cpp +++ b/src/client/WstringLookup.cpp @@ -8,7 +8,7 @@ WstringLookup::WstringLookup() numIDs = 0; } -wstring WstringLookup::lookup(UINT id) +wstring WstringLookup::lookup(unsigned int id) { // TODO //if (id > currentMaxID) @@ -17,12 +17,12 @@ wstring WstringLookup::lookup(UINT id) return int2str.at(id); } -UINT WstringLookup::lookup(wstring str) +unsigned int WstringLookup::lookup(wstring str) { if (str2int.find(str) == str2int.end()) { - pair p = - pair(str, numIDs); + pair p = + pair(str, numIDs); str2int.insert( p ); int2str.push_back( str ); @@ -35,14 +35,14 @@ UINT WstringLookup::lookup(wstring str) } } -VOID WstringLookup::getTable(wstring **lookup, UINT *len) +void WstringLookup::getTable(wstring **lookup, unsigned int *len) { // Outputs - wstring *out_lookup; UINT out_len; + wstring *out_lookup; unsigned int out_len; // Fill lookup. out_lookup = new wstring[int2str.size()]; - for (UINT i = 0; i < numIDs; i++) + for (unsigned int i = 0; i < numIDs; i++) out_lookup[i] = int2str.at(i); out_len = numIDs; diff --git a/src/client/WstringLookup.h b/src/client/WstringLookup.h index 50501020..b335c931 100644 --- a/src/client/WstringLookup.h +++ b/src/client/WstringLookup.h @@ -5,16 +5,16 @@ using namespace std; class WstringLookup { private: - UINT numIDs; - unordered_map str2int; + unsigned int numIDs; + unordered_map str2int; vector int2str; public: WstringLookup(); - wstring lookup(UINT id); + wstring lookup(unsigned int id); - UINT lookup(wstring); + unsigned int lookup(wstring); - VOID getTable(wstring **lookup, UINT *len); + void getTable(wstring **lookup, unsigned int *len); }; \ No newline at end of file diff --git a/src/client/Xbox/4JLibs/inc/4J_Input.h b/src/client/Xbox/4JLibs/inc/4J_Input.h index 120e9c7b..30f0c4da 100644 --- a/src/client/Xbox/4JLibs/inc/4J_Input.h +++ b/src/client/Xbox/4JLibs/inc/4J_Input.h @@ -84,7 +84,7 @@ public: void SetJoypadStickAxisMap(int iPad,unsigned int uiFrom, unsigned int uiTo); void SetJoypadStickTriggerMap(int iPad,unsigned int uiFrom, unsigned int uiTo); void SetKeyRepeatRate(float fRepeatDelaySecs,float fRepeatRateSecs); - void SetDebugSequence( const char *chSequenceA,int( *Func)(LPVOID),LPVOID lpParam ); + void SetDebugSequence( const char *chSequenceA,int( *Func)(void*),void* lpParam ); FLOAT GetIdleSeconds(int iPad); bool IsPadConnected(int iPad); @@ -98,8 +98,8 @@ public: void SetMenuDisplayed(int iPad, bool bVal); - EKeyboardResult RequestKeyboard(UINT uiTitle, UINT uiText, UINT uiDesc, DWORD dwPad, WCHAR *pwchResult, UINT uiResultSize,int( *Func)(LPVOID,const bool),LPVOID lpParam,EKeyboardMode eMode,CXuiStringTable *pStringTable=NULL); - EKeyboardResult RequestKeyboard(UINT uiTitle, LPCWSTR pwchDefault, UINT uiDesc, DWORD dwPad, WCHAR *pwchResult, UINT uiResultSize,int( *Func)(LPVOID,const bool),LPVOID lpParam, EKeyboardMode eMode,CXuiStringTable *pStringTable=NULL); + EKeyboardResult RequestKeyboard(unsigned int uiTitle, unsigned int uiText, unsigned int uiDesc, unsigned long dwPad, wchar_t *pwchResult, unsigned int uiResultSize,int( *Func)(void*,const bool),void* lpParam,EKeyboardMode eMode,CXuiStringTable *pStringTable=NULL); + EKeyboardResult RequestKeyboard(unsigned int uiTitle, const wchar_t* pwchDefault, unsigned int uiDesc, unsigned long dwPad, wchar_t *pwchResult, unsigned int uiResultSize,int( *Func)(void*,const bool),void* lpParam, EKeyboardMode eMode,CXuiStringTable *pStringTable=NULL); // Online check strings against offensive list - TCR 92 // TCR # 092 CMTV Player Text String Verification @@ -116,11 +116,11 @@ public: // // Intent Protect players from inappropriate language. /* -bool VerifyStrings(WCHAR **pwStringA,int iStringC,int( *Func)(LPVOID,STRING_VERIFY_RESPONSE *),LPVOID lpParam); - void CancelQueuedVerifyStrings(int( *Func)(LPVOID,STRING_VERIFY_RESPONSE *),LPVOID lpParam); +bool VerifyStrings(wchar_t **pwStringA,int iStringC,int( *Func)(void*,STRING_VERIFY_RESPONSE *),void* lpParam); + void CancelQueuedVerifyStrings(int( *Func)(void*,STRING_VERIFY_RESPONSE *),void* lpParam); void CancelAllVerifyInProgress(void); */ - //bool InputDetected(DWORD dwUserIndex,WCHAR *pwchInput); + //bool InputDetected(unsigned long dwUserIndex,wchar_t *pwchInput); }; // Singleton diff --git a/src/client/Xbox/4JLibs/inc/4J_Profile.h b/src/client/Xbox/4JLibs/inc/4J_Profile.h index 28e717e8..3d171c6a 100644 --- a/src/client/Xbox/4JLibs/inc/4J_Profile.h +++ b/src/client/Xbox/4JLibs/inc/4J_Profile.h @@ -39,12 +39,12 @@ 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, + void Initialise( unsigned long dwTitleID, + unsigned long dwOfferID, unsigned short usProfileVersion, - UINT uiProfileValuesC, - UINT uiProfileSettingsC, - DWORD *pdwProfileSettingsA, + unsigned int uiProfileValuesC, + unsigned int uiProfileSettingsC, + unsigned long *pdwProfileSettingsA, int iGameDefinedDataSizeX4, unsigned int *puiGameDefinedDataChangedBitmask); void SetTrialTextStringTable(CXuiStringTable *pStringTable,int iAccept,int iReject); @@ -54,18 +54,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)(LPVOID,const bool, const int iPad),LPVOID lpParam,int iQuadrant=XUSER_INDEX_ANY); - UINT DisplayOfflineProfile(int( *Func)(LPVOID,const bool, const int iPad),LPVOID lpParam,int iQuadrant=XUSER_INDEX_ANY); - UINT RequestConvertOfflineToGuestUI(int( *Func)(LPVOID,const bool, const int iPad),LPVOID 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, XUID *pXuid,bool bOnlineXuid); - BOOL AreXUIDSEqual(XUID xuid1,XUID xuid2); - BOOL XUIDIsGuest(XUID xuid); + bool AreXUIDSEqual(XUID xuid1,XUID xuid2); + bool XUIDIsGuest(XUID xuid); bool AllowedToPlayMultiplayer(int iProf); void StartTrialGame(); // disables saves and leaderboard, and change state to readyforgame from pregame - void AllowedPlayerCreatedContent(int iPad, bool thisQuadrantOnly, BOOL *allAllowed, BOOL *friendsAllowed); - BOOL CanViewPlayerCreatedContent(int iPad, bool thisQuadrantOnly, PXUID pXuids, DWORD dwXuidCount ); + void AllowedPlayerCreatedContent(int iPad, bool thisQuadrantOnly, bool *allAllowed, bool *friendsAllowed); + bool CanViewPlayerCreatedContent(int iPad, bool thisQuadrantOnly, PXUID pXuids, unsigned long dwXuidCount ); // SYS @@ -74,18 +74,18 @@ public: char* GetGamertag(int iPad); wchar_t* GetDisplayName(int iPad); bool IsFullVersion(); - void SetSignInChangeCallback(void ( *Func)(LPVOID, bool, unsigned int),LPVOID lpParam); - void SetNotificationsCallback(void ( *Func)(LPVOID, DWORD, unsigned int),LPVOID lpParam); + void SetSignInChangeCallback(void ( *Func)(void*, bool, unsigned int),void* lpParam); + void SetNotificationsCallback(void ( *Func)(void*, unsigned long, unsigned int),void* lpParam); bool RegionIsNorthAmerica(void); bool LocaleIsUSorCanada(void); - HRESULT GetLiveConnectionStatus(); + int GetLiveConnectionStatus(); bool IsSystemUIDisplayed(); - void SetProfileReadErrorCallback(void ( *Func)(LPVOID), LPVOID lpParam); + void SetProfileReadErrorCallback(void ( *Func)(void*), void* lpParam); // PROFILE DATA - int SetDefaultOptionsCallback(int( *Func)(LPVOID,PROFILESETTINGS *, const int iPad),LPVOID lpParam); - int SetOldProfileVersionCallback(int( *Func)(LPVOID,unsigned char *, const unsigned short,const int),LPVOID lpParam); + int SetDefaultOptionsCallback(int( *Func)(void*,PROFILESETTINGS *, const int iPad),void* lpParam); + int SetOldProfileVersionCallback(int( *Func)(void*,unsigned char *, const unsigned short,const int),void* lpParam); PROFILESETTINGS * GetDashboardProfileSettings(int iPad); void WriteToProfile(int iQuadrant, bool bGameDefinedDataChanged=false, bool bOverride5MinuteLimitOnProfileWrites=false); void ForceQueuedProfileWrites(int iPad=XUSER_INDEX_ANY); @@ -112,7 +112,7 @@ public: // PURCHASE void DisplayFullVersionPurchase(bool bRequired, int iQuadrant, int iUpsellParam = -1); - void SetUpsellCallback(void ( *Func)(LPVOID lpParam, eUpsellType type, eUpsellResponse response, int iUserData),LPVOID lpParam); + void SetUpsellCallback(void ( *Func)(void* lpParam, eUpsellType type, eUpsellResponse response, int iUserData),void* lpParam); // Debug void SetDebugFullOverride(bool bVal); // To override the license version (trail/full). Only in debug/release, not ContentPackage diff --git a/src/client/Xbox/4JLibs/inc/4J_Render.h b/src/client/Xbox/4JLibs/inc/4J_Render.h index 5f113d5d..7045116e 100644 --- a/src/client/Xbox/4JLibs/inc/4J_Render.h +++ b/src/client/Xbox/4JLibs/inc/4J_Render.h @@ -130,8 +130,8 @@ public: // Vertex data handling typedef enum { - VERTEX_TYPE_PF3_TF2_CB4_NB4_XW1, // Position 3 x float, texture 2 x float, colour 4 x byte, normal 4 x byte, padding 1 DWORD - VERTEX_TYPE_PS3_TS2_CS1, // Position 3 x short, texture 2 x short, colour 4 x byte, padding 1 DWORD + VERTEX_TYPE_PF3_TF2_CB4_NB4_XW1, // Position 3 x float, texture 2 x float, colour 4 x byte, normal 4 x byte, padding 1 unsigned long + VERTEX_TYPE_PS3_TS2_CS1, // Position 3 x short, texture 2 x short, colour 4 x byte, padding 1 unsigned long VERTEX_TYPE_PF3_TF2_CB4_NB4_XW1_LIT, // as VERTEX_TYPE_PF3_TF2_CB4_NB4_XW1 with lighting applied, VERTEX_TYPE_PF3_TF2_CB4_NB4_XW1_TEXGEN, // as VERTEX_TYPE_PF3_TF2_CB4_NB4_XW1 with tex gen VERTEX_TYPE_COUNT @@ -194,9 +194,9 @@ public: void TextureData(int width, int height, void *data, int level, eTextureFormat format = TEXTURE_FORMAT_RxGyBzAw); void TextureDataUpdate(void *data, int level); void TextureSetParam(int param, int value); - HRESULT LoadTextureData(const char *szFilename,D3DXIMAGE_INFO *pSrcInfo, int **ppDataOut); - HRESULT LoadTextureData(BYTE *pbData, DWORD dwBytes,D3DXIMAGE_INFO *pSrcInfo, int **ppDataOut); - HRESULT SaveTextureData(const char *szFilename, D3DXIMAGE_INFO *pSrcInfo, int *ppDataOut); + int LoadTextureData(const char *szFilename,D3DXIMAGE_INFO *pSrcInfo, int **ppDataOut); + int LoadTextureData(uint8_t *pbData, unsigned long dwBytes,D3DXIMAGE_INFO *pSrcInfo, int **ppDataOut); + int SaveTextureData(const char *szFilename, D3DXIMAGE_INFO *pSrcInfo, int *ppDataOut); void TextureGetStats(); // State control diff --git a/src/client/Xbox/4JLibs/inc/4J_Storage.h b/src/client/Xbox/4JLibs/inc/4J_Storage.h index 2988dc2c..954a037c 100644 --- a/src/client/Xbox/4JLibs/inc/4J_Storage.h +++ b/src/client/Xbox/4JLibs/inc/4J_Storage.h @@ -15,7 +15,7 @@ SAVE_DETAILS,*PSAVE_DETAILS; typedef - VOID + void (CALLBACK * TMSCLIENT_PROG_CALLBACK)( __in float progress, __in_opt void* userCallbackData @@ -37,38 +37,38 @@ public: typedef struct { unsigned int uiFileSize; - DWORD dwType; - DWORD dwWchCount; // count of WCHAR in next array - WCHAR wchFile[1]; + unsigned long dwType; + unsigned long dwWchCount; // count of wchar_t in next array + wchar_t wchFile[1]; } DLC_FILE_DETAILS, *PDLC_FILE_DETAILS; typedef struct { - DWORD dwType; - DWORD dwWchCount; // count of WCHAR in next array; - WCHAR wchData[1]; // will be an array of size dwBytes + unsigned long dwType; + unsigned long dwWchCount; // count of wchar_t in next array; + wchar_t wchData[1]; // will be an array of size dwBytes } DLC_FILE_PARAM, *PDLC_FILE_PARAM; // End of DLC_Creator structs typedef struct { - WCHAR wchDisplayName[XCONTENT_MAX_DISPLAYNAME_LENGTH]; - CHAR szFileName[XCONTENT_MAX_FILENAME_LENGTH]; - DWORD dwImageOffset; - DWORD dwImageBytes; + wchar_t wchDisplayName[XCONTENT_MAX_DISPLAYNAME_LENGTH]; + char szFileName[XCONTENT_MAX_FILENAME_LENGTH]; + unsigned long dwImageOffset; + unsigned long 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 + unsigned long dwVersion; + unsigned long dwNewOffers; + unsigned long dwTotalOffers; + unsigned long dwInstalledTotalOffers; + uint8_t bPadding[1024-sizeof(unsigned long)*4]; // future expansion } DLC_TMS_DETAILS; @@ -191,7 +191,7 @@ public: typedef struct { - CHAR szFilename[256]; + char szFilename[256]; int iFileSize; eTMS_FILETYPEVAL eFileTypeVal; } @@ -206,8 +206,8 @@ public: typedef struct { - DWORD dwSize; - PBYTE pbData; + unsigned long dwSize; + uint8_t* pbData; } TMSPP_FILEDATA, *PTMSPP_FILEDATA; @@ -216,31 +216,31 @@ public: void Tick(void); // Messages - C4JStorage::EMessageResult RequestMessageBox(UINT uiTitle, UINT uiText, UINT *uiOptionA,UINT uiOptionC, DWORD dwPad=XUSER_INDEX_ANY, - int( *Func)(LPVOID,int,const C4JStorage::EMessageResult)=NULL,LPVOID lpParam=NULL, CXuiStringTable *pStringTable=NULL, WCHAR *pwchFormatString=NULL,DWORD dwFocusButton=0); + C4JStorage::EMessageResult RequestMessageBox(unsigned int uiTitle, unsigned int uiText, unsigned int *uiOptionA,unsigned int uiOptionC, unsigned long dwPad=XUSER_INDEX_ANY, + int( *Func)(void*,int,const C4JStorage::EMessageResult)=NULL,void* lpParam=NULL, CXuiStringTable *pStringTable=NULL, wchar_t *pwchFormatString=NULL,unsigned long dwFocusButton=0); void CancelMessageBoxRequest(); C4JStorage::EMessageResult GetMessageBoxResult(); // save device - bool SetSaveDevice(int( *Func)(LPVOID,const bool),LPVOID lpParam, bool bForceResetOfSaveDevice=false); + bool SetSaveDevice(int( *Func)(void*,const bool),void* lpParam, bool bForceResetOfSaveDevice=false); // savegame - void Init(LPCWSTR pwchDefaultSaveName,char *pszSavePackName,int iMinimumSaveSize, int( *Func)(LPVOID, const ESavingMessage, int),LPVOID lpParam,LPCSTR szGroupID); + void Init(const wchar_t* pwchDefaultSaveName,char *pszSavePackName,int iMinimumSaveSize, int( *Func)(void*, const ESavingMessage, int),void* lpParam,const char* szGroupID); void ResetSaveData(); // Call before a new save to clear out stored save file name - void SetDefaultSaveNameForKeyboardDisplay(LPCWSTR pwchDefaultSaveName); - void SetSaveTitle(LPCWSTR pwchDefaultSaveName); - LPCWSTR GetSaveTitle(); - bool GetSaveUniqueNumber(INT *piVal); + void SetDefaultSaveNameForKeyboardDisplay(const wchar_t* pwchDefaultSaveName); + void SetSaveTitle(const wchar_t* pwchDefaultSaveName); + const wchar_t* GetSaveTitle(); + bool GetSaveUniqueNumber(int *piVal); bool GetSaveUniqueFilename(char *pszName); - void SetState(ESaveGameControlState eControlState,int( *Func)(LPVOID,const bool),LPVOID lpParam); + void SetState(ESaveGameControlState eControlState,int( *Func)(void*,const bool),void* lpParam); void SetSaveDisabled(bool bDisable); bool GetSaveDisabled(void); unsigned int GetSaveSize(); void GetSaveData(void *pvData,unsigned int *puiBytes); - PVOID AllocateSaveData(unsigned int uiBytes); - void SaveSaveData(unsigned int uiBytes,PBYTE pbThumbnail=NULL,DWORD cbThumbnail=0,PBYTE pbTextData=NULL, DWORD dwTextLen=0); - void CopySaveDataToNewSave(PBYTE pbThumbnail,DWORD cbThumbnail,WCHAR *wchNewName,int ( *Func)(LPVOID lpParam, bool), LPVOID lpParam); + void* AllocateSaveData(unsigned int uiBytes); + void SaveSaveData(unsigned int uiBytes,uint8_t* pbThumbnail=NULL,unsigned long cbThumbnail=0,uint8_t* pbTextData=NULL, unsigned long dwTextLen=0); + void CopySaveDataToNewSave(uint8_t* pbThumbnail,unsigned long cbThumbnail,wchar_t *wchNewName,int ( *Func)(void* lpParam, bool), void* lpParam); void SetSaveDeviceSelected(unsigned int uiPad,bool bSelected); bool GetSaveDeviceSelected(unsigned int iPad); C4JStorage::ELoadGameStatus DoesSaveExist(bool *pbExists); @@ -248,53 +248,53 @@ public: void SetSaveMessageVPosition(float fY); // The 'Saving' message will display at a default position unless changed // Get the info for the saves - C4JStorage::ESGIStatus GetSavesInfo(int iPad,bool ( *Func)(LPVOID, int, CACHEINFOSTRUCT *, int, HRESULT),LPVOID lpParam,char *pszSavePackName); + C4JStorage::ESGIStatus GetSavesInfo(int iPad,bool ( *Func)(void*, int, CACHEINFOSTRUCT *, int, int),void* lpParam,char *pszSavePackName); - void GetSaveCacheFileInfo(DWORD dwFile,XCONTENT_DATA &xContentData); - void GetSaveCacheFileInfo(DWORD dwFile, PBYTE *ppbImageData, DWORD *pdwImageBytes); + void GetSaveCacheFileInfo(unsigned long dwFile,XCONTENT_DATA &xContentData); + void GetSaveCacheFileInfo(unsigned long dwFile, uint8_t* *ppbImageData, unsigned long *pdwImageBytes); // Load the save. Need to call GetSaveData once the callback is called - C4JStorage::ELoadGameStatus LoadSaveData(XCONTENT_DATA *pContentData,int( *Func)(LPVOID lpParam,const bool), LPVOID lpParam); - C4JStorage::EDeleteGameStatus DeleteSaveData(XCONTENT_DATA *pContentData,int( *Func)(LPVOID lpParam,const bool), LPVOID lpParam); + C4JStorage::ELoadGameStatus LoadSaveData(XCONTENT_DATA *pContentData,int( *Func)(void* lpParam,const bool), void* lpParam); + C4JStorage::EDeleteGameStatus DeleteSaveData(XCONTENT_DATA *pContentData,int( *Func)(void* lpParam,const bool), void* lpParam); // DLC - void RegisterMarketplaceCountsCallback(int ( *Func)(LPVOID lpParam, C4JStorage::DLC_TMS_DETAILS *, int), LPVOID lpParam ); + void RegisterMarketplaceCountsCallback(int ( *Func)(void* lpParam, C4JStorage::DLC_TMS_DETAILS *, int), void* lpParam ); void SetDLCPackageRoot(char *pszDLCRoot); - C4JStorage::EDLCStatus GetDLCOffers(int iPad,int( *Func)(LPVOID, int, DWORD, int),LPVOID lpParam, DWORD dwOfferTypesBitmask=XMARKETPLACE_OFFERING_TYPE_CONTENT); - DWORD CancelGetDLCOffers(); + C4JStorage::EDLCStatus GetDLCOffers(int iPad,int( *Func)(void*, int, unsigned long, int),void* lpParam, unsigned long dwOfferTypesBitmask=XMARKETPLACE_OFFERING_TYPE_CONTENT); + unsigned long CancelGetDLCOffers(); void ClearDLCOffers(); - //XMARKETPLACE_CONTENTOFFER_INFO& GetOffer(DWORD dw); - XMARKETPLACE_CURRENCY_CONTENTOFFER_INFO& GetOffer(DWORD dw); + //XMARKETPLACE_CONTENTOFFER_INFO& GetOffer(unsigned long dw); + XMARKETPLACE_CURRENCY_CONTENTOFFER_INFO& GetOffer(unsigned long dw); int GetOfferCount(); - DWORD InstallOffer(int iOfferIDC,unsigned __int64 *ullOfferIDA,int( *Func)(LPVOID, int, int),LPVOID lpParam, bool bTrial=false); - DWORD GetAvailableDLCCount( int iPad); + unsigned long InstallOffer(int iOfferIDC,unsigned int64_t *ullOfferIDA,int( *Func)(void*, int, int),void* lpParam, bool bTrial=false); + unsigned long GetAvailableDLCCount( int iPad); - C4JStorage::EDLCStatus GetInstalledDLC(int iPad,int( *Func)(LPVOID, int, int),LPVOID lpParam); - XCONTENT_DATA& GetDLC(DWORD dw); - DWORD MountInstalledDLC(int iPad,DWORD dwDLC,int( *Func)(LPVOID, int, DWORD,DWORD),LPVOID lpParam,LPCSTR szMountDrive=NULL); - DWORD UnmountInstalledDLC(LPCSTR szMountDrive=NULL); + C4JStorage::EDLCStatus GetInstalledDLC(int iPad,int( *Func)(void*, int, int),void* lpParam); + XCONTENT_DATA& GetDLC(unsigned long dw); + unsigned long MountInstalledDLC(int iPad,unsigned long dwDLC,int( *Func)(void*, int, unsigned long,unsigned long),void* lpParam,const char* szMountDrive=NULL); + unsigned long UnmountInstalledDLC(const char* szMountDrive=NULL); // Global title storage C4JStorage::ETMSStatus ReadTMSFile(int iQuadrant,eGlobalStorage eStorageFacility,C4JStorage::eTMS_FileType eFileType, - WCHAR *pwchFilename,BYTE **ppBuffer,DWORD *pdwBufferSize,int( *Func)(LPVOID, WCHAR *,int, bool, int)=NULL,LPVOID lpParam=NULL, int iAction=0); - bool WriteTMSFile(int iQuadrant,eGlobalStorage eStorageFacility,WCHAR *pwchFilename,BYTE *pBuffer,DWORD dwBufferSize); - bool DeleteTMSFile(int iQuadrant,eGlobalStorage eStorageFacility,WCHAR *pwchFilename); - void StoreTMSPathName(WCHAR *pwchName=NULL); + wchar_t *pwchFilename,uint8_t **ppBuffer,unsigned long *pdwBufferSize,int( *Func)(void*, wchar_t *,int, bool, int)=NULL,void* lpParam=NULL, int iAction=0); + bool WriteTMSFile(int iQuadrant,eGlobalStorage eStorageFacility,wchar_t *pwchFilename,uint8_t *pBuffer,unsigned long dwBufferSize); + bool DeleteTMSFile(int iQuadrant,eGlobalStorage eStorageFacility,wchar_t *pwchFilename); + void StoreTMSPathName(wchar_t *pwchName=NULL); // TMS++ - C4JStorage::ETMSStatus TMSPP_WriteFile(int iPad,C4JStorage::eGlobalStorage eStorageFacility,C4JStorage::eTMS_FILETYPEVAL eFileTypeVal,C4JStorage::eTMS_UGCTYPE eUGCType,CHAR *pchFilePath,CHAR *pchBuffer,DWORD dwBufferSize,int( *Func)(LPVOID,int,int)=NULL,LPVOID lpParam=NULL, int iUserData=0); - C4JStorage::ETMSStatus TMSPP_GetUserQuotaInfo(int iPad,TMSCLIENT_CALLBACK Func,LPVOID lpParam, int iUserData=0); - C4JStorage::ETMSStatus TMSPP_ReadFile(int iPad,C4JStorage::eGlobalStorage eStorageFacility,C4JStorage::eTMS_FILETYPEVAL eFileTypeVal,LPCSTR szFilename,int( *Func)(LPVOID,int,int,PTMSPP_FILEDATA, LPCSTR)=NULL,LPVOID lpParam=NULL, int iUserData=0); - C4JStorage::ETMSStatus TMSPP_ReadFileList(int iPad,C4JStorage::eGlobalStorage eStorageFacility,CHAR *pchFilePath,int( *Func)(LPVOID,int,int,PTMSPP_FILE_LIST)=NULL,LPVOID lpParam=NULL, int iUserData=0); - C4JStorage::ETMSStatus TMSPP_DeleteFile(int iPad,LPCSTR szFilePath,C4JStorage::eTMS_FILETYPEVAL eFileTypeVal,int( *Func)(LPVOID,int,int),LPVOID lpParam=NULL, int iUserData=0); + C4JStorage::ETMSStatus TMSPP_WriteFile(int iPad,C4JStorage::eGlobalStorage eStorageFacility,C4JStorage::eTMS_FILETYPEVAL eFileTypeVal,C4JStorage::eTMS_UGCTYPE eUGCType,char *pchFilePath,char *pchBuffer,unsigned long dwBufferSize,int( *Func)(void*,int,int)=NULL,void* lpParam=NULL, int iUserData=0); + C4JStorage::ETMSStatus TMSPP_GetUserQuotaInfo(int iPad,TMSCLIENT_CALLBACK Func,void* lpParam, int iUserData=0); + C4JStorage::ETMSStatus TMSPP_ReadFile(int iPad,C4JStorage::eGlobalStorage eStorageFacility,C4JStorage::eTMS_FILETYPEVAL eFileTypeVal,const char* szFilename,int( *Func)(void*,int,int,PTMSPP_FILEDATA, const char*)=NULL,void* lpParam=NULL, int iUserData=0); + C4JStorage::ETMSStatus TMSPP_ReadFileList(int iPad,C4JStorage::eGlobalStorage eStorageFacility,char *pchFilePath,int( *Func)(void*,int,int,PTMSPP_FILE_LIST)=NULL,void* lpParam=NULL, int iUserData=0); + C4JStorage::ETMSStatus TMSPP_DeleteFile(int iPad,const char* szFilePath,C4JStorage::eTMS_FILETYPEVAL eFileTypeVal,int( *Func)(void*,int,int),void* lpParam=NULL, int iUserData=0); bool TMSPP_InFileList(eGlobalStorage eStorageFacility, int iPad,const wstring &Filename); unsigned int CRC(unsigned char *buf, int len); - C4JStorage::ETMSStatus TMSPP_WriteFileWithProgress(int iPad,C4JStorage::eGlobalStorage eStorageFacility,C4JStorage::eTMS_FILETYPEVAL eFileTypeVal,C4JStorage::eTMS_UGCTYPE eUGCType,CHAR *pchFilePath,CHAR *pchBuffer,DWORD dwBufferSize,int( *Func)(LPVOID,int,int)=NULL,LPVOID lpParam=NULL, int iUserData=0, - int( *CompletionFunc)(LPVOID,float fComplete)=NULL,LPVOID lpCompletionParam=NULL); + C4JStorage::ETMSStatus TMSPP_WriteFileWithProgress(int iPad,C4JStorage::eGlobalStorage eStorageFacility,C4JStorage::eTMS_FILETYPEVAL eFileTypeVal,C4JStorage::eTMS_UGCTYPE eUGCType,char *pchFilePath,char *pchBuffer,unsigned long dwBufferSize,int( *Func)(void*,int,int)=NULL,void* lpParam=NULL, int iUserData=0, + int( *CompletionFunc)(void*,float fComplete)=NULL,void* lpCompletionParam=NULL); void TMSPP_CancelWriteFileWithProgress(int iPad); - HRESULT TMSPP_SetTitleGroupID(LPCSTR szGroupID); + int TMSPP_SetTitleGroupID(const char* szGroupID); // #ifdef _DEBUG // void SetSaveName(int i); diff --git a/src/client/Xbox/4JLibs/inc/4J_xtms.h b/src/client/Xbox/4JLibs/inc/4J_xtms.h index ea35da4b..5a1c5bce 100644 --- a/src/client/Xbox/4JLibs/inc/4J_xtms.h +++ b/src/client/Xbox/4JLibs/inc/4J_xtms.h @@ -18,7 +18,7 @@ extern "C" { #ifndef XSGX_MOD1 typedef -VOID +void (CALLBACK * TMSCLIENT_PROG_CALLBACK)( __in float progress, __in_opt void* userCallbackData @@ -26,24 +26,24 @@ VOID XBOXAPI -HRESULT +int WINAPI XSGX_XTmsPutUserFile( __in HTMSCLIENT tmsClient, __in XUID xuid, - __in_z LPCSTR filePath, - __in_z LPCSTR fileType, - __in_z LPCSTR displayName, - __in_z LPCSTR ugcContentType, - __in_bcount(fileSize) CONST CHAR* fileBuffer, - __in DWORD fileSize, - __in_opt DWORD bufferSize, - __in_z_opt LPCSTR etag, + __in_z const char* filePath, + __in_z const char* fileType, + __in_z const char* displayName, + __in_z const char* ugcContentType, + __in_bcount(fileSize) const char* fileBuffer, + __in unsigned long fileSize, + __in_opt unsigned long bufferSize, + __in_z_opt const char* etag, __in ETAGFLAG etagFlag, __in TMSCLIENT_CALLBACK clientCallback, - __in_opt PVOID userCallbackData, + __in_opt void* userCallbackData, __in TMSCLIENT_PROG_CALLBACK clientProgCallback, - __in_opt PVOID progCallbackData + __in_opt void* progCallbackData ); void XSGX_XTmsCancelPutUserFile(__in HTMSCLIENT tmsClient); diff --git a/src/client/Xbox/Audio/SoundEngine.cpp b/src/client/Xbox/Audio/SoundEngine.cpp index b0ac35e9..1786e2d9 100644 --- a/src/client/Xbox/Audio/SoundEngine.cpp +++ b/src/client/Xbox/Audio/SoundEngine.cpp @@ -85,7 +85,7 @@ void SoundEngine::init(Options *pOptions) InitializeCriticalSection(&m_CS); // Iniatialise XACT itself - HRESULT hr; + int hr; if ( FAILED ( hr = XACT3CreateEngine( 0, &m_pXACT3Engine ) ) ) { app.FatalLoadError(); @@ -95,7 +95,7 @@ void SoundEngine::init(Options *pOptions) // Load global settings file // 4J-PB - move this to the title update, since we've corrected it to allow sounds to be pitch varied when they weren't before - HANDLE file; + void* file; #ifdef _TU_BUILD file = CreateFile("UPDATE:\\res\\audio\\Minecraft.xgs", GENERIC_READ, 0, NULL, OPEN_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL); #else @@ -107,9 +107,9 @@ void SoundEngine::init(Options *pOptions) assert(false); return; } - DWORD dwFileSize = GetFileSize(file,NULL); - DWORD bytesRead = 0; - DWORD memFlags = MAKE_XALLOC_ATTRIBUTES(0,false,true,false,0,XALLOC_PHYSICAL_ALIGNMENT_DEFAULT,XALLOC_MEMPROTECT_READWRITE,false,XALLOC_MEMTYPE_PHYSICAL); + unsigned long dwFileSize = GetFileSize(file,NULL); + unsigned long bytesRead = 0; + unsigned long memFlags = MAKE_XALLOC_ATTRIBUTES(0,false,true,false,0,XALLOC_PHYSICAL_ALIGNMENT_DEFAULT,XALLOC_MEMPROTECT_READWRITE,false,XALLOC_MEMTYPE_PHYSICAL); void *pvGlobalSettings = XMemAlloc(dwFileSize, memFlags); ReadFile(file,pvGlobalSettings,dwFileSize,&bytesRead,NULL); CloseHandle(file); @@ -322,9 +322,9 @@ void SoundEngine::init(Options *pOptions) void SoundEngine::CreateStreamingWavebank(const char *pchName, IXACT3WaveBank **ppStreamedWaveBank) { // Create streamed sound bank - HRESULT hr; + int hr; - HANDLE file = CreateFile(pchName, GENERIC_READ, 0, NULL, OPEN_ALWAYS, FILE_FLAG_OVERLAPPED | FILE_FLAG_NO_BUFFERING, NULL); + void* file = CreateFile(pchName, GENERIC_READ, 0, NULL, OPEN_ALWAYS, FILE_FLAG_OVERLAPPED | FILE_FLAG_NO_BUFFERING, NULL); if( file == INVALID_HANDLE_VALUE ) { @@ -349,8 +349,8 @@ void SoundEngine::CreateStreamingWavebank(const char *pchName, IXACT3WaveBank ** void SoundEngine::CreateSoundbank(const char *pchName, IXACT3SoundBank **ppSoundBank) { - HRESULT hr; - HANDLE file = CreateFile(pchName, GENERIC_READ, 0, NULL, OPEN_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL); + int hr; + void* file = CreateFile(pchName, GENERIC_READ, 0, NULL, OPEN_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL); if( file == INVALID_HANDLE_VALUE ) { @@ -358,9 +358,9 @@ void SoundEngine::CreateSoundbank(const char *pchName, IXACT3SoundBank **ppSound assert(false); return; } - DWORD dwFileSize = GetFileSize(file,NULL); - DWORD bytesRead = 0; - DWORD memFlags = MAKE_XALLOC_ATTRIBUTES(0,false,true,false,0,XALLOC_PHYSICAL_ALIGNMENT_DEFAULT,XALLOC_MEMPROTECT_READWRITE,false,XALLOC_MEMTYPE_PHYSICAL); + unsigned long dwFileSize = GetFileSize(file,NULL); + unsigned long bytesRead = 0; + unsigned long memFlags = MAKE_XALLOC_ATTRIBUTES(0,false,true,false,0,XALLOC_PHYSICAL_ALIGNMENT_DEFAULT,XALLOC_MEMPROTECT_READWRITE,false,XALLOC_MEMTYPE_PHYSICAL); void *pvSoundBank = XMemAlloc(dwFileSize, memFlags); ReadFile(file,pvSoundBank,dwFileSize,&bytesRead,NULL); CloseHandle(file); @@ -377,7 +377,7 @@ bool SoundEngine::isStreamingWavebankReady() { if(m_bStreamingMusicReady==false) { - DWORD dwState; + unsigned long dwState; m_pSoundBank->GetState(&dwState); if(dwState&XACT_WAVEBANKSTATE_PREPARED) { @@ -401,7 +401,7 @@ bool SoundEngine::isStreamingWavebankReady() #ifdef _XBOX bool SoundEngine::isStreamingWavebankReady(IXACT3WaveBank *pWaveBank) { - DWORD dwState; + unsigned long dwState; pWaveBank->GetState(&dwState); if(dwState&XACT_WAVEBANKSTATE_PREPARED) { @@ -513,7 +513,7 @@ void SoundEngine::play(int iSound, float x, float y, float z, float volume, floa } IXACT3Cue *cueInstance; - HRESULT hr; + int hr; MemSect(31); if(bSoundbank1) @@ -597,7 +597,7 @@ void SoundEngine::playUI(int iSound, float, float) } IXACT3Cue *cueInstance; - HRESULT hr; + int hr; if(bSoundBank1) { @@ -737,7 +737,7 @@ void SoundEngine::playStreaming(const wstring& name, float x, float y, float z, m_musicIDX = pSoundBank->GetCueIndex(ConvertSoundPathToName(name)); } - HRESULT hr; + int hr; if( FAILED( hr = pSoundBank->Prepare(m_musicIDX, 0, 0, &m_MusicInfo.pCue ) ) ) { @@ -783,8 +783,8 @@ void SoundEngine::playMusicTick() } // check to see if the sound has stopped playing - DWORD state; - HRESULT hr; + unsigned long state; + int hr; if(m_MusicInfo.pCue!=NULL) { if( FAILED( hr = m_MusicInfo.pCue->GetState(&state) ) ) @@ -865,7 +865,7 @@ void SoundEngine::playMusicTick() void SoundEngine::updateMusicVolume(float fVal) { XACTVOLUME xactVol=fVal; - HRESULT hr=m_pXACT3Engine->SetVolume(m_xactMusic,fVal); + int hr=m_pXACT3Engine->SetVolume(m_xactMusic,fVal); } void SoundEngine::updateSystemMusicPlaying(bool isPlaying) @@ -875,7 +875,7 @@ void SoundEngine::updateSystemMusicPlaying(bool isPlaying) void SoundEngine::updateSoundEffectVolume(float fVal) { XACTVOLUME xactVol=fVal; - HRESULT hr=m_pXACT3Engine->SetVolume(m_xactSFX,fVal); + int hr=m_pXACT3Engine->SetVolume(m_xactSFX,fVal); } void SoundEngine::update3DPosition(SoundEngine::soundInfo *pInfo, bool bPlaceEmitterAtListener,bool bIsCDMusic) @@ -1033,8 +1033,8 @@ void SoundEngine::tick(shared_ptr *players, float a) { SoundEngine::soundInfo *info = currentSounds[i]; - DWORD state; - HRESULT hr; + unsigned long state; + int hr; if( FAILED( hr = info->pCue->GetState(&state) ) ) { assert(false); diff --git a/src/client/Xbox/Font/XUI_Font.cpp b/src/client/Xbox/Font/XUI_Font.cpp index 50873d76..ceeb0f72 100644 --- a/src/client/Xbox/Font/XUI_Font.cpp +++ b/src/client/Xbox/Font/XUI_Font.cpp @@ -50,8 +50,8 @@ XUI_Font::~XUI_Font() // Desc: Get the dimensions of a text string //-------------------------------------------------------------------------------------- -VOID XUI_Font::GetTextExtent( const WCHAR* strText, FLOAT* pWidth, - FLOAT* pHeight, BOOL bFirstLineOnly ) const +void XUI_Font::GetTextExtent( const wchar_t* strText, FLOAT* pWidth, + FLOAT* pHeight, bool bFirstLineOnly ) const { assert( pWidth != NULL ); assert( pHeight != NULL ); @@ -69,7 +69,7 @@ VOID XUI_Font::GetTextExtent( const WCHAR* strText, FLOAT* pWidth, fHeight = fy; // Loop through each character and update text extent - DWORD letter; + unsigned long letter; while( (letter = *strText) != 0 ) { ++strText; @@ -118,7 +118,7 @@ VOID XUI_Font::GetTextExtent( const WCHAR* strText, FLOAT* pWidth, // Name: GetTextWidth() // Desc: Returns the width in pixels of a text string //-------------------------------------------------------------------------------------- -FLOAT XUI_Font::GetTextWidth( const WCHAR* strText ) const +FLOAT XUI_Font::GetTextWidth( const wchar_t* strText ) const { FLOAT fTextWidth; FLOAT fTextHeight; @@ -130,7 +130,7 @@ FLOAT XUI_Font::GetTextWidth( const WCHAR* strText ) const // Name: Begin() // Desc: Prepares the font vertex buffers for rendering. //-------------------------------------------------------------------------------------- -VOID XUI_Font::Begin() +void XUI_Font::Begin() { PIXBeginNamedEvent( 0, "Text Rendering" ); @@ -190,7 +190,7 @@ VOID XUI_Font::Begin() // Name: DrawText() // Desc: Draws text as textured polygons //-------------------------------------------------------------------------------------- -VOID XUI_Font::DrawText( DWORD dwColor, const WCHAR* strText, DWORD dwFlags, +void XUI_Font::DrawText( unsigned long dwColor, const wchar_t* strText, unsigned long dwFlags, FLOAT fMaxPixelWidth ) { DrawText( m_fCursorX, m_fCursorY, dwColor, strText, dwFlags, fMaxPixelWidth ); @@ -200,8 +200,8 @@ VOID XUI_Font::DrawText( DWORD dwColor, const WCHAR* strText, DWORD dwFlags, // Name: DrawShadowText() // Desc: Draws text as textured polygons //-------------------------------------------------------------------------------------- -VOID XUI_Font::DrawShadowText( FLOAT fOriginX, FLOAT fOriginY, DWORD dwColor, DWORD dwShadowColor, - const WCHAR* strText, DWORD dwFlags, FLOAT fMaxPixelWidth) +void XUI_Font::DrawShadowText( FLOAT fOriginX, FLOAT fOriginY, unsigned long dwColor, unsigned long dwShadowColor, + const wchar_t* strText, unsigned long dwFlags, FLOAT fMaxPixelWidth) { float fXShadow=1.0f, fYShadow=1.0f; // 4J Stu - Don't move the drop shadow as much @@ -233,8 +233,8 @@ VOID XUI_Font::DrawShadowText( FLOAT fOriginX, FLOAT fOriginY, DWORD dwColor, DW // TODO: This function should use the Begin/SetVertexData/End() API when it // becomes available. //-------------------------------------------------------------------------------------- -VOID XUI_Font::DrawText( FLOAT fOriginX, FLOAT fOriginY, DWORD dwColor, - const WCHAR* strText, DWORD dwFlags, FLOAT fMaxPixelWidth, bool darken /*= false*/ ) +void XUI_Font::DrawText( FLOAT fOriginX, FLOAT fOriginY, unsigned long dwColor, + const wchar_t* strText, unsigned long dwFlags, FLOAT fMaxPixelWidth, bool darken /*= false*/ ) { if( NULL == strText ) return; if( L'\0' == strText[0] ) return; @@ -353,21 +353,21 @@ VOID XUI_Font::DrawText( FLOAT fOriginX, FLOAT fOriginY, DWORD dwColor, m_fCursorY += Winy; // Set a flag so we can determine initial justification effects - BOOL bStartingNewLine = true; + bool bStartingNewLine = true; - DWORD dwNumEllipsesToDraw = 0; + unsigned long dwNumEllipsesToDraw = 0; // Begin drawing the vertices - DWORD dwNumChars = wcslen( strText ) + ( dwFlags & ATGFONT_TRUNCATED ? 3 : 0 ); + unsigned long dwNumChars = wcslen( strText ) + ( dwFlags & ATGFONT_TRUNCATED ? 3 : 0 ); bStartingNewLine = true; // Draw four vertices for each glyph while( *strText ) { - WCHAR letter; + wchar_t letter; if( dwNumEllipsesToDraw ) { @@ -490,7 +490,7 @@ VOID XUI_Font::DrawText( FLOAT fOriginX, FLOAT fOriginY, DWORD dwColor, // Name: End() // Desc: Paired call that restores state set in the Begin() call. //-------------------------------------------------------------------------------------- -VOID XUI_Font::End() +void XUI_Font::End() { assert( m_dwNestedBeginCount > 0 ); if( --m_dwNestedBeginCount > 0 ) diff --git a/src/client/Xbox/Font/XUI_Font.h b/src/client/Xbox/Font/XUI_Font.h index 3225e60b..4d660839 100644 --- a/src/client/Xbox/Font/XUI_Font.h +++ b/src/client/Xbox/Font/XUI_Font.h @@ -32,23 +32,23 @@ public: FLOAT m_fCursorX; // Current text cursor FLOAT m_fCursorY; - BOOL m_bRotate; + bool m_bRotate; - DWORD m_dwNestedBeginCount; + unsigned long m_dwNestedBeginCount; wstring m_fontName; wstring m_fallbackFont; - DWORD refCount; + unsigned long refCount; public: float getScaleFactor() { return m_fScaleFactor; } void GetScaleFactors(FLOAT *pfXScaleFactor, FLOAT *pfYScaleFactor) { *pfXScaleFactor = m_fScaleFactor; *pfYScaleFactor = m_fScaleFactor; } // Accessor functions - inline VOID SetSlantFactor( FLOAT fSlantFactor ) + inline void SetSlantFactor( FLOAT fSlantFactor ) { m_fSlantFactor = fSlantFactor; } - inline VOID SetScaleFactors( FLOAT fXScaleFactor, FLOAT fYScaleFactor ) + inline void SetScaleFactors( FLOAT fXScaleFactor, FLOAT fYScaleFactor ) { // m_fXScaleFactor = m_fYScaleFactor = m_fScaleFactor; } @@ -62,19 +62,19 @@ public: ~XUI_Font(); // Returns the dimensions of a text string - VOID GetTextExtent( const WCHAR* strText, FLOAT* pWidth, - FLOAT* pHeight, BOOL bFirstLineOnly=false ) const; - FLOAT GetTextWidth( const WCHAR* strText ) const; - FLOAT GetCharAdvance( const WCHAR* strChar ) const; + void GetTextExtent( const wchar_t* strText, FLOAT* pWidth, + FLOAT* pHeight, bool bFirstLineOnly=false ) const; + FLOAT GetTextWidth( const wchar_t* strText ) const; + FLOAT GetCharAdvance( const wchar_t* strChar ) const; - VOID SetWindow(const D3DRECT &rcWindow ); - VOID SetWindow( LONG x1, LONG y1, LONG x2, LONG y2 ); - VOID GetWindow(D3DRECT &rcWindow) const; - VOID SetCursorPosition( FLOAT fCursorX, FLOAT fCursorY ); - VOID SetRotationFactor( FLOAT fRotationFactor ); + void SetWindow(const D3DRECT &rcWindow ); + void SetWindow( int32_t x1, int32_t y1, int32_t x2, int32_t y2 ); + void GetWindow(D3DRECT &rcWindow) const; + void SetCursorPosition( FLOAT fCursorX, FLOAT fCursorY ); + void SetRotationFactor( FLOAT fRotationFactor ); // Function to create a texture containing rendered text - D3DTexture* CreateTexture( const WCHAR* strText, + D3DTexture* CreateTexture( const wchar_t* strText, D3DCOLOR dwBackgroundColor = 0x00000000, D3DCOLOR dwTextColor = 0xffffffff, D3DFORMAT d3dFormat = D3DFMT_A8R8G8B8 ); @@ -82,12 +82,12 @@ public: // Public calls to render text. Callers can simply call DrawText(), but for // performance, they should batch multiple calls together, bracketed by calls to // Begin() and End(). - VOID Begin(); - VOID DrawText( DWORD dwColor, const WCHAR* strText, DWORD dwFlags=0L, + void Begin(); + void DrawText( unsigned long dwColor, const wchar_t* strText, unsigned long dwFlags=0L, FLOAT fMaxPixelWidth = 0.0f ); - VOID DrawText( FLOAT sx, FLOAT sy, DWORD dwColor, const WCHAR* strText, - DWORD dwFlags=0L, FLOAT fMaxPixelWidth = 0.0f, bool darken = false ); - VOID DrawShadowText( FLOAT sx, FLOAT sy, DWORD dwColor, DWORD dwShadowColor, const WCHAR* strText, - DWORD dwFlags=0L, FLOAT fMaxPixelWidth = 0.0f ); - VOID End(); + void DrawText( FLOAT sx, FLOAT sy, unsigned long dwColor, const wchar_t* strText, + unsigned long dwFlags=0L, FLOAT fMaxPixelWidth = 0.0f, bool darken = false ); + void DrawShadowText( FLOAT sx, FLOAT sy, unsigned long dwColor, unsigned long dwShadowColor, const wchar_t* strText, + unsigned long dwFlags=0L, FLOAT fMaxPixelWidth = 0.0f ); + void End(); }; \ No newline at end of file diff --git a/src/client/Xbox/Font/XUI_FontData.cpp b/src/client/Xbox/Font/XUI_FontData.cpp index d6d2559b..74962305 100644 --- a/src/client/Xbox/Font/XUI_FontData.cpp +++ b/src/client/Xbox/Font/XUI_FontData.cpp @@ -184,7 +184,7 @@ XUI_FontData::~XUI_FontData() // Desc: Create the font's internal objects (texture and array of glyph info) // using the XPR packed resource file //-------------------------------------------------------------------------------------- -HRESULT XUI_FontData::Create( SFontData &sfontdata ) +int XUI_FontData::Create( SFontData &sfontdata ) { #ifndef _CONTENT_PACKAGE app.DebugPrintf("Attempting to load font data for font: '%s'\n", sfontdata.m_strFontName.c_str()); @@ -206,13 +206,13 @@ HRESULT XUI_FontData::Create( SFontData &sfontdata ) #if 0 { // 4J-JEV: Load in FontData (ABC) file, and initialize member variables from it. - const ULONG_PTR c_ModuleHandle = (ULONG_PTR)GetModuleHandle(NULL); + const uintptr_t c_ModuleHandle = (uintptr_t)GetModuleHandle(NULL); //wsprintfW(szResourceLocator,L"section://%X,%s#%s",c_ModuleHandle,L"media", L"media/font/Mojangles_10.abc"); wsprintfW(szResourceLocator,L"section://%X,%s#%s%s%s",c_ModuleHandle,L"media", L"media/font/",strFontFileName.c_str(),L".abc"); - BYTE *buffer; - UINT bufferSize; + uint8_t *buffer; + unsigned int bufferSize; hr = XuiResourceLoadAllNoLoc( szResourceLocator, &buffer, @@ -237,7 +237,7 @@ HRESULT XUI_FontData::Create( SFontData &sfontdata ) // Translate unprintable characters GLYPH_ATTR* pGlyph; - DWORD letter = m_fontData->getGlyphId(i); + unsigned long letter = m_fontData->getGlyphId(i); if( letter == 0 || letter >= 280 ) continue; pGlyph = (GLYPH_ATTR*)&m_Glyphs[letter]; // Get the requested glyph @@ -267,7 +267,7 @@ HRESULT XUI_FontData::Create( SFontData &sfontdata ) for (int y = pGlyph->tv1; y < pGlyph->tv2; y++) { int rawPix = rawPixels[x + (y*imgWidth)]; - DWORD pixel = rawPixels[x + (y*imgWidth)] & 0xff000000; + unsigned long pixel = rawPixels[x + (y*imgWidth)] & 0xff000000; if (pixel > 0) emptyColumn = false; } @@ -292,8 +292,8 @@ HRESULT XUI_FontData::Create( SFontData &sfontdata ) // Name: Create() // Desc: Create the font's internal objects (texture and array of glyph info) //-------------------------------------------------------------------------------------- -//HRESULT XUI_FontData::Create( D3DTexture* pFontTexture, const VOID* pFontData ) -HRESULT XUI_FontData::Create( int iFontTexture, const VOID* pFontData ) +//int XUI_FontData::Create( D3DTexture* pFontTexture, const void* pFontData ) +int XUI_FontData::Create( int iFontTexture, const void* pFontData ) { // Save a copy of the texture //m_pFontTexture = pFontTexture; @@ -301,8 +301,8 @@ HRESULT XUI_FontData::Create( int iFontTexture, const VOID* pFontData ) m_iFontTexture = iFontTexture; // Check version of file (to make sure it matches up with the FontMaker tool) - const BYTE* pData = static_cast(pFontData); - DWORD dwFileVersion = reinterpret_cast(pData)->m_dwFileVersion; + const uint8_t* pData = static_cast(pFontData); + unsigned long dwFileVersion = reinterpret_cast(pData)->m_dwFileVersion; if( dwFileVersion == ATGFONTFILEVERSION ) { @@ -314,7 +314,7 @@ HRESULT XUI_FontData::Create( int iFontTexture, const VOID* pFontData ) // Point to the translator string which immediately follows the 4 floats m_cMaxGlyph = reinterpret_cast(pData)->m_cMaxGlyph; - WCHAR* translatorTable = const_cast(reinterpret_cast(pData))->m_TranslatorTable; + wchar_t* translatorTable = const_cast(reinterpret_cast(pData))->m_TranslatorTable; // 4J Stu - This map saves us some memory because the translatorTable is largely empty // If we were ever to use >50% of the table then we should store it and use directly rather than the map @@ -347,7 +347,7 @@ HRESULT XUI_FontData::Create( int iFontTexture, const VOID* pFontData ) // Name: Destroy() // Desc: Destroy the font object //-------------------------------------------------------------------------------------- -VOID XUI_FontData::Destroy() +void XUI_FontData::Destroy() { if(m_pFontTexture!=NULL) { @@ -365,18 +365,18 @@ VOID XUI_FontData::Destroy() } /* -FLOAT XUI_FontData::GetCharAdvance( const WCHAR* strChar ) +FLOAT XUI_FontData::GetCharAdvance( const wchar_t* strChar ) { unsigned int uiChar = (unsigned int) *strChar; return 0.0f;// m_fontData.getAdvance(m_fontData.getGlyphId(uiChar)); } -FLOAT XUI_FontData::GetCharWidth( const WCHAR* strChar ) +FLOAT XUI_FontData::GetCharWidth( const wchar_t* strChar ) { return 0.0f; } -void XUI_FontData::GetCharMetrics( const WCHAR* strChar, XUICharMetrics *xuiMetrics) +void XUI_FontData::GetCharMetrics( const wchar_t* strChar, XUICharMetrics *xuiMetrics) { unsigned int uiChar = (unsigned int) *strChar; unsigned short usGlyph = m_fontData->getGlyphId(uiChar); diff --git a/src/client/Xbox/Font/XUI_FontData.h b/src/client/Xbox/Font/XUI_FontData.h index 1c69b1c1..369df372 100644 --- a/src/client/Xbox/Font/XUI_FontData.h +++ b/src/client/Xbox/Font/XUI_FontData.h @@ -11,11 +11,11 @@ using namespace std; //-------------------------------------------------------------------------------------- typedef struct GLYPH_ATTR { - WORD tu1, tv1, tu2, tv2; // Texture coordinates for the image - SHORT wOffset; // Pixel offset for glyph start - SHORT wWidth; // Pixel width of the glyph - SHORT wAdvance; // Pixels to advance after the glyph - WORD wMask; // Channel mask + uint16_t tu1, tv1, tu2, tv2; // Texture coordinates for the image + int16_t wOffset; // Pixel offset for glyph start + int16_t wWidth; // Pixel width of the glyph + int16_t wAdvance; // Pixels to advance after the glyph + uint16_t wMask; // Channel mask } GLYPH_ATTR; // @@ -26,17 +26,17 @@ typedef struct GLYPH_ATTR // Font description -#define ATGCALCFONTFILEHEADERSIZE(x) ( sizeof(DWORD) + (sizeof(FLOAT)*4) + sizeof(WORD) + (sizeof(WCHAR)*(x)) ) +#define ATGCALCFONTFILEHEADERSIZE(x) ( sizeof(unsigned long) + (sizeof(FLOAT)*4) + sizeof(uint16_t) + (sizeof(wchar_t)*(x)) ) #define ATGFONTFILEVERSION 5 typedef struct FontFileHeaderImage_t { - DWORD m_dwFileVersion; // Version of the font file (Must match FONTFILEVERSION) + unsigned long m_dwFileVersion; // Version of the font file (Must match FONTFILEVERSION) FLOAT m_fFontHeight; // Height of the font strike in pixels FLOAT m_fFontTopPadding; // Padding above the strike zone FLOAT m_fFontBottomPadding; // Padding below the strike zone FLOAT m_fFontYAdvance; // Number of pixels to move the cursor for a line feed - WORD m_cMaxGlyph; // Number of font characters (Should be an odd number to maintain DWORD Alignment) - WCHAR m_TranslatorTable[1]; // ASCII to Glyph lookup table, NOTE: It's m_cMaxGlyph+1 in size. + uint16_t m_cMaxGlyph; // Number of font characters (Should be an odd number to maintain unsigned long Alignment) + wchar_t m_TranslatorTable[1]; // ASCII to Glyph lookup table, NOTE: It's m_cMaxGlyph+1 in size. // Entry 0 maps to the "Unknown" glyph. } FontFileHeaderImage_t; @@ -44,7 +44,7 @@ typedef struct FontFileHeaderImage_t { // structure image typedef struct FontFileStrikesImage_t { - DWORD m_dwNumGlyphs; // Size of font strike array (First entry is the unknown glyph) + unsigned long m_dwNumGlyphs; // Size of font strike array (First entry is the unknown glyph) GLYPH_ATTR m_Glyphs[1]; // Array of font strike uv's etc... NOTE: It's m_dwNumGlyphs in size } FontFileStrikesImage_t; @@ -96,7 +96,7 @@ public: short getOffset(); // Pixel offset for glyph start short getWidth(); // Pixel width of the glyph short getWAdvance(); // Pixels to advance after the glyph - WORD getMask(); // Channel mask, tv2; + uint16_t getMask(); // Channel mask, tv2; } SChar; SChar getChar(const wchar_t strChar); @@ -111,13 +111,13 @@ private: CharMetrics *m_characterMetrics; // Translator table for supporting unicode ranges - DWORD m_cMaxGlyph; // Number of entries in the translator table + unsigned long m_cMaxGlyph; // Number of entries in the translator table // Glyph data for the font - DWORD m_dwNumGlyphs; // Number of valid glyphs + unsigned long m_dwNumGlyphs; // Number of valid glyphs GLYPH_ATTR* m_Glyphs; // Array of glyphs - DWORD m_dwNestedBeginCount; + unsigned long m_dwNestedBeginCount; protected: @@ -135,13 +135,13 @@ public: ~XUI_FontData(); // Functions to create and destroy the internal objects - HRESULT Create( SFontData &sfontdata ); - //HRESULT Create( D3DTexture* pFontTexture, const VOID* pFontData ); - HRESULT Create( int iFontTexture, const VOID* pFontData ); - VOID Destroy(); + int Create( SFontData &sfontdata ); + //int Create( D3DTexture* pFontTexture, const void* pFontData ); + int Create( int iFontTexture, const void* pFontData ); + void Destroy(); - //FLOAT GetCharAdvance( const WCHAR* strChar ); - //FLOAT GetCharWidth( const WCHAR* strChar ); - //void GetCharMetrics( const WCHAR* strChar, XUICharMetrics *xuiMetrics); + //FLOAT GetCharAdvance( const wchar_t* strChar ); + //FLOAT GetCharWidth( const wchar_t* strChar ); + //void GetCharMetrics( const wchar_t* strChar, XUICharMetrics *xuiMetrics); //unsigned short getGlyphId(wchar_t character); }; \ No newline at end of file diff --git a/src/client/Xbox/Font/XUI_FontRenderer.cpp b/src/client/Xbox/Font/XUI_FontRenderer.cpp index d75570f7..c022bdd0 100644 --- a/src/client/Xbox/Font/XUI_FontRenderer.cpp +++ b/src/client/Xbox/Font/XUI_FontRenderer.cpp @@ -5,8 +5,8 @@ #include "StringHelpers.h" extern IDirect3DDevice9 *g_pD3DDevice; -extern void GetRenderAndSamplerStates(IDirect3DDevice9 *pDevice,DWORD *RenderStateA,DWORD *SamplerStateA); -extern void SetRenderAndSamplerStates(IDirect3DDevice9 *pDevice,DWORD *RenderStateA,DWORD *SamplerStateA); +extern void GetRenderAndSamplerStates(IDirect3DDevice9 *pDevice,unsigned long *RenderStateA,unsigned long *SamplerStateA); +extern void SetRenderAndSamplerStates(IDirect3DDevice9 *pDevice,unsigned long *RenderStateA,unsigned long *SamplerStateA); XUI_FontRenderer::XUI_FontRenderer() { @@ -23,18 +23,18 @@ XUI_FontRenderer::XUI_FontRenderer() //m_fRawHeight=(float)ssc.rawHeight; } -HRESULT XUI_FontRenderer::Init( float fDpi ) +int XUI_FontRenderer::Init( float fDpi ) { return( S_OK ); } -VOID XUI_FontRenderer::Term() +void XUI_FontRenderer::Term() { return; } -HRESULT XUI_FontRenderer::GetCaps( DWORD * pdwCaps ) +int XUI_FontRenderer::GetCaps( unsigned long * pdwCaps ) { if( pdwCaps != NULL ) { @@ -44,7 +44,7 @@ HRESULT XUI_FontRenderer::GetCaps( DWORD * pdwCaps ) return ( S_OK ); } -HRESULT XUI_FontRenderer::CreateFont( const TypefaceDescriptor * pTypefaceDescriptor, float fPointSize, DWORD dwStyle, DWORD dwReserved, HFONTOBJ * phFont ) +int XUI_FontRenderer::CreateFont( const TypefaceDescriptor * pTypefaceDescriptor, float fPointSize, unsigned long dwStyle, unsigned long dwReserved, HFONTOBJ * phFont ) { float fXuiSize = fPointSize * ( 16.0f / 14.0f ); //float fXuiSize = fPointSize * ( 16.0f / 16.0f ); @@ -105,7 +105,7 @@ HRESULT XUI_FontRenderer::CreateFont( const TypefaceDescriptor * pTypefaceDescri return S_OK; } -VOID XUI_FontRenderer::ReleaseFont( HFONTOBJ hFont ) +void XUI_FontRenderer::ReleaseFont( HFONTOBJ hFont ) { XUI_Font *xuiFont = (XUI_Font*) hFont; if (xuiFont != NULL) @@ -121,7 +121,7 @@ VOID XUI_FontRenderer::ReleaseFont( HFONTOBJ hFont ) return; } -HRESULT XUI_FontRenderer::GetFontMetrics( HFONTOBJ hFont, XUIFontMetrics *pFontMetrics ) +int XUI_FontRenderer::GetFontMetrics( HFONTOBJ hFont, XUIFontMetrics *pFontMetrics ) { if( hFont == 0 || pFontMetrics == 0 ) return E_INVALIDARG; @@ -138,7 +138,7 @@ HRESULT XUI_FontRenderer::GetFontMetrics( HFONTOBJ hFont, XUIFontMetrics *pFontM return( S_OK ); } -HRESULT XUI_FontRenderer::GetCharMetrics( HFONTOBJ hFont, WCHAR wch, XUICharMetrics *pCharMetrics ) +int XUI_FontRenderer::GetCharMetrics( HFONTOBJ hFont, wchar_t wch, XUICharMetrics *pCharMetrics ) { if (hFont == 0 || pCharMetrics == 0) return E_INVALIDARG; @@ -154,19 +154,19 @@ HRESULT XUI_FontRenderer::GetCharMetrics( HFONTOBJ hFont, WCHAR wch, XUICharMetr return(S_OK); } -HRESULT XUI_FontRenderer::DrawCharToTexture( HFONTOBJ hFont, WCHAR wch, HXUIDC hDC, IXuiTexture * pTexture, UINT x, UINT y, UINT width, UINT height, UINT insetX, UINT insetY ) +int XUI_FontRenderer::DrawCharToTexture( HFONTOBJ hFont, wchar_t wch, HXUIDC hDC, IXuiTexture * pTexture, unsigned int x, unsigned int y, unsigned int width, unsigned int height, unsigned int insetX, unsigned int insetY ) { if( hFont==0 || pTexture==NULL ) return E_INVALIDARG; return( S_OK ); } -HRESULT XUI_FontRenderer::DrawCharsToDevice( HFONTOBJ hFont, CharData * pCharData, DWORD dwCount, RECT *pClipRect, HXUIDC hDC, D3DXMATRIX * pWorldViewProj ) +int XUI_FontRenderer::DrawCharsToDevice( HFONTOBJ hFont, CharData * pCharData, unsigned long dwCount, RECT *pClipRect, HXUIDC hDC, D3DXMATRIX * pWorldViewProj ) { if( hFont == 0 ) return E_INVALIDARG; if( dwCount == 0 ) return( S_OK ); - DWORD RenderStateA[8]; - DWORD SamplerStateA[5]; + unsigned long RenderStateA[8]; + unsigned long SamplerStateA[5]; XMVECTOR vconsts[20]; XMVECTOR pconsts[20]; XUI_Font *font = (XUI_Font *)hFont; @@ -234,8 +234,8 @@ HRESULT XUI_FontRenderer::DrawCharsToDevice( HFONTOBJ hFont, CharData * pCharDat float lineXPos = 0.0f; float lineYPos = 0.0f; - DWORD colour = 0; - DWORD style = 0; + unsigned long colour = 0; + unsigned long style = 0; #if 1 for( int i = 0; i < dwCount; i++ ) { @@ -254,7 +254,7 @@ HRESULT XUI_FontRenderer::DrawCharsToDevice( HFONTOBJ hFont, CharData * pCharDat break; } #else - DWORD i = 0; + unsigned long i = 0; while( i < dwCount ) { wstring string; @@ -281,7 +281,7 @@ HRESULT XUI_FontRenderer::DrawCharsToDevice( HFONTOBJ hFont, CharData * pCharDat if(dropShadow) { - DWORD shadowColour; + unsigned long shadowColour; XuiGetTextDropShadowColor(hDC, &shadowColour); // 4J Stu - Shadow colour is currently ignored font->DrawShadowText( lineXPos,lineYPos,colour,shadowColour,string.c_str() ); diff --git a/src/client/Xbox/Font/XUI_FontRenderer.h b/src/client/Xbox/Font/XUI_FontRenderer.h index cffe2ed1..cd497d89 100644 --- a/src/client/Xbox/Font/XUI_FontRenderer.h +++ b/src/client/Xbox/Font/XUI_FontRenderer.h @@ -30,20 +30,20 @@ public: XUI_FontRenderer(); // 4J - IXuiFontRenderer interface - virtual HRESULT STDMETHODCALLTYPE Init( float fDpi ); - virtual VOID STDMETHODCALLTYPE Term(); - virtual HRESULT STDMETHODCALLTYPE GetCaps( DWORD * pdwCaps ); - virtual HRESULT STDMETHODCALLTYPE CreateFont( const TypefaceDescriptor * pTypefaceDescriptor, - float fPointSize, DWORD dwStyle, DWORD dwReserved, HFONTOBJ * phFont ); - virtual VOID STDMETHODCALLTYPE ReleaseFont( HFONTOBJ hFont ); - virtual HRESULT STDMETHODCALLTYPE GetFontMetrics( HFONTOBJ hFont, XUIFontMetrics *pFontMetrics ); - virtual HRESULT STDMETHODCALLTYPE GetCharMetrics( HFONTOBJ hFont, WCHAR wch, + virtual int STDMETHODCALLTYPE Init( float fDpi ); + virtual void STDMETHODCALLTYPE Term(); + virtual int STDMETHODCALLTYPE GetCaps( unsigned long * pdwCaps ); + virtual int STDMETHODCALLTYPE CreateFont( const TypefaceDescriptor * pTypefaceDescriptor, + float fPointSize, unsigned long dwStyle, unsigned long dwReserved, HFONTOBJ * phFont ); + virtual void STDMETHODCALLTYPE ReleaseFont( HFONTOBJ hFont ); + virtual int STDMETHODCALLTYPE GetFontMetrics( HFONTOBJ hFont, XUIFontMetrics *pFontMetrics ); + virtual int STDMETHODCALLTYPE GetCharMetrics( HFONTOBJ hFont, wchar_t wch, XUICharMetrics *pCharMetrics ); - virtual HRESULT STDMETHODCALLTYPE DrawCharToTexture( HFONTOBJ hFont, WCHAR wch, HXUIDC hDC, - IXuiTexture * pTexture, UINT x, UINT y, UINT width, UINT height, - UINT insetX, UINT insetY ); - virtual HRESULT STDMETHODCALLTYPE DrawCharsToDevice( HFONTOBJ hFont, CharData * pCharData, - DWORD dwCount, RECT *pClipRect, HXUIDC hDC, + virtual int STDMETHODCALLTYPE DrawCharToTexture( HFONTOBJ hFont, wchar_t wch, HXUIDC hDC, + IXuiTexture * pTexture, unsigned int x, unsigned int y, unsigned int width, unsigned int height, + unsigned int insetX, unsigned int insetY ); + virtual int STDMETHODCALLTYPE DrawCharsToDevice( HFONTOBJ hFont, CharData * pCharData, + unsigned long dwCount, RECT *pClipRect, HXUIDC hDC, D3DXMATRIX * pWorldViewProj ); }; \ No newline at end of file diff --git a/src/client/Xbox/Leaderboards/XboxLeaderboardManager.cpp b/src/client/Xbox/Leaderboards/XboxLeaderboardManager.cpp index 5033895f..7d256731 100644 --- a/src/client/Xbox/Leaderboards/XboxLeaderboardManager.cpp +++ b/src/client/Xbox/Leaderboards/XboxLeaderboardManager.cpp @@ -110,17 +110,17 @@ bool XboxLeaderboardManager::OpenSession() } XSESSION_INFO sessionInfo; - ULONGLONG sessionNonce; + uint64_t sessionNonce; - DWORD ret = XSessionCreate(XSESSION_CREATE_USES_STATS | XSESSION_CREATE_HOST, lockedProfile, 8, 8, &sessionNonce, &sessionInfo, NULL, &m_hSession); + unsigned long ret = XSessionCreate(XSESSION_CREATE_USES_STATS | XSESSION_CREATE_HOST, lockedProfile, 8, 8, &sessionNonce, &sessionInfo, NULL, &m_hSession); if( ret != ERROR_SUCCESS ) { m_hSession = NULL; return false; } - DWORD userIndices[1] = { lockedProfile }; - BOOL privateSlots[1] = { false }; + unsigned long userIndices[1] = { lockedProfile }; + bool privateSlots[1] = { false }; ret = XSessionJoinLocal(m_hSession, 1, userIndices, privateSlots, NULL); if( ret != ERROR_SUCCESS ) { @@ -155,7 +155,7 @@ void XboxLeaderboardManager::CloseSession() memset(&m_endSessionOverlapped, 0, sizeof(m_endSessionOverlapped)); - DWORD ret = XSessionEnd( m_hSession, &m_endSessionOverlapped ); + unsigned long ret = XSessionEnd( m_hSession, &m_endSessionOverlapped ); if (ret == ERROR_SUCCESS || ret == ERROR_IO_PENDING) { m_endingSession = true; @@ -179,7 +179,7 @@ void XboxLeaderboardManager::DeleteSession() bool XboxLeaderboardManager::WriteStats(unsigned int viewCount, ViewIn views) { - DWORD ret = S_OK; + unsigned long ret = S_OK; // some debug code to catch the leaderboard write with 7 views #ifndef _CONTENT_PACKAGE @@ -230,10 +230,10 @@ bool XboxLeaderboardManager::ReadStats_MyScore(LeaderboardReadListener *callback if (!readStats(difficulty,type)) return false; if (!LeaderboardManager::ReadStats_MyScore(callback, difficulty, type, myUID, readCount)) return false; - HANDLE hEnumerator; - DWORD ret; + void* hEnumerator; + unsigned long ret; - //DWORD readCount = 0; + //unsigned long readCount = 0; m_numStats = 0; ret = XUserCreateStatsEnumeratorByXuid( @@ -248,7 +248,7 @@ bool XboxLeaderboardManager::ReadStats_MyScore(LeaderboardReadListener *callback if( ret != ERROR_SUCCESS ) return false; //Allocate a buffer for the stats - m_stats = (PXUSER_STATS_READ_RESULTS) new BYTE[m_numStats]; + m_stats = (PXUSER_STATS_READ_RESULTS) new uint8_t[m_numStats]; if (m_stats == NULL) return false; memset(m_stats, 0, m_numStats); @@ -272,8 +272,8 @@ bool XboxLeaderboardManager::ReadStats_Friends(LeaderboardReadListener *callback if (!readStats(difficulty,type)) return false; if (!LeaderboardManager::ReadStats_Friends(callback, difficulty, type, myUID, startIndex, readCount)) return false; - HANDLE hEnumerator; - DWORD ret; + void* hEnumerator; + unsigned long ret; unsigned int friendCount; XUID *friends; @@ -303,7 +303,7 @@ bool XboxLeaderboardManager::ReadStats_Friends(LeaderboardReadListener *callback if ( (ret!=ERROR_SUCCESS) && (ret!=ERROR_INSUFFICIENT_BUFFER) ) return false; //Allocate a buffer for the stats - m_stats = (PXUSER_STATS_READ_RESULTS) new BYTE[m_numStats]; + m_stats = (PXUSER_STATS_READ_RESULTS) new uint8_t[m_numStats]; if (m_stats == NULL) return false; memset(m_stats, 0, m_numStats); @@ -330,10 +330,10 @@ bool XboxLeaderboardManager::ReadStats_TopRank(LeaderboardReadListener *callback if (!readStats(difficulty,type)) return false; if (!LeaderboardManager::ReadStats_TopRank(callback, difficulty, type, startIndex, readCount)) return false; - HANDLE hEnumerator; + void* hEnumerator; m_numStats = 0; - DWORD ret = XUserCreateStatsEnumeratorByRank( + unsigned long ret = XUserCreateStatsEnumeratorByRank( 0, // Current title ID startIndex, // Index to start enumerating from readCount, // Number of rows to retrieve @@ -345,7 +345,7 @@ bool XboxLeaderboardManager::ReadStats_TopRank(LeaderboardReadListener *callback if( ret != ERROR_SUCCESS ) return false; //Allocate a buffer for the stats - m_stats = (PXUSER_STATS_READ_RESULTS) new BYTE[m_numStats]; + m_stats = (PXUSER_STATS_READ_RESULTS) new uint8_t[m_numStats]; if (m_stats == NULL) return false; memset(m_stats, 0, m_numStats); @@ -480,16 +480,16 @@ void XboxLeaderboardManager::SetStatsRetrieved(bool success) // 4J-JEV: Adapted/stolen from 'XUI_Leaderboards'. bool XboxLeaderboardManager::getFriends(unsigned int &friendsCount, PlayerUID** friends) { - DWORD resultsSize; - HANDLE hEnumerator; - DWORD ret; - DWORD numFriends; + unsigned long resultsSize; + void* hEnumerator; + unsigned long ret; + unsigned long numFriends; //First, get a list of (up to 100) friends (this is the maximum that the enumerator currently supports) ret = XFriendsCreateEnumerator( ProfileManager.GetLockedProfile(), 0, 100, &resultsSize, &hEnumerator); if(ret!=ERROR_SUCCESS) return false; - XONLINE_FRIEND *xonlineFriends = (XONLINE_FRIEND*) new BYTE[resultsSize]; + XONLINE_FRIEND *xonlineFriends = (XONLINE_FRIEND*) new uint8_t[resultsSize]; ret = XEnumerate( hEnumerator, diff --git a/src/client/Xbox/Leaderboards/XboxLeaderboardManager.h b/src/client/Xbox/Leaderboards/XboxLeaderboardManager.h index 2c53b1cf..0fed3899 100644 --- a/src/client/Xbox/Leaderboards/XboxLeaderboardManager.h +++ b/src/client/Xbox/Leaderboards/XboxLeaderboardManager.h @@ -32,13 +32,13 @@ protected: // LEADERBOARD DESCRIPTIONS // static const int READ_SIZE = 15; //Read this many entries at a time struct LeaderboardDescriptor { - DWORD m_viewId; - DWORD m_columnCount; - WORD m_columnIds[8]; + unsigned long m_viewId; + unsigned long m_columnCount; + uint16_t m_columnIds[8]; - LeaderboardDescriptor( DWORD viewId, DWORD columnCount, - WORD columnId_0, WORD columnId_1, WORD columnId_2, WORD columnId_3, - WORD columnId_4, WORD columnId_5, WORD columnId_6, WORD columnId_7) + LeaderboardDescriptor( unsigned long viewId, unsigned long columnCount, + uint16_t columnId_0, uint16_t columnId_1, uint16_t columnId_2, uint16_t columnId_3, + uint16_t columnId_4, uint16_t columnId_5, uint16_t columnId_6, uint16_t columnId_7) { m_viewId = viewId; m_columnCount = columnCount; @@ -61,11 +61,11 @@ private: EStatsState m_eStatsState; //State of the stats read bool m_statsRead; //Whether or not the stats read operation has completed - HANDLE m_hSession; //Current session + void* m_hSession; //Current session XOVERLAPPED m_overlapped; //Overlapped structure used for async actions XUSER_STATS_SPEC* m_spec; //Spec structure used in reads - DWORD m_numStats; + unsigned long m_numStats; PXUSER_STATS_READ_RESULTS m_stats; //Structure that stats are read into bool m_isQNetSession; //Session is being managed via QNet diff --git a/src/client/Xbox/Network/NetworkPlayerXbox.cpp b/src/client/Xbox/Network/NetworkPlayerXbox.cpp index f40f4e15..b70b9b0d 100644 --- a/src/client/Xbox/Network/NetworkPlayerXbox.cpp +++ b/src/client/Xbox/Network/NetworkPlayerXbox.cpp @@ -14,7 +14,7 @@ unsigned char NetworkPlayerXbox::GetSmallId() void NetworkPlayerXbox::SendData(INetworkPlayer *player, const void *pvData, int dataSize, bool lowPriority) { - DWORD flags; + unsigned long flags; flags = QNET_SENDDATA_RELIABLE | QNET_SENDDATA_SEQUENTIAL; if( lowPriority ) flags |= QNET_SENDDATA_LOW_PRIORITY | QNET_SENDDATA_SECONDARY; m_qnetPlayer->SendData(((NetworkPlayerXbox *)player)->m_qnetPlayer, pvData, dataSize, flags); @@ -27,14 +27,14 @@ bool NetworkPlayerXbox::IsSameSystem(INetworkPlayer *player) int NetworkPlayerXbox::GetSendQueueSizeBytes( INetworkPlayer *player, bool lowPriority ) { - DWORD flags = QNET_GETSENDQUEUESIZE_BYTES; + unsigned long flags = QNET_GETSENDQUEUESIZE_BYTES; if( lowPriority ) flags |= QNET_GETSENDQUEUESIZE_SECONDARY_TYPE; return m_qnetPlayer->GetSendQueueSize(player ? ((NetworkPlayerXbox *)player)->m_qnetPlayer : NULL , flags); } int NetworkPlayerXbox::GetSendQueueSizeMessages( INetworkPlayer *player, bool lowPriority ) { - DWORD flags = QNET_GETSENDQUEUESIZE_MESSAGES; + unsigned long flags = QNET_GETSENDQUEUESIZE_MESSAGES; if( lowPriority ) flags |= QNET_GETSENDQUEUESIZE_SECONDARY_TYPE; return m_qnetPlayer->GetSendQueueSize(player ? ((NetworkPlayerXbox *)player)->m_qnetPlayer : NULL , flags); } diff --git a/src/client/Xbox/Network/PlatformNetworkManagerXbox.cpp b/src/client/Xbox/Network/PlatformNetworkManagerXbox.cpp index 9f3c2fe8..d69fe3ab 100644 --- a/src/client/Xbox/Network/PlatformNetworkManagerXbox.cpp +++ b/src/client/Xbox/Network/PlatformNetworkManagerXbox.cpp @@ -7,10 +7,10 @@ CPlatformNetworkManagerXbox *g_pPlatformNetworkManager; -VOID CPlatformNetworkManagerXbox::NotifyStateChanged( +void CPlatformNetworkManagerXbox::NotifyStateChanged( __in QNET_STATE OldState, __in QNET_STATE NewState, - __in HRESULT hrInfo + __in int hrInfo ) { static const char * c_apszStateNames[] = @@ -97,7 +97,7 @@ VOID CPlatformNetworkManagerXbox::NotifyStateChanged( } -VOID CPlatformNetworkManagerXbox::NotifyPlayerJoined( +void CPlatformNetworkManagerXbox::NotifyPlayerJoined( __in IQNetPlayer * pQNetPlayer ) { @@ -207,7 +207,7 @@ VOID CPlatformNetworkManagerXbox::NotifyPlayerJoined( } -VOID CPlatformNetworkManagerXbox::NotifyPlayerLeaving( +void CPlatformNetworkManagerXbox::NotifyPlayerLeaving( __in IQNetPlayer * pQNetPlayer ) { @@ -294,7 +294,7 @@ VOID CPlatformNetworkManagerXbox::NotifyPlayerLeaving( } -VOID CPlatformNetworkManagerXbox::NotifyNewHost( +void CPlatformNetworkManagerXbox::NotifyNewHost( __in IQNetPlayer * pQNetPlayer ) { @@ -312,18 +312,18 @@ VOID CPlatformNetworkManagerXbox::NotifyNewHost( } -VOID CPlatformNetworkManagerXbox::NotifyDataReceived( +void CPlatformNetworkManagerXbox::NotifyDataReceived( __in IQNetPlayer * pQNetPlayerFrom, - __in DWORD dwNumPlayersTo, + __in unsigned long dwNumPlayersTo, __in_ecount(dwNumPlayersTo) IQNetPlayer ** apQNetPlayersTo, - __in_bcount(dwDataSize) const BYTE * pbData, - __in DWORD dwDataSize + __in_bcount(dwDataSize) const uint8_t * pbData, + __in unsigned long dwDataSize ) { if(m_pIQNet->GetState() == QNET_STATE_SESSION_ENDING) return; - DWORD dwPlayer; + unsigned long dwPlayer; // Loop through all the local players that were targeted and print info // regarding this message. @@ -365,7 +365,7 @@ VOID CPlatformNetworkManagerXbox::NotifyDataReceived( } -VOID CPlatformNetworkManagerXbox::NotifyWriteStats( +void CPlatformNetworkManagerXbox::NotifyWriteStats( __in IQNetPlayer * pQNetPlayer ) { @@ -375,34 +375,34 @@ VOID CPlatformNetworkManagerXbox::NotifyWriteStats( } -VOID CPlatformNetworkManagerXbox::NotifyReadinessChanged( +void CPlatformNetworkManagerXbox::NotifyReadinessChanged( __in IQNetPlayer * pQNetPlayer, - __in BOOL bReady + __in bool bReady ) { app.DebugPrintf( "Player 0x%p readiness is now %i.\n", pQNetPlayer, (int) bReady ); } -VOID CPlatformNetworkManagerXbox::NotifyCommSettingsChanged( +void CPlatformNetworkManagerXbox::NotifyCommSettingsChanged( __in IQNetPlayer * pQNetPlayer ) { } -VOID CPlatformNetworkManagerXbox::NotifyGameSearchComplete( +void CPlatformNetworkManagerXbox::NotifyGameSearchComplete( __in IQNetGameSearch * pGameSearch, - __in HRESULT hrComplete, - __in DWORD dwNumResults + __in int hrComplete, + __in unsigned long dwNumResults ) { // Not currently used } -VOID CPlatformNetworkManagerXbox::NotifyGameInvite( - __in DWORD dwUserIndex, +void CPlatformNetworkManagerXbox::NotifyGameInvite( + __in unsigned long dwUserIndex, __in const INVITE_INFO * pInviteInfo ) { @@ -410,7 +410,7 @@ VOID CPlatformNetworkManagerXbox::NotifyGameInvite( } -VOID CPlatformNetworkManagerXbox::NotifyContextChanged( +void CPlatformNetworkManagerXbox::NotifyContextChanged( __in const XUSER_CONTEXT * pContext ) { @@ -418,7 +418,7 @@ VOID CPlatformNetworkManagerXbox::NotifyContextChanged( } -VOID CPlatformNetworkManagerXbox::NotifyPropertyChanged( +void CPlatformNetworkManagerXbox::NotifyPropertyChanged( __in const XUSER_PROPERTY * pProperty ) { @@ -435,9 +435,9 @@ bool CPlatformNetworkManagerXbox::Initialise(CGameNetworkManager *pGameNetworkMa playerChangedCallback[ i ] = NULL; } - HRESULT hr; + int hr; int iResult; - DWORD dwResult; + unsigned long dwResult; // Start up XNet with default settings. iResult = XNetStartup( NULL ); @@ -466,15 +466,15 @@ bool CPlatformNetworkManagerXbox::Initialise(CGameNetworkManager *pGameNetworkMa return false; } - BOOL enableNotify = false; - m_pIQNet->SetOpt( QNET_OPTION_NOTIFY_LISTENER, &enableNotify, sizeof BOOL ); + bool enableNotify = false; + m_pIQNet->SetOpt( QNET_OPTION_NOTIFY_LISTENER, &enableNotify, sizeof bool ); - BOOL enableJip = false; - m_pIQNet->SetOpt( QNET_OPTION_JOIN_IN_PROGRESS_ALLOWED, &enableJip, sizeof BOOL ); - BOOL enableInv = false; - m_pIQNet->SetOpt( QNET_OPTION_INVITES_ALLOWED, &enableInv, sizeof BOOL ); - BOOL enablePres = false; - m_pIQNet->SetOpt( QNET_OPTION_PRESENCE_JOIN_MODE, &enablePres, sizeof BOOL ); + bool enableJip = false; + m_pIQNet->SetOpt( QNET_OPTION_JOIN_IN_PROGRESS_ALLOWED, &enableJip, sizeof bool ); + bool enableInv = false; + m_pIQNet->SetOpt( QNET_OPTION_INVITES_ALLOWED, &enableInv, sizeof bool ); + bool enablePres = false; + m_pIQNet->SetOpt( QNET_OPTION_PRESENCE_JOIN_MODE, &enablePres, sizeof bool ); // We DO NOT want QNet to handle XN_SYS_SIGNINCHANGED but so far everything else should be fine // We DO WANT QNet to handle XN_LIVE_INVITE_ACCEPTED at a minimum @@ -541,8 +541,8 @@ bool CPlatformNetworkManagerXbox::isSystemPrimaryPlayer(IQNetPlayer *pQNetPlayer // We call this twice a frame, either side of the render call so is a good place to "tick" things void CPlatformNetworkManagerXbox::DoWork() { - DWORD dwNotifyId; - ULONG_PTR ulpNotifyParam; + unsigned long dwNotifyId; + uintptr_t ulpNotifyParam; while( XNotifyGetNext( m_notificationListener, @@ -591,10 +591,10 @@ bool CPlatformNetworkManagerXbox::ShouldMessageForFullSession() int CPlatformNetworkManagerXbox::GetOnlinePlayerCount() { - DWORD playerCount = GetPlayerCount(); - DWORD onlinePlayerCount = 0; + unsigned long playerCount = GetPlayerCount(); + unsigned long onlinePlayerCount = 0; - for(DWORD i = 0; i < playerCount; ++i) + for(unsigned long i = 0; i < playerCount; ++i) { IQNetPlayer *pQNetPlayer = m_pIQNet->GetPlayerByIndex(i); if(!pQNetPlayer->IsLocal())++onlinePlayerCount; @@ -652,7 +652,7 @@ bool CPlatformNetworkManagerXbox::RemoveLocalPlayerByUserIndex( int userIndex ) bool CPlatformNetworkManagerXbox::IsInStatsEnabledSession() { - DWORD dataSize = sizeof(QNET_LIVE_STATS_MODE); + unsigned long dataSize = sizeof(QNET_LIVE_STATS_MODE); QNET_LIVE_STATS_MODE statsMode; m_pIQNet->GetOpt(QNET_OPTION_LIVE_STATS_MODE, &statsMode , &dataSize ); @@ -665,18 +665,18 @@ bool CPlatformNetworkManagerXbox::SessionHasSpace(unsigned int spaceRequired /*= { // This function is used while a session is running, so all players trying to join // should use public slots, - DWORD publicSlots = 0; - DWORD filledPublicSlots = 0; - DWORD privateSlots = 0; - DWORD filledPrivateSlots = 0; + unsigned long publicSlots = 0; + unsigned long filledPublicSlots = 0; + unsigned long privateSlots = 0; + unsigned long filledPrivateSlots = 0; - DWORD dataSize = sizeof(DWORD); + unsigned long dataSize = sizeof(unsigned long); m_pIQNet->GetOpt(QNET_OPTION_TOTAL_PUBLIC_SLOTS, &publicSlots, &dataSize ); m_pIQNet->GetOpt(QNET_OPTION_FILLED_PUBLIC_SLOTS, &filledPublicSlots, &dataSize ); m_pIQNet->GetOpt(QNET_OPTION_TOTAL_PRIVATE_SLOTS, &privateSlots, &dataSize ); m_pIQNet->GetOpt(QNET_OPTION_FILLED_PRIVATE_SLOTS, &filledPrivateSlots, &dataSize ); - DWORD spaceLeft = (publicSlots - filledPublicSlots) + (privateSlots - filledPrivateSlots); + unsigned long spaceLeft = (publicSlots - filledPublicSlots) + (privateSlots - filledPrivateSlots); return spaceLeft >= spaceRequired; } @@ -708,7 +708,7 @@ bool CPlatformNetworkManagerXbox::LeaveGame(bool bMigrateHost) if( socket != NULL ) { //printf("Waiting for socket closed event\n"); - DWORD result = socket->m_socketClosedEvent->WaitForSignal(INFINITE); + unsigned long result = socket->m_socketClosedEvent->WaitForSignal(INFINITE); // The session might be gone once the socket releases if( IsInSession() ) @@ -765,7 +765,7 @@ void CPlatformNetworkManagerXbox::HostGame(int localUsersMask, bool bOnlineGame, void CPlatformNetworkManagerXbox::_HostGame(int usersMask, unsigned char publicSlots /*= MINECRAFT_NET_MAX_PLAYERS*/, unsigned char privateSlots /*= 0*/) { - HRESULT hr; + int hr; // Create a session using the standard game type, in multiplayer game mode, // The constants used to specify game mode, context ID and context value are // defined in the title's .spa.h file, generated using the XLAST tool. @@ -780,12 +780,12 @@ void CPlatformNetworkManagerXbox::_HostGame(int usersMask, unsigned char publicS //printf("Hosting game with %d public slots and %d private slots\n", publicSlots, privateSlots); - BOOL enableJip = false; - m_pIQNet->SetOpt( QNET_OPTION_JOIN_IN_PROGRESS_ALLOWED, &enableJip, sizeof BOOL ); - BOOL enableInv = false; - m_pIQNet->SetOpt( QNET_OPTION_INVITES_ALLOWED, &enableInv, sizeof BOOL ); - BOOL enablePres = false; - m_pIQNet->SetOpt( QNET_OPTION_PRESENCE_JOIN_MODE, &enablePres, sizeof BOOL ); + bool enableJip = false; + m_pIQNet->SetOpt( QNET_OPTION_JOIN_IN_PROGRESS_ALLOWED, &enableJip, sizeof bool ); + bool enableInv = false; + m_pIQNet->SetOpt( QNET_OPTION_INVITES_ALLOWED, &enableInv, sizeof bool ); + bool enablePres = false; + m_pIQNet->SetOpt( QNET_OPTION_PRESENCE_JOIN_MODE, &enablePres, sizeof bool ); // Start hosting a new game // Use only the contexts defined above, and no properties. @@ -816,12 +816,12 @@ void CPlatformNetworkManagerXbox::_HostGame(int usersMask, unsigned char publicS bool CPlatformNetworkManagerXbox::_StartGame() { // Set the options that now allow players to join this game - BOOL enableJip = true; // Must always be true othewise nobody can join the game while in the PLAY state - m_pIQNet->SetOpt( QNET_OPTION_JOIN_IN_PROGRESS_ALLOWED, &enableJip, sizeof BOOL ); - BOOL enableInv = !IsLocalGame(); - m_pIQNet->SetOpt( QNET_OPTION_INVITES_ALLOWED, &enableInv, sizeof BOOL ); - BOOL enablePres = !IsPrivateGame() && !IsLocalGame(); - m_pIQNet->SetOpt( QNET_OPTION_PRESENCE_JOIN_MODE, &enablePres, sizeof BOOL ); + bool enableJip = true; // Must always be true othewise nobody can join the game while in the PLAY state + m_pIQNet->SetOpt( QNET_OPTION_JOIN_IN_PROGRESS_ALLOWED, &enableJip, sizeof bool ); + bool enableInv = !IsLocalGame(); + m_pIQNet->SetOpt( QNET_OPTION_INVITES_ALLOWED, &enableInv, sizeof bool ); + bool enablePres = !IsPrivateGame() && !IsLocalGame(); + m_pIQNet->SetOpt( QNET_OPTION_PRESENCE_JOIN_MODE, &enablePres, sizeof bool ); return ( m_pIQNet->StartGame() == S_OK ); } @@ -833,7 +833,7 @@ int CPlatformNetworkManagerXbox::JoinGame(FriendSessionInfo *searchResult, int l // JoinGameFromSearchResult is running. static XSESSION_SEARCHRESULT searchResultCopy; searchResultCopy = searchResult->searchResult; - HRESULT hr = m_pIQNet->JoinGameFromSearchResult( + int hr = m_pIQNet->JoinGameFromSearchResult( primaryUserIndex, // dwUserIndex localUsersMask, // dwUserMask &searchResultCopy ); // pSearchResult @@ -913,23 +913,23 @@ bool CPlatformNetworkManagerXbox::_RunNetworkGame() { // We delay actually starting the session so that we know the game server is running by the time the clients try to join // This does result in a host advantage - HRESULT hr = m_pIQNet->StartGame(); + int hr = m_pIQNet->StartGame(); if(FAILED(hr)) return false; // Set the options that now allow players to join this game - BOOL enableJip = true; // Must always be true othewise nobody can join the game while in the PLAY state - m_pIQNet->SetOpt( QNET_OPTION_JOIN_IN_PROGRESS_ALLOWED, &enableJip, sizeof BOOL ); - BOOL enableInv = !IsLocalGame(); - m_pIQNet->SetOpt( QNET_OPTION_INVITES_ALLOWED, &enableInv, sizeof BOOL ); - BOOL enablePres = !IsPrivateGame() && !IsLocalGame(); - m_pIQNet->SetOpt( QNET_OPTION_PRESENCE_JOIN_MODE, &enablePres, sizeof BOOL ); + bool enableJip = true; // Must always be true othewise nobody can join the game while in the PLAY state + m_pIQNet->SetOpt( QNET_OPTION_JOIN_IN_PROGRESS_ALLOWED, &enableJip, sizeof bool ); + bool enableInv = !IsLocalGame(); + m_pIQNet->SetOpt( QNET_OPTION_INVITES_ALLOWED, &enableInv, sizeof bool ); + bool enablePres = !IsPrivateGame() && !IsLocalGame(); + m_pIQNet->SetOpt( QNET_OPTION_PRESENCE_JOIN_MODE, &enablePres, sizeof bool ); return true; } void CPlatformNetworkManagerXbox::UpdateAndSetGameSessionData(INetworkPlayer *pNetworkPlayerLeaving /*= NULL*/) { - DWORD playerCount = m_pIQNet->GetPlayerCount(); + unsigned long playerCount = m_pIQNet->GetPlayerCount(); if( this->m_bLeavingGame ) return; @@ -968,7 +968,7 @@ void CPlatformNetworkManagerXbox::UpdateAndSetGameSessionData(INetworkPlayer *pN m_hostGameSessionData.hostPlayerUID = ((NetworkPlayerXbox *)GetHostPlayer())->GetQNetPlayer()->GetXuid(); m_hostGameSessionData.m_uiGameHostSettings = app.GetGameHostOption(eGameHostOption_All); - HRESULT hr = S_OK; + int hr = S_OK; hr = m_pIQNet->SetOpt( QNET_OPTION_QOS_DATA_BUFFER, &m_hostGameSessionData, @@ -1115,7 +1115,7 @@ wstring CPlatformNetworkManagerXbox::GatherRTTStats() if(!pQNetPlayer->IsLocal()) { - ZeroMemory(stat,sizeof(WCHAR)*32); + ZeroMemory(stat,sizeof(wchar_t)*32); swprintf(stat, 32, L"%d: %d/", i, pQNetPlayer->GetCurrentRtt() ); stats.append(stat); } @@ -1197,7 +1197,7 @@ void CPlatformNetworkManagerXbox::SearchForGames() { // PARTY XPARTY_USER_LIST partyUserList; - HRESULT partyResult = XPartyGetUserList( &partyUserList ); + int partyResult = XPartyGetUserList( &partyUserList ); if((partyResult != XPARTY_E_NOT_IN_PARTY) && (partyUserList.dwUserCount>1)) { for(unsigned int i = 0; isessionId; } - DWORD dwStatus = ERROR_SUCCESS; - DWORD cbResults = 0; + unsigned long dwStatus = ERROR_SUCCESS; + unsigned long cbResults = 0; // In this first call, explicitly pass in a null pointer and a buffer size // of 0. This forces the function to set cbResults to the correct buffer // size. @@ -1330,7 +1330,7 @@ void CPlatformNetworkManagerXbox::SearchForGames() if (ERROR_INSUFFICIENT_BUFFER == dwStatus && cbResults > 0) { // Allocate this on the main thread rather in the search thread which might run out of memory - m_pSearchResults[m_lastSearchPad] = (XSESSION_SEARCHRESULT_HEADER *) new BYTE[cbResults]; + m_pSearchResults[m_lastSearchPad] = (XSESSION_SEARCHRESULT_HEADER *) new uint8_t[cbResults]; if (!m_pSearchResults[m_lastSearchPad]) { @@ -1388,12 +1388,12 @@ int CPlatformNetworkManagerXbox::SearchForGamesThreadProc( void* lpParameter ) { SearchForGamesData *threadData = (SearchForGamesData *)lpParameter; - DWORD sessionIDCount = threadData->sessionIDCount; + unsigned long sessionIDCount = threadData->sessionIDCount; XOVERLAPPED *pOverlapped = threadData->pOverlapped; - DWORD dwStatus = ERROR_SUCCESS; - DWORD cbResults = sessionIDCount; + unsigned long dwStatus = ERROR_SUCCESS; + unsigned long cbResults = sessionIDCount; XSESSION_SEARCHRESULT_HEADER *pSearchResults = (XSESSION_SEARCHRESULT_HEADER *)threadData->searchBuffer; while( !XHasOverlappedIoCompleted(pOverlapped) ) @@ -1415,7 +1415,7 @@ int CPlatformNetworkManagerXbox::SearchForGamesThreadProc( void* lpParameter ) const XNKEY *QoSxnkey[XSESSION_SEARCH_MAX_IDS];// = new XNKEY*[sessionIDCount]; - for(DWORD i = 0; i < pSearchResults->dwSearchResults; ++i) + for(unsigned long i = 0; i < pSearchResults->dwSearchResults; ++i) { QoSxnaddr[i] = &pSearchResults->pResults[i].info.hostAddress; QoSxnkid[i] = &pSearchResults->pResults[i].info.sessionID; @@ -1423,11 +1423,11 @@ int CPlatformNetworkManagerXbox::SearchForGamesThreadProc( void* lpParameter ) } // Create an event object that is autoreset with an initial state of "not signaled". // Pass this event handle to the QoSLookup to receive notification of each QoS lookup. - HANDLE QoSLookupHandle = CreateEvent(NULL, false, false, NULL); + void* QoSLookupHandle = CreateEvent(NULL, false, false, NULL); *threadData->ppQos = new XNQOS(); - INT iRet = XNetQosLookup( + int iRet = XNetQosLookup( pSearchResults->dwSearchResults, // Number of remote Xbox 360 consoles to probe QoSxnaddr, // Array of pointers to XNADDR structures QoSxnkid, // Array of pointers to XNKID structures that contain session IDs for the remote Xbox 360 consoles @@ -1484,7 +1484,7 @@ vector *CPlatformNetworkManagerXbox::GetSessionList(int iPa if( m_currentSearchResultsCount[iPad] > 0 ) { // Loop through all the results. - for( DWORD dwResult = 0; dwResult < m_currentSearchResultsCount[iPad]; dwResult++ ) + for( unsigned long dwResult = 0; dwResult < m_currentSearchResultsCount[iPad]; dwResult++ ) { pSearchResult = &m_pCurrentSearchResults[iPad]->pResults[dwResult]; @@ -1580,7 +1580,7 @@ vector *CPlatformNetworkManagerXbox::GetSessionList(int iPa // This runs through the search results for a session matching sessionId, then returns the full details in foundSessionInfo bool CPlatformNetworkManagerXbox::GetGameSessionInfo(int iPad, SessionID sessionId, FriendSessionInfo *foundSessionInfo) { - HRESULT hr = E_FAIL; + int hr = E_FAIL; const XSESSION_SEARCHRESULT *pSearchResult; const XNQOSINFO * pxnqi; @@ -1588,7 +1588,7 @@ bool CPlatformNetworkManagerXbox::GetGameSessionInfo(int iPad, SessionID session if( m_currentSearchResultsCount[iPad] > 0 ) { // Loop through all the results. - for( DWORD dwResult = 0; dwResult < m_currentSearchResultsCount[iPad]; dwResult++ ) + for( unsigned long dwResult = 0; dwResult < m_currentSearchResultsCount[iPad]; dwResult++ ) { pSearchResult = &m_pCurrentSearchResults[iPad]->pResults[dwResult]; @@ -1654,7 +1654,7 @@ bool CPlatformNetworkManagerXbox::GetGameSessionInfo(int iPad, SessionID session return ( hr == S_OK ); } -void CPlatformNetworkManagerXbox::SetSessionsUpdatedCallback( void (*SessionsUpdatedCallback)(LPVOID pParam), LPVOID pSearchParam ) +void CPlatformNetworkManagerXbox::SetSessionsUpdatedCallback( void (*SessionsUpdatedCallback)(void* pParam), void* pSearchParam ) { m_SessionsUpdatedCallback = SessionsUpdatedCallback; m_pSearchParam = pSearchParam; } @@ -1679,7 +1679,7 @@ void CPlatformNetworkManagerXbox::ForceFriendsSessionRefresh() INetworkPlayer *CPlatformNetworkManagerXbox::addNetworkPlayer(IQNetPlayer *pQNetPlayer) { NetworkPlayerXbox *pNetworkPlayer = new NetworkPlayerXbox(pQNetPlayer); - pQNetPlayer->SetCustomDataValue((ULONG_PTR)pNetworkPlayer); + pQNetPlayer->SetCustomDataValue((uintptr_t)pNetworkPlayer); currentNetworkPlayers.push_back( pNetworkPlayer ); return pNetworkPlayer; } @@ -1748,7 +1748,7 @@ void CPlatformNetworkManagerXbox::SetSessionSubTexturePackId( int id ) m_hostGameSessionData.subTexturePackId = id; } -void CPlatformNetworkManagerXbox::Notify(int ID, ULONG_PTR Param) +void CPlatformNetworkManagerXbox::Notify(int ID, uintptr_t Param) { m_pIQNet->Notify( ID, Param ); } diff --git a/src/client/Xbox/Network/PlatformNetworkManagerXbox.h b/src/client/Xbox/Network/PlatformNetworkManagerXbox.h index 53b044ea..23cfb369 100644 --- a/src/client/Xbox/Network/PlatformNetworkManagerXbox.h +++ b/src/client/Xbox/Network/PlatformNetworkManagerXbox.h @@ -71,7 +71,7 @@ private: IQNet * m_pIQNet; // pointer to QNet interface - HANDLE m_notificationListener; + void* m_notificationListener; vector m_machineQNetPrimaryPlayers; // collection of players that we deem to be the main one for that system @@ -141,8 +141,8 @@ private: int m_lastSearchPad; bool m_bSearchResultsReady; bool m_bSearchPending; - LPVOID m_pSearchParam; - void (*m_SessionsUpdatedCallback)(LPVOID pParam); + void* m_pSearchParam; + void (*m_SessionsUpdatedCallback)(void* pParam); C4JThread* m_SearchingThread; @@ -159,26 +159,26 @@ private: virtual void SetSessionTexturePackParentId( int id ); virtual void SetSessionSubTexturePackId( int id ); - virtual void Notify(int ID, ULONG_PTR Param); + virtual void Notify(int ID, uintptr_t Param); public: virtual vector *GetSessionList(int iPad, int localPlayers, bool partyOnly); virtual bool GetGameSessionInfo(int iPad, SessionID sessionId,FriendSessionInfo *foundSession); - virtual void SetSessionsUpdatedCallback( void (*SessionsUpdatedCallback)(LPVOID pParam), LPVOID pSearchParam ); + virtual void SetSessionsUpdatedCallback( void (*SessionsUpdatedCallback)(void* pParam), void* pSearchParam ); virtual void GetFullFriendSessionInfo( FriendSessionInfo *foundSession, void (* FriendSessionUpdatedFn)(bool success, void *pParam), void *pParam ); virtual void ForceFriendsSessionRefresh(); // IQNetcallback interface functions - VOID NotifyStateChanged( __in QNET_STATE OldState, __in QNET_STATE NewState, __in HRESULT hrInfo ); - VOID NotifyPlayerJoined( __in IQNetPlayer *pQNetPlayer ); - VOID NotifyPlayerLeaving(__in IQNetPlayer *pQNetPlayer ); - VOID NotifyNewHost( __in IQNetPlayer * pQNetPlayer); - VOID NotifyDataReceived( __in IQNetPlayer * pQNetPlayerFrom, __in DWORD dwNumPlayersTo, __in_ecount(dwNumPlayersTo) IQNetPlayer ** apQNetPlayersTo, __in_bcount(dwDataSize) const BYTE * pbData, __in DWORD dwDataSize); - VOID NotifyWriteStats( __in IQNetPlayer * pQNetPlayer ); - VOID NotifyReadinessChanged(__in IQNetPlayer * pQNetPlayer, __in BOOL bReady); - VOID NotifyCommSettingsChanged(__in IQNetPlayer * pQNetPlayer); - VOID NotifyGameSearchComplete(__in IQNetGameSearch * pGameSearch, __in HRESULT hrComplete, __in DWORD dwNumResults); - VOID NotifyGameInvite( __in DWORD dwUserIndex, __in const INVITE_INFO * pInviteInfo ); - VOID NotifyContextChanged( __in const XUSER_CONTEXT * pContext); - VOID NotifyPropertyChanged( __in const XUSER_PROPERTY * pProperty); + void NotifyStateChanged( __in QNET_STATE OldState, __in QNET_STATE NewState, __in int hrInfo ); + void NotifyPlayerJoined( __in IQNetPlayer *pQNetPlayer ); + void NotifyPlayerLeaving(__in IQNetPlayer *pQNetPlayer ); + void NotifyNewHost( __in IQNetPlayer * pQNetPlayer); + void NotifyDataReceived( __in IQNetPlayer * pQNetPlayerFrom, __in unsigned long dwNumPlayersTo, __in_ecount(dwNumPlayersTo) IQNetPlayer ** apQNetPlayersTo, __in_bcount(dwDataSize) const uint8_t * pbData, __in unsigned long dwDataSize); + void NotifyWriteStats( __in IQNetPlayer * pQNetPlayer ); + void NotifyReadinessChanged(__in IQNetPlayer * pQNetPlayer, __in bool bReady); + void NotifyCommSettingsChanged(__in IQNetPlayer * pQNetPlayer); + void NotifyGameSearchComplete(__in IQNetGameSearch * pGameSearch, __in int hrComplete, __in unsigned long dwNumResults); + void NotifyGameInvite( __in unsigned long dwUserIndex, __in const INVITE_INFO * pInviteInfo ); + void NotifyContextChanged( __in const XUSER_CONTEXT * pContext); + void NotifyPropertyChanged( __in const XUSER_PROPERTY * pProperty); }; \ No newline at end of file diff --git a/src/client/Xbox/Sentient/DynamicConfigurations.cpp b/src/client/Xbox/Sentient/DynamicConfigurations.cpp index 5d2b9763..8a1bbb87 100644 --- a/src/client/Xbox/Sentient/DynamicConfigurations.cpp +++ b/src/client/Xbox/Sentient/DynamicConfigurations.cpp @@ -22,14 +22,14 @@ void MinecraftDynamicConfigurations::Tick() } } -DWORD MinecraftDynamicConfigurations::GetTrialTime() +unsigned long MinecraftDynamicConfigurations::GetTrialTime() { return trialData.trialTimeSeconds; } void MinecraftDynamicConfigurations::UpdateAllConfigurations() { - for(DWORD i = 0; i < eDynamic_Config_Max; ++i) + for(unsigned long i = 0; i < eDynamic_Config_Max; ++i) { s_bUpdatedConfigs[i] = false; } @@ -39,7 +39,7 @@ void MinecraftDynamicConfigurations::UpdateAllConfigurations() void MinecraftDynamicConfigurations::UpdateNextConfiguration() { EDynamic_Configs update = eDynamic_Config_Max; - for(DWORD i = 0; i < eDynamic_Config_Max; ++i) + for(unsigned long i = 0; i < eDynamic_Config_Max; ++i) { if(!s_bUpdatedConfigs[i]) { @@ -57,7 +57,7 @@ void MinecraftDynamicConfigurations::UpdateConfiguration(EDynamic_Configs id) { app.DebugPrintf("DynamicConfig: Attempting to update dynamic configuration %d\n", id); - HRESULT hr = Sentient::SenDynamicConfigGetSize( id, &s_currentConfigSize, &MinecraftDynamicConfigurations::GetSizeCompletedCallback, NULL); + int hr = Sentient::SenDynamicConfigGetSize( id, &s_currentConfigSize, &MinecraftDynamicConfigurations::GetSizeCompletedCallback, NULL); switch(hr) { @@ -86,12 +86,12 @@ void MinecraftDynamicConfigurations::UpdateConfiguration(EDynamic_Configs id) } } -void MinecraftDynamicConfigurations::GetSizeCompletedCallback(HRESULT taskResult, void *userCallbackData) +void MinecraftDynamicConfigurations::GetSizeCompletedCallback(int taskResult, void *userCallbackData) { if( HRESULT_SUCCEEDED(taskResult) ) { s_dataWritten = new byte[s_currentConfigSize]; - HRESULT hr = Sentient::SenDynamicConfigGetBytes( + int hr = Sentient::SenDynamicConfigGetBytes( s_eCurrentConfig, s_currentConfigSize, &s_dataWrittenSize, @@ -133,7 +133,7 @@ void MinecraftDynamicConfigurations::GetSizeCompletedCallback(HRESULT taskResult } } -void MinecraftDynamicConfigurations::GetDataCompletedCallback(HRESULT taskResult, void *userCallbackData) +void MinecraftDynamicConfigurations::GetDataCompletedCallback(int taskResult, void *userCallbackData) { if(HRESULT_SUCCEEDED(taskResult) && s_currentConfigSize == s_dataWrittenSize) { diff --git a/src/client/Xbox/Sentient/DynamicConfigurations.h b/src/client/Xbox/Sentient/DynamicConfigurations.h index 61b206eb..1119122f 100644 --- a/src/client/Xbox/Sentient/DynamicConfigurations.h +++ b/src/client/Xbox/Sentient/DynamicConfigurations.h @@ -30,12 +30,12 @@ private: ************************/ // 4J Stu - The first 4 bytes define a version number, that defines the structure of the data - // After reading those bytes into a DWORD, the remainder of the data should be the size of the + // After reading those bytes into a unsigned long, the remainder of the data should be the size of the // relevant struct and can be cast to the struct struct _dynamic_config_trial_data_version1 { // The time in seconds that the player can play the trial for - DWORD trialTimeSeconds; + unsigned long trialTimeSeconds; _dynamic_config_trial_data_version1() { trialTimeSeconds = DYNAMIC_CONFIG_DEFAULT_TRIAL_TIME; } }; @@ -56,13 +56,13 @@ private: public: static void Tick(); - static DWORD GetTrialTime(); + static unsigned long GetTrialTime(); private: static void UpdateAllConfigurations(); static void UpdateNextConfiguration(); static void UpdateConfiguration(EDynamic_Configs id); - static void GetSizeCompletedCallback(HRESULT taskResult, void *userCallbackData); - static void GetDataCompletedCallback(HRESULT taskResult, void *userCallbackData); + static void GetSizeCompletedCallback(int taskResult, void *userCallbackData); + static void GetDataCompletedCallback(int taskResult, void *userCallbackData); }; \ No newline at end of file diff --git a/src/client/Xbox/Sentient/Include/SenClientAvatar.h b/src/client/Xbox/Sentient/Include/SenClientAvatar.h index dfccfd3b..979018a7 100644 --- a/src/client/Xbox/Sentient/Include/SenClientAvatar.h +++ b/src/client/Xbox/Sentient/Include/SenClientAvatar.h @@ -119,7 +119,7 @@ namespace Sentient /// @related SenAvatarDownloadAssets() /// @related SenAvatarDownloadIcon() /// - HRESULT SenAvatarEnumerate( + int SenAvatarEnumerate( int userIndex, size_t avatarInfoCountMax, size_t *out_avatarInfoCount, @@ -159,7 +159,7 @@ namespace Sentient /// @related SenAvatarDownloadAssets() /// @related SenAvatarDownloadIcon() /// - HRESULT SenAvatarFind( + int SenAvatarFind( SenSysTitleID titleID, SenResourceID resourceID, SenAvatarInfo *out_avatarInfo, @@ -201,7 +201,7 @@ namespace Sentient /// @related SenAvatarDownloadAssets() /// @related SenAvatarDownloadIcon() /// - HRESULT SenAvatarDownloadMetadata( + int SenAvatarDownloadMetadata( const SenAvatarInfo &avatarInfo, bool male, size_t dataSizeMax, @@ -244,7 +244,7 @@ namespace Sentient /// @related SenAvatarDownloadMetadata() /// @related SenAvatarDownloadIcon() /// - HRESULT SenAvatarDownloadAssets( + int SenAvatarDownloadAssets( const SenAvatarInfo &avatarInfo, bool male, size_t dataSizeMax, @@ -287,7 +287,7 @@ namespace Sentient /// @related SenAvatarDownloadMetadata() /// @related SenAvatarDownloadAssets() /// - HRESULT SenAvatarDownloadIcon( + int SenAvatarDownloadIcon( const SenAvatarInfo &avatarInfo, bool male, size_t dataSizeMax, @@ -327,7 +327,7 @@ namespace Sentient /// @related SenAvatarDownloadAssets() /// @related SenAvatarDownloadIcon() /// - HRESULT SenAvatarDownloadExtraInfo( + int SenAvatarDownloadExtraInfo( const SenAvatarInfo &avatarInfo, bool male, SenAvatarExtraInfo *out_avatarExtraInfo, @@ -336,7 +336,7 @@ namespace Sentient // Download the raw binary data to the client. // It is assumed that out_data is preallocated to (at least) dataSizeMax bytes, // which in turn should be at least avatarInfo.[fe]male.xml.GetBufferSize() bytes. - HRESULT SenAvatarDownloadXML( + int SenAvatarDownloadXML( const SenAvatarInfo &avatarInfo, bool male, size_t dataSizeMax, @@ -364,7 +364,7 @@ namespace Sentient // Note that bufferLength is in wchars, and includes the terminating nul. // The actual length of the _string_ is (*out_bufferLength - 1). // - HRESULT SenAvatarXMLGetTitle( + int SenAvatarXMLGetTitle( const SenXML &senXML, size_t bufferLengthMax, size_t *out_bufferLength, // optional @@ -372,7 +372,7 @@ namespace Sentient // Obtain a wide, localized string with a given avatar's name. // See the similar SenAvatarGetTitle() for details. - HRESULT SenAvatarXMLGetName( + int SenAvatarXMLGetName( const SenXML &senXML, size_t bufferLengthMax, size_t *out_bufferLength, // optional @@ -380,20 +380,20 @@ namespace Sentient // Obtain a wide, localized string with a given avatar's description. // See the similar SenAvatarGetTitle() for details. - HRESULT SenAvatarXMLGetDescription( + int SenAvatarXMLGetDescription( const SenXML &senXML, size_t bufferLengthMax, size_t *out_bufferLength, // optional wchar_t *out_buffer ); // optional // Obtain the number of custom avatar palettes. - HRESULT SenAvatarXMLGetPaletteCount( + int SenAvatarXMLGetPaletteCount( const SenXML &senXML, size_t *out_paletteCount ); // Obtain the localized name for an avatar palettes. // See the similar SenAvatarGetTitle() for details. - HRESULT SenAvatarXMLGetPaletteName( + int SenAvatarXMLGetPaletteName( const SenXML &senXML, int paletteIndex, size_t bufferLengthMax, @@ -402,7 +402,7 @@ namespace Sentient // Obtain a single palette at a given index in the list of palettes // for a given avatar. - HRESULT SenAvatarXMLGetPalette( + int SenAvatarXMLGetPalette( const SenXML &senXML, int paletteIndex, SenAvatarPalette *out_palette ); @@ -410,7 +410,7 @@ namespace Sentient // Extract all palette entries at once. // It is assumed that out_paletteList is preallocated to (at least) // paletteCountMax entries. - HRESULT SenAvatarXMLGetPalettes( + int SenAvatarXMLGetPalettes( const SenXML &senXML, size_t paletteCountMax, size_t *out_paletteCount, // optional diff --git a/src/client/Xbox/Sentient/Include/SenClientBoxArt.h b/src/client/Xbox/Sentient/Include/SenClientBoxArt.h index 09662243..a3cf45f1 100644 --- a/src/client/Xbox/Sentient/Include/SenClientBoxArt.h +++ b/src/client/Xbox/Sentient/Include/SenClientBoxArt.h @@ -125,7 +125,7 @@ namespace Sentient /// @related SenBoxArtDownloadImage() /// @related SenBoxArtDownloadXML() /// - HRESULT SenBoxArtEnumerate( + int SenBoxArtEnumerate( int userIndex, size_t boxArtInfoCountMax, size_t *out_boxArtInfoCount, @@ -169,7 +169,7 @@ namespace Sentient /// @related SenBoxArtEnumerate() /// @related SenBoxArtDownloadXML() /// - HRESULT SenBoxArtDownloadImage( + int SenBoxArtDownloadImage( const SenBoxArtInfo &boxArtInfo, size_t dataSizeMax, void *out_data, @@ -207,7 +207,7 @@ namespace Sentient /// @related SenBoxArtEnumerate() /// @related SenBoxArtDownloadImage() /// - HRESULT SenBoxArtDownloadExtraInfo( + int SenBoxArtDownloadExtraInfo( const SenBoxArtInfo &boxArtInfo, SenBoxArtExtraInfo *out_boxArtExtraInfo, SenHandle *out_senHandle, @@ -248,7 +248,7 @@ namespace Sentient /// /// @deprecated Use SenBoxArtDownloadExtraInfo() instead. /// - __declspec(deprecated("This function is deprecated, use SenBoxArtDownloadExtraInfo instead")) HRESULT SenBoxArtDownloadXML( + __declspec(deprecated("This function is deprecated, use SenBoxArtDownloadExtraInfo instead")) int SenBoxArtDownloadXML( const SenBoxArtInfo &boxArtInfo, size_t dataSizeMax, void *out_data, @@ -305,7 +305,7 @@ namespace Sentient /// /// @deprecated Use SenBoxArtDownloadExtraInfo() instead. /// - __declspec(deprecated("This function is deprecated, use SenBoxArtDownloadExtraInfo instead")) HRESULT SenBoxArtXMLGetTitle( + __declspec(deprecated("This function is deprecated, use SenBoxArtDownloadExtraInfo instead")) int SenBoxArtXMLGetTitle( const SenXML &senXML, size_t bufferLengthMax, size_t *out_bufferLength, @@ -361,7 +361,7 @@ namespace Sentient /// /// @deprecated Use SenBoxArtDownloadExtraInfo() instead. /// - __declspec(deprecated("This function is deprecated, use SenBoxArtDownloadExtraInfo instead")) HRESULT SenBoxArtXMLGetDescription( + __declspec(deprecated("This function is deprecated, use SenBoxArtDownloadExtraInfo instead")) int SenBoxArtXMLGetDescription( const SenXML &senXML, size_t bufferLengthMax, size_t *out_bufferLength, @@ -399,7 +399,7 @@ namespace Sentient /// @related SenBoxArtEnumerate() /// @related SenBoxArtDownloadXML() /// - __declspec(deprecated("This function is deprecated, use the overload with a SenHandle out param instead")) HRESULT SenBoxArtDownloadImage( + __declspec(deprecated("This function is deprecated, use the overload with a SenHandle out param instead")) int SenBoxArtDownloadImage( const SenBoxArtInfo &boxArtInfo, size_t dataSizeMax, void *out_data, diff --git a/src/client/Xbox/Sentient/Include/SenClientConfig.h b/src/client/Xbox/Sentient/Include/SenClientConfig.h index 81c2f3cc..7a72e0ff 100644 --- a/src/client/Xbox/Sentient/Include/SenClientConfig.h +++ b/src/client/Xbox/Sentient/Include/SenClientConfig.h @@ -66,7 +66,7 @@ namespace Sentient /// @related SenConfigFileDownload() /// __declspec(deprecated("Use SenDynamicConfigGetSize() instead")) - HRESULT SenConfigFileFind( + int SenConfigFileFind( SenResourceID resourceID, SenConfigInfo *out_configInfo, SenSysCompletedCallback userCallback, @@ -106,7 +106,7 @@ namespace Sentient /// @related SenConfigFileFind() /// __declspec(deprecated("Use SenDynamicConfigGetBytes() instead")) - HRESULT SenConfigFileDownload( + int SenConfigFileDownload( const SenConfigInfo &configInfo, size_t dataSizeMax, void *out_data, diff --git a/src/client/Xbox/Sentient/Include/SenClientCore.h b/src/client/Xbox/Sentient/Include/SenClientCore.h index f86eb92a..0bdffa3a 100644 --- a/src/client/Xbox/Sentient/Include/SenClientCore.h +++ b/src/client/Xbox/Sentient/Include/SenClientCore.h @@ -28,10 +28,10 @@ /* API Design considerations - 1. All functions will return S_OK if they succeed or either E_FAIL or an HRESULT error code + 1. All functions will return S_OK if they succeed or either E_FAIL or an int error code if they fail. Callers should use the standard SUCCEEDED(hr) or FAILED(hr) macros to test the results, as it eliminates errors due to misconceptions about what exactly is - an HRESULT error vs. success/status. + an int error vs. success/status. PLEASE NOTE: S_FALSE is for successfully returning a false, and does *not* qualify as an error code. It should not be used for fail cases. Use only codes like E_FAIL, diff --git a/src/client/Xbox/Sentient/Include/SenClientCulture.h b/src/client/Xbox/Sentient/Include/SenClientCulture.h index 8fb6b642..1ebcc028 100644 --- a/src/client/Xbox/Sentient/Include/SenClientCulture.h +++ b/src/client/Xbox/Sentient/Include/SenClientCulture.h @@ -22,10 +22,10 @@ namespace Sentient /// @brief Set the current culture to the one specified, if possible. /// /// @param[in] dwLanguage - /// the DWORD id as defined in xconfig.h (e.g. XC_LANGUAGE_ENGLISH) for the language to use + /// the unsigned long id as defined in xconfig.h (e.g. XC_LANGUAGE_ENGLISH) for the language to use /// @param[in] dwLocale - /// the DWORD id as defined in xconfig.h (e.g. XC_LOCALE_GREAT_BRITAIN) for the region to use + /// the unsigned long id as defined in xconfig.h (e.g. XC_LOCALE_GREAT_BRITAIN) for the region to use /// /// @return Check SUCCEEDED( hresult ) or FAILED( hresult ) to determine success. Specific values include: /// SENTIENT_E_NOT_INITIALIZED: You did not call SentientInitialize() first. @@ -38,9 +38,9 @@ namespace Sentient /// This is the culture that will be used when any string routine is called. /// By default, this is set to the system culture & region. /// - HRESULT SetCurrentCulture( - __in DWORD dwLanguage, - __in DWORD dwLocale + int SetCurrentCulture( + __in unsigned long dwLanguage, + __in unsigned long dwLocale ); /// @brief Set the current culture to English (no region) @@ -56,6 +56,6 @@ namespace Sentient /// This is the culture that will be used when any string routine is called. /// By default, Sentient uses the console's culture & region. /// - __inline HRESULT SetCurrentCultureEnglish() { return SetCurrentCulture(XC_LANGUAGE_ENGLISH, 0); } + __inline int SetCurrentCultureEnglish() { return SetCurrentCulture(XC_LANGUAGE_ENGLISH, 0); } } // namespace Sentient diff --git a/src/client/Xbox/Sentient/Include/SenClientCultureBackCompat_SenBoxArt.h b/src/client/Xbox/Sentient/Include/SenClientCultureBackCompat_SenBoxArt.h index 050d86bf..596a8313 100644 --- a/src/client/Xbox/Sentient/Include/SenClientCultureBackCompat_SenBoxArt.h +++ b/src/client/Xbox/Sentient/Include/SenClientCultureBackCompat_SenBoxArt.h @@ -8,7 +8,7 @@ namespace Sentient #pragma warning(disable:4996) __declspec(deprecated("This function is deprecated. See the function body for an example of using the new API.")) - __inline HRESULT SenBoxArtDownloadExtraInfo( + __inline int SenBoxArtDownloadExtraInfo( const SenBoxArtInfo &boxArtInfo, const SenCultureInfo *culture, SenBoxArtExtraInfo *out_boxArtExtraInfo, @@ -19,7 +19,7 @@ namespace Sentient } __declspec(deprecated("This function is deprecated, use SenBoxArtDownloadExtraInfo instead")) - __inline HRESULT SenBoxArtXMLGetTitle( + __inline int SenBoxArtXMLGetTitle( const SenXML &senXML, const SenCultureInfo *culture, size_t bufferLengthMax, @@ -30,7 +30,7 @@ namespace Sentient } __declspec(deprecated("This function is deprecated, use SenBoxArtDownloadExtraInfo instead")) - __inline HRESULT SenBoxArtXMLGetDescription( + __inline int SenBoxArtXMLGetDescription( const SenXML &senXML, const SenCultureInfo *culture, size_t bufferLengthMax, diff --git a/src/client/Xbox/Sentient/Include/SenClientCultureBackCompat_SenClientUGC.h b/src/client/Xbox/Sentient/Include/SenClientCultureBackCompat_SenClientUGC.h index b36fd6e5..6738d26a 100644 --- a/src/client/Xbox/Sentient/Include/SenClientCultureBackCompat_SenClientUGC.h +++ b/src/client/Xbox/Sentient/Include/SenClientCultureBackCompat_SenClientUGC.h @@ -57,7 +57,7 @@ namespace Sentient /// @deprecated Use SenUGCEnumerateFeeds() without SenCulture /// __declspec(deprecated("This function is deprecated. See the function body for an example of using the new API.")) - __inline HRESULT SenUGCEnumerateFeeds( + __inline int SenUGCEnumerateFeeds( int userIndex, const SenCultureInfo *culture, size_t maxResults, diff --git a/src/client/Xbox/Sentient/Include/SenClientCultureBackCompat_SenCore.h b/src/client/Xbox/Sentient/Include/SenClientCultureBackCompat_SenCore.h index df980fb5..a90c97eb 100644 --- a/src/client/Xbox/Sentient/Include/SenClientCultureBackCompat_SenCore.h +++ b/src/client/Xbox/Sentient/Include/SenClientCultureBackCompat_SenCore.h @@ -53,7 +53,7 @@ __inline const SenCultureInfo *SenCultureGetParent( const SenCultureInfo *cultur } __declspec(deprecated("This function is deprecated, and should not be used")) -__inline HRESULT SenCultureSetCurrent( const wchar_t name[] ) +__inline int SenCultureSetCurrent( const wchar_t name[] ) { return E_FAIL; } @@ -66,7 +66,7 @@ __inline const SenCultureInfo *SenCultureGetCurrent() __declspec(deprecated("This function is deprecated, and should not be used")) -__inline HRESULT SenCultureSetDefault( const wchar_t name[] ) +__inline int SenCultureSetDefault( const wchar_t name[] ) { return E_FAIL; } diff --git a/src/client/Xbox/Sentient/Include/SenClientCultureBackCompat_SenNews.h b/src/client/Xbox/Sentient/Include/SenClientCultureBackCompat_SenNews.h index 0c4d9450..37a7d50b 100644 --- a/src/client/Xbox/Sentient/Include/SenClientCultureBackCompat_SenNews.h +++ b/src/client/Xbox/Sentient/Include/SenClientCultureBackCompat_SenNews.h @@ -6,7 +6,7 @@ namespace Sentient { __declspec(deprecated("This function is deprecated. See the function body for an example of using the new API.")) -__inline HRESULT SenGetTickerMessage( +__inline int SenGetTickerMessage( int userIndex, const SenCultureInfo *culture, SenTickerData *out_tickerData ) diff --git a/src/client/Xbox/Sentient/Include/SenClientCultureBackCompat_SenSuperstars.h b/src/client/Xbox/Sentient/Include/SenClientCultureBackCompat_SenSuperstars.h index 31e1eff4..fd5d36ee 100644 --- a/src/client/Xbox/Sentient/Include/SenClientCultureBackCompat_SenSuperstars.h +++ b/src/client/Xbox/Sentient/Include/SenClientCultureBackCompat_SenSuperstars.h @@ -7,7 +7,7 @@ namespace Sentient { __declspec(deprecated("This function is deprecated. See the function body for an example of using the new API.")) - __inline HRESULT SenGetAwardMessage( + __inline int SenGetAwardMessage( int userIndex, const SenCultureInfo *culture, SenAwardMessageData *out_awardData ) @@ -16,7 +16,7 @@ namespace Sentient } __declspec(deprecated("This function is deprecated. See the function body for an example of using the new API.")) - __inline HRESULT SenGetVIPLevelName( + __inline int SenGetVIPLevelName( const SenCultureInfo *culture, unsigned int vipLevel, size_t maxNameLength, @@ -26,7 +26,7 @@ namespace Sentient } __declspec(deprecated("This function is deprecated. See the function body for an example of using the new API.")) - __inline HRESULT SenGetFameDisplayData( + __inline int SenGetFameDisplayData( int userIndex, const SenCultureInfo *culture, size_t startIndex, @@ -39,7 +39,7 @@ namespace Sentient __declspec(deprecated("This function is deprecated. See the function body for an example of using the new API.")) - __inline HRESULT SenAvatarDownloadExtraInfo( + __inline int SenAvatarDownloadExtraInfo( const SenAvatarInfo &avatarInfo, bool male, const SenCultureInfo *culture, @@ -55,7 +55,7 @@ namespace Sentient } __declspec(deprecated("This function is deprecated. See the function body for an example of using the new API.")) - __inline HRESULT SenAvatarXMLGetTitle( + __inline int SenAvatarXMLGetTitle( const SenXML &senXML, const SenCultureInfo *culture, // optional size_t bufferLengthMax, @@ -66,7 +66,7 @@ namespace Sentient } __declspec(deprecated("This function is deprecated. See the function body for an example of using the new API.")) - __inline HRESULT SenAvatarXMLGetName( + __inline int SenAvatarXMLGetName( const SenXML &senXML, const SenCultureInfo *culture, size_t bufferLengthMax, @@ -77,7 +77,7 @@ namespace Sentient } __declspec(deprecated("This function is deprecated. See the function body for an example of using the new API.")) - __inline HRESULT SenAvatarXMLGetDescription( + __inline int SenAvatarXMLGetDescription( const SenXML &senXML, const SenCultureInfo *culture, // optional size_t bufferLengthMax, @@ -88,7 +88,7 @@ namespace Sentient } __declspec(deprecated("This function is deprecated. See the function body for an example of using the new API.")) - __inline HRESULT SenAvatarXMLGetPaletteName( + __inline int SenAvatarXMLGetPaletteName( const SenXML &senXML, int paletteIndex, const SenCultureInfo *culture, // optional diff --git a/src/client/Xbox/Sentient/Include/SenClientDynamicConfig.h b/src/client/Xbox/Sentient/Include/SenClientDynamicConfig.h index d6c5cb64..1628b5fe 100644 --- a/src/client/Xbox/Sentient/Include/SenClientDynamicConfig.h +++ b/src/client/Xbox/Sentient/Include/SenClientDynamicConfig.h @@ -42,7 +42,7 @@ namespace Sentient /// /// @related SenDynamicConfigFileGetBytes() /// - HRESULT SenDynamicConfigGetSize( + int SenDynamicConfigGetSize( __in unsigned int titleID, __in unsigned int resourceID, __out size_t* out_size, @@ -74,7 +74,7 @@ namespace Sentient /// /// @related SenDynamicConfigFileGetBytes() /// - __inline HRESULT SenDynamicConfigGetSize( + __inline int SenDynamicConfigGetSize( __in unsigned int resourceID, __out size_t* out_size, __in SenSysCompletedCallback userCallback, @@ -117,7 +117,7 @@ namespace Sentient /// /// @related SenDynamicConfigFileGetSize() /// - HRESULT SenDynamicConfigGetBytes( + int SenDynamicConfigGetBytes( __in unsigned int titleID, __in unsigned int resourceID, __in size_t dataSizeMax, @@ -157,7 +157,7 @@ namespace Sentient /// /// @related SenDynamicConfigFileGetSize() /// - __inline HRESULT SenDynamicConfigGetBytes( + __inline int SenDynamicConfigGetBytes( __in unsigned int resourceID, __in size_t dataSizeMax, __out_opt size_t* out_bytesWritten, diff --git a/src/client/Xbox/Sentient/Include/SenClientFame.h b/src/client/Xbox/Sentient/Include/SenClientFame.h index 1e823075..7cafe217 100644 --- a/src/client/Xbox/Sentient/Include/SenClientFame.h +++ b/src/client/Xbox/Sentient/Include/SenClientFame.h @@ -223,7 +223,7 @@ namespace Sentient /// @details This overload can be used to retrieve VIP status for friends or remote participants in a multiplayer session. /// For local users, prefer SenGetFameVIPLevel(int, SenFameVIPData*) /// - HRESULT SenGetFameVIPLevel( + int SenGetFameVIPLevel( int userIndex, size_t userIDCount, const PlayerUID *userIDArray, @@ -252,7 +252,7 @@ namespace Sentient /// In rare cases where SENTIENT_S_OPERATION_IN_PROGRESS is returned the title should call again /// on the next scheduled iteration of their Sentient update loop. /// - HRESULT SenGetFameVIPLevel( + int SenGetFameVIPLevel( int userIndex, SenFameVIPData *out_fameVIPData ); @@ -271,7 +271,7 @@ namespace Sentient /// for which it has not received an acknowledgement message. Titles can use this information /// to highlight changes in VIP level. Once a change has been messaged titles should /// call this API to clear the server state. - HRESULT SenAcknowledgeVIPLevelChange( + int SenAcknowledgeVIPLevelChange( int userIndex ); /// @brief Query a Fame leaderboard @@ -310,7 +310,7 @@ namespace Sentient /// E_FAIL: Failed to spawn server call. /// S_OK: Server call spawned successfully. /// - HRESULT SenGetFameLeaderboard( + int SenGetFameLeaderboard( int userIndex, const SenFameLeaderboardRequest &leaderboardRequest, size_t entryCountMax, @@ -340,7 +340,7 @@ namespace Sentient /// in all states where they can display award messages. When a message is returned it is popped from an internal queue /// and will not be returned again by further calls. /// - HRESULT SenGetAwardMessage( + int SenGetAwardMessage( int userIndex, SenAwardMessageData *out_awardData ); @@ -358,7 +358,7 @@ namespace Sentient /// /// @details Some Fame Challenges are reset weekly. Use this API when displaying a timer for the reset. /// - HRESULT SenGetTimeLeftInFameWeek( + int SenGetTimeLeftInFameWeek( SenFameTime *out_timeRemaining ); // @@ -382,7 +382,7 @@ namespace Sentient /// @details Some VIP levels are reset if the user does not actively maintain them. Use this API /// when displaying a timer for the reset. /// - HRESULT SenGetTimeLeftInVIPLevel( + int SenGetTimeLeftInVIPLevel( int userIndex, SenFameTime *out_timeRemaining ); @@ -409,7 +409,7 @@ namespace Sentient /// In rare cases where SENTIENT_S_OPERATION_IN_PROGRESS is returned the title should call again /// on the next scheduled iteration of their Sentient update loop. /// - HRESULT SenGetVIPLevelName( + int SenGetVIPLevelName( unsigned int vipLevel, size_t maxNameLength, wchar_t *out_name); @@ -431,7 +431,7 @@ namespace Sentient /// @details Titles can use this API to ensure that they allocate a buffer of appropriate size /// before making a call to SenGetFameDisplayData. /// - HRESULT SenGetFameDisplayDataCount( + int SenGetFameDisplayDataCount( size_t *out_count ); /// @brief Retrieve a summary of a user's progress against Fame Challenges. @@ -466,7 +466,7 @@ namespace Sentient /// Use SenGetFameDisplayDataCount() to dynamically size a buffer large enough to obtain all the display data entries /// in a single call, or use the startIndex parameter for paging. /// - HRESULT SenGetFameDisplayData( + int SenGetFameDisplayData( int userIndex, size_t startIndex, size_t maxDisplayDataCount, @@ -495,7 +495,7 @@ namespace Sentient /// on the Sentient server, but it may be buffered on the client to prevent excessive server load. Titles should call /// SenFlushFameProgress as appropriate (e.g. on game save) to ensure that all progress writes are committed to the server. /// Titles should not submit updates against Fame Challenges whose progress is determined by the server(e.g. First Play) - HRESULT SenUpdateFameProgress( + int SenUpdateFameProgress( int userIndex, unsigned int milestoneTypeID, unsigned int xpGained ); @@ -525,7 +525,7 @@ namespace Sentient /// When there is no local data that needs flushing, the supplied callback will be invoked before execution /// returns from this function, and the return code will be S_OK. /// - HRESULT SenFlushFameProgress( + int SenFlushFameProgress( int userIndex, SenSysCompletedCallback userCallback, void *userCallbackData ); @@ -561,7 +561,7 @@ namespace Sentient /// @details Titles should report multiplayer sessions to the Sentient server via this API in order to support /// tracking of progress against certain Fame Challenges. For proper tracking each user in the multiplayer /// session should independently call this function on completion of a game. - HRESULT SenRegisterFameMPGame( + int SenRegisterFameMPGame( int userIndex, size_t participantCount, const SenFameMPGameParticipant *participants, diff --git a/src/client/Xbox/Sentient/Include/SenClientFile.h b/src/client/Xbox/Sentient/Include/SenClientFile.h index 0ec968c8..0b607626 100644 --- a/src/client/Xbox/Sentient/Include/SenClientFile.h +++ b/src/client/Xbox/Sentient/Include/SenClientFile.h @@ -105,7 +105,7 @@ namespace Sentient /// @related SenFileDownload() /// @related SenFileDigestCreate() /// - SenFileDigest SenFileDigestCreate( size_t dataSize, const BYTE *data ); + SenFileDigest SenFileDigestCreate( size_t dataSize, const uint8_t *data ); /// @brief Compare two SenFileDigests for equality. /// diff --git a/src/client/Xbox/Sentient/Include/SenClientMain.h b/src/client/Xbox/Sentient/Include/SenClientMain.h index 416d4dea..b93de156 100644 --- a/src/client/Xbox/Sentient/Include/SenClientMain.h +++ b/src/client/Xbox/Sentient/Include/SenClientMain.h @@ -41,7 +41,7 @@ namespace Sentient /// /// @details Call this on startup to set up networking system and initialize internal buffers. /// - HRESULT SentientInitialize( + int SentientInitialize( SenSysTitleID titleID ); /// @brief Update Sentient's internal state. @@ -55,7 +55,7 @@ namespace Sentient /// /// @details Call this every frame to handle network message pumping and to trigger asynchronous callbacks on completed ( or failed ) tasks. /// - HRESULT SentientUpdate(); + int SentientUpdate(); /// @brief Stop and uninitialize Sentient. /// @@ -66,7 +66,7 @@ namespace Sentient /// /// @details Call this on app/game shutdown. (not necessary on X360) /// - HRESULT SentientShutdown(); + int SentientShutdown(); /// @brief Cancel an asynchronous task. /// @@ -80,6 +80,6 @@ namespace Sentient /// @detail Call this to immediately cancel any task that exposes a SenHandle. /// The completion callback will be invoked on a successful cancel. /// - HRESULT SentientCancel( SenHandle task ); + int SentientCancel( SenHandle task ); } // namespace Sentient diff --git a/src/client/Xbox/Sentient/Include/SenClientMarkers.h b/src/client/Xbox/Sentient/Include/SenClientMarkers.h index 1eac8fec..91f64cd6 100644 --- a/src/client/Xbox/Sentient/Include/SenClientMarkers.h +++ b/src/client/Xbox/Sentient/Include/SenClientMarkers.h @@ -32,13 +32,13 @@ namespace Sentient ***** Marker Functions ***** ****************************/ - HRESULT SenMarkerAdd( + int SenMarkerAdd( int userIndex, SenSysTitleID titleID, SenUGCID ugcID, const SenMarker *marker ); - HRESULT SenMarkerGetWithinArea( + int SenMarkerGetWithinArea( SenSysTitleID titleID, SenUGCID ugcID, float xMin, float yMin, float zMin, diff --git a/src/client/Xbox/Sentient/Include/SenClientNews.h b/src/client/Xbox/Sentient/Include/SenClientNews.h index 22c39a1e..702fc178 100644 --- a/src/client/Xbox/Sentient/Include/SenClientNews.h +++ b/src/client/Xbox/Sentient/Include/SenClientNews.h @@ -79,12 +79,12 @@ namespace Sentient /// @param[in\out] userIndex /// @param[in\out] out_tickerData /// - /// @return HRESULT + /// @return int /// /// @details /// /// @related - HRESULT SenGetTickerMessage( + int SenGetTickerMessage( int userIndex, SenTickerData *out_tickerData ); diff --git a/src/client/Xbox/Sentient/Include/SenClientStats.h b/src/client/Xbox/Sentient/Include/SenClientStats.h index 0ee41a47..912ba726 100644 --- a/src/client/Xbox/Sentient/Include/SenClientStats.h +++ b/src/client/Xbox/Sentient/Include/SenClientStats.h @@ -39,14 +39,14 @@ namespace Sentient struct SenStat { - DWORD dwUserID; - DWORD dwStatID; - DWORD dwFlags; // SenStatFlag_* - DWORD dwNumProperties; - CHAR* arrProperties; - DWORD dwNumValues; - CHAR* arrValues; - DWORD* arrValueFlags; // SenStatValueFlag_* + unsigned long dwUserID; + unsigned long dwStatID; + unsigned long dwFlags; // SenStatFlag_* + unsigned long dwNumProperties; + char* arrProperties; + unsigned long dwNumValues; + char* arrValues; + unsigned long* arrValueFlags; // SenStatValueFlag_* }; @@ -68,7 +68,7 @@ namespace Sentient /// /// @details Calls to this function should use generated Telemetry code, rather than /// calling the function from title code - HRESULT SentientStatsSend( SenStat *pStat ); + int SentientStatsSend( SenStat *pStat ); /// @brief Sets the send interval for Telemetry. Only works in debug builds /// @@ -77,7 +77,7 @@ namespace Sentient /// /// @details The body of this function is conditionally compiled out of non-debug builds. /// - void SentientSetStatSendInterval( DWORD dwIntervalMs ); + void SentientSetStatSendInterval( unsigned long dwIntervalMs ); /// @brief Requests that Sentient immediately send any stats being buffered /// @@ -89,7 +89,7 @@ namespace Sentient /// @details This API can only be called once every minute. Any attempts to call the API more frequently /// will result in the call being throttled, and the API returning SENTIENT_E_TOO_MANY_CALLS /// Data is not actually sent until the next Sentient::Update() call - HRESULT SentientFlushStats( ); + int SentientFlushStats( ); /// @brief Requests that Sentient immediately send any stats being buffered because the title is exiting /// @@ -101,7 +101,7 @@ namespace Sentient /// @details This API can only be called ONCE. Any attempts to call the API more frequently /// will result in the call being throttled, and the API returning SENTIENT_E_TOO_MANY_CALLS /// Data is not actually sent until the next Sentient::Update() call - HRESULT SentientFlushStatsOnExit( ); + int SentientFlushStatsOnExit( ); /// @brief Requests that Sentient immediately send any stats being buffered because the title is going to the marketplace and may not return /// @@ -113,7 +113,7 @@ namespace Sentient /// @details Any attempts to call the API too frequently will result in the call being throttled, /// and the API returning SENTIENT_E_TOO_MANY_CALLS /// Data is not actually sent until the next Sentient::Update() call - HRESULT SentientFlushStatsOnMarketPlace( ); + int SentientFlushStatsOnMarketPlace( ); /// @brief Tells Sentient that an important point in the game was hit and that events should be sent as soon as possible /// @@ -123,7 +123,7 @@ namespace Sentient /// /// @details This API should be caleld when the game hits an important event or point. /// Sentient Will send the event data to the server within the next minute, calling this method frequently will not cause any additional sends - HRESULT SentientFlushStatsOnKeyEvent( ); + int SentientFlushStatsOnKeyEvent( ); #ifdef SEN_LOGTELEMETRY // if we're in debug build log out the stat to a file for testing diff --git a/src/client/Xbox/Sentient/Include/SenClientSys.h b/src/client/Xbox/Sentient/Include/SenClientSys.h index dc33098b..405525a9 100644 --- a/src/client/Xbox/Sentient/Include/SenClientSys.h +++ b/src/client/Xbox/Sentient/Include/SenClientSys.h @@ -20,7 +20,7 @@ namespace Sentient ************************/ // Standardized callback that all asynchronous functions call either on completion or on failure. - typedef void (*SenSysCompletedCallback)( HRESULT taskResult, void *userCallbackData ); + typedef void (*SenSysCompletedCallback)( int taskResult, void *userCallbackData ); typedef void *(*SenSysMemAllocCallback)( size_t size ); diff --git a/src/client/Xbox/Sentient/Include/SenClientTypes.h b/src/client/Xbox/Sentient/Include/SenClientTypes.h index 1a1827a2..28aa55c1 100644 --- a/src/client/Xbox/Sentient/Include/SenClientTypes.h +++ b/src/client/Xbox/Sentient/Include/SenClientTypes.h @@ -95,7 +95,7 @@ namespace Sentient /// /// @related SentientCancel() /// - typedef VOID *SenHandle; + typedef void *SenHandle; // TODO: this really doesn't belong in SenCore's global types typedef UINT64 SenUGCID; @@ -111,7 +111,7 @@ namespace Sentient typedef XCONTENTDEVICEID SenContentDeviceID; #define SenContentDeviceID_Any XCONTENTDEVICE_ANY #else - typedef DWORD SenContentDeviceID; + typedef unsigned long SenContentDeviceID; #define SenContentDeviceID_Any 0 #endif @@ -122,39 +122,39 @@ namespace Sentient // // //=========================// - // Sentient HRESULT fields + // Sentient int fields #define SENTIENT_FACILITY 0x58 #define SENTIENT_E_FIRST_ERROR MAKE_HRESULT( SEVERITY_ERROR, SENTIENT_FACILITY, 0x0000 ) #define SENTIENT_S_FIRST_STATUS MAKE_HRESULT( SEVERITY_SUCCESS, SENTIENT_FACILITY, 0x0000 ) // Sentient Error codes - const HRESULT SENTIENT_E_NOT_INITIALIZED = SENTIENT_E_FIRST_ERROR + 0x0001; // 0x80580001 // title has tried to call a Sentient function when the library is not initialized. - const HRESULT SENTIENT_E_ALREADY_INITIALIZED = SENTIENT_E_FIRST_ERROR + 0x0002; // 0x80580002 // title has tried to initialize an already-initialized library. - const HRESULT SENTIENT_E_NO_UGC_PUBLISH_PRIVILEGE = SENTIENT_E_FIRST_ERROR + 0x0003; // 0x80580003 // user does not have the proper UGC upload/publish privilege flag set - const HRESULT SENTIENT_E_NO_UGC_USE_PRIVILEGE = SENTIENT_E_FIRST_ERROR + 0x0004; // 0x80580004 // user does not have the proper UGC download/use privilege flag set - const HRESULT SENTIENT_E_GUEST_ACCESS_VIOLATION = SENTIENT_E_FIRST_ERROR + 0x0005; // 0x80580005 // user is a guest, and therefore should not be accessing certain sentient features - const HRESULT SENTIENT_E_TOO_MANY_CALLS = SENTIENT_E_FIRST_ERROR + 0x0006; // 0x80580006 // title has called this API too frequently. Call has been discarded to avoid excessive server load. - const HRESULT SENTIENT_E_SERVER_ERROR = SENTIENT_E_FIRST_ERROR + 0x0007; // 0x80580007 // call generated an unhandled error on the server. Contact senhelp for assistance. - const HRESULT SENTIENT_E_TIME_OUT = SENTIENT_E_FIRST_ERROR + 0x0008; // 0x80580008 // the operation took too long to complete and has been abandoned. - const HRESULT SENTIENT_E_CANCELED = SENTIENT_E_FIRST_ERROR + 0x0009; // 0x80580009 // the operation was canceled by user sign-out or via an explicit call to SentientCancel - const HRESULT SENTIENT_E_FORBIDDEN = SENTIENT_E_FIRST_ERROR + 0x000a; // 0x8058000a // the server has indicated that the supplied user is not permitted to perform this operation. - const HRESULT SENTIENT_E_USERINDEX_IS_ANY = SENTIENT_E_FIRST_ERROR + 0x000b; // 0x8058000b // userIndex of ANY passed to a routine that requires a specific user. - const HRESULT SENTIENT_E_USERINDEX_IS_NONE = SENTIENT_E_FIRST_ERROR + 0x000c; // 0x8058000c // userIndex of NONE passed to a routine that requires a user. - const HRESULT SENTIENT_E_USERINDEX_IS_INVALID = SENTIENT_E_FIRST_ERROR + 0x000d; // 0x8058000d // userIndex is not a known value - const HRESULT SENTIENT_E_USERINDEX_IS_FOCUS = SENTIENT_E_FIRST_ERROR + 0x000e; // 0x8058000e // userIndex of FOCUS passed to a routine that requires a specific user. - const HRESULT SENTIENT_E_BUFFER_EXHAUSTED = SENTIENT_E_FIRST_ERROR + 0x000f; // 0x8058000f // no more space in buffer, operation was discarded - const HRESULT SENTIENT_E_RETRY_INVALID_DATA = SENTIENT_E_FIRST_ERROR + 0x0010; // 0x80580010 // retry; data was found to be invalid either after step or whole operation finished - const HRESULT SENTIENT_E_UNREACHABLE = SENTIENT_E_FIRST_ERROR + 0x0011; // 0x80580011 // Server was not reachable when called. Contact senhelp for assistance. - const HRESULT SENTIENT_E_RETRY_OVERLOADED = SENTIENT_E_FIRST_ERROR + 0x0012; // 0x80580012 // Server was overloaded when called. Retry later or contact senhelp for assistance. - const HRESULT SENTIENT_E_NO_UGC_DOWNLOAD_PRIVILEGE = SENTIENT_E_FIRST_ERROR + 0x0013; // 0x80580013 // user does not have the proper UGC download privilege flag set - const HRESULT SENTIENT_E_UGC_DOESNT_EXIST = SENTIENT_E_FIRST_ERROR + 0x0014; // 0x80580014 // requested action is aborted because the ugcid passed doesn't exist - const HRESULT SENTIENT_E_INVALID_UGC_PUBLISH_STATE = SENTIENT_E_FIRST_ERROR + 0x0015; // 0x80580015 // requested action is aborted because the UGC is in the wrong publish state + const int SENTIENT_E_NOT_INITIALIZED = SENTIENT_E_FIRST_ERROR + 0x0001; // 0x80580001 // title has tried to call a Sentient function when the library is not initialized. + const int SENTIENT_E_ALREADY_INITIALIZED = SENTIENT_E_FIRST_ERROR + 0x0002; // 0x80580002 // title has tried to initialize an already-initialized library. + const int SENTIENT_E_NO_UGC_PUBLISH_PRIVILEGE = SENTIENT_E_FIRST_ERROR + 0x0003; // 0x80580003 // user does not have the proper UGC upload/publish privilege flag set + const int SENTIENT_E_NO_UGC_USE_PRIVILEGE = SENTIENT_E_FIRST_ERROR + 0x0004; // 0x80580004 // user does not have the proper UGC download/use privilege flag set + const int SENTIENT_E_GUEST_ACCESS_VIOLATION = SENTIENT_E_FIRST_ERROR + 0x0005; // 0x80580005 // user is a guest, and therefore should not be accessing certain sentient features + const int SENTIENT_E_TOO_MANY_CALLS = SENTIENT_E_FIRST_ERROR + 0x0006; // 0x80580006 // title has called this API too frequently. Call has been discarded to avoid excessive server load. + const int SENTIENT_E_SERVER_ERROR = SENTIENT_E_FIRST_ERROR + 0x0007; // 0x80580007 // call generated an unhandled error on the server. Contact senhelp for assistance. + const int SENTIENT_E_TIME_OUT = SENTIENT_E_FIRST_ERROR + 0x0008; // 0x80580008 // the operation took too long to complete and has been abandoned. + const int SENTIENT_E_CANCELED = SENTIENT_E_FIRST_ERROR + 0x0009; // 0x80580009 // the operation was canceled by user sign-out or via an explicit call to SentientCancel + const int SENTIENT_E_FORBIDDEN = SENTIENT_E_FIRST_ERROR + 0x000a; // 0x8058000a // the server has indicated that the supplied user is not permitted to perform this operation. + const int SENTIENT_E_USERINDEX_IS_ANY = SENTIENT_E_FIRST_ERROR + 0x000b; // 0x8058000b // userIndex of ANY passed to a routine that requires a specific user. + const int SENTIENT_E_USERINDEX_IS_NONE = SENTIENT_E_FIRST_ERROR + 0x000c; // 0x8058000c // userIndex of NONE passed to a routine that requires a user. + const int SENTIENT_E_USERINDEX_IS_INVALID = SENTIENT_E_FIRST_ERROR + 0x000d; // 0x8058000d // userIndex is not a known value + const int SENTIENT_E_USERINDEX_IS_FOCUS = SENTIENT_E_FIRST_ERROR + 0x000e; // 0x8058000e // userIndex of FOCUS passed to a routine that requires a specific user. + const int SENTIENT_E_BUFFER_EXHAUSTED = SENTIENT_E_FIRST_ERROR + 0x000f; // 0x8058000f // no more space in buffer, operation was discarded + const int SENTIENT_E_RETRY_INVALID_DATA = SENTIENT_E_FIRST_ERROR + 0x0010; // 0x80580010 // retry; data was found to be invalid either after step or whole operation finished + const int SENTIENT_E_UNREACHABLE = SENTIENT_E_FIRST_ERROR + 0x0011; // 0x80580011 // Server was not reachable when called. Contact senhelp for assistance. + const int SENTIENT_E_RETRY_OVERLOADED = SENTIENT_E_FIRST_ERROR + 0x0012; // 0x80580012 // Server was overloaded when called. Retry later or contact senhelp for assistance. + const int SENTIENT_E_NO_UGC_DOWNLOAD_PRIVILEGE = SENTIENT_E_FIRST_ERROR + 0x0013; // 0x80580013 // user does not have the proper UGC download privilege flag set + const int SENTIENT_E_UGC_DOESNT_EXIST = SENTIENT_E_FIRST_ERROR + 0x0014; // 0x80580014 // requested action is aborted because the ugcid passed doesn't exist + const int SENTIENT_E_INVALID_UGC_PUBLISH_STATE = SENTIENT_E_FIRST_ERROR + 0x0015; // 0x80580015 // requested action is aborted because the UGC is in the wrong publish state // Sentient Status/Success codes - const HRESULT SENTIENT_S_NOT_SIGNED_IN_TO_LIVE = SENTIENT_S_FIRST_STATUS + 0x0003; // 0x00580003 - const HRESULT SENTIENT_S_INITIALIZING_CONNECTION = SENTIENT_S_FIRST_STATUS + 0x0004; // 0x00580004 - const HRESULT SENTIENT_S_SERVER_CONNECTION_FAILED = SENTIENT_S_FIRST_STATUS + 0x0005; // 0x00580005 - const HRESULT SENTIENT_S_OPERATION_IN_PROGRESS = SENTIENT_S_FIRST_STATUS + 0x0006; // 0x00580006 - const HRESULT SENTIENT_S_NEWER_BLOB_EXISTS = SENTIENT_S_FIRST_STATUS + 0x0007; // 0x00580007 // UGC can have different versions of MainDataBlob with Republish API + const int SENTIENT_S_NOT_SIGNED_IN_TO_LIVE = SENTIENT_S_FIRST_STATUS + 0x0003; // 0x00580003 + const int SENTIENT_S_INITIALIZING_CONNECTION = SENTIENT_S_FIRST_STATUS + 0x0004; // 0x00580004 + const int SENTIENT_S_SERVER_CONNECTION_FAILED = SENTIENT_S_FIRST_STATUS + 0x0005; // 0x00580005 + const int SENTIENT_S_OPERATION_IN_PROGRESS = SENTIENT_S_FIRST_STATUS + 0x0006; // 0x00580006 + const int SENTIENT_S_NEWER_BLOB_EXISTS = SENTIENT_S_FIRST_STATUS + 0x0007; // 0x00580007 // UGC can have different versions of MainDataBlob with Republish API } // namespace Sentient diff --git a/src/client/Xbox/Sentient/Include/SenClientUGC.h b/src/client/Xbox/Sentient/Include/SenClientUGC.h index da1b1f65..051ad42f 100644 --- a/src/client/Xbox/Sentient/Include/SenClientUGC.h +++ b/src/client/Xbox/Sentient/Include/SenClientUGC.h @@ -50,7 +50,7 @@ namespace Sentient /// @details All UGC functions require a uniquely provisioned UGC ID. /// /// @related All UGC related functions. - HRESULT SenUGCCreatePublishingUGCID( + int SenUGCCreatePublishingUGCID( int userIndex, SenUGCID *outResult, SenSysCompletedCallback userCallback, @@ -66,7 +66,7 @@ namespace Sentient SenHandle out_taskHandle; /// token for canceling the upload process INT8 percentageComplete; /// 1-100, how much percent is complete of upload process for blob size_t bytesCompleted; /// how many bytes have been successfully transmitted for the task - HRESULT lastStepResult; /// sentient client SDK HRESULT value + int lastStepResult; /// sentient client SDK int value int numRetries; /// does not reset between internal steps for a long-running task }; @@ -74,7 +74,7 @@ namespace Sentient // Method: SenUGCUpload // FullName: Sentient::SenUGCUpload // Access: public - // Returns: HRESULT + // Returns: int // Qualifier: // Parameter: int userIndex // Parameter: SenUGCID ugcID @@ -102,7 +102,7 @@ namespace Sentient // signature so you can get the running progress and a cancellation token // to abort the upload (allowing UI for the user, etc) //************************************ - HRESULT SenUGCUpload( + int SenUGCUpload( int userIndex, SenUGCID ugcID, const SenUGCMetaData *metaData, @@ -116,7 +116,7 @@ namespace Sentient // Method: SenUGCUploadMetadata // FullName: Sentient::SenUGCUploadMetadata // Access: public - // Returns: HRESULT + // Returns: int // Qualifier: // Parameter: int userIndex // Parameter: SenUGCID ugcID @@ -132,7 +132,7 @@ namespace Sentient // NOTE: If a creator uploads metadata again, it will overwrite the previous // stored blob with the new one. //************************************ - HRESULT SenUGCUploadMetadata( + int SenUGCUploadMetadata( int userIndex, SenUGCID ugcID, const SenUGCMetaData* metaData, @@ -143,7 +143,7 @@ namespace Sentient // Method: SenUGCUploadMainData // FullName: Sentient::SenUGCUploadMainData // Access: public - // Returns: HRESULT + // Returns: int // Qualifier: // Parameter: int userIndex // Parameter: SenUGCID ugcID @@ -176,7 +176,7 @@ namespace Sentient // NOTE: If a creator uploads a data blob again, it will overwrite the previous // stored blob with the new one. //************************************ - HRESULT SenUGCUploadMainDataBlob( + int SenUGCUploadMainDataBlob( int userIndex, SenUGCID ugcID, int mainDataBlobIndex, @@ -190,7 +190,7 @@ namespace Sentient // Method: SenUGCDelete // FullName: Sentient::SenUGCDelete // Access: public - // Returns: HRESULT + // Returns: int // Qualifier: // Parameter: int userIndex // Parameter: SenUGCID ugcID @@ -198,7 +198,7 @@ namespace Sentient // Parameter: void * userCallbackData // Delete the UGC - only the user that created the UGC can delete it. //************************************ - HRESULT SenUGCDelete( + int SenUGCDelete( int userIndex, SenUGCID ugcID, SenSysCompletedCallback userCallback, @@ -212,7 +212,7 @@ namespace Sentient // Method: SenUGCEnumerate // FullName: Sentient::SenUGCEnumerate // Access: public - // Returns: HRESULT + // Returns: int // Qualifier: // Parameter: int userIndex // Parameter: SenSysTitleID titleID @@ -234,7 +234,7 @@ namespace Sentient // Search the database for all the UGCs that match various search criteria. // outBuffer should be an preallocated array of [sizeof(SenUGCSearchResult)*maxNrResults] bytes. //************************************ - HRESULT SenUGCEnumerate( + int SenUGCEnumerate( int userIndex, SenSysTitleID titleID, SenUGCSortBy sortBy, @@ -247,7 +247,7 @@ namespace Sentient SenUGCDescriptor descriptor, int maxNrResults, SenUGCSearchResult *outBuffer, - UINT *outNrResults, + unsigned int *outNrResults, SenSysCompletedCallback userCallback, void* userCallbackData ); @@ -278,7 +278,7 @@ namespace Sentient /// of descriptors will perform an equality lookup on Descriptor /// /// @related SenUGCEnumerate - HRESULT SenUGCEnumerate( + int SenUGCEnumerate( int userIndex, SenSysTitleID titleID, SenUGCSortBy sortBy, @@ -292,7 +292,7 @@ namespace Sentient INT64 *descriptors, int maxNrResults, SenUGCSearchResult *outBuffer, - UINT *outNrResults, + unsigned int *outNrResults, SenSysCompletedCallback userCallback, void* userCallbackData ); @@ -324,7 +324,7 @@ namespace Sentient /// Note: The collection of descriptor bit masks is constrained to four. /// /// @related SenUGCEnumerate - HRESULT SenUGCEnumerateByDescriptorWithLogicalAnd( + int SenUGCEnumerateByDescriptorWithLogicalAnd( int userIndex, SenSysTitleID titleID, SenUGCSortBy sortBy, @@ -338,7 +338,7 @@ namespace Sentient INT64 *descriptors, int maxNrResults, SenUGCSearchResult *outBuffer, - UINT *outNrResults, + unsigned int *outNrResults, SenSysCompletedCallback userCallback, void* userCallbackData ); @@ -366,7 +366,7 @@ namespace Sentient /// /// @related SenUGCEnumerate __declspec(deprecated("Use SenUGCEnumerateByName() instead")) - HRESULT SenUGCEnumerate( + int SenUGCEnumerate( int userIndex, SenSysTitleID titleID, SenUGCType type, @@ -376,7 +376,7 @@ namespace Sentient const wchar_t *name, int maxNrResults, SenUGCSearchResult *outBuffer, - UINT *outNrResults, + unsigned int *outNrResults, SenSysCompletedCallback userCallback, void* userCallbackData ); @@ -403,7 +403,7 @@ namespace Sentient /// on a specific UGC Type as well as an author list type. Author List type of Everyone is NOT supported. /// /// @related SenUGCEnumerate - HRESULT SenUGCEnumerateByName( + int SenUGCEnumerateByName( int userIndex, SenSysTitleID titleID, SenUGCType type, @@ -414,7 +414,7 @@ namespace Sentient bool performWildCardLookup, int maxNrResults, SenUGCSearchResult *outBuffer, - UINT *outNrResults, + unsigned int *outNrResults, SenSysCompletedCallback userCallback, void* userCallbackData ); @@ -422,7 +422,7 @@ namespace Sentient // Method: SenUGCDownloadMetaData // FullName: Sentient::SenUGCDownloadMetaData // Access: public - // Returns: HRESULT + // Returns: int // Qualifier: // Parameter: int userIndex // Parameter: SenSysTitleID titleID @@ -437,7 +437,7 @@ namespace Sentient // outBuffer should be an preallocated array of [(sizeof(SenUGCDownloadedMetaData)+SenUGCMetaData::BlobSizeLimit)*nrUGCs] bytes. // This new signature is compatible with resubmission feature and 64-bit UGC Ids. //************************************ - HRESULT SenUGCDownloadMetaData( + int SenUGCDownloadMetaData( int userIndex, SenSysTitleID titleID, int nrUGCs, @@ -448,7 +448,7 @@ namespace Sentient void *userCallbackData ); __declspec(deprecated("Use signature with SenUGCDownloadedMetaData2.")) - HRESULT SenUGCDownloadMetaData( + int SenUGCDownloadMetaData( int userIndex, SenSysTitleID titleID, int nrUGCs, @@ -462,13 +462,13 @@ namespace Sentient // Method: SenUGCDownloadMainDataBlob // FullName: Sentient::SenUGCDownloadMainDataBlob // Access: public - // Returns: HRESULT + // Returns: int // Qualifier: // Parameter: int userIndex // Parameter: SenUGCID ugcID // Parameter: int mainDataBlobID // Parameter: size_t bufferSize - // Parameter: UINT blobVersion + // Parameter: unsigned int blobVersion // Parameter: void * outBuffer // Parameter: size_t * outSize // Parameter: SenSysCompletedCallback userCallback @@ -479,20 +479,20 @@ namespace Sentient // from SenUGCDownloadedMetaData. // outBuffer should be an preallocated array of bufferSize bytes. //************************************ - HRESULT SenUGCDownloadMainDataBlob( + int SenUGCDownloadMainDataBlob( int userIndex, SenSysTitleID titleID, SenUGCID ugcID, - UINT mainDataBlobIndex, + unsigned int mainDataBlobIndex, size_t bufferSize, - UINT blobVersion, + unsigned int blobVersion, void *outBuffer, size_t *outSize, SenSysCompletedCallback userCallback, void *userCallbackData ); __declspec(deprecated("Use signature with blobVersion.")) - HRESULT SenUGCDownloadMainDataBlob( + int SenUGCDownloadMainDataBlob( int userIndex, SenSysTitleID titleID, SenUGCID ugcID, @@ -507,13 +507,13 @@ namespace Sentient // Method: SenUGCDownloadMainDataBlob // FullName: Sentient::SenUGCDownloadMainDataBlob // Access: public - // Returns: HRESULT + // Returns: int // Qualifier: // Parameter: int userIndex // Parameter: SenUGCID ugcID // Parameter: int mainDataBlobID // Parameter: size_t bufferSize - // Parameter: UINT blobVersion + // Parameter: unsigned int blobVersion // Parameter: void * outBuffer // Parameter: size_t * outBytesReceived // Parameter: SenSysCompletedCallback userCallback @@ -531,13 +531,13 @@ namespace Sentient // which is available on the metadata information for the // main data blobs (via DownloadMetaData). //************************************ - HRESULT SenUGCDownloadMainDataBlob( + int SenUGCDownloadMainDataBlob( int userIndex, SenSysTitleID titleID, SenUGCID ugcID, - UINT mainDataBlobIndex, + unsigned int mainDataBlobIndex, size_t bufferSize, - UINT blobVersion, + unsigned int blobVersion, void *outBuffer, size_t *outBytesReceived, SenSysCompletedCallback userCallback, @@ -545,7 +545,7 @@ namespace Sentient SenUGCProgressInfo* out_progressInfo); __declspec(deprecated("Use signature with blobVersion.")) - HRESULT SenUGCDownloadMainDataBlob( + int SenUGCDownloadMainDataBlob( int userIndex, SenSysTitleID titleID, SenUGCID ugcID, @@ -565,17 +565,17 @@ namespace Sentient // Method: SenUGCSetReviewScore // FullName: Sentient::SenUGCSetReviewScore // Access: public - // Returns: HRESULT + // Returns: int // Qualifier: // Parameter: int userIndex // Parameter: SenUGCID ugcId // Parameter: SenUGCReviewScoreType type - // Parameter: UINT score + // Parameter: unsigned int score // Parameter: bool isFavorite // Parameter: SenSysCompletedCallback callback // Parameter: void * callbackData //************************************ - HRESULT SenUGCSetReviewScore( + int SenUGCSetReviewScore( int userIndex, SenUGCID ugcId, SenUGCReviewScoreType type, @@ -588,16 +588,16 @@ namespace Sentient // Method: SenUGCGetReviewScore // FullName: Sentient::SenUGCGetReviewScore // Access: public - // Returns: HRESULT + // Returns: int // Qualifier: // Parameter: int userIndex // Parameter: SenUGCID ugcId // Parameter: SenUGCReviewScoreType type - // Parameter: UINT * out_score + // Parameter: unsigned int * out_score // Parameter: SenSysCompletedCallback callback // Parameter: void * callbackData //************************************ - HRESULT SenUGCGetReviewScore( + int SenUGCGetReviewScore( int userIndex, SenUGCID ugcId, SenUGCReviewScoreType type, @@ -609,7 +609,7 @@ namespace Sentient // Method: SenUGCSetFavoriteFlag // FullName: Sentient::SenUGCSetFavoriteFlag // Access: public - // Returns: HRESULT + // Returns: int // Qualifier: // Parameter: int userIndex // Parameter: SenSysTitleID titleID @@ -620,11 +620,11 @@ namespace Sentient // Users can flag the UGCs that they really like, which can be used for // the search results //************************************ - HRESULT SenUGCSetFavoriteFlag( + int SenUGCSetFavoriteFlag( int userIndex, SenSysTitleID titleID, SenUGCID ugcID, - BOOL isFavorite, + bool isFavorite, SenSysCompletedCallback userCallback, void *userCallbackData ); @@ -632,22 +632,22 @@ namespace Sentient // Method: SenUGCGetFavoriteFlag // FullName: Sentient::SenUGCGetFavoriteFlag // Access: public - // Returns: HRESULT + // Returns: int // Qualifier: // Parameter: int userIndex // Parameter: SenSysTitleID titleID // Parameter: SenUGCID ugcID - // Parameter: BOOL * outResult + // Parameter: bool * outResult // Parameter: SenSysCompletedCallback userCallback // Parameter: void * userCallbackData // Users can flag the UGCs that they really like, which can be used for // the search results //************************************ - HRESULT SenUGCGetFavoriteFlag( + int SenUGCGetFavoriteFlag( int userIndex, SenSysTitleID titleID, SenUGCID ugcID, - BOOL *outResult, + bool *outResult, SenSysCompletedCallback userCallback, void *userCallbackData ); @@ -655,7 +655,7 @@ namespace Sentient // Method: SenUGCGetFriendFavoriteCount // FullName: Sentient::SenUGCGetFriendFavoriteCount // Access: public - // Returns: HRESULT + // Returns: int // Qualifier: // Parameter: int userIndex // Parameter: SenSysTitleID titleID @@ -666,7 +666,7 @@ namespace Sentient // Find out how many friends of the user have flagged this UGC as // a favorite (inclusive the user's favorite flag also) //************************************ - HRESULT SenUGCGetFriendFavoriteCount( + int SenUGCGetFriendFavoriteCount( int userIndex, SenSysTitleID titleID, SenUGCID ugcID, @@ -678,7 +678,7 @@ namespace Sentient // Method: SenUGCAddToCustomCounters // FullName: Sentient::SenUGCAddToCustomCounters // Access: public - // Returns: HRESULT + // Returns: int // Qualifier: // Parameter: int userIndex // Parameter: SenSysTitleID titleID @@ -690,7 +690,7 @@ namespace Sentient // servers, to count up a few basic stats per UGC (number of deaths, // number of enemies killed, total playtime etc.) //************************************ - HRESULT SenUGCAddToCustomCounters( + int SenUGCAddToCustomCounters( int userIndex, SenSysTitleID titleID, SenUGCID ugcID, @@ -734,7 +734,7 @@ namespace Sentient /// being offensive. /// /// @related - HRESULT SenUGCSetOffensivenessFlag( + int SenUGCSetOffensivenessFlag( int userIndex, SenUGCID ugcID, SenUGCOffensivenessFlag offensivenessFlag, @@ -771,10 +771,10 @@ namespace Sentient /// @related SenUGCCreatePublishingUGCID() /// @related SenUGCSetOffensivenessFlag() /// @related SenUGCPublish() - HRESULT SenUGCIsBanned( + int SenUGCIsBanned( int userIndex, SenUGCID ugcID, - BOOL *out_result, + bool *out_result, SenSysCompletedCallback userCallback, void *userCallbackData ); @@ -829,13 +829,13 @@ namespace Sentient /// @details /// /// @related SenUGCEnumerateFeeds() - HRESULT SenUGCGetFeed( + int SenUGCGetFeed( int userIndex, SenSysTitleID titleID, SenUGCFeedType feedType, size_t maxNumberOfFeedItems, SenUGCFeedItem *out_buffer, - UINT *out_buffersize, + unsigned int *out_buffersize, SenSysCompletedCallback userCallback, void *userCallbackData ); @@ -876,7 +876,7 @@ namespace Sentient /// @details /// /// @related SenUGCGetFeed() - HRESULT SenUGCEnumerateFeeds( + int SenUGCEnumerateFeeds( int userIndex, size_t maxResults, SenUGCFeedInfo *out_feedInfo, @@ -918,7 +918,7 @@ namespace Sentient /// This is the preferred way of creating UGC Leaderboards. /// /// @related SenCreateLeaderboard() - HRESULT SenUGCPublish( + int SenUGCPublish( int userIndex, SenUGCID ugcID, const SenLeaderboardDefinition *leaderboardDefinition, @@ -948,7 +948,7 @@ namespace Sentient /// The user making the call must be the author of the UGC item. /// /// @related SenUGCPublish() - HRESULT SenUGCRepublish( + int SenUGCRepublish( int userIndex, SenUGCID ugcID, SenSysCompletedCallback userCallback, diff --git a/src/client/Xbox/Sentient/Include/SenClientUGCLeaderboards.h b/src/client/Xbox/Sentient/Include/SenClientUGCLeaderboards.h index 847e5101..2ce2833a 100644 --- a/src/client/Xbox/Sentient/Include/SenClientUGCLeaderboards.h +++ b/src/client/Xbox/Sentient/Include/SenClientUGCLeaderboards.h @@ -57,7 +57,7 @@ namespace Sentient /// @details Creates a new Leaderboard based on the supplied Leaderboard Definition. /// /// @related SenCreateLeaderboard() - HRESULT SenCreateLeaderboard( + int SenCreateLeaderboard( int userIndex, const SenLeaderboardDefinition &definition, const void *metadataBlob, @@ -99,18 +99,18 @@ namespace Sentient /// /// @related SenSetUserLeaderboardValue() __declspec(deprecated("This function is deprecated, and should not be used")) - HRESULT SenSetUserLeaderboardValue( + int SenSetUserLeaderboardValue( int userIndex, SenLeaderboardId leaderboardId, SenLeaderboardEntryValue value, SenSysCompletedCallback callback, void *callbackData ); - HRESULT SenSetUserLeaderboardValue( + int SenSetUserLeaderboardValue( int userIndex, SenLeaderboardId leaderboardId, SenLeaderboardEntryValue value, - LONGLONG descriptor, + int64_t descriptor, SenSysCompletedCallback callback, void *callbackData ); @@ -152,7 +152,7 @@ namespace Sentient /// /// @related SenSetUserLeaderboardValue() __declspec(deprecated("This function is deprecated, and should not be used")) - HRESULT SenSetUserLeaderboardValue( + int SenSetUserLeaderboardValue( int userIndex, SenLeaderboardId leaderboardId, SenLeaderboardEntryValue value, @@ -161,11 +161,11 @@ namespace Sentient SenSysCompletedCallback callback, void *callbackData ); - HRESULT SenSetUserLeaderboardValue( + int SenSetUserLeaderboardValue( int userIndex, SenLeaderboardId leaderboardId, SenLeaderboardEntryValue value, - LONGLONG descriptor, + int64_t descriptor, const void *metadataBlob, size_t metadataBlobSize, SenSysCompletedCallback callback, @@ -222,7 +222,7 @@ namespace Sentient /// logged in at the specified index. /// /// @related SenGetLeaderboardEntry() - HRESULT SenGetLeaderboardEntry( + int SenGetLeaderboardEntry( int userIndex, SenLeaderboardId leaderboardId, SenLeaderboardMetadataFlag leaderboardFlag, @@ -279,7 +279,7 @@ namespace Sentient /// @details Retrieves a single Leaderboard Entry for a given actor. /// /// @related SenGetLeaderboardEntry() - HRESULT SenGetLeaderboardEntry( + int SenGetLeaderboardEntry( int userIndex, SenLeaderboardActorId actorId, SenLeaderboardId leaderboardId, @@ -340,7 +340,7 @@ namespace Sentient /// Specific values include: /// /// @details Returns a ranked Leaderboard. - HRESULT SenGetLeaderboardFriends( + int SenGetLeaderboardFriends( int userIndex, SenLeaderboardId leaderboardId, SenLeaderboardMetadataFlag leaderboardFlag, @@ -385,7 +385,7 @@ namespace Sentient /// Specific values include: /// /// @details Returns a ranked Leaderboard of all the top Leaderboard Entries. - HRESULT SenGetLeaderboardTop( + int SenGetLeaderboardTop( int userIndex, SenLeaderboardId leaderboardId, size_t maxLeaderboardEntries, diff --git a/src/client/Xbox/Sentient/Include/SenClientUGCTypes.h b/src/client/Xbox/Sentient/Include/SenClientUGCTypes.h index 6d1056ff..060a3f1f 100644 --- a/src/client/Xbox/Sentient/Include/SenClientUGCTypes.h +++ b/src/client/Xbox/Sentient/Include/SenClientUGCTypes.h @@ -57,7 +57,7 @@ namespace Sentient SenUGCMetaDataFlags_FirstCustom = 0X00000100 }; - typedef ULONGLONG SenLeaderboardId; + typedef uint64_t SenLeaderboardId; struct SenUGCMetaData { @@ -66,7 +66,7 @@ namespace Sentient #pragma warning ( disable : 4996 ) // @TODO - Removed once Int16 Descriptors are deprecated memset(descriptors, 0, sizeof(SenUGCDescriptor) * NrUgcDescriptors); #pragma warning ( default : 4996 ) - memset(descriptors2, 0, sizeof(__int64) * NrUgcDescriptors); + memset(descriptors2, 0, sizeof(int64_t) * NrUgcDescriptors); } SenUGCID parentID; @@ -83,7 +83,7 @@ namespace Sentient __declspec(deprecated("Descriptors have increased in size (from Int16 to Int64). Please Use descriptors2 instead")) SenUGCDescriptor descriptors[NrUgcDescriptors]; - __int64 descriptors2[NrUgcDescriptors]; + int64_t descriptors2[NrUgcDescriptors]; static const int BlobSizeLimit = 1024; size_t metaDataBlobSize; @@ -124,15 +124,15 @@ namespace Sentient struct SenUGCBlobMetaData { size_t Size; - UINT Version; + unsigned int Version; }; struct SenUGCStatsMetaData { - UINT AverageReviewScore; - UINT NumberOfReviews; - UINT NumberOfFavorites; // number of times tagged as a favorite item - UINT NumDownloads; // how many times any blob has been downloaded + unsigned int AverageReviewScore; + unsigned int NumberOfReviews; + unsigned int NumberOfFavorites; // number of times tagged as a favorite item + unsigned int NumDownloads; // how many times any blob has been downloaded SenLeaderboardId LeaderboardId; INT64 CustomCounters[SenUGCDownloadedMetaData_NrCustomCounters]; }; @@ -152,7 +152,7 @@ namespace Sentient SYSTEMTIME PublishedDate; // anytime it's published/republished SenUGCPublishState PublishState; - UINT Revision; + unsigned int Revision; SenUGCBlobMetaData BlobInfo[SenUGCMainData_NrBlobs]; // size and version of each blob, 0's if not present SenUGCStatsMetaData StatsInfo; // stats of ugc item: counters, aggregates, etc @@ -211,8 +211,8 @@ namespace Sentient }; // ***** Leaderboard types - typedef __int64 SenLeaderboardEntryValue; - typedef ULONGLONG SenLeaderboardActorId; + typedef int64_t SenLeaderboardEntryValue; + typedef uint64_t SenLeaderboardActorId; enum SenLeaderboardSortType { @@ -241,7 +241,7 @@ namespace Sentient { static const int NameLength = 50; - WCHAR Name[NameLength]; + wchar_t Name[NameLength]; SenLeaderboardSortType SortType; }; @@ -249,7 +249,7 @@ namespace Sentient { SenLeaderboardActorId ActorId; SenLeaderboardEntryValue Value; - LONGLONG Descriptor; + int64_t Descriptor; unsigned int Rank; size_t metaDataBlobSize; size_t reserved_metaDataBlobCount; diff --git a/src/client/Xbox/Sentient/Include/SenClientUser.h b/src/client/Xbox/Sentient/Include/SenClientUser.h index cf3ef0b3..b1d8ae0a 100644 --- a/src/client/Xbox/Sentient/Include/SenClientUser.h +++ b/src/client/Xbox/Sentient/Include/SenClientUser.h @@ -65,7 +65,7 @@ namespace Sentient /// E_FAIL: Failed to spawn server call. /// S_OK: Server call spawned successfully. /// - HRESULT SenUserIsInRole( + int SenUserIsInRole( int userIndex, SenUserRole role, bool *out_isInRole, @@ -95,7 +95,7 @@ namespace Sentient /// E_FAIL: Failed to spawn server call. /// S_OK: Server call spawned successfully. /// - HRESULT SenUserIsInRole( + int SenUserIsInRole( PlayerUID xuid, SenUserRole role, bool *out_isInRole, diff --git a/src/client/Xbox/Sentient/Include/SenClientXML.h b/src/client/Xbox/Sentient/Include/SenClientXML.h index d1ebc051..55282c97 100644 --- a/src/client/Xbox/Sentient/Include/SenClientXML.h +++ b/src/client/Xbox/Sentient/Include/SenClientXML.h @@ -61,7 +61,7 @@ namespace Sentient /// /// @related SenXMLDestroy() /// - HRESULT SenXMLParse( + int SenXMLParse( const char *source, SenXML *out_senXML ); @@ -79,7 +79,7 @@ namespace Sentient /// /// @related SenXMLParse() /// - HRESULT SenXMLDestroy( + int SenXMLDestroy( SenXML &senXML ); } // namespace Sentient diff --git a/src/client/Xbox/Sentient/SentientManager.cpp b/src/client/Xbox/Sentient/SentientManager.cpp index 6678f051..6e9ac515 100644 --- a/src/client/Xbox/Sentient/SentientManager.cpp +++ b/src/client/Xbox/Sentient/SentientManager.cpp @@ -17,12 +17,12 @@ // Global instance CTelemetryManager *TelemetryManager = new CSentientManager(); -HRESULT CSentientManager::Init() +int CSentientManager::Init() { Sentient::SenSysTitleID sentitleID; sentitleID = (Sentient::SenSysTitleID)TITLEID_MINECRAFT; - HRESULT hr = SentientInitialize( sentitleID ); + int hr = SentientInitialize( sentitleID ); m_lastHeartbeat = m_initialiseTime; @@ -31,12 +31,12 @@ HRESULT CSentientManager::Init() return hr; } -HRESULT CSentientManager::Tick() +int CSentientManager::Tick() { - HRESULT hr = S_OK; + int hr = S_OK; // Update Sentient System - HRESULT sentientResult = Sentient::SentientUpdate(); + int sentientResult = Sentient::SentientUpdate(); switch(sentientResult) { @@ -50,7 +50,7 @@ HRESULT CSentientManager::Tick() if(currentTime - m_lastHeartbeat > 60) { m_lastHeartbeat = currentTime; - for(DWORD i = 0; i < XUSER_MAX_COUNT; ++i) + for(unsigned long i = 0; i < XUSER_MAX_COUNT; ++i) { if(Minecraft::GetInstance()->localplayers[i] != NULL) { @@ -61,7 +61,7 @@ HRESULT CSentientManager::Tick() if(m_bFirstFlush) { - for(DWORD i = 0; i < XUSER_MAX_COUNT; ++i) + for(unsigned long i = 0; i < XUSER_MAX_COUNT; ++i) { if(Minecraft::GetInstance()->localplayers[i] != NULL && m_fLevelStartTime[i] - currentTime > 60) { @@ -115,29 +115,29 @@ HRESULT CSentientManager::Tick() return hr; } -HRESULT CSentientManager::Flush() +int CSentientManager::Flush() { m_bFirstFlush = false; return Sentient::SentientFlushStats(); } -BOOL CSentientManager::RecordPlayerSessionStart(DWORD dwUserId) +bool CSentientManager::RecordPlayerSessionStart(unsigned long dwUserId) { - return SenStatPlayerSessionStart( dwUserId, GetSecondsSinceInitialize(), GetMode(dwUserId), GetSubMode(dwUserId), GetLevelId(dwUserId), GetSubLevelId(dwUserId), GetTitleBuildId(), 0, 0, 0, (INT)app.getDeploymentType() ); + return SenStatPlayerSessionStart( dwUserId, GetSecondsSinceInitialize(), GetMode(dwUserId), GetSubMode(dwUserId), GetLevelId(dwUserId), GetSubLevelId(dwUserId), GetTitleBuildId(), 0, 0, 0, (int)app.getDeploymentType() ); } -BOOL CSentientManager::RecordPlayerSessionExit(DWORD dwUserId, int _) +bool CSentientManager::RecordPlayerSessionExit(unsigned long dwUserId, int _) { return SenStatPlayerSessionExit( dwUserId, GetSecondsSinceInitialize(), GetMode(dwUserId), GetSubMode(dwUserId), GetLevelId(dwUserId), GetSubLevelId(dwUserId) ); } -BOOL CSentientManager::RecordHeartBeat(DWORD dwUserId) +bool CSentientManager::RecordHeartBeat(unsigned long dwUserId) { // Handled elswhere return false; } -BOOL CSentientManager::RecordLevelStart(DWORD dwUserId, ESen_FriendOrMatch friendsOrMatch, ESen_CompeteOrCoop competeOrCoop, int difficulty, DWORD numberOfLocalPlayers, DWORD numberOfOnlinePlayers) +bool CSentientManager::RecordLevelStart(unsigned long dwUserId, ESen_FriendOrMatch friendsOrMatch, ESen_CompeteOrCoop competeOrCoop, int difficulty, unsigned long numberOfLocalPlayers, unsigned long numberOfOnlinePlayers) { if(dwUserId == ProfileManager.GetPrimaryPad() ) m_bFirstFlush = true; @@ -146,87 +146,87 @@ BOOL CSentientManager::RecordLevelStart(DWORD dwUserId, ESen_FriendOrMatch frien return SenStatLevelStart( dwUserId, GetSecondsSinceInitialize(), GetMode(dwUserId), GetSubMode(dwUserId), GetLevelId(dwUserId), GetSubLevelId(dwUserId), GetLevelInstanceID(), GetMultiplayerInstanceID(), GetSingleOrMultiplayer(), friendsOrMatch, competeOrCoop, GetDifficultyLevel(difficulty), numberOfLocalPlayers, numberOfOnlinePlayers, GetLicense(), GetDefaultGameControls(), GetAudioSettings(dwUserId), 0, 0 ); } -BOOL CSentientManager::RecordLevelExit(DWORD dwUserId, ESen_LevelExitStatus levelExitStatus) +bool CSentientManager::RecordLevelExit(unsigned long dwUserId, ESen_LevelExitStatus levelExitStatus) { float levelDuration = app.getAppTime() - m_fLevelStartTime[dwUserId]; - return SenStatLevelExit( dwUserId, GetSecondsSinceInitialize(), GetMode(dwUserId), GetSubMode(dwUserId), GetLevelId(dwUserId), GetSubLevelId(dwUserId), GetLevelInstanceID(), GetMultiplayerInstanceID(), levelExitStatus, GetLevelExitProgressStat1(), GetLevelExitProgressStat2(), (INT)levelDuration ); + return SenStatLevelExit( dwUserId, GetSecondsSinceInitialize(), GetMode(dwUserId), GetSubMode(dwUserId), GetLevelId(dwUserId), GetSubLevelId(dwUserId), GetLevelInstanceID(), GetMultiplayerInstanceID(), levelExitStatus, GetLevelExitProgressStat1(), GetLevelExitProgressStat2(), (int)levelDuration ); } -BOOL CSentientManager::RecordLevelSaveOrCheckpoint(DWORD dwUserId, INT saveOrCheckPointID, INT saveSizeInBytes) +bool CSentientManager::RecordLevelSaveOrCheckpoint(unsigned long dwUserId, int saveOrCheckPointID, int saveSizeInBytes) { float levelDuration = app.getAppTime() - m_fLevelStartTime[dwUserId]; - return SenStatLevelSaveOrCheckpoint( dwUserId, GetSecondsSinceInitialize(), GetMode(dwUserId), GetSubMode(dwUserId), GetLevelId(dwUserId), GetSubLevelId(dwUserId), GetLevelInstanceID(), GetMultiplayerInstanceID(), GetLevelExitProgressStat1(), GetLevelExitProgressStat2(), (INT)levelDuration, saveOrCheckPointID, saveSizeInBytes ); + return SenStatLevelSaveOrCheckpoint( dwUserId, GetSecondsSinceInitialize(), GetMode(dwUserId), GetSubMode(dwUserId), GetLevelId(dwUserId), GetSubLevelId(dwUserId), GetLevelInstanceID(), GetMultiplayerInstanceID(), GetLevelExitProgressStat1(), GetLevelExitProgressStat2(), (int)levelDuration, saveOrCheckPointID, saveSizeInBytes ); } -BOOL CSentientManager::RecordLevelResume(DWORD dwUserId, ESen_FriendOrMatch friendsOrMatch, ESen_CompeteOrCoop competeOrCoop, int difficulty, DWORD numberOfLocalPlayers, DWORD numberOfOnlinePlayers, INT saveOrCheckPointID) +bool CSentientManager::RecordLevelResume(unsigned long dwUserId, ESen_FriendOrMatch friendsOrMatch, ESen_CompeteOrCoop competeOrCoop, int difficulty, unsigned long numberOfLocalPlayers, unsigned long numberOfOnlinePlayers, int saveOrCheckPointID) { return SenStatLevelResume( dwUserId, GetSecondsSinceInitialize(), GetMode(dwUserId), GetSubMode(dwUserId), GetLevelId(dwUserId), GetSubLevelId(dwUserId), GetLevelInstanceID(), GetMultiplayerInstanceID(), GetSingleOrMultiplayer(), friendsOrMatch, competeOrCoop, GetDifficultyLevel(difficulty), numberOfLocalPlayers, numberOfOnlinePlayers, GetLicense(), GetDefaultGameControls(), saveOrCheckPointID, GetAudioSettings(dwUserId), 0, 0 ); } -BOOL CSentientManager::RecordPauseOrInactive(DWORD dwUserId) +bool CSentientManager::RecordPauseOrInactive(unsigned long dwUserId) { return SenStatPauseOrInactive( dwUserId, GetSecondsSinceInitialize(), GetMode(dwUserId), GetSubMode(dwUserId), GetLevelId(dwUserId), GetSubLevelId(dwUserId), GetLevelInstanceID(), GetMultiplayerInstanceID() ); } -BOOL CSentientManager::RecordUnpauseOrActive(DWORD dwUserId) +bool CSentientManager::RecordUnpauseOrActive(unsigned long dwUserId) { return SenStatUnpauseOrActive( dwUserId, GetSecondsSinceInitialize(), GetMode(dwUserId), GetSubMode(dwUserId), GetLevelId(dwUserId), GetSubLevelId(dwUserId), GetLevelInstanceID(), GetMultiplayerInstanceID() ); } -BOOL CSentientManager::RecordMenuShown(DWORD dwUserId, INT menuID, INT optionalMenuSubID) +bool CSentientManager::RecordMenuShown(unsigned long dwUserId, int menuID, int optionalMenuSubID) { return SenStatMenuShown( dwUserId, GetSecondsSinceInitialize(), GetMode(dwUserId), GetSubMode(dwUserId), GetLevelId(dwUserId), GetSubLevelId(dwUserId), menuID, optionalMenuSubID, GetLevelInstanceID(), GetMultiplayerInstanceID() ); } -BOOL CSentientManager::RecordAchievementUnlocked(DWORD dwUserId, INT achievementID, INT achievementGamerscore) +bool CSentientManager::RecordAchievementUnlocked(unsigned long dwUserId, int achievementID, int achievementGamerscore) { return SenStatAchievementUnlocked( dwUserId, GetSecondsSinceInitialize(), GetMode(dwUserId), GetSubMode(dwUserId), GetLevelId(dwUserId), GetSubLevelId(dwUserId), GetLevelInstanceID(), GetMultiplayerInstanceID(), achievementID, achievementGamerscore ); } -BOOL CSentientManager::RecordMediaShareUpload(DWORD dwUserId, ESen_MediaDestination mediaDestination, ESen_MediaType mediaType) +bool CSentientManager::RecordMediaShareUpload(unsigned long dwUserId, ESen_MediaDestination mediaDestination, ESen_MediaType mediaType) { return SenStatMediaShareUpload( dwUserId, GetSecondsSinceInitialize(), GetMode(dwUserId), GetSubMode(dwUserId), GetLevelId(dwUserId), GetSubLevelId(dwUserId), GetLevelInstanceID(), GetMultiplayerInstanceID(), mediaDestination, mediaType ); } -BOOL CSentientManager::RecordUpsellPresented(DWORD dwUserId, ESen_UpsellID upsellId, INT marketplaceOfferID) +bool CSentientManager::RecordUpsellPresented(unsigned long dwUserId, ESen_UpsellID upsellId, int marketplaceOfferID) { return SenStatUpsellPresented( dwUserId, GetSecondsSinceInitialize(), GetMode(dwUserId), GetSubMode(dwUserId), GetLevelId(dwUserId), GetSubLevelId(dwUserId), GetLevelInstanceID(), GetMultiplayerInstanceID(), upsellId, marketplaceOfferID ); } -BOOL CSentientManager::RecordUpsellResponded(DWORD dwUserId, ESen_UpsellID upsellId, INT marketplaceOfferID, ESen_UpsellOutcome upsellOutcome) +bool CSentientManager::RecordUpsellResponded(unsigned long dwUserId, ESen_UpsellID upsellId, int marketplaceOfferID, ESen_UpsellOutcome upsellOutcome) { return SenStatUpsellResponded( dwUserId, GetSecondsSinceInitialize(), GetMode(dwUserId), GetSubMode(dwUserId), GetLevelId(dwUserId), GetSubLevelId(dwUserId), GetLevelInstanceID(), GetMultiplayerInstanceID(), upsellId, marketplaceOfferID, upsellOutcome ); } -BOOL CSentientManager::RecordPlayerDiedOrFailed(DWORD dwUserId, INT lowResMapX, INT lowResMapY, INT lowResMapZ, INT mapID, INT playerWeaponID, INT enemyWeaponID, ETelemetryChallenges enemyTypeID) +bool CSentientManager::RecordPlayerDiedOrFailed(unsigned long dwUserId, int lowResMapX, int lowResMapY, int lowResMapZ, int mapID, int playerWeaponID, int enemyWeaponID, ETelemetryChallenges enemyTypeID) { - INT secs = GetSecondsSinceInitialize(); + int secs = GetSecondsSinceInitialize(); return SenStatPlayerDiedOrFailed( dwUserId, GetMode(dwUserId), GetSubMode(dwUserId), GetLevelId(dwUserId), GetSubLevelId(dwUserId), GetLevelInstanceID(), GetMultiplayerInstanceID(), lowResMapX, lowResMapY, lowResMapZ, mapID, playerWeaponID, enemyWeaponID, enemyTypeID, secs, secs ); } -BOOL CSentientManager::RecordEnemyKilledOrOvercome(DWORD dwUserId, INT lowResMapX, INT lowResMapY, INT lowResMapZ, INT mapID, INT playerWeaponID, INT enemyWeaponID, ETelemetryChallenges enemyTypeID) +bool CSentientManager::RecordEnemyKilledOrOvercome(unsigned long dwUserId, int lowResMapX, int lowResMapY, int lowResMapZ, int mapID, int playerWeaponID, int enemyWeaponID, ETelemetryChallenges enemyTypeID) { - INT secs = GetSecondsSinceInitialize(); + int secs = GetSecondsSinceInitialize(); return SenStatEnemyKilledOrOvercome( dwUserId, GetMode(dwUserId), GetSubMode(dwUserId), GetLevelId(dwUserId), GetSubLevelId(dwUserId), GetLevelInstanceID(), GetMultiplayerInstanceID(), lowResMapX, lowResMapY, lowResMapZ, mapID, playerWeaponID, enemyWeaponID, enemyTypeID, secs, secs ); } -BOOL CSentientManager::RecordSkinChanged(DWORD dwUserId, DWORD dwSkinId) +bool CSentientManager::RecordSkinChanged(unsigned long dwUserId, unsigned long dwSkinId) { return SenStatSkinChanged( dwUserId, GetSecondsSinceInitialize(), GetMode(dwUserId), GetSubMode(dwUserId), GetLevelId(dwUserId), GetSubLevelId(dwUserId), GetLevelInstanceID(), GetMultiplayerInstanceID(), dwSkinId ); } -BOOL CSentientManager::RecordBanLevel(DWORD dwUserId) +bool CSentientManager::RecordBanLevel(unsigned long dwUserId) { return SenStatBanLevel( dwUserId, GetSecondsSinceInitialize(), GetMode(dwUserId), GetSubMode(dwUserId), GetLevelId(dwUserId), GetSubLevelId(dwUserId), GetLevelInstanceID(), GetMultiplayerInstanceID() ); } -BOOL CSentientManager::RecordUnBanLevel(DWORD dwUserId) +bool CSentientManager::RecordUnBanLevel(unsigned long dwUserId) { return SenStatUnBanLevel( dwUserId, GetSecondsSinceInitialize(), GetMode(dwUserId), GetSubMode(dwUserId), GetLevelId(dwUserId), GetSubLevelId(dwUserId), GetLevelInstanceID(), GetMultiplayerInstanceID() ); } -BOOL CSentientManager::RecordTexturePackLoaded(DWORD dwUserId, INT texturePackId, INT purchased) +bool CSentientManager::RecordTexturePackLoaded(unsigned long dwUserId, int texturePackId, int purchased) { return SenStatTexturePackChanged( dwUserId, GetSecondsSinceInitialize(), GetMode(dwUserId), GetSubMode(dwUserId), GetLevelId(dwUserId), GetSubLevelId(dwUserId), GetLevelInstanceID(), GetMultiplayerInstanceID(), texturePackId, purchased ); } @@ -238,9 +238,9 @@ Title needs to track this and report it as a property. These times will be used to create timelines and understand durations. This should be tracked independently of saved games (restoring a save should not reset the seconds since initialize) */ -INT CSentientManager::GetSecondsSinceInitialize() +int CSentientManager::GetSecondsSinceInitialize() { - return (INT)(app.getAppTime() - m_initialiseTime); + return (int)(app.getAppTime() - m_initialiseTime); } /* @@ -251,9 +251,9 @@ The intent is to allow teams to capture data on the highest level categories of For example, a game mode could be the name of the specific mini game (eg: golf vs darts) or a specific multiplayer mode (eg: hoard vs beast.) ModeID = 0 means undefined or unknown. The intent is to answer the question "How are players playing your game?" */ -INT CSentientManager::GetMode(DWORD dwUserId) +int CSentientManager::GetMode(unsigned long dwUserId) { - INT mode = (INT)eTelem_ModeId_Undefined; + int mode = (int)eTelem_ModeId_Undefined; Minecraft *pMinecraft = Minecraft::GetInstance(); @@ -263,15 +263,15 @@ INT CSentientManager::GetMode(DWORD dwUserId) if (gameType->isSurvival()) { - mode = (INT)eTelem_ModeId_Survival; + mode = (int)eTelem_ModeId_Survival; } else if (gameType->isCreative()) { - mode = (INT)eTelem_ModeId_Creative; + mode = (int)eTelem_ModeId_Creative; } else { - mode = (INT)eTelem_ModeId_Undefined; + mode = (int)eTelem_ModeId_Undefined; } } return mode; @@ -284,17 +284,17 @@ For titles that have sub-modes (Sports/Football). Mode is always an indicator of "How is the player choosing to play my game?" so these do not have to be consecutive. LevelIDs and SubLevelIDs can be reused as they will always be paired with a Mode/SubModeID, Mode should be unique - SubMode can be shared between modes. */ -INT CSentientManager::GetSubMode(DWORD dwUserId) +int CSentientManager::GetSubMode(unsigned long dwUserId) { - INT subMode = (INT)eTelem_SubModeId_Undefined; + int subMode = (int)eTelem_SubModeId_Undefined; if(Minecraft::GetInstance()->isTutorial()) { - subMode = (INT)eTelem_SubModeId_Tutorial; + subMode = (int)eTelem_SubModeId_Tutorial; } else { - subMode = (INT)eTelem_SubModeId_Normal; + subMode = (int)eTelem_SubModeId_Normal; } return subMode; @@ -308,11 +308,11 @@ The intent is that level start and ends do not occur more than every 2 minutes o Levels are unique only within a given modeID - so you can have a ModeID =1, LevelID =1 and a different ModeID=2, LevelID = 1 indicate two completely different levels. LevelID = 0 means undefined or unknown. */ -INT CSentientManager::GetLevelId(DWORD dwUserId) +int CSentientManager::GetLevelId(unsigned long dwUserId) { - INT levelId = (INT)eTelem_LevelId_Undefined; + int levelId = (int)eTelem_LevelId_Undefined; - levelId = (INT)eTelem_LevelId_PlayerGeneratedLevel; + levelId = (int)eTelem_LevelId_PlayerGeneratedLevel; return levelId; } @@ -323,9 +323,9 @@ For titles that have sub-levels. Level is always an indicator of "How far has the player progressed." so when possible these should be consecutive or at least monotonically increasing. LevelIDs and SubLevelIDs can be reused as they will always be paired with a Mode/SubModeID */ -INT CSentientManager::GetSubLevelId(DWORD dwUserId) +int CSentientManager::GetSubLevelId(unsigned long dwUserId) { - INT subLevelId = (INT)eTelem_SubLevelId_Undefined; + int subLevelId = (int)eTelem_SubLevelId_Undefined; Minecraft *pMinecraft = Minecraft::GetInstance(); @@ -334,13 +334,13 @@ INT CSentientManager::GetSubLevelId(DWORD dwUserId) switch(pMinecraft->localplayers[dwUserId]->dimension) { case 0: - subLevelId = (INT)eTelem_SubLevelId_Overworld; + subLevelId = (int)eTelem_SubLevelId_Overworld; break; case -1: - subLevelId = (INT)eTelem_SubLevelId_Nether; + subLevelId = (int)eTelem_SubLevelId_Nether; break; case 1: - subLevelId = (INT)eTelem_SubLevelId_End; + subLevelId = (int)eTelem_SubLevelId_End; break; }; } @@ -352,9 +352,9 @@ INT CSentientManager::GetSubLevelId(DWORD dwUserId) Build version of the title, used to track changes in development as well as patches/title updates Allows developer to separate out stats from different builds */ -INT CSentientManager::GetTitleBuildId() +int CSentientManager::GetTitleBuildId() { - return (INT)VER_PRODUCTBUILD; + return (int)VER_PRODUCTBUILD; } /* @@ -362,29 +362,29 @@ Generated by the game every time LevelStart or LevelResume is called. This should be a unique ID (can be sequential) within a session. Helps differentiate level attempts when a play plays the same mode/level - especially with aggregated stats */ -INT CSentientManager::GetLevelInstanceID() +int CSentientManager::GetLevelInstanceID() { - return (INT)m_levelInstanceID; + return (int)m_levelInstanceID; } /* MultiplayerinstanceID is a title-generated value that is the same for all players in the same multiplayer session. Link up players into a single multiplayer session ID. */ -INT CSentientManager::GetMultiplayerInstanceID() +int CSentientManager::GetMultiplayerInstanceID() { return m_multiplayerInstanceID; } -INT CSentientManager::GenerateMultiplayerInstanceId() +int CSentientManager::GenerateMultiplayerInstanceId() { FILETIME SystemTimeAsFileTime; GetSystemTimeAsFileTime( &SystemTimeAsFileTime ); - return *((INT *)&SystemTimeAsFileTime.dwLowDateTime); + return *((int *)&SystemTimeAsFileTime.dwLowDateTime); } -void CSentientManager::SetMultiplayerInstanceId(INT value) +void CSentientManager::SetMultiplayerInstanceId(int value) { m_multiplayerInstanceID = value; } @@ -393,9 +393,9 @@ void CSentientManager::SetMultiplayerInstanceId(INT value) Indicates whether the game is being played in single or multiplayer mode and whether multiplayer is being played locally or over live. How social is your game? How do people play it? */ -INT CSentientManager::GetSingleOrMultiplayer() +int CSentientManager::GetSingleOrMultiplayer() { - INT singleOrMultiplayer = (INT)eSen_SingleOrMultiplayer_Undefined; + int singleOrMultiplayer = (int)eSen_SingleOrMultiplayer_Undefined; // Unused //eSen_SingleOrMultiplayer_Single_Player @@ -403,19 +403,19 @@ INT CSentientManager::GetSingleOrMultiplayer() if(app.GetLocalPlayerCount() == 1 && g_NetworkManager.GetOnlinePlayerCount() == 0) { - singleOrMultiplayer = (INT)eSen_SingleOrMultiplayer_Single_Player; + singleOrMultiplayer = (int)eSen_SingleOrMultiplayer_Single_Player; } else if(app.GetLocalPlayerCount() > 1 && g_NetworkManager.GetOnlinePlayerCount() == 0) { - singleOrMultiplayer = (INT)eSen_SingleOrMultiplayer_Multiplayer_Local; + singleOrMultiplayer = (int)eSen_SingleOrMultiplayer_Multiplayer_Local; } else if(app.GetLocalPlayerCount() == 1 && g_NetworkManager.GetOnlinePlayerCount() > 0) { - singleOrMultiplayer = (INT)eSen_SingleOrMultiplayer_Multiplayer_Live; + singleOrMultiplayer = (int)eSen_SingleOrMultiplayer_Multiplayer_Live; } else if(app.GetLocalPlayerCount() > 1 && g_NetworkManager.GetOnlinePlayerCount() > 0) { - singleOrMultiplayer = (INT)eSen_SingleOrMultiplayer_Multiplayer_Both_Local_and_Live; + singleOrMultiplayer = (int)eSen_SingleOrMultiplayer_Multiplayer_Both_Local_and_Live; } return singleOrMultiplayer; @@ -425,23 +425,23 @@ INT CSentientManager::GetSingleOrMultiplayer() An in-game setting that differentiates the challenge imposed on the user. Normalized to a standard 5-point scale. Are players changing the difficulty? */ -INT CSentientManager::GetDifficultyLevel(INT diff) +int CSentientManager::GetDifficultyLevel(int diff) { - INT difficultyLevel = (INT)eSen_DifficultyLevel_Undefined; + int difficultyLevel = (int)eSen_DifficultyLevel_Undefined; switch(diff) { case 0: - difficultyLevel = (INT)eSen_DifficultyLevel_Easiest; + difficultyLevel = (int)eSen_DifficultyLevel_Easiest; break; case 1: - difficultyLevel = (INT)eSen_DifficultyLevel_Easier; + difficultyLevel = (int)eSen_DifficultyLevel_Easier; break; case 2: - difficultyLevel = (INT)eSen_DifficultyLevel_Normal; + difficultyLevel = (int)eSen_DifficultyLevel_Normal; break; case 3: - difficultyLevel = (INT)eSen_DifficultyLevel_Harder; + difficultyLevel = (int)eSen_DifficultyLevel_Harder; break; } @@ -455,17 +455,17 @@ INT CSentientManager::GetDifficultyLevel(INT diff) Differentiates trial/demo from full purchased titles Is this a full title or demo? */ -INT CSentientManager::GetLicense() +int CSentientManager::GetLicense() { - INT license = eSen_License_Undefined; + int license = eSen_License_Undefined; if(ProfileManager.IsFullVersion()) { - license = (INT)eSen_License_Full_Purchased_Title; + license = (int)eSen_License_Full_Purchased_Title; } else { - license = (INT)eSen_License_Trial_or_Demo; + license = (int)eSen_License_Trial_or_Demo; } return license; } @@ -474,9 +474,9 @@ INT CSentientManager::GetLicense() This is intended to capture whether players played using default control scheme or customized the control scheme. Are players customizing your controls? */ -INT CSentientManager::GetDefaultGameControls() +int CSentientManager::GetDefaultGameControls() { - INT defaultGameControls = eSen_DefaultGameControls_Undefined; + int defaultGameControls = eSen_DefaultGameControls_Undefined; // Unused //eSen_DefaultGameControls_Custom_controls @@ -490,25 +490,25 @@ INT CSentientManager::GetDefaultGameControls() Are players changing default audio settings? This is intended to capture whether players are playing with or without volume and whether they make changes from the default audio settings. */ -INT CSentientManager::GetAudioSettings(DWORD dwUserId) +int CSentientManager::GetAudioSettings(unsigned long dwUserId) { - INT audioSettings = (INT)eSen_AudioSettings_Undefined; + int audioSettings = (int)eSen_AudioSettings_Undefined; if(dwUserId == ProfileManager.GetPrimaryPad()) { - BYTE volume = app.GetGameSettings(dwUserId,eGameSetting_SoundFXVolume); + uint8_t volume = app.GetGameSettings(dwUserId,eGameSetting_SoundFXVolume); if(volume == 0) { - audioSettings = (INT)eSen_AudioSettings_Off; + audioSettings = (int)eSen_AudioSettings_Off; } else if(volume == DEFAULT_VOLUME_LEVEL) { - audioSettings = (INT)eSen_AudioSettings_On_Default; + audioSettings = (int)eSen_AudioSettings_On_Default; } else { - audioSettings = (INT)eSen_AudioSettings_On_CustomSetting; + audioSettings = (int)eSen_AudioSettings_On_CustomSetting; } } return audioSettings; @@ -520,7 +520,7 @@ For example, a performance metric could points earned, race time, total kills, e This is entirely up to you and will help us understand how well the player performed, or how far the player progressed �in the level before exiting. How far did users progress before failing/exiting the level? */ -INT CSentientManager::GetLevelExitProgressStat1() +int CSentientManager::GetLevelExitProgressStat1() { // 4J Stu - Unused return 0; @@ -532,7 +532,7 @@ For example, a performance metric could points earned, race time, total kills, e This is entirely up to you and will help us understand how well the player performed, or how far the player progressed �in the level before exiting. How far did users progress before failing/exiting the level? */ -INT CSentientManager::GetLevelExitProgressStat2() +int CSentientManager::GetLevelExitProgressStat2() { // 4J Stu - Unused return 0; diff --git a/src/client/Xbox/Sentient/SentientManager.h b/src/client/Xbox/Sentient/SentientManager.h index 3cf6df09..553f9719 100644 --- a/src/client/Xbox/Sentient/SentientManager.h +++ b/src/client/Xbox/Sentient/SentientManager.h @@ -23,36 +23,36 @@ public: eTelemetry_EnemyKilledOrOvercome, }; - virtual HRESULT Init(); - virtual HRESULT Tick(); + virtual int Init(); + virtual int Tick(); - virtual HRESULT Flush(); + virtual int Flush(); - virtual BOOL RecordPlayerSessionStart(DWORD dwUserId); - virtual BOOL RecordPlayerSessionExit(DWORD dwUserId, int exitStatus); - virtual BOOL RecordHeartBeat(DWORD dwUserId); - virtual BOOL RecordLevelStart(DWORD dwUserId, ESen_FriendOrMatch friendsOrMatch, ESen_CompeteOrCoop competeOrCoop, int difficulty, DWORD numberOfLocalPlayers, DWORD numberOfOnlinePlayers); - virtual BOOL RecordLevelExit(DWORD dwUserId, ESen_LevelExitStatus levelExitStatus); - virtual BOOL RecordLevelSaveOrCheckpoint(DWORD dwUserId, INT saveOrCheckPointID, INT saveSizeInBytes); - virtual BOOL RecordLevelResume(DWORD dwUserId, ESen_FriendOrMatch friendsOrMatch, ESen_CompeteOrCoop competeOrCoop, int difficulty, DWORD numberOfLocalPlayers, DWORD numberOfOnlinePlayers, INT saveOrCheckPointID); - virtual BOOL RecordPauseOrInactive(DWORD dwUserId); - virtual BOOL RecordUnpauseOrActive(DWORD dwUserId); - virtual BOOL RecordMenuShown(DWORD dwUserId, INT menuID, INT optionalMenuSubID); - virtual BOOL RecordAchievementUnlocked(DWORD dwUserId, INT achievementID, INT achievementGamerscore); - virtual BOOL RecordMediaShareUpload(DWORD dwUserId, ESen_MediaDestination mediaDestination, ESen_MediaType mediaType); - virtual BOOL RecordUpsellPresented(DWORD dwUserId, ESen_UpsellID upsellId, INT marketplaceOfferID); - virtual BOOL RecordUpsellResponded(DWORD dwUserId, ESen_UpsellID upsellId, INT marketplaceOfferID, ESen_UpsellOutcome upsellOutcome); - virtual BOOL RecordPlayerDiedOrFailed(DWORD dwUserId, INT lowResMapX, INT lowResMapY, INT lowResMapZ, INT mapID, INT playerWeaponID, INT enemyWeaponID, ETelemetryChallenges enemyTypeID); - virtual BOOL RecordEnemyKilledOrOvercome(DWORD dwUserId, INT lowResMapX, INT lowResMapY, INT lowResMapZ, INT mapID, INT playerWeaponID, INT enemyWeaponID, ETelemetryChallenges enemyTypeID); - virtual BOOL RecordTexturePackLoaded(DWORD dwUserId, INT texturePackId, INT purchased); + virtual bool RecordPlayerSessionStart(unsigned long dwUserId); + virtual bool RecordPlayerSessionExit(unsigned long dwUserId, int exitStatus); + virtual bool RecordHeartBeat(unsigned long dwUserId); + virtual bool RecordLevelStart(unsigned long dwUserId, ESen_FriendOrMatch friendsOrMatch, ESen_CompeteOrCoop competeOrCoop, int difficulty, unsigned long numberOfLocalPlayers, unsigned long numberOfOnlinePlayers); + virtual bool RecordLevelExit(unsigned long dwUserId, ESen_LevelExitStatus levelExitStatus); + virtual bool RecordLevelSaveOrCheckpoint(unsigned long dwUserId, int saveOrCheckPointID, int saveSizeInBytes); + virtual bool RecordLevelResume(unsigned long dwUserId, ESen_FriendOrMatch friendsOrMatch, ESen_CompeteOrCoop competeOrCoop, int difficulty, unsigned long numberOfLocalPlayers, unsigned long numberOfOnlinePlayers, int saveOrCheckPointID); + virtual bool RecordPauseOrInactive(unsigned long dwUserId); + virtual bool RecordUnpauseOrActive(unsigned long dwUserId); + virtual bool RecordMenuShown(unsigned long dwUserId, int menuID, int optionalMenuSubID); + virtual bool RecordAchievementUnlocked(unsigned long dwUserId, int achievementID, int achievementGamerscore); + virtual bool RecordMediaShareUpload(unsigned long dwUserId, ESen_MediaDestination mediaDestination, ESen_MediaType mediaType); + virtual bool RecordUpsellPresented(unsigned long dwUserId, ESen_UpsellID upsellId, int marketplaceOfferID); + virtual bool RecordUpsellResponded(unsigned long dwUserId, ESen_UpsellID upsellId, int marketplaceOfferID, ESen_UpsellOutcome upsellOutcome); + virtual bool RecordPlayerDiedOrFailed(unsigned long dwUserId, int lowResMapX, int lowResMapY, int lowResMapZ, int mapID, int playerWeaponID, int enemyWeaponID, ETelemetryChallenges enemyTypeID); + virtual bool RecordEnemyKilledOrOvercome(unsigned long dwUserId, int lowResMapX, int lowResMapY, int lowResMapZ, int mapID, int playerWeaponID, int enemyWeaponID, ETelemetryChallenges enemyTypeID); + virtual bool RecordTexturePackLoaded(unsigned long dwUserId, int texturePackId, int purchased); - virtual BOOL RecordSkinChanged(DWORD dwUserId, DWORD dwSkinId); - virtual BOOL RecordBanLevel(DWORD dwUserId); - virtual BOOL RecordUnBanLevel(DWORD dwUserId); + virtual bool RecordSkinChanged(unsigned long dwUserId, unsigned long dwSkinId); + virtual bool RecordBanLevel(unsigned long dwUserId); + virtual bool RecordUnBanLevel(unsigned long dwUserId); - virtual INT GetMultiplayerInstanceID(); - virtual INT GenerateMultiplayerInstanceId(); - virtual void SetMultiplayerInstanceId(INT value); + virtual int GetMultiplayerInstanceID(); + virtual int GenerateMultiplayerInstanceId(); + virtual void SetMultiplayerInstanceId(int value); private: float m_lastHeartbeat; @@ -60,22 +60,22 @@ private: float m_fLevelStartTime[XUSER_MAX_COUNT]; - INT m_multiplayerInstanceID; - DWORD m_levelInstanceID; + int m_multiplayerInstanceID; + unsigned long m_levelInstanceID; // Helper functions to get the various common settings - INT GetSecondsSinceInitialize(); - INT GetMode(DWORD dwUserId); - INT GetSubMode(DWORD dwUserId); - INT GetLevelId(DWORD dwUserId); - INT GetSubLevelId(DWORD dwUserId); - INT GetTitleBuildId(); - INT GetLevelInstanceID(); - INT GetSingleOrMultiplayer(); - INT GetDifficultyLevel(INT diff); - INT GetLicense(); - INT GetDefaultGameControls(); - INT GetAudioSettings(DWORD dwUserId); - INT GetLevelExitProgressStat1(); - INT GetLevelExitProgressStat2(); + int GetSecondsSinceInitialize(); + int GetMode(unsigned long dwUserId); + int GetSubMode(unsigned long dwUserId); + int GetLevelId(unsigned long dwUserId); + int GetSubLevelId(unsigned long dwUserId); + int GetTitleBuildId(); + int GetLevelInstanceID(); + int GetSingleOrMultiplayer(); + int GetDifficultyLevel(int diff); + int GetLicense(); + int GetDefaultGameControls(); + int GetAudioSettings(unsigned long dwUserId); + int GetLevelExitProgressStat1(); + int GetLevelExitProgressStat2(); }; \ No newline at end of file diff --git a/src/client/Xbox/Sentient/SentientStats.cpp b/src/client/Xbox/Sentient/SentientStats.cpp index 361d18ee..3a3693a1 100644 --- a/src/client/Xbox/Sentient/SentientStats.cpp +++ b/src/client/Xbox/Sentient/SentientStats.cpp @@ -15,27 +15,27 @@ using namespace Sentient; /************************************************************************/ // PlayerSessionStart -BOOL SenStatPlayerSessionStart ( DWORD dwUserID, INT SecondsSinceInitialize, INT ModeID, INT OptionalSubModeID, INT LevelID, INT OptionalSubLevelID, INT TitleBuildID, INT SkeletonDistanceInInches, INT EnrollmentType, INT NumberOfSkeletonsInView, INT DeploymentType ) +bool SenStatPlayerSessionStart ( unsigned long dwUserID, int SecondsSinceInitialize, int ModeID, int OptionalSubModeID, int LevelID, int OptionalSubLevelID, int TitleBuildID, int SkeletonDistanceInInches, int EnrollmentType, int NumberOfSkeletonsInView, int DeploymentType ) { struct { - INT SecondsSinceInitialize; - INT ModeID; - INT OptionalSubModeID; - INT LevelID; - INT OptionalSubLevelID; - INT TitleBuildID; - INT SkeletonDistanceInInches; - INT EnrollmentType; - INT NumberOfSkeletonsInView; - INT DeploymentType; + int SecondsSinceInitialize; + int ModeID; + int OptionalSubModeID; + int LevelID; + int OptionalSubLevelID; + int TitleBuildID; + int SkeletonDistanceInInches; + int EnrollmentType; + int NumberOfSkeletonsInView; + int DeploymentType; } LocalStruct = { SecondsSinceInitialize, ModeID, OptionalSubModeID, LevelID, OptionalSubLevelID, TitleBuildID, SkeletonDistanceInInches, EnrollmentType, NumberOfSkeletonsInView, DeploymentType }; SenStat st; st.dwUserID = dwUserID; st.dwStatID = 128; st.dwFlags = SenStatFlag_Normal; st.dwNumProperties = 10; - st.arrProperties = (CHAR*)&LocalStruct; + st.arrProperties = (char*)&LocalStruct; st.dwNumValues = 0; st.arrValues = NULL; st.arrValueFlags = NULL; @@ -50,22 +50,22 @@ BOOL SenStatPlayerSessionStart ( DWORD dwUserID, INT SecondsSinceI } // PlayerSessionExit -BOOL SenStatPlayerSessionExit ( DWORD dwUserID, INT SecondsSinceInitialize, INT ModeID, INT OptionalSubModeID, INT LevelID, INT OptionalSubLevelID ) +bool SenStatPlayerSessionExit ( unsigned long dwUserID, int SecondsSinceInitialize, int ModeID, int OptionalSubModeID, int LevelID, int OptionalSubLevelID ) { struct { - INT SecondsSinceInitialize; - INT ModeID; - INT OptionalSubModeID; - INT LevelID; - INT OptionalSubLevelID; + int SecondsSinceInitialize; + int ModeID; + int OptionalSubModeID; + int LevelID; + int OptionalSubLevelID; } LocalStruct = { SecondsSinceInitialize, ModeID, OptionalSubModeID, LevelID, OptionalSubLevelID }; SenStat st; st.dwUserID = dwUserID; st.dwStatID = 129; st.dwFlags = SenStatFlag_Normal; st.dwNumProperties = 5; - st.arrProperties = (CHAR*)&LocalStruct; + st.arrProperties = (char*)&LocalStruct; st.dwNumValues = 0; st.arrValues = NULL; st.arrValueFlags = NULL; @@ -80,18 +80,18 @@ BOOL SenStatPlayerSessionExit ( DWORD dwUserID, INT SecondsSinceI } // HeartBeat -BOOL SenStatHeartBeat ( DWORD dwUserID, INT SecondsSinceInitialize ) +bool SenStatHeartBeat ( unsigned long dwUserID, int SecondsSinceInitialize ) { struct { - INT SecondsSinceInitialize; + int SecondsSinceInitialize; } LocalStruct = { SecondsSinceInitialize }; SenStat st; st.dwUserID = dwUserID; st.dwStatID = 130; st.dwFlags = SenStatFlag_Normal; st.dwNumProperties = 1; - st.arrProperties = (CHAR*)&LocalStruct; + st.arrProperties = (char*)&LocalStruct; st.dwNumValues = 0; st.arrValues = NULL; st.arrValueFlags = NULL; @@ -106,35 +106,35 @@ BOOL SenStatHeartBeat ( DWORD dwUserID, INT SecondsSinceI } // LevelStart -BOOL SenStatLevelStart ( DWORD dwUserID, INT SecondsSinceInitialize, INT ModeID, INT OptionalSubModeID, INT LevelID, INT OptionalSubLevelID, INT LevelInstanceID, INT MultiplayerInstanceID, INT SingleOrMultiplayer, INT FriendsOrMatch, INT CompeteOrCoop, INT DifficultyLevel, INT NumberOfLocalPlayers, INT NumberOfOnlinePlayers, INT License, INT DefaultGameControls, INT AudioSettings, INT SkeletonDistanceInInches, INT NumberOfSkeletonsInView ) +bool SenStatLevelStart ( unsigned long dwUserID, int SecondsSinceInitialize, int ModeID, int OptionalSubModeID, int LevelID, int OptionalSubLevelID, int LevelInstanceID, int MultiplayerInstanceID, int SingleOrMultiplayer, int FriendsOrMatch, int CompeteOrCoop, int DifficultyLevel, int NumberOfLocalPlayers, int NumberOfOnlinePlayers, int License, int DefaultGameControls, int AudioSettings, int SkeletonDistanceInInches, int NumberOfSkeletonsInView ) { struct { - INT SecondsSinceInitialize; - INT ModeID; - INT OptionalSubModeID; - INT LevelID; - INT OptionalSubLevelID; - INT LevelInstanceID; - INT MultiplayerInstanceID; - INT SingleOrMultiplayer; - INT FriendsOrMatch; - INT CompeteOrCoop; - INT DifficultyLevel; - INT NumberOfLocalPlayers; - INT NumberOfOnlinePlayers; - INT License; - INT DefaultGameControls; - INT AudioSettings; - INT SkeletonDistanceInInches; - INT NumberOfSkeletonsInView; + int SecondsSinceInitialize; + int ModeID; + int OptionalSubModeID; + int LevelID; + int OptionalSubLevelID; + int LevelInstanceID; + int MultiplayerInstanceID; + int SingleOrMultiplayer; + int FriendsOrMatch; + int CompeteOrCoop; + int DifficultyLevel; + int NumberOfLocalPlayers; + int NumberOfOnlinePlayers; + int License; + int DefaultGameControls; + int AudioSettings; + int SkeletonDistanceInInches; + int NumberOfSkeletonsInView; } LocalStruct = { SecondsSinceInitialize, ModeID, OptionalSubModeID, LevelID, OptionalSubLevelID, LevelInstanceID, MultiplayerInstanceID, SingleOrMultiplayer, FriendsOrMatch, CompeteOrCoop, DifficultyLevel, NumberOfLocalPlayers, NumberOfOnlinePlayers, License, DefaultGameControls, AudioSettings, SkeletonDistanceInInches, NumberOfSkeletonsInView }; SenStat st; st.dwUserID = dwUserID; st.dwStatID = 131; st.dwFlags = SenStatFlag_Normal; st.dwNumProperties = 18; - st.arrProperties = (CHAR*)&LocalStruct; + st.arrProperties = (char*)&LocalStruct; st.dwNumValues = 0; st.arrValues = NULL; st.arrValueFlags = NULL; @@ -149,28 +149,28 @@ BOOL SenStatLevelStart ( DWORD dwUserID, INT SecondsSinceI } // LevelExit -BOOL SenStatLevelExit ( DWORD dwUserID, INT SecondsSinceInitialize, INT ModeID, INT OptionalSubModeID, INT LevelID, INT OptionalSubLevelID, INT LevelInstanceID, INT MultiplayerInstanceID, INT LevelExitStatus, INT LevelExitProgressStat1, INT LevelExitProgressStat2, INT LevelDurationInSeconds ) +bool SenStatLevelExit ( unsigned long dwUserID, int SecondsSinceInitialize, int ModeID, int OptionalSubModeID, int LevelID, int OptionalSubLevelID, int LevelInstanceID, int MultiplayerInstanceID, int LevelExitStatus, int LevelExitProgressStat1, int LevelExitProgressStat2, int LevelDurationInSeconds ) { struct { - INT SecondsSinceInitialize; - INT ModeID; - INT OptionalSubModeID; - INT LevelID; - INT OptionalSubLevelID; - INT LevelInstanceID; - INT MultiplayerInstanceID; - INT LevelExitStatus; - INT LevelExitProgressStat1; - INT LevelExitProgressStat2; - INT LevelDurationInSeconds; + int SecondsSinceInitialize; + int ModeID; + int OptionalSubModeID; + int LevelID; + int OptionalSubLevelID; + int LevelInstanceID; + int MultiplayerInstanceID; + int LevelExitStatus; + int LevelExitProgressStat1; + int LevelExitProgressStat2; + int LevelDurationInSeconds; } LocalStruct = { SecondsSinceInitialize, ModeID, OptionalSubModeID, LevelID, OptionalSubLevelID, LevelInstanceID, MultiplayerInstanceID, LevelExitStatus, LevelExitProgressStat1, LevelExitProgressStat2, LevelDurationInSeconds }; SenStat st; st.dwUserID = dwUserID; st.dwStatID = 132; st.dwFlags = SenStatFlag_Normal; st.dwNumProperties = 11; - st.arrProperties = (CHAR*)&LocalStruct; + st.arrProperties = (char*)&LocalStruct; st.dwNumValues = 0; st.arrValues = NULL; st.arrValueFlags = NULL; @@ -185,29 +185,29 @@ BOOL SenStatLevelExit ( DWORD dwUserID, INT SecondsSinceI } // LevelSaveOrCheckpoint -BOOL SenStatLevelSaveOrCheckpoint ( DWORD dwUserID, INT SecondsSinceInitialize, INT ModeID, INT OptionalSubModeID, INT LevelID, INT OptionalSubLevelID, INT LevelInstanceID, INT MultiplayerInstanceID, INT LevelExitProgressStat1, INT LevelExitProgressStat2, INT LevelDurationInSeconds, INT SaveOrCheckPointID, INT SaveSizeInBytes ) +bool SenStatLevelSaveOrCheckpoint ( unsigned long dwUserID, int SecondsSinceInitialize, int ModeID, int OptionalSubModeID, int LevelID, int OptionalSubLevelID, int LevelInstanceID, int MultiplayerInstanceID, int LevelExitProgressStat1, int LevelExitProgressStat2, int LevelDurationInSeconds, int SaveOrCheckPointID, int SaveSizeInBytes ) { struct { - INT SecondsSinceInitialize; - INT ModeID; - INT OptionalSubModeID; - INT LevelID; - INT OptionalSubLevelID; - INT LevelInstanceID; - INT MultiplayerInstanceID; - INT LevelExitProgressStat1; - INT LevelExitProgressStat2; - INT LevelDurationInSeconds; - INT SaveOrCheckPointID; - INT SaveSizeInBytes; + int SecondsSinceInitialize; + int ModeID; + int OptionalSubModeID; + int LevelID; + int OptionalSubLevelID; + int LevelInstanceID; + int MultiplayerInstanceID; + int LevelExitProgressStat1; + int LevelExitProgressStat2; + int LevelDurationInSeconds; + int SaveOrCheckPointID; + int SaveSizeInBytes; } LocalStruct = { SecondsSinceInitialize, ModeID, OptionalSubModeID, LevelID, OptionalSubLevelID, LevelInstanceID, MultiplayerInstanceID, LevelExitProgressStat1, LevelExitProgressStat2, LevelDurationInSeconds, SaveOrCheckPointID, SaveSizeInBytes }; SenStat st; st.dwUserID = dwUserID; st.dwStatID = 133; st.dwFlags = SenStatFlag_Normal; st.dwNumProperties = 12; - st.arrProperties = (CHAR*)&LocalStruct; + st.arrProperties = (char*)&LocalStruct; st.dwNumValues = 0; st.arrValues = NULL; st.arrValueFlags = NULL; @@ -222,36 +222,36 @@ BOOL SenStatLevelSaveOrCheckpoint ( DWORD dwUserID, INT SecondsSinceI } // LevelResume -BOOL SenStatLevelResume ( DWORD dwUserID, INT SecondsSinceInitialize, INT ModeID, INT OptionalSubModeID, INT LevelID, INT OptionalSubLevelID, INT LevelInstanceID, INT MultiplayerInstanceID, INT SingleOrMultiplayer, INT FriendsOrMatch, INT CompeteOrCoop, INT DifficultyLevel, INT NumberOfLocalPlayers, INT NumberOfOnlinePlayers, INT License, INT DefaultGameControls, INT SaveOrCheckPointID, INT AudioSettings, INT SkeletonDistanceInInches, INT NumberOfSkeletonsInView ) +bool SenStatLevelResume ( unsigned long dwUserID, int SecondsSinceInitialize, int ModeID, int OptionalSubModeID, int LevelID, int OptionalSubLevelID, int LevelInstanceID, int MultiplayerInstanceID, int SingleOrMultiplayer, int FriendsOrMatch, int CompeteOrCoop, int DifficultyLevel, int NumberOfLocalPlayers, int NumberOfOnlinePlayers, int License, int DefaultGameControls, int SaveOrCheckPointID, int AudioSettings, int SkeletonDistanceInInches, int NumberOfSkeletonsInView ) { struct { - INT SecondsSinceInitialize; - INT ModeID; - INT OptionalSubModeID; - INT LevelID; - INT OptionalSubLevelID; - INT LevelInstanceID; - INT MultiplayerInstanceID; - INT SingleOrMultiplayer; - INT FriendsOrMatch; - INT CompeteOrCoop; - INT DifficultyLevel; - INT NumberOfLocalPlayers; - INT NumberOfOnlinePlayers; - INT License; - INT DefaultGameControls; - INT SaveOrCheckPointID; - INT AudioSettings; - INT SkeletonDistanceInInches; - INT NumberOfSkeletonsInView; + int SecondsSinceInitialize; + int ModeID; + int OptionalSubModeID; + int LevelID; + int OptionalSubLevelID; + int LevelInstanceID; + int MultiplayerInstanceID; + int SingleOrMultiplayer; + int FriendsOrMatch; + int CompeteOrCoop; + int DifficultyLevel; + int NumberOfLocalPlayers; + int NumberOfOnlinePlayers; + int License; + int DefaultGameControls; + int SaveOrCheckPointID; + int AudioSettings; + int SkeletonDistanceInInches; + int NumberOfSkeletonsInView; } LocalStruct = { SecondsSinceInitialize, ModeID, OptionalSubModeID, LevelID, OptionalSubLevelID, LevelInstanceID, MultiplayerInstanceID, SingleOrMultiplayer, FriendsOrMatch, CompeteOrCoop, DifficultyLevel, NumberOfLocalPlayers, NumberOfOnlinePlayers, License, DefaultGameControls, SaveOrCheckPointID, AudioSettings, SkeletonDistanceInInches, NumberOfSkeletonsInView }; SenStat st; st.dwUserID = dwUserID; st.dwStatID = 134; st.dwFlags = SenStatFlag_Normal; st.dwNumProperties = 19; - st.arrProperties = (CHAR*)&LocalStruct; + st.arrProperties = (char*)&LocalStruct; st.dwNumValues = 0; st.arrValues = NULL; st.arrValueFlags = NULL; @@ -266,24 +266,24 @@ BOOL SenStatLevelResume ( DWORD dwUserID, INT SecondsSinceI } // PauseOrInactive -BOOL SenStatPauseOrInactive ( DWORD dwUserID, INT SecondsSinceInitialize, INT ModeID, INT OptionalSubModeID, INT LevelID, INT OptionalSubLevelID, INT LevelInstanceID, INT MultiplayerInstanceID ) +bool SenStatPauseOrInactive ( unsigned long dwUserID, int SecondsSinceInitialize, int ModeID, int OptionalSubModeID, int LevelID, int OptionalSubLevelID, int LevelInstanceID, int MultiplayerInstanceID ) { struct { - INT SecondsSinceInitialize; - INT ModeID; - INT OptionalSubModeID; - INT LevelID; - INT OptionalSubLevelID; - INT LevelInstanceID; - INT MultiplayerInstanceID; + int SecondsSinceInitialize; + int ModeID; + int OptionalSubModeID; + int LevelID; + int OptionalSubLevelID; + int LevelInstanceID; + int MultiplayerInstanceID; } LocalStruct = { SecondsSinceInitialize, ModeID, OptionalSubModeID, LevelID, OptionalSubLevelID, LevelInstanceID, MultiplayerInstanceID }; SenStat st; st.dwUserID = dwUserID; st.dwStatID = 135; st.dwFlags = SenStatFlag_Normal; st.dwNumProperties = 7; - st.arrProperties = (CHAR*)&LocalStruct; + st.arrProperties = (char*)&LocalStruct; st.dwNumValues = 0; st.arrValues = NULL; st.arrValueFlags = NULL; @@ -298,24 +298,24 @@ BOOL SenStatPauseOrInactive ( DWORD dwUserID, INT SecondsSinceI } // UnpauseOrActive -BOOL SenStatUnpauseOrActive ( DWORD dwUserID, INT SecondsSinceInitialize, INT ModeID, INT OptionalSubModeID, INT LevelID, INT OptionalSubLevelID, INT LevelInstanceID, INT MultiplayerInstanceID ) +bool SenStatUnpauseOrActive ( unsigned long dwUserID, int SecondsSinceInitialize, int ModeID, int OptionalSubModeID, int LevelID, int OptionalSubLevelID, int LevelInstanceID, int MultiplayerInstanceID ) { struct { - INT SecondsSinceInitialize; - INT ModeID; - INT OptionalSubModeID; - INT LevelID; - INT OptionalSubLevelID; - INT LevelInstanceID; - INT MultiplayerInstanceID; + int SecondsSinceInitialize; + int ModeID; + int OptionalSubModeID; + int LevelID; + int OptionalSubLevelID; + int LevelInstanceID; + int MultiplayerInstanceID; } LocalStruct = { SecondsSinceInitialize, ModeID, OptionalSubModeID, LevelID, OptionalSubLevelID, LevelInstanceID, MultiplayerInstanceID }; SenStat st; st.dwUserID = dwUserID; st.dwStatID = 136; st.dwFlags = SenStatFlag_Normal; st.dwNumProperties = 7; - st.arrProperties = (CHAR*)&LocalStruct; + st.arrProperties = (char*)&LocalStruct; st.dwNumValues = 0; st.arrValues = NULL; st.arrValueFlags = NULL; @@ -330,26 +330,26 @@ BOOL SenStatUnpauseOrActive ( DWORD dwUserID, INT SecondsSinceI } // MenuShown -BOOL SenStatMenuShown ( DWORD dwUserID, INT SecondsSinceInitialize, INT ModeID, INT OptionalSubModeID, INT LevelID, INT OptionalSubLevelID, INT MenuID, INT OptionalMenuSubID, INT LevelInstanceID, INT MultiplayerInstanceID ) +bool SenStatMenuShown ( unsigned long dwUserID, int SecondsSinceInitialize, int ModeID, int OptionalSubModeID, int LevelID, int OptionalSubLevelID, int MenuID, int OptionalMenuSubID, int LevelInstanceID, int MultiplayerInstanceID ) { struct { - INT SecondsSinceInitialize; - INT ModeID; - INT OptionalSubModeID; - INT LevelID; - INT OptionalSubLevelID; - INT MenuID; - INT OptionalMenuSubID; - INT LevelInstanceID; - INT MultiplayerInstanceID; + int SecondsSinceInitialize; + int ModeID; + int OptionalSubModeID; + int LevelID; + int OptionalSubLevelID; + int MenuID; + int OptionalMenuSubID; + int LevelInstanceID; + int MultiplayerInstanceID; } LocalStruct = { SecondsSinceInitialize, ModeID, OptionalSubModeID, LevelID, OptionalSubLevelID, MenuID, OptionalMenuSubID, LevelInstanceID, MultiplayerInstanceID }; SenStat st; st.dwUserID = dwUserID; st.dwStatID = 137; st.dwFlags = SenStatFlag_Normal; st.dwNumProperties = 9; - st.arrProperties = (CHAR*)&LocalStruct; + st.arrProperties = (char*)&LocalStruct; st.dwNumValues = 0; st.arrValues = NULL; st.arrValueFlags = NULL; @@ -364,26 +364,26 @@ BOOL SenStatMenuShown ( DWORD dwUserID, INT SecondsSinceI } // AchievementUnlocked -BOOL SenStatAchievementUnlocked ( DWORD dwUserID, INT SecondsSinceInitialize, INT ModeID, INT OptionalSubModeID, INT LevelID, INT OptionalSubLevelID, INT LevelInstanceID, INT MultiplayerInstanceID, INT AchievementID, INT AchievementGamerscore ) +bool SenStatAchievementUnlocked ( unsigned long dwUserID, int SecondsSinceInitialize, int ModeID, int OptionalSubModeID, int LevelID, int OptionalSubLevelID, int LevelInstanceID, int MultiplayerInstanceID, int AchievementID, int AchievementGamerscore ) { struct { - INT SecondsSinceInitialize; - INT ModeID; - INT OptionalSubModeID; - INT LevelID; - INT OptionalSubLevelID; - INT LevelInstanceID; - INT MultiplayerInstanceID; - INT AchievementID; - INT AchievementGamerscore; + int SecondsSinceInitialize; + int ModeID; + int OptionalSubModeID; + int LevelID; + int OptionalSubLevelID; + int LevelInstanceID; + int MultiplayerInstanceID; + int AchievementID; + int AchievementGamerscore; } LocalStruct = { SecondsSinceInitialize, ModeID, OptionalSubModeID, LevelID, OptionalSubLevelID, LevelInstanceID, MultiplayerInstanceID, AchievementID, AchievementGamerscore }; SenStat st; st.dwUserID = dwUserID; st.dwStatID = 138; st.dwFlags = SenStatFlag_Normal; st.dwNumProperties = 9; - st.arrProperties = (CHAR*)&LocalStruct; + st.arrProperties = (char*)&LocalStruct; st.dwNumValues = 0; st.arrValues = NULL; st.arrValueFlags = NULL; @@ -398,26 +398,26 @@ BOOL SenStatAchievementUnlocked ( DWORD dwUserID, INT SecondsSinceI } // MediaShareUpload -BOOL SenStatMediaShareUpload ( DWORD dwUserID, INT SecondsSinceInitialize, INT ModeID, INT OptionalSubModeID, INT LevelID, INT OptionalSubLevelID, INT LevelInstanceID, INT MultiplayerInstanceID, INT MediaDestination, INT MediaType ) +bool SenStatMediaShareUpload ( unsigned long dwUserID, int SecondsSinceInitialize, int ModeID, int OptionalSubModeID, int LevelID, int OptionalSubLevelID, int LevelInstanceID, int MultiplayerInstanceID, int MediaDestination, int MediaType ) { struct { - INT SecondsSinceInitialize; - INT ModeID; - INT OptionalSubModeID; - INT LevelID; - INT OptionalSubLevelID; - INT LevelInstanceID; - INT MultiplayerInstanceID; - INT MediaDestination; - INT MediaType; + int SecondsSinceInitialize; + int ModeID; + int OptionalSubModeID; + int LevelID; + int OptionalSubLevelID; + int LevelInstanceID; + int MultiplayerInstanceID; + int MediaDestination; + int MediaType; } LocalStruct = { SecondsSinceInitialize, ModeID, OptionalSubModeID, LevelID, OptionalSubLevelID, LevelInstanceID, MultiplayerInstanceID, MediaDestination, MediaType }; SenStat st; st.dwUserID = dwUserID; st.dwStatID = 139; st.dwFlags = SenStatFlag_Normal; st.dwNumProperties = 9; - st.arrProperties = (CHAR*)&LocalStruct; + st.arrProperties = (char*)&LocalStruct; st.dwNumValues = 0; st.arrValues = NULL; st.arrValueFlags = NULL; @@ -432,26 +432,26 @@ BOOL SenStatMediaShareUpload ( DWORD dwUserID, INT SecondsSinceI } // UpsellPresented -BOOL SenStatUpsellPresented ( DWORD dwUserID, INT SecondsSinceInitialize, INT ModeID, INT OptionalSubModeID, INT LevelID, INT OptionalSubLevelID, INT LevelInstanceID, INT MultiplayerInstanceID, INT UpsellID, INT MarketplaceOfferID ) +bool SenStatUpsellPresented ( unsigned long dwUserID, int SecondsSinceInitialize, int ModeID, int OptionalSubModeID, int LevelID, int OptionalSubLevelID, int LevelInstanceID, int MultiplayerInstanceID, int UpsellID, int MarketplaceOfferID ) { struct { - INT SecondsSinceInitialize; - INT ModeID; - INT OptionalSubModeID; - INT LevelID; - INT OptionalSubLevelID; - INT LevelInstanceID; - INT MultiplayerInstanceID; - INT UpsellID; - INT MarketplaceOfferID; + int SecondsSinceInitialize; + int ModeID; + int OptionalSubModeID; + int LevelID; + int OptionalSubLevelID; + int LevelInstanceID; + int MultiplayerInstanceID; + int UpsellID; + int MarketplaceOfferID; } LocalStruct = { SecondsSinceInitialize, ModeID, OptionalSubModeID, LevelID, OptionalSubLevelID, LevelInstanceID, MultiplayerInstanceID, UpsellID, MarketplaceOfferID }; SenStat st; st.dwUserID = dwUserID; st.dwStatID = 140; st.dwFlags = SenStatFlag_Normal; st.dwNumProperties = 9; - st.arrProperties = (CHAR*)&LocalStruct; + st.arrProperties = (char*)&LocalStruct; st.dwNumValues = 0; st.arrValues = NULL; st.arrValueFlags = NULL; @@ -466,27 +466,27 @@ BOOL SenStatUpsellPresented ( DWORD dwUserID, INT SecondsSinceI } // UpsellResponded -BOOL SenStatUpsellResponded ( DWORD dwUserID, INT SecondsSinceInitialize, INT ModeID, INT OptionalSubModeID, INT LevelID, INT OptionalSubLevelID, INT LevelInstanceID, INT MultiplayerInstanceID, INT UpsellID, INT MarketplaceOfferID, INT UpsellOutcome ) +bool SenStatUpsellResponded ( unsigned long dwUserID, int SecondsSinceInitialize, int ModeID, int OptionalSubModeID, int LevelID, int OptionalSubLevelID, int LevelInstanceID, int MultiplayerInstanceID, int UpsellID, int MarketplaceOfferID, int UpsellOutcome ) { struct { - INT SecondsSinceInitialize; - INT ModeID; - INT OptionalSubModeID; - INT LevelID; - INT OptionalSubLevelID; - INT LevelInstanceID; - INT MultiplayerInstanceID; - INT UpsellID; - INT MarketplaceOfferID; - INT UpsellOutcome; + int SecondsSinceInitialize; + int ModeID; + int OptionalSubModeID; + int LevelID; + int OptionalSubLevelID; + int LevelInstanceID; + int MultiplayerInstanceID; + int UpsellID; + int MarketplaceOfferID; + int UpsellOutcome; } LocalStruct = { SecondsSinceInitialize, ModeID, OptionalSubModeID, LevelID, OptionalSubLevelID, LevelInstanceID, MultiplayerInstanceID, UpsellID, MarketplaceOfferID, UpsellOutcome }; SenStat st; st.dwUserID = dwUserID; st.dwStatID = 141; st.dwFlags = SenStatFlag_Normal; st.dwNumProperties = 10; - st.arrProperties = (CHAR*)&LocalStruct; + st.arrProperties = (char*)&LocalStruct; st.dwNumValues = 0; st.arrValues = NULL; st.arrValueFlags = NULL; @@ -501,37 +501,37 @@ BOOL SenStatUpsellResponded ( DWORD dwUserID, INT SecondsSinceI } // PlayerDiedOrFailed -BOOL SenStatPlayerDiedOrFailed ( DWORD dwUserID, INT ModeID, INT OptionalSubModeID, INT LevelID, INT OptionalSubLevelID, INT LevelInstanceID, INT MultiplayerInstanceID, INT LowResMapX, INT LowResMapY, INT LowResMapZ, INT MapID, INT PlayerWeaponID, INT EnemyWeaponID, INT EnemyTypeID, INT SecondsSinceInitialize, INT CopyOfSecondsSinceInitialize ) +bool SenStatPlayerDiedOrFailed ( unsigned long dwUserID, int ModeID, int OptionalSubModeID, int LevelID, int OptionalSubLevelID, int LevelInstanceID, int MultiplayerInstanceID, int LowResMapX, int LowResMapY, int LowResMapZ, int MapID, int PlayerWeaponID, int EnemyWeaponID, int EnemyTypeID, int SecondsSinceInitialize, int CopyOfSecondsSinceInitialize ) { struct { - INT ModeID; - INT OptionalSubModeID; - INT LevelID; - INT OptionalSubLevelID; - INT LevelInstanceID; - INT MultiplayerInstanceID; - INT LowResMapX; - INT LowResMapY; - INT LowResMapZ; - INT MapID; - INT PlayerWeaponID; - INT EnemyWeaponID; - INT EnemyTypeID; - INT SecondsSinceInitialize; - INT CopyOfSecondsSinceInitialize; - INT Count; + int ModeID; + int OptionalSubModeID; + int LevelID; + int OptionalSubLevelID; + int LevelInstanceID; + int MultiplayerInstanceID; + int LowResMapX; + int LowResMapY; + int LowResMapZ; + int MapID; + int PlayerWeaponID; + int EnemyWeaponID; + int EnemyTypeID; + int SecondsSinceInitialize; + int CopyOfSecondsSinceInitialize; + int Count; } LocalStruct = { ModeID, OptionalSubModeID, LevelID, OptionalSubLevelID, LevelInstanceID, MultiplayerInstanceID, LowResMapX, LowResMapY, LowResMapZ, MapID, PlayerWeaponID, EnemyWeaponID, EnemyTypeID, SecondsSinceInitialize, CopyOfSecondsSinceInitialize, 1 }; - DWORD arrValueFlags[] = { SenStatValueFlag_Min, SenStatValueFlag_Max, SenStatValueFlag_Inc }; + unsigned long arrValueFlags[] = { SenStatValueFlag_Min, SenStatValueFlag_Max, SenStatValueFlag_Inc }; SenStat st; st.dwUserID = dwUserID; st.dwStatID = 142; st.dwFlags = SenStatFlag_Normal; st.dwNumProperties = 13; - st.arrProperties = (CHAR*)&LocalStruct; + st.arrProperties = (char*)&LocalStruct; st.dwNumValues = 3; - st.arrValues = (CHAR*)&LocalStruct.SecondsSinceInitialize; + st.arrValues = (char*)&LocalStruct.SecondsSinceInitialize; st.arrValueFlags = arrValueFlags; #ifdef SEN_LOGTELEMETRY @@ -544,37 +544,37 @@ BOOL SenStatPlayerDiedOrFailed ( DWORD dwUserID, INT ModeID, INT O } // EnemyKilledOrOvercome -BOOL SenStatEnemyKilledOrOvercome ( DWORD dwUserID, INT ModeID, INT OptionalSubModeID, INT LevelID, INT OptionalSubLevelID, INT LevelInstanceID, INT MultiplayerInstanceID, INT LowResMapX, INT LowResMapY, INT LowResMapZ, INT MapID, INT PlayerWeaponID, INT EnemyWeaponID, INT EnemyTypeID, INT SecondsSinceInitialize, INT CopyOfSecondsSinceInitialize ) +bool SenStatEnemyKilledOrOvercome ( unsigned long dwUserID, int ModeID, int OptionalSubModeID, int LevelID, int OptionalSubLevelID, int LevelInstanceID, int MultiplayerInstanceID, int LowResMapX, int LowResMapY, int LowResMapZ, int MapID, int PlayerWeaponID, int EnemyWeaponID, int EnemyTypeID, int SecondsSinceInitialize, int CopyOfSecondsSinceInitialize ) { struct { - INT ModeID; - INT OptionalSubModeID; - INT LevelID; - INT OptionalSubLevelID; - INT LevelInstanceID; - INT MultiplayerInstanceID; - INT LowResMapX; - INT LowResMapY; - INT LowResMapZ; - INT MapID; - INT PlayerWeaponID; - INT EnemyWeaponID; - INT EnemyTypeID; - INT SecondsSinceInitialize; - INT CopyOfSecondsSinceInitialize; - INT Count; + int ModeID; + int OptionalSubModeID; + int LevelID; + int OptionalSubLevelID; + int LevelInstanceID; + int MultiplayerInstanceID; + int LowResMapX; + int LowResMapY; + int LowResMapZ; + int MapID; + int PlayerWeaponID; + int EnemyWeaponID; + int EnemyTypeID; + int SecondsSinceInitialize; + int CopyOfSecondsSinceInitialize; + int Count; } LocalStruct = { ModeID, OptionalSubModeID, LevelID, OptionalSubLevelID, LevelInstanceID, MultiplayerInstanceID, LowResMapX, LowResMapY, LowResMapZ, MapID, PlayerWeaponID, EnemyWeaponID, EnemyTypeID, SecondsSinceInitialize, CopyOfSecondsSinceInitialize, 1 }; - DWORD arrValueFlags[] = { SenStatValueFlag_Min, SenStatValueFlag_Max, SenStatValueFlag_Inc }; + unsigned long arrValueFlags[] = { SenStatValueFlag_Min, SenStatValueFlag_Max, SenStatValueFlag_Inc }; SenStat st; st.dwUserID = dwUserID; st.dwStatID = 143; st.dwFlags = SenStatFlag_Normal; st.dwNumProperties = 13; - st.arrProperties = (CHAR*)&LocalStruct; + st.arrProperties = (char*)&LocalStruct; st.dwNumValues = 3; - st.arrValues = (CHAR*)&LocalStruct.SecondsSinceInitialize; + st.arrValues = (char*)&LocalStruct.SecondsSinceInitialize; st.arrValueFlags = arrValueFlags; #ifdef SEN_LOGTELEMETRY @@ -587,25 +587,25 @@ BOOL SenStatEnemyKilledOrOvercome ( DWORD dwUserID, INT ModeID, INT O } // SkinChanged -BOOL SenStatSkinChanged ( DWORD dwUserID, INT SecondsSinceInitialize, INT ModeID, INT OptionalSubModeID, INT LevelID, INT OptionalSubLevelID, INT LevelInstanceID, INT MultiplayerInstanceID, INT SkinID ) +bool SenStatSkinChanged ( unsigned long dwUserID, int SecondsSinceInitialize, int ModeID, int OptionalSubModeID, int LevelID, int OptionalSubLevelID, int LevelInstanceID, int MultiplayerInstanceID, int SkinID ) { struct { - INT SecondsSinceInitialize; - INT ModeID; - INT OptionalSubModeID; - INT LevelID; - INT OptionalSubLevelID; - INT LevelInstanceID; - INT MultiplayerInstanceID; - INT SkinID; + int SecondsSinceInitialize; + int ModeID; + int OptionalSubModeID; + int LevelID; + int OptionalSubLevelID; + int LevelInstanceID; + int MultiplayerInstanceID; + int SkinID; } LocalStruct = { SecondsSinceInitialize, ModeID, OptionalSubModeID, LevelID, OptionalSubLevelID, LevelInstanceID, MultiplayerInstanceID, SkinID }; SenStat st; st.dwUserID = dwUserID; st.dwStatID = 144; st.dwFlags = SenStatFlag_Normal; st.dwNumProperties = 8; - st.arrProperties = (CHAR*)&LocalStruct; + st.arrProperties = (char*)&LocalStruct; st.dwNumValues = 0; st.arrValues = NULL; st.arrValueFlags = NULL; @@ -620,24 +620,24 @@ BOOL SenStatSkinChanged ( DWORD dwUserID, INT SecondsSinceI } // BanLevel -BOOL SenStatBanLevel ( DWORD dwUserID, INT SecondsSinceInitialize, INT ModeID, INT OptionalSubModeID, INT LevelID, INT OptionalSubLevelID, INT LevelInstanceID, INT MultiplayerInstanceID ) +bool SenStatBanLevel ( unsigned long dwUserID, int SecondsSinceInitialize, int ModeID, int OptionalSubModeID, int LevelID, int OptionalSubLevelID, int LevelInstanceID, int MultiplayerInstanceID ) { struct { - INT SecondsSinceInitialize; - INT ModeID; - INT OptionalSubModeID; - INT LevelID; - INT OptionalSubLevelID; - INT LevelInstanceID; - INT MultiplayerInstanceID; + int SecondsSinceInitialize; + int ModeID; + int OptionalSubModeID; + int LevelID; + int OptionalSubLevelID; + int LevelInstanceID; + int MultiplayerInstanceID; } LocalStruct = { SecondsSinceInitialize, ModeID, OptionalSubModeID, LevelID, OptionalSubLevelID, LevelInstanceID, MultiplayerInstanceID }; SenStat st; st.dwUserID = dwUserID; st.dwStatID = 145; st.dwFlags = SenStatFlag_Normal; st.dwNumProperties = 7; - st.arrProperties = (CHAR*)&LocalStruct; + st.arrProperties = (char*)&LocalStruct; st.dwNumValues = 0; st.arrValues = NULL; st.arrValueFlags = NULL; @@ -652,24 +652,24 @@ BOOL SenStatBanLevel ( DWORD dwUserID, INT SecondsSinceI } // UnBanLevel -BOOL SenStatUnBanLevel ( DWORD dwUserID, INT SecondsSinceInitialize, INT ModeID, INT OptionalSubModeID, INT LevelID, INT OptionalSubLevelID, INT LevelInstanceID, INT MultiplayerInstanceID ) +bool SenStatUnBanLevel ( unsigned long dwUserID, int SecondsSinceInitialize, int ModeID, int OptionalSubModeID, int LevelID, int OptionalSubLevelID, int LevelInstanceID, int MultiplayerInstanceID ) { struct { - INT SecondsSinceInitialize; - INT ModeID; - INT OptionalSubModeID; - INT LevelID; - INT OptionalSubLevelID; - INT LevelInstanceID; - INT MultiplayerInstanceID; + int SecondsSinceInitialize; + int ModeID; + int OptionalSubModeID; + int LevelID; + int OptionalSubLevelID; + int LevelInstanceID; + int MultiplayerInstanceID; } LocalStruct = { SecondsSinceInitialize, ModeID, OptionalSubModeID, LevelID, OptionalSubLevelID, LevelInstanceID, MultiplayerInstanceID }; SenStat st; st.dwUserID = dwUserID; st.dwStatID = 146; st.dwFlags = SenStatFlag_Normal; st.dwNumProperties = 7; - st.arrProperties = (CHAR*)&LocalStruct; + st.arrProperties = (char*)&LocalStruct; st.dwNumValues = 0; st.arrValues = NULL; st.arrValueFlags = NULL; @@ -684,26 +684,26 @@ BOOL SenStatUnBanLevel ( DWORD dwUserID, INT SecondsSinceI } // TexturePackChanged -BOOL SenStatTexturePackChanged ( DWORD dwUserID, INT SecondsSinceInitialize, INT ModeID, INT OptionalSubModeID, INT LevelID, INT OptionalSubLevelID, INT LevelInstanceID, INT MultiplayerInstanceID, INT TexturePackId, INT Purchased ) +bool SenStatTexturePackChanged ( unsigned long dwUserID, int SecondsSinceInitialize, int ModeID, int OptionalSubModeID, int LevelID, int OptionalSubLevelID, int LevelInstanceID, int MultiplayerInstanceID, int TexturePackId, int Purchased ) { struct { - INT SecondsSinceInitialize; - INT ModeID; - INT OptionalSubModeID; - INT LevelID; - INT OptionalSubLevelID; - INT LevelInstanceID; - INT MultiplayerInstanceID; - INT TexturePackId; - INT Purchased; + int SecondsSinceInitialize; + int ModeID; + int OptionalSubModeID; + int LevelID; + int OptionalSubLevelID; + int LevelInstanceID; + int MultiplayerInstanceID; + int TexturePackId; + int Purchased; } LocalStruct = { SecondsSinceInitialize, ModeID, OptionalSubModeID, LevelID, OptionalSubLevelID, LevelInstanceID, MultiplayerInstanceID, TexturePackId, Purchased }; SenStat st; st.dwUserID = dwUserID; st.dwStatID = 147; st.dwFlags = SenStatFlag_Normal; st.dwNumProperties = 9; - st.arrProperties = (CHAR*)&LocalStruct; + st.arrProperties = (char*)&LocalStruct; st.dwNumValues = 0; st.arrValues = NULL; st.arrValueFlags = NULL; diff --git a/src/client/Xbox/Sentient/SentientStats.h b/src/client/Xbox/Sentient/SentientStats.h index 9af0a0d9..d48c2e57 100644 --- a/src/client/Xbox/Sentient/SentientStats.h +++ b/src/client/Xbox/Sentient/SentientStats.h @@ -12,81 +12,81 @@ // PlayerSessionStart // Player signed in or joined -BOOL SenStatPlayerSessionStart ( DWORD dwUserID, INT SecondsSinceInitialize, INT ModeID, INT OptionalSubModeID, INT LevelID, INT OptionalSubLevelID, INT TitleBuildID, INT SkeletonDistanceInInches, INT EnrollmentType, INT NumberOfSkeletonsInView, INT DeploymentType ); +bool SenStatPlayerSessionStart ( unsigned long dwUserID, int SecondsSinceInitialize, int ModeID, int OptionalSubModeID, int LevelID, int OptionalSubLevelID, int TitleBuildID, int SkeletonDistanceInInches, int EnrollmentType, int NumberOfSkeletonsInView, int DeploymentType ); // PlayerSessionExit // Player signed out or left -BOOL SenStatPlayerSessionExit ( DWORD dwUserID, INT SecondsSinceInitialize, INT ModeID, INT OptionalSubModeID, INT LevelID, INT OptionalSubLevelID ); +bool SenStatPlayerSessionExit ( unsigned long dwUserID, int SecondsSinceInitialize, int ModeID, int OptionalSubModeID, int LevelID, int OptionalSubLevelID ); // HeartBeat // Sent every 60 seconds by title -BOOL SenStatHeartBeat ( DWORD dwUserID, INT SecondsSinceInitialize ); +bool SenStatHeartBeat ( unsigned long dwUserID, int SecondsSinceInitialize ); // LevelStart // Level started -BOOL SenStatLevelStart ( DWORD dwUserID, INT SecondsSinceInitialize, INT ModeID, INT OptionalSubModeID, INT LevelID, INT OptionalSubLevelID, INT LevelInstanceID, INT MultiplayerInstanceID, INT SingleOrMultiplayer, INT FriendsOrMatch, INT CompeteOrCoop, INT DifficultyLevel, INT NumberOfLocalPlayers, INT NumberOfOnlinePlayers, INT License, INT DefaultGameControls, INT AudioSettings, INT SkeletonDistanceInInches, INT NumberOfSkeletonsInView ); +bool SenStatLevelStart ( unsigned long dwUserID, int SecondsSinceInitialize, int ModeID, int OptionalSubModeID, int LevelID, int OptionalSubLevelID, int LevelInstanceID, int MultiplayerInstanceID, int SingleOrMultiplayer, int FriendsOrMatch, int CompeteOrCoop, int DifficultyLevel, int NumberOfLocalPlayers, int NumberOfOnlinePlayers, int License, int DefaultGameControls, int AudioSettings, int SkeletonDistanceInInches, int NumberOfSkeletonsInView ); // LevelExit // Level exited -BOOL SenStatLevelExit ( DWORD dwUserID, INT SecondsSinceInitialize, INT ModeID, INT OptionalSubModeID, INT LevelID, INT OptionalSubLevelID, INT LevelInstanceID, INT MultiplayerInstanceID, INT LevelExitStatus, INT LevelExitProgressStat1, INT LevelExitProgressStat2, INT LevelDurationInSeconds ); +bool SenStatLevelExit ( unsigned long dwUserID, int SecondsSinceInitialize, int ModeID, int OptionalSubModeID, int LevelID, int OptionalSubLevelID, int LevelInstanceID, int MultiplayerInstanceID, int LevelExitStatus, int LevelExitProgressStat1, int LevelExitProgressStat2, int LevelDurationInSeconds ); // LevelSaveOrCheckpoint // Level saved explicitly or implicitly -BOOL SenStatLevelSaveOrCheckpoint ( DWORD dwUserID, INT SecondsSinceInitialize, INT ModeID, INT OptionalSubModeID, INT LevelID, INT OptionalSubLevelID, INT LevelInstanceID, INT MultiplayerInstanceID, INT LevelExitProgressStat1, INT LevelExitProgressStat2, INT LevelDurationInSeconds, INT SaveOrCheckPointID, INT SaveSizeInBytes ); +bool SenStatLevelSaveOrCheckpoint ( unsigned long dwUserID, int SecondsSinceInitialize, int ModeID, int OptionalSubModeID, int LevelID, int OptionalSubLevelID, int LevelInstanceID, int MultiplayerInstanceID, int LevelExitProgressStat1, int LevelExitProgressStat2, int LevelDurationInSeconds, int SaveOrCheckPointID, int SaveSizeInBytes ); // LevelResume // Level resumed from a save or restarted at a checkpoint -BOOL SenStatLevelResume ( DWORD dwUserID, INT SecondsSinceInitialize, INT ModeID, INT OptionalSubModeID, INT LevelID, INT OptionalSubLevelID, INT LevelInstanceID, INT MultiplayerInstanceID, INT SingleOrMultiplayer, INT FriendsOrMatch, INT CompeteOrCoop, INT DifficultyLevel, INT NumberOfLocalPlayers, INT NumberOfOnlinePlayers, INT License, INT DefaultGameControls, INT SaveOrCheckPointID, INT AudioSettings, INT SkeletonDistanceInInches, INT NumberOfSkeletonsInView ); +bool SenStatLevelResume ( unsigned long dwUserID, int SecondsSinceInitialize, int ModeID, int OptionalSubModeID, int LevelID, int OptionalSubLevelID, int LevelInstanceID, int MultiplayerInstanceID, int SingleOrMultiplayer, int FriendsOrMatch, int CompeteOrCoop, int DifficultyLevel, int NumberOfLocalPlayers, int NumberOfOnlinePlayers, int License, int DefaultGameControls, int SaveOrCheckPointID, int AudioSettings, int SkeletonDistanceInInches, int NumberOfSkeletonsInView ); // PauseOrInactive // Player paused game or has become inactive, level and mode are for what the player is leaving -BOOL SenStatPauseOrInactive ( DWORD dwUserID, INT SecondsSinceInitialize, INT ModeID, INT OptionalSubModeID, INT LevelID, INT OptionalSubLevelID, INT LevelInstanceID, INT MultiplayerInstanceID ); +bool SenStatPauseOrInactive ( unsigned long dwUserID, int SecondsSinceInitialize, int ModeID, int OptionalSubModeID, int LevelID, int OptionalSubLevelID, int LevelInstanceID, int MultiplayerInstanceID ); // UnpauseOrActive // Player unpaused game or has become active, level and mode are for what the player is entering into -BOOL SenStatUnpauseOrActive ( DWORD dwUserID, INT SecondsSinceInitialize, INT ModeID, INT OptionalSubModeID, INT LevelID, INT OptionalSubLevelID, INT LevelInstanceID, INT MultiplayerInstanceID ); +bool SenStatUnpauseOrActive ( unsigned long dwUserID, int SecondsSinceInitialize, int ModeID, int OptionalSubModeID, int LevelID, int OptionalSubLevelID, int LevelInstanceID, int MultiplayerInstanceID ); // MenuShown // A menu screen or major menu area has been shown -BOOL SenStatMenuShown ( DWORD dwUserID, INT SecondsSinceInitialize, INT ModeID, INT OptionalSubModeID, INT LevelID, INT OptionalSubLevelID, INT MenuID, INT OptionalMenuSubID, INT LevelInstanceID, INT MultiplayerInstanceID ); +bool SenStatMenuShown ( unsigned long dwUserID, int SecondsSinceInitialize, int ModeID, int OptionalSubModeID, int LevelID, int OptionalSubLevelID, int MenuID, int OptionalMenuSubID, int LevelInstanceID, int MultiplayerInstanceID ); // AchievementUnlocked // An achievement was unlocked -BOOL SenStatAchievementUnlocked ( DWORD dwUserID, INT SecondsSinceInitialize, INT ModeID, INT OptionalSubModeID, INT LevelID, INT OptionalSubLevelID, INT LevelInstanceID, INT MultiplayerInstanceID, INT AchievementID, INT AchievementGamerscore ); +bool SenStatAchievementUnlocked ( unsigned long dwUserID, int SecondsSinceInitialize, int ModeID, int OptionalSubModeID, int LevelID, int OptionalSubLevelID, int LevelInstanceID, int MultiplayerInstanceID, int AchievementID, int AchievementGamerscore ); // MediaShareUpload // The user uploaded something to Kinect Share -BOOL SenStatMediaShareUpload ( DWORD dwUserID, INT SecondsSinceInitialize, INT ModeID, INT OptionalSubModeID, INT LevelID, INT OptionalSubLevelID, INT LevelInstanceID, INT MultiplayerInstanceID, INT MediaDestination, INT MediaType ); +bool SenStatMediaShareUpload ( unsigned long dwUserID, int SecondsSinceInitialize, int ModeID, int OptionalSubModeID, int LevelID, int OptionalSubLevelID, int LevelInstanceID, int MultiplayerInstanceID, int MediaDestination, int MediaType ); // UpsellPresented // The user is shown an upsell to purchase something -BOOL SenStatUpsellPresented ( DWORD dwUserID, INT SecondsSinceInitialize, INT ModeID, INT OptionalSubModeID, INT LevelID, INT OptionalSubLevelID, INT LevelInstanceID, INT MultiplayerInstanceID, INT UpsellID, INT MarketplaceOfferID ); +bool SenStatUpsellPresented ( unsigned long dwUserID, int SecondsSinceInitialize, int ModeID, int OptionalSubModeID, int LevelID, int OptionalSubLevelID, int LevelInstanceID, int MultiplayerInstanceID, int UpsellID, int MarketplaceOfferID ); // UpsellResponded // The user responded to the upsell -BOOL SenStatUpsellResponded ( DWORD dwUserID, INT SecondsSinceInitialize, INT ModeID, INT OptionalSubModeID, INT LevelID, INT OptionalSubLevelID, INT LevelInstanceID, INT MultiplayerInstanceID, INT UpsellID, INT MarketplaceOfferID, INT UpsellOutcome ); +bool SenStatUpsellResponded ( unsigned long dwUserID, int SecondsSinceInitialize, int ModeID, int OptionalSubModeID, int LevelID, int OptionalSubLevelID, int LevelInstanceID, int MultiplayerInstanceID, int UpsellID, int MarketplaceOfferID, int UpsellOutcome ); // PlayerDiedOrFailed // The player died or failed a challenge - can be used for many types of failure -BOOL SenStatPlayerDiedOrFailed ( DWORD dwUserID, INT ModeID, INT OptionalSubModeID, INT LevelID, INT OptionalSubLevelID, INT LevelInstanceID, INT MultiplayerInstanceID, INT LowResMapX, INT LowResMapY, INT LowResMapZ, INT MapID, INT PlayerWeaponID, INT EnemyWeaponID, INT EnemyTypeID, INT SecondsSinceInitialize, INT CopyOfSecondsSinceInitialize ); +bool SenStatPlayerDiedOrFailed ( unsigned long dwUserID, int ModeID, int OptionalSubModeID, int LevelID, int OptionalSubLevelID, int LevelInstanceID, int MultiplayerInstanceID, int LowResMapX, int LowResMapY, int LowResMapZ, int MapID, int PlayerWeaponID, int EnemyWeaponID, int EnemyTypeID, int SecondsSinceInitialize, int CopyOfSecondsSinceInitialize ); // EnemyKilledOrOvercome // The player killed an enemy or overcame or solved a major challenge -BOOL SenStatEnemyKilledOrOvercome ( DWORD dwUserID, INT ModeID, INT OptionalSubModeID, INT LevelID, INT OptionalSubLevelID, INT LevelInstanceID, INT MultiplayerInstanceID, INT LowResMapX, INT LowResMapY, INT LowResMapZ, INT MapID, INT PlayerWeaponID, INT EnemyWeaponID, INT EnemyTypeID, INT SecondsSinceInitialize, INT CopyOfSecondsSinceInitialize ); +bool SenStatEnemyKilledOrOvercome ( unsigned long dwUserID, int ModeID, int OptionalSubModeID, int LevelID, int OptionalSubLevelID, int LevelInstanceID, int MultiplayerInstanceID, int LowResMapX, int LowResMapY, int LowResMapZ, int MapID, int PlayerWeaponID, int EnemyWeaponID, int EnemyTypeID, int SecondsSinceInitialize, int CopyOfSecondsSinceInitialize ); // SkinChanged // The player has changed their skin, level and mode are for what the player is currently in -BOOL SenStatSkinChanged ( DWORD dwUserID, INT SecondsSinceInitialize, INT ModeID, INT OptionalSubModeID, INT LevelID, INT OptionalSubLevelID, INT LevelInstanceID, INT MultiplayerInstanceID, INT SkinID ); +bool SenStatSkinChanged ( unsigned long dwUserID, int SecondsSinceInitialize, int ModeID, int OptionalSubModeID, int LevelID, int OptionalSubLevelID, int LevelInstanceID, int MultiplayerInstanceID, int SkinID ); // BanLevel // The player has banned a level, level and mode are for what the player is currently in and banning -BOOL SenStatBanLevel ( DWORD dwUserID, INT SecondsSinceInitialize, INT ModeID, INT OptionalSubModeID, INT LevelID, INT OptionalSubLevelID, INT LevelInstanceID, INT MultiplayerInstanceID ); +bool SenStatBanLevel ( unsigned long dwUserID, int SecondsSinceInitialize, int ModeID, int OptionalSubModeID, int LevelID, int OptionalSubLevelID, int LevelInstanceID, int MultiplayerInstanceID ); // UnBanLevel // The player has unbanned a level, level and mode are for what the player is currently in and unbanning -BOOL SenStatUnBanLevel ( DWORD dwUserID, INT SecondsSinceInitialize, INT ModeID, INT OptionalSubModeID, INT LevelID, INT OptionalSubLevelID, INT LevelInstanceID, INT MultiplayerInstanceID ); +bool SenStatUnBanLevel ( unsigned long dwUserID, int SecondsSinceInitialize, int ModeID, int OptionalSubModeID, int LevelID, int OptionalSubLevelID, int LevelInstanceID, int MultiplayerInstanceID ); // TexturePackChanged // The player has changed their texture pack, level and mode are for what the player is currently in -BOOL SenStatTexturePackChanged ( DWORD dwUserID, INT SecondsSinceInitialize, INT ModeID, INT OptionalSubModeID, INT LevelID, INT OptionalSubLevelID, INT LevelInstanceID, INT MultiplayerInstanceID, INT TexturePackId, INT Purchased ); +bool SenStatTexturePackChanged ( unsigned long dwUserID, int SecondsSinceInitialize, int ModeID, int OptionalSubModeID, int LevelID, int OptionalSubLevelID, int LevelInstanceID, int MultiplayerInstanceID, int TexturePackId, int Purchased ); diff --git a/src/client/Xbox/Social/SocialManager.cpp b/src/client/Xbox/Social/SocialManager.cpp index a0720814..18d92b30 100644 --- a/src/client/Xbox/Social/SocialManager.cpp +++ b/src/client/Xbox/Social/SocialManager.cpp @@ -16,7 +16,7 @@ /////////////////////////////////////////////////////////////////////////// // Table of SDK IDs for the social networks. -static const DWORD kaSocialNetworkIDS[ eNumSocialNetworks ] = +static const unsigned long kaSocialNetworkIDS[ eNumSocialNetworks ] = { 2, // eFacebook }; @@ -24,14 +24,14 @@ static const DWORD kaSocialNetworkIDS[ eNumSocialNetworks ] = // WESTY : Not sure if we even need to get social access key! /* // Table of social network permissions that we will required to post. -static const LPCWSTR kaSocialNetworkRequiredPermissions[ eNumSocialNetworks ] = +static const const wchar_t* kaSocialNetworkRequiredPermissions[ eNumSocialNetworks ] = { L"publish_stream", // eFacebook }; // Default size to use for social network access key text. -static const DWORD kDefaultAccessKeyTextSize = 64; +static const unsigned long kDefaultAccessKeyTextSize = 64; */ @@ -77,9 +77,9 @@ CSocialManager::CSocialManager() m_PostPreviewImage.pBytes = NULL; m_dwCurrRequestUser = -1; - ZeroMemory(m_wchTitleA,sizeof(WCHAR)*MAX_SOCIALPOST_CAPTION); - ZeroMemory(m_wchCaptionA,sizeof(WCHAR)*MAX_SOCIALPOST_CAPTION); - ZeroMemory(m_wchDescA,sizeof(WCHAR)*MAX_SOCIALPOST_DESC); + ZeroMemory(m_wchTitleA,sizeof(wchar_t)*MAX_SOCIALPOST_CAPTION); + ZeroMemory(m_wchCaptionA,sizeof(wchar_t)*MAX_SOCIALPOST_CAPTION); + ZeroMemory(m_wchDescA,sizeof(wchar_t)*MAX_SOCIALPOST_DESC); } @@ -108,7 +108,7 @@ void CSocialManager::Tick() case eStateGetPostingCapability: { // Poll for result. - DWORD dwResult = XGetOverlappedResult( &( m_Overlapped ), &( m_dwOverlappedResultCode ), false ); + unsigned long dwResult = XGetOverlappedResult( &( m_Overlapped ), &( m_dwOverlappedResultCode ), false ); switch( dwResult ) { @@ -136,7 +136,7 @@ void CSocialManager::Tick() case eStatePostingImage: { // Poll for result. - DWORD dwResult = XGetOverlappedResult( &( m_Overlapped ), &( m_dwOverlappedResultCode ), false ); + unsigned long dwResult = XGetOverlappedResult( &( m_Overlapped ), &( m_dwOverlappedResultCode ), false ); switch( dwResult ) { @@ -172,7 +172,7 @@ void CSocialManager::Tick() case eStatePostingLink: { // Poll for result. - DWORD dwResult = XGetOverlappedResult( &( m_Overlapped ), &( m_dwOverlappedResultCode ), false ); + unsigned long dwResult = XGetOverlappedResult( &( m_Overlapped ), &( m_dwOverlappedResultCode ), false ); switch( dwResult ) { @@ -223,7 +223,7 @@ bool CSocialManager::RefreshPostingCapability() XMemSet( &m_Overlapped, 0, sizeof(XOVERLAPPED) ); - DWORD dwResult = XSocialGetCapabilities( &( m_dwSocialPostingCapability ), &( m_Overlapped ) ); + unsigned long dwResult = XSocialGetCapabilities( &( m_dwSocialPostingCapability ), &( m_Overlapped ) ); switch( dwResult ) { @@ -235,7 +235,7 @@ bool CSocialManager::RefreshPostingCapability() case ERROR_FUNCTION_FAILED: { // Hmm ... why would it fail, and what are we meant to do about it? - DWORD dwExtendedError = XGetOverlappedExtendedError( &( m_Overlapped ) ); + unsigned long dwExtendedError = XGetOverlappedExtendedError( &( m_Overlapped ) ); app.DebugPrintf( "XSocialGetCapabilities ASYNC : FAILED : Extended Error %d\n", dwExtendedError ); //assert( false ); } @@ -244,7 +244,7 @@ bool CSocialManager::RefreshPostingCapability() default: { // Should never get in here. - DWORD dwExtendedError = XGetOverlappedExtendedError( &( m_Overlapped ) ); + unsigned long dwExtendedError = XGetOverlappedExtendedError( &( m_Overlapped ) ); app.DebugPrintf( "XSocialGetCapabilities ASYNC : FAILED : Extended Error %d\n", dwExtendedError ); //assert( false ); } @@ -282,7 +282,7 @@ bool CSocialManager::IsTitleAllowedToPostLinks() bool CSocialManager::AreAllUsersAllowedToPostImages() { // catch no user being signed in to LIVE here too (or a local disconnect) - BOOL bUserAllowedToPost=false; + bool bUserAllowedToPost=false; for(int i=0;iSetParseProgress( (DWORD)iProgress ); + int64_t iProgress = m_dwCharsTotal ? (( (int64_t)m_dwCharsConsumed * 1000 ) / (int64_t)m_dwCharsTotal) : 0; + m_pISAXCallback->SetParseProgress( (unsigned long)iProgress ); m_pReadBuf[ NChars ] = '\0'; m_pReadBuf[ NChars + 1] = '\0'; @@ -81,7 +81,7 @@ VOID XMLParser::FillBuffer() // Name: XMLParser::SkipNextAdvance // Desc: Puts the last character read back on the input stream //------------------------------------------------------------------------------------- -VOID XMLParser::SkipNextAdvance() +void XMLParser::SkipNextAdvance() { m_bSkipNextAdvance = true; } @@ -91,9 +91,9 @@ VOID XMLParser::SkipNextAdvance() // Name: XMLParser::ConsumeSpace // Desc: Skips spaces in the current stream //------------------------------------------------------------------------------------- -HRESULT XMLParser::ConsumeSpace() +int XMLParser::ConsumeSpace() { - HRESULT hr; + int hr; // Skip spaces if( FAILED( hr = AdvanceCharacter() ) ) @@ -114,10 +114,10 @@ HRESULT XMLParser::ConsumeSpace() // Name: XMLParser::ConvertEscape // Desc: Copies and converts an escape sequence into m_pWriteBuf //------------------------------------------------------------------------------------- -HRESULT XMLParser::ConvertEscape() +int XMLParser::ConvertEscape() { - HRESULT hr; - WCHAR wVal = 0; + int hr; + wchar_t wVal = 0; if( FAILED( hr = AdvanceCharacter() ) ) return hr; @@ -191,14 +191,14 @@ HRESULT XMLParser::ConvertEscape() // must be an entity reference - WCHAR *pEntityRefVal = m_pWritePtr; - UINT EntityRefLen; + wchar_t *pEntityRefVal = m_pWritePtr; + unsigned int EntityRefLen; SkipNextAdvance(); if( FAILED( hr = AdvanceName() ) ) return hr; - EntityRefLen = (UINT)( m_pWritePtr - pEntityRefVal ); + EntityRefLen = (unsigned int)( m_pWritePtr - pEntityRefVal ); m_pWritePtr = pEntityRefVal; if ( EntityRefLen == 0 ) @@ -241,10 +241,10 @@ HRESULT XMLParser::ConvertEscape() // Name: XMLParser::AdvanceAttrVal // Desc: Copies an attribute value into m_pWrite buf, skipping surrounding quotes //------------------------------------------------------------------------------------- -HRESULT XMLParser::AdvanceAttrVal() +int XMLParser::AdvanceAttrVal() { - HRESULT hr; - WCHAR wQuoteChar; + int hr; + wchar_t wQuoteChar; if( FAILED( hr = AdvanceCharacter() ) ) return hr; @@ -295,9 +295,9 @@ HRESULT XMLParser::AdvanceAttrVal() // Desc: Copies a name into the m_pWriteBuf - returns true on success, false on failure // Ignores leading whitespace. Currently does not support unicode names //------------------------------------------------------------------------------------- -HRESULT XMLParser::AdvanceName() +int XMLParser::AdvanceName() { - HRESULT hr; + int hr; if( FAILED( hr = AdvanceCharacter() ) ) return hr; @@ -342,7 +342,7 @@ HRESULT XMLParser::AdvanceName() // and getting another chunk of the file if needed // Returns S_OK if there are more characters, E_ABORT for no characters to read //------------------------------------------------------------------------------------- -HRESULT XMLParser::AdvanceCharacter( BOOL bOkToFail ) +int XMLParser::AdvanceCharacter( bool bOkToFail ) { if( m_bSkipNextAdvance ) { @@ -376,12 +376,12 @@ HRESULT XMLParser::AdvanceCharacter( BOOL bOkToFail ) if( m_bUnicode == false ) { - m_Ch = *((CHAR *)m_pReadPtr); + m_Ch = *((char *)m_pReadPtr); m_pReadPtr++; } else // if( m_bUnicode == true ) { - m_Ch = *((WCHAR *)m_pReadPtr); + m_Ch = *((wchar_t *)m_pReadPtr); if( m_bReverseBytes ) { @@ -407,9 +407,9 @@ HRESULT XMLParser::AdvanceCharacter( BOOL bOkToFail ) // Name: XMLParser::AdvanceElement // Desc: Builds data, calls callback //------------------------------------------------------------------------------------- -HRESULT XMLParser::AdvanceElement() +int XMLParser::AdvanceElement() { - HRESULT hr; + int hr; // write ptr at the beginning of the buffer m_pWritePtr = m_pWriteBuf; @@ -492,13 +492,13 @@ HRESULT XMLParser::AdvanceElement() } else if( m_Ch == '/' ) { - WCHAR *pEntityRefVal = m_pWritePtr; + wchar_t *pEntityRefVal = m_pWritePtr; if( FAILED( hr = AdvanceName() ) ) return hr; if( FAILED( m_pISAXCallback->ElementEnd( pEntityRefVal, - (UINT) ( m_pWritePtr - pEntityRefVal ) ) ) ) + (unsigned int) ( m_pWritePtr - pEntityRefVal ) ) ) ) return E_ABORT; if( FAILED( hr = ConsumeSpace() ) ) @@ -528,10 +528,10 @@ HRESULT XMLParser::AdvanceElement() else { XMLAttribute Attributes[ XML_MAX_ATTRIBUTES_PER_ELEMENT ]; - UINT NumAttrs; + unsigned int NumAttrs; - WCHAR *pEntityRefVal = m_pWritePtr; - UINT EntityRefLen; + wchar_t *pEntityRefVal = m_pWritePtr; + unsigned int EntityRefLen; NumAttrs = 0; @@ -541,7 +541,7 @@ HRESULT XMLParser::AdvanceElement() if( FAILED( hr = AdvanceName() ) ) return hr; - EntityRefLen = (UINT)( m_pWritePtr - pEntityRefVal ); + EntityRefLen = (unsigned int)( m_pWritePtr - pEntityRefVal ); if( FAILED( hr = ConsumeSpace() ) ) return hr; @@ -566,7 +566,7 @@ HRESULT XMLParser::AdvanceElement() if( FAILED( hr = AdvanceName() ) ) return hr; - Attributes[ NumAttrs ].NameLen = (UINT)( m_pWritePtr - Attributes[ NumAttrs ].strName ); + Attributes[ NumAttrs ].NameLen = (unsigned int)( m_pWritePtr - Attributes[ NumAttrs ].strName ); if( FAILED( hr = ConsumeSpace() ) ) return hr; @@ -588,7 +588,7 @@ HRESULT XMLParser::AdvanceElement() if( FAILED( hr = AdvanceAttrVal() ) ) return hr; - Attributes[ NumAttrs ].ValueLen = (UINT)( m_pWritePtr - + Attributes[ NumAttrs ].ValueLen = (unsigned int)( m_pWritePtr - Attributes[ NumAttrs ].strValue ); ++NumAttrs; @@ -633,10 +633,10 @@ HRESULT XMLParser::AdvanceElement() // Name: XMLParser::AdvanceCDATA // Desc: Read a CDATA section //------------------------------------------------------------------------------------- -HRESULT XMLParser::AdvanceCDATA() +int XMLParser::AdvanceCDATA() { - HRESULT hr; - WORD wStage = 0; + int hr; + uint16_t wStage = 0; if( FAILED( m_pISAXCallback->CDATABegin() ) ) return E_ABORT; @@ -663,13 +663,13 @@ HRESULT XMLParser::AdvanceCDATA() if( m_pWritePtr - m_pWriteBuf >= XML_WRITE_BUFFER_SIZE ) { - if( FAILED( m_pISAXCallback->CDATAData( m_pWriteBuf, (UINT)( m_pWritePtr - m_pWriteBuf ), true ) ) ) + if( FAILED( m_pISAXCallback->CDATAData( m_pWriteBuf, (unsigned int)( m_pWritePtr - m_pWriteBuf ), true ) ) ) return E_ABORT; m_pWritePtr = m_pWriteBuf; } } - if( FAILED( m_pISAXCallback->CDATAData( m_pWriteBuf, (UINT)( m_pWritePtr - m_pWriteBuf ), false ) ) ) + if( FAILED( m_pISAXCallback->CDATAData( m_pWriteBuf, (unsigned int)( m_pWritePtr - m_pWriteBuf ), false ) ) ) return E_ABORT; m_pWritePtr = m_pWriteBuf; @@ -684,10 +684,10 @@ HRESULT XMLParser::AdvanceCDATA() // Name: XMLParser::AdvanceComment // Desk: Skips over a comment //------------------------------------------------------------------------------------- -HRESULT XMLParser::AdvanceComment() +int XMLParser::AdvanceComment() { - HRESULT hr; - WORD wStage; + int hr; + uint16_t wStage; wStage = 0; for( ;; ) @@ -713,7 +713,7 @@ HRESULT XMLParser::AdvanceComment() // Name: XMLParser::RegisterSAXCallbackInterface // Desc: Registers callback interface //------------------------------------------------------------------------------------- -VOID XMLParser::RegisterSAXCallbackInterface( ISAXCallback *pISAXCallback ) +void XMLParser::RegisterSAXCallbackInterface( ISAXCallback *pISAXCallback ) { m_pISAXCallback = pISAXCallback; } @@ -733,10 +733,10 @@ ISAXCallback* XMLParser::GetSAXCallbackInterface() // Name: XMLParser::MainParseLoop // Desc: Main Loop to Parse Data - source agnostic //------------------------------------------------------------------------------------- -HRESULT XMLParser::MainParseLoop() +int XMLParser::MainParseLoop() { - BOOL bWhiteSpaceOnly = true; - HRESULT hr = S_OK; + bool bWhiteSpaceOnly = true; + int hr = S_OK; if( FAILED( m_pISAXCallback->StartDocument() ) ) return E_ABORT; @@ -745,24 +745,24 @@ HRESULT XMLParser::MainParseLoop() FillBuffer(); - if ( *((WCHAR *) m_pReadBuf ) == 0xFEFF ) + if ( *((wchar_t *) m_pReadBuf ) == 0xFEFF ) { m_bUnicode = true; m_bReverseBytes = false; m_pReadPtr += 2; } - else if ( *((WCHAR *) m_pReadBuf ) == 0xFFFE ) + else if ( *((wchar_t *) m_pReadBuf ) == 0xFFFE ) { m_bUnicode = true; m_bReverseBytes = true; m_pReadPtr += 2; } - else if ( *((WCHAR *) m_pReadBuf ) == 0x003C ) + else if ( *((wchar_t *) m_pReadBuf ) == 0x003C ) { m_bUnicode = true; m_bReverseBytes = false; } - else if ( *((WCHAR *) m_pReadBuf ) == 0x3C00 ) + else if ( *((wchar_t *) m_pReadBuf ) == 0x3C00 ) { m_bUnicode = true; m_bReverseBytes = true; @@ -782,9 +782,9 @@ HRESULT XMLParser::MainParseLoop() { if( FAILED( AdvanceCharacter( true ) ) ) { - if ( ( (UINT) ( m_pWritePtr - m_pWriteBuf ) != 0 ) && ( !bWhiteSpaceOnly ) ) + if ( ( (unsigned int) ( m_pWritePtr - m_pWriteBuf ) != 0 ) && ( !bWhiteSpaceOnly ) ) { - if( FAILED( m_pISAXCallback->ElementContent( m_pWriteBuf, (UINT)( m_pWritePtr - m_pWriteBuf ), false ) ) ) + if( FAILED( m_pISAXCallback->ElementContent( m_pWriteBuf, (unsigned int)( m_pWritePtr - m_pWriteBuf ), false ) ) ) return E_ABORT; bWhiteSpaceOnly = true; @@ -798,9 +798,9 @@ HRESULT XMLParser::MainParseLoop() if( m_Ch == '<' ) { - if( ( (UINT) ( m_pWritePtr - m_pWriteBuf ) != 0 ) && ( !bWhiteSpaceOnly ) ) + if( ( (unsigned int) ( m_pWritePtr - m_pWriteBuf ) != 0 ) && ( !bWhiteSpaceOnly ) ) { - if( FAILED( m_pISAXCallback->ElementContent( m_pWriteBuf, (UINT)( m_pWritePtr - m_pWriteBuf ), false ) ) ) + if( FAILED( m_pISAXCallback->ElementContent( m_pWriteBuf, (unsigned int)( m_pWritePtr - m_pWriteBuf ), false ) ) ) return E_ABORT; bWhiteSpaceOnly = true; @@ -838,7 +838,7 @@ HRESULT XMLParser::MainParseLoop() if( !bWhiteSpaceOnly ) { if( FAILED( m_pISAXCallback->ElementContent( m_pWriteBuf, - ( UINT ) ( m_pWritePtr - m_pWriteBuf ), + ( unsigned int ) ( m_pWritePtr - m_pWriteBuf ), true ) ) ) { return E_ABORT; @@ -857,9 +857,9 @@ HRESULT XMLParser::MainParseLoop() // Name: XMLParser::ParseXMLFile // Desc: Builds element data //------------------------------------------------------------------------------------- -HRESULT XMLParser::ParseXMLFile( CONST CHAR *strFilename ) +int XMLParser::ParseXMLFile( const char *strFilename ) { - HRESULT hr; + int hr; if( m_pISAXCallback == NULL ) return E_NOINTERFACE; @@ -888,7 +888,7 @@ HRESULT XMLParser::ParseXMLFile( CONST CHAR *strFilename ) { LARGE_INTEGER iFileSize; GetFileSizeEx( m_hFile, &iFileSize ); - m_dwCharsTotal = (DWORD)iFileSize.QuadPart; + m_dwCharsTotal = (unsigned long)iFileSize.QuadPart; m_dwCharsConsumed = 0; hr = MainParseLoop(); } @@ -908,9 +908,9 @@ HRESULT XMLParser::ParseXMLFile( CONST CHAR *strFilename ) // Name: XMLParser::ParseXMLFile // Desc: Builds element data //------------------------------------------------------------------------------------- -HRESULT XMLParser::ParseXMLBuffer( CONST CHAR *strBuffer, UINT uBufferSize ) +int XMLParser::ParseXMLBuffer( const char *strBuffer, unsigned int uBufferSize ) { - HRESULT hr; + int hr; if( m_pISAXCallback == NULL ) return E_NOINTERFACE; @@ -944,13 +944,13 @@ HRESULT XMLParser::ParseXMLBuffer( CONST CHAR *strBuffer, UINT uBufferSize ) // Logs an error through the callback interface //------------------------------------------------------------------------------------- #ifdef _Printf_format_string_ // VC++ 2008 and later support this annotation -VOID XMLParser::Error( HRESULT hErr, _In_z_ _Printf_format_string_ CONST CHAR* strFormat, ... ) +void XMLParser::Error( int hErr, _In_z_ _Printf_format_string_ const char* strFormat, ... ) #else -VOID XMLParser::Error( HRESULT hErr, CONST CHAR* strFormat, ... ) +void XMLParser::Error( int hErr, const char* strFormat, ... ) #endif { - CONST INT MAX_OUTPUT_STR = 160; - CHAR strBuffer[ MAX_OUTPUT_STR ]; + const int MAX_OUTPUT_STR = 160; + char strBuffer[ MAX_OUTPUT_STR ]; va_list pArglist; va_start( pArglist, strFormat ); diff --git a/src/client/Xbox/XML/ATGXmlParser.h b/src/client/Xbox/XML/ATGXmlParser.h index 2da6fe48..7c0babd4 100644 --- a/src/client/Xbox/XML/ATGXmlParser.h +++ b/src/client/Xbox/XML/ATGXmlParser.h @@ -28,10 +28,10 @@ namespace ATG #define E_INVALID_XML_SYNTAX MAKE_HRESULT(1, _ATGFAC, 0x0002 ) -CONST UINT XML_MAX_ATTRIBUTES_PER_ELEMENT = 32; -CONST UINT XML_MAX_NAME_LENGTH = 128; -CONST UINT XML_READ_BUFFER_SIZE = 2048; -CONST UINT XML_WRITE_BUFFER_SIZE = 2048; +const unsigned int XML_MAX_ATTRIBUTES_PER_ELEMENT = 32; +const unsigned int XML_MAX_NAME_LENGTH = 128; +const unsigned int XML_READ_BUFFER_SIZE = 2048; +const unsigned int XML_WRITE_BUFFER_SIZE = 2048; // No tag can be longer than XML_WRITE_BUFFER_SIZE - an error will be returned if // it is @@ -39,10 +39,10 @@ CONST UINT XML_WRITE_BUFFER_SIZE = 2048; //------------------------------------------------------------------------------------- struct XMLAttribute { - WCHAR* strName; - UINT NameLen; - WCHAR* strValue; - UINT ValueLen; + wchar_t* strName; + unsigned int NameLen; + wchar_t* strValue; + unsigned int ValueLen; }; //------------------------------------------------------------------------------------- @@ -53,30 +53,30 @@ public: ISAXCallback() {}; virtual ~ISAXCallback() {}; - virtual HRESULT StartDocument() = 0; - virtual HRESULT EndDocument() = 0; + virtual int StartDocument() = 0; + virtual int EndDocument() = 0; - virtual HRESULT ElementBegin( CONST WCHAR* strName, UINT NameLen, - CONST XMLAttribute *pAttributes, UINT NumAttributes ) = 0; - virtual HRESULT ElementContent( CONST WCHAR *strData, UINT DataLen, BOOL More ) = 0; - virtual HRESULT ElementEnd( CONST WCHAR *strName, UINT NameLen ) = 0; + virtual int ElementBegin( const wchar_t* strName, unsigned int NameLen, + const XMLAttribute *pAttributes, unsigned int NumAttributes ) = 0; + virtual int ElementContent( const wchar_t *strData, unsigned int DataLen, bool More ) = 0; + virtual int ElementEnd( const wchar_t *strName, unsigned int NameLen ) = 0; - virtual HRESULT CDATABegin( ) = 0; - virtual HRESULT CDATAData( CONST WCHAR *strCDATA, UINT CDATALen, BOOL bMore ) = 0; - virtual HRESULT CDATAEnd( ) = 0; + virtual int CDATABegin( ) = 0; + virtual int CDATAData( const wchar_t *strCDATA, unsigned int CDATALen, bool bMore ) = 0; + virtual int CDATAEnd( ) = 0; - virtual VOID Error( HRESULT hError, CONST CHAR *strMessage ) = 0; + virtual void Error( int hError, const char *strMessage ) = 0; - virtual VOID SetParseProgress( DWORD dwProgress ) { } + virtual void SetParseProgress( unsigned long dwProgress ) { } - const CHAR* GetFilename() { return m_strFilename; } - UINT GetLineNumber() { return m_LineNum; } - UINT GetLinePosition() { return m_LinePos; } + const char* GetFilename() { return m_strFilename; } + unsigned int GetLineNumber() { return m_LineNum; } + unsigned int GetLinePosition() { return m_LinePos; } private: - CONST CHAR *m_strFilename; - UINT m_LineNum; - UINT m_LinePos; + const char *m_strFilename; + unsigned int m_LineNum; + unsigned int m_LinePos; }; @@ -88,7 +88,7 @@ public: ~XMLParser(); // Register an interface inheiriting from ISAXCallback - VOID RegisterSAXCallbackInterface( ISAXCallback *pISAXCallback ); + void RegisterSAXCallbackInterface( ISAXCallback *pISAXCallback ); // Get the registered interface ISAXCallback* GetSAXCallbackInterface(); @@ -100,55 +100,55 @@ public: // E_ABORT - callback returned a fail code // S_OK - file parsed and completed - HRESULT ParseXMLFile( CONST CHAR *strFilename ); + int ParseXMLFile( const char *strFilename ); - // Parses from a buffer- if you pass a WCHAR buffer (and cast it), it will + // Parses from a buffer- if you pass a wchar_t buffer (and cast it), it will // correctly detect it and use unicode instead. Return codes are the // same as for ParseXMLFile - HRESULT ParseXMLBuffer( CONST CHAR* strBuffer, UINT uBufferSize ); + int ParseXMLBuffer( const char* strBuffer, unsigned int uBufferSize ); private: - HRESULT MainParseLoop(); + int MainParseLoop(); - HRESULT AdvanceCharacter( BOOL bOkToFail = false ); - VOID SkipNextAdvance(); + int AdvanceCharacter( bool bOkToFail = false ); + void SkipNextAdvance(); - HRESULT ConsumeSpace(); - HRESULT ConvertEscape(); - HRESULT AdvanceElement(); - HRESULT AdvanceName(); - HRESULT AdvanceAttrVal(); - HRESULT AdvanceCDATA(); - HRESULT AdvanceComment(); + int ConsumeSpace(); + int ConvertEscape(); + int AdvanceElement(); + int AdvanceName(); + int AdvanceAttrVal(); + int AdvanceCDATA(); + int AdvanceComment(); - VOID FillBuffer(); + void FillBuffer(); #ifdef _Printf_format_string_ // VC++ 2008 and later support this annotation - VOID Error( HRESULT hRet, _In_z_ _Printf_format_string_ CONST CHAR* strFormat, ... ); + void Error( int hRet, _In_z_ _Printf_format_string_ const char* strFormat, ... ); #else - VOID Error( HRESULT hRet, CONST CHAR* strFormat, ... ); + void Error( int hRet, const char* strFormat, ... ); #endif ISAXCallback* m_pISAXCallback; - HANDLE m_hFile; - CONST CHAR* m_pInXMLBuffer; - UINT m_uInXMLBufferCharsLeft; - DWORD m_dwCharsTotal; - DWORD m_dwCharsConsumed; + void* m_hFile; + const char* m_pInXMLBuffer; + unsigned int m_uInXMLBufferCharsLeft; + unsigned long m_dwCharsTotal; + unsigned long m_dwCharsConsumed; - BYTE m_pReadBuf[ XML_READ_BUFFER_SIZE + 2 ]; // room for a trailing NULL - WCHAR m_pWriteBuf[ XML_WRITE_BUFFER_SIZE ]; + uint8_t m_pReadBuf[ XML_READ_BUFFER_SIZE + 2 ]; // room for a trailing NULL + wchar_t m_pWriteBuf[ XML_WRITE_BUFFER_SIZE ]; - BYTE* m_pReadPtr; - WCHAR* m_pWritePtr; // write pointer within m_pBuf + uint8_t* m_pReadPtr; + wchar_t* m_pWritePtr; // write pointer within m_pBuf - BOOL m_bUnicode; // true = 16-bits, false = 8-bits - BOOL m_bReverseBytes; // true = reverse bytes, false = don't reverse + bool m_bUnicode; // true = 16-bits, false = 8-bits + bool m_bReverseBytes; // true = reverse bytes, false = don't reverse - BOOL m_bSkipNextAdvance; - WCHAR m_Ch; // Current character being parsed + bool m_bSkipNextAdvance; + wchar_t m_Ch; // Current character being parsed }; } // namespace ATG diff --git a/src/client/Xbox/XML/xmlFilesCallback.h b/src/client/Xbox/XML/xmlFilesCallback.h index 2ea670df..78913846 100644 --- a/src/client/Xbox/XML/xmlFilesCallback.h +++ b/src/client/Xbox/XML/xmlFilesCallback.h @@ -9,16 +9,16 @@ using namespace ATG; class xmlMojangCallback : public ATG::ISAXCallback { public: - virtual HRESULT StartDocument() { return S_OK; }; - virtual HRESULT EndDocument() { return S_OK; }; + virtual int StartDocument() { return S_OK; }; + virtual int EndDocument() { return S_OK; }; - virtual HRESULT ElementBegin( CONST WCHAR* strName, UINT NameLen, CONST XMLAttribute *pAttributes, UINT NumAttributes ) + virtual int ElementBegin( const wchar_t* strName, unsigned int NameLen, const XMLAttribute *pAttributes, unsigned int NumAttributes ) { - WCHAR wTemp[35] = L""; - WCHAR wAttName[32] = L""; - WCHAR wNameXUID[32] = L""; - WCHAR wNameSkin[32] = L""; - WCHAR wNameCloak[32] = L""; + wchar_t wTemp[35] = L""; + wchar_t wAttName[32] = L""; + wchar_t wNameXUID[32] = L""; + wchar_t wNameSkin[32] = L""; + wchar_t wNameCloak[32] = L""; PlayerUID xuid=0LL; @@ -33,7 +33,7 @@ public: } else if ( _wcsicmp(wAttName,L"data") == 0) { - for(UINT i = 0; i < NumAttributes; i++) + for(unsigned int i = 0; i < NumAttributes; i++) { wcsncpy_s( wAttName, pAttributes[i].strName, pAttributes[i].NameLen); if (_wcsicmp(wAttName,L"name")==0) @@ -45,7 +45,7 @@ public: { if (pAttributes[i].ValueLen <= 32) { - ZeroMemory(wTemp,sizeof(WCHAR)*35); + ZeroMemory(wTemp,sizeof(wchar_t)*35); wcsncpy_s( wTemp, pAttributes[i].strValue, pAttributes[i].ValueLen); xuid=_wcstoui64(wTemp,NULL,10); } @@ -80,32 +80,32 @@ public: } }; - virtual HRESULT ElementContent( CONST WCHAR *strData, UINT DataLen, BOOL More ) { return S_OK; }; + virtual int ElementContent( const wchar_t *strData, unsigned int DataLen, bool More ) { return S_OK; }; - virtual HRESULT ElementEnd( CONST WCHAR *strName, UINT NameLen ){ return S_OK; }; + virtual int ElementEnd( const wchar_t *strName, unsigned int NameLen ){ return S_OK; }; - virtual HRESULT CDATABegin( ) { return S_OK; }; + virtual int CDATABegin( ) { return S_OK; }; - virtual HRESULT CDATAData( CONST WCHAR *strCDATA, UINT CDATALen, BOOL bMore ){ return S_OK; }; + virtual int CDATAData( const wchar_t *strCDATA, unsigned int CDATALen, bool bMore ){ return S_OK; }; - virtual HRESULT CDATAEnd( ){ return S_OK; }; + virtual int CDATAEnd( ){ return S_OK; }; - virtual VOID Error( HRESULT hError, CONST CHAR *strMessage ) { app.DebugPrintf("Error when Parsing xuids.XML\n"); }; + virtual void Error( int hError, const char *strMessage ) { app.DebugPrintf("Error when Parsing xuids.XML\n"); }; }; class xmlConfigCallback : public ATG::ISAXCallback { public: - virtual HRESULT StartDocument() { return S_OK; }; - virtual HRESULT EndDocument() { return S_OK; }; + virtual int StartDocument() { return S_OK; }; + virtual int EndDocument() { return S_OK; }; - virtual HRESULT ElementBegin( CONST WCHAR* strName, UINT NameLen, CONST XMLAttribute *pAttributes, UINT NumAttributes ) + virtual int ElementBegin( const wchar_t* strName, unsigned int NameLen, const XMLAttribute *pAttributes, unsigned int NumAttributes ) { - WCHAR wTemp[35] = L""; - WCHAR wType[32] = L""; - WCHAR wAttName[32] = L""; - WCHAR wValue[32] = L""; + wchar_t wTemp[35] = L""; + wchar_t wType[32] = L""; + wchar_t wAttName[32] = L""; + wchar_t wValue[32] = L""; int iValue=-1; if (NameLen >31) @@ -119,7 +119,7 @@ public: } else if ( _wcsicmp(wAttName,L"data") == 0) { - for(UINT i = 0; i < NumAttributes; i++) + for(unsigned int i = 0; i < NumAttributes; i++) { wcsncpy_s( wAttName, pAttributes[i].strName, pAttributes[i].NameLen); if (_wcsicmp(wAttName,L"Type")==0) @@ -165,37 +165,37 @@ public: } - virtual HRESULT ElementContent( CONST WCHAR *strData, UINT DataLen, BOOL More ) { return S_OK; }; + virtual int ElementContent( const wchar_t *strData, unsigned int DataLen, bool More ) { return S_OK; }; - virtual HRESULT ElementEnd( CONST WCHAR *strName, UINT NameLen ){ return S_OK; }; + virtual int ElementEnd( const wchar_t *strName, unsigned int NameLen ){ return S_OK; }; - virtual HRESULT CDATABegin( ) { return S_OK; }; + virtual int CDATABegin( ) { return S_OK; }; - virtual HRESULT CDATAData( CONST WCHAR *strCDATA, UINT CDATALen, BOOL bMore ){ return S_OK; }; + virtual int CDATAData( const wchar_t *strCDATA, unsigned int CDATALen, bool bMore ){ return S_OK; }; - virtual HRESULT CDATAEnd( ){ return S_OK; }; + virtual int CDATAEnd( ){ return S_OK; }; - virtual VOID Error( HRESULT hError, CONST CHAR *strMessage ) { app.DebugPrintf("Error when Parsing xuids.XML\n"); }; + virtual void Error( int hError, const char *strMessage ) { app.DebugPrintf("Error when Parsing xuids.XML\n"); }; }; class xmlDLCInfoCallback : public ATG::ISAXCallback { public: - virtual HRESULT StartDocument() { return S_OK; }; - virtual HRESULT EndDocument() { return S_OK; }; + virtual int StartDocument() { return S_OK; }; + virtual int EndDocument() { return S_OK; }; - virtual HRESULT ElementBegin( CONST WCHAR* strName, UINT NameLen, CONST XMLAttribute *pAttributes, UINT NumAttributes ) + virtual int ElementBegin( const wchar_t* strName, unsigned int NameLen, const XMLAttribute *pAttributes, unsigned int NumAttributes ) { - WCHAR wTemp[35] = L""; - WCHAR wAttName[32] = L""; - WCHAR wNameBanner[32] = L""; - WCHAR wDataFile[32] = L""; - WCHAR wType[32] = L""; - WCHAR wFirstSkin[32] = L""; - WCHAR wConfig[32] = L""; - ULONGLONG ullFull=0ll; - ULONGLONG ullTrial=0ll; + wchar_t wTemp[35] = L""; + wchar_t wAttName[32] = L""; + wchar_t wNameBanner[32] = L""; + wchar_t wDataFile[32] = L""; + wchar_t wType[32] = L""; + wchar_t wFirstSkin[32] = L""; + wchar_t wConfig[32] = L""; + uint64_t ullFull=0ll; + uint64_t ullTrial=0ll; unsigned int uiSortIndex=0L; int iGender=0; int iConfig=0; @@ -211,14 +211,14 @@ public: } else if ( _wcsicmp(wAttName,L"data") == 0) { - for(UINT i = 0; i < NumAttributes; i++) + for(unsigned int i = 0; i < NumAttributes; i++) { wcsncpy_s( wAttName, pAttributes[i].strName, pAttributes[i].NameLen); if (_wcsicmp(wAttName,L"SortIndex")==0) { if (pAttributes[i].ValueLen <= 32) { - ZeroMemory(wTemp,sizeof(WCHAR)*35); + ZeroMemory(wTemp,sizeof(wchar_t)*35); wcsncpy_s( wTemp, pAttributes[i].strValue, pAttributes[i].ValueLen); uiSortIndex=wcstoul(wTemp,NULL,16); } @@ -234,7 +234,7 @@ public: { if (pAttributes[i].ValueLen <= 32) { - ZeroMemory(wTemp,sizeof(WCHAR)*35); + ZeroMemory(wTemp,sizeof(wchar_t)*35); wcsncpy_s( wTemp, pAttributes[i].strValue, pAttributes[i].ValueLen); ullFull=_wcstoui64(wTemp,NULL,16); } @@ -243,7 +243,7 @@ public: { if (pAttributes[i].ValueLen <= 32) { - ZeroMemory(wTemp,sizeof(WCHAR)*35); + ZeroMemory(wTemp,sizeof(wchar_t)*35); wcsncpy_s( wTemp, pAttributes[i].strValue, pAttributes[i].ValueLen); ullTrial=_wcstoui64(wTemp,NULL,16); } @@ -321,17 +321,17 @@ public: } }; - virtual HRESULT ElementContent( CONST WCHAR *strData, UINT DataLen, BOOL More ) { return S_OK; }; + virtual int ElementContent( const wchar_t *strData, unsigned int DataLen, bool More ) { return S_OK; }; - virtual HRESULT ElementEnd( CONST WCHAR *strName, UINT NameLen ){ return S_OK; }; + virtual int ElementEnd( const wchar_t *strName, unsigned int NameLen ){ return S_OK; }; - virtual HRESULT CDATABegin( ) { return S_OK; }; + virtual int CDATABegin( ) { return S_OK; }; - virtual HRESULT CDATAData( CONST WCHAR *strCDATA, UINT CDATALen, BOOL bMore ){ return S_OK; }; + virtual int CDATAData( const wchar_t *strCDATA, unsigned int CDATALen, bool bMore ){ return S_OK; }; - virtual HRESULT CDATAEnd( ){ return S_OK; }; + virtual int CDATAEnd( ){ return S_OK; }; - virtual VOID Error( HRESULT hError, CONST CHAR *strMessage ) { app.DebugPrintf("Error when Parsing DLC.XML\n"); }; + virtual void Error( int hError, const char *strMessage ) { app.DebugPrintf("Error when Parsing DLC.XML\n"); }; }; diff --git a/src/client/Xbox/Xbox_App.cpp b/src/client/Xbox/Xbox_App.cpp index d7d41d6d..21077da6 100644 --- a/src/client/Xbox/Xbox_App.cpp +++ b/src/client/Xbox/Xbox_App.cpp @@ -176,7 +176,7 @@ CConsoleMinecraftApp app; -LPCWSTR apwstrLocale[10] = +const wchar_t* apwstrLocale[10] = { L"", // the default locale L"", // English @@ -190,7 +190,7 @@ LPCWSTR apwstrLocale[10] = L"pt-PT" // Portuguese }; -WCHAR *CConsoleMinecraftApp::wchTypefaceA[]= +wchar_t *CConsoleMinecraftApp::wchTypefaceA[]= { L"Mojangles", L"SDBookM", @@ -198,7 +198,7 @@ WCHAR *CConsoleMinecraftApp::wchTypefaceA[]= L"DFHeiMedium-B5", }; -WCHAR *CConsoleMinecraftApp::wchTypefaceLocatorA[]= +wchar_t *CConsoleMinecraftApp::wchTypefaceLocatorA[]= { L"media/font/Mojangles.ttf", L"media/font/KOR/BOKMSD.ttf", @@ -206,7 +206,7 @@ WCHAR *CConsoleMinecraftApp::wchTypefaceLocatorA[]= L"media/font/CHT/DFHeiMedium-B5.ttf", }; -WCHAR *CConsoleMinecraftApp::wchSceneA[]= +wchar_t *CConsoleMinecraftApp::wchSceneA[]= { L"xuiscene_partnernetpassword", L"xuiscene_intro", @@ -306,7 +306,7 @@ CConsoleMinecraftApp::CConsoleMinecraftApp() : CMinecraftApp() } m_titleDeploymentType = XTITLE_DEPLOYMENT_DOWNLOAD; - DWORD dwResult = XTitleGetDeploymentType(&m_titleDeploymentType, NULL); + unsigned long dwResult = XTitleGetDeploymentType(&m_titleDeploymentType, NULL); if( dwResult == ERROR_SUCCESS ) { switch( m_titleDeploymentType ) @@ -343,10 +343,10 @@ void CConsoleMinecraftApp::SetRichPresenceContext(int iPad, int contextId) // Name: RegisterXuiClasses() // Desc: Registers all the scene classes. //-------------------------------------------------------------------------------------- -HRESULT CConsoleMinecraftApp::RegisterXuiClasses() +int CConsoleMinecraftApp::RegisterXuiClasses() { // Register any other classes necessary for the app/scene - HRESULT hr; + int hr; #ifdef _CONTENT_PACKAGE #ifndef _FINAL_BUILD @@ -544,7 +544,7 @@ HRESULT CConsoleMinecraftApp::RegisterXuiClasses() // Name: UnregisterXuiClasses() // Desc: Unregisters all the scene classes. //-------------------------------------------------------------------------------------- -HRESULT CConsoleMinecraftApp::UnregisterXuiClasses() +int CConsoleMinecraftApp::UnregisterXuiClasses() { XuiHtmlUnregister(); @@ -655,9 +655,9 @@ void CConsoleMinecraftApp::GetPreviewImage(int iPad,XSOCIAL_PREVIEWIMAGE *previe preview->Height = m_PreviewBuffer[iPad].Height; preview->Format = m_PreviewBuffer[iPad].Format; unsigned int sizeBytes = XGAddress2DTiledExtent(m_PreviewBuffer[iPad].Width, m_PreviewBuffer[iPad].Height, 4) * 4; - preview->pBytes = (BYTE *)XPhysicalAlloc(sizeBytes, MAXULONG_PTR, 0, PAGE_READWRITE | PAGE_WRITECOMBINE ); + preview->pBytes = (uint8_t *)XPhysicalAlloc(sizeBytes, MAXULONG_PTR, 0, PAGE_READWRITE | PAGE_WRITECOMBINE ); memcpy( (void *)preview->pBytes, (void *)m_PreviewBuffer[iPad].pBytes, sizeBytes ); - XPhysicalFree((LPVOID)m_PreviewBuffer[iPad].pBytes); + XPhysicalFree((void*)m_PreviewBuffer[iPad].pBytes); m_PreviewBuffer[iPad].pBytes = NULL; } @@ -667,23 +667,23 @@ void CConsoleMinecraftApp::CaptureScreenshot(int iPad) } -HRESULT CConsoleMinecraftApp::LoadXuiResources() +int CConsoleMinecraftApp::LoadXuiResources() { m_fontRenderer = new XUI_FontRenderer(); OverrideFontRenderer(true); - const DWORD LOCATOR_SIZE = 256; // Use this to allocate space to hold a ResourceLocator string - WCHAR szResourceLocator[ LOCATOR_SIZE ]; - HRESULT hr; + const unsigned long LOCATOR_SIZE = 256; // Use this to allocate space to hold a ResourceLocator string + wchar_t szResourceLocator[ LOCATOR_SIZE ]; + int hr; // load from the .xzp file - const ULONG_PTR c_ModuleHandle = (ULONG_PTR)GetModuleHandle(NULL); + const uintptr_t c_ModuleHandle = (uintptr_t)GetModuleHandle(NULL); //#ifdef _CONTENT_PACKAGE // Get the current language setting from the console - DWORD dwLanguage = XGetLanguage( ); + unsigned long dwLanguage = XGetLanguage( ); // if( dwLanguage>=sizeof( apwstrLocale )/sizeof( apwstrLocale[0] ) ) // { @@ -892,7 +892,7 @@ HRESULT CConsoleMinecraftApp::LoadXuiResources() // #ifdef _DEBUG // // dump out the text // int iStringC=0; - // LPCWSTR lpTempString; + // const wchar_t* lpTempString; // // while((lpTempString=StringTable.Lookup(iStringC))!=NULL) // { @@ -945,10 +945,10 @@ HRESULT CConsoleMinecraftApp::LoadXuiResources() XuiElementGetChildById( m_PlayerBaseScene[idx], L"XuiSceneChatRoot", &m_hCurrentChatScene[idx]); m_hFirstChatScene[idx]=m_hCurrentChatScene[idx]; - WCHAR szResourceLocator[ LOCATOR_SIZE ]; + wchar_t szResourceLocator[ LOCATOR_SIZE ]; wsprintfW(szResourceLocator,L"section://%X,%s#%s",c_ModuleHandle,L"media", L"media/"); HXUIOBJ hScene; - HRESULT hr = XuiSceneCreate(szResourceLocator,app.GetSceneName(eUIComponent_Chat, true,false), &idx, &hScene); + int hr = XuiSceneCreate(szResourceLocator,app.GetSceneName(eUIComponent_Chat, true,false), &idx, &hScene); if( FAILED(hr) ) app.FatalLoadError(); hr = XuiSceneNavigateForward(m_hCurrentChatScene[idx], false, hScene, idx); @@ -984,17 +984,17 @@ HRESULT CConsoleMinecraftApp::LoadXuiResources() } -HRESULT CConsoleMinecraftApp::RegisterFont(eFont eFontLanguage,eFont eFontFallback, bool bSetAsDefault) +int CConsoleMinecraftApp::RegisterFont(eFont eFontLanguage,eFont eFontFallback, bool bSetAsDefault) { - HRESULT hr=S_OK; - const DWORD LOCATOR_SIZE = 256; // Use this to allocate space to hold a ResourceLocator string - WCHAR szResourceLocator[ LOCATOR_SIZE ]; - const ULONG_PTR c_ModuleHandle = (ULONG_PTR)GetModuleHandle(NULL); + int hr=S_OK; + const unsigned long LOCATOR_SIZE = 256; // Use this to allocate space to hold a ResourceLocator string + wchar_t szResourceLocator[ LOCATOR_SIZE ]; + const uintptr_t c_ModuleHandle = (uintptr_t)GetModuleHandle(NULL); wsprintfW(szResourceLocator,L"section://%X,%s#%s",c_ModuleHandle,L"media", wchTypefaceLocatorA[eFontLanguage]); // 4J Stu - Check that the font file actually exists HXUIRESOURCE fontTempResource; - BOOL isMemoryResource; + bool isMemoryResource; hr = XuiResourceOpenNoLoc(szResourceLocator, &fontTempResource, &isMemoryResource); if( FAILED(hr) ) app.FatalLoadError(); XuiResourceClose(fontTempResource); @@ -1028,12 +1028,12 @@ HRESULT CConsoleMinecraftApp::RegisterFont(eFont eFontLanguage,eFont eFontFallba // TMS++ -void CConsoleMinecraftApp::TMSPP_SetTitleGroupID(LPCSTR szTitleGroupID) +void CConsoleMinecraftApp::TMSPP_SetTitleGroupID(const char* szTitleGroupID) { StorageManager.TMSPP_SetTitleGroupID(szTitleGroupID); } -void CConsoleMinecraftApp::TMSPP_RetrieveFileList(int iPad,C4JStorage::eGlobalStorage eStorageFacility,CHAR *szPath,eTMSAction NextAction) +void CConsoleMinecraftApp::TMSPP_RetrieveFileList(int iPad,C4JStorage::eGlobalStorage eStorageFacility,char *szPath,eTMSAction NextAction) { app.DebugPrintf("CConsoleMinecraftApp::TMSPP_RetrieveFileList\n"); @@ -1099,7 +1099,7 @@ void CConsoleMinecraftApp::TMSPP_ReadXuidsFile(int iPad,eTMSAction NextAction) } } -int CConsoleMinecraftApp::Callback_TMSPPReadXuidsFile(void *pParam,int iPad, int iUserData, C4JStorage::PTMSPP_FILEDATA pFileData, LPCSTR szFilename) +int CConsoleMinecraftApp::Callback_TMSPPReadXuidsFile(void *pParam,int iPad, int iUserData, C4JStorage::PTMSPP_FILEDATA pFileData, const char* szFilename) { app.DebugPrintf("CConsoleMinecraftApp::Callback_TMSPPReadXuidsFile\n"); CConsoleMinecraftApp* pClass = (CConsoleMinecraftApp*)pParam; @@ -1109,7 +1109,7 @@ int CConsoleMinecraftApp::Callback_TMSPPReadXuidsFile(void *pParam,int iPad, int xmlMojangCallback xmlCallback; xmlParser.RegisterSAXCallbackInterface( &xmlCallback ); - xmlParser.ParseXMLBuffer((CHAR *)pFileData->pbData,pFileData->dwSize); + xmlParser.ParseXMLBuffer((char *)pFileData->pbData,pFileData->dwSize); delete [] pFileData->pbData; delete [] pFileData; } @@ -1144,7 +1144,7 @@ void CConsoleMinecraftApp::TMSPP_ReadConfigFile(int iPad,eTMSAction NextAction) } } -int CConsoleMinecraftApp::Callback_TMSPPReadConfigFile(void *pParam,int iPad, int iUserData, C4JStorage::PTMSPP_FILEDATA pFileData, LPCSTR szFilename) +int CConsoleMinecraftApp::Callback_TMSPPReadConfigFile(void *pParam,int iPad, int iUserData, C4JStorage::PTMSPP_FILEDATA pFileData, const char* szFilename) { app.DebugPrintf("CConsoleMinecraftApp::Callback_TMSPPReadConfigFile\n"); CConsoleMinecraftApp* pClass = (CConsoleMinecraftApp*)pParam; @@ -1154,7 +1154,7 @@ int CConsoleMinecraftApp::Callback_TMSPPReadConfigFile(void *pParam,int iPad, in xmlConfigCallback xmlCallback; xmlParser.RegisterSAXCallbackInterface( &xmlCallback ); - xmlParser.ParseXMLBuffer((CHAR *)pFileData->pbData,pFileData->dwSize); + xmlParser.ParseXMLBuffer((char *)pFileData->pbData,pFileData->dwSize); delete [] pFileData->pbData; delete [] pFileData; } @@ -1211,7 +1211,7 @@ bool CConsoleMinecraftApp::TMSPP_ReadBannedList(int iPad,eTMSAction NextAction) return true; } -int CConsoleMinecraftApp::Callback_TMSPPReadBannedList(void *pParam,int iPad, int iUserData, C4JStorage::PTMSPP_FILEDATA pFileData,LPCSTR szFilename) +int CConsoleMinecraftApp::Callback_TMSPPReadBannedList(void *pParam,int iPad, int iUserData, C4JStorage::PTMSPP_FILEDATA pFileData,const char* szFilename) { app.DebugPrintf("CConsoleMinecraftApp::Callback_TMSPPReadBannedList\n"); @@ -1273,7 +1273,7 @@ void CConsoleMinecraftApp::TMSPP_ReadDLCFile(int iPad,eTMSAction NextAction) } } -int CConsoleMinecraftApp::Callback_TMSPPReadDLCFile(void *pParam,int iPad, int iUserData, C4JStorage::PTMSPP_FILEDATA pFileData,LPCSTR szFilename) +int CConsoleMinecraftApp::Callback_TMSPPReadDLCFile(void *pParam,int iPad, int iUserData, C4JStorage::PTMSPP_FILEDATA pFileData,const char* szFilename) { app.DebugPrintf("CConsoleMinecraftApp::Callback_TMSPPReadDLCFile\n"); CConsoleMinecraftApp* pClass = (CConsoleMinecraftApp*)pParam; @@ -1285,7 +1285,7 @@ int CConsoleMinecraftApp::Callback_TMSPPReadDLCFile(void *pParam,int iPad, int i unsigned int uiDecompSize=*(unsigned int *)pFileData->pbData; unsigned int uiCompSize=((unsigned int *)pFileData->pbData)[1]; - BYTE *pDecompressedData = new BYTE [uiDecompSize]; + uint8_t *pDecompressedData = new uint8_t [uiDecompSize]; Compression::getCompression()->Decompress(pDecompressedData,&uiDecompSize,&((unsigned int *)pFileData->pbData)[2],uiCompSize); delete [] pFileData->pbData; @@ -1295,7 +1295,7 @@ int CConsoleMinecraftApp::Callback_TMSPPReadDLCFile(void *pParam,int iPad, int i xmlDLCInfoCallback xmlCallback; xmlParser.RegisterSAXCallbackInterface( &xmlCallback ); - xmlParser.ParseXMLBuffer((CHAR *)pDecompressedData,uiDecompSize); + xmlParser.ParseXMLBuffer((char *)pDecompressedData,uiDecompSize); pClass->m_bRead_TMS_DLCINFO_XML=true; @@ -1359,7 +1359,7 @@ void CConsoleMinecraftApp::ReadBannedList(int iPad,eTMSAction NextAction, bool b } } -int CConsoleMinecraftApp::CallbackBannedListFileFromTMS(LPVOID lpParam, WCHAR *wchFilename, int iPad, bool bResult, int iAction) +int CConsoleMinecraftApp::CallbackBannedListFileFromTMS(void* lpParam, wchar_t *wchFilename, int iPad, bool bResult, int iAction) { CConsoleMinecraftApp* pClass = (CConsoleMinecraftApp*)lpParam; @@ -1448,14 +1448,14 @@ void CConsoleMinecraftApp::CaptureSaveThumbnail() RenderManager.CaptureThumbnail(&m_ThumbnailBuffer); MemSect(0); } -void CConsoleMinecraftApp::GetSaveThumbnail(PBYTE *pbData,DWORD *pdwSize) +void CConsoleMinecraftApp::GetSaveThumbnail(uint8_t* *pbData,unsigned long *pdwSize) { // on a save caused by a create world, the thumbnail capture won't have happened if(m_ThumbnailBuffer!=NULL) { if( pbData ) { - *pbData= new BYTE [m_ThumbnailBuffer->GetBufferSize()]; + *pbData= new uint8_t [m_ThumbnailBuffer->GetBufferSize()]; *pdwSize=m_ThumbnailBuffer->GetBufferSize(); memcpy(*pbData,m_ThumbnailBuffer->GetBufferPointer(),*pdwSize); } @@ -1472,12 +1472,12 @@ void CConsoleMinecraftApp::ReleaseSaveThumbnail() } } -void CConsoleMinecraftApp::GetScreenshot(int iPad,PBYTE *pbData,DWORD *pdwSize) +void CConsoleMinecraftApp::GetScreenshot(int iPad,uint8_t* *pbData,unsigned long *pdwSize) { // on a save caused by a create world, the thumbnail capture won't have happened if(m_ScreenshotBuffer[iPad]!=NULL) { - *pbData= new BYTE [m_ScreenshotBuffer[iPad]->GetBufferSize()]; + *pbData= new uint8_t [m_ScreenshotBuffer[iPad]->GetBufferSize()]; *pdwSize=m_ScreenshotBuffer[iPad]->GetBufferSize(); memcpy(*pbData,m_ScreenshotBuffer[iPad]->GetBufferPointer(),*pdwSize); m_ScreenshotBuffer[iPad]->Release(); @@ -1488,14 +1488,14 @@ void CConsoleMinecraftApp::GetScreenshot(int iPad,PBYTE *pbData,DWORD *pdwSize) #ifdef _DEBUG_MENUS_ENABLED void CConsoleMinecraftApp::EnableDebugOverlay(bool enable,int iPad) { - HRESULT hr = S_OK; + int hr = S_OK; if(enable && !debugOverlayCreated) { - const ULONG_PTR c_ModuleHandle = (ULONG_PTR)GetModuleHandle(NULL); + const uintptr_t c_ModuleHandle = (uintptr_t)GetModuleHandle(NULL); - const DWORD LOCATOR_SIZE = 256; // Use this to allocate space to hold a ResourceLocator string - WCHAR szResourceLocator[ LOCATOR_SIZE ]; + const unsigned long LOCATOR_SIZE = 256; // Use this to allocate space to hold a ResourceLocator string + wchar_t szResourceLocator[ LOCATOR_SIZE ]; wsprintfW(szResourceLocator,L"section://%X,%s#%s",c_ModuleHandle,L"media", L"media/"); hr = XuiSceneCreate(szResourceLocator, L"xuiscene_debugoverlay.xur", NULL, &m_hDebugOverlay); @@ -1610,7 +1610,7 @@ bool CConsoleMinecraftApp::IsSceneInStack(int iPad, EUIScene eScene) return inStack; } -WCHAR *CConsoleMinecraftApp::GetSceneName(EUIScene eScene,bool bAppendToName,bool bSplitscreenScene) +wchar_t *CConsoleMinecraftApp::GetSceneName(EUIScene eScene,bool bAppendToName,bool bSplitscreenScene) { wcscpy(m_SceneName,wchSceneA[eScene]); if(bAppendToName) @@ -1645,7 +1645,7 @@ WCHAR *CConsoleMinecraftApp::GetSceneName(EUIScene eScene,bool bAppendToName,boo return m_SceneName; } -HRESULT CConsoleMinecraftApp::NavigateToScene(int iPad,EUIScene eScene, void *initData /* = NULL */, bool forceUsePad /*= false*/, BOOL bStayVisible /* = false */, HXUIOBJ *phResultingScene /*= NULL*/ ) +int CConsoleMinecraftApp::NavigateToScene(int iPad,EUIScene eScene, void *initData /* = NULL */, bool forceUsePad /*= false*/, bool bStayVisible /* = false */, HXUIOBJ *phResultingScene /*= NULL*/ ) { ASSERT(m_bDefaultTypefaceRegistered); ASSERT(m_bSkinLoaded); @@ -1690,12 +1690,12 @@ HRESULT CConsoleMinecraftApp::NavigateToScene(int iPad,EUIScene eScene, void *in } // load from the .xzp file - const ULONG_PTR c_ModuleHandle = (ULONG_PTR)GetModuleHandle(NULL); + const uintptr_t c_ModuleHandle = (uintptr_t)GetModuleHandle(NULL); HXUIOBJ hScene; - HRESULT hr; - const DWORD LOCATOR_SIZE = 256; // Use this to allocate space to hold a ResourceLocator string - WCHAR szResourceLocator[ LOCATOR_SIZE ]; + int hr; + const unsigned long LOCATOR_SIZE = 256; // Use this to allocate space to hold a ResourceLocator string + wchar_t szResourceLocator[ LOCATOR_SIZE ]; wsprintfW(szResourceLocator,L"section://%X,%s#%s",c_ModuleHandle,L"media", L"media/"); @@ -1728,7 +1728,7 @@ HRESULT CConsoleMinecraftApp::NavigateToScene(int iPad,EUIScene eScene, void *in bool bIsHiDef=RenderManager.IsHiDef(); bool bIsSplitscreen = GetLocalPlayerCount()>1; - BOOL bSceneIsFullscreen = CXuiSceneBase::GetPlayerBasePosition(idx)==CXuiSceneBase::e_BaseScene_Fullscreen; + bool bSceneIsFullscreen = CXuiSceneBase::GetPlayerBasePosition(idx)==CXuiSceneBase::e_BaseScene_Fullscreen; switch(eScene) { @@ -1894,7 +1894,7 @@ HRESULT CConsoleMinecraftApp::NavigateToScene(int iPad,EUIScene eScene, void *in return S_OK; } -HRESULT CConsoleMinecraftApp::NavigateBack(int iPad, bool forceUsePad /*= false*/, EUIScene eScene /*= eUIScene_COUNT*/) +int CConsoleMinecraftApp::NavigateBack(int iPad, bool forceUsePad /*= false*/, EUIScene eScene /*= eUIScene_COUNT*/) { HXUIOBJ hCur; HXUIOBJ hBack; @@ -1942,7 +1942,7 @@ HRESULT CConsoleMinecraftApp::NavigateBack(int iPad, bool forceUsePad /*= false* return XuiSceneNavigateBack(hCur, hBack,iPad ); } -HRESULT CConsoleMinecraftApp::TutorialSceneNavigateBack(int iPad, bool forceUsePad /*= false*/) +int CConsoleMinecraftApp::TutorialSceneNavigateBack(int iPad, bool forceUsePad /*= false*/) { HXUIOBJ hCur; HXUIOBJ hBack; @@ -1963,9 +1963,9 @@ HRESULT CConsoleMinecraftApp::TutorialSceneNavigateBack(int iPad, bool forceUseP return XuiSceneNavigateBack(hCur, hBack,iPad ); } -HRESULT CConsoleMinecraftApp::CloseXuiScenes(int iPad, bool forceUsePad /*= false*/) +int CConsoleMinecraftApp::CloseXuiScenes(int iPad, bool forceUsePad /*= false*/) { - HRESULT hr; + int hr; int idx = 0; if( m_bGameStarted || forceUsePad ) @@ -2052,9 +2052,9 @@ HRESULT CConsoleMinecraftApp::CloseXuiScenes(int iPad, bool forceUsePad /*= fals return hr; } -HRESULT CConsoleMinecraftApp::CloseAllPlayersXuiScenes() +int CConsoleMinecraftApp::CloseAllPlayersXuiScenes() { - HRESULT hr = S_OK; + int hr = S_OK; // 4J Stu - Fix for #11211 - TCR 015 BAS Sign In Changes: One time-occurrence where users were unable to access any in-game menus after several sign-in changes // We only hide them during a save, but this could be interrupted @@ -2070,9 +2070,9 @@ HRESULT CConsoleMinecraftApp::CloseAllPlayersXuiScenes() return hr; } -HRESULT CConsoleMinecraftApp::CloseXuiScenesAndNavigateToScene(int iPad,EUIScene eScene, void *initData, bool forceUsePad /*= false*/) +int CConsoleMinecraftApp::CloseXuiScenesAndNavigateToScene(int iPad,EUIScene eScene, void *initData, bool forceUsePad /*= false*/) { - HRESULT hr; + int hr; int idx = 0; if( m_bGameStarted || forceUsePad) @@ -2102,7 +2102,7 @@ HRESULT CConsoleMinecraftApp::CloseXuiScenesAndNavigateToScene(int iPad,EUIScene return hr; } -HRESULT CConsoleMinecraftApp::RemoveBackScene(int iPad) +int CConsoleMinecraftApp::RemoveBackScene(int iPad) { int idx = 0; if( m_bGameStarted) @@ -2141,9 +2141,9 @@ HRESULT CConsoleMinecraftApp::RemoveBackScene(int iPad) return S_OK; } -HRESULT CConsoleMinecraftApp::NavigateToHomeMenu() +int CConsoleMinecraftApp::NavigateToHomeMenu() { - HRESULT hr = S_OK; + int hr = S_OK; for(unsigned int idx = 0; idx < XUSER_MAX_COUNT; ++idx) { @@ -2187,7 +2187,7 @@ HRESULT CConsoleMinecraftApp::NavigateToHomeMenu() { pDLCTexPack->m_pSoundBank->Destroy(); } - DWORD result = StorageManager.UnmountInstalledDLC("TPACK"); + unsigned long result = StorageManager.UnmountInstalledDLC("TPACK"); app.DebugPrintf("Unmount result is %d\n",result); } @@ -2220,7 +2220,7 @@ void CConsoleMinecraftApp::ReloadChatScene(int iPad, bool bJoining /*= false*/, if(m_hFirstChatScene[iPad] == NULL || m_hCurrentChatScene[iPad] == NULL) return; // Re-create the chat scene so it is the correct size. It starts without any visible lines. - BOOL chatSceneVisible = false; + bool chatSceneVisible = false; if( m_hFirstChatScene[iPad] != m_hCurrentChatScene[iPad] ) { chatSceneVisible = XuiElementIsShown(m_hCurrentChatScene[iPad]); @@ -2288,7 +2288,7 @@ void CConsoleMinecraftApp::ReloadChatScene(int iPad, bool bJoining /*= false*/, XuiElementSetBounds(m_hCurrentChatScene[iPad],sceneWidth, fHeight ); CScene_Chat* chatScene; - VOID *pObj; + void *pObj; XuiObjectFromHandle( m_hCurrentChatScene[iPad], &pObj ); chatScene = (CScene_Chat *)pObj; chatScene->OffsetTextPosition( textXOffset ); @@ -2301,7 +2301,7 @@ void CConsoleMinecraftApp::ReloadHudScene(int iPad, bool bJoining /*= false*/, b if(m_hFirstHudScene[iPad] == NULL || m_hCurrentHudScene[iPad] == NULL) return; // Re-create the hud scene so it is the correct size. It starts without any visible lines. - BOOL hudSceneVisible = false; + bool hudSceneVisible = false; if( m_hFirstHudScene[iPad] != m_hCurrentHudScene[iPad] ) { hudSceneVisible = XuiElementIsShown(m_hCurrentHudScene[iPad]); @@ -2427,7 +2427,7 @@ void CConsoleMinecraftApp::AdjustSplitscreenScene(HXUIOBJ hScene,D3DXVECTOR3 *pv XuiElementSetPosition(hScene,&vec); } -HRESULT CConsoleMinecraftApp::AdjustSplitscreenScene_PlayerChanged(HXUIOBJ hScene,D3DXVECTOR3 *pvOriginalPosition, int iPad, bool bJoining, bool bAdjustXForSafeArea) +int CConsoleMinecraftApp::AdjustSplitscreenScene_PlayerChanged(HXUIOBJ hScene,D3DXVECTOR3 *pvOriginalPosition, int iPad, bool bJoining, bool bAdjustXForSafeArea) { int iLocalPlayerC=GetLocalPlayerCount(); Minecraft *pMinecraft=Minecraft::GetInstance(); @@ -2492,7 +2492,7 @@ HRESULT CConsoleMinecraftApp::AdjustSplitscreenScene_PlayerChanged(HXUIOBJ hScen return S_OK; } -HRESULT CConsoleMinecraftApp::AdjustSplitscreenScene_PlayerChanged(HXUIOBJ hScene,D3DXVECTOR3 *pvOriginalPosition, int iPad, bool bJoining, float fXAdjust) +int CConsoleMinecraftApp::AdjustSplitscreenScene_PlayerChanged(HXUIOBJ hScene,D3DXVECTOR3 *pvOriginalPosition, int iPad, bool bJoining, float fXAdjust) { int iLocalPlayerC=GetLocalPlayerCount(); Minecraft *pMinecraft=Minecraft::GetInstance(); @@ -2563,10 +2563,10 @@ void CConsoleMinecraftApp::StoreLaunchData() LD_DEMO* pDemoData = NULL; - DWORD dwStatus = XGetLaunchDataSize( &m_dwLaunchDataSize ); + unsigned long dwStatus = XGetLaunchDataSize( &m_dwLaunchDataSize ); if( dwStatus == ERROR_SUCCESS ) { - m_pLaunchData = new BYTE [ m_dwLaunchDataSize ]; + m_pLaunchData = new uint8_t [ m_dwLaunchDataSize ]; dwStatus = XGetLaunchData( m_pLaunchData, m_dwLaunchDataSize ); pDemoData = (LD_DEMO*)( m_pLaunchData ); if( pDemoData->dwID != LAUNCH_DATA_DEMO_ID ) @@ -2605,7 +2605,7 @@ void CConsoleMinecraftApp::FatalLoadError(void) memset(&MessageBoxOverlap, 0, sizeof(MessageBoxOverlap)); - //HANDLE messageBoxThread = CreateThread(NULL, 0, &CMinecraftApp::ShowFatalLoadMessageBoxThreadProc, &MessageBoxOverlap, 0, NULL); + //void* messageBoxThread = CreateThread(NULL, 0, &CMinecraftApp::ShowFatalLoadMessageBoxThreadProc, &MessageBoxOverlap, 0, NULL); // //WaitForSingleObjectEx(messageBoxThread, // handle to object // 20000, // time-out interval @@ -2614,7 +2614,7 @@ void CConsoleMinecraftApp::FatalLoadError(void) //XOVERLAPPED *MessageBoxOverlap = (XOVERLAPPED *)lpParameter; wchar_t *aStrings[3]; - LPCWSTR wszButtons[1]; + const wchar_t* wszButtons[1]; // IDS_FATAL_ERROR_TITLE // IDS_FATAL_ERROR_TEXT @@ -2695,17 +2695,17 @@ void CConsoleMinecraftApp::FatalLoadError(void) ExitGame(); } -WCHAR *CConsoleMinecraftApp::wchExt[MAX_EXTENSION_TYPES]= +wchar_t *CConsoleMinecraftApp::wchExt[MAX_EXTENSION_TYPES]= { L"png", L"inf", L"dat", }; -int CConsoleMinecraftApp::GetLocalTMSFileIndex(WCHAR *wchTMSFile,bool bFilenameIncludesExtension,eFileExtensionType eEXT) +int CConsoleMinecraftApp::GetLocalTMSFileIndex(wchar_t *wchTMSFile,bool bFilenameIncludesExtension,eFileExtensionType eEXT) { - WCHAR wchTemp[ 256 ]; - WCHAR wchInFile[ 256 ]; + wchar_t wchTemp[ 256 ]; + wchar_t wchInFile[ 256 ]; if(bFilenameIncludesExtension) { @@ -2728,10 +2728,10 @@ int CConsoleMinecraftApp::GetLocalTMSFileIndex(WCHAR *wchTMSFile,bool bFilenameI return -1; } -int CConsoleMinecraftApp::RetrieveTMSFileListIndex(WCHAR *wchTMSFile) +int CConsoleMinecraftApp::RetrieveTMSFileListIndex(wchar_t *wchTMSFile) { eFileExtensionType eEXT; - WCHAR wTemp[256]; + wchar_t wTemp[256]; int iIndex=0; // split the file name into name and extension @@ -2753,19 +2753,19 @@ int CConsoleMinecraftApp::RetrieveTMSFileListIndex(WCHAR *wchTMSFile) return GetLocalTMSFileIndex(wTemp,false,eEXT); } -int CConsoleMinecraftApp::LoadLocalTMSFile(WCHAR *wchTMSFile, eFileExtensionType eExt) +int CConsoleMinecraftApp::LoadLocalTMSFile(wchar_t *wchTMSFile, eFileExtensionType eExt) { - WCHAR wcTemp[256]; + wchar_t wcTemp[256]; wsprintfW(wcTemp,L"%s.%s",wchTMSFile,wchExt[eExt]); return LoadLocalTMSFile(wcTemp); } -int CConsoleMinecraftApp::LoadLocalTMSFile(WCHAR *wchTMSFile) +int CConsoleMinecraftApp::LoadLocalTMSFile(wchar_t *wchTMSFile) { - const DWORD LOCATOR_SIZE = 256; // Use this to allocate space to hold a ResourceLocator string - WCHAR szResourceLocator[ LOCATOR_SIZE ]; - HRESULT hr; + const unsigned long LOCATOR_SIZE = 256; // Use this to allocate space to hold a ResourceLocator string + wchar_t szResourceLocator[ LOCATOR_SIZE ]; + int hr; int iTMSFileIndex; // split the file name into file and extension and find it in out tms file list @@ -2953,15 +2953,15 @@ TMS_FILE CConsoleMinecraftApp::TMSFileA[TMS_COUNT] = }; #ifndef _CONTENT_PACKAGE -WCHAR CConsoleMinecraftApp::m_wchTMSXZP[] = L"file://game:/TMSFiles.xzp"; +wchar_t CConsoleMinecraftApp::m_wchTMSXZP[] = L"file://game:/TMSFiles.xzp"; #else -WCHAR CConsoleMinecraftApp::m_wchTMSXZP[] = L"file://UPDATE:/res/TMS/TMSFiles.xzp"; +wchar_t CConsoleMinecraftApp::m_wchTMSXZP[] = L"file://UPDATE:/res/TMS/TMSFiles.xzp"; #endif -void CConsoleMinecraftApp::GetFileFromTPD(eTPDFileType eType,PBYTE pbData,DWORD dwBytes,PBYTE *ppbData,DWORD *pdwBytes ) +void CConsoleMinecraftApp::GetFileFromTPD(eTPDFileType eType,uint8_t* pbData,unsigned long dwBytes,uint8_t* *ppbData,unsigned long *pdwBytes ) { - PBYTE pbPos=pbData; + uint8_t* pbPos=pbData; // icon is the second thing in the file if(pbData && dwBytes>0) { @@ -2973,15 +2973,15 @@ void CConsoleMinecraftApp::GetFileFromTPD(eTPDFileType eType,PBYTE pbData,DWORD if(eType==eTPDFileType_Loc) { *pdwBytes= uiDecompSize; - *ppbData = new BYTE [uiDecompSize]; + *ppbData = new uint8_t [uiDecompSize]; - Compression::getCompression()->Decompress(*ppbData,(UINT *)pdwBytes,&((unsigned int *)pbPos)[2],uiCompSize); + Compression::getCompression()->Decompress(*ppbData,(unsigned int *)pdwBytes,&((unsigned int *)pbPos)[2],uiCompSize); return; } else { // skip over the data - pbPos=(PBYTE)&((unsigned int *)pbPos)[2]; + pbPos=(uint8_t*)&((unsigned int *)pbPos)[2]; pbPos+=uiCompSize; } @@ -2992,15 +2992,15 @@ void CConsoleMinecraftApp::GetFileFromTPD(eTPDFileType eType,PBYTE pbData,DWORD if(eType==eTPDFileType_Icon) { *pdwBytes= uiDecompSize; - *ppbData = new BYTE [uiDecompSize]; + *ppbData = new uint8_t [uiDecompSize]; - Compression::getCompression()->Decompress(*ppbData,(UINT *)pdwBytes,&((unsigned int *)pbPos)[2],uiCompSize); + Compression::getCompression()->Decompress(*ppbData,(unsigned int *)pdwBytes,&((unsigned int *)pbPos)[2],uiCompSize); return; } else { // skip over the data - pbPos=(PBYTE)&((unsigned int *)pbPos)[2]; + pbPos=(uint8_t*)&((unsigned int *)pbPos)[2]; pbPos+=uiCompSize; } @@ -3011,9 +3011,9 @@ void CConsoleMinecraftApp::GetFileFromTPD(eTPDFileType eType,PBYTE pbData,DWORD if(eType==eTPDFileType_Comparison) { *pdwBytes= uiDecompSize; - *ppbData = new BYTE [uiDecompSize]; + *ppbData = new uint8_t [uiDecompSize]; - Compression::getCompression()->Decompress(*ppbData,(UINT *)pdwBytes,&((unsigned int *)pbPos)[2],uiCompSize); + Compression::getCompression()->Decompress(*ppbData,(unsigned int *)pdwBytes,&((unsigned int *)pbPos)[2],uiCompSize); return; } } @@ -3022,7 +3022,7 @@ void CConsoleMinecraftApp::GetFileFromTPD(eTPDFileType eType,PBYTE pbData,DWORD } -LPCWSTR CConsoleMinecraftApp::GetString(int iID) +const wchar_t* CConsoleMinecraftApp::GetString(int iID) { return StringTable.Lookup(iID); } diff --git a/src/client/Xbox/Xbox_App.h b/src/client/Xbox/Xbox_App.h index e20b68a4..0cf68367 100644 --- a/src/client/Xbox/Xbox_App.h +++ b/src/client/Xbox/Xbox_App.h @@ -29,61 +29,61 @@ private: std::list< SceneStackPair > m_sceneStack[XUSER_MAX_COUNT]; // XUI scene names - static WCHAR *wchSceneA[eUIScene_COUNT]; - static WCHAR *wchTypefaceA[4]; - static WCHAR *wchTypefaceLocatorA[4]; + static wchar_t *wchSceneA[eUIScene_COUNT]; + static wchar_t *wchTypefaceA[4]; + static wchar_t *wchTypefaceLocatorA[4]; - WCHAR m_SceneName[50]; + wchar_t m_SceneName[50]; public: CConsoleMinecraftApp(); virtual void SetRichPresenceContext(int iPad, int contextId); - virtual HRESULT RegisterXuiClasses(); - virtual HRESULT UnregisterXuiClasses(); + virtual int RegisterXuiClasses(); + virtual int UnregisterXuiClasses(); XTITLE_DEPLOYMENT_TYPE getDeploymentType() { return m_titleDeploymentType; } void GetPreviewImage(int iPad,XSOCIAL_PREVIEWIMAGE *preview); - virtual HRESULT LoadXuiResources(); + virtual int LoadXuiResources(); virtual void CaptureScreenshot(int iPad); virtual void CaptureSaveThumbnail(); - virtual void GetSaveThumbnail(PBYTE*,DWORD*); + virtual void GetSaveThumbnail(uint8_t**,unsigned long*); virtual void ReleaseSaveThumbnail(); - virtual void GetScreenshot(int iPad,PBYTE *pbData,DWORD *pdwSize); + virtual void GetScreenshot(int iPad,uint8_t* *pbData,unsigned long *pdwSize); virtual void RunFrame(); // TMS++ - void TMSPP_SetTitleGroupID(LPCSTR szTitleGroupID); - void TMSPP_RetrieveFileList(int iPad,C4JStorage::eGlobalStorage eStorageFacility,CHAR *szPath,eTMSAction NextAction); + void TMSPP_SetTitleGroupID(const char* szTitleGroupID); + void TMSPP_RetrieveFileList(int iPad,C4JStorage::eGlobalStorage eStorageFacility,char *szPath,eTMSAction NextAction); void TMSPP_ReadXuidsFile(int iPad,eTMSAction NextAction); void TMSPP_ReadConfigFile(int iPad,eTMSAction NextAction); void TMSPP_ReadDLCFile(int iPad,eTMSAction NextAction); bool TMSPP_ReadBannedList(int iPad,eTMSAction NextAction); static int Callback_TMSPPReadFileList(void *pParam,int iPad, int iUserData, C4JStorage::PTMSPP_FILE_LIST pTmsFileList); - static int Callback_TMSPPReadXuidsFile(void *pParam,int iPad, int iUserData, C4JStorage::PTMSPP_FILEDATA pFileData,LPCSTR szFilename); - static int Callback_TMSPPReadConfigFile(void *pParam,int iPad, int iUserData, C4JStorage::PTMSPP_FILEDATA pFileData, LPCSTR szFilename); - static int Callback_TMSPPReadDLCFile(void *pParam,int iPad, int iUserData, C4JStorage::PTMSPP_FILEDATA pFileData,LPCSTR szFilename); - static int Callback_TMSPPReadBannedList(void *pParam,int iPad, int iUserData, C4JStorage::PTMSPP_FILEDATA pFileData,LPCSTR szFilename); + static int Callback_TMSPPReadXuidsFile(void *pParam,int iPad, int iUserData, C4JStorage::PTMSPP_FILEDATA pFileData,const char* szFilename); + static int Callback_TMSPPReadConfigFile(void *pParam,int iPad, int iUserData, C4JStorage::PTMSPP_FILEDATA pFileData, const char* szFilename); + static int Callback_TMSPPReadDLCFile(void *pParam,int iPad, int iUserData, C4JStorage::PTMSPP_FILEDATA pFileData,const char* szFilename); + static int Callback_TMSPPReadBannedList(void *pParam,int iPad, int iUserData, C4JStorage::PTMSPP_FILEDATA pFileData,const char* szFilename); virtual bool GetTMSGlobalFileListRead() { return m_bTMSPP_GlobalFileListRead;} virtual bool GetTMSDLCInfoRead() { return m_bRead_TMS_DLCINFO_XML;} virtual bool GetTMSXUIDsFileRead() { return m_bRead_TMS_XUIDS_XML;} - virtual int LoadLocalTMSFile(WCHAR *wchTMSFile); - virtual int LoadLocalTMSFile(WCHAR *wchTMSFile, eFileExtensionType eExt); + virtual int LoadLocalTMSFile(wchar_t *wchTMSFile); + virtual int LoadLocalTMSFile(wchar_t *wchTMSFile, eFileExtensionType eExt); virtual void FreeLocalTMSFiles(eTMSFileType eType); - virtual int GetLocalTMSFileIndex(WCHAR *wchTMSFile,bool bFilenameIncludesExtension,eFileExtensionType eEXT=eFileExtensionType_PNG); - virtual int RetrieveTMSFileListIndex(WCHAR *wchTMSFile); + virtual int GetLocalTMSFileIndex(wchar_t *wchTMSFile,bool bFilenameIncludesExtension,eFileExtensionType eEXT=eFileExtensionType_PNG); + virtual int RetrieveTMSFileListIndex(wchar_t *wchTMSFile); virtual void OverrideFontRenderer(bool set, bool immediate=true); virtual void ToggleFontRenderer() { OverrideFontRenderer(!m_bFontRendererOverridden,false); } - virtual LPCWSTR GetString(int iID); + virtual const wchar_t* GetString(int iID); CXuiStringTable *GetStringTable(); #ifdef _DEBUG_MENUS_ENABLED @@ -111,8 +111,8 @@ private: bool m_bRead_TMS_XUIDS_XML; // track whether we have already read the TMS xuids.xml file bool m_bRead_TMS_Config_XML; // track whether we have already read the config file bool m_bRead_TMS_DLCINFO_XML; // track whether we have already read the TMS DLC.xml file - BYTE *m_pXuidsFileBuffer; - DWORD m_dwXuidsFileSize; + uint8_t *m_pXuidsFileBuffer; + unsigned long m_dwXuidsFileSize; #ifdef _DEBUG_MENUS_ENABLED bool debugOverlayCreated; @@ -125,22 +125,22 @@ public: // void ReadXuidsFileFromTMS(int iPad,eTMSAction NextAction,bool bCallback); // void ReadDLCFileFromTMS(int iPad,eTMSAction NextAction, bool bCallback); -// static int CallbackReadXuidsFileFromTMS(LPVOID lpParam, WCHAR *wchFilename, int iPad, bool bResult, int iAction); -// static int CallbackDLCFileFromTMS(LPVOID lpParam, WCHAR *wchFilename, int iPad, bool bResult, int iAction); - static int CallbackBannedListFileFromTMS(LPVOID lpParam, WCHAR *wchFilename, int iPad, bool bResult, int iAction); +// static int CallbackReadXuidsFileFromTMS(void* lpParam, wchar_t *wchFilename, int iPad, bool bResult, int iAction); +// static int CallbackDLCFileFromTMS(void* lpParam, wchar_t *wchFilename, int iPad, bool bResult, int iAction); + static int CallbackBannedListFileFromTMS(void* lpParam, wchar_t *wchFilename, int iPad, bool bResult, int iAction); - HRESULT RegisterFont(eFont eFontLanguage,eFont eFontFallback, bool bSetAsDefault=false); + int RegisterFont(eFont eFontLanguage,eFont eFontFallback, bool bSetAsDefault=false); - WCHAR *GetSceneName(EUIScene eScene, bool bAppendToName,bool bSplitscreenScene); + wchar_t *GetSceneName(EUIScene eScene, bool bAppendToName,bool bSplitscreenScene); - virtual HRESULT NavigateToScene(int iPad,EUIScene eScene, void *initData = NULL, bool forceUsePad = false, BOOL bStayVisible=false, HXUIOBJ *phResultingScene=NULL); - virtual HRESULT NavigateBack(int iPad, bool forceUsePad = false,EUIScene eScene = eUIScene_COUNT); - virtual HRESULT TutorialSceneNavigateBack(int iPad, bool forceUsePad = false); - virtual HRESULT CloseXuiScenes(int iPad, bool forceUsePad = false); - virtual HRESULT CloseAllPlayersXuiScenes(); - virtual HRESULT CloseXuiScenesAndNavigateToScene(int iPad,EUIScene eScene, void *initData=NULL, bool forceUsePad = false); - virtual HRESULT RemoveBackScene(int iPad); - virtual HRESULT NavigateToHomeMenu(); + virtual int NavigateToScene(int iPad,EUIScene eScene, void *initData = NULL, bool forceUsePad = false, bool bStayVisible=false, HXUIOBJ *phResultingScene=NULL); + virtual int NavigateBack(int iPad, bool forceUsePad = false,EUIScene eScene = eUIScene_COUNT); + virtual int TutorialSceneNavigateBack(int iPad, bool forceUsePad = false); + virtual int CloseXuiScenes(int iPad, bool forceUsePad = false); + virtual int CloseAllPlayersXuiScenes(); + virtual int CloseXuiScenesAndNavigateToScene(int iPad,EUIScene eScene, void *initData=NULL, bool forceUsePad = false); + virtual int RemoveBackScene(int iPad); + virtual int NavigateToHomeMenu(); D3DXVECTOR3 GetElementScreenPosition(HXUIOBJ hObj); virtual void SetChatTextDisplayed(int iPad, bool bVal); virtual void ReloadChatScene(int iPad, bool bJoining = false, bool bForce = false); @@ -175,8 +175,8 @@ public: // Move splitscreen scenes based on which screen segment they are in void AdjustSplitscreenScene(HXUIOBJ hScene,D3DXVECTOR3 *pvOriginalPosition, int iPad, bool bAdjustXForSafeArea=true); void AdjustSplitscreenScene(HXUIOBJ hScene,D3DXVECTOR3 *pvOriginalPosition, int iPad, float fXAdjust); - HRESULT AdjustSplitscreenScene_PlayerChanged(HXUIOBJ hScene,D3DXVECTOR3 *pvOriginalPosition, int iPad, bool bJoining, bool bAdjustXForSafeArea=true); - HRESULT AdjustSplitscreenScene_PlayerChanged(HXUIOBJ hScene,D3DXVECTOR3 *pvOriginalPosition, int iPad, bool bJoining, float fXAdjust); + int AdjustSplitscreenScene_PlayerChanged(HXUIOBJ hScene,D3DXVECTOR3 *pvOriginalPosition, int iPad, bool bJoining, bool bAdjustXForSafeArea=true); + int AdjustSplitscreenScene_PlayerChanged(HXUIOBJ hScene,D3DXVECTOR3 *pvOriginalPosition, int iPad, bool bJoining, float fXAdjust); // functions to store launch data, and to exit the game - required due to possibly being on a demo disc virtual void StoreLaunchData(); @@ -185,11 +185,11 @@ public: static TMS_FILE TMSFileA[TMS_COUNT]; - virtual void GetFileFromTPD(eTPDFileType eType,PBYTE pbData,DWORD dwBytes,PBYTE *ppbData,DWORD *pdwBytes ); + virtual void GetFileFromTPD(eTPDFileType eType,uint8_t* pbData,unsigned long dwBytes,uint8_t* *ppbData,unsigned long *pdwBytes ); private: - static WCHAR m_wchTMSXZP[]; - static WCHAR *CConsoleMinecraftApp::wchExt[MAX_EXTENSION_TYPES]; + static wchar_t m_wchTMSXZP[]; + static wchar_t *CConsoleMinecraftApp::wchExt[MAX_EXTENSION_TYPES]; }; diff --git a/src/client/Xbox/Xbox_Minecraft.cpp b/src/client/Xbox/Xbox_Minecraft.cpp index 3c2aa895..7ca5c3d8 100644 --- a/src/client/Xbox/Xbox_Minecraft.cpp +++ b/src/client/Xbox/Xbox_Minecraft.cpp @@ -37,8 +37,8 @@ #include -void GetRenderAndSamplerStates(IDirect3DDevice9 *pDevice,DWORD *RenderStateA,DWORD *SamplerStateA); -void SetRenderAndSamplerStates(IDirect3DDevice9 *pDevice,DWORD *RenderStateA,DWORD *SamplerStateA); +void GetRenderAndSamplerStates(IDirect3DDevice9 *pDevice,unsigned long *RenderStateA,unsigned long *SamplerStateA); +void SetRenderAndSamplerStates(IDirect3DDevice9 *pDevice,unsigned long *RenderStateA,unsigned long *SamplerStateA); // 4J-PB - Done - #pragma message(__LOC__"Theme should be GREEN SIGNED before _FINAL_BUILD") @@ -52,7 +52,7 @@ void SetRenderAndSamplerStates(IDirect3DDevice9 *pDevice,DWORD *RenderStateA,DWO //#define PROFILE_VERSION 3 // new version for the interim bug fix 166 TU #define NUM_PROFILE_VALUES 5 #define NUM_PROFILE_SETTINGS 4 -DWORD dwProfileSettingsA[NUM_PROFILE_VALUES]= +unsigned long dwProfileSettingsA[NUM_PROFILE_VALUES]= { XPROFILE_OPTION_CONTROLLER_VIBRATION, XPROFILE_GAMER_YAXIS_INVERSION, @@ -89,7 +89,7 @@ D3DSAMPLERSTATETYPE SamplerStateModes[]= //------------------------------------------------------------------------------------- -BOOL g_bWidescreen = true; +bool g_bWidescreen = true; void DefineActions(void) @@ -249,7 +249,7 @@ void DefineActions(void) -HRESULT InitD3D( IDirect3DDevice9 **ppDevice, +int InitD3D( IDirect3DDevice9 **ppDevice, D3DPRESENT_PARAMETERS *pd3dPP ) { IDirect3D9 *pD3D; @@ -312,7 +312,7 @@ int __cdecl main() { IDirect3DDevice9 *pDevice; D3DPRESENT_PARAMETERS d3dpp; - HRESULT hr; + int hr; static bool bTrialTimerDisplayed=true; //__debugbreak(); @@ -355,10 +355,10 @@ int __cdecl main() D3DRS_COLORWRITEENABLE */ - DWORD RenderStateA[8]; - DWORD SamplerStateA[5]; - DWORD RenderStateA2[8]; - DWORD SamplerStateA2[5]; + unsigned long RenderStateA[8]; + unsigned long SamplerStateA[5]; + unsigned long RenderStateA2[8]; + unsigned long SamplerStateA2[5]; // Initialize D3D hr = InitD3D( &pDevice, &d3dpp ); @@ -466,23 +466,23 @@ int __cdecl main() app.LoadXuiResources(); // initialise the storage manager with a default save display name, a Minimum save size, and a callback for displaying the saving message - StorageManager.Init(app.GetString(IDS_DEFAULT_SAVENAME),"savegame.dat",FIFTY_ONE_MB,&CConsoleMinecraftApp::DisplaySavingMessage,(LPVOID)&app,GROUP_ID); + StorageManager.Init(app.GetString(IDS_DEFAULT_SAVENAME),"savegame.dat",FIFTY_ONE_MB,&CConsoleMinecraftApp::DisplaySavingMessage,(void*)&app,GROUP_ID); // Set up the global title storage path StorageManager.StoreTMSPathName(); // set a function to be called when there's a sign in change, so we can exit a level if the primary player signs out - ProfileManager.SetSignInChangeCallback(&CConsoleMinecraftApp::SignInChangeCallback,(LPVOID)&app); + ProfileManager.SetSignInChangeCallback(&CConsoleMinecraftApp::SignInChangeCallback,(void*)&app); // set a function to be called when the ethernet is disconnected, so we can back out if required - ProfileManager.SetNotificationsCallback(&CConsoleMinecraftApp::NotificationsCallback,(LPVOID)&app); + ProfileManager.SetNotificationsCallback(&CConsoleMinecraftApp::NotificationsCallback,(void*)&app); // Set a callback for the default player options to be set - when there is no profile data for the player - ProfileManager.SetDefaultOptionsCallback(&CConsoleMinecraftApp::DefaultOptionsCallback,(LPVOID)&app); + ProfileManager.SetDefaultOptionsCallback(&CConsoleMinecraftApp::DefaultOptionsCallback,(void*)&app); // Set a callback to deal with old profile versions needing updated to new versions - ProfileManager.SetOldProfileVersionCallback(&CConsoleMinecraftApp::OldProfileVersionCallback,(LPVOID)&app); + ProfileManager.SetOldProfileVersionCallback(&CConsoleMinecraftApp::OldProfileVersionCallback,(void*)&app); // Set a callback for when there is a read error on profile data - ProfileManager.SetProfileReadErrorCallback(&CConsoleMinecraftApp::ProfileReadErrorCallback,(LPVOID)&app); + ProfileManager.SetProfileReadErrorCallback(&CConsoleMinecraftApp::ProfileReadErrorCallback,(void*)&app); // QNet needs to be setup after profile manager, as we do not want its Notify listener to handle @@ -497,7 +497,7 @@ int __cdecl main() //ProfileManager.AddDLC(2); StorageManager.SetDLCPackageRoot("DLCDrive"); - StorageManager.RegisterMarketplaceCountsCallback(&CConsoleMinecraftApp::MarketplaceCountsCallback,(LPVOID)&app); + StorageManager.RegisterMarketplaceCountsCallback(&CConsoleMinecraftApp::MarketplaceCountsCallback,(void*)&app); // Kinect ! // if(XNuiGetHardwareStatus()!=0) @@ -553,7 +553,7 @@ int __cdecl main() app.InitialiseTips(); - DWORD initData=0; + unsigned long initData=0; @@ -859,7 +859,7 @@ int __cdecl main() } -void GetRenderAndSamplerStates(IDirect3DDevice9 *pDevice,DWORD *RenderStateA,DWORD *SamplerStateA) +void GetRenderAndSamplerStates(IDirect3DDevice9 *pDevice,unsigned long *RenderStateA,unsigned long *SamplerStateA) { for(int i=0;i<8;i++) { @@ -872,7 +872,7 @@ void GetRenderAndSamplerStates(IDirect3DDevice9 *pDevice,DWORD *RenderStateA,DWO } } -void SetRenderAndSamplerStates(IDirect3DDevice9 *pDevice,DWORD *RenderStateA,DWORD *SamplerStateA) +void SetRenderAndSamplerStates(IDirect3DDevice9 *pDevice,unsigned long *RenderStateA,unsigned long *SamplerStateA) { for(int i=0;i<8;i++) { @@ -895,9 +895,9 @@ volatile size_t sizeCheckMin = 1160; volatile size_t sizeCheckMax = 1160; volatile int sectCheck = 48; CRITICAL_SECTION memCS; -DWORD tlsIdx; +unsigned long tlsIdx; -LPVOID XMemAlloc(SIZE_T dwSize, DWORD dwAllocAttributes) +void* XMemAlloc(size_t dwSize, unsigned long dwAllocAttributes) { if( !trackStarted ) { @@ -951,7 +951,7 @@ void operator delete (void *p) XMemFree(p,MAKE_XALLOC_ATTRIBUTES(0,false,true,false,0,XALLOC_PHYSICAL_ALIGNMENT_DEFAULT,XALLOC_MEMPROTECT_READWRITE,false,XALLOC_MEMTYPE_HEAP)); } -void WINAPI XMemFree(PVOID pAddress, DWORD dwAllocAttributes) +void WINAPI XMemFree(void* pAddress, unsigned long dwAllocAttributes) { bool special = false; if( dwAllocAttributes == 0 ) @@ -987,9 +987,9 @@ void WINAPI XMemFree(PVOID pAddress, DWORD dwAllocAttributes) LeaveCriticalSection(&memCS); } -SIZE_T WINAPI XMemSize( - PVOID pAddress, - DWORD dwAllocAttributes +size_t WINAPI XMemSize( + void* pAddress, + unsigned long dwAllocAttributes ) { if( trackStarted ) @@ -1045,7 +1045,7 @@ void MemSect(int section) { value = (value << 6) | section; } - TlsSetValue(tlsIdx, (LPVOID)value); + TlsSetValue(tlsIdx, (void*)value); } void MemPixStuff() diff --git a/src/client/Xbox/Xbox_UIController.cpp b/src/client/Xbox/Xbox_UIController.cpp index e2a1c91b..b51e8251 100644 --- a/src/client/Xbox/Xbox_UIController.cpp +++ b/src/client/Xbox/Xbox_UIController.cpp @@ -106,7 +106,7 @@ void ConsoleUIController::SetTooltipText( unsigned int iPad, unsigned int toolti CXuiSceneBase::SetTooltipText(iPad,tooltip,iTextID); } -void ConsoleUIController::SetEnableTooltips( unsigned int iPad, BOOL bVal ) +void ConsoleUIController::SetEnableTooltips( unsigned int iPad, bool bVal ) { CXuiSceneBase::SetEnableTooltips(iPad,bVal); } @@ -313,13 +313,13 @@ void ConsoleUIController::SetWinUserIndex(unsigned int iPad) CScene_Win::setWinUserIndex( iPad ); } -C4JStorage::EMessageResult ConsoleUIController::RequestMessageBox(UINT uiTitle, UINT uiText, UINT *uiOptionA,UINT uiOptionC, DWORD dwPad, - int( *Func)(LPVOID,int,const C4JStorage::EMessageResult),LPVOID lpParam, CXuiStringTable *pStringTable, WCHAR *pwchFormatString,DWORD dwFocusButton,bool bIsError) +C4JStorage::EMessageResult ConsoleUIController::RequestMessageBox(unsigned int uiTitle, unsigned int uiText, unsigned int *uiOptionA,unsigned int uiOptionC, unsigned long dwPad, + int( *Func)(void*,int,const C4JStorage::EMessageResult),void* lpParam, CXuiStringTable *pStringTable, wchar_t *pwchFormatString,unsigned long dwFocusButton,bool bIsError) { return StorageManager.RequestMessageBox(uiTitle, uiText, uiOptionA, uiOptionC, dwPad, Func, lpParam, pStringTable, pwchFormatString, dwFocusButton); } -C4JStorage::EMessageResult ConsoleUIController::RequestUGCMessageBox(UINT title/* = -1 */, UINT message/* = -1 */, int iPad/* = -1*/, int( *Func)(LPVOID,int,const C4JStorage::EMessageResult)/* = NULL*/, LPVOID lpParam/* = NULL*/) +C4JStorage::EMessageResult ConsoleUIController::RequestUGCMessageBox(unsigned int title/* = -1 */, unsigned int message/* = -1 */, int iPad/* = -1*/, int( *Func)(void*,int,const C4JStorage::EMessageResult)/* = NULL*/, void* lpParam/* = NULL*/) { // Default title / messages if (title == -1) @@ -335,7 +335,7 @@ C4JStorage::EMessageResult ConsoleUIController::RequestUGCMessageBox(UINT title/ // Default pad to primary player if (iPad == -1) iPad = ProfileManager.GetPrimaryPad(); - UINT uiIDA[1]; + unsigned int uiIDA[1]; uiIDA[0]=IDS_CONFIRM_OK; return ui.RequestMessageBox(title, message, uiIDA, 1, iPad, Func, lpParam, app.GetStringTable(), NULL, 0, false); } \ No newline at end of file diff --git a/src/client/Xbox/Xbox_UIController.h b/src/client/Xbox/Xbox_UIController.h index db37c900..5cf45eea 100644 --- a/src/client/Xbox/Xbox_UIController.h +++ b/src/client/Xbox/Xbox_UIController.h @@ -28,7 +28,7 @@ public: virtual void AnimateKeyPress(int iPad, int dwKeyCode); virtual void SetTooltipText( unsigned int iPad, unsigned int tooltip, int iTextID ); - virtual void SetEnableTooltips( unsigned int iPad, BOOL bVal ); + virtual void SetEnableTooltips( unsigned int iPad, bool bVal ); virtual void ShowTooltip( unsigned int iPad, unsigned int tooltip, bool show ); virtual void SetTooltips( unsigned int iPad, int iA, int iB=-1, int iX=-1, int iY=-1 , int iLT=-1, int iRT=-1, int iLB=-1, int iRB=-1, int iLS=-1, bool forceUpdate = false); virtual void EnableTooltip( unsigned int iPad, unsigned int tooltip, bool enable ); @@ -70,10 +70,10 @@ public: virtual void SetWinUserIndex(unsigned int iPad); - virtual C4JStorage::EMessageResult RequestMessageBox(UINT uiTitle, UINT uiText, UINT *uiOptionA,UINT uiOptionC, DWORD dwPad=XUSER_INDEX_ANY, - int( *Func)(LPVOID,int,const C4JStorage::EMessageResult)=NULL,LPVOID lpParam=NULL, CXuiStringTable *pStringTable=NULL, WCHAR *pwchFormatString=NULL,DWORD dwFocusButton=0, bool bIsError = true); + virtual C4JStorage::EMessageResult RequestMessageBox(unsigned int uiTitle, unsigned int uiText, unsigned int *uiOptionA,unsigned int uiOptionC, unsigned long dwPad=XUSER_INDEX_ANY, + int( *Func)(void*,int,const C4JStorage::EMessageResult)=NULL,void* lpParam=NULL, CXuiStringTable *pStringTable=NULL, wchar_t *pwchFormatString=NULL,unsigned long dwFocusButton=0, bool bIsError = true); - C4JStorage::EMessageResult RequestUGCMessageBox(UINT title = -1, UINT message = -1, int iPad = -1, int( *Func)(LPVOID,int,const C4JStorage::EMessageResult) = NULL, LPVOID lpParam = NULL); + C4JStorage::EMessageResult RequestUGCMessageBox(unsigned int title = -1, unsigned int message = -1, int iPad = -1, int( *Func)(void*,int,const C4JStorage::EMessageResult) = NULL, void* lpParam = NULL); }; extern ConsoleUIController ui; \ No newline at end of file diff --git a/src/client/extraX64client.h b/src/client/extraX64client.h index 0ba6980c..f82844a1 100644 --- a/src/client/extraX64client.h +++ b/src/client/extraX64client.h @@ -7,7 +7,7 @@ typedef enum _XBACKGROUND_DOWNLOAD_MODE XBACKGROUND_DOWNLOAD_MODE_AUTO = 2 } XBACKGROUND_DOWNLOAD_MODE, *PXBACKGROUND_DOWNLOAD_MODE; -DWORD XBackgroundDownloadSetMode( +unsigned long XBackgroundDownloadSetMode( XBACKGROUND_DOWNLOAD_MODE Mode ); @@ -16,33 +16,33 @@ DWORD XBackgroundDownloadSetMode( #define XPARTY_MAX_USERS 4 typedef struct _XPARTY_USER_INFO { PlayerUID Xuid; - CHAR GamerTag[XUSER_NAME_SIZE]; - DWORD dwUserIndex; + char GamerTag[XUSER_NAME_SIZE]; + unsigned long dwUserIndex; // XONLINE_NAT_TYPE NatType; - DWORD dwTitleId; - DWORD dwFlags; + unsigned long dwTitleId; + unsigned long dwFlags; // XSESSION_INFO SessionInfo; // XPARTY_CUSTOM_DATA CustomData; } XPARTY_USER_INFO; typedef struct _XPARTY_USER_LIST { - DWORD dwUserCount; + unsigned long dwUserCount; XPARTY_USER_INFO Users[XPARTY_MAX_USERS]; } XPARTY_USER_LIST; -DWORD XShowPartyUI(DWORD dwUserIndex); -DWORD XShowFriendsUI(DWORD dwUserIndex); -HRESULT XPartyGetUserList(XPARTY_USER_LIST *pUserList); +unsigned long XShowPartyUI(unsigned long dwUserIndex); +unsigned long XShowFriendsUI(unsigned long dwUserIndex); +int XPartyGetUserList(XPARTY_USER_LIST *pUserList); -DWORD XContentGetThumbnail(DWORD dwUserIndex, const XCONTENT_DATA *pContentData, PBYTE pbThumbnail, PDWORD pcbThumbnail, PXOVERLAPPED *pOverlapped); +unsigned long XContentGetThumbnail(unsigned long dwUserIndex, const XCONTENT_DATA *pContentData, uint8_t* pbThumbnail, PDWORD pcbThumbnail, PXOVERLAPPED *pOverlapped); void XShowAchievementsUI(int i); -DWORD XUserAreUsersFriends( - DWORD dwUserIndex, +unsigned long XUserAreUsersFriends( + unsigned long dwUserIndex, PPlayerUID pXuids, - DWORD dwXuidCount, + unsigned long dwXuidCount, PBOOL pfResult, void *pOverlapped); @@ -56,8 +56,8 @@ class XSOCIAL_LINKPOSTPARAMS typedef struct _XSESSION_VIEW_PROPERTIES { - DWORD dwViewId; - DWORD dwNumProperties; + unsigned long dwViewId; + unsigned long dwNumProperties; XUSER_PROPERTY *pProperties; } XSESSION_VIEW_PROPERTIES; @@ -65,37 +65,37 @@ typedef struct _XSESSION_VIEW_PROPERTIES typedef struct _XUSER_STATS_SPEC { - DWORD dwViewId; - DWORD dwNumColumnIds; - WORD rgwColumnIds[XUSER_STATS_ATTRS_IN_SPEC]; + unsigned long dwViewId; + unsigned long dwNumColumnIds; + uint16_t rgwColumnIds[XUSER_STATS_ATTRS_IN_SPEC]; } XUSER_STATS_SPEC, *PXUSER_STATS_SPEC; typedef struct _XUSER_STATS_COLUMN { - WORD wColumnId; + uint16_t wColumnId; XUSER_DATA Value; } XUSER_STATS_COLUMN, *PXUSER_STATS_COLUMN; typedef struct _XUSER_STATS_ROW { PlayerUID xuid; - DWORD dwRank; - LONGLONG i64Rating; - CHAR szGamertag[XUSER_NAME_SIZE]; - DWORD dwNumColumns; + unsigned long dwRank; + int64_t i64Rating; + char szGamertag[XUSER_NAME_SIZE]; + unsigned long dwNumColumns; PXUSER_STATS_COLUMN pColumns; } XUSER_STATS_ROW, *PXUSER_STATS_ROW; typedef struct _XUSER_STATS_VIEW { - DWORD dwViewId; - DWORD dwTotalViewRows; - DWORD dwNumRows; + unsigned long dwViewId; + unsigned long dwTotalViewRows; + unsigned long dwNumRows; PXUSER_STATS_ROW pRows; } XUSER_STATS_VIEW, *PXUSER_STATS_VIEW; typedef struct _XUSER_STATS_READ_RESULTS { - DWORD dwNumViews; + unsigned long dwNumViews; PXUSER_STATS_VIEW pViews; } XUSER_STATS_READ_RESULTS, *PXUSER_STATS_READ_RESULTS; diff --git a/src/client/stdafx.h b/src/client/stdafx.h index b3ab5332..6f4324b3 100644 --- a/src/client/stdafx.h +++ b/src/client/stdafx.h @@ -41,7 +41,7 @@ #include "OrbisTypes.h" #include "OrbisStubs.h" #include "OrbisMaths.h" -#define HRESULT_SUCCEEDED(hr) (((HRESULT)(hr)) >= 0) +#define HRESULT_SUCCEEDED(hr) (((int)(hr)) >= 0) #elif defined __PSVITA__ #include #include @@ -59,7 +59,7 @@ #include #include #include -typedef unsigned __int64 __uint64; +typedef unsigned int64_t uint64_t; #endif #ifdef _WINDOWS64 @@ -73,7 +73,7 @@ typedef unsigned __int64 __uint64; #include using namespace DirectX; -#define HRESULT_SUCCEEDED(hr) (((HRESULT)(hr)) >= 0) +#define HRESULT_SUCCEEDED(hr) (((int)(hr)) >= 0) #endif @@ -89,7 +89,7 @@ using namespace DirectX; using namespace DirectX; #include #include "DurangoStubs.h" -#define HRESULT_SUCCEEDED(hr) (((HRESULT)(hr)) >= 0) +#define HRESULT_SUCCEEDED(hr) (((int)(hr)) >= 0) #endif @@ -105,7 +105,7 @@ typedef XINVITE_INFO INVITE_INFO; typedef XUID PlayerUID; typedef XNKID SessionID; typedef XUID GameSessionUID; -#define HRESULT_SUCCEEDED(hr) (((HRESULT)(hr)) >= 0) +#define HRESULT_SUCCEEDED(hr) (((int)(hr)) >= 0) #include "xbox\network\extra.h" #else diff --git a/src/client/stubs.cpp b/src/client/stubs.cpp index 0c7e680a..ea5d23e9 100644 --- a/src/client/stubs.cpp +++ b/src/client/stubs.cpp @@ -100,18 +100,18 @@ void glTexGeni(int,int,int) #ifdef _XBOX // 4J Stu - Added these to stop us needing to pull in loads of media libraries just to use Qnet #include -DWORD XCamInitialize(){ return 0; } -VOID XCamShutdown() {} +unsigned long XCamInitialize(){ return 0; } +void XCamShutdown() {} -DWORD XCamCreateStreamEngine( - CONST XCAM_STREAM_ENGINE_INIT_PARAMS *pParams, +unsigned long XCamCreateStreamEngine( + const XCAM_STREAM_ENGINE_INIT_PARAMS *pParams, PIXCAMSTREAMENGINE *ppEngine ) { return 0; } -DWORD XCamSetView( +unsigned long XCamSetView( XCAMZOOMFACTOR ZoomFactor, - LONG XCenter, - LONG YCenter, + int32_t XCenter, + int32_t YCenter, PXOVERLAPPED pOverlapped ) { return 0; } diff --git a/src/world/AddIslandLayer.cpp b/src/world/AddIslandLayer.cpp index 21e9a96d..a8842936 100644 --- a/src/world/AddIslandLayer.cpp +++ b/src/world/AddIslandLayer.cpp @@ -2,7 +2,7 @@ #include "net.minecraft.world.level.newbiome.layer.h" #include "net.minecraft.world.level.biome.h" -AddIslandLayer::AddIslandLayer(__int64 seedMixup, shared_ptrparent) : Layer(seedMixup) +AddIslandLayer::AddIslandLayer(int64_t seedMixup, shared_ptrparent) : Layer(seedMixup) { this->parent = parent; } diff --git a/src/world/AddIslandLayer.h b/src/world/AddIslandLayer.h index e7c9384b..2446bbf8 100644 --- a/src/world/AddIslandLayer.h +++ b/src/world/AddIslandLayer.h @@ -5,7 +5,7 @@ class AddIslandLayer : public Layer { public: - AddIslandLayer(__int64 seedMixup, shared_ptrparent); + AddIslandLayer(int64_t seedMixup, shared_ptrparent); intArray getArea(int xo, int yo, int w, int h); }; \ No newline at end of file diff --git a/src/world/AddMushroomIslandLayer.cpp b/src/world/AddMushroomIslandLayer.cpp index 022a3b29..324c88ee 100644 --- a/src/world/AddMushroomIslandLayer.cpp +++ b/src/world/AddMushroomIslandLayer.cpp @@ -3,7 +3,7 @@ #include "net.minecraft.world.level.biome.h" -AddMushroomIslandLayer::AddMushroomIslandLayer(__int64 seedMixup, shared_ptr parent) : Layer(seedMixup) +AddMushroomIslandLayer::AddMushroomIslandLayer(int64_t seedMixup, shared_ptr parent) : Layer(seedMixup) { this->parent = parent; } diff --git a/src/world/AddMushroomIslandLayer.h b/src/world/AddMushroomIslandLayer.h index acda9fa7..f691ebda 100644 --- a/src/world/AddMushroomIslandLayer.h +++ b/src/world/AddMushroomIslandLayer.h @@ -4,6 +4,6 @@ class AddMushroomIslandLayer : public Layer { public: - AddMushroomIslandLayer(__int64 seedMixup, shared_ptr parent); + AddMushroomIslandLayer(int64_t seedMixup, shared_ptr parent); virtual intArray getArea(int xo, int yo, int w, int h); }; \ No newline at end of file diff --git a/src/world/AddPlayerPacket.cpp b/src/world/AddPlayerPacket.cpp index f3d8a32b..a5b5b5f0 100644 --- a/src/world/AddPlayerPacket.cpp +++ b/src/world/AddPlayerPacket.cpp @@ -55,7 +55,7 @@ AddPlayerPacket::AddPlayerPacket(shared_ptr player, PlayerUID xuid, Play this->xuid = xuid; this->OnlineXuid = OnlineXuid; - m_playerIndex = (BYTE)player->getPlayerIndex(); + m_playerIndex = (uint8_t)player->getPlayerIndex(); m_skinId = player->getCustomSkin(); m_capeId = player->getCustomCape(); m_uiGamePrivileges = player->getAllPlayerGamePrivileges(); @@ -78,11 +78,11 @@ void AddPlayerPacket::read(DataInputStream *dis) //throws IOException xuid = dis->readPlayerUID(); OnlineXuid = dis->readPlayerUID(); m_playerIndex = dis->readByte(); - INT skinId = dis->readInt(); - m_skinId = *(DWORD *)&skinId; - INT capeId = dis->readInt(); - m_capeId = *(DWORD *)&capeId; - INT privileges = dis->readInt(); + int skinId = dis->readInt(); + m_skinId = *(unsigned long *)&skinId; + int capeId = dis->readInt(); + m_capeId = *(unsigned long *)&capeId; + int privileges = dis->readInt(); m_uiGamePrivileges = *(unsigned int *)&privileges; MemSect(1); unpack = SynchedEntityData::unpack(dis); @@ -117,7 +117,7 @@ void AddPlayerPacket::handle(PacketListener *listener) int AddPlayerPacket::getEstimatedSize() { - int iSize= sizeof(int) + Player::MAX_NAME_LENGTH + sizeof(int) + sizeof(int) + sizeof(int) + sizeof(BYTE) + sizeof(BYTE) +sizeof(short) + sizeof(PlayerUID) + sizeof(PlayerUID) + sizeof(int) + sizeof(BYTE) + sizeof(unsigned int) + sizeof(byte); + int iSize= sizeof(int) + Player::MAX_NAME_LENGTH + sizeof(int) + sizeof(int) + sizeof(int) + sizeof(uint8_t) + sizeof(uint8_t) +sizeof(short) + sizeof(PlayerUID) + sizeof(PlayerUID) + sizeof(int) + sizeof(uint8_t) + sizeof(unsigned int) + sizeof(byte); if( entityData != NULL ) { diff --git a/src/world/AddPlayerPacket.h b/src/world/AddPlayerPacket.h index 30f6bcdd..d4f86974 100644 --- a/src/world/AddPlayerPacket.h +++ b/src/world/AddPlayerPacket.h @@ -21,9 +21,9 @@ public: int carriedItem; PlayerUID xuid; // 4J Added PlayerUID OnlineXuid; // 4J Added - BYTE m_playerIndex; // 4J Added - DWORD m_skinId; // 4J Added - DWORD m_capeId; // 4J Added + uint8_t m_playerIndex; // 4J Added + unsigned long m_skinId; // 4J Added + unsigned long m_capeId; // 4J Added unsigned int m_uiGamePrivileges; // 4J Added byte yHeadRot; // 4J Added diff --git a/src/world/AddSnowLayer.cpp b/src/world/AddSnowLayer.cpp index d8a33cc9..aa459789 100644 --- a/src/world/AddSnowLayer.cpp +++ b/src/world/AddSnowLayer.cpp @@ -2,7 +2,7 @@ #include "net.minecraft.world.level.newbiome.layer.h" #include "net.minecraft.world.level.biome.h" -AddSnowLayer::AddSnowLayer(__int64 seedMixup, shared_ptr parent) : Layer(seedMixup) +AddSnowLayer::AddSnowLayer(int64_t seedMixup, shared_ptr parent) : Layer(seedMixup) { this->parent = parent; } diff --git a/src/world/AddSnowLayer.h b/src/world/AddSnowLayer.h index ede7a226..0b3702da 100644 --- a/src/world/AddSnowLayer.h +++ b/src/world/AddSnowLayer.h @@ -4,6 +4,6 @@ class AddSnowLayer : public Layer { public: - AddSnowLayer(__int64 seedMixup, shared_ptr parent); + AddSnowLayer(int64_t seedMixup, shared_ptr parent); virtual intArray getArea(int xo, int yo, int w, int h); }; \ No newline at end of file diff --git a/src/world/ArmorItem.cpp b/src/world/ArmorItem.cpp index e0c3ff50..263dd5c8 100644 --- a/src/world/ArmorItem.cpp +++ b/src/world/ArmorItem.cpp @@ -170,9 +170,8 @@ void ArmorItem::setColor(shared_ptr item, int color) { #ifndef _CONTENT_PACKAGE printf("Can't dye non-leather!"); - __debugbreak(); + throw new UnsupportedOperationException("Can't dye non-leather!"); #endif - //throw new UnsupportedOperationException("Can't dye non-leather!"); } CompoundTag *tag = item->getTag(); diff --git a/src/world/BasicTree.cpp b/src/world/BasicTree.cpp index 01f10cb3..c1c92287 100644 --- a/src/world/BasicTree.cpp +++ b/src/world/BasicTree.cpp @@ -524,7 +524,7 @@ bool BasicTree::place(Level *level, Random *random, int x, int y, int z) // Initialize the instance fields for the level and the seed. thisLevel = level; - __int64 seed = random->nextLong(); + int64_t seed = random->nextLong(); rnd->setSeed(seed); // Initialize the origin of the tree trunk origin[0] = x; diff --git a/src/world/BasicTypeContainers.h b/src/world/BasicTypeContainers.h index 094e9616..2dc5c173 100644 --- a/src/world/BasicTypeContainers.h +++ b/src/world/BasicTypeContainers.h @@ -1,5 +1,6 @@ #pragma once - +#include +#include class Byte { @@ -57,14 +58,14 @@ public: } static bool isInfinite( double a ) { return false; /*4J TODO*/ } - static double longBitsToDouble( __int64 bits ) + static double longBitsToDouble( int64_t bits ) { return *(double *)&bits; } - static __int64 doubleToLongBits( double d ) + static int64_t doubleToLongBits( double d ) { - return *(__int64 *)&d; + return *(int64_t *)&d; } }; diff --git a/src/world/BiomeCache.cpp b/src/world/BiomeCache.cpp index 0d9c017c..3ef4f0f6 100644 --- a/src/world/BiomeCache.cpp +++ b/src/world/BiomeCache.cpp @@ -85,7 +85,7 @@ BiomeCache::Block *BiomeCache::getBlockAt(int x, int z) EnterCriticalSection(&m_CS); x >>= ZONE_SIZE_BITS; z >>= ZONE_SIZE_BITS; - __int64 slot = (((__int64) x) & 0xffffffffl) | ((((__int64) z) & 0xffffffffl) << 32l); + int64_t slot = (((int64_t) x) & 0xffffffffl) | ((((int64_t) z) & 0xffffffffl) << 32l); AUTO_VAR(it, cached.find(slot)); Block *block = NULL; if (it == cached.end()) @@ -124,8 +124,8 @@ float BiomeCache::getDownfall(int x, int z) void BiomeCache::update() { EnterCriticalSection(&m_CS); - __int64 now = app.getAppTime(); - __int64 utime = now - lastUpdateTime; + int64_t now = app.getAppTime(); + int64_t utime = now - lastUpdateTime; if (utime > DECAY_TIME / 4 || utime < 0) { lastUpdateTime = now; @@ -133,11 +133,11 @@ void BiomeCache::update() for (AUTO_VAR(it, all.begin()); it != all.end();) { Block *block = *it; - __int64 time = now - block->lastUse; + int64_t time = now - block->lastUse; if (time > DECAY_TIME || time < 0) { it = all.erase(it); - __int64 slot = (((__int64) block->x) & 0xffffffffl) | ((((__int64) block->z) & 0xffffffffl) << 32l); + int64_t slot = (((int64_t) block->x) & 0xffffffffl) | ((((int64_t) block->z) & 0xffffffffl) << 32l); cached.erase(slot); delete block; } diff --git a/src/world/BiomeCache.h b/src/world/BiomeCache.h index d52a1e4c..0fb3d7ac 100644 --- a/src/world/BiomeCache.h +++ b/src/world/BiomeCache.h @@ -10,7 +10,7 @@ private: static const int ZONE_SIZE_MASK = ZONE_SIZE - 1; const BiomeSource *source; - __int64 lastUpdateTime; + int64_t lastUpdateTime; public: class Block @@ -22,7 +22,7 @@ public: // BiomeArray biomes; byteArray biomeIndices; int x, z; - __int64 lastUse; + int64_t lastUse; Block(int x, int z, BiomeCache *parent); ~Block(); @@ -32,7 +32,7 @@ public: }; private: - unordered_map<__int64,Block *,LongKeyHash,LongKeyEq> cached; // 4J - was LongHashMap + unordered_map cached; // 4J - was LongHashMap vector all; // was ArrayList public: diff --git a/src/world/BiomeDecorator.cpp b/src/world/BiomeDecorator.cpp index 6ca7386c..cf4a5b32 100644 --- a/src/world/BiomeDecorator.cpp +++ b/src/world/BiomeDecorator.cpp @@ -23,8 +23,7 @@ void BiomeDecorator::decorate(Level *level, Random *random, int xo, int zo) { app.DebugPrintf("BiomeDecorator::decorate - Already decorating!!\n"); #ifndef _CONTENT_PACKAGE - __debugbreak(); - //throw new RuntimeException("Already decorating!!"); + throw new RuntimeException("Already decorating!!"); #endif } this->level = level; diff --git a/src/world/BiomeInitLayer.cpp b/src/world/BiomeInitLayer.cpp index ead63eee..6edd18de 100644 --- a/src/world/BiomeInitLayer.cpp +++ b/src/world/BiomeInitLayer.cpp @@ -4,7 +4,7 @@ #include "net.minecraft.world.level.h" #include "BiomeInitLayer.h" -BiomeInitLayer::BiomeInitLayer(__int64 seed, shared_ptrparent, LevelType *levelType) : Layer(seed) +BiomeInitLayer::BiomeInitLayer(int64_t seed, shared_ptrparent, LevelType *levelType) : Layer(seed) { this->parent = parent; diff --git a/src/world/BiomeInitLayer.h b/src/world/BiomeInitLayer.h index e645a379..00bf3812 100644 --- a/src/world/BiomeInitLayer.h +++ b/src/world/BiomeInitLayer.h @@ -10,7 +10,7 @@ private: BiomeArray startBiomes; public: - BiomeInitLayer(__int64 seed, shared_ptr parent, LevelType *levelType); + BiomeInitLayer(int64_t seed, shared_ptr parent, LevelType *levelType); virtual ~BiomeInitLayer(); intArray getArea(int xo, int yo, int w, int h); }; \ No newline at end of file diff --git a/src/world/BiomeOverrideLayer.cpp b/src/world/BiomeOverrideLayer.cpp index b4f42914..d7f1155a 100644 --- a/src/world/BiomeOverrideLayer.cpp +++ b/src/world/BiomeOverrideLayer.cpp @@ -11,18 +11,18 @@ BiomeOverrideLayer::BiomeOverrideLayer(int seedMixup) : Layer(seedMixup) #ifdef _UNICODE wstring path = L"GAME:\\GameRules\\biomemap.bin"; - HANDLE file = CreateFile(path.c_str(), GENERIC_READ, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); + void* file = CreateFile(path.c_str(), GENERIC_READ, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); #else #ifdef _WINDOWS64 string path = "GameRules\\biomemap.bin"; #else string path = "GAME:\\GameRules\\biomemap.bin"; #endif - HANDLE file = CreateFile(path.c_str(), GENERIC_READ, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); + void* file = CreateFile(path.c_str(), GENERIC_READ, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); #endif if( file == INVALID_HANDLE_VALUE ) { - DWORD error = GetLastError(); + unsigned long error = GetLastError(); //assert(false); app.DebugPrintf("Biome override not found, using plains as default\n"); @@ -33,16 +33,16 @@ BiomeOverrideLayer::BiomeOverrideLayer(int seedMixup) : Layer(seedMixup) #ifdef _DURANGO __debugbreak(); // TODO - DWORD bytesRead,dwFileSize = 0; + unsigned long bytesRead,dwFileSize = 0; #else - DWORD bytesRead,dwFileSize = GetFileSize(file,NULL); + unsigned long bytesRead,dwFileSize = GetFileSize(file,NULL); #endif if(dwFileSize > m_biomeOverride.length) { app.DebugPrintf("Biomemap binary is too large!!\n"); __debugbreak(); } - BOOL bSuccess = ReadFile(file,m_biomeOverride.data,dwFileSize,&bytesRead,NULL); + bool bSuccess = ReadFile(file,m_biomeOverride.data,dwFileSize,&bytesRead,NULL); if(bSuccess==false) { diff --git a/src/world/BiomeSource.cpp b/src/world/BiomeSource.cpp index 50ac5f9a..08af15ad 100644 --- a/src/world/BiomeSource.cpp +++ b/src/world/BiomeSource.cpp @@ -26,7 +26,7 @@ void BiomeSource::_init() playerSpawnBiomes.push_back(Biome::jungleHills); } -void BiomeSource::_init(__int64 seed, LevelType *generator) +void BiomeSource::_init(int64_t seed, LevelType *generator) { _init(); @@ -43,7 +43,7 @@ BiomeSource::BiomeSource() } // 4J added -BiomeSource::BiomeSource(__int64 seed, LevelType *generator) +BiomeSource::BiomeSource(int64_t seed, LevelType *generator) { _init(seed, generator); } @@ -408,13 +408,13 @@ void BiomeSource::update() // 4J added - find a seed for this biomesource that matches certain criteria #ifdef __PSVITA__ -__int64 BiomeSource::findSeed(LevelType *generator, bool* pServerRunning) // MGH - added pRunning, so we can early out of this on Vita as it can take up to 60 secs +int64_t BiomeSource::findSeed(LevelType *generator, bool* pServerRunning) // MGH - added pRunning, so we can early out of this on Vita as it can take up to 60 secs #else -__int64 BiomeSource::findSeed(LevelType *generator) +int64_t BiomeSource::findSeed(LevelType *generator) #endif { - __int64 bestSeed = 0; + int64_t bestSeed = 0; ProgressRenderer *mcprogress = Minecraft::GetInstance()->progressRenderer; mcprogress->progressStage(IDS_PROGRESS_NEW_WORLD_SEED); @@ -452,7 +452,7 @@ __int64 BiomeSource::findSeed(LevelType *generator) // Just keeping trying to generate seeds until we find one that matches our criteria do { - __int64 seed = pr->nextLong(); + int64_t seed = pr->nextLong(); BiomeSource *biomeSource = new BiomeSource(seed,generator); biomeSource->getRawBiomeIndices(indices, biomeOffset, biomeOffset, biomeWidth, biomeWidth); diff --git a/src/world/BiomeSource.h b/src/world/BiomeSource.h index bef09db0..d1cdb4ab 100644 --- a/src/world/BiomeSource.h +++ b/src/world/BiomeSource.h @@ -25,20 +25,20 @@ private: protected: void _init(); - void _init(__int64 seed, LevelType *generator); + void _init(int64_t seed, LevelType *generator); BiomeSource(); public: - BiomeSource(__int64 seed, LevelType *generator); + BiomeSource(int64_t seed, LevelType *generator); BiomeSource(Level *level); private: static bool getIsMatch(float *frac); // 4J added static void getFracs(intArray indices, float *fracs); // 4J added public: #ifdef __PSVITA__ - static __int64 findSeed(LevelType *generator, bool* pServerRunning); // MGH - added pRunning, so we can early out of this on Vita as it can take up to 60 secs // 4J added + static int64_t findSeed(LevelType *generator, bool* pServerRunning); // MGH - added pRunning, so we can early out of this on Vita as it can take up to 60 secs // 4J added #else - static __int64 findSeed(LevelType *generator); // 4J added + static int64_t findSeed(LevelType *generator); // 4J added #endif ~BiomeSource(); diff --git a/src/world/BlockGenMethods.cpp b/src/world/BlockGenMethods.cpp index d6c6730e..136dbd81 100644 --- a/src/world/BlockGenMethods.cpp +++ b/src/world/BlockGenMethods.cpp @@ -3,7 +3,7 @@ #include "net.minecraft.world.level.h" #include "BlockGenMethods.h" -void BlockGenMethods::generateBox(Level *level, byteArray blocks, int sx, int sy, int sz, int ex, int ey, int ez, BYTE edge, BYTE filling) +void BlockGenMethods::generateBox(Level *level, byteArray blocks, int sx, int sy, int sz, int ex, int ey, int ez, uint8_t edge, uint8_t filling) { sx = Mth::clamp(sx, 0, 15); @@ -34,7 +34,7 @@ void BlockGenMethods::generateBox(Level *level, byteArray blocks, int sx, int sy } } -void BlockGenMethods::generateFrame(Level *level, byteArray blocks, int sx, int sy, int ex, int ey, int flatZ, int direction, BYTE edge, BYTE filling) +void BlockGenMethods::generateFrame(Level *level, byteArray blocks, int sx, int sy, int ex, int ey, int flatZ, int direction, uint8_t edge, uint8_t filling) { sx = Mth::clamp(sx, 0, 15); @@ -100,7 +100,7 @@ void BlockGenMethods::generateFrame(Level *level, byteArray blocks, int sx, int } } -void BlockGenMethods::generateDirectionLine(Level *level, byteArray blocks, int sx, int sy, int sz, int ex, int ey, int ez, int startDirection, int endDirection, BYTE block) +void BlockGenMethods::generateDirectionLine(Level *level, byteArray blocks, int sx, int sy, int sz, int ex, int ey, int ez, int startDirection, int endDirection, uint8_t block) { sx = Mth::clamp(sx, 0, 15); @@ -218,7 +218,7 @@ void BlockGenMethods::generateDirectionLine(Level *level, byteArray blocks, int } } -void BlockGenMethods::generateLine(Level *level, byteArray blocks, int sx, int sy, int sz, int ex, int ey, int ez, BYTE block) +void BlockGenMethods::generateLine(Level *level, byteArray blocks, int sx, int sy, int sz, int ex, int ey, int ez, uint8_t block) { generateDirectionLine(level, blocks, sx, sy, sz, ex, ey, ez, 0, 0, block); } \ No newline at end of file diff --git a/src/world/BlockGenMethods.h b/src/world/BlockGenMethods.h index deed0396..65435a4f 100644 --- a/src/world/BlockGenMethods.h +++ b/src/world/BlockGenMethods.h @@ -5,8 +5,8 @@ class BlockGenMethods { public: - static void generateBox(Level *level, byteArray blocks, int sx, int sy, int sz, int ex, int ey, int ez, BYTE edge, BYTE filling); - static void generateFrame(Level *level, byteArray blocks, int sx, int sy, int ex, int ey, int flatZ, int direction, BYTE edge, BYTE filling); - static void generateDirectionLine(Level *level, byteArray blocks, int sx, int sy, int sz, int ex, int ey, int ez, int startDirection, int endDirection, BYTE block); - static void generateLine(Level *level, byteArray blocks, int sx, int sy, int sz, int ex, int ey, int ez, BYTE block); + static void generateBox(Level *level, byteArray blocks, int sx, int sy, int sz, int ex, int ey, int ez, uint8_t edge, uint8_t filling); + static void generateFrame(Level *level, byteArray blocks, int sx, int sy, int ex, int ey, int flatZ, int direction, uint8_t edge, uint8_t filling); + static void generateDirectionLine(Level *level, byteArray blocks, int sx, int sy, int sz, int ex, int ey, int ez, int startDirection, int endDirection, uint8_t block); + static void generateLine(Level *level, byteArray blocks, int sx, int sy, int sz, int ex, int ey, int ez, uint8_t block); }; \ No newline at end of file diff --git a/src/world/ByteArrayInputStream.cpp b/src/world/ByteArrayInputStream.cpp index 394bda14..f0f8c398 100644 --- a/src/world/ByteArrayInputStream.cpp +++ b/src/world/ByteArrayInputStream.cpp @@ -100,7 +100,7 @@ void ByteArrayInputStream::close() //n - the number of bytes to be skipped. //Returns: //the actual number of bytes skipped. -__int64 ByteArrayInputStream::skip(__int64 n) +int64_t ByteArrayInputStream::skip(int64_t n) { int newPos = pos + n; diff --git a/src/world/ByteArrayInputStream.h b/src/world/ByteArrayInputStream.h index e74b1cf7..5b2d95cf 100644 --- a/src/world/ByteArrayInputStream.h +++ b/src/world/ByteArrayInputStream.h @@ -19,7 +19,7 @@ public: virtual int read(byteArray b); virtual int read(byteArray b, unsigned int offset, unsigned int length); virtual void close(); - virtual __int64 skip(__int64 n); + virtual int64_t skip(int64_t n); // 4J Stu Added - Sometimes we don't want to delete the data on destroying this void reset() { buf = byteArray(); count = 0; mark = 0; pos = 0; } diff --git a/src/world/ByteBuffer.cpp b/src/world/ByteBuffer.cpp index 66514737..ec729edf 100644 --- a/src/world/ByteBuffer.cpp +++ b/src/world/ByteBuffer.cpp @@ -104,7 +104,7 @@ int ByteBuffer::getSize() //The byte at the given index //Throws: //IndexOutOfBoundsException - If index is negative or not smaller than the buffer's limit -BYTE ByteBuffer::get(int index) +uint8_t ByteBuffer::get(int index) { assert( index < m_limit ); assert( index >= 0 ); @@ -176,20 +176,20 @@ int ByteBuffer::getInt(unsigned int index) // //Returns: //The long value at the buffer's current position -__int64 ByteBuffer::getLong() +int64_t ByteBuffer::getLong() { assert( m_position+8 < m_limit ); - __int64 value = 0; + int64_t value = 0; - __int64 b1 = buffer[ m_position ]; - __int64 b2 = buffer[ m_position+1 ]; - __int64 b3 = buffer[ m_position+2 ]; - __int64 b4 = buffer[ m_position+3 ]; - __int64 b5 = buffer[ m_position+4 ]; - __int64 b6 = buffer[ m_position+5 ]; - __int64 b7 = buffer[ m_position+6 ]; - __int64 b8 = buffer[ m_position+7 ]; + int64_t b1 = buffer[ m_position ]; + int64_t b2 = buffer[ m_position+1 ]; + int64_t b3 = buffer[ m_position+2 ]; + int64_t b4 = buffer[ m_position+3 ]; + int64_t b5 = buffer[ m_position+4 ]; + int64_t b6 = buffer[ m_position+5 ]; + int64_t b7 = buffer[ m_position+6 ]; + int64_t b8 = buffer[ m_position+7 ]; m_position += 8; @@ -373,7 +373,7 @@ ByteBuffer *ByteBuffer::putShortArray(shortArray &s) //value - The long value to be written //Returns: //This buffer -ByteBuffer *ByteBuffer::putLong(__int64 value) +ByteBuffer *ByteBuffer::putLong(int64_t value) { assert( m_position+7 < m_limit ); diff --git a/src/world/ByteBuffer.h b/src/world/ByteBuffer.h index 2d936374..56ac0b96 100644 --- a/src/world/ByteBuffer.h +++ b/src/world/ByteBuffer.h @@ -28,7 +28,7 @@ public: int getInt(unsigned int index); void get(byteArray) {} // 4J - TODO byte get(int index); - __int64 getLong(); + int64_t getLong(); short getShort(); void getShortArray(shortArray &s); ByteBuffer *put(int index, byte b); @@ -36,7 +36,7 @@ public: ByteBuffer *putInt(unsigned int index, int value); ByteBuffer *putShort(short value); ByteBuffer *putShortArray(shortArray &s); - ByteBuffer *putLong(__int64 value); + ByteBuffer *putLong(int64_t value); ByteBuffer *put(byteArray inputArray); byteArray array(); IntBuffer *asIntBuffer(); diff --git a/src/world/C4JThread.cpp b/src/world/C4JThread.cpp index f9796bfb..4017eb59 100644 --- a/src/world/C4JThread.cpp +++ b/src/world/C4JThread.cpp @@ -1,1100 +1,148 @@ -#include "stdafx.h" - - #include "C4JThread.h" -#ifdef __PSVITA__ -#include "PSVita\PSVitaExtras\ShutdownManager.h" -#include "PSVita\PSVitaExtras\PSVitaTLSStorage.h" - -// AP - this comes from the low level user_malloc.c file used to overide the default memory functions. These must be called when a thread is started/stopped -extern "C" { -extern void user_registerthread(); -extern void user_removethread(); -} -#else -#include "PS3\PS3Extras\ShutdownManager.h" - -#endif std::vector C4JThread::ms_threadList; -CRITICAL_SECTION C4JThread::ms_threadListCS; +std::mutex C4JThread::ms_threadListMutex; +thread_local C4JThread* C4JThread::tls_currentThread = nullptr; +C4JThread C4JThread::m_mainThread("MainThread"); -#ifdef _XBOX_ONE - // 4J Stu - On XboxOne the main thread is not the one that does all the static init, so we have to set this up later -C4JThread *C4JThread::m_mainThread = NULL; - -void C4JThread::StaticInit() +C4JThread::Event::Event(EMode mode) + : m_mode(mode) { - m_mainThread = new C4JThread("Main thread"); } -#else -C4JThread C4JThread::m_mainThread("Main thread"); -#endif - -#ifdef __ORBIS__ -__thread SceKernelCpumask C4JThread::m_oldAffinityMask; -#endif - - -#if __PSVITA__ -static SceInt32 g_DefaultCPU; -static SceInt32 g_DefaultPriority; -#endif - -C4JThread::C4JThread( C4JThreadStartFunc* startFunc, void* param, const char* threadName, int stackSize/* = 0*/ ) -{ - m_startFunc = startFunc; - m_threadParam = param; - m_stackSize = stackSize; - - // to match XBox, if the stack size is zero, use the default 64k - if(m_stackSize == 0) - m_stackSize = 65536 * 2; - // make sure it's at least 16K - if(m_stackSize < 16384) - m_stackSize = 16384; - -#ifdef __PS3__ - sprintf(m_threadName, "(4J) %s", threadName ); -#else - sprintf_s(m_threadName,64, "(4J) %s", threadName ); -#endif - - m_isRunning = false; - m_hasStarted = false; - - m_exitCode = STILL_ACTIVE; - -#ifdef __PS3__ - m_completionFlag = new Event(Event::e_modeManualClear); - m_threadID = 0; - m_lastSleepTime = 0; - m_priority = 1002; // main thread has priority 1001 -#elif defined __ORBIS__ - m_completionFlag = new Event(Event::e_modeManualClear); - m_threadID = 0; - m_lastSleepTime = 0; - scePthreadAttrInit(&m_threadAttr); - int err = scePthreadAttrSetaffinity(&m_threadAttr, 63); // set the thread affinity to all cores to start with - assert(err == SCE_OK); - m_oldAffinityMask = 0; - m_priority = SCE_KERNEL_PRIO_FIFO_DEFAULT; -#elif defined __PSVITA__ - m_completionFlag = new Event(Event::e_modeManualClear); - m_threadID = 0; - m_lastSleepTime = 0; - m_priority = g_DefaultPriority; - //m_CPUMask = SCE_KERNEL_CPU_MASK_USER_ALL; - - // AP - I had trouble getting the cpu to change once the thread was created so I've hard coded them here - // The main work division is... - // 0 - Main - // 1 - Chunk/Tile Update - // 2 - Server/Audio - // These three can sometimes consume ALL the CPU time so they are set to below average priority so as not to block other critical threads - int CPU = SCE_KERNEL_CPU_MASK_USER_ALL; - if( !strcmp(threadName, "Chunk update") ) - { - CPU = SCE_KERNEL_CPU_MASK_USER_2; - m_priority = g_DefaultPriority + 1; - } - if( !strcmp(threadName, "Server" ) ) - { - CPU = SCE_KERNEL_CPU_MASK_USER_1; - m_priority = g_DefaultPriority + 1; - } - // make sure Tile Update doesn't go on cpu 0 because it will hold up the main thread. And it can't go on cpu 1 because Chunk Update crashes. - if( !strcmp(threadName, "Tile update") ) - { - CPU = SCE_KERNEL_CPU_MASK_USER_1; - } - - m_threadID = sceKernelCreateThread(m_threadName, entryPoint, g_DefaultPriority, m_stackSize, 0, CPU, NULL); - app.DebugPrintf("***************************** start thread %s **************************\n", m_threadName); -#else - m_threadID = 0; - m_threadHandle = 0; - m_threadHandle = CreateThread(NULL, m_stackSize, entryPoint, this, CREATE_SUSPENDED, &m_threadID); -#endif - EnterCriticalSection(&ms_threadListCS); - ms_threadList.push_back(this); - LeaveCriticalSection(&ms_threadListCS); -} - -// only used for the main thread -C4JThread::C4JThread( const char* mainThreadName) -{ -#ifdef __PSVITA__ - user_registerthread(); -#endif - - m_startFunc = NULL; - m_threadParam = NULL; - m_stackSize = 0; - -#ifdef __PS3__ - sprintf(m_threadName, "(4J) %s", mainThreadName); -#else - sprintf_s(m_threadName, 64, "(4J) %s", mainThreadName); -#endif - m_isRunning = true; - m_hasStarted = true; - m_lastSleepTime = System::currentTimeMillis(); - - // should be the first thread to be created, so init the static critical section for the threadlist here - InitializeCriticalSection(&ms_threadListCS); - - -#ifdef __PS3__ - m_completionFlag = new Event(Event::e_modeManualClear); - sys_ppu_thread_get_id(&m_threadID); -#elif defined __ORBIS__ - m_completionFlag = new Event(Event::e_modeManualClear); - m_threadID = scePthreadSelf(); - m_priority = SCE_KERNEL_PRIO_FIFO_DEFAULT; -#elif defined __PSVITA__ - m_completionFlag = new Event(Event::e_modeManualClear); - g_DefaultPriority = sceKernelGetThreadCurrentPriority(); - m_threadID = sceKernelGetThreadId(); - int err = sceKernelChangeThreadCpuAffinityMask(m_threadID, SCE_KERNEL_CPU_MASK_USER_0); -// sceKernelChangeThreadPriority(m_threadID, g_DefaultPriority + 1); - g_DefaultCPU = SCE_KERNEL_CPU_MASK_USER_ALL;//sceKernelGetThreadCpuAffinityMask(m_threadID); -#else - m_threadID = GetCurrentThreadId(); - m_threadHandle = GetCurrentThread(); -#endif -#ifdef _XBOX_ONE - SetThreadName(-1, m_threadName); -#endif - EnterCriticalSection(&ms_threadListCS); - ms_threadList.push_back(this); - LeaveCriticalSection(&ms_threadListCS); -} - -C4JThread::~C4JThread() -{ -#if defined __PS3__ || defined __ORBIS__ || defined __PSVITA__ - delete m_completionFlag; -#endif - -#if defined __ORBIS__ - scePthreadJoin(m_threadID, NULL); -#endif - - EnterCriticalSection(&ms_threadListCS); - - for( AUTO_VAR(it,ms_threadList.begin()); it != ms_threadList.end(); it++ ) - { - if( (*it) == this ) - { - ms_threadList.erase(it); - LeaveCriticalSection(&ms_threadListCS); - return; - } - } - - LeaveCriticalSection(&ms_threadListCS); -} - -#ifdef __PS3__ -void C4JThread::entryPoint(uint64_t param) -{ - C4JThread* pThread = (C4JThread*)param; - pThread->m_exitCode = (*pThread->m_startFunc)(pThread->m_threadParam); - pThread->m_completionFlag->Set(); - pThread->m_isRunning = false; - sys_ppu_thread_exit(0); -} -#elif defined __ORBIS__ -void * C4JThread::entryPoint(void *param) -{ - C4JThread* pThread = (C4JThread*)param; - pThread->m_exitCode = (*pThread->m_startFunc)(pThread->m_threadParam); - pThread->m_completionFlag->Set(); - pThread->m_isRunning = false; - scePthreadExit(NULL); -} -#elif defined __PSVITA__ -struct StrArg { - C4JThread* Thread; -}; - -SceInt32 C4JThread::entryPoint(SceSize argSize, void *pArgBlock) -{ - StrArg *strArg = (StrArg*)pArgBlock; - C4JThread* pThread = strArg->Thread; - user_registerthread(); - pThread->m_exitCode = (*pThread->m_startFunc)(pThread->m_threadParam); - app.DebugPrintf("***************************** thread exit %s **************************\n", pThread->m_threadName); - pThread->m_completionFlag->Set(); - pThread->m_isRunning = false; - - // AP - make sure we clean up this thread's storage and memory - PSVitaTLSStorage::RemoveThread(pThread->m_threadID); - user_removethread(); - - sceKernelExitDeleteThread(NULL); - - return pThread->m_exitCode; -} -#else -DWORD WINAPI C4JThread::entryPoint(LPVOID lpParam) -{ - C4JThread* pThread = (C4JThread*)lpParam; - SetThreadName(-1, pThread->m_threadName); - pThread->m_exitCode = (*pThread->m_startFunc)(pThread->m_threadParam); - pThread->m_isRunning = false; - return pThread->m_exitCode; -} -#endif - - - - -void C4JThread::Run() -{ -#ifdef __PS3__ - // prio specifies the priority value of the PPU thread within the range from 0 to 3071 where 0 is the highest. - // One of the following values is set to flags: - // 0 - non-joinable non-interrupt thread - // SYS_PPU_THREAD_CREATE_JOINABLE - Create a joinable thread - // SYS_PPU_THREAD_CREATE_INTERRUPT - Create an interrupt thread - uint64_t flags = 0; - int err = sys_ppu_thread_create(&m_threadID, entryPoint, (uint64_t)this, m_priority, m_stackSize, flags, m_threadName); -#elif defined __ORBIS__ - scePthreadAttrSetstacksize(&m_threadAttr, m_stackSize); - scePthreadAttrSetguardsize(&m_threadAttr, 1024); - int ret = scePthreadCreate(&m_threadID, &m_threadAttr, entryPoint, this, m_threadName); - assert( ret == SCE_OK ); - scePthreadSetprio(m_threadID,m_priority); - scePthreadAttrDestroy(&m_threadAttr); -#elif defined __PSVITA__ - StrArg strArg = {this}; -// m_threadID = sceKernelCreateThread(m_threadName, entryPoint, m_priority, m_stackSize, 0, m_CPUMask, NULL); - sceKernelStartThread( m_threadID, sizeof(strArg), &strArg); -#else - ResumeThread(m_threadHandle); -#endif - m_lastSleepTime = System::currentTimeMillis(); - m_isRunning = true; - m_hasStarted = true; -} - -void C4JThread::SetProcessor( int proc ) -{ -#ifdef __PS3__ - // does nothing since we only have the 1 processor -#elif defined __ORBIS__ - scePthreadAttrSetaffinity(&m_threadAttr, 1 << proc); -#elif defined __PSVITA__ - int Proc = proc >> 1; // convert from 360's 3 cores * 2 hardware threads to Vita's 3 cores - int Mask = SCE_KERNEL_CPU_MASK_USER_0 << Proc; - //m_CPUMask = Mask; -// int err = sceKernelChangeThreadCpuAffinityMask(m_threadID, Mask); - int Newmask = sceKernelGetThreadCpuAffinityMask(m_threadID); - app.DebugPrintf("***************************** set thread proc %s %d %d %d **************************\n", m_threadName, proc, Mask, Newmask); -#elif defined _DURANGO - SetThreadAffinityMask(m_threadHandle, 1 << proc ); -#else - XSetThreadProcessor( m_threadHandle, proc); -#endif -} - -void C4JThread::SetPriority( int priority ) -{ -#ifdef __PS3__ - switch(priority) - { - case THREAD_PRIORITY_LOWEST: m_priority = 1003; break; - case THREAD_PRIORITY_BELOW_NORMAL: m_priority = 1002; break; - case THREAD_PRIORITY_NORMAL: m_priority = 1001; break; // same as main thread - case THREAD_PRIORITY_ABOVE_NORMAL: m_priority = 1000; break; - case THREAD_PRIORITY_HIGHEST: m_priority = 999; break; - } - if(m_threadID != 0) - sys_ppu_thread_set_priority(m_threadID, m_priority); - //int erro = sys_ppu_thread_set_priority(m_threadID, priority); -#elif defined __ORBIS__ - - switch(priority) - { - case THREAD_PRIORITY_LOWEST: m_priority = SCE_KERNEL_PRIO_FIFO_LOWEST; break; - case THREAD_PRIORITY_BELOW_NORMAL: m_priority = SCE_KERNEL_PRIO_FIFO_LOWEST + ((SCE_KERNEL_PRIO_FIFO_DEFAULT-SCE_KERNEL_PRIO_FIFO_LOWEST)/2); break; - case THREAD_PRIORITY_NORMAL: m_priority = SCE_KERNEL_PRIO_FIFO_DEFAULT; break; // same as main thread - case THREAD_PRIORITY_ABOVE_NORMAL: m_priority = SCE_KERNEL_PRIO_FIFO_DEFAULT + ((SCE_KERNEL_PRIO_FIFO_HIGHEST-SCE_KERNEL_PRIO_FIFO_DEFAULT)/2); break; - case THREAD_PRIORITY_HIGHEST: m_priority = SCE_KERNEL_PRIO_FIFO_HIGHEST; break; - } - - if( m_threadID != 0 ) - { - scePthreadSetprio(m_threadID,m_priority); - } -#elif defined __PSVITA__ - int Mid = g_DefaultPriority;//(SCE_KERNEL_LOWEST_PRIORITY_USER + SCE_KERNEL_HIGHEST_PRIORITY_USER) / 2; - switch(priority) - { - case THREAD_PRIORITY_LOWEST: - m_priority = SCE_KERNEL_LOWEST_PRIORITY_USER; - break; - case THREAD_PRIORITY_BELOW_NORMAL: - m_priority = Mid + 1; - break; - case THREAD_PRIORITY_NORMAL: - m_priority = Mid; - break; // same as main thread - case THREAD_PRIORITY_ABOVE_NORMAL: - m_priority = Mid - 1; - break; - case THREAD_PRIORITY_HIGHEST: - m_priority = SCE_KERNEL_HIGHEST_PRIORITY_USER; - break; - } - -// sceKernelChangeThreadPriority(m_threadID, m_priority); - app.DebugPrintf("***************************** set thread prio %s %d %d **************************\n", m_threadName, priority, m_priority); -#else - SetThreadPriority(m_threadHandle, priority); -#endif // __PS3__ -} - -DWORD C4JThread::WaitForCompletion( int timeoutMs ) -{ -#ifdef __PS3__ - if(timeoutMs == INFINITE) - timeoutMs = SYS_NO_TIMEOUT ; - return m_completionFlag->WaitForSignal(timeoutMs); -#elif defined __ORBIS__ - return m_completionFlag->WaitForSignal( timeoutMs ); -#elif defined __PSVITA__ - return m_completionFlag->WaitForSignal( timeoutMs ); -/* SceUInt32 Timeout = timeoutMs * 1000; - SceInt32 err = sceKernelWaitThreadEnd(m_threadID, &m_exitCode, &Timeout); - if( err == 0 ) - { - return m_exitCode; - } - else - { - if( err == SCE_KERNEL_ERROR_WAIT_TIMEOUT ) - { - return WAIT_TIMEOUT; - } - else - { - // AP - not sure what to do here - return 0; - } - }*/ - -// return m_exitCode; -#else - return WaitForSingleObject(m_threadHandle, timeoutMs); -#endif // __PS3__ -} - -int C4JThread::GetExitCode() -{ -#if defined __PS3__ || defined __ORBIS__ || defined __PSVITA__ - return m_exitCode; -#else - DWORD exitcode = 0; - GetExitCodeThread(m_threadHandle, &exitcode); - - return *((int *)&exitcode); -#endif -} - -void C4JThread::Sleep( int millisecs ) -{ -#ifdef __PS3__ - if(millisecs == 0) - { - // https://ps3.scedev.net/forums/thread/116470/ - // "sys_timer_usleep(0) does not yield the CPU." - sys_ppu_thread_yield(); - } - else - sys_timer_usleep(millisecs * 1000); -#elif defined __ORBIS__ - sceKernelUsleep(((SceKernelUseconds)millisecs) * 1000); -#elif defined __PSVITA__ - // 4J Stu - 0 is an error, so add a tiny sleep when we just want to yield - sceKernelDelayThread(millisecs * 1000 + 1); -#else - ::Sleep(millisecs); -#endif // __PS3__ -} - -C4JThread* C4JThread::getCurrentThread() -{ -#ifdef __PS3__ - sys_ppu_thread_t currThreadID; - sys_ppu_thread_get_id(&currThreadID); -#elif defined __ORBIS__ - ScePthread currThreadID = scePthreadSelf(); -#elif defined __PSVITA__ - SceUID currThreadID = sceKernelGetThreadId(); -#else - DWORD currThreadID = GetCurrentThreadId(); -#endif //__PS3__ - EnterCriticalSection(&ms_threadListCS); - - for(int i=0;im_threadID) - { - LeaveCriticalSection(&ms_threadListCS); - return ms_threadList[i]; - } - } - - LeaveCriticalSection(&ms_threadListCS); - - return NULL; -} - -bool C4JThread::isMainThread() -{ -#ifdef _XBOX_ONE - return getCurrentThread() == m_mainThread; -#else - return getCurrentThread() == &m_mainThread; -#endif -} - -C4JThread::Event::Event(EMode mode/* = e_modeAutoClear*/) -{ - m_mode = mode; -#ifdef __PS3__ - sys_event_flag_attribute_t attr; - // default values taken from sys_event_flag_attribute_initialize - attr.attr_protocol = SYS_SYNC_PRIORITY; - attr.attr_pshared = SYS_SYNC_NOT_PROCESS_SHARED; - attr.key = 0; - attr.flags = 0; - attr.type = SYS_SYNC_WAITER_SINGLE; - attr.name[0] = '\0'; - sys_event_flag_attribute_initialize(attr); - - int err = sys_event_flag_create(&m_event, &attr, 0); - -#elif defined __ORBIS__ - char name[1] = {0}; - sceKernelCreateEventFlag( &m_event, name, SCE_KERNEL_EVF_ATTR_TH_FIFO | SCE_KERNEL_EVF_ATTR_MULTI, 0, NULL); -#elif defined __PSVITA__ - char name[1] = {0}; - m_event = sceKernelCreateEventFlag( name, SCE_KERNEL_EVF_ATTR_TH_FIFO | SCE_KERNEL_EVF_ATTR_MULTI, 0, NULL); -#else - m_event = CreateEvent( NULL, (m_mode == e_modeManualClear), false, NULL ); -#endif //__PS3__ -} - - -C4JThread::Event::~Event() -{ -#ifdef __PS3__ - sys_event_flag_destroy(m_event); -#elif defined __ORBIS__ - sceKernelDeleteEventFlag(m_event); -#elif defined __PSVITA__ - sceKernelDeleteEventFlag(m_event); -#else - CloseHandle( m_event ); -#endif // __PS3__ -} - void C4JThread::Event::Set() { -#ifdef __PS3__ - int err =sys_event_flag_set(m_event, 1); -#elif defined __ORBIS__ - sceKernelSetEventFlag(m_event, 1); -#elif defined __PSVITA__ - sceKernelSetEventFlag(m_event, 1); -#else - SetEvent(m_event); -#endif //__PS3__ + std::lock_guard lock(m_mutex); + m_signaled = true; + m_cv.notify_all(); } void C4JThread::Event::Clear() { -#ifdef __PS3__ - int err =sys_event_flag_clear(m_event, ~(1)); -#elif defined __ORBIS__ - sceKernelClearEventFlag(m_event, ~(1)); -#elif defined __PSVITA__ - sceKernelClearEventFlag(m_event, ~1); -#else - ResetEvent(m_event); -#endif //__PS3__ + std::lock_guard lock(m_mutex); + m_signaled = false; } -DWORD C4JThread::Event::WaitForSignal( int timeoutMs ) +unsigned long C4JThread::Event::WaitForSignal(int timeoutMs) { -#ifdef __PS3__ - if(timeoutMs == INFINITE) - timeoutMs = SYS_NO_TIMEOUT ; - int timoutMicrosecs = timeoutMs * 1000; - uint32_t mode = SYS_EVENT_FLAG_WAIT_AND; - if(m_mode == e_modeAutoClear) - mode |= SYS_EVENT_FLAG_WAIT_CLEAR; - int err = sys_event_flag_wait(m_event, 1, mode, 0, timoutMicrosecs); + std::unique_lock lock(m_mutex); - switch(err) - { - case CELL_OK: return WAIT_OBJECT_0; - case ETIMEDOUT: return WAIT_TIMEOUT; - case ECANCELED: return WAIT_ABANDONED; - default: return WAIT_FAILED; - } + if (timeoutMs < 0) + { + m_cv.wait(lock, [&] { return m_signaled; }); + } + else + { + if (!m_cv.wait_for(lock, std::chrono::milliseconds(timeoutMs), [&] { return m_signaled; })) + return 0x102; + } -#elif defined __ORBIS__ - SceKernelUseconds timeoutMicrosecs; - SceKernelUseconds *pTimeoutMicrosecs; - if( timeoutMs == INFINITE ) - { - pTimeoutMicrosecs = NULL; - } - else - { - timeoutMicrosecs = ((SceKernelUseconds)timeoutMs) * 1000; - pTimeoutMicrosecs = &timeoutMicrosecs; - } - uint32_t waitMode = SCE_KERNEL_EVF_WAITMODE_AND; - if(m_mode == e_modeAutoClear) - { - waitMode |= SCE_KERNEL_EVF_WAITMODE_CLEAR_PAT; - } - int err = sceKernelWaitEventFlag(m_event, 1, waitMode, NULL, pTimeoutMicrosecs); - switch(err) - { - case SCE_OK: return WAIT_OBJECT_0; - case SCE_KERNEL_ERROR_ETIMEDOUT: return WAIT_TIMEOUT; - case SCE_KERNEL_ERROR_ECANCELED: return WAIT_ABANDONED; - default: return WAIT_FAILED; - } -#elif defined __PSVITA__ - SceUInt32 timeoutMicrosecs; - SceUInt32 *pTimeoutMicrosecs; - if( timeoutMs == INFINITE ) - { - pTimeoutMicrosecs = NULL; - } - else - { - timeoutMicrosecs = ((SceInt32)timeoutMs) * 1000; - pTimeoutMicrosecs = &timeoutMicrosecs; - } - uint32_t waitMode = SCE_KERNEL_EVF_WAITMODE_AND; - if(m_mode == e_modeAutoClear) - { - waitMode |= SCE_KERNEL_EVF_WAITMODE_CLEAR_ALL; - } - int err = sceKernelWaitEventFlag(m_event, 1, waitMode, NULL, pTimeoutMicrosecs); - switch(err) - { - case SCE_OK: return WAIT_OBJECT_0; - case SCE_KERNEL_ERROR_WAIT_TIMEOUT: return WAIT_TIMEOUT; - case SCE_KERNEL_ERROR_WAIT_CANCEL: return WAIT_ABANDONED; - default: return WAIT_FAILED; - } -#else - return WaitForSingleObject(m_event, timeoutMs); -#endif // __PS3__ + if (m_mode == e_modeAutoClear) + m_signaled = false; + + return 0; } -C4JThread::EventArray::EventArray( int size, EMode mode/* = e_modeAutoClear*/) +C4JThread::EventArray::EventArray(int size, Event::EMode mode) { - assert(size<32); - m_size = size; - m_mode = mode; -#ifdef __PS3__ - sys_event_flag_attribute_t attr; - // default values taken from sys_event_flag_attribute_initialize - attr.attr_protocol = SYS_SYNC_PRIORITY; - attr.attr_pshared = SYS_SYNC_NOT_PROCESS_SHARED; - attr.key = 0; - attr.flags = 0; - attr.type = SYS_SYNC_WAITER_SINGLE; - attr.name[0] = '\0'; - sys_event_flag_attribute_initialize(attr); - int err = sys_event_flag_create(&m_events, &attr, 0); - assert(err == CELL_OK); -#elif defined __ORBIS__ - char name[1] = {0}; - sceKernelCreateEventFlag( &m_events, name, SCE_KERNEL_EVF_ATTR_TH_FIFO | SCE_KERNEL_EVF_ATTR_MULTI, 0, NULL); -#elif defined __PSVITA__ - char name[1] = {0}; - m_events = sceKernelCreateEventFlag( name, SCE_KERNEL_EVF_ATTR_TH_FIFO | SCE_KERNEL_EVF_ATTR_MULTI, 0, NULL); -#else - m_events = new HANDLE[size]; - for(int i=0;i lock(ms_threadListMutex); + ms_threadList.push_back(this); } -#endif - - - -C4JThread::EventQueue::EventQueue( UpdateFunc* updateFunc, ThreadInitFunc threadInitFunc, const char* szThreadName) +C4JThread::C4JThread(const char* mainThreadName) { - m_updateFunc = updateFunc; - m_threadInitFunc = threadInitFunc; - strcpy(m_threadName, szThreadName); - m_thread = NULL; - m_startEvent = NULL; - m_finishedEvent = NULL; - m_processor = -1; - m_priority = THREAD_PRIORITY_HIGHEST+1; + std::strncpy(m_threadName, mainThreadName, sizeof(m_threadName)); + tls_currentThread = this; + m_isRunning = true; + m_hasStarted = true; } -void C4JThread::EventQueue::init() +C4JThread::~C4JThread() { - m_startEvent = new C4JThread::EventArray(1); - m_finishedEvent = new C4JThread::Event(); - InitializeCriticalSection(&m_critSect); - m_thread = new C4JThread(threadFunc, this, m_threadName); - if(m_processor >= 0) - m_thread->SetProcessor(m_processor); - if(m_priority != THREAD_PRIORITY_HIGHEST+1) - m_thread->SetPriority(m_priority); - m_thread->Run(); + if (m_thread.joinable()) + m_thread.join(); } -void C4JThread::EventQueue::sendEvent( Level* pLevel ) +void C4JThread::threadEntry() { - if(m_thread == NULL) - init(); - EnterCriticalSection(&m_critSect); - m_queue.push(pLevel); - m_startEvent->Set(0); - m_finishedEvent->Clear(); - LeaveCriticalSection(&m_critSect); + tls_currentThread = this; + m_isRunning = true; + m_exitCode = (*m_startFunc)(m_threadParam); + m_isRunning = false; } -void C4JThread::EventQueue::waitForFinish() +void C4JThread::Run() { - if(m_thread == NULL) - init(); - EnterCriticalSection(&m_critSect); - if(m_queue.empty()) - { - LeaveCriticalSection((&m_critSect)); - return; - } - LeaveCriticalSection((&m_critSect)); - m_finishedEvent->WaitForSignal(INFINITE); + m_hasStarted = true; + m_thread = std::thread(&C4JThread::threadEntry, this); } -int C4JThread::EventQueue::threadFunc( void* lpParam ) +unsigned long C4JThread::WaitForCompletion(int) { - EventQueue* p = (EventQueue*)lpParam; - p->threadPoll(); - return 0; + if (m_thread.joinable()) + m_thread.join(); + return 0; } -void C4JThread::EventQueue::threadPoll() +void C4JThread::Sleep(int ms) { - ShutdownManager::HasStarted(ShutdownManager::eEventQueueThreads, m_startEvent); - - if(m_threadInitFunc) - m_threadInitFunc(); - - while(ShutdownManager::ShouldRun(ShutdownManager::eEventQueueThreads)) - { - - DWORD err = m_startEvent->WaitForAny(INFINITE); - if(err == WAIT_OBJECT_0) - { - bool bListEmpty = true; - do - { - EnterCriticalSection(&m_critSect); - void* updateParam = m_queue.front(); - LeaveCriticalSection(&m_critSect); - - m_updateFunc(updateParam); - - EnterCriticalSection(&m_critSect); - m_queue.pop(); - bListEmpty = m_queue.empty(); - if(bListEmpty) - { - m_finishedEvent->Set(); - } - LeaveCriticalSection(&m_critSect); - - } while(!bListEmpty); - } - }; - - ShutdownManager::HasFinished(ShutdownManager::eEventQueueThreads); + std::this_thread::sleep_for(std::chrono::milliseconds(ms)); } - -#ifdef __ORBIS__ - -void C4JThread::PushAffinityAllCores() +C4JThread* C4JThread::getCurrentThread() { - assert(m_oldAffinityMask == 0); - int err; - ScePthread currThreadID = scePthreadSelf(); - err = scePthreadGetaffinity(currThreadID, &m_oldAffinityMask); - assert(err == SCE_OK); - err = scePthreadSetaffinity(currThreadID, 63); - assert(err == SCE_OK); - - + return tls_currentThread ? tls_currentThread : &m_mainThread; } -void C4JThread::PopAffinity() +bool C4JThread::isMainThread() { - int err; - ScePthread currThreadID = scePthreadSelf(); - err = scePthreadSetaffinity(currThreadID, m_oldAffinityMask); - m_oldAffinityMask = 0; - assert(err == SCE_OK); -} - -#endif // __ORBIS__ \ No newline at end of file + return getCurrentThread() == &m_mainThread; +} \ No newline at end of file diff --git a/src/world/C4JThread.h b/src/world/C4JThread.h index 9a303c7b..b523ef71 100644 --- a/src/world/C4JThread.h +++ b/src/world/C4JThread.h @@ -1,225 +1,122 @@ #pragma once + +#include +#include +#include +#include +#include #include +#include +#include typedef int (C4JThreadStartFunc)(void* lpThreadParameter); class Level; -#if defined(_XBOX_ONE) || defined(__ORBIS__) - -#define CPU_CORE_MAIN_THREAD 0 - -#define CPU_CORE_SERVER 1 - -#define CPU_CORE_CHUNK_UPDATE 2 -#define CPU_CORE_REMOVE_PLAYER 2 - -#define CPU_CORE_CHUNK_REBUILD_A 3 -#define CPU_CORE_SAVE_THREAD_A 3 -#define CPU_CORE_UI_SCENE 3 -#define CPU_CORE_POST_PROCESSING 3 -#define CPU_CORE_DQR_REALTIMESESSION 3 - -#define CPU_CORE_CHUNK_REBUILD_B 4 -#define CPU_CORE_SAVE_THREAD_B 4 -#define CPU_CORE_TILE_UPDATE 4 -#define CPU_CORE_CONNECTIONS 4 - -#define CPU_CORE_CHUNK_REBUILD_C 5 -#define CPU_CORE_SAVE_THREAD_C 5 -#define CPU_CORE_LEADERBOARDS 5 // Orbis only - -#else - -#define CPU_CORE_MAIN_THREAD 0 - -#define CPU_CORE_CHUNK_REBUILD_A 1 -#define CPU_CORE_SAVE_THREAD_A 1 -#define CPU_CORE_TILE_UPDATE 1 -#define CPU_CORE_CONNECTIONS 1 - -#define CPU_CORE_CHUNK_UPDATE 2 -#define CPU_CORE_REMOVE_PLAYER 2 - -#define CPU_CORE_CHUNK_REBUILD_B 3 -#define CPU_CORE_SAVE_THREAD_B 3 -#define CPU_CORE_UI_SCENE 3 -#define CPU_CORE_POST_PROCESSING 3 - -#define CPU_CORE_SERVER 4 - -#define CPU_CORE_CHUNK_REBUILD_C 5 -#define CPU_CORE_SAVE_THREAD_C 5 -#define CPU_CORE_LEADERBOARDS 5 // Sony only - -#endif - class C4JThread { public: + class Event + { + public: + enum EMode + { + e_modeAutoClear, + e_modeManualClear + }; - class Event - { - public: - enum EMode - { - e_modeAutoClear, - e_modeManualClear - }; - Event(EMode mode = e_modeAutoClear); - ~Event(); - void Set(); - void Clear(); - DWORD WaitForSignal(int timeoutMs); + Event(EMode mode = e_modeAutoClear); - private: - EMode m_mode; - #ifdef __PS3__ - sys_event_flag_t m_event; - #elif defined __ORBIS__ - SceKernelEventFlag m_event; - #elif defined __PSVITA__ - SceUID m_event; - #else - HANDLE m_event; - #endif // __PS3__ - }; + void Set(); + void Clear(); + unsigned long WaitForSignal(int timeoutMs); - class EventArray - { - public: - enum EMode - { - e_modeAutoClear, - e_modeManualClear - }; + private: + EMode m_mode; + std::mutex m_mutex; + std::condition_variable m_cv; + bool m_signaled = false; + }; - EventArray(int size, EMode mode = e_modeAutoClear); + class EventArray + { + public: + EventArray(int size, Event::EMode mode = Event::e_modeAutoClear); - void Set(int index); - void Clear(int index); - void SetAll(); - void ClearAll(); - DWORD WaitForAll(int timeoutMs); - DWORD WaitForAny(int timeoutMs); - DWORD WaitForSingle(int index, int timeoutMs); -#ifdef __PS3__ - void Cancel(); -#endif + void Set(int index); + void Clear(int index); + void SetAll(); + void ClearAll(); - private: - int m_size; - EMode m_mode; -#ifdef __PS3__ - sys_event_flag_t m_events; -#elif defined __ORBIS__ - SceKernelEventFlag m_events; -#elif defined __PSVITA__ - SceUID m_events; -#else - HANDLE* m_events; -#endif // __PS3__ - }; + unsigned long WaitForAll(int timeoutMs); + unsigned long WaitForAny(int timeoutMs); + unsigned long WaitForSingle(int index, int timeoutMs); + private: + std::vector m_events; + }; + class EventQueue + { + typedef void (UpdateFunc)(void* lpParameter); + typedef void (ThreadInitFunc)(); - class EventQueue - { - typedef void (UpdateFunc)(void* lpParameter); - typedef void (ThreadInitFunc)(); + public: + EventQueue(UpdateFunc* updateFunc, ThreadInitFunc threadInitFunc, const char* name); - C4JThread* m_thread; - std::queue m_queue; - C4JThread::EventArray* m_startEvent; - C4JThread::Event* m_finishedEvent; - CRITICAL_SECTION m_critSect; - UpdateFunc* m_updateFunc; - ThreadInitFunc* m_threadInitFunc; - char m_threadName[64]; - int m_processor; - int m_priority; - void init(); - static int threadFunc(void* lpParam); - void threadPoll(); + void sendEvent(Level* pLevel); + void waitForFinish(); - public: - EventQueue(UpdateFunc* updateFunc, ThreadInitFunc threadInitFunc, const char* szThreadName); - void setProcessor(int proc) { m_processor = proc; if(m_thread) m_thread->SetProcessor(proc); } - void setPriority(int priority) { m_priority = priority; if(m_thread) m_thread->SetPriority(priority); } - void sendEvent(Level* pLevel); - void waitForFinish(); - }; + private: + static int threadFunc(void* lpParam); + void threadPoll(); + std::queue m_queue; + std::mutex m_mutex; + EventArray m_startEvent; + Event m_finishedEvent; - C4JThread(C4JThreadStartFunc* startFunc, void* param, const char* threadName, int stackSize = 0); - C4JThread( const char* mainThreadName ); // only used for the main thread - ~C4JThread(); + UpdateFunc* m_updateFunc; + ThreadInitFunc* m_threadInitFunc; - void Run(); - bool isRunning() { return m_isRunning; } - bool hasStarted() { return m_hasStarted; } - void SetProcessor(int proc); - void SetPriority(int priority); - DWORD WaitForCompletion(int timeoutMs); - int GetExitCode(); - char* getName() { return m_threadName; } - static void Sleep(int millisecs); - static C4JThread* getCurrentThread(); - static bool isMainThread(); - static char* getCurrentThreadName() { return getCurrentThread()->getName(); } + char m_threadName[64]; + C4JThread* m_thread = nullptr; + }; -#ifdef __ORBIS__ - static void PushAffinityAllCores(); // PS4 only - static void PopAffinity(); - static __thread SceKernelCpumask m_oldAffinityMask; -#endif // __ORBIS__ + C4JThread(C4JThreadStartFunc* startFunc, void* param, const char* name, int stackSize = 0); + C4JThread(const char* mainThreadName); + ~C4JThread(); -#ifdef _XBOX_ONE - static void StaticInit(); -#endif + void Run(); + bool isRunning() const { return m_isRunning; } + bool hasStarted() const { return m_hasStarted; } + + unsigned long WaitForCompletion(int timeoutMs); + int GetExitCode() const { return m_exitCode; } + + char* getName() { return m_threadName; } + + static void Sleep(int millisecs); + static C4JThread* getCurrentThread(); + static bool isMainThread(); private: - void* m_threadParam; - C4JThreadStartFunc* m_startFunc; - int m_stackSize; - char m_threadName[64]; - bool m_isRunning; - bool m_hasStarted; - int m_exitCode; - __int64 m_lastSleepTime; - static std::vector ms_threadList; - static CRITICAL_SECTION ms_threadListCS; + void threadEntry(); -#ifdef _XBOX_ONE - // 4J Stu - On XboxOne the main thread is not the one that does all the static init, so we have to set this up later - static C4JThread *m_mainThread; -#else - static C4JThread m_mainThread; -#endif + std::thread m_thread; + void* m_threadParam{}; + C4JThreadStartFunc* m_startFunc{}; -#ifdef __PS3__ - sys_ppu_thread_t m_threadID; - Event *m_completionFlag; - int m_priority; - static void entryPoint(uint64_t); -#elif defined __ORBIS__ - ScePthreadAttr m_threadAttr; - ScePthread m_threadID; - Event *m_completionFlag; - int m_priority; - static void *entryPoint(void *); -#elif defined __PSVITA__ - SceUID m_threadID; - Event *m_completionFlag; - int m_priority; - static SceInt32 entryPoint(SceSize argSize, void *pArgBlock); -#else - DWORD m_threadID; - HANDLE m_threadHandle; - Event *m_completionFlag; - static DWORD WINAPI entryPoint(LPVOID lpParam); -#endif -}; -void SetThreadName( DWORD dwThreadID, LPCSTR szThreadName ); + std::atomic m_isRunning{false}; + std::atomic m_hasStarted{false}; + int m_exitCode{}; + char m_threadName[64]{}; + + static std::vector ms_threadList; + static std::mutex ms_threadListMutex; + static thread_local C4JThread* tls_currentThread; + + static C4JThread m_mainThread; +}; \ No newline at end of file diff --git a/src/world/CanyonFeature.cpp b/src/world/CanyonFeature.cpp index b96c97e0..4eea3902 100644 --- a/src/world/CanyonFeature.cpp +++ b/src/world/CanyonFeature.cpp @@ -4,7 +4,7 @@ #include "net.minecraft.world.level.tile.h" #include "net.minecraft.world.level.biome.h" -void CanyonFeature::addTunnel(__int64 seed, int xOffs, int zOffs, byteArray blocks, double xCave, double yCave, double zCave, float thickness, float yRot, float xRot, int step, int dist, double yScale) +void CanyonFeature::addTunnel(int64_t seed, int xOffs, int zOffs, byteArray blocks, double xCave, double yCave, double zCave, float thickness, float yRot, float xRot, int step, int dist, double yScale) { MemSect(49); Random *random = new Random(seed); diff --git a/src/world/CanyonFeature.h b/src/world/CanyonFeature.h index cf3f7a61..d3edbf1f 100644 --- a/src/world/CanyonFeature.h +++ b/src/world/CanyonFeature.h @@ -9,6 +9,6 @@ private: float rs[1024]; protected: - void addTunnel(__int64 seed, int xOffs, int zOffs, byteArray blocks, double xCave, double yCave, double zCave, float thickness, float yRot, float xRot, int step, int dist, double yScale); + void addTunnel(int64_t seed, int xOffs, int zOffs, byteArray blocks, double xCave, double yCave, double zCave, float thickness, float yRot, float xRot, int step, int dist, double yScale); virtual void addFeature(Level *level, int x, int z, int xOffs, int zOffs, byteArray blocks); }; diff --git a/src/world/CaveFeature.cpp b/src/world/CaveFeature.cpp index aad92805..45158539 100644 --- a/src/world/CaveFeature.cpp +++ b/src/world/CaveFeature.cpp @@ -20,7 +20,7 @@ using namespace std; double radius = random->nextDouble() * 4 + 2; double fuss = random->nextDouble() * 0.6; - __int64 seed = random->nextLong(); + int64_t seed = random->nextLong(); random->setSeed(seed); vector toRemove; diff --git a/src/world/ChunkPos.cpp b/src/world/ChunkPos.cpp index 3f9674a7..f31fe7c8 100644 --- a/src/world/ChunkPos.cpp +++ b/src/world/ChunkPos.cpp @@ -6,16 +6,16 @@ ChunkPos::ChunkPos(int x, int z) : x( x ), z( z ) { } -__int64 ChunkPos::hashCode(int x, int z) +int64_t ChunkPos::hashCode(int x, int z) { - __int64 xx = x; - __int64 zz = z; + int64_t xx = x; + int64_t zz = z; return (xx & 0xffffffffl) | ((zz & 0xffffffffl) << 32l); } int ChunkPos::hashCode() { - __int64 hash = hashCode(x, z); + int64_t hash = hashCode(x, z); int h1 = (int) (hash); int h2 = (int) (hash >> 32l); return h1 ^ h2; @@ -63,7 +63,7 @@ wstring ChunkPos::toString() return L"[" + _toString(x) + L", " + _toString(z) + L"]"; } -__int64 ChunkPos::hash_fnct(const ChunkPos &k) +int64_t ChunkPos::hash_fnct(const ChunkPos &k) { return k.hashCode(k.x,k.z); } diff --git a/src/world/ChunkPos.h b/src/world/ChunkPos.h index f1d483c7..e3030002 100644 --- a/src/world/ChunkPos.h +++ b/src/world/ChunkPos.h @@ -10,7 +10,7 @@ public: ChunkPos(int x, int z); - static __int64 hashCode(int x, int z); + static int64_t hashCode(int x, int z); int hashCode(); double distanceToSqr(shared_ptr e); @@ -22,7 +22,7 @@ public: TilePos getMiddleBlockPosition(int y); wstring toString(); - static __int64 hash_fnct(const ChunkPos &k); + static int64_t hash_fnct(const ChunkPos &k); static bool eq_test(const ChunkPos &x, const ChunkPos &y); bool operator == (const ChunkPos &k) const { return (this->x == k.x) && ( this->z == k.z); } ChunkPos & operator= (const ChunkPos & other) { x = other.x; z = other.z; return *this; } @@ -30,7 +30,7 @@ public: typedef struct { - __int64 operator() (const ChunkPos &k) const { return ChunkPos::hash_fnct(k); } + int64_t operator() (const ChunkPos &k) const { return ChunkPos::hash_fnct(k); } } ChunkPosKeyHash; diff --git a/src/world/ChunkStorageProfileDecorator.cpp b/src/world/ChunkStorageProfileDecorator.cpp index 76ffddbc..6ad37d78 100644 --- a/src/world/ChunkStorageProfileDecorator.cpp +++ b/src/world/ChunkStorageProfileDecorator.cpp @@ -10,7 +10,7 @@ ChunkStorageProfilerDecorator::ChunkStorageProfilerDecorator(ChunkStorage *capsu LevelChunk *ChunkStorageProfilerDecorator::load(Level *level, int x, int z) { - __int64 nanoTime = System::nanoTime(); + int64_t nanoTime = System::nanoTime(); LevelChunk *chunk = capsulated->load(level, x, z); timeSpentLoading += System::nanoTime() - nanoTime; loadCount++; @@ -20,7 +20,7 @@ LevelChunk *ChunkStorageProfilerDecorator::load(Level *level, int x, int z) void ChunkStorageProfilerDecorator::save(Level *level, LevelChunk *levelChunk) { - __int64 nanoTime = System::nanoTime(); + int64_t nanoTime = System::nanoTime(); capsulated->save(level, levelChunk); timeSpentSaving += System::nanoTime() - nanoTime; saveCount++; diff --git a/src/world/ChunkStorageProfileDecorator.h b/src/world/ChunkStorageProfileDecorator.h index 67c582da..02ea4dcb 100644 --- a/src/world/ChunkStorageProfileDecorator.h +++ b/src/world/ChunkStorageProfileDecorator.h @@ -8,10 +8,10 @@ class ChunkStorageProfilerDecorator : public ChunkStorage private: ChunkStorage *capsulated; - __int64 timeSpentLoading; - __int64 loadCount; - __int64 timeSpentSaving; - __int64 saveCount; + int64_t timeSpentLoading; + int64_t loadCount; + int64_t timeSpentSaving; + int64_t saveCount; int counter; diff --git a/src/world/CompoundTag.h b/src/world/CompoundTag.h index 32c31583..fa6a93f3 100644 --- a/src/world/CompoundTag.h +++ b/src/world/CompoundTag.h @@ -80,7 +80,7 @@ public: tags[name] = (new IntTag(name,value)); } - void putLong(wchar_t * name, __int64 value) + void putLong(wchar_t * name, int64_t value) { tags[name] = (new LongTag(name,value)); } @@ -150,9 +150,9 @@ public: return ((IntTag *) tags[name])->data; } - __int64 getLong(wchar_t * name) + int64_t getLong(wchar_t * name) { - if (tags.find(name) == tags.end()) return (__int64)0; + if (tags.find(name) == tags.end()) return (int64_t)0; return ((LongTag *) tags[name])->data; } diff --git a/src/world/CompressedTileStorage.cpp b/src/world/CompressedTileStorage.cpp index 8704b7d8..ed7e7671 100644 --- a/src/world/CompressedTileStorage.cpp +++ b/src/world/CompressedTileStorage.cpp @@ -151,7 +151,7 @@ bool CompressedTileStorage::isRenderChunkEmpty(int y) // y == 0, 16, 32... 112 ( for( int z = 0; z < 16; z += 4 ) { getBlock(&block, x, y, z); - __uint64 *comp = (__uint64 *)&blockIndices[block]; + uint64_t *comp = (uint64_t *)&blockIndices[block]; // Are the 4 y regions stored here all zero? (INDEX_TYPE_0_OR_8_BIT | INDEX_TYPE_0_BIT_FLAG ) if( ( *comp ) != 0x0007000700070007L ) return false; } @@ -169,18 +169,18 @@ bool CompressedTileStorage::isSameAs(CompressedTileStorage *other) // Attempt to compare as much as we can in 64-byte chunks (8 groups of 8 bytes) int quickCount = allocatedSize / 64; - __int64 *pOld = (__int64 *)indicesAndData; - __int64 *pNew = (__int64 *)other->indicesAndData; + int64_t *pOld = (int64_t *)indicesAndData; + int64_t *pNew = (int64_t *)other->indicesAndData; for( int i = 0; i < quickCount; i++ ) { - __int64 d0 = pOld[0] ^ pNew[0]; - __int64 d1 = pOld[1] ^ pNew[1]; - __int64 d2 = pOld[2] ^ pNew[2]; - __int64 d3 = pOld[3] ^ pNew[3]; - __int64 d4 = pOld[4] ^ pNew[4]; - __int64 d5 = pOld[5] ^ pNew[5]; - __int64 d6 = pOld[6] ^ pNew[6]; - __int64 d7 = pOld[7] ^ pNew[7]; + int64_t d0 = pOld[0] ^ pNew[0]; + int64_t d1 = pOld[1] ^ pNew[1]; + int64_t d2 = pOld[2] ^ pNew[2]; + int64_t d3 = pOld[3] ^ pNew[3]; + int64_t d4 = pOld[4] ^ pNew[4]; + int64_t d5 = pOld[5] ^ pNew[5]; + int64_t d6 = pOld[6] ^ pNew[6]; + int64_t d7 = pOld[7] ^ pNew[7]; d0 |= d1; d2 |= d3; d4 |= d5; @@ -314,7 +314,7 @@ void CompressedTileStorage::setData(byteArray dataIn, unsigned int inOffset) // AP - Vita isn't so great at shifting 64bits. The top biggest CPU time sink after profiling is __ashldi3 (64bit shift) at 3% // Let's use 32bit instead unsigned int usedFlags[8] = {0,0,0,0,0,0,0,0}; - __int32 i32_1 = 1; + int32_t i32_1 = 1; for( int j = 0; j < 64; j++ ) // This loop of 64 is to go round the 4 x 4 tiles in the block { int tile = data[getIndex(i,j)]; @@ -332,8 +332,8 @@ void CompressedTileStorage::setData(byteArray dataIn, unsigned int inOffset) } } #else - __uint64 usedFlags[4] = {0,0,0,0}; - __int64 i64_1 = 1; // MGH - instead of 1i64, which is MS specific + uint64_t usedFlags[4] = {0,0,0,0}; + int64_t i64_1 = 1; // MGH - instead of 1i64, which is MS specific for( int j = 0; j < 64; j++ ) // This loop of 64 is to go round the 4 x 4 tiles in the block { int tile = data[getIndex(i,j)]; @@ -933,7 +933,7 @@ void CompressedTileStorage::compress(int upgradeBlock/*=-1*/) // AP - Vita isn't so great at shifting 64bits. The top biggest CPU time sink after profiling is __ashldi3 (64bit shift) at 3% // lets use 32bit values instead unsigned int usedFlags[8] = {0,0,0,0,0,0,0,0}; - __int32 i32_1 = 1; + int32_t i32_1 = 1; for( int j = 0; j < 64; j++ ) // This loop of 64 is to go round the 4x4x4 tiles in the block { int tiletype = unpacked_data[j]; @@ -950,8 +950,8 @@ void CompressedTileStorage::compress(int upgradeBlock/*=-1*/) } #else - __uint64 usedFlags[4] = {0,0,0,0}; - __int64 i64_1 = 1; // MGH - instead of 1i64, which is MS specific + uint64_t usedFlags[4] = {0,0,0,0}; + int64_t i64_1 = 1; // MGH - instead of 1i64, which is MS specific for( int j = 0; j < 64; j++ ) // This loop of 64 is to go round the 4x4x4 tiles in the block { int tiletype = unpacked_data[j]; @@ -1051,7 +1051,7 @@ void CompressedTileStorage::compress(int upgradeBlock/*=-1*/) unsigned char *newIndicesAndData = (unsigned char *)XPhysicalAlloc(memToAlloc, MAXULONG_PTR, 4096, PAGE_READWRITE);//(unsigned char *)malloc( memToAlloc ); if( newIndicesAndData == NULL ) { - DWORD lastError = GetLastError(); + unsigned long lastError = GetLastError(); #ifndef _DURANGO MEMORYSTATUS memStatus; GlobalMemoryStatus(&memStatus); diff --git a/src/world/Connection.cpp b/src/world/Connection.cpp index 5c905cbf..a178543d 100644 --- a/src/world/Connection.cpp +++ b/src/world/Connection.cpp @@ -600,7 +600,7 @@ int Connection::runWrite(void* lpParam) // 4J Stu - Adding this to force us to run through the writeTick at least once after the event is fired // Otherwise there is a race between the calling thread setting the running flag and this loop checking the condition - DWORD waitResult = WAIT_TIMEOUT; + unsigned long waitResult = WAIT_TIMEOUT; while ((con->running || waitResult == WAIT_OBJECT_0 ) && ShutdownManager::ShouldRun(ShutdownManager::eConnectionWriteThreads)) { diff --git a/src/world/Connection.h b/src/world/Connection.h index 9db00512..badd42e7 100644 --- a/src/world/Connection.h +++ b/src/world/Connection.h @@ -19,10 +19,10 @@ class ByteArrayOutputStream; class Connection { - friend DWORD WINAPI runRead(LPVOID lpParam); - friend DWORD WINAPI runWrite(LPVOID lpParam); - friend DWORD WINAPI runSendAndQuit(LPVOID lpParam); - friend DWORD WINAPI runClose(LPVOID lpParam); + friend unsigned long WINAPI runRead(void* lpParam); + friend unsigned long WINAPI runWrite(void* lpParam); + friend unsigned long WINAPI runSendAndQuit(void* lpParam); + friend unsigned long WINAPI runClose(void* lpParam); private: static const int SEND_BUFFER_SIZE = 1024 * 5; @@ -68,7 +68,7 @@ private: C4JThread::Event* m_hWakeReadThread; C4JThread::Event* m_hWakeWriteThread; - DWORD saqThreadID, closeThreadID; + unsigned long saqThreadID, closeThreadID; bool disconnected; DisconnectPacket::eDisconnectReason disconnectReason; diff --git a/src/world/ConsoleSaveFile.h b/src/world/ConsoleSaveFile.h index 39c1ec89..ec6e47fd 100644 --- a/src/world/ConsoleSaveFile.h +++ b/src/world/ConsoleSaveFile.h @@ -10,11 +10,11 @@ public: virtual FileEntry *createFile( const ConsoleSavePath &fileName ) = 0; virtual void deleteFile( FileEntry *file ) = 0; - virtual void setFilePointer( FileEntry *file,LONG lDistanceToMove, PLONG lpDistanceToMoveHigh,DWORD dwMoveMethod) = 0; - virtual BOOL writeFile( FileEntry *file, LPCVOID lpBuffer, DWORD nNumberOfBytesToWrite, LPDWORD lpNumberOfBytesWritten) = 0; - virtual BOOL zeroFile(FileEntry *file, DWORD nNumberOfBytesToWrite, LPDWORD lpNumberOfBytesWritten) = 0; - virtual BOOL readFile( FileEntry *file, LPVOID lpBuffer, DWORD nNumberOfBytesToRead, LPDWORD lpNumberOfBytesRead ) = 0; - virtual BOOL closeHandle( FileEntry *file ) = 0; + virtual void setFilePointer( FileEntry *file,int32_t lDistanceToMove, PLONG lpDistanceToMoveHigh,unsigned long dwMoveMethod) = 0; + virtual bool writeFile( FileEntry *file, const void* lpBuffer, unsigned long nNumberOfBytesToWrite, LPDWORD lpNumberOfBytesWritten) = 0; + virtual bool zeroFile(FileEntry *file, unsigned long nNumberOfBytesToWrite, LPDWORD lpNumberOfBytesWritten) = 0; + virtual bool readFile( FileEntry *file, void* lpBuffer, unsigned long nNumberOfBytesToRead, LPDWORD lpNumberOfBytesRead ) = 0; + virtual bool closeHandle( FileEntry *file ) = 0; virtual void finalizeWrite() = 0; virtual void tick() {}; diff --git a/src/world/ConsoleSaveFileConverter.cpp b/src/world/ConsoleSaveFileConverter.cpp index 9a3d572d..996fb2cc 100644 --- a/src/world/ConsoleSaveFileConverter.cpp +++ b/src/world/ConsoleSaveFileConverter.cpp @@ -7,8 +7,8 @@ void ConsoleSaveFileConverter::ProcessSimpleFile(ConsoleSaveFile *sourceSave, FileEntry *sourceFileEntry, ConsoleSaveFile *targetSave, FileEntry *targetFileEntry) { - DWORD numberOfBytesRead = 0; - DWORD numberOfBytesWritten = 0; + unsigned long numberOfBytesRead = 0; + unsigned long numberOfBytesWritten = 0; byte *data = new byte[sourceFileEntry->getFileSize()]; @@ -23,8 +23,8 @@ void ConsoleSaveFileConverter::ProcessSimpleFile(ConsoleSaveFile *sourceSave, Fi void ConsoleSaveFileConverter::ProcessStandardRegionFile(ConsoleSaveFile *sourceSave, File sourceFile, ConsoleSaveFile *targetSave, File targetFile) { - DWORD numberOfBytesWritten = 0; - DWORD numberOfBytesRead = 0; + unsigned long numberOfBytesWritten = 0; + unsigned long numberOfBytesRead = 0; RegionFile sourceRegionFile(sourceSave, &sourceFile); RegionFile targetRegionFile(targetSave, &targetFile); diff --git a/src/world/ConsoleSaveFileInputStream.cpp b/src/world/ConsoleSaveFileInputStream.cpp index 93d49956..198dd03c 100644 --- a/src/world/ConsoleSaveFileInputStream.cpp +++ b/src/world/ConsoleSaveFileInputStream.cpp @@ -26,9 +26,9 @@ ConsoleSaveFileInputStream::ConsoleSaveFileInputStream(ConsoleSaveFile *saveFile int ConsoleSaveFileInputStream::read() { byte byteRead = 0; - DWORD numberOfBytesRead; + unsigned long numberOfBytesRead; - BOOL result = m_saveFile->readFile( + bool result = m_saveFile->readFile( m_file, &byteRead, // data buffer 1, // number of bytes to read @@ -56,9 +56,9 @@ int ConsoleSaveFileInputStream::read() //the total number of bytes read into the buffer, or -1 if there is no more data because the end of the file has been reached. int ConsoleSaveFileInputStream::read(byteArray b) { - DWORD numberOfBytesRead; + unsigned long numberOfBytesRead; - BOOL result = m_saveFile->readFile( + bool result = m_saveFile->readFile( m_file, &b.data, // data buffer b.length, // number of bytes to read @@ -92,9 +92,9 @@ int ConsoleSaveFileInputStream::read(byteArray b, unsigned int offset, unsigned // 4J Stu - We don't want to read any more than the array buffer can hold assert( length <= ( b.length - offset ) ); - DWORD numberOfBytesRead; + unsigned long numberOfBytesRead; - BOOL result = m_saveFile->readFile( + bool result = m_saveFile->readFile( m_file, &b[offset], // data buffer length, // number of bytes to read @@ -121,7 +121,7 @@ void ConsoleSaveFileInputStream::close() { if( m_saveFile != NULL ) { - BOOL result = m_saveFile->closeHandle( m_file ); + bool result = m_saveFile->closeHandle( m_file ); if( result == 0 ) { diff --git a/src/world/ConsoleSaveFileInputStream.h b/src/world/ConsoleSaveFileInputStream.h index 876a9484..7f4a69c4 100644 --- a/src/world/ConsoleSaveFileInputStream.h +++ b/src/world/ConsoleSaveFileInputStream.h @@ -17,7 +17,7 @@ public: virtual int read(byteArray b); virtual int read(byteArray b, unsigned int offset, unsigned int length); virtual void close(); - virtual __int64 skip(__int64 n) { return n; } + virtual int64_t skip(int64_t n) { return n; } private: ConsoleSaveFile *m_saveFile; diff --git a/src/world/ConsoleSaveFileOriginal.cpp b/src/world/ConsoleSaveFileOriginal.cpp index 2cb569a7..150f1545 100644 --- a/src/world/ConsoleSaveFileOriginal.cpp +++ b/src/world/ConsoleSaveFileOriginal.cpp @@ -24,7 +24,7 @@ unsigned int ConsoleSaveFileOriginal::pagesCommitted = 0; void *ConsoleSaveFileOriginal::pvHeap = NULL; -ConsoleSaveFileOriginal::ConsoleSaveFileOriginal(const wstring &fileName, LPVOID pvSaveData /*= NULL*/, DWORD dFileSize /*= 0*/, bool forceCleanSave /*= false*/, ESavePlatform plat /*= SAVE_FILE_PLATFORM_LOCAL*/) +ConsoleSaveFileOriginal::ConsoleSaveFileOriginal(const wstring &fileName, void* pvSaveData /*= NULL*/, unsigned long dFileSize /*= 0*/, bool forceCleanSave /*= false*/, ESavePlatform plat /*= SAVE_FILE_PLATFORM_LOCAL*/) { InitializeCriticalSectionAndSpinCount(&m_lock,5120); @@ -44,7 +44,7 @@ ConsoleSaveFileOriginal::ConsoleSaveFileOriginal(const wstring &fileName, LPVOID pvSaveMem = pvHeap; m_fileName = fileName; - DWORD fileSize = dFileSize; + unsigned long fileSize = dFileSize; // Load a save from the game rules bool bLevelGenBaseSave = false; @@ -61,7 +61,7 @@ ConsoleSaveFileOriginal::ConsoleSaveFileOriginal(const wstring &fileName, LPVOID if( forceCleanSave ) fileSize = 0; - DWORD heapSize = max( fileSize, (DWORD)(1024 * 1024 * 2)); // 4J Stu - Our files are going to be bigger than 2MB so allocate high to start with + unsigned long heapSize = max( fileSize, (unsigned long)(1024 * 1024 * 2)); // 4J Stu - Our files are going to be bigger than 2MB so allocate high to start with // Initially committ enough room to store headSize bytes (using CSF_PAGE_SIZE pages, so rounding up here). We should only ever have one save file at a time, // and the pages should be decommitted in the dtor, so pages committed should always be zero at this point. @@ -173,9 +173,9 @@ ConsoleSaveFileOriginal::ConsoleSaveFileOriginal(const wstring &fileName, LPVOID } // Only ReAlloc if we need to (we might already have enough) and align to 512 byte boundaries - DWORD currentHeapSize = pagesCommitted * CSF_PAGE_SIZE; + unsigned long currentHeapSize = pagesCommitted * CSF_PAGE_SIZE; - DWORD desiredSize = decompSize; + unsigned long desiredSize = decompSize; if( desiredSize > currentHeapSize ) { @@ -239,13 +239,13 @@ void ConsoleSaveFileOriginal::deleteFile( FileEntry *file ) LockSaveAccess(); - DWORD numberOfBytesRead = 0; - DWORD numberOfBytesWritten = 0; + unsigned long numberOfBytesRead = 0; + unsigned long numberOfBytesWritten = 0; const int bufferSize = 4096; int amountToRead = bufferSize; byte buffer[bufferSize]; - DWORD bufferDataSize = 0; + unsigned long bufferDataSize = 0; char *readStartOffset = (char *)pvSaveMem + file->data.startOffset + file->getFileSize(); @@ -299,7 +299,7 @@ void ConsoleSaveFileOriginal::deleteFile( FileEntry *file ) ReleaseSaveAccess(); } -void ConsoleSaveFileOriginal::setFilePointer(FileEntry *file,LONG lDistanceToMove,PLONG lpDistanceToMoveHigh,DWORD dwMoveMethod) +void ConsoleSaveFileOriginal::setFilePointer(FileEntry *file,int32_t lDistanceToMove,PLONG lpDistanceToMoveHigh,unsigned long dwMoveMethod) { LockSaveAccess(); @@ -314,7 +314,7 @@ void ConsoleSaveFileOriginal::setFilePointer(FileEntry *file,LONG lDistanceToMov } // If this file needs to grow, move the data after along -void ConsoleSaveFileOriginal::PrepareForWrite( FileEntry *file, DWORD nNumberOfBytesToWrite ) +void ConsoleSaveFileOriginal::PrepareForWrite( FileEntry *file, unsigned long nNumberOfBytesToWrite ) { int bytesToGrowBy = ( (file->currentFilePointer - file->data.startOffset) + nNumberOfBytesToWrite) - file->getFileSize(); if( bytesToGrowBy <= 0 ) @@ -337,7 +337,7 @@ void ConsoleSaveFileOriginal::PrepareForWrite( FileEntry *file, DWORD nNumberOfB finalizeWrite(); } -BOOL ConsoleSaveFileOriginal::writeFile(FileEntry *file,LPCVOID lpBuffer, DWORD nNumberOfBytesToWrite, LPDWORD lpNumberOfBytesWritten) +bool ConsoleSaveFileOriginal::writeFile(FileEntry *file,const void* lpBuffer, unsigned long nNumberOfBytesToWrite, LPDWORD lpNumberOfBytesWritten) { assert( pvSaveMem != NULL ); if( pvSaveMem == NULL ) @@ -374,7 +374,7 @@ BOOL ConsoleSaveFileOriginal::writeFile(FileEntry *file,LPCVOID lpBuffer, DWORD return 1; } -BOOL ConsoleSaveFileOriginal::zeroFile(FileEntry *file, DWORD nNumberOfBytesToWrite, LPDWORD lpNumberOfBytesWritten) +bool ConsoleSaveFileOriginal::zeroFile(FileEntry *file, unsigned long nNumberOfBytesToWrite, LPDWORD lpNumberOfBytesWritten) { assert( pvSaveMem != NULL ); if( pvSaveMem == NULL ) @@ -411,9 +411,9 @@ BOOL ConsoleSaveFileOriginal::zeroFile(FileEntry *file, DWORD nNumberOfBytesToWr return 1; } -BOOL ConsoleSaveFileOriginal::readFile( FileEntry *file, LPVOID lpBuffer, DWORD nNumberOfBytesToRead, LPDWORD lpNumberOfBytesRead) +bool ConsoleSaveFileOriginal::readFile( FileEntry *file, void* lpBuffer, unsigned long nNumberOfBytesToRead, LPDWORD lpNumberOfBytesRead) { - DWORD actualBytesToRead; + unsigned long actualBytesToRead; assert( pvSaveMem != NULL ); if( pvSaveMem == NULL ) { @@ -451,7 +451,7 @@ BOOL ConsoleSaveFileOriginal::readFile( FileEntry *file, LPVOID lpBuffer, DWORD return 1; } -BOOL ConsoleSaveFileOriginal::closeHandle( FileEntry *file ) +bool ConsoleSaveFileOriginal::closeHandle( FileEntry *file ) { LockSaveAccess(); finalizeWrite(); @@ -467,23 +467,23 @@ void ConsoleSaveFileOriginal::finalizeWrite() ReleaseSaveAccess(); } -void ConsoleSaveFileOriginal::MoveDataBeyond(FileEntry *file, DWORD nNumberOfBytesToWrite) +void ConsoleSaveFileOriginal::MoveDataBeyond(FileEntry *file, unsigned long nNumberOfBytesToWrite) { - DWORD numberOfBytesRead = 0; - DWORD numberOfBytesWritten = 0; + unsigned long numberOfBytesRead = 0; + unsigned long numberOfBytesWritten = 0; - const DWORD bufferSize = 4096; - DWORD amountToRead = bufferSize; + const unsigned long bufferSize = 4096; + unsigned long amountToRead = bufferSize; //assert( nNumberOfBytesToWrite <= bufferSize ); static byte buffer1[bufferSize]; static byte buffer2[bufferSize]; - DWORD buffer1Size = 0; - DWORD buffer2Size = 0; + unsigned long buffer1Size = 0; + unsigned long buffer2Size = 0; // Only ReAlloc if we need to (we might already have enough) and align to 512 byte boundaries - DWORD currentHeapSize = pagesCommitted * CSF_PAGE_SIZE; + unsigned long currentHeapSize = pagesCommitted * CSF_PAGE_SIZE; - DWORD desiredSize = header.GetFileSize() + nNumberOfBytesToWrite; + unsigned long desiredSize = header.GetFileSize() + nNumberOfBytesToWrite; if( desiredSize > currentHeapSize ) { @@ -570,7 +570,7 @@ void ConsoleSaveFileOriginal::MoveDataBeyond(FileEntry *file, DWORD nNumberOfByt // Fill buffer 1 from file if( (readStartOffset - bufferSize) < spaceStartOffset ) { - amountToRead = (DWORD)(readStartOffset - spaceStartOffset); + amountToRead = (unsigned long)(readStartOffset - spaceStartOffset); } else { @@ -734,11 +734,11 @@ void ConsoleSaveFileOriginal::Flush(bool autosave, bool updateThumbnail ) app.DebugPrintf("Save data compressed from %d to %d\n", fileSize, compLength); #endif - PBYTE pbThumbnailData=NULL; - DWORD dwThumbnailDataSize=0; + uint8_t* pbThumbnailData=NULL; + unsigned long dwThumbnailDataSize=0; - PBYTE pbDataSaveImage=NULL; - DWORD dwDataSizeSaveImage=0; + uint8_t* pbDataSaveImage=NULL; + unsigned long dwDataSizeSaveImage=0; #if ( defined _XBOX || defined _DURANGO ) app.GetSaveThumbnail(&pbThumbnailData,&dwThumbnailDataSize); @@ -746,10 +746,10 @@ void ConsoleSaveFileOriginal::Flush(bool autosave, bool updateThumbnail ) app.GetSaveThumbnail(&pbThumbnailData,&dwThumbnailDataSize,&pbDataSaveImage,&dwDataSizeSaveImage); #endif - BYTE bTextMetadata[88]; + uint8_t bTextMetadata[88]; ZeroMemory(bTextMetadata,88); - __int64 seed = 0; + int64_t seed = 0; bool hasSeed = false; if(MinecraftServer::getInstance()!= NULL && MinecraftServer::getInstance()->levels[0]!=NULL) { @@ -759,7 +759,7 @@ void ConsoleSaveFileOriginal::Flush(bool autosave, bool updateThumbnail ) int iTextMetadataBytes = app.CreateImageTextData(bTextMetadata, seed, hasSeed, app.GetGameHostOption(eGameHostOption_All), Minecraft::GetInstance()->getCurrentTexturePackId()); - INT saveOrCheckpointId = 0; + int saveOrCheckpointId = 0; bool validSave = StorageManager.GetSaveUniqueNumber(&saveOrCheckpointId); TelemetryManager->RecordLevelSaveOrCheckpoint(ProfileManager.GetPrimaryPad(), saveOrCheckpointId, compLength+8); @@ -808,7 +808,7 @@ void ConsoleSaveFileOriginal::Flush(bool autosave, bool updateThumbnail ) #if (defined __PS3__ || defined __ORBIS__ || defined __PSVITA__ || defined _DURANGO || defined _WINDOWS64) -int ConsoleSaveFileOriginal::SaveSaveDataCallback(LPVOID lpParam,bool bRes) +int ConsoleSaveFileOriginal::SaveSaveDataCallback(void* lpParam,bool bRes) { ConsoleSaveFile *pClass=(ConsoleSaveFile *)lpParam; @@ -826,7 +826,7 @@ void ConsoleSaveFileOriginal::DebugFlushToFile(void *compressedData /*= NULL*/, unsigned int fileSize = header.GetFileSize(); - DWORD numberOfBytesWritten = 0; + unsigned long numberOfBytesWritten = 0; #ifdef _XBOX File targetFileDir(L"GAME:\\Saves"); #else @@ -853,12 +853,12 @@ void ConsoleSaveFileOriginal::DebugFlushToFile(void *compressedData /*= NULL*/, #ifdef _UNICODE wstring wtemp = targetFileDir.getPath() + wstring(fileName); - LPCWSTR lpFileName = wtemp.c_str(); + const wchar_t* lpFileName = wtemp.c_str(); #else - LPCSTR lpFileName = wstringtofilename( targetFileDir.getPath() + wstring(fileName) ); + const char* lpFileName = wstringtofilename( targetFileDir.getPath() + wstring(fileName) ); #endif #ifndef __PSVITA__ - HANDLE hSaveFile = CreateFile( lpFileName, GENERIC_WRITE, 0, NULL, OPEN_ALWAYS, FILE_FLAG_RANDOM_ACCESS, NULL); + void* hSaveFile = CreateFile( lpFileName, GENERIC_WRITE, 0, NULL, OPEN_ALWAYS, FILE_FLAG_RANDOM_ACCESS, NULL); #endif if(compressedData != NULL && compressedDataSize > 0) @@ -989,8 +989,8 @@ bool ConsoleSaveFileOriginal::isLocalEndianDifferent( ESavePlatform plat ) void ConsoleSaveFileOriginal::ConvertRegionFile(File sourceFile) { - DWORD numberOfBytesWritten = 0; - DWORD numberOfBytesRead = 0; + unsigned long numberOfBytesWritten = 0; + unsigned long numberOfBytesRead = 0; RegionFile sourceRegionFile(this, &sourceFile); diff --git a/src/world/ConsoleSaveFileOriginal.h b/src/world/ConsoleSaveFileOriginal.h index fd35aa1d..883305f5 100644 --- a/src/world/ConsoleSaveFileOriginal.h +++ b/src/world/ConsoleSaveFileOriginal.h @@ -11,7 +11,7 @@ private: wstring m_fileName; -// HANDLE hHeap; +// void* hHeap; static void *pvHeap; static unsigned int pagesCommitted; #ifdef _LARGE_WORLDS @@ -24,18 +24,18 @@ private: static const unsigned int CSF_PAGE_SIZE = 64 * 1024; static const unsigned int MAX_PAGE_COUNT = 1024; #endif - LPVOID pvSaveMem; + void* pvSaveMem; CRITICAL_SECTION m_lock; - void PrepareForWrite( FileEntry *file, DWORD nNumberOfBytesToWrite ); - void MoveDataBeyond(FileEntry *file, DWORD nNumberOfBytesToWrite); + void PrepareForWrite( FileEntry *file, unsigned long nNumberOfBytesToWrite ); + void MoveDataBeyond(FileEntry *file, unsigned long nNumberOfBytesToWrite); public: #if (defined __PS3__ || defined __ORBIS__ || defined __PSVITA__ || defined _DURANGO || defined _WINDOWS64) - static int SaveSaveDataCallback(LPVOID lpParam,bool bRes); + static int SaveSaveDataCallback(void* lpParam,bool bRes); #endif - ConsoleSaveFileOriginal(const wstring &fileName, LPVOID pvSaveData = NULL, DWORD fileSize = 0, bool forceCleanSave = false, ESavePlatform plat = SAVE_FILE_PLATFORM_LOCAL); + ConsoleSaveFileOriginal(const wstring &fileName, void* pvSaveData = NULL, unsigned long fileSize = 0, bool forceCleanSave = false, ESavePlatform plat = SAVE_FILE_PLATFORM_LOCAL); virtual ~ConsoleSaveFileOriginal(); // 4J Stu - Initial implementation is intended to have a similar interface to the standard Xbox file access functions @@ -43,11 +43,11 @@ public: virtual FileEntry *createFile( const ConsoleSavePath &fileName ); virtual void deleteFile( FileEntry *file ); - virtual void setFilePointer(FileEntry *file,LONG lDistanceToMove,PLONG lpDistanceToMoveHigh,DWORD dwMoveMethod); - virtual BOOL writeFile( FileEntry *file, LPCVOID lpBuffer, DWORD nNumberOfBytesToWrite, LPDWORD lpNumberOfBytesWritten ); - virtual BOOL zeroFile(FileEntry *file, DWORD nNumberOfBytesToWrite, LPDWORD lpNumberOfBytesWritten); - virtual BOOL readFile( FileEntry *file, LPVOID lpBuffer, DWORD nNumberOfBytesToRead, LPDWORD lpNumberOfBytesRead ); - virtual BOOL closeHandle( FileEntry *file ); + virtual void setFilePointer(FileEntry *file,int32_t lDistanceToMove,PLONG lpDistanceToMoveHigh,unsigned long dwMoveMethod); + virtual bool writeFile( FileEntry *file, const void* lpBuffer, unsigned long nNumberOfBytesToWrite, LPDWORD lpNumberOfBytesWritten ); + virtual bool zeroFile(FileEntry *file, unsigned long nNumberOfBytesToWrite, LPDWORD lpNumberOfBytesWritten); + virtual bool readFile( FileEntry *file, void* lpBuffer, unsigned long nNumberOfBytesToRead, LPDWORD lpNumberOfBytesRead ); + virtual bool closeHandle( FileEntry *file ); virtual void finalizeWrite(); diff --git a/src/world/ConsoleSaveFileOutputStream.cpp b/src/world/ConsoleSaveFileOutputStream.cpp index 3d8bb3f7..157790ba 100644 --- a/src/world/ConsoleSaveFileOutputStream.cpp +++ b/src/world/ConsoleSaveFileOutputStream.cpp @@ -36,11 +36,11 @@ ConsoleSaveFileOutputStream::ConsoleSaveFileOutputStream(ConsoleSaveFile *saveFi //b - the byte to be written. void ConsoleSaveFileOutputStream::write(unsigned int b) { - DWORD numberOfBytesWritten; + unsigned long numberOfBytesWritten; byte value = (byte) b; - BOOL result = m_saveFile->writeFile( + bool result = m_saveFile->writeFile( m_file, &value, // data buffer 1, // number of bytes to write @@ -62,9 +62,9 @@ void ConsoleSaveFileOutputStream::write(unsigned int b) //b - the data. void ConsoleSaveFileOutputStream::write(byteArray b) { - DWORD numberOfBytesWritten; + unsigned long numberOfBytesWritten; - BOOL result = m_saveFile->writeFile( + bool result = m_saveFile->writeFile( m_file, &b.data, // data buffer b.length, // number of bytes to write @@ -91,9 +91,9 @@ void ConsoleSaveFileOutputStream::write(byteArray b, unsigned int offset, unsign // 4J Stu - We don't want to write any more than the array buffer holds assert( length <= ( b.length - offset ) ); - DWORD numberOfBytesWritten; + unsigned long numberOfBytesWritten; - BOOL result = m_saveFile->writeFile( + bool result = m_saveFile->writeFile( m_file, &b[offset], // data buffer length, // number of bytes to write @@ -117,7 +117,7 @@ void ConsoleSaveFileOutputStream::close() { if( m_saveFile != NULL ) { - BOOL result = m_saveFile->closeHandle( m_file ); + bool result = m_saveFile->closeHandle( m_file ); if( result == 0 ) { diff --git a/src/world/ConsoleSaveFileSplit.cpp b/src/world/ConsoleSaveFileSplit.cpp index 3f84b4ae..6bb70c54 100644 --- a/src/world/ConsoleSaveFileSplit.cpp +++ b/src/world/ConsoleSaveFileSplit.cpp @@ -379,9 +379,9 @@ FileEntry *ConsoleSaveFileSplit::GetRegionFileEntry(unsigned int regionIndex) return newRef->fileEntry; } -ConsoleSaveFileSplit::ConsoleSaveFileSplit(const wstring &fileName, LPVOID pvSaveData /*= NULL*/, DWORD dFileSize /*= 0*/, bool forceCleanSave /*= false*/, ESavePlatform plat /*= SAVE_FILE_PLATFORM_LOCAL*/) +ConsoleSaveFileSplit::ConsoleSaveFileSplit(const wstring &fileName, void* pvSaveData /*= NULL*/, unsigned long dFileSize /*= 0*/, bool forceCleanSave /*= false*/, ESavePlatform plat /*= SAVE_FILE_PLATFORM_LOCAL*/) { - DWORD fileSize = dFileSize; + unsigned long fileSize = dFileSize; // Load a save from the game rules bool bLevelGenBaseSave = false; @@ -418,7 +418,7 @@ ConsoleSaveFileSplit::ConsoleSaveFileSplit(ConsoleSaveFile *sourceSave, bool alr vector *sourceFiles = sourceSave->getFilesWithPrefix(L""); - DWORD bytesWritten; + unsigned long bytesWritten; for(AUTO_VAR(it, sourceFiles->begin()); it != sourceFiles->end(); ++it) { FileEntry *sourceEntry = *it; @@ -437,7 +437,7 @@ ConsoleSaveFileSplit::ConsoleSaveFileSplit(ConsoleSaveFile *sourceSave, bool alr } } -void ConsoleSaveFileSplit::_init(const wstring &fileName, LPVOID pvSaveData, DWORD fileSize, ESavePlatform plat) +void ConsoleSaveFileSplit::_init(const wstring &fileName, void* pvSaveData, unsigned long fileSize, ESavePlatform plat) { InitializeCriticalSectionAndSpinCount(&m_lock,5120); @@ -478,7 +478,7 @@ void ConsoleSaveFileSplit::_init(const wstring &fileName, LPVOID pvSaveData, DWO regionFiles[regionIndex] = regionFileRef; } - DWORD heapSize = max( fileSize, (DWORD)(1024 * 1024 * 2)); // 4J Stu - Our files are going to be bigger than 2MB so allocate high to start with + unsigned long heapSize = max( fileSize, (unsigned long)(1024 * 1024 * 2)); // 4J Stu - Our files are going to be bigger than 2MB so allocate high to start with // Initially committ enough room to store headSize bytes (using CSF_PAGE_SIZE pages, so rounding up here). We should only ever have one save file at a time, // and the pages should be decommitted in the dtor, so pages committed should always be zero at this point. @@ -537,9 +537,9 @@ void ConsoleSaveFileSplit::_init(const wstring &fileName, LPVOID pvSaveData, DWO { // Only ReAlloc if we need to (we might already have enough) and align to 512 byte boundaries - DWORD currentHeapSize = pagesCommitted * CSF_PAGE_SIZE; + unsigned long currentHeapSize = pagesCommitted * CSF_PAGE_SIZE; - DWORD desiredSize = decompSize; + unsigned long desiredSize = decompSize; if( desiredSize > currentHeapSize ) { @@ -636,13 +636,13 @@ void ConsoleSaveFileSplit::deleteFile( FileEntry *file ) LockSaveAccess(); - DWORD numberOfBytesRead = 0; - DWORD numberOfBytesWritten = 0; + unsigned long numberOfBytesRead = 0; + unsigned long numberOfBytesWritten = 0; const int bufferSize = 4096; int amountToRead = bufferSize; byte buffer[bufferSize]; - DWORD bufferDataSize = 0; + unsigned long bufferDataSize = 0; char *readStartOffset = (char *)pvSaveMem + file->data.startOffset + file->getFileSize(); @@ -686,7 +686,7 @@ void ConsoleSaveFileSplit::deleteFile( FileEntry *file ) ReleaseSaveAccess(); } -void ConsoleSaveFileSplit::setFilePointer(FileEntry *file,LONG lDistanceToMove,PLONG lpDistanceToMoveHigh,DWORD dwMoveMethod) +void ConsoleSaveFileSplit::setFilePointer(FileEntry *file,int32_t lDistanceToMove,PLONG lpDistanceToMoveHigh,unsigned long dwMoveMethod) { LockSaveAccess(); @@ -708,7 +708,7 @@ void ConsoleSaveFileSplit::setFilePointer(FileEntry *file,LONG lDistanceToMove,P } // If this file needs to grow, move the data after along -void ConsoleSaveFileSplit::PrepareForWrite( FileEntry *file, DWORD nNumberOfBytesToWrite ) +void ConsoleSaveFileSplit::PrepareForWrite( FileEntry *file, unsigned long nNumberOfBytesToWrite ) { int bytesToGrowBy = ( (file->currentFilePointer - file->data.startOffset) + nNumberOfBytesToWrite) - file->getFileSize(); if( bytesToGrowBy <= 0 ) @@ -733,7 +733,7 @@ void ConsoleSaveFileSplit::PrepareForWrite( FileEntry *file, DWORD nNumberOfByte finalizeWrite(); } -BOOL ConsoleSaveFileSplit::writeFile(FileEntry *file,LPCVOID lpBuffer, DWORD nNumberOfBytesToWrite, LPDWORD lpNumberOfBytesWritten) +bool ConsoleSaveFileSplit::writeFile(FileEntry *file,const void* lpBuffer, unsigned long nNumberOfBytesToWrite, LPDWORD lpNumberOfBytesWritten) { assert( pvSaveMem != NULL ); if( pvSaveMem == NULL ) @@ -786,7 +786,7 @@ BOOL ConsoleSaveFileSplit::writeFile(FileEntry *file,LPCVOID lpBuffer, DWORD nNu return 1; } -BOOL ConsoleSaveFileSplit::zeroFile(FileEntry *file, DWORD nNumberOfBytesToWrite, LPDWORD lpNumberOfBytesWritten) +bool ConsoleSaveFileSplit::zeroFile(FileEntry *file, unsigned long nNumberOfBytesToWrite, LPDWORD lpNumberOfBytesWritten) { assert( pvSaveMem != NULL ); if( pvSaveMem == NULL ) @@ -839,9 +839,9 @@ BOOL ConsoleSaveFileSplit::zeroFile(FileEntry *file, DWORD nNumberOfBytesToWrite return 1; } -BOOL ConsoleSaveFileSplit::readFile( FileEntry *file, LPVOID lpBuffer, DWORD nNumberOfBytesToRead, LPDWORD lpNumberOfBytesRead) +bool ConsoleSaveFileSplit::readFile( FileEntry *file, void* lpBuffer, unsigned long nNumberOfBytesToRead, LPDWORD lpNumberOfBytesRead) { - DWORD actualBytesToRead; + unsigned long actualBytesToRead; assert( pvSaveMem != NULL ); if( pvSaveMem == NULL ) { @@ -891,7 +891,7 @@ BOOL ConsoleSaveFileSplit::readFile( FileEntry *file, LPVOID lpBuffer, DWORD nNu return 1; } -BOOL ConsoleSaveFileSplit::closeHandle( FileEntry *file ) +bool ConsoleSaveFileSplit::closeHandle( FileEntry *file ) { LockSaveAccess(); finalizeWrite(); @@ -999,7 +999,7 @@ void ConsoleSaveFileSplit::tick() { unsigned int totalDirty = 0; unsigned int totalDirtyBytes = 0; - __int64 oldestDirty = currentTime; + int64_t oldestDirty = currentTime; for( AUTO_VAR(it, regionFiles.begin()); it != regionFiles.end(); it++ ) { if( it->second->dirty ) @@ -1036,23 +1036,23 @@ void ConsoleSaveFileSplit::finalizeWrite() ReleaseSaveAccess(); } -void ConsoleSaveFileSplit::MoveDataBeyond(FileEntry *file, DWORD nNumberOfBytesToWrite) +void ConsoleSaveFileSplit::MoveDataBeyond(FileEntry *file, unsigned long nNumberOfBytesToWrite) { - DWORD numberOfBytesRead = 0; - DWORD numberOfBytesWritten = 0; + unsigned long numberOfBytesRead = 0; + unsigned long numberOfBytesWritten = 0; - const DWORD bufferSize = 4096; - DWORD amountToRead = bufferSize; + const unsigned long bufferSize = 4096; + unsigned long amountToRead = bufferSize; //assert( nNumberOfBytesToWrite <= bufferSize ); static byte buffer1[bufferSize]; static byte buffer2[bufferSize]; - DWORD buffer1Size = 0; - DWORD buffer2Size = 0; + unsigned long buffer1Size = 0; + unsigned long buffer2Size = 0; // Only ReAlloc if we need to (we might already have enough) and align to 512 byte boundaries - DWORD currentHeapSize = pagesCommitted * CSF_PAGE_SIZE; + unsigned long currentHeapSize = pagesCommitted * CSF_PAGE_SIZE; - DWORD desiredSize = header.GetFileSize() + nNumberOfBytesToWrite; + unsigned long desiredSize = header.GetFileSize() + nNumberOfBytesToWrite; if( desiredSize > currentHeapSize ) { @@ -1134,7 +1134,7 @@ void ConsoleSaveFileSplit::MoveDataBeyond(FileEntry *file, DWORD nNumberOfBytesT // Fill buffer 1 from file if( (readStartOffset - bufferSize) < spaceStartOffset ) { - amountToRead = (DWORD)(readStartOffset - spaceStartOffset); + amountToRead = (unsigned long)(readStartOffset - spaceStartOffset); } else { @@ -1406,11 +1406,11 @@ void ConsoleSaveFileSplit::Flush(bool autosave, bool updateThumbnail) if(updateThumbnail) { - PBYTE pbThumbnailData=NULL; - DWORD dwThumbnailDataSize=0; + uint8_t* pbThumbnailData=NULL; + unsigned long dwThumbnailDataSize=0; - PBYTE pbDataSaveImage=NULL; - DWORD dwDataSizeSaveImage=0; + uint8_t* pbDataSaveImage=NULL; + unsigned long dwDataSizeSaveImage=0; #if ( defined _XBOX || defined _DURANGO ) app.GetSaveThumbnail(&pbThumbnailData,&dwThumbnailDataSize); @@ -1418,10 +1418,10 @@ void ConsoleSaveFileSplit::Flush(bool autosave, bool updateThumbnail) app.GetSaveThumbnail(&pbThumbnailData,&dwThumbnailDataSize,&pbDataSaveImage,&dwDataSizeSaveImage); #endif - BYTE bTextMetadata[88]; + uint8_t bTextMetadata[88]; ZeroMemory(bTextMetadata,88); - __int64 seed = 0; + int64_t seed = 0; bool hasSeed = false; if(MinecraftServer::getInstance()!= NULL && MinecraftServer::getInstance()->levels[0]!=NULL) { @@ -1437,7 +1437,7 @@ void ConsoleSaveFileSplit::Flush(bool autosave, bool updateThumbnail) } - INT saveOrCheckpointId = 0; + int saveOrCheckpointId = 0; bool validSave = StorageManager.GetSaveUniqueNumber(&saveOrCheckpointId); TelemetryManager->RecordLevelSaveOrCheckpoint(ProfileManager.GetPrimaryPad(), saveOrCheckpointId, compLength+8); @@ -1456,7 +1456,7 @@ void ConsoleSaveFileSplit::Flush(bool autosave, bool updateThumbnail) } } -int ConsoleSaveFileSplit::SaveSaveDataCallback(LPVOID lpParam,bool bRes) +int ConsoleSaveFileSplit::SaveSaveDataCallback(void* lpParam,bool bRes) { ConsoleSaveFileSplit *pClass=(ConsoleSaveFileSplit *)lpParam; @@ -1469,7 +1469,7 @@ int ConsoleSaveFileSplit::SaveSaveDataCallback(LPVOID lpParam,bool bRes) return 0; } -int ConsoleSaveFileSplit::SaveRegionFilesCallback(LPVOID lpParam,bool bRes) +int ConsoleSaveFileSplit::SaveRegionFilesCallback(void* lpParam,bool bRes) { ConsoleSaveFileSplit *pClass=(ConsoleSaveFileSplit *)lpParam; @@ -1488,7 +1488,7 @@ void ConsoleSaveFileSplit::DebugFlushToFile(void *compressedData /*= NULL*/, uns unsigned int fileSize = header.GetFileSize(); - DWORD numberOfBytesWritten = 0; + unsigned long numberOfBytesWritten = 0; File targetFileDir(L"Saves"); @@ -1512,12 +1512,12 @@ void ConsoleSaveFileSplit::DebugFlushToFile(void *compressedData /*= NULL*/, uns #ifdef _UNICODE wstring wtemp = targetFileDir.getPath() + wstring(fileName); - LPCWSTR lpFileName = wtemp.c_str(); + const wchar_t* lpFileName = wtemp.c_str(); #else - LPCSTR lpFileName = wstringtofilename( targetFileDir.getPath() + wstring(fileName) ); + const char* lpFileName = wstringtofilename( targetFileDir.getPath() + wstring(fileName) ); #endif - HANDLE hSaveFile = CreateFile( lpFileName, GENERIC_WRITE, 0, NULL, OPEN_ALWAYS, FILE_FLAG_RANDOM_ACCESS, NULL); + void* hSaveFile = CreateFile( lpFileName, GENERIC_WRITE, 0, NULL, OPEN_ALWAYS, FILE_FLAG_RANDOM_ACCESS, NULL); if(compressedData != NULL && compressedDataSize > 0) { @@ -1646,8 +1646,8 @@ void ConsoleSaveFileSplit::setEndian(ByteOrder endian) void ConsoleSaveFileSplit::ConvertRegionFile(File sourceFile) { - DWORD numberOfBytesWritten = 0; - DWORD numberOfBytesRead = 0; + unsigned long numberOfBytesWritten = 0; + unsigned long numberOfBytesRead = 0; RegionFile sourceRegionFile(this, &sourceFile); diff --git a/src/world/ConsoleSaveFileSplit.h b/src/world/ConsoleSaveFileSplit.h index 0b2017a2..054ef23d 100644 --- a/src/world/ConsoleSaveFileSplit.h +++ b/src/world/ConsoleSaveFileSplit.h @@ -57,7 +57,7 @@ private: wstring m_fileName; bool m_autosave; -// HANDLE hHeap; +// void* hHeap; static void *pvHeap; static unsigned int pagesCommitted; #ifdef _LARGE_WORLDS @@ -67,26 +67,26 @@ private: static const unsigned int CSF_PAGE_SIZE = 64 * 1024; static const unsigned int MAX_PAGE_COUNT = 1024; #endif - LPVOID pvSaveMem; + void* pvSaveMem; CRITICAL_SECTION m_lock; - void PrepareForWrite( FileEntry *file, DWORD nNumberOfBytesToWrite ); - void MoveDataBeyond(FileEntry *file, DWORD nNumberOfBytesToWrite); + void PrepareForWrite( FileEntry *file, unsigned long nNumberOfBytesToWrite ); + void MoveDataBeyond(FileEntry *file, unsigned long nNumberOfBytesToWrite); bool GetNumericIdentifierFromName(const wstring &fileName, unsigned int *idOut); wstring GetNameFromNumericIdentifier(unsigned int idIn); void processSubfilesForWrite(); void processSubfilesAfterWrite(); public: - static int SaveSaveDataCallback(LPVOID lpParam,bool bRes); - static int SaveRegionFilesCallback(LPVOID lpParam,bool bRes); + static int SaveSaveDataCallback(void* lpParam,bool bRes); + static int SaveRegionFilesCallback(void* lpParam,bool bRes); private: - void _init(const wstring &fileName, LPVOID pvSaveData, DWORD fileSize, ESavePlatform plat); + void _init(const wstring &fileName, void* pvSaveData, unsigned long fileSize, ESavePlatform plat); public: - ConsoleSaveFileSplit(const wstring &fileName, LPVOID pvSaveData = NULL, DWORD fileSize = 0, bool forceCleanSave = false, ESavePlatform plat = SAVE_FILE_PLATFORM_LOCAL); + ConsoleSaveFileSplit(const wstring &fileName, void* pvSaveData = NULL, unsigned long fileSize = 0, bool forceCleanSave = false, ESavePlatform plat = SAVE_FILE_PLATFORM_LOCAL); ConsoleSaveFileSplit(ConsoleSaveFile *sourceSave, bool alreadySmallRegions = true, ProgressListener *progress = NULL); virtual ~ConsoleSaveFileSplit(); @@ -95,11 +95,11 @@ public: virtual FileEntry *createFile( const ConsoleSavePath &fileName ); virtual void deleteFile( FileEntry *file ); - virtual void setFilePointer(FileEntry *file,LONG lDistanceToMove,PLONG lpDistanceToMoveHigh,DWORD dwMoveMethod); - virtual BOOL writeFile( FileEntry *file, LPCVOID lpBuffer, DWORD nNumberOfBytesToWrite, LPDWORD lpNumberOfBytesWritten ); - virtual BOOL zeroFile(FileEntry *file, DWORD nNumberOfBytesToWrite, LPDWORD lpNumberOfBytesWritten); - virtual BOOL readFile( FileEntry *file, LPVOID lpBuffer, DWORD nNumberOfBytesToRead, LPDWORD lpNumberOfBytesRead ); - virtual BOOL closeHandle( FileEntry *file ); + virtual void setFilePointer(FileEntry *file,int32_t lDistanceToMove,PLONG lpDistanceToMoveHigh,unsigned long dwMoveMethod); + virtual bool writeFile( FileEntry *file, const void* lpBuffer, unsigned long nNumberOfBytesToWrite, LPDWORD lpNumberOfBytesWritten ); + virtual bool zeroFile(FileEntry *file, unsigned long nNumberOfBytesToWrite, LPDWORD lpNumberOfBytesWritten); + virtual bool readFile( FileEntry *file, void* lpBuffer, unsigned long nNumberOfBytesToRead, LPDWORD lpNumberOfBytesRead ); + virtual bool closeHandle( FileEntry *file ); virtual void finalizeWrite(); virtual void tick(); diff --git a/src/world/ContainerSetSlotPacket.cpp b/src/world/ContainerSetSlotPacket.cpp index 42892f3c..8c7af2c4 100644 --- a/src/world/ContainerSetSlotPacket.cpp +++ b/src/world/ContainerSetSlotPacket.cpp @@ -34,7 +34,7 @@ void ContainerSetSlotPacket::read(DataInputStream *dis) //throws IOException { // 4J Stu - TU-1 hotfix // Fix for #13142 - Holding down the A button on the furnace ingredient slot causes the UI to display incorrect item counts - BYTE byteId = dis->readByte(); + uint8_t byteId = dis->readByte(); containerId = *(char *)&byteId; slot = dis->readShort(); item = readItem(dis); diff --git a/src/world/CustomLevelSource.cpp b/src/world/CustomLevelSource.cpp index 005a9f44..db22973a 100644 --- a/src/world/CustomLevelSource.cpp +++ b/src/world/CustomLevelSource.cpp @@ -12,7 +12,7 @@ const double CustomLevelSource::SNOW_SCALE = 0.3; const double CustomLevelSource::SNOW_CUTOFF = 0.5; -CustomLevelSource::CustomLevelSource(Level *level, __int64 seed, bool generateStructures) : generateStructures( generateStructures ) +CustomLevelSource::CustomLevelSource(Level *level, int64_t seed, bool generateStructures) : generateStructures( generateStructures ) { #ifdef _OVERRIDE_HEIGHTMAP m_XZSize = level->getLevelData()->getXZSize(); @@ -29,11 +29,11 @@ CustomLevelSource::CustomLevelSource(Level *level, __int64 seed, bool generateSt string path = "GAME:\\GameRules\\heightmap.bin"; #endif #endif - HANDLE file = CreateFile(path.c_str(), GENERIC_READ, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); + void* file = CreateFile(path.c_str(), GENERIC_READ, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); if( file == INVALID_HANDLE_VALUE ) { app.FatalLoadError(); - DWORD error = GetLastError(); + unsigned long error = GetLastError(); assert(false); } else @@ -41,16 +41,16 @@ CustomLevelSource::CustomLevelSource(Level *level, __int64 seed, bool generateSt #ifdef _DURANGO __debugbreak(); // TODO - DWORD bytesRead,dwFileSize = 0; + unsigned long bytesRead,dwFileSize = 0; #else - DWORD bytesRead,dwFileSize = GetFileSize(file,NULL); + unsigned long bytesRead,dwFileSize = GetFileSize(file,NULL); #endif if(dwFileSize > m_heightmapOverride.length) { app.DebugPrintf("Heightmap binary is too large!!\n"); __debugbreak(); } - BOOL bSuccess = ReadFile(file,m_heightmapOverride.data,dwFileSize,&bytesRead,NULL); + bool bSuccess = ReadFile(file,m_heightmapOverride.data,dwFileSize,&bytesRead,NULL); if(bSuccess==false) { @@ -74,7 +74,7 @@ CustomLevelSource::CustomLevelSource(Level *level, __int64 seed, bool generateSt file = CreateFile(waterHeightPath.c_str(), GENERIC_READ, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); if( file == INVALID_HANDLE_VALUE ) { - DWORD error = GetLastError(); + unsigned long error = GetLastError(); //assert(false); memset(m_waterheightOverride.data, level->seaLevel, m_waterheightOverride.length); } @@ -83,16 +83,16 @@ CustomLevelSource::CustomLevelSource(Level *level, __int64 seed, bool generateSt #ifdef _DURANGO __debugbreak(); // TODO - DWORD bytesRead,dwFileSize = 0; + unsigned long bytesRead,dwFileSize = 0; #else - DWORD bytesRead,dwFileSize = GetFileSize(file,NULL); + unsigned long bytesRead,dwFileSize = GetFileSize(file,NULL); #endif if(dwFileSize > m_waterheightOverride.length) { app.DebugPrintf("waterheight binary is too large!!\n"); __debugbreak(); } - BOOL bSuccess = ReadFile(file,m_waterheightOverride.data,dwFileSize,&bytesRead,NULL); + bool bSuccess = ReadFile(file,m_waterheightOverride.data,dwFileSize,&bytesRead,NULL); if(bSuccess==false) { @@ -504,8 +504,8 @@ void CustomLevelSource::postProcess(ChunkSource *parent, int xt, int zt) } pprandom->setSeed(level->getSeed()); - __int64 xScale = pprandom->nextLong() / 2 * 2 + 1; - __int64 zScale = pprandom->nextLong() / 2 * 2 + 1; + int64_t xScale = pprandom->nextLong() / 2 * 2 + 1; + int64_t zScale = pprandom->nextLong() / 2 * 2 + 1; pprandom->setSeed(((xt * xScale) + (zt * zScale)) ^ level->getSeed()); bool hasVillage = false; diff --git a/src/world/CustomLevelSource.h b/src/world/CustomLevelSource.h index af01a478..84dee836 100644 --- a/src/world/CustomLevelSource.h +++ b/src/world/CustomLevelSource.h @@ -44,7 +44,7 @@ private: const bool generateStructures; public: - CustomLevelSource(Level *level, __int64 seed, bool generateStructures); + CustomLevelSource(Level *level, int64_t seed, bool generateStructures); ~CustomLevelSource(); public: diff --git a/src/world/DataInput.h b/src/world/DataInput.h index 258b2717..f61eceb5 100644 --- a/src/world/DataInput.h +++ b/src/world/DataInput.h @@ -13,7 +13,7 @@ public: virtual double readDouble() = 0; virtual float readFloat() = 0; virtual int readInt() = 0; - virtual __int64 readLong() = 0; + virtual int64_t readLong() = 0; virtual short readShort() = 0; virtual wchar_t readChar() = 0; virtual wstring readUTF() = 0; diff --git a/src/world/DataInputStream.cpp b/src/world/DataInputStream.cpp index 2291bf48..172b225e 100644 --- a/src/world/DataInputStream.cpp +++ b/src/world/DataInputStream.cpp @@ -170,7 +170,7 @@ bool DataInputStream::readFully(charArray b) //the double value read. double DataInputStream::readDouble() { - __int64 bits = readLong(); + int64_t bits = readLong(); return Double::longBitsToDouble( bits ); } @@ -221,18 +221,18 @@ int DataInputStream::readInt() // //Returns: //the long value read. -__int64 DataInputStream::readLong() +int64_t DataInputStream::readLong() { - __int64 a = stream->read(); - __int64 b = stream->read(); - __int64 c = stream->read(); - __int64 d = stream->read(); - __int64 e = stream->read(); - __int64 f = stream->read(); - __int64 g = stream->read(); - __int64 h = stream->read(); + int64_t a = stream->read(); + int64_t b = stream->read(); + int64_t c = stream->read(); + int64_t d = stream->read(); + int64_t e = stream->read(); + int64_t f = stream->read(); + int64_t g = stream->read(); + int64_t h = stream->read(); - __int64 bits = (((a & 0xff) << 56) | + int64_t bits = (((a & 0xff) << 56) | ((b & 0xff) << 48) | ((c & 0xff) << 40) | ((d & 0xff) << 32) | @@ -535,7 +535,7 @@ void DataInputStream::deleteChildStream() //n - the number of bytes to be skipped. //Returns: //the actual number of bytes skipped. -__int64 DataInputStream::skip(__int64 n) +int64_t DataInputStream::skip(int64_t n) { return stream->skip(n); } diff --git a/src/world/DataInputStream.h b/src/world/DataInputStream.h index f69d490a..043ab745 100644 --- a/src/world/DataInputStream.h +++ b/src/world/DataInputStream.h @@ -24,12 +24,12 @@ public: virtual double readDouble(); virtual float readFloat(); virtual int readInt(); - virtual __int64 readLong(); + virtual int64_t readLong(); virtual short readShort(); virtual wstring readUTF(); void deleteChildStream(); virtual int readUTFChar(); virtual PlayerUID readPlayerUID(); // 4J Added - virtual __int64 skip(__int64 n); + virtual int64_t skip(int64_t n); virtual int skipBytes(int n); }; \ No newline at end of file diff --git a/src/world/DataOutput.h b/src/world/DataOutput.h index 648be6df..7ebf96da 100644 --- a/src/world/DataOutput.h +++ b/src/world/DataOutput.h @@ -10,7 +10,7 @@ public: virtual void writeDouble(double a) = 0; virtual void writeFloat(float a) = 0; virtual void writeInt(int a) = 0; - virtual void writeLong(__int64 a) = 0; + virtual void writeLong(int64_t a) = 0; virtual void writeShort(short a) = 0; virtual void writeBoolean(bool v) = 0; virtual void writeChar(wchar_t v) = 0; diff --git a/src/world/DataOutputStream.cpp b/src/world/DataOutputStream.cpp index 8e277c23..4c1da618 100644 --- a/src/world/DataOutputStream.cpp +++ b/src/world/DataOutputStream.cpp @@ -78,7 +78,7 @@ void DataOutputStream::writeByte(byte a) //v - a double value to be written. void DataOutputStream::writeDouble(double a) { - __int64 bits = Double::doubleToLongBits( a ); + int64_t bits = Double::doubleToLongBits( a ); writeLong( bits ); // TODO 4J Stu - Error handling? @@ -116,7 +116,7 @@ void DataOutputStream::writeInt(int a) //In no exception is thrown, the counter written is incremented by 8. //Parameters: //v - a long to be written. -void DataOutputStream::writeLong(__int64 a) +void DataOutputStream::writeLong(int64_t a) { stream->write( (a >> 56) & 0xff ); stream->write( (a >> 48) & 0xff ); diff --git a/src/world/DataOutputStream.h b/src/world/DataOutputStream.h index 01be8309..9cc3c7a9 100644 --- a/src/world/DataOutputStream.h +++ b/src/world/DataOutputStream.h @@ -26,7 +26,7 @@ public: virtual void writeDouble(double a); virtual void writeFloat(float a); virtual void writeInt(int a); - virtual void writeLong(__int64 a); + virtual void writeLong(int64_t a); virtual void writeShort(short a); virtual void writeChar(wchar_t a); virtual void writeChars(const wstring& a); diff --git a/src/world/DerivedLevelData.cpp b/src/world/DerivedLevelData.cpp index 71c4d87b..da3d048d 100644 --- a/src/world/DerivedLevelData.cpp +++ b/src/world/DerivedLevelData.cpp @@ -22,7 +22,7 @@ CompoundTag *DerivedLevelData::createTag(vector > *players) return wrapped->createTag(players); } -__int64 DerivedLevelData::getSeed() +int64_t DerivedLevelData::getSeed() { return wrapped->getSeed(); } @@ -43,12 +43,12 @@ int DerivedLevelData::getZSpawn() return wrapped->getZSpawn(); } -__int64 DerivedLevelData::getTime() +int64_t DerivedLevelData::getTime() { return wrapped->getTime(); } -__int64 DerivedLevelData::getSizeOnDisk() +int64_t DerivedLevelData::getSizeOnDisk() { return wrapped->getSizeOnDisk(); } @@ -68,7 +68,7 @@ int DerivedLevelData::getVersion() return wrapped->getVersion(); } -__int64 DerivedLevelData::getLastPlayed() +int64_t DerivedLevelData::getLastPlayed() { return wrapped->getLastPlayed(); } @@ -98,7 +98,7 @@ GameType *DerivedLevelData::getGameType() return wrapped->getGameType(); } -void DerivedLevelData::setSeed(__int64 seed) +void DerivedLevelData::setSeed(int64_t seed) { } @@ -114,11 +114,11 @@ void DerivedLevelData::setZSpawn(int zSpawn) { } -void DerivedLevelData::setTime(__int64 time) +void DerivedLevelData::setTime(int64_t time) { } -void DerivedLevelData::setSizeOnDisk(__int64 sizeOnDisk) +void DerivedLevelData::setSizeOnDisk(int64_t sizeOnDisk) { } diff --git a/src/world/DerivedLevelData.h b/src/world/DerivedLevelData.h index a39f7d04..db5a72d2 100644 --- a/src/world/DerivedLevelData.h +++ b/src/world/DerivedLevelData.h @@ -16,27 +16,27 @@ protected: public: CompoundTag *createTag(); CompoundTag *createTag(vector > *players); - __int64 getSeed(); + int64_t getSeed(); int getXSpawn(); int getYSpawn(); int getZSpawn(); - __int64 getTime(); - __int64 getSizeOnDisk(); + int64_t getTime(); + int64_t getSizeOnDisk(); CompoundTag *getLoadedPlayerTag(); wstring getLevelName(); int getVersion(); - __int64 getLastPlayed(); + int64_t getLastPlayed(); bool isThundering(); int getThunderTime(); bool isRaining(); int getRainTime(); GameType *getGameType(); - void setSeed(__int64 seed); + void setSeed(int64_t seed); void setXSpawn(int xSpawn); void setYSpawn(int ySpawn); void setZSpawn(int zSpawn); - void setTime(__int64 time); - void setSizeOnDisk(__int64 sizeOnDisk); + void setTime(int64_t time); + void setSizeOnDisk(int64_t sizeOnDisk); void setLoadedPlayerTag(CompoundTag *loadedPlayerTag); void setDimension(int dimension); void setSpawn(int xSpawn, int ySpawn, int zSpawn); diff --git a/src/world/DesertBiome.cpp b/src/world/DesertBiome.cpp index 6928861e..4e545bf6 100644 --- a/src/world/DesertBiome.cpp +++ b/src/world/DesertBiome.cpp @@ -10,8 +10,8 @@ DesertBiome::DesertBiome(int id) : Biome(id) friendlies.clear(); friendlies_chicken.clear(); // 4J added friendlies_wolf.clear(); // 4J added - this->topMaterial = (BYTE) Tile::sand_Id; - this->material = (BYTE) Tile::sand_Id; + this->topMaterial = (uint8_t) Tile::sand_Id; + this->material = (uint8_t) Tile::sand_Id; decorator->treeCount = -999; decorator->deadBushCount = 2; diff --git a/src/world/Dimension.cpp b/src/world/Dimension.cpp index 3eb4b335..e2aaed63 100644 --- a/src/world/Dimension.cpp +++ b/src/world/Dimension.cpp @@ -106,7 +106,7 @@ bool Dimension::isValidSpawn(int x, int z) const return true; } -float Dimension::getTimeOfDay(__int64 time, float a) const +float Dimension::getTimeOfDay(int64_t time, float a) const { int dayStep = (int) (time % Level::TICKS_PER_DAY); float td = (dayStep + a) / Level::TICKS_PER_DAY - 0.25f; @@ -118,7 +118,7 @@ float Dimension::getTimeOfDay(__int64 time, float a) const return td; } -int Dimension::getMoonPhase(__int64 time, float a) const +int Dimension::getMoonPhase(int64_t time, float a) const { return ((int) (time / Level::TICKS_PER_DAY)) % 8; } diff --git a/src/world/Dimension.h b/src/world/Dimension.h index 36df385e..d4490284 100644 --- a/src/world/Dimension.h +++ b/src/world/Dimension.h @@ -35,8 +35,8 @@ public: virtual bool isValidSpawn(int x, int z) const; - virtual float getTimeOfDay(__int64 time, float a) const; - virtual int getMoonPhase(__int64 time, float a) const; + virtual float getTimeOfDay(int64_t time, float a) const; + virtual int getMoonPhase(int64_t time, float a) const; virtual bool isNaturalDimension(); private: static const int fogColor = 0xc0d8ff; diff --git a/src/world/DirectoryLevelStorage.cpp b/src/world/DirectoryLevelStorage.cpp index 27514c9b..95b2e4bd 100644 --- a/src/world/DirectoryLevelStorage.cpp +++ b/src/world/DirectoryLevelStorage.cpp @@ -108,19 +108,19 @@ void _MapDataMappings_old::setMapping(int id, PlayerUID xuid, int dimension) #ifdef _LARGE_WORLDS void DirectoryLevelStorage::PlayerMappings::addMapping(int id, int centreX, int centreZ, int dimension, int scale) { - __int64 index = ( ((__int64)(centreZ & 0x1FFFFFFF)) << 34) | ( ((__int64)(centreX & 0x1FFFFFFF)) << 5) | ( (scale & 0x7) << 2) | (dimension & 0x3); + int64_t index = ( ((int64_t)(centreZ & 0x1FFFFFFF)) << 34) | ( ((int64_t)(centreX & 0x1FFFFFFF)) << 5) | ( (scale & 0x7) << 2) | (dimension & 0x3); m_mappings[index] = id; //app.DebugPrintf("Adding mapping: %d - (%d,%d)/%d/%d [%I64d - 0x%016llx]\n", id, centreX, centreZ, dimension, scale, index, index); } bool DirectoryLevelStorage::PlayerMappings::getMapping(int &id, int centreX, int centreZ, int dimension, int scale) { - //__int64 zMasked = centreZ & 0x1FFFFFFF; - //__int64 xMasked = centreX & 0x1FFFFFFF; - //__int64 zShifted = zMasked << 34; - //__int64 xShifted = xMasked << 5; + //int64_t zMasked = centreZ & 0x1FFFFFFF; + //int64_t xMasked = centreX & 0x1FFFFFFF; + //int64_t zShifted = zMasked << 34; + //int64_t xShifted = xMasked << 5; //app.DebugPrintf("xShifted = %d (0x%016x), zShifted = %I64d (0x%016llx)\n", xShifted, xShifted, zShifted, zShifted); - __int64 index = ( ((__int64)(centreZ & 0x1FFFFFFF)) << 34) | ( ((__int64)(centreX & 0x1FFFFFFF)) << 5) | ( (scale & 0x7) << 2) | (dimension & 0x3); + int64_t index = ( ((int64_t)(centreZ & 0x1FFFFFFF)) << 34) | ( ((int64_t)(centreX & 0x1FFFFFFF)) << 5) | ( (scale & 0x7) << 2) | (dimension & 0x3); AUTO_VAR(it,m_mappings.find(index)); if(it != m_mappings.end()) { @@ -151,7 +151,7 @@ void DirectoryLevelStorage::PlayerMappings::readMappings(DataInputStream *dis) int count = dis->readInt(); for(unsigned int i = 0; i < count; ++i) { - __int64 index = dis->readLong(); + int64_t index = dis->readLong(); int id = dis->readInt(); m_mappings[index] = id; app.DebugPrintf(" -- %lld (0x%016llx) = %d\n", index, index, id); @@ -243,7 +243,7 @@ LevelData *DirectoryLevelStorage::prepareLevel() #endif if (!m_bHasLoadedMapDataMappings && !mapFile.getName().empty() && getSaveFile()->doesFileExist( mapFile )) { - DWORD NumberOfBytesRead; + unsigned long NumberOfBytesRead; FileEntry *fileEntry = getSaveFile()->createFile(mapFile); #ifdef __PS3__ @@ -677,7 +677,7 @@ void DirectoryLevelStorage::saveMapIdLookup() if (!file.getName().empty()) { - DWORD NumberOfBytesWritten; + unsigned long NumberOfBytesWritten; FileEntry *fileEntry = m_saveFile->createFile(file); m_saveFile->setFilePointer(fileEntry,0,NULL, FILE_BEGIN); diff --git a/src/world/DirectoryLevelStorage.h b/src/world/DirectoryLevelStorage.h index 820ef31f..396619ff 100644 --- a/src/world/DirectoryLevelStorage.h +++ b/src/world/DirectoryLevelStorage.h @@ -65,7 +65,7 @@ private: const ConsoleSavePath playerDir; //const File dataDir; const ConsoleSavePath dataDir; - const __int64 sessionId; + const int64_t sessionId; const wstring levelId; static const wstring sc_szPlayerDir; @@ -75,7 +75,7 @@ private: { friend class DirectoryLevelStorage; private: - unordered_map<__int64, short> m_mappings; + unordered_map m_mappings; public: void addMapping(int id, int centreX, int centreZ, int dimension, int scale); diff --git a/src/world/DurangoStats.cpp b/src/world/DurangoStats.cpp index 68dc9986..1b1fc8d2 100644 --- a/src/world/DurangoStats.cpp +++ b/src/world/DurangoStats.cpp @@ -1109,17 +1109,17 @@ void DurangoStats::setMultiplayerCorrelationId(Platform::String^ mcpId) ((DurangoStats*)GenericStats::getInstance())->multiplayerCorrelationId = mcpId; } -LPCWSTR DurangoStats::getMultiplayerCorrelationId() +const wchar_t* DurangoStats::getMultiplayerCorrelationId() { return ((DurangoStats*)GenericStats::getInstance())->multiplayerCorrelationId->Data(); } -LPCWSTR DurangoStats::getUserId(shared_ptr player) +const wchar_t* DurangoStats::getUserId(shared_ptr player) { return getUserId(player->GetXboxPad()); } -LPCWSTR DurangoStats::getUserId(int iPad) +const wchar_t* DurangoStats::getUserId(int iPad) { static wstring cache = L""; PlayerUID uid = INVALID_XUID; diff --git a/src/world/DurangoStats.h b/src/world/DurangoStats.h index 1b2f7723..cfeb2a8e 100644 --- a/src/world/DurangoStats.h +++ b/src/world/DurangoStats.h @@ -298,10 +298,10 @@ public: static LPCGUID getPlayerSession(); static void setMultiplayerCorrelationId(Platform::String^ mpcId); - static LPCWSTR getMultiplayerCorrelationId(); + static const wchar_t* getMultiplayerCorrelationId(); - static LPCWSTR getUserId(shared_ptr plr); - static LPCWSTR getUserId(int iPad); + static const wchar_t* getUserId(shared_ptr plr); + static const wchar_t* getUserId(int iPad); static void playerSessionStart(PlayerUID,shared_ptr); static void playerSessionStart(int iPad); diff --git a/src/world/EmptyLevelChunk.cpp b/src/world/EmptyLevelChunk.cpp index 80460b10..4934ac96 100644 --- a/src/world/EmptyLevelChunk.cpp +++ b/src/world/EmptyLevelChunk.cpp @@ -210,7 +210,7 @@ bool EmptyLevelChunk::testSetBlocksAndData(byteArray data, int x0, int y0, int z return false; } -Random *EmptyLevelChunk::getRandom(__int64 l) +Random *EmptyLevelChunk::getRandom(int64_t l) { return new Random((level->getSeed() + x * x * 4987142 + x * 5947611 + z * z * 4392871l + z * 389711) ^ l); } diff --git a/src/world/EmptyLevelChunk.h b/src/world/EmptyLevelChunk.h index 02ffc176..a8ff27f9 100644 --- a/src/world/EmptyLevelChunk.h +++ b/src/world/EmptyLevelChunk.h @@ -48,7 +48,7 @@ public: int getBlocksAndData(byteArray data, int x0, int y0, int z0, int x1, int y1, int z1, int p, bool includeLighting = true); // 4J - added includeLighting parameter int setBlocksAndData(byteArray data, int x0, int y0, int z0, int x1, int y1, int z1, int p, bool includeLighting = true); // 4J - added includeLighting parameter bool testSetBlocksAndData(byteArray data, int x0, int y0, int z0, int x1, int y1, int z1, int p); // 4J added - Random *getRandom(__int64 l); + Random *getRandom(int64_t l); bool isEmpty(); virtual void reSyncLighting() {}; // 4J added }; diff --git a/src/world/EnchantmentMenu.h b/src/world/EnchantmentMenu.h index e09b94c6..62408f1d 100644 --- a/src/world/EnchantmentMenu.h +++ b/src/world/EnchantmentMenu.h @@ -23,7 +23,7 @@ private: bool m_costsChanged; // 4J Added public: - __int64 nameSeed; + int64_t nameSeed; public: int costs[3]; diff --git a/src/world/Entity.cpp b/src/world/Entity.cpp index e183d78f..6a6373c1 100644 --- a/src/world/Entity.cpp +++ b/src/world/Entity.cpp @@ -24,7 +24,7 @@ int Entity::entityCounter = 2048; // 4J - changed initialiser to 2048, as we are using range 0 - 2047 as special unique smaller ids for things that need network tracked -DWORD Entity::tlsIdx = TlsAlloc(); +unsigned long Entity::tlsIdx = TlsAlloc(); // 4J - added getSmallId & freeSmallId methods unsigned int Entity::entityIdUsedFlags[2048/32] = {0}; @@ -146,7 +146,7 @@ void Entity::freeSmallId(int index) void Entity::useSmallIds() { - TlsSetValue(tlsIdx,(LPVOID)1); + TlsSetValue(tlsIdx,(void*)1); } // Things also added here to be able to manage the concept of a number of extra "wandering" entities - normally path finding entities aren't allowed to diff --git a/src/world/Entity.h b/src/world/Entity.h index bde83e30..72f78e56 100644 --- a/src/world/Entity.h +++ b/src/world/Entity.h @@ -365,7 +365,7 @@ private: static int extraWanderIds[EXTRA_WANDER_MAX]; static int extraWanderCount; static int extraWanderTicks; - static DWORD tlsIdx; + static unsigned long tlsIdx; public: static void tickExtraWandering(); static void countFlagsForPIX(); diff --git a/src/world/EntityEvent.h b/src/world/EntityEvent.h index 4d2064ab..d99bd582 100644 --- a/src/world/EntityEvent.h +++ b/src/world/EntityEvent.h @@ -3,27 +3,27 @@ class EntityEvent { public: - static const BYTE JUMP = 1; - static const BYTE HURT = 2; - static const BYTE DEATH = 3; - static const BYTE START_ATTACKING = 4; - static const BYTE STOP_ATTACKING = 5; + static const uint8_t JUMP = 1; + static const uint8_t HURT = 2; + static const uint8_t DEATH = 3; + static const uint8_t START_ATTACKING = 4; + static const uint8_t STOP_ATTACKING = 5; - static const BYTE TAMING_FAILED = 6; - static const BYTE TAMING_SUCCEEDED = 7; - static const BYTE SHAKE_WETNESS = 8; + static const uint8_t TAMING_FAILED = 6; + static const uint8_t TAMING_SUCCEEDED = 7; + static const uint8_t SHAKE_WETNESS = 8; - static const BYTE USE_ITEM_COMPLETE = 9; + static const uint8_t USE_ITEM_COMPLETE = 9; - static const BYTE EAT_GRASS = 10; - static const BYTE OFFER_FLOWER = 11; - static const BYTE LOVE_HEARTS = 12; - static const BYTE VILLAGER_ANGRY = 13; - static const BYTE VILLAGER_HAPPY = 14; - static const BYTE WITCH_HAT_MAGIC = 15; - static const BYTE ZOMBIE_CONVERTING = 16; + static const uint8_t EAT_GRASS = 10; + static const uint8_t OFFER_FLOWER = 11; + static const uint8_t LOVE_HEARTS = 12; + static const uint8_t VILLAGER_ANGRY = 13; + static const uint8_t VILLAGER_HAPPY = 14; + static const uint8_t WITCH_HAT_MAGIC = 15; + static const uint8_t ZOMBIE_CONVERTING = 16; - static const BYTE FIREWORKS_EXPLODE = 17; + static const uint8_t FIREWORKS_EXPLODE = 17; - static const BYTE IN_LOVE_HEARTS = 18; + static const uint8_t IN_LOVE_HEARTS = 18; }; \ No newline at end of file diff --git a/src/world/File.cpp b/src/world/File.cpp index ae0cf96c..f16b80c0 100644 --- a/src/world/File.cpp +++ b/src/world/File.cpp @@ -98,13 +98,13 @@ this->parent = NULL; bool File::_delete() { #ifdef _UNICODE - BOOL result = DeleteFile( getPath().c_str() ); + bool result = DeleteFile( getPath().c_str() ); #else - BOOL result = DeleteFile( wstringtofilename(getPath()) ); + bool result = DeleteFile( wstringtofilename(getPath()) ); #endif if( result == 0 ) { - DWORD error = GetLastError(); + unsigned long error = GetLastError(); #ifndef _CONTENT_PACKAGE printf( "File::_delete - Error code %d (%#0.8X)\n", error, error ); #endif @@ -168,7 +168,7 @@ bool File::mkdirs() const #ifdef _UNICODE if( GetFileAttributes( pathToHere.c_str() ) == -1 ) { - DWORD result = CreateDirectory( pathToHere.c_str(), NULL); + unsigned long result = CreateDirectory( pathToHere.c_str(), NULL); if( result == 0 ) { // Failed to create @@ -178,7 +178,7 @@ bool File::mkdirs() const #else if( GetFileAttributes( wstringtofilename(pathToHere) ) == -1 ) { - DWORD result = CreateDirectory( wstringtofilename(pathToHere), NULL); + unsigned long result = CreateDirectory( wstringtofilename(pathToHere), NULL); if( result == 0 ) { // Failed to create @@ -241,14 +241,14 @@ bool File::renameTo(File dest) const char *destPath = wstringtofilename(dest.getPath()); #ifdef _DURANGO __debugbreak(); // TODO - BOOL result = false; + bool result = false; #else - BOOL result = MoveFile(sourcePath.c_str(), destPath); + bool result = MoveFile(sourcePath.c_str(), destPath); #endif if( result == 0 ) { - DWORD error = GetLastError(); + unsigned long error = GetLastError(); #ifndef _CONTENT_PACKAGE printf( "File::renameTo - Error code %d (%#0.8X)\n", error, error ); #endif @@ -371,9 +371,9 @@ vector *File::listFiles() const WIN32_FIND_DATA wfd; #ifdef _UNICODE - WCHAR path[MAX_PATH]; + wchar_t path[MAX_PATH]; swprintf( path, L"%ls\\*", getPath().c_str() ); - HANDLE hFind = FindFirstFile( path, &wfd); + void* hFind = FindFirstFile( path, &wfd); if(hFind != INVALID_HANDLE_VALUE) { int count = 0; @@ -388,7 +388,7 @@ vector *File::listFiles() const #else char path[MAX_PATH]; sprintf( path, "%s\\*", wstringtofilename( getPath() ) ); - HANDLE hFind = FindFirstFile( path, &wfd); + void* hFind = FindFirstFile( path, &wfd); if(hFind != INVALID_HANDLE_VALUE) { //int count = 0; @@ -460,12 +460,12 @@ vector *File::listFiles(FileFilter *filter) const #ifdef _UNICODE - WCHAR path[MAX_PATH]; + wchar_t path[MAX_PATH]; WIN32_FIND_DATA wfd; - DWORD dwAttr = FILE_ATTRIBUTE_DIRECTORY; + unsigned long dwAttr = FILE_ATTRIBUTE_DIRECTORY; swprintf( path, L"%ls\\*", getPath().c_str() ); - HANDLE hFind = FindFirstFile( path, &wfd); + void* hFind = FindFirstFile( path, &wfd); if(hFind != INVALID_HANDLE_VALUE) { int count = 0; @@ -483,10 +483,10 @@ vector *File::listFiles(FileFilter *filter) const #else char path[MAX_PATH]; WIN32_FIND_DATA wfd; - //DWORD dwAttr = FILE_ATTRIBUTE_DIRECTORY; + //unsigned long dwAttr = FILE_ATTRIBUTE_DIRECTORY; sprintf( path, "%s\\*", wstringtofilename( getPath() ) ); - HANDLE hFind = FindFirstFile( path, &wfd); + void* hFind = FindFirstFile( path, &wfd); if(hFind != INVALID_HANDLE_VALUE) { //int count = 0; @@ -521,7 +521,7 @@ bool File::isDirectory() const //Returns the length of the file denoted by this abstract pathname. The return value is unspecified if this pathname denotes a directory. //Returns: //The length, in bytes, of the file denoted by this abstract pathname, or 0L if the file does not exist -__int64 File::length() +int64_t File::length() { #ifdef __PS3__ //extern const char* getPS3HomePath(); @@ -590,13 +590,13 @@ __int64 File::length() WIN32_FILE_ATTRIBUTE_DATA fileInfoBuffer; #ifdef _UNICODE - BOOL result = GetFileAttributesEx( + bool result = GetFileAttributesEx( getPath().c_str(), // file or directory name GetFileExInfoStandard, // attribute &fileInfoBuffer // attribute information ); #else - BOOL result = GetFileAttributesEx( + bool result = GetFileAttributesEx( wstringtofilename(getPath()), // file or directory name GetFileExInfoStandard, // attribute &fileInfoBuffer // attribute information @@ -624,17 +624,17 @@ __int64 File::length() //Returns: //A long value representing the time the file was last modified, measured in milliseconds since the epoch (00:00:00 GMT, January 1, 1970), //or 0L if the file does not exist or if an I/O error occurs -__int64 File::lastModified() +int64_t File::lastModified() { WIN32_FILE_ATTRIBUTE_DATA fileInfoBuffer; #ifdef _UNICODE - BOOL result = GetFileAttributesEx( + bool result = GetFileAttributesEx( getPath().c_str(), // file or directory name GetFileExInfoStandard, // attribute &fileInfoBuffer // attribute information ); #else - BOOL result = GetFileAttributesEx( + bool result = GetFileAttributesEx( wstringtofilename(getPath()), // file or directory name GetFileExInfoStandard, // attribute &fileInfoBuffer // attribute information diff --git a/src/world/File.h b/src/world/File.h index 0b710cd4..c9bb821f 100644 --- a/src/world/File.h +++ b/src/world/File.h @@ -27,8 +27,8 @@ public: vector *listFiles() const; // Array vector *listFiles(FileFilter *filter) const; bool isDirectory() const; - __int64 length(); - __int64 lastModified(); + int64_t length(); + int64_t lastModified(); const wstring getPath() const; // 4J Jev: TODO wstring getName() const; diff --git a/src/world/FileHeader.cpp b/src/world/FileHeader.cpp index 59e97d9b..1becf6e5 100644 --- a/src/world/FileHeader.cpp +++ b/src/world/FileHeader.cpp @@ -67,14 +67,14 @@ void FileHeader::RemoveFile( FileEntry *file ) delete file; } -void FileHeader::WriteHeader( LPVOID saveMem ) +void FileHeader::WriteHeader( void* saveMem ) { unsigned int headerOffset = GetStartOfNextData(); // 4J Changed for save version 2 to be the number of files rather than the size in bytes unsigned int headerSize = (int)(fileTable.size()); - //DWORD numberOfBytesWritten = 0; + //unsigned long numberOfBytesWritten = 0; // Write the offset of the header //assert(numberOfBytesWritten == 4); @@ -135,7 +135,7 @@ void FileHeader::WriteHeader( LPVOID saveMem ) } } -void FileHeader::ReadHeader( LPVOID saveMem, ESavePlatform plat /*= SAVE_FILE_PLATFORM_LOCAL */ ) +void FileHeader::ReadHeader( void* saveMem, ESavePlatform plat /*= SAVE_FILE_PLATFORM_LOCAL */ ) { unsigned int headerOffset; unsigned int headerSize; @@ -323,7 +323,7 @@ unsigned int FileHeader::GetFileSize() return GetStartOfNextData() + ( sizeof(FileEntrySaveData) * (unsigned int)fileTable.size() ); } -void FileHeader::AdjustStartOffsets(FileEntry *file, DWORD nNumberOfBytesToWrite, bool subtract /*= false*/) +void FileHeader::AdjustStartOffsets(FileEntry *file, unsigned long nNumberOfBytesToWrite, bool subtract /*= false*/) { bool found = false; for( unsigned int i = 0; i < fileTable.size(); ++i ) diff --git a/src/world/FileHeader.h b/src/world/FileHeader.h index 203ec322..dcb20cb6 100644 --- a/src/world/FileHeader.h +++ b/src/world/FileHeader.h @@ -51,6 +51,7 @@ enum ESavePlatform SAVE_FILE_PLATFORM_PS4 = MAKE_FOURCC('P', 'S', '4', '_') , SAVE_FILE_PLATFORM_PSVITA = MAKE_FOURCC('P', 'S', 'V', '_') , SAVE_FILE_PLATFORM_WIN64 = MAKE_FOURCC('W', 'I', 'N', '_') , + SAVE_FILE_PLATFORM_UNIVERSAL= MAKE_FOURCC('U','N','V','_'), #if defined _XBOX SAVE_FILE_PLATFORM_LOCAL = SAVE_FILE_PLATFORM_X360 @@ -64,6 +65,8 @@ enum ESavePlatform SAVE_FILE_PLATFORM_LOCAL = SAVE_FILE_PLATFORM_PSVITA #elif defined _WINDOWS64 SAVE_FILE_PLATFORM_LOCAL = SAVE_FILE_PLATFORM_WIN64 +#else + SAVE_FILE_PLATFORM_LOCAL = SAVE_FILE_PLATFORM_UNIVERSAL #endif }; #define SAVE_FILE_VERSION_NUMBER (SAVE_FILE_VERSION_NEXT - 1) @@ -96,7 +99,7 @@ public: }; - __int64 lastModifiedTime; // 8B + int64_t lastModifiedTime; // 8B }; typedef FileEntrySaveDataV2 FileEntrySaveData; @@ -163,14 +166,14 @@ public: protected: FileEntry *AddFile( const wstring &name, unsigned int length = 0 ); void RemoveFile( FileEntry * ); - void WriteHeader( LPVOID saveMem ); - void ReadHeader( LPVOID saveMem, ESavePlatform plat = SAVE_FILE_PLATFORM_LOCAL ); + void WriteHeader( void* saveMem ); + void ReadHeader( void* saveMem, ESavePlatform plat = SAVE_FILE_PLATFORM_LOCAL ); unsigned int GetStartOfNextData(); unsigned int GetFileSize(); - void AdjustStartOffsets(FileEntry *file, DWORD nNumberOfBytesToWrite, bool subtract = false); + void AdjustStartOffsets(FileEntry *file, unsigned long nNumberOfBytesToWrite, bool subtract = false); bool fileExists( const wstring &name ); diff --git a/src/world/FileInputStream.cpp b/src/world/FileInputStream.cpp index 751d8cb4..2d8eda6e 100644 --- a/src/world/FileInputStream.cpp +++ b/src/world/FileInputStream.cpp @@ -61,9 +61,9 @@ FileInputStream::~FileInputStream() int FileInputStream::read() { byte byteRead = 0; - DWORD numberOfBytesRead; + unsigned long numberOfBytesRead; - BOOL bSuccess = ReadFile( + bool bSuccess = ReadFile( m_fileHandle, // handle to file &byteRead, // data buffer 1, // number of bytes to read @@ -93,9 +93,9 @@ int FileInputStream::read() //the total number of bytes read into the buffer, or -1 if there is no more data because the end of the file has been reached. int FileInputStream::read(byteArray b) { - DWORD numberOfBytesRead; + unsigned long numberOfBytesRead; - BOOL bSuccess = ReadFile( + bool bSuccess = ReadFile( m_fileHandle, // handle to file b.data, // data buffer b.length, // number of bytes to read @@ -131,9 +131,9 @@ int FileInputStream::read(byteArray b, unsigned int offset, unsigned int length) // 4J Stu - We don't want to read any more than the array buffer can hold assert( length <= ( b.length - offset ) ); - DWORD numberOfBytesRead; + unsigned long numberOfBytesRead; - BOOL bSuccess = ReadFile( + bool bSuccess = ReadFile( m_fileHandle, // handle to file &b[offset], // data buffer length, // number of bytes to read @@ -162,11 +162,11 @@ void FileInputStream::close() { if(m_fileHandle==INVALID_HANDLE_VALUE) { - //printf("\n\nFileInputStream::close - TRYING TO CLOSE AN INVALID FILE HANDLE\n\n"); + //printf("\n\nFileInputStream::close - TRYING TO CLOSE AN INVALID FILE void*\n\n"); return; } - BOOL result = CloseHandle( m_fileHandle ); + bool result = CloseHandle( m_fileHandle ); if( result == 0 ) { @@ -185,7 +185,7 @@ void FileInputStream::close() //n - the number of bytes to be skipped. //Returns: //the actual number of bytes skipped. -__int64 FileInputStream::skip(__int64 n) +int64_t FileInputStream::skip(int64_t n) { #ifdef _XBOX LARGE_INTEGER li; diff --git a/src/world/FileInputStream.h b/src/world/FileInputStream.h index e855a2d7..a292883a 100644 --- a/src/world/FileInputStream.h +++ b/src/world/FileInputStream.h @@ -12,9 +12,9 @@ public: virtual int read(byteArray b); virtual int read(byteArray b, unsigned int offset, unsigned int length); virtual void close(); - virtual __int64 skip(__int64 n); + virtual int64_t skip(int64_t n); private: - HANDLE m_fileHandle; + void* m_fileHandle; }; \ No newline at end of file diff --git a/src/world/FileOutputStream.cpp b/src/world/FileOutputStream.cpp index 557ba812..a4bc5966 100644 --- a/src/world/FileOutputStream.cpp +++ b/src/world/FileOutputStream.cpp @@ -43,7 +43,7 @@ FileOutputStream::FileOutputStream(const File &file) : m_fileHandle( INVALID_HAN if( m_fileHandle == INVALID_HANDLE_VALUE ) { - DWORD error = GetLastError(); + unsigned long error = GetLastError(); // TODO 4J Stu - Any form of error/exception handling } } @@ -59,11 +59,11 @@ FileOutputStream::~FileOutputStream() //b - the byte to be written. void FileOutputStream::write(unsigned int b) { - DWORD numberOfBytesWritten; + unsigned long numberOfBytesWritten; byte value = (byte) b; - BOOL result = WriteFile( + bool result = WriteFile( m_fileHandle, // handle to file &value, // data buffer 1, // number of bytes to write @@ -86,9 +86,9 @@ void FileOutputStream::write(unsigned int b) //b - the data. void FileOutputStream::write(byteArray b) { - DWORD numberOfBytesWritten; + unsigned long numberOfBytesWritten; - BOOL result = WriteFile( + bool result = WriteFile( m_fileHandle, // handle to file &b.data, // data buffer b.length, // number of bytes to write @@ -116,9 +116,9 @@ void FileOutputStream::write(byteArray b, unsigned int offset, unsigned int leng // 4J Stu - We don't want to write any more than the array buffer holds assert( length <= ( b.length - offset ) ); - DWORD numberOfBytesWritten; + unsigned long numberOfBytesWritten; - BOOL result = WriteFile( + bool result = WriteFile( m_fileHandle, // handle to file &b[offset], // data buffer length, // number of bytes to write @@ -141,7 +141,7 @@ void FileOutputStream::write(byteArray b, unsigned int offset, unsigned int leng //If this stream has an associated channel then the channel is closed as well. void FileOutputStream::close() { - BOOL result = CloseHandle( m_fileHandle ); + bool result = CloseHandle( m_fileHandle ); if( result == 0 ) { diff --git a/src/world/FileOutputStream.h b/src/world/FileOutputStream.h index bb8df059..a42c3a71 100644 --- a/src/world/FileOutputStream.h +++ b/src/world/FileOutputStream.h @@ -15,5 +15,5 @@ public: virtual void flush() {} private: - HANDLE m_fileHandle; + void* m_fileHandle; }; \ No newline at end of file diff --git a/src/world/FlatLevelSource.cpp b/src/world/FlatLevelSource.cpp index 6435bfb4..15e685e6 100644 --- a/src/world/FlatLevelSource.cpp +++ b/src/world/FlatLevelSource.cpp @@ -11,7 +11,7 @@ //FlatLevelSource::villageFeature = new VillageFeature(1); -FlatLevelSource::FlatLevelSource(Level *level, __int64 seed, bool generateStructures) +FlatLevelSource::FlatLevelSource(Level *level, int64_t seed, bool generateStructures) { m_XZSize = level->getLevelData()->getXZSize(); @@ -105,8 +105,8 @@ void FlatLevelSource::postProcess(ChunkSource *parent, int xt, int zt) { // 4J - changed from random to pprandom so we can run in parallel with getChunk etc. pprandom->setSeed(level->getSeed()); - __int64 xScale = pprandom->nextLong() / 2 * 2 + 1; - __int64 zScale = pprandom->nextLong() / 2 * 2 + 1; + int64_t xScale = pprandom->nextLong() / 2 * 2 + 1; + int64_t zScale = pprandom->nextLong() / 2 * 2 + 1; pprandom->setSeed(((xt * xScale) + (zt * zScale)) ^ level->getSeed()); if (generateStructures) diff --git a/src/world/FlatLevelSource.h b/src/world/FlatLevelSource.h index 804a7b5a..f809bd96 100644 --- a/src/world/FlatLevelSource.h +++ b/src/world/FlatLevelSource.h @@ -25,7 +25,7 @@ private: VillageFeature *villageFeature;// = new VillageFeature(1); public: - FlatLevelSource(Level *level, __int64 seed, bool generateStructures); + FlatLevelSource(Level *level, int64_t seed, bool generateStructures); ~FlatLevelSource(); private: void prepareHeights(byteArray blocks); diff --git a/src/world/FuzzyZoomLayer.cpp b/src/world/FuzzyZoomLayer.cpp index 65c6709e..54155ff5 100644 --- a/src/world/FuzzyZoomLayer.cpp +++ b/src/world/FuzzyZoomLayer.cpp @@ -2,7 +2,7 @@ #include "System.h" #include "net.minecraft.world.level.newbiome.layer.h" -FuzzyZoomLayer::FuzzyZoomLayer(__int64 seedMixup, shared_ptrparent) : Layer(seedMixup) +FuzzyZoomLayer::FuzzyZoomLayer(int64_t seedMixup, shared_ptrparent) : Layer(seedMixup) { this->parent = parent; } @@ -61,7 +61,7 @@ int FuzzyZoomLayer::random(int a, int b, int c, int d) return d; } -shared_ptrFuzzyZoomLayer::zoom(__int64 seed, shared_ptrsup, int count) +shared_ptrFuzzyZoomLayer::zoom(int64_t seed, shared_ptrsup, int count) { shared_ptr result = sup; for (int i = 0; i < count; i++) diff --git a/src/world/FuzzyZoomLayer.h b/src/world/FuzzyZoomLayer.h index bc8f5e48..19526931 100644 --- a/src/world/FuzzyZoomLayer.h +++ b/src/world/FuzzyZoomLayer.h @@ -5,7 +5,7 @@ class FuzzyZoomLayer : public Layer { public: - FuzzyZoomLayer(__int64 seedMixup, shared_ptrparent); + FuzzyZoomLayer(int64_t seedMixup, shared_ptrparent); intArray getArea(int xo, int yo, int w, int h); protected: @@ -13,5 +13,5 @@ protected: int random(int a, int b, int c, int d); public: - static shared_ptrzoom(__int64 seed, shared_ptrsup, int count); + static shared_ptrzoom(int64_t seed, shared_ptrsup, int count); }; \ No newline at end of file diff --git a/src/world/GZIPInputStream.h b/src/world/GZIPInputStream.h index f852518b..b9242576 100644 --- a/src/world/GZIPInputStream.h +++ b/src/world/GZIPInputStream.h @@ -13,5 +13,5 @@ public: virtual int read(byteArray b) { return stream->read( b ); }; virtual int read(byteArray b, unsigned int offset, unsigned int length) { return stream->read(b, offset, length); }; virtual void close() { return stream->close(); }; - virtual __int64 skip(__int64 n) { return 0; }; + virtual int64_t skip(int64_t n) { return 0; }; }; \ No newline at end of file diff --git a/src/world/GrowMushroomIslandLayer.cpp b/src/world/GrowMushroomIslandLayer.cpp index 14857366..89c97996 100644 --- a/src/world/GrowMushroomIslandLayer.cpp +++ b/src/world/GrowMushroomIslandLayer.cpp @@ -3,7 +3,7 @@ #include "net.minecraft.world.level.biome.h" -GrowMushroomIslandLayer::GrowMushroomIslandLayer(__int64 seedMixup, shared_ptr parent) : Layer(seedMixup) +GrowMushroomIslandLayer::GrowMushroomIslandLayer(int64_t seedMixup, shared_ptr parent) : Layer(seedMixup) { this->parent = parent; } diff --git a/src/world/GrowMushroomIslandLayer.h b/src/world/GrowMushroomIslandLayer.h index 3bca4d5c..6b0860f7 100644 --- a/src/world/GrowMushroomIslandLayer.h +++ b/src/world/GrowMushroomIslandLayer.h @@ -4,6 +4,6 @@ class GrowMushroomIslandLayer : public Layer { public: - GrowMushroomIslandLayer(__int64 seedMixup, shared_ptr parent); + GrowMushroomIslandLayer(int64_t seedMixup, shared_ptr parent); virtual intArray getArea(int xo, int yo, int w, int h); }; \ No newline at end of file diff --git a/src/world/HellDimension.cpp b/src/world/HellDimension.cpp index f00f3977..79168004 100644 --- a/src/world/HellDimension.cpp +++ b/src/world/HellDimension.cpp @@ -68,7 +68,7 @@ bool HellDimension::isValidSpawn(int x, int z) const return false; } -float HellDimension::getTimeOfDay(__int64 time, float a) const +float HellDimension::getTimeOfDay(int64_t time, float a) const { return 0.5f; } diff --git a/src/world/HellDimension.h b/src/world/HellDimension.h index b37f2b53..fa95d9b2 100644 --- a/src/world/HellDimension.h +++ b/src/world/HellDimension.h @@ -14,7 +14,7 @@ public: virtual ChunkSource *createRandomLevelSource() const; virtual bool isNaturalDimension(); virtual bool isValidSpawn(int x, int y) const; - virtual float getTimeOfDay(__int64 time, float a) const; + virtual float getTimeOfDay(int64_t time, float a) const; virtual bool mayRespawn() const; virtual bool isFoggyAt(int x, int z); diff --git a/src/world/HellFlatLevelSource.cpp b/src/world/HellFlatLevelSource.cpp index 0b1c4359..3c9505b6 100644 --- a/src/world/HellFlatLevelSource.cpp +++ b/src/world/HellFlatLevelSource.cpp @@ -4,7 +4,7 @@ #include "net.minecraft.world.level.storage.h" #include "HellFlatLevelSource.h" -HellFlatLevelSource::HellFlatLevelSource(Level *level, __int64 seed) +HellFlatLevelSource::HellFlatLevelSource(Level *level, int64_t seed) { int xzSize = level->getLevelData()->getXZSize(); int hellScale = level->getLevelData()->getHellScale(); @@ -159,8 +159,8 @@ void HellFlatLevelSource::postProcess(ChunkSource *parent, int xt, int zt) // we need to use a separate random - have used the same initialisation code as used in RandomLevelSource::postProcess to make sure this random value // is consistent for each world generation. Also changed all uses of random here to pprandom. pprandom->setSeed(level->getSeed()); - __int64 xScale = pprandom->nextLong() / 2 * 2 + 1; - __int64 zScale = pprandom->nextLong() / 2 * 2 + 1; + int64_t xScale = pprandom->nextLong() / 2 * 2 + 1; + int64_t zScale = pprandom->nextLong() / 2 * 2 + 1; pprandom->setSeed(((xt * xScale) + (zt * zScale)) ^ level->getSeed()); int count = pprandom->nextInt(pprandom->nextInt(10) + 1) + 1; diff --git a/src/world/HellFlatLevelSource.h b/src/world/HellFlatLevelSource.h index b756d9a6..c1bd5868 100644 --- a/src/world/HellFlatLevelSource.h +++ b/src/world/HellFlatLevelSource.h @@ -26,7 +26,7 @@ private: Level *level; public: - HellFlatLevelSource(Level *level, __int64 seed); + HellFlatLevelSource(Level *level, int64_t seed); ~HellFlatLevelSource(); private: diff --git a/src/world/HellRandomLevelSource.cpp b/src/world/HellRandomLevelSource.cpp index 10194f7d..2ecb971b 100644 --- a/src/world/HellRandomLevelSource.cpp +++ b/src/world/HellRandomLevelSource.cpp @@ -7,7 +7,7 @@ #include "BiomeSource.h" #include "HellRandomLevelSource.h" -HellRandomLevelSource::HellRandomLevelSource(Level *level, __int64 seed) +HellRandomLevelSource::HellRandomLevelSource(Level *level, int64_t seed) { int xzSize = level->getLevelData()->getXZSize(); int hellScale = level->getLevelData()->getHellScale(); @@ -430,8 +430,8 @@ void HellRandomLevelSource::postProcess(ChunkSource *parent, int xt, int zt) // we need to use a separate random - have used the same initialisation code as used in RandomLevelSource::postProcess to make sure this random value // is consistent for each world generation. Also changed all uses of random here to pprandom. pprandom->setSeed(level->getSeed()); - __int64 xScale = pprandom->nextLong() / 2 * 2 + 1; - __int64 zScale = pprandom->nextLong() / 2 * 2 + 1; + int64_t xScale = pprandom->nextLong() / 2 * 2 + 1; + int64_t zScale = pprandom->nextLong() / 2 * 2 + 1; pprandom->setSeed(((xt * xScale) + (zt * zScale)) ^ level->getSeed()); netherBridgeFeature->postProcess(level, pprandom, xt, zt); diff --git a/src/world/HellRandomLevelSource.h b/src/world/HellRandomLevelSource.h index 0587e86a..44486c64 100644 --- a/src/world/HellRandomLevelSource.h +++ b/src/world/HellRandomLevelSource.h @@ -37,7 +37,7 @@ private: Level *level; public: - HellRandomLevelSource(Level *level, __int64 seed); + HellRandomLevelSource(Level *level, int64_t seed); ~HellRandomLevelSource(); NetherBridgeFeature *netherBridgeFeature; diff --git a/src/world/InputStream.h b/src/world/InputStream.h index af0ff593..234e85b5 100644 --- a/src/world/InputStream.h +++ b/src/world/InputStream.h @@ -11,7 +11,7 @@ public: virtual int read(byteArray b) = 0; virtual int read(byteArray b, unsigned int offset, unsigned int length) = 0; virtual void close() = 0; - virtual __int64 skip(__int64 n) = 0; + virtual int64_t skip(int64_t n) = 0; static InputStream *getResourceAsStream(const wstring &fileName); }; \ No newline at end of file diff --git a/src/world/IntCache.cpp b/src/world/IntCache.cpp index 174d01d3..4af9b6bb 100644 --- a/src/world/IntCache.cpp +++ b/src/world/IntCache.cpp @@ -1,7 +1,7 @@ #include "stdafx.h" #include "IntCache.h" -DWORD IntCache::tlsIdx = TlsAlloc(); +unsigned long IntCache::tlsIdx = TlsAlloc(); void IntCache::CreateNewThreadStorage() { diff --git a/src/world/IntCache.h b/src/world/IntCache.h index edc9764d..bbdc344d 100644 --- a/src/world/IntCache.h +++ b/src/world/IntCache.h @@ -20,7 +20,7 @@ private: vector toosmall; // 4J added ~ThreadStorage(); }; - static DWORD tlsIdx; + static unsigned long tlsIdx; static const int TINY_CUTOFF = 256; diff --git a/src/world/IslandLayer.cpp b/src/world/IslandLayer.cpp index b502f384..0a6cc3fa 100644 --- a/src/world/IslandLayer.cpp +++ b/src/world/IslandLayer.cpp @@ -1,7 +1,7 @@ #include "stdafx.h" #include "net.minecraft.world.level.newbiome.layer.h" -IslandLayer::IslandLayer(__int64 seedMixup) : Layer(seedMixup) +IslandLayer::IslandLayer(int64_t seedMixup) : Layer(seedMixup) { } diff --git a/src/world/IslandLayer.h b/src/world/IslandLayer.h index 09e90eb3..90995636 100644 --- a/src/world/IslandLayer.h +++ b/src/world/IslandLayer.h @@ -5,7 +5,7 @@ class IslandLayer : public Layer { public: - IslandLayer(__int64 seedMixup); + IslandLayer(int64_t seedMixup); intArray getArea(int xo, int yo, int w, int h); }; \ No newline at end of file diff --git a/src/world/Item.cpp b/src/world/Item.cpp index 5d723ec5..6c94a2e7 100644 --- a/src/world/Item.cpp +++ b/src/world/Item.cpp @@ -747,13 +747,13 @@ Item *Item::setDescriptionId(unsigned int id) return this; } -LPCWSTR Item::getDescription() +const wchar_t* Item::getDescription() { return app.GetString(getDescriptionId()); //return I18n::get(getDescriptionId()); } -LPCWSTR Item::getDescription(shared_ptr instance) +const wchar_t* Item::getDescription(shared_ptr instance) { return app.GetString(getDescriptionId(instance)); //return I18n::get(getDescriptionId(instance)); diff --git a/src/world/Item.h b/src/world/Item.h index 727fc661..430b98e1 100644 --- a/src/world/Item.h +++ b/src/world/Item.h @@ -672,8 +672,8 @@ public: virtual bool isHandEquipped(); virtual bool isMirroredArt(); Item *setDescriptionId(unsigned int id); - LPCWSTR getDescription(); - LPCWSTR getDescription(shared_ptr instance); + const wchar_t* getDescription(); + const wchar_t* getDescription(shared_ptr instance); virtual unsigned int getDescriptionId(int iData = -1); virtual unsigned int getDescriptionId(shared_ptr instance); Item *setUseDescriptionId(unsigned int id); diff --git a/src/world/JavaIntHash.h b/src/world/JavaIntHash.h index 447b8052..815b44e4 100644 --- a/src/world/JavaIntHash.h +++ b/src/world/JavaIntHash.h @@ -49,15 +49,15 @@ typedef struct return (int)(h ^ (h >> 7) ^ (h >> 4)); } - int operator() (const __int64 &k) const + int operator() (const int64_t &k) const { - return hash((int) ( k ^ (((__uint64)k) >> 32 ))); + return hash((int) ( k ^ (((uint64_t)k) >> 32 ))); } } LongKeyHash; typedef struct { - bool operator() (const __int64 &x, const __int64 &y) const { return x==y; } + bool operator() (const int64_t &x, const int64_t &y) const { return x==y; } } LongKeyEq; typedef struct diff --git a/src/world/JavaMath.cpp b/src/world/JavaMath.cpp index 92843695..6f12f4ae 100644 --- a/src/world/JavaMath.cpp +++ b/src/world/JavaMath.cpp @@ -34,9 +34,9 @@ double Math::random() //a - a floating-point value to be rounded to a long. //Returns: //the value of the argument rounded to the nearest long value. -__int64 Math::round( double d ) +int64_t Math::round( double d ) { - return (__int64)floor( d + 0.5 ); + return (int64_t)floor( d + 0.5 ); } int Math::_max(int a, int b) diff --git a/src/world/JavaMath.h b/src/world/JavaMath.h index fcd095c8..b64832e9 100644 --- a/src/world/JavaMath.h +++ b/src/world/JavaMath.h @@ -8,7 +8,7 @@ private: public: static double random(); - static __int64 round( double d ); + static int64_t round( double d ); static int _max(int a, int b); static float _max(float a, float b); static int _min(int a, int b); diff --git a/src/world/KickPlayerPacket.cpp b/src/world/KickPlayerPacket.cpp index cfef71e0..9bacab26 100644 --- a/src/world/KickPlayerPacket.cpp +++ b/src/world/KickPlayerPacket.cpp @@ -11,7 +11,7 @@ KickPlayerPacket::KickPlayerPacket() m_networkSmallId = 0; } -KickPlayerPacket::KickPlayerPacket(BYTE networkSmallId) +KickPlayerPacket::KickPlayerPacket(uint8_t networkSmallId) { m_networkSmallId = networkSmallId; } diff --git a/src/world/KickPlayerPacket.h b/src/world/KickPlayerPacket.h index b9a6ce3e..3ae47b47 100644 --- a/src/world/KickPlayerPacket.h +++ b/src/world/KickPlayerPacket.h @@ -6,10 +6,10 @@ using namespace std; class KickPlayerPacket : public Packet, public enable_shared_from_this { public: - BYTE m_networkSmallId; + uint8_t m_networkSmallId; KickPlayerPacket(); - KickPlayerPacket(BYTE networkSmallId); + KickPlayerPacket(uint8_t networkSmallId); virtual void handle(PacketListener *listener); virtual void read(DataInputStream *dis); diff --git a/src/world/LargeCaveFeature.cpp b/src/world/LargeCaveFeature.cpp index 20b83a30..40c6639a 100644 --- a/src/world/LargeCaveFeature.cpp +++ b/src/world/LargeCaveFeature.cpp @@ -4,12 +4,12 @@ #include "net.minecraft.world.level.biome.h" #include "LargeCaveFeature.h" -void LargeCaveFeature::addRoom(__int64 seed, int xOffs, int zOffs, byteArray blocks, double xRoom, double yRoom, double zRoom) +void LargeCaveFeature::addRoom(int64_t seed, int xOffs, int zOffs, byteArray blocks, double xRoom, double yRoom, double zRoom) { addTunnel(seed, xOffs, zOffs, blocks, xRoom, yRoom, zRoom, 1 + random->nextFloat() * 6, 0, 0, -1, -1, 0.5); } -void LargeCaveFeature::addTunnel(__int64 seed, int xOffs, int zOffs, byteArray blocks, double xCave, double yCave, double zCave, float thickness, float yRot, float xRot, int step, int dist, double yScale) +void LargeCaveFeature::addTunnel(int64_t seed, int xOffs, int zOffs, byteArray blocks, double xCave, double yCave, double zCave, float thickness, float yRot, float xRot, int step, int dist, double yScale) { double xMid = xOffs * 16 + 8; double zMid = zOffs * 16 + 8; diff --git a/src/world/LargeCaveFeature.h b/src/world/LargeCaveFeature.h index 5188aca7..66eadde9 100644 --- a/src/world/LargeCaveFeature.h +++ b/src/world/LargeCaveFeature.h @@ -5,7 +5,7 @@ class LargeCaveFeature : public LargeFeature { protected: - void addRoom(__int64 seed, int xOffs, int zOffs, byteArray blocks, double xRoom, double yRoom, double zRoom); - void addTunnel(__int64 seed, int xOffs, int zOffs, byteArray blocks, double xCave, double yCave, double zCave, float thickness, float yRot, float xRot, int step, int dist, double yScale); + void addRoom(int64_t seed, int xOffs, int zOffs, byteArray blocks, double xRoom, double yRoom, double zRoom); + void addTunnel(int64_t seed, int xOffs, int zOffs, byteArray blocks, double xCave, double yCave, double zCave, float thickness, float yRot, float xRot, int step, int dist, double yScale); virtual void addFeature(Level *level, int x, int z, int xOffs, int zOffs, byteArray blocks); }; diff --git a/src/world/LargeFeature.cpp b/src/world/LargeFeature.cpp index 2e43fac7..23dc532f 100644 --- a/src/world/LargeFeature.cpp +++ b/src/world/LargeFeature.cpp @@ -21,15 +21,15 @@ void LargeFeature::apply(ChunkSource *ChunkSource, Level *level, int xOffs, int this->level = level; random->setSeed(level->getSeed()); - __int64 xScale = random->nextLong(); - __int64 zScale = random->nextLong(); + int64_t xScale = random->nextLong(); + int64_t zScale = random->nextLong(); for (int x = xOffs - r; x <= xOffs + r; x++) { for (int z = zOffs - r; z <= zOffs + r; z++) { - __int64 xx = x * xScale; - __int64 zz = z * zScale; + int64_t xx = x * xScale; + int64_t zz = z * zScale; random->setSeed(xx ^ zz ^ level->getSeed()); addFeature(level, x, z, xOffs, zOffs, blocks); } diff --git a/src/world/Layer.cpp b/src/world/Layer.cpp index 3f5366bd..988d7e4e 100644 --- a/src/world/Layer.cpp +++ b/src/world/Layer.cpp @@ -16,7 +16,7 @@ libdivide::divider fast_d7(7); libdivide::divider fast_d10(10); #endif -LayerArray Layer::getDefaultLayers(__int64 seed, LevelType *levelType) +LayerArray Layer::getDefaultLayers(int64_t seed, LevelType *levelType) { // 4J - Some changes moved here from 1.2.3. Temperature & downfall layers are no longer created & returned, and a debug layer is isn't. // For reference with regard to future merging, things NOT brought forward from the 1.2.3 version are new layer types that we @@ -107,7 +107,7 @@ LayerArray Layer::getDefaultLayers(__int64 seed, LevelType *levelType) return result; } -Layer::Layer(__int64 seedMixup) +Layer::Layer(int64_t seedMixup) { parent = nullptr; @@ -120,7 +120,7 @@ Layer::Layer(__int64 seedMixup) this->seedMixup += seedMixup; } -void Layer::init(__int64 seed) +void Layer::init(int64_t seed) { this->seed = seed; if (parent != NULL) parent->init(seed); @@ -132,7 +132,7 @@ void Layer::init(__int64 seed) this->seed += seedMixup; } -void Layer::initRandom(__int64 x, __int64 y) +void Layer::initRandom(int64_t x, int64_t y) { rval = seed; rval *= rval * 6364136223846793005l + 1442695040888963407l; diff --git a/src/world/Layer.h b/src/world/Layer.h index a444a629..6f31e94a 100644 --- a/src/world/Layer.h +++ b/src/world/Layer.h @@ -11,22 +11,22 @@ class LevelType; class Layer { private: - __int64 seed; + int64_t seed; protected: shared_ptrparent; private: - __int64 rval; - __int64 seedMixup; + int64_t rval; + int64_t seedMixup; public: - static LayerArray getDefaultLayers(__int64 seed, LevelType *levelType); + static LayerArray getDefaultLayers(int64_t seed, LevelType *levelType); - Layer(__int64 seedMixup); + Layer(int64_t seedMixup); - virtual void init(__int64 seed); - virtual void initRandom(__int64 x, __int64 y); + virtual void init(int64_t seed); + virtual void initRandom(int64_t x, int64_t y); protected: int nextRandom(int max); diff --git a/src/world/Level.cpp b/src/world/Level.cpp index 621b3239..47e5aca9 100644 --- a/src/world/Level.cpp +++ b/src/world/Level.cpp @@ -43,8 +43,8 @@ #include "PS3\PS3Extras\ShutdownManager.h" -DWORD Level::tlsIdx = TlsAlloc(); -DWORD Level::tlsIdxLightCache = TlsAlloc(); +unsigned long Level::tlsIdx = TlsAlloc(); +unsigned long Level::tlsIdxLightCache = TlsAlloc(); // 4J : WESTY : Added for time played stats. #include "net.minecraft.stats.h" @@ -112,7 +112,7 @@ void Level::initCache(lightCache_t *cache) } // Set a brightness value, going through the cache if enabled for this thread -void inline Level::setBrightnessCached(lightCache_t *cache, __uint64 *cacheUse, LightLayer::variety layer, int x, int y, int z, int brightness) +void inline Level::setBrightnessCached(lightCache_t *cache, uint64_t *cacheUse, LightLayer::variety layer, int x, int y, int z, int brightness) { if( cache == NULL ) { @@ -129,8 +129,8 @@ void inline Level::setBrightnessCached(lightCache_t *cache, __uint64 *cacheUse, ( ( z & 0x3f0 ) >> 4 ); #ifdef _LARGE_WORLDS // Add in the higher bits for x and z - posbits |= ( ( ((__uint64)x) & 0x3FFFC00L) << 38) | - ( ( ((__uint64)z) & 0x3FFFC00L) << 22); + posbits |= ( ( ((uint64_t)x) & 0x3FFFC00L) << 38) | + ( ( ((uint64_t)z) & 0x3FFFC00L) << 22); #endif lightCache_t cacheValue = cache[idx]; @@ -188,8 +188,8 @@ inline int Level::getBrightnessCached(lightCache_t *cache, LightLayer::variety l ( ( z & 0x3f0 ) >> 4 ); #ifdef _LARGE_WORLDS // Add in the higher bits for x and z - posbits |= ( ( ((__uint64)x) & 0x3FFFC00L) << 38) | - ( ( ((__uint64)z) & 0x3FFFC00L) << 22); + posbits |= ( ( ((uint64_t)x) & 0x3FFFC00L) << 38) | + ( ( ((uint64_t)z) & 0x3FFFC00L) << 22); #endif lightCache_t cacheValue = cache[idx]; @@ -255,8 +255,8 @@ inline int Level::getEmissionCached(lightCache_t *cache, int ct, int x, int y, i ( ( z & 0x3f0 ) >> 4 ); #ifdef _LARGE_WORLDS // Add in the higher bits for x and z - posbits |= ( ( ((__uint64)x) & 0x3FFFC00) << 38) | - ( ( ((__uint64)z) & 0x3FFFC00) << 22); + posbits |= ( ( ((uint64_t)x) & 0x3FFFC00) << 38) | + ( ( ((uint64_t)z) & 0x3FFFC00) << 22); #endif lightCache_t cacheValue = cache[idx]; @@ -331,8 +331,8 @@ inline int Level::getBlockingCached(lightCache_t *cache, LightLayer::variety lay ( ( z & 0x3f0 ) >> 4 ); #ifdef _LARGE_WORLDS // Add in the higher bits for x and z - posbits |= ( ( ((__uint64)x) & 0x3FFFC00L) << 38) | - ( ( ((__uint64)z) & 0x3FFFC00L) << 22); + posbits |= ( ( ((uint64_t)x) & 0x3FFFC00L) << 38) | + ( ( ((uint64_t)z) & 0x3FFFC00L) << 22); #endif lightCache_t cacheValue = cache[idx]; @@ -394,7 +394,7 @@ inline int Level::getBlockingCached(lightCache_t *cache, LightLayer::variety lay // this hasn't been updated (for client threads) for each individual lighting update as would have been the case with the non-cached lighting. There's two reasons for this // (1) it's more efficient, since we aren't doing so many individual calls to the level listener to let the renderer know what has been updated // (2) it lets the lighting actually complete before we get any visual representation of the update, otherwise we end up seeing some strange partial updates -void Level::flushCache(lightCache_t *cache, __uint64 cacheUse, LightLayer::variety layer) +void Level::flushCache(lightCache_t *cache, uint64_t cacheUse, LightLayer::variety layer) { // cacheUse has a single bit for each x, y and z to say whether anything with that x, y or z has been written to if( cacheUse == 0 ) return; @@ -3387,7 +3387,7 @@ inline int GetIndex(int x, int y, int z) void Level::checkLight(LightLayer::variety layer, int xc, int yc, int zc, bool force, bool rootOnlyEmissive) { lightCache_t *cache = (lightCache_t *)TlsGetValue(tlsIdxLightCache); - __uint64 cacheUse = 0; + uint64_t cacheUse = 0; if( force ) { @@ -4318,13 +4318,13 @@ void Level::checkSession() } -void Level::setTime(__int64 time) +void Level::setTime(int64_t time) { // 4J : WESTY : Added to track game time played by players for other awards. if (time != 0) // Ignore setting time to 0, done at level start and during tutorial. { // Determine step in time and ensure it is reasonable ( we only have an int to store the player stat). - __int64 timeDiff = time - levelData->getTime(); + int64_t timeDiff = time - levelData->getTime(); // debug setting added to keep it at day time #ifndef _FINAL_BUILD @@ -4363,18 +4363,18 @@ void Level::setTime(__int64 time) this->levelData->setTime(time); } -void Level::setOverrideTimeOfDay(__int64 time) +void Level::setOverrideTimeOfDay(int64_t time) { m_timeOfDayOverride = time; } -__int64 Level::getSeed() +int64_t Level::getSeed() { return levelData->getSeed(); } -__int64 Level::getTime() +int64_t Level::getTime() { return levelData->getTime(); } @@ -4565,7 +4565,7 @@ int Level::getHeight() Random *Level::getRandomFor(int x, int z, int blend) { - __int64 seed = (x * 341873128712l + z * 132897987541l) + getLevelData()->getSeed() + blend; + int64_t seed = (x * 341873128712l + z * 132897987541l) + getLevelData()->getSeed() + blend; random->setSeed(seed); return random; } diff --git a/src/world/Level.h b/src/world/Level.h index 9c779d54..286da8dd 100644 --- a/src/world/Level.h +++ b/src/world/Level.h @@ -7,7 +7,7 @@ using namespace std; #include "SavedData.h" #include "Definitions.h" #include "ParticleTypes.h" -#include "biome.h" +#include "Biome.h" #include "C4JThread.h" #ifdef __PSVITA__ @@ -77,8 +77,8 @@ public: int seaLevel; // 4J - added, making instaTick flag use TLS so we can set it in the chunk rebuilding thread without upsetting the main game thread - static DWORD tlsIdx; - static DWORD tlsIdxLightCache; + static unsigned long tlsIdx; + static unsigned long tlsIdxLightCache; static void enableLightingCache(); static void destroyLightingCache(); static bool getCacheTestEnabled(); @@ -239,26 +239,26 @@ public: void setBrightnessNoUpdateOnClient(LightLayer::variety layer, int x, int y, int z, int brightness); // 4J added #ifdef _LARGE_WORLDS - typedef __uint64 lightCache_t; + typedef uint64_t lightCache_t; #else typedef unsigned int lightCache_t; #endif - inline void setBrightnessCached(lightCache_t *cache, __uint64 *cacheUse, LightLayer::variety layer, int x, int y, int z, int brightness); + inline void setBrightnessCached(lightCache_t *cache, uint64_t *cacheUse, LightLayer::variety layer, int x, int y, int z, int brightness); inline int getBrightnessCached(lightCache_t *cache, LightLayer::variety layer, int x, int y, int z); inline int getEmissionCached(lightCache_t *cache, int ct, int x, int y, int z); inline int getBlockingCached(lightCache_t *cache, LightLayer::variety layer, int *ct, int x, int y, int z); void initCache(lightCache_t *cache); - void flushCache(lightCache_t *cache, __uint64 cacheUse, LightLayer::variety layer); + void flushCache(lightCache_t *cache, uint64_t cacheUse, LightLayer::variety layer); bool cachewritten; static const int LIGHTING_SHIFT = 24; static const int BLOCKING_SHIFT = 20; static const int EMISSION_SHIFT = 16; #ifdef _LARGE_WORLDS - static const __int64 LIGHTING_WRITEBACK = 0x80000000LL; - static const __int64 EMISSION_VALID = 0x40000000LL; - static const __int64 BLOCKING_VALID = 0x20000000LL; - static const __int64 LIGHTING_VALID = 0x10000000LL; + static const int64_t LIGHTING_WRITEBACK = 0x80000000LL; + static const int64_t EMISSION_VALID = 0x40000000LL; + static const int64_t BLOCKING_VALID = 0x20000000LL; + static const int64_t LIGHTING_VALID = 0x10000000LL; static const lightCache_t POSITION_MASK = 0xffffffff0000ffffLL; #else static const int LIGHTING_WRITEBACK = 0x80000000; @@ -449,10 +449,10 @@ public: void setBlocksAndData(int x, int y, int z, int xs, int ys, int zs, byteArray data, bool includeLighting = true); virtual void disconnect(bool sendDisconnect = true); void checkSession(); - void setTime(__int64 time); - void setOverrideTimeOfDay(__int64 time); // 4J Added so we can override timeOfDay without changing tick time - __int64 getSeed(); - __int64 getTime(); + void setTime(int64_t time); + void setOverrideTimeOfDay(int64_t time); // 4J Added so we can override timeOfDay without changing tick time + int64_t getSeed(); + int64_t getTime(); Pos *getSharedSpawnPos(); void setSpawnPos(int x, int y, int z); void setSpawnPos(Pos *spawnPos); @@ -496,7 +496,7 @@ public: // 4J added - __int64 m_timeOfDayOverride; + int64_t m_timeOfDayOverride; // 4J - optimisation - keep direct reference of underlying cache here LevelChunk **chunkSourceCache; diff --git a/src/world/LevelChunk.cpp b/src/world/LevelChunk.cpp index 9947071d..76beb4af 100644 --- a/src/world/LevelChunk.cpp +++ b/src/world/LevelChunk.cpp @@ -388,7 +388,7 @@ void LevelChunk::startSharingTilesAndData(int forceMs) else { // Only force if it has been more than forceMs milliseconds since we last wanted to unshare this chunk - __int64 timenow = System::currentTimeMillis(); + int64_t timenow = System::currentTimeMillis(); if( ( timenow - lastUnsharedTime ) < forceMs ) { LeaveCriticalSection(&m_csSharing); @@ -1879,7 +1879,7 @@ void LevelChunk::setCheckAllLight() checkLightPosition = 0; } -Random *LevelChunk::getRandom(__int64 l) +Random *LevelChunk::getRandom(int64_t l) { return new Random((level->getSeed() + x * x * 4987142 + x * 5947611 + z * z * 4392871l + z * 389711) ^ l); } diff --git a/src/world/LevelChunk.h b/src/world/LevelChunk.h index e9510ad5..f9c4d8b3 100644 --- a/src/world/LevelChunk.h +++ b/src/world/LevelChunk.h @@ -134,8 +134,8 @@ public: void stopSharingTilesAndData(); // 4J added virtual void reSyncLighting(); // 4J added void startSharingTilesAndData(int forceMs = 0); // 4J added - __int64 lastUnsharedTime; // 4J added - __int64 lastSaveTime; + int64_t lastUnsharedTime; // 4J added + int64_t lastSaveTime; bool seenByPlayer; #ifdef _LARGE_WORLDS @@ -213,7 +213,7 @@ public: virtual bool testSetBlocksAndData(byteArray data, int x0, int y0, int z0, int x1, int y1, int z1, int p); // 4J added virtual void setCheckAllLight(); - virtual Random *getRandom(__int64 l); + virtual Random *getRandom(int64_t l); virtual bool isEmpty(); virtual void attemptCompression(); diff --git a/src/world/LevelConflictException.h b/src/world/LevelConflictException.h index e8b2bc32..db90f4c1 100644 --- a/src/world/LevelConflictException.h +++ b/src/world/LevelConflictException.h @@ -6,7 +6,7 @@ using namespace std; class LevelConflictException : public RuntimeException { private: - static const __int32 serialVersionUID = 1L; + static const int32_t serialVersionUID = 1L; public: LevelConflictException(const wstring& msg); diff --git a/src/world/LevelData.cpp b/src/world/LevelData.cpp index 026dca70..20633d1d 100644 --- a/src/world/LevelData.cpp +++ b/src/world/LevelData.cpp @@ -287,7 +287,7 @@ void LevelData::setTagData(CompoundTag *tag) tag->putInt(L"HellScale", m_hellScale); } -__int64 LevelData::getSeed() +int64_t LevelData::getSeed() { return seed; } @@ -329,12 +329,12 @@ int LevelData::getZStrongholdEndPortal() return zStrongholdEndPortal; } -__int64 LevelData::getTime() +int64_t LevelData::getTime() { return time; } -__int64 LevelData::getSizeOnDisk() +int64_t LevelData::getSizeOnDisk() { return sizeOnDisk; } @@ -350,7 +350,7 @@ CompoundTag *LevelData::getLoadedPlayerTag() // return dimension; //} -void LevelData::setSeed(__int64 seed) +void LevelData::setSeed(int64_t seed) { this->seed = seed; } @@ -411,12 +411,12 @@ void LevelData::setZStrongholdEndPortal(int zStrongholdEndPortal) this->zStrongholdEndPortal = zStrongholdEndPortal; } -void LevelData::setTime(__int64 time) +void LevelData::setTime(int64_t time) { this->time = time; } -void LevelData::setSizeOnDisk(__int64 sizeOnDisk) +void LevelData::setSizeOnDisk(int64_t sizeOnDisk) { this->sizeOnDisk = sizeOnDisk; } @@ -460,7 +460,7 @@ void LevelData::setVersion(int version) this->version = version; } -__int64 LevelData::getLastPlayed() +int64_t LevelData::getLastPlayed() { return lastPlayed; } diff --git a/src/world/LevelData.h b/src/world/LevelData.h index 0afe9be2..405ba1b8 100644 --- a/src/world/LevelData.h +++ b/src/world/LevelData.h @@ -11,14 +11,14 @@ class LevelData { friend class DerivedLevelData; private: - __int64 seed; + int64_t seed; LevelType *m_pGenerator;// = LevelType.normal; int xSpawn; int ySpawn; int zSpawn; - __int64 time; - __int64 lastPlayed; - __int64 sizeOnDisk; + int64_t time; + int64_t lastPlayed; + int64_t sizeOnDisk; // CompoundTag *loadedPlayerTag; // 4J removed int dimension; wstring levelName; @@ -71,7 +71,7 @@ protected: virtual void setTagData(CompoundTag *tag); // 4J - removed CompoundTag *playerTag public: - virtual __int64 getSeed(); + virtual int64_t getSeed(); virtual int getXSpawn(); virtual int getYSpawn(); virtual int getZSpawn(); @@ -79,11 +79,11 @@ public: virtual int getZStronghold(); virtual int getXStrongholdEndPortal(); virtual int getZStrongholdEndPortal(); - virtual __int64 getTime(); - virtual __int64 getSizeOnDisk(); + virtual int64_t getTime(); + virtual int64_t getSizeOnDisk(); virtual CompoundTag *getLoadedPlayerTag(); //int getDimension(); // 4J Removed TU 9 as it's never accurate - virtual void setSeed(__int64 seed); + virtual void setSeed(int64_t seed); virtual void setXSpawn(int xSpawn); virtual void setYSpawn(int ySpawn); virtual void setZSpawn(int zSpawn); @@ -96,8 +96,8 @@ public: virtual void setXStrongholdEndPortal(int xStrongholdEndPortal); virtual void setZStrongholdEndPortal(int zStrongholdEndPortal); - virtual void setTime(__int64 time); - virtual void setSizeOnDisk(__int64 sizeOnDisk); + virtual void setTime(int64_t time); + virtual void setSizeOnDisk(int64_t sizeOnDisk); virtual void setLoadedPlayerTag(CompoundTag *loadedPlayerTag); //void setDimension(int dimension); // 4J Removed TU 9 as it's never used virtual void setSpawn(int xSpawn, int ySpawn, int zSpawn); @@ -105,7 +105,7 @@ public: virtual void setLevelName(const wstring& levelName); virtual int getVersion(); virtual void setVersion(int version); - virtual __int64 getLastPlayed(); + virtual int64_t getLastPlayed(); virtual bool isThundering(); virtual void setThundering(bool thundering); virtual int getThunderTime(); diff --git a/src/world/LevelSettings.cpp b/src/world/LevelSettings.cpp index 59faa1ca..1c0bc1a2 100644 --- a/src/world/LevelSettings.cpp +++ b/src/world/LevelSettings.cpp @@ -85,7 +85,7 @@ GameType *GameType::byName(const wstring &name) return SURVIVAL; } -void LevelSettings::_init(__int64 seed, GameType *gameType, bool generateMapFeatures, bool hardcore, bool newSeaLevel, LevelType *levelType, int xzSize, int hellScale) +void LevelSettings::_init(int64_t seed, GameType *gameType, bool generateMapFeatures, bool hardcore, bool newSeaLevel, LevelType *levelType, int xzSize, int hellScale) { this->seed = seed; this->gameType = gameType; @@ -99,7 +99,7 @@ void LevelSettings::_init(__int64 seed, GameType *gameType, bool generateMapFeat m_hellScale = hellScale; } -LevelSettings::LevelSettings(__int64 seed, GameType *gameType, bool generateMapFeatures, bool hardcore, bool newSeaLevel, LevelType *levelType, int xzSize, int hellScale) : +LevelSettings::LevelSettings(int64_t seed, GameType *gameType, bool generateMapFeatures, bool hardcore, bool newSeaLevel, LevelType *levelType, int xzSize, int hellScale) : seed(seed), gameType(gameType), hardcore(hardcore), @@ -133,7 +133,7 @@ bool LevelSettings::hasStartingBonusItems() return startingBonusItems; } -__int64 LevelSettings::getSeed() +int64_t LevelSettings::getSeed() { return seed; } diff --git a/src/world/LevelSettings.h b/src/world/LevelSettings.h index c183df8c..2de2330a 100644 --- a/src/world/LevelSettings.h +++ b/src/world/LevelSettings.h @@ -35,7 +35,7 @@ public: class LevelSettings { private: - __int64 seed; + int64_t seed; GameType *gameType; bool generateMapFeatures; bool hardcore; @@ -46,15 +46,15 @@ private: int m_xzSize; // 4J Added int m_hellScale; - void _init(__int64 seed, GameType *gameType, bool generateMapFeatures, bool hardcore, bool newSeaLevel, LevelType *levelType, int xzSize, int hellScale); // 4J Added xzSize and hellScale param + void _init(int64_t seed, GameType *gameType, bool generateMapFeatures, bool hardcore, bool newSeaLevel, LevelType *levelType, int xzSize, int hellScale); // 4J Added xzSize and hellScale param public: - LevelSettings(__int64 seed, GameType *gameType, bool generateMapFeatures, bool hardcore, bool newSeaLevel, LevelType *levelType, int xzSize, int hellScale); // 4J Added xzSize and hellScale param + LevelSettings(int64_t seed, GameType *gameType, bool generateMapFeatures, bool hardcore, bool newSeaLevel, LevelType *levelType, int xzSize, int hellScale); // 4J Added xzSize and hellScale param LevelSettings(LevelData *levelData); LevelSettings *enableStartingBonusItems(); // 4J - brought forward from 1.3.2 LevelSettings *enableSinglePlayerCommands(); bool hasStartingBonusItems(); // 4J - brought forward from 1.3.2 - __int64 getSeed(); + int64_t getSeed(); GameType *getGameType(); bool isHardcore(); LevelType *getLevelType(); diff --git a/src/world/LevelSummary.cpp b/src/world/LevelSummary.cpp index d8e7ddee..919e6552 100644 --- a/src/world/LevelSummary.cpp +++ b/src/world/LevelSummary.cpp @@ -1,7 +1,7 @@ #include "stdafx.h" #include "LevelSummary.h" -LevelSummary::LevelSummary(const wstring& levelId, const wstring& levelName, __int64 lastPlayed, __int64 sizeOnDisk, GameType *gameMode, bool requiresConversion, bool hardcore, bool hasCheats) : +LevelSummary::LevelSummary(const wstring& levelId, const wstring& levelName, int64_t lastPlayed, int64_t sizeOnDisk, GameType *gameMode, bool requiresConversion, bool hardcore, bool hasCheats) : levelId( levelId ), levelName( levelName ), lastPlayed( lastPlayed ), @@ -23,7 +23,7 @@ wstring LevelSummary::getLevelName() return levelName; } -__int64 LevelSummary::getSizeOnDisk() +int64_t LevelSummary::getSizeOnDisk() { return sizeOnDisk; } @@ -33,7 +33,7 @@ bool LevelSummary::isRequiresConversion() return requiresConversion; } -__int64 LevelSummary::getLastPlayed() +int64_t LevelSummary::getLastPlayed() { return lastPlayed; } diff --git a/src/world/LevelSummary.h b/src/world/LevelSummary.h index bbf391ff..ce5699a2 100644 --- a/src/world/LevelSummary.h +++ b/src/world/LevelSummary.h @@ -7,20 +7,20 @@ class LevelSummary { const wstring levelId; const wstring levelName; - const __int64 lastPlayed; - const __int64 sizeOnDisk; + const int64_t lastPlayed; + const int64_t sizeOnDisk; const bool requiresConversion; GameType *gameMode; const bool hardcore; const bool _hasCheats; public: - LevelSummary(const wstring& levelId, const wstring& levelName, __int64 lastPlayed, __int64 sizeOnDisk, GameType *gameMode, bool requiresConversion, bool hardcore, bool hasCheats); + LevelSummary(const wstring& levelId, const wstring& levelName, int64_t lastPlayed, int64_t sizeOnDisk, GameType *gameMode, bool requiresConversion, bool hardcore, bool hasCheats); wstring getLevelId(); wstring getLevelName(); - __int64 getSizeOnDisk(); + int64_t getSizeOnDisk(); bool isRequiresConversion(); - __int64 getLastPlayed(); + int64_t getLastPlayed(); int compareTo(LevelSummary *rhs); GameType *getGameMode(); bool isHardcore(); diff --git a/src/world/LightningBolt.h b/src/world/LightningBolt.h index 28d5e004..2a14e88a 100644 --- a/src/world/LightningBolt.h +++ b/src/world/LightningBolt.h @@ -16,7 +16,7 @@ private: int life; public: - __int64 seed; + int64_t seed; private: int flashes; diff --git a/src/world/ListTag.h b/src/world/ListTag.h index 9deeb22d..7035b7a9 100644 --- a/src/world/ListTag.h +++ b/src/world/ListTag.h @@ -47,20 +47,20 @@ public: return wstring( buf ); } - void print(char *prefix, ostream out) + void print(char *prefix, std::ostream& out) { - Tag::print(prefix, out); - - out << prefix << "{" << endl; + out << prefix << "{" << std::endl; char *newPrefix = new char[ strlen(prefix) + 4 ]; - strcpy( newPrefix, prefix); - strcat( newPrefix, " "); - AUTO_VAR(itEnd, list.end()); - for (AUTO_VAR(it, list.begin()); it != itEnd; it++) - (*it)->print(newPrefix, out); + strcpy(newPrefix, prefix); + strcat(newPrefix, " "); + + auto itEnd = list.end(); + for (auto it = list.begin(); it != itEnd; ++it) + (*it)->print(newPrefix, out); + delete[] newPrefix; - out << prefix << "}" << endl; + out << prefix << "}" << std::endl; } void add(T *tag) diff --git a/src/world/LoginPacket.cpp b/src/world/LoginPacket.cpp index bfe69226..aa692283 100644 --- a/src/world/LoginPacket.cpp +++ b/src/world/LoginPacket.cpp @@ -37,7 +37,7 @@ LoginPacket::LoginPacket() } // Client -> Server -LoginPacket::LoginPacket(const wstring& userName, int clientVersion, PlayerUID offlineXuid, PlayerUID onlineXuid, bool friendsOnlyUGC, DWORD ugcPlayersVersion, DWORD skinId, DWORD capeId, bool isGuest) +LoginPacket::LoginPacket(const wstring& userName, int clientVersion, PlayerUID offlineXuid, PlayerUID onlineXuid, bool friendsOnlyUGC, unsigned long ugcPlayersVersion, unsigned long skinId, unsigned long capeId, bool isGuest) { this->userName = userName; this->clientVersion = clientVersion; @@ -66,7 +66,7 @@ LoginPacket::LoginPacket(const wstring& userName, int clientVersion, PlayerUID o } // Server -> Client -LoginPacket::LoginPacket(const wstring& userName, int clientVersion, LevelType *pLevelType, __int64 seed, int gameType, char dimension, BYTE mapHeight, BYTE maxPlayers, char difficulty, INT multiplayerInstanceId, BYTE playerIndex, bool newSeaLevel, unsigned int uiGamePrivileges, int xzSize, int hellScale) +LoginPacket::LoginPacket(const wstring& userName, int clientVersion, LevelType *pLevelType, int64_t seed, int gameType, char dimension, uint8_t mapHeight, uint8_t maxPlayers, char difficulty, int multiplayerInstanceId, uint8_t playerIndex, bool newSeaLevel, unsigned int uiGamePrivileges, int xzSize, int hellScale) { this->userName = userName; this->clientVersion = clientVersion; @@ -116,10 +116,10 @@ void LoginPacket::read(DataInputStream *dis) //throws IOException difficulty = dis->readByte(); m_multiplayerInstanceId = dis->readInt(); m_playerIndex = dis->readByte(); - INT skinId = dis->readInt(); - m_playerSkinId = *(DWORD *)&skinId; - INT capeId = dis->readInt(); - m_playerCapeId = *(DWORD *)&capeId; + int skinId = dis->readInt(); + m_playerSkinId = *(unsigned long *)&skinId; + int capeId = dis->readInt(); + m_playerCapeId = *(unsigned long *)&capeId; m_isGuest = dis->readBoolean(); m_newSeaLevel = dis->readBoolean(); m_uiGamePrivileges = dis->readInt(); @@ -179,5 +179,5 @@ int LoginPacket::getEstimatedSize() length = (int)m_pLevelType->getGeneratorName().length(); } - return (int)(sizeof(int) + userName.length() + 4 + 6 + sizeof(__int64) + sizeof(char) + sizeof(int) + (2*sizeof(PlayerUID)) +1 + sizeof(char) + sizeof(BYTE) + sizeof(bool) + sizeof(bool) + length + sizeof(unsigned int)); + return (int)(sizeof(int) + userName.length() + 4 + 6 + sizeof(int64_t) + sizeof(char) + sizeof(int) + (2*sizeof(PlayerUID)) +1 + sizeof(char) + sizeof(uint8_t) + sizeof(bool) + sizeof(bool) + length + sizeof(unsigned int)); } diff --git a/src/world/LoginPacket.h b/src/world/LoginPacket.h index 09041135..38cb4cbe 100644 --- a/src/world/LoginPacket.h +++ b/src/world/LoginPacket.h @@ -9,15 +9,15 @@ class LoginPacket : public Packet, public enable_shared_from_this public: int clientVersion; wstring userName; - __int64 seed; + int64_t seed; char dimension; PlayerUID m_offlineXuid, m_onlineXuid; // 4J Added char difficulty; // 4J Added bool m_friendsOnlyUGC; // 4J Added - DWORD m_ugcPlayersVersion; // 4J Added - INT m_multiplayerInstanceId; //4J Added for sentient - BYTE m_playerIndex; // 4J Added - DWORD m_playerSkinId, m_playerCapeId; // 4J Added + unsigned long m_ugcPlayersVersion; // 4J Added + int m_multiplayerInstanceId; //4J Added for sentient + uint8_t m_playerIndex; // 4J Added + unsigned long m_playerSkinId, m_playerCapeId; // 4J Added bool m_isGuest; // 4J Added bool m_newSeaLevel; // 4J Added LevelType *m_pLevelType; @@ -27,12 +27,12 @@ public: // 1.8.2 int gameType; - BYTE mapHeight; - BYTE maxPlayers; + uint8_t mapHeight; + uint8_t maxPlayers; LoginPacket(); - LoginPacket(const wstring& userName, int clientVersion, LevelType *pLevelType, __int64 seed, int gameType, char dimension, BYTE mapHeight, BYTE maxPlayers, char difficulty, INT m_multiplayerInstanceId, BYTE playerIndex, bool newSeaLevel, unsigned int uiGamePrivileges, int xzSize, int hellScale); // Server -> Client - LoginPacket(const wstring& userName, int clientVersion, PlayerUID offlineXuid, PlayerUID onlineXuid, bool friendsOnlyUGC, DWORD ugcPlayersVersion, DWORD skinId, DWORD capeId, bool isGuest); // Client -> Server + LoginPacket(const wstring& userName, int clientVersion, LevelType *pLevelType, int64_t seed, int gameType, char dimension, uint8_t mapHeight, uint8_t maxPlayers, char difficulty, int m_multiplayerInstanceId, uint8_t playerIndex, bool newSeaLevel, unsigned int uiGamePrivileges, int xzSize, int hellScale); // Server -> Client + LoginPacket(const wstring& userName, int clientVersion, PlayerUID offlineXuid, PlayerUID onlineXuid, bool friendsOnlyUGC, unsigned long ugcPlayersVersion, unsigned long skinId, unsigned long capeId, bool isGuest); // Client -> Server virtual void read(DataInputStream *dis); virtual void write(DataOutputStream *dos); diff --git a/src/world/LongTag.h b/src/world/LongTag.h index 2dcd3819..316fe937 100644 --- a/src/world/LongTag.h +++ b/src/world/LongTag.h @@ -4,9 +4,9 @@ class LongTag : public Tag { public: - __int64 data; + int64_t data; LongTag(const wstring &name) : Tag(name) {} - LongTag(const wstring &name, __int64 data) : Tag(name) {this->data = data; } + LongTag(const wstring &name, int64_t data) : Tag(name) {this->data = data; } void write(DataOutput *dos) { dos->writeLong(data); } void load(DataInput *dis) { data = dis->readLong(); } diff --git a/src/world/McRegionChunkStorage.cpp b/src/world/McRegionChunkStorage.cpp index a11cb1c1..62b39bbb 100644 --- a/src/world/McRegionChunkStorage.cpp +++ b/src/world/McRegionChunkStorage.cpp @@ -45,7 +45,7 @@ McRegionChunkStorage::McRegionChunkStorage(ConsoleSaveFile *saveFile, const wstr for(int i = 0; i < count; ++i) { - __int64 index = dis.readLong(); + int64_t index = dis.readLong(); CompoundTag *tag = NbtIo::read(&dis); ByteArrayOutputStream bos; @@ -78,7 +78,7 @@ LevelChunk *McRegionChunkStorage::load(Level *level, int x, int z) // If we can't find the chunk in the save file, then we should remove any entities we might have for that chunk if(regionChunkInputStream == NULL) { - __int64 index = ((__int64)(x) << 32) | (((__int64)(z))&0x00000000FFFFFFFF); + int64_t index = ((int64_t)(x) << 32) | (((int64_t)(z))&0x00000000FFFFFFFF); AUTO_VAR(it, m_entityData.find(index)); if(it != m_entityData.end()) @@ -235,7 +235,7 @@ void McRegionChunkStorage::saveEntities(Level *level, LevelChunk *levelChunk) { #ifdef SPLIT_SAVES PIXBeginNamedEvent(0,"Saving entities"); - __int64 index = ((__int64)(levelChunk->x) << 32) | (((__int64)(levelChunk->z))&0x00000000FFFFFFFF); + int64_t index = ((int64_t)(levelChunk->x) << 32) | (((int64_t)(levelChunk->z))&0x00000000FFFFFFFF); delete m_entityData[index].data; @@ -269,7 +269,7 @@ void McRegionChunkStorage::saveEntities(Level *level, LevelChunk *levelChunk) void McRegionChunkStorage::loadEntities(Level *level, LevelChunk *levelChunk) { #ifdef SPLIT_SAVES - __int64 index = ((__int64)(levelChunk->x) << 32) | (((__int64)(levelChunk->z))&0x00000000FFFFFFFF); + int64_t index = ((int64_t)(levelChunk->x) << 32) | (((int64_t)(levelChunk->z))&0x00000000FFFFFFFF); AUTO_VAR(it, m_entityData.find(index)); if(it != m_entityData.end()) @@ -345,7 +345,7 @@ void McRegionChunkStorage::staticCtor() } } -int McRegionChunkStorage::runSaveThreadProc(LPVOID lpParam) +int McRegionChunkStorage::runSaveThreadProc(void* lpParam) { Compression::CreateNewThreadStorage(); diff --git a/src/world/McRegionChunkStorage.h b/src/world/McRegionChunkStorage.h index 50dabd52..83525589 100644 --- a/src/world/McRegionChunkStorage.h +++ b/src/world/McRegionChunkStorage.h @@ -16,7 +16,7 @@ private: ConsoleSaveFile *m_saveFile; static CRITICAL_SECTION cs_memory; - unordered_map<__int64, byteArray> m_entityData; + unordered_map m_entityData; static std::deque s_chunkDataQueue; static int s_runningThreadCount; @@ -39,5 +39,5 @@ public: private: static void WaitForAllSaves(); static void WaitForSaves(); - static int runSaveThreadProc(LPVOID lpParam); + static int runSaveThreadProc(void* lpParam); }; diff --git a/src/world/McRegionLevelStorage.cpp b/src/world/McRegionLevelStorage.cpp index 687ee048..d8f4a829 100644 --- a/src/world/McRegionLevelStorage.cpp +++ b/src/world/McRegionLevelStorage.cpp @@ -33,7 +33,7 @@ ChunkStorage *McRegionLevelStorage::createChunkStorage(Dimension *dimension) vector *netherFiles = m_saveFile->getRegionFilesByDimension(1); if(netherFiles!=NULL) { - DWORD bytesWritten = 0; + unsigned long bytesWritten = 0; for(AUTO_VAR(it, netherFiles->begin()); it != netherFiles->end(); ++it) { m_saveFile->zeroFile(*it, (*it)->getFileSize(), &bytesWritten); diff --git a/src/world/Mob.cpp b/src/world/Mob.cpp index 622a9346..c196f987 100644 --- a/src/world/Mob.cpp +++ b/src/world/Mob.cpp @@ -1097,7 +1097,7 @@ void Mob::addAdditonalSaveData(CompoundTag *entityTag) MobEffectInstance *effect = it->second; CompoundTag *tag = new CompoundTag(); - tag->putByte(L"Id", (BYTE) effect->getId()); + tag->putByte(L"Id", (uint8_t) effect->getId()); tag->putByte(L"Amplifier", (char) effect->getAmplifier()); tag->putInt(L"Duration", effect->getDuration()); listTag->add(tag); diff --git a/src/world/Mth.cpp b/src/world/Mth.cpp index eccd828e..3b5412ad 100644 --- a/src/world/Mth.cpp +++ b/src/world/Mth.cpp @@ -50,9 +50,9 @@ int Mth::floor(float v) return v < i ? i - 1 : i; } -__int64 Mth::lfloor(double v) +int64_t Mth::lfloor(double v) { - __int64 i = (__int64) v; + int64_t i = (int64_t) v; return v < i ? i - 1 : i; } diff --git a/src/world/Mth.h b/src/world/Mth.h index 17119fb1..78c3ef10 100644 --- a/src/world/Mth.h +++ b/src/world/Mth.h @@ -22,7 +22,7 @@ public : static float sqrt(float x); static float sqrt(double x); static int floor(float v); - static __int64 lfloor(double v); + static int64_t lfloor(double v); static int fastFloor(double x); static int floor(double v); static int absFloor(double v); diff --git a/src/world/NbtSlotFile.cpp b/src/world/NbtSlotFile.cpp index 81880cfb..55866627 100644 --- a/src/world/NbtSlotFile.cpp +++ b/src/world/NbtSlotFile.cpp @@ -4,7 +4,7 @@ byteArray NbtSlotFile::READ_BUFFER(1024*1024); -__int64 NbtSlotFile::largest = 0; +int64_t NbtSlotFile::largest = 0; NbtSlotFile::NbtSlotFile(File file) { @@ -29,7 +29,7 @@ NbtSlotFile::NbtSlotFile(File file) fileSlotMap[i] = new vector; } - DWORD numberofBytesRead; + unsigned long numberofBytesRead; for (int fileSlot = 0; fileSlot < totalFileSlots; fileSlot++) { seekSlotHeader(fileSlot); @@ -49,7 +49,7 @@ NbtSlotFile::NbtSlotFile(File file) void NbtSlotFile::readHeader() { - DWORD numberOfBytesRead; + unsigned long numberOfBytesRead; SetFilePointer(raf,0,0,FILE_BEGIN); int magic; ReadFile(raf,&magic,4,&numberOfBytesRead,NULL); @@ -62,7 +62,7 @@ void NbtSlotFile::readHeader() void NbtSlotFile::writeHeader() { - DWORD numberOfBytesWritten; + unsigned long numberOfBytesWritten; short version = 0; SetFilePointer(raf,0,0,FILE_BEGIN); WriteFile(raf,&MAGIC_NUMBER,4,&numberOfBytesWritten,NULL); @@ -84,7 +84,7 @@ void NbtSlotFile::seekSlot(int fileSlot) vector *NbtSlotFile::readAll(int slot) { - DWORD numberOfBytesRead; + unsigned long numberOfBytesRead; vector *tags = new vector; vector *fileSlots = fileSlotMap[slot]; int skipped = 0; @@ -161,7 +161,7 @@ int NbtSlotFile::getFreeSlot() } void NbtSlotFile::replaceSlot(int slot, vector *tags) { - DWORD numberOfBytesWritten; + unsigned long numberOfBytesWritten; toReplace = fileSlotMap[slot]; fileSlotMap[slot] = new vector(); diff --git a/src/world/NbtSlotFile.h b/src/world/NbtSlotFile.h index 93b4fe57..d47a61ab 100644 --- a/src/world/NbtSlotFile.h +++ b/src/world/NbtSlotFile.h @@ -14,12 +14,12 @@ private: static const int FILE_SLOT_HEADER_SIZE = 12; static const int FILE_SLOT_SIZE = 500; - HANDLE raf; + void* raf; vector **fileSlotMap; int fileSlotMapLength; vector freeFileSlots; int totalFileSlots; - static __int64 largest; + static int64_t largest; public: NbtSlotFile(File file); diff --git a/src/world/NotGateTile.cpp b/src/world/NotGateTile.cpp index a3971284..c458d114 100644 --- a/src/world/NotGateTile.cpp +++ b/src/world/NotGateTile.cpp @@ -221,7 +221,7 @@ int NotGateTile::cloneTileId(Level *level, int x, int y, int z) return Tile::notGate_on_Id; } -void NotGateTile::levelTimeChanged(Level *level, __int64 delta, __int64 newTime) +void NotGateTile::levelTimeChanged(Level *level, int64_t delta, int64_t newTime) { deque *toggles = recentToggles[level]; diff --git a/src/world/NotGateTile.h b/src/world/NotGateTile.h index 52dd4a2e..ea0aac1e 100644 --- a/src/world/NotGateTile.h +++ b/src/world/NotGateTile.h @@ -19,9 +19,9 @@ public: { public: int x, y, z; - __int64 when; + int64_t when; - Toggle(int x, int y, int z, __int64 when) + Toggle(int x, int y, int z, int64_t when) { this->x = x; this->y = y; @@ -61,7 +61,7 @@ public: public: void animateTick(Level *level, int xt, int yt, int zt, Random *random); int cloneTileId(Level *level, int x, int y, int z); - void levelTimeChanged(Level *level, __int64 delta, __int64 newTime); + void levelTimeChanged(Level *level, int64_t delta, int64_t newTime); void registerIcons(IconRegister *iconRegister); }; \ No newline at end of file diff --git a/src/world/OldChunkStorage.cpp b/src/world/OldChunkStorage.cpp index 50c29a96..149d9c49 100644 --- a/src/world/OldChunkStorage.cpp +++ b/src/world/OldChunkStorage.cpp @@ -8,7 +8,7 @@ #include "net.minecraft.world.level.storage.h" #include "FileHeader.h" #include "OldChunkStorage.h" -DWORD OldChunkStorage::tlsIdx = 0; +unsigned long OldChunkStorage::tlsIdx = 0; OldChunkStorage::ThreadStorage *OldChunkStorage::tlsDefault = NULL; OldChunkStorage::ThreadStorage::ThreadStorage() @@ -283,7 +283,7 @@ void OldChunkStorage::save(LevelChunk *lc, Level *level, DataOutputStream *dos) vector *ticksInChunk = level->fetchTicksInChunk(lc, false); if (ticksInChunk != NULL) { - __int64 levelTime = level->getTime(); + int64_t levelTime = level->getTime(); ListTag *tickTags = new ListTag(); for( int i = 0; i < ticksInChunk->size(); i++ ) @@ -372,7 +372,7 @@ void OldChunkStorage::save(LevelChunk *lc, Level *level, CompoundTag *tag) vector *ticksInChunk = level->fetchTicksInChunk(lc, false); if (ticksInChunk != NULL) { - __int64 levelTime = level->getTime(); + int64_t levelTime = level->getTime(); ListTag *tickTags = new ListTag(); for( int i = 0; i < ticksInChunk->size(); i++ ) diff --git a/src/world/OldChunkStorage.h b/src/world/OldChunkStorage.h index a77b102c..290e6b9c 100644 --- a/src/world/OldChunkStorage.h +++ b/src/world/OldChunkStorage.h @@ -22,7 +22,7 @@ private: ThreadStorage(); ~ThreadStorage(); }; - static DWORD tlsIdx; + static unsigned long tlsIdx; static ThreadStorage *tlsDefault; public: // Each new thread that needs to use Compression will need to call one of the following 2 functions, to either create its own diff --git a/src/world/Packet.cpp b/src/world/Packet.cpp index 48a3804f..6a6214d3 100644 --- a/src/world/Packet.cpp +++ b/src/world/Packet.cpp @@ -271,9 +271,9 @@ void Packet::renderAllPacketStatsKey() #endif } -__int64 Packet::getIndexedStatValue(unsigned int samplePos, unsigned int renderableId) +int64_t Packet::getIndexedStatValue(unsigned int samplePos, unsigned int renderableId) { - __int64 val = 0; + int64_t val = 0; #ifndef _CONTENT_PACKAGE #if PACKET_ENABLE_STAT_TRACKING @@ -489,7 +489,7 @@ void Packet::PacketStatistics::renderStats( ) #endif } -__int64 Packet::PacketStatistics::getCountSample(int samplePos) +int64_t Packet::PacketStatistics::getCountSample(int samplePos) { if(samplePos == 511) { diff --git a/src/world/Packet.h b/src/world/Packet.h index 60410df3..6ce210fd 100644 --- a/src/world/Packet.h +++ b/src/world/Packet.h @@ -22,10 +22,10 @@ public: int totalSize; // 4J Added - __int64 countSamples[512]; - __int64 sizeSamples[512]; + int64_t countSamples[512]; + int64_t sizeSamples[512]; int samplesPos; - __int64 firstSampleTime; + int64_t firstSampleTime; public: @@ -39,7 +39,7 @@ public: // 4J Added void renderStats(); - __int64 getCountSample(int samplePos); + int64_t getCountSample(int samplePos); wstring getLegendString(); }; @@ -58,7 +58,7 @@ public: static void map(int id, bool receiveOnClient, bool receiveOnServer, bool sendToAnyClient, bool renderStats, const type_info& clazz, packetCreateFn ); public: - const __int64 createTime; + const int64_t createTime; Packet(); @@ -84,7 +84,7 @@ public: static void renderPacketStats(int id); static void renderAllPacketStats(); static void renderAllPacketStatsKey(); - static __int64 getIndexedStatValue(unsigned int samplePos, unsigned int renderableId); + static int64_t getIndexedStatValue(unsigned int samplePos, unsigned int renderableId); private : static unordered_map statistics; diff --git a/src/world/PerlinNoise.cpp b/src/world/PerlinNoise.cpp index b4fd8004..b4c65e55 100644 --- a/src/world/PerlinNoise.cpp +++ b/src/world/PerlinNoise.cpp @@ -77,8 +77,8 @@ doubleArray PerlinNoise::getRegion(doubleArray buffer, int x, int y, int z, int double xx = x * pow * xScale; double yy = y * pow * yScale; double zz = z * pow * zScale; - __int64 xb = Mth::lfloor(xx); - __int64 zb = Mth::lfloor(zz); + int64_t xb = Mth::lfloor(xx); + int64_t zb = Mth::lfloor(zz); xx -= xb; zz -= zb; xb %= 16777216; diff --git a/src/world/PistonBaseTile.cpp b/src/world/PistonBaseTile.cpp index 6306c843..8308465b 100644 --- a/src/world/PistonBaseTile.cpp +++ b/src/world/PistonBaseTile.cpp @@ -19,7 +19,7 @@ const wstring PistonBaseTile::INSIDE_TEX = L"piston_inner_top"; const float PistonBaseTile::PLATFORM_THICKNESS = 4.0f; -DWORD PistonBaseTile::tlsIdx = TlsAlloc(); +unsigned long PistonBaseTile::tlsIdx = TlsAlloc(); // 4J - NOTE - this ignoreUpdate stuff has been removed from the java version, but I'm not currently sure how the java version does without it... there must be // some other mechanism that we don't have that stops the event from one piston being processed, from causing neighbours to have extra events created for them. @@ -33,7 +33,7 @@ bool PistonBaseTile::ignoreUpdate() void PistonBaseTile::ignoreUpdate(bool set) { - TlsSetValue(tlsIdx,(LPVOID)(set?1:0)); + TlsSetValue(tlsIdx,(void*)(set?1:0)); } PistonBaseTile::PistonBaseTile(int id, bool isSticky) : Tile(id, Material::piston, isSolidRender() ) diff --git a/src/world/PistonBaseTile.h b/src/world/PistonBaseTile.h index 0fda1391..e563b556 100644 --- a/src/world/PistonBaseTile.h +++ b/src/world/PistonBaseTile.h @@ -25,7 +25,7 @@ private: Icon *iconBack; Icon *iconPlatform; - static DWORD tlsIdx; + static unsigned long tlsIdx; // 4J - was just a static but implemented with TLS for our version static bool ignoreUpdate(); static void ignoreUpdate(bool set); diff --git a/src/world/Player.cpp b/src/world/Player.cpp index f5b065e4..2b3c4088 100644 --- a/src/world/Player.cpp +++ b/src/world/Player.cpp @@ -619,7 +619,7 @@ void Player::setPlayerDefaultSkin(EDefaultSkins skin) m_skinIndex = skin; } -void Player::setCustomSkin(DWORD skinId) +void Player::setCustomSkin(unsigned long skinId) { #ifndef _CONTENT_PACKAGE wprintf(L"Attempting to set skin to %08X for player %ls\n", skinId, name.c_str() ); @@ -633,8 +633,8 @@ void Player::setCustomSkin(DWORD skinId) if( !GET_IS_DLC_SKIN_FROM_BITMASK(skinId) ) { // GET_UGC_SKIN_ID_FROM_BITMASK will always be zero - this was for a possible custom skin editor skin - DWORD ugcSkinIndex = GET_UGC_SKIN_ID_FROM_BITMASK(skinId); - DWORD defaultSkinIndex = GET_DEFAULT_SKIN_ID_FROM_BITMASK(skinId); + unsigned long ugcSkinIndex = GET_UGC_SKIN_ID_FROM_BITMASK(skinId); + unsigned long defaultSkinIndex = GET_DEFAULT_SKIN_ID_FROM_BITMASK(skinId); if( ugcSkinIndex == 0 && defaultSkinIndex > 0 ) { playerSkin = (EDefaultSkins) defaultSkinIndex; @@ -665,7 +665,7 @@ void Player::setCustomSkin(DWORD skinId) if(pDLCSkinFile!=NULL) { - DWORD dwBoxC=pDLCSkinFile->getAdditionalBoxesCount(); + unsigned long dwBoxC=pDLCSkinFile->getAdditionalBoxesCount(); if(dwBoxC!=0) { app.DebugPrintf("Got model parts from DLCskin for skin %X\n",m_dwSkinId); @@ -698,7 +698,7 @@ void Player::setCustomSkin(DWORD skinId) } -unsigned int Player::getSkinAnimOverrideBitmask(DWORD skinId) +unsigned int Player::getSkinAnimOverrideBitmask(unsigned long skinId) { unsigned long bitmask = 0L; if( GET_IS_DLC_SKIN_FROM_BITMASK(skinId) ) @@ -750,7 +750,7 @@ void Player::setXuid(PlayerUID xuid) #endif } -void Player::setCustomCape(DWORD capeId) +void Player::setCustomCape(unsigned long capeId) { #ifndef _CONTENT_PACKAGE wprintf(L"Attempting to set cape to %08X for player %s\n", capeId, name.c_str() ); @@ -800,7 +800,7 @@ void Player::setCustomCape(DWORD capeId) } } -DWORD Player::getCapeIdFromPath(const wstring &cape) +unsigned long Player::getCapeIdFromPath(const wstring &cape) { bool dlcCape = false; unsigned int capeId = 0; @@ -826,9 +826,9 @@ DWORD Player::getCapeIdFromPath(const wstring &cape) return capeId; } -wstring Player::getCapePathFromId(DWORD capeId) +wstring Player::getCapePathFromId(unsigned long capeId) { - // 4J Stu - This function maps the encoded DWORD we store in the player profile + // 4J Stu - This function maps the encoded unsigned long we store in the player profile // to a filename that is stored as a memory texture and shared between systems in game wchar_t chars[256]; if( GET_IS_DLC_SKIN_FROM_BITMASK(capeId) ) @@ -839,8 +839,8 @@ wstring Player::getCapePathFromId(DWORD capeId) } else { - DWORD ugcCapeIndex = GET_UGC_SKIN_ID_FROM_BITMASK(capeId); - DWORD defaultCapeIndex = GET_DEFAULT_SKIN_ID_FROM_BITMASK(capeId); + unsigned long ugcCapeIndex = GET_UGC_SKIN_ID_FROM_BITMASK(capeId); + unsigned long defaultCapeIndex = GET_DEFAULT_SKIN_ID_FROM_BITMASK(capeId); if( ugcCapeIndex == 0 ) { swprintf(chars,256,L"defcape%08X.png",defaultCapeIndex); @@ -2957,7 +2957,7 @@ vector *Player::GetAdditionalModelParts() if(pDLCSkinFile!=NULL) { - DWORD dwBoxC=pDLCSkinFile->getAdditionalBoxesCount(); + unsigned long dwBoxC=pDLCSkinFile->getAdditionalBoxesCount(); if(dwBoxC!=0) { app.DebugPrintf("m_bCheckedForModelParts Got model parts from DLCskin for skin %X\n",m_dwSkinId); diff --git a/src/world/Player.h b/src/world/Player.h index c323bf05..2595b33f 100644 --- a/src/world/Player.h +++ b/src/world/Player.h @@ -64,7 +64,7 @@ protected: int jumpTriggerTime; public: - BYTE userType; + uint8_t userType; int score; float oBob, bob; bool swinging; @@ -396,14 +396,14 @@ public: virtual int getTexture(); // 4J changed from wstring to int void setPlayerDefaultSkin(EDefaultSkins skin); EDefaultSkins getPlayerDefaultSkin() { return m_skinIndex; } - virtual void setCustomSkin(DWORD skinId); - DWORD getCustomSkin() {return m_dwSkinId; } - virtual void setCustomCape(DWORD capeId); - DWORD getCustomCape() {return m_dwCapeId; } + virtual void setCustomSkin(unsigned long skinId); + unsigned long getCustomSkin() {return m_dwSkinId; } + virtual void setCustomCape(unsigned long capeId); + unsigned long getCustomCape() {return m_dwCapeId; } - static DWORD getCapeIdFromPath(const wstring &cape); - static wstring getCapePathFromId(DWORD capeId); - static unsigned int getSkinAnimOverrideBitmask(DWORD skinId); + static unsigned long getCapeIdFromPath(const wstring &cape); + static wstring getCapePathFromId(unsigned long capeId); + static unsigned int getSkinAnimOverrideBitmask(unsigned long skinId); // 4J Added void setXuid(PlayerUID xuid); @@ -413,8 +413,8 @@ public: void setUUID(const wstring &UUID) { m_UUID = UUID; } wstring getUUID() { return m_UUID; } - void setPlayerIndex(DWORD dwIndex) { m_playerIndex = dwIndex; } - DWORD getPlayerIndex() { return m_playerIndex; } + void setPlayerIndex(unsigned long dwIndex) { m_playerIndex = dwIndex; } + unsigned long getPlayerIndex() { return m_playerIndex; } void setIsGuest(bool bVal) { m_bIsGuest = bVal; } bool isGuest() { return m_bIsGuest; } @@ -436,10 +436,10 @@ protected: private: EDefaultSkins m_skinIndex; - DWORD m_dwSkinId,m_dwCapeId; + unsigned long m_dwSkinId,m_dwCapeId; // 4J Added - Used to show which colour the player is on the map/behind their name - DWORD m_playerIndex; + unsigned long m_playerIndex; // 4J-PB - to track debug options from the server player unsigned int m_uiDebugOptions; diff --git a/src/world/PlayerInfoPacket.cpp b/src/world/PlayerInfoPacket.cpp index be546aca..c72b3f32 100644 --- a/src/world/PlayerInfoPacket.cpp +++ b/src/world/PlayerInfoPacket.cpp @@ -17,7 +17,7 @@ PlayerInfoPacket::PlayerInfoPacket() m_entityId = -1; } -PlayerInfoPacket::PlayerInfoPacket(BYTE networkSmallId, short playerColourIndex, unsigned int playerPrivileges) +PlayerInfoPacket::PlayerInfoPacket(uint8_t networkSmallId, short playerColourIndex, unsigned int playerPrivileges) { m_networkSmallId = networkSmallId; m_playerColourIndex = playerColourIndex; diff --git a/src/world/PlayerInfoPacket.h b/src/world/PlayerInfoPacket.h index 85e2ed64..74fecf3f 100644 --- a/src/world/PlayerInfoPacket.h +++ b/src/world/PlayerInfoPacket.h @@ -18,7 +18,7 @@ class PlayerInfoPacket : public Packet, public enable_shared_from_this player); virtual void read(DataInputStream *dis); diff --git a/src/world/PreLoginPacket.cpp b/src/world/PreLoginPacket.cpp index 4b474214..4cb08684 100644 --- a/src/world/PreLoginPacket.cpp +++ b/src/world/PreLoginPacket.cpp @@ -34,7 +34,7 @@ PreLoginPacket::PreLoginPacket(wstring userName) m_netcodeVersion = 0; } -PreLoginPacket::PreLoginPacket(wstring userName, PlayerUID *playerXuids, DWORD playerCount, BYTE friendsOnlyBits, DWORD ugcPlayersVersion,char *pszUniqueSaveName, DWORD serverSettings, BYTE hostIndex, DWORD texturePackId) +PreLoginPacket::PreLoginPacket(wstring userName, PlayerUID *playerXuids, unsigned long playerCount, uint8_t friendsOnlyBits, unsigned long ugcPlayersVersion,char *pszUniqueSaveName, unsigned long serverSettings, uint8_t hostIndex, unsigned long texturePackId) { this->loginKey = userName; m_playerXuids = playerXuids; @@ -65,20 +65,20 @@ void PreLoginPacket::read(DataInputStream *dis) //throws IOException if( m_dwPlayerCount > 0 ) { m_playerXuids = new PlayerUID[m_dwPlayerCount]; - for(DWORD i = 0; i < m_dwPlayerCount; ++i) + for(unsigned long i = 0; i < m_dwPlayerCount; ++i) { m_playerXuids[i] = dis->readPlayerUID(); } } - for(DWORD i = 0; i < m_iSaveNameLen; ++i) + for(unsigned long i = 0; i < m_iSaveNameLen; ++i) { m_szUniqueSaveName[i]=dis->readByte(); } m_serverSettings = dis->readInt(); m_hostIndex = dis->readByte(); - INT texturePackId = dis->readInt(); - m_texturePackId = *(DWORD *)&texturePackId; + int texturePackId = dis->readInt(); + m_texturePackId = *(unsigned long *)&texturePackId; // Set the name of the map so we can check it for players banned lists app.SetUniqueMapName((char *)m_szUniqueSaveName); @@ -93,13 +93,13 @@ void PreLoginPacket::write(DataOutputStream *dos) //throws IOException dos->writeByte(m_friendsOnlyBits); dos->writeInt(m_ugcPlayersVersion); dos->writeByte((byte)m_dwPlayerCount); - for(DWORD i = 0; i < m_dwPlayerCount; ++i) + for(unsigned long i = 0; i < m_dwPlayerCount; ++i) { dos->writePlayerUID( m_playerXuids[i] ); } app.DebugPrintf("*** PreLoginPacket::write - %s\n",m_szUniqueSaveName); - for(DWORD i = 0; i < m_iSaveNameLen; ++i) + for(unsigned long i = 0; i < m_iSaveNameLen; ++i) { dos->writeByte(m_szUniqueSaveName[i]); } diff --git a/src/world/PreLoginPacket.h b/src/world/PreLoginPacket.h index 243f2f36..ba97115d 100644 --- a/src/world/PreLoginPacket.h +++ b/src/world/PreLoginPacket.h @@ -12,20 +12,20 @@ public: // join, and so that we can inform the server if we have that privilege set. Anyone with UGC turned off completely // can't play the game online at all, so we only need to specify players with friends only set PlayerUID *m_playerXuids; - DWORD m_dwPlayerCount; - BYTE m_friendsOnlyBits; - DWORD m_ugcPlayersVersion; - BYTE m_szUniqueSaveName[m_iSaveNameLen]; // added for checking if the level is in the ban list - DWORD m_serverSettings; // A bitfield of server settings constructed with the MAKE_SERVER_SETTINGS macro - BYTE m_hostIndex; // Rather than sending the xuid of the host again, send an index into the m_playerXuids array - DWORD m_texturePackId; - SHORT m_netcodeVersion; + unsigned long m_dwPlayerCount; + uint8_t m_friendsOnlyBits; + unsigned long m_ugcPlayersVersion; + uint8_t m_szUniqueSaveName[m_iSaveNameLen]; // added for checking if the level is in the ban list + unsigned long m_serverSettings; // A bitfield of server settings constructed with the MAKE_SERVER_SETTINGS macro + uint8_t m_hostIndex; // Rather than sending the xuid of the host again, send an index into the m_playerXuids array + unsigned long m_texturePackId; + int16_t m_netcodeVersion; wstring loginKey; PreLoginPacket(); PreLoginPacket(wstring userName); - PreLoginPacket(wstring userName, PlayerUID *playerXuids, DWORD playerCount, BYTE friendsOnlyBits, DWORD ugcPlayersVersion,char *pszUniqueSaveName, DWORD serverSettings, BYTE hostIndex, DWORD texturePackId); + PreLoginPacket(wstring userName, PlayerUID *playerXuids, unsigned long playerCount, uint8_t friendsOnlyBits, unsigned long ugcPlayersVersion,char *pszUniqueSaveName, unsigned long serverSettings, uint8_t hostIndex, unsigned long texturePackId); ~PreLoginPacket(); virtual void read(DataInputStream *dis); diff --git a/src/world/Random.cpp b/src/world/Random.cpp index 9176bf38..fccb6b10 100644 --- a/src/world/Random.cpp +++ b/src/world/Random.cpp @@ -6,19 +6,19 @@ Random::Random() { // 4J - jave now uses the system nanosecond counter added to a "seedUniquifier" to get an initial seed. Our nanosecond timer is actually only millisecond accuate, so // use QueryPerformanceCounter here instead - __int64 seed; + int64_t seed; QueryPerformanceCounter((LARGE_INTEGER *)&seed); seed += 8682522807148012LL; setSeed(seed); } -Random::Random(__int64 seed) +Random::Random(int64_t seed) { setSeed(seed); } -void Random::setSeed(__int64 s) +void Random::setSeed(int64_t s) { this->seed = (s ^ 0x5DEECE66DLL) & ((1LL << 48) - 1); haveNextNextGaussian = false; @@ -41,7 +41,7 @@ void Random::nextBytes(byte *bytes, unsigned int count) double Random::nextDouble() { - return (((__int64)next(26) << 27) + next(27)) + return (((int64_t)next(26) << 27) + next(27)) / (double)(1LL << 53); } @@ -79,7 +79,7 @@ int Random::nextInt(int n) if ((n & -n) == n) // i.e., n is a power of 2 - return (int)(((__int64)next(31) * n) >> 31); // 4J Stu - Made __int64 instead of long + return (int)(((int64_t)next(31) * n) >> 31); // 4J Stu - Made int64_t instead of long int bits, val; do @@ -95,9 +95,9 @@ float Random::nextFloat() return next(24) / ((float)(1 << 24)); } -__int64 Random::nextLong() +int64_t Random::nextLong() { - return ((__int64)next(32) << 32) + next(32); + return ((int64_t)next(32) << 32) + next(32); } bool Random::nextBoolean() diff --git a/src/world/Random.h b/src/world/Random.h index 9af3a3c2..cfb6af26 100644 --- a/src/world/Random.h +++ b/src/world/Random.h @@ -3,21 +3,21 @@ class Random { private: - __int64 seed; + int64_t seed; bool haveNextNextGaussian; double nextNextGaussian; protected: int next(int bits); public: Random(); - Random(__int64 seed); - void setSeed(__int64 s); + Random(int64_t seed); + void setSeed(int64_t s); void nextBytes(byte *bytes, unsigned int count); double nextDouble(); double nextGaussian(); int nextInt(); int nextInt(int to); float nextFloat(); - __int64 nextLong(); + int64_t nextLong(); bool nextBoolean(); }; \ No newline at end of file diff --git a/src/world/RandomLevelSource.cpp b/src/world/RandomLevelSource.cpp index a03845dd..cdb0e148 100644 --- a/src/world/RandomLevelSource.cpp +++ b/src/world/RandomLevelSource.cpp @@ -23,7 +23,7 @@ static PerlinNoise_DataIn g_depthNoise_SPU __attribute__((__aligned__(16))); const double RandomLevelSource::SNOW_SCALE = 0.3; const double RandomLevelSource::SNOW_CUTOFF = 0.5; -RandomLevelSource::RandomLevelSource(Level *level, __int64 seed, bool generateStructures) : generateStructures( generateStructures ) +RandomLevelSource::RandomLevelSource(Level *level, int64_t seed, bool generateStructures) : generateStructures( generateStructures ) { m_XZSize = level->getLevelData()->getXZSize(); @@ -652,8 +652,8 @@ void RandomLevelSource::postProcess(ChunkSource *parent, int xt, int zt) } pprandom->setSeed(level->getSeed()); - __int64 xScale = pprandom->nextLong() / 2 * 2 + 1; - __int64 zScale = pprandom->nextLong() / 2 * 2 + 1; + int64_t xScale = pprandom->nextLong() / 2 * 2 + 1; + int64_t zScale = pprandom->nextLong() / 2 * 2 + 1; pprandom->setSeed(((xt * xScale) + (zt * zScale)) ^ level->getSeed()); bool hasVillage = false; diff --git a/src/world/RandomLevelSource.h b/src/world/RandomLevelSource.h index d71028b1..6be1ebdb 100644 --- a/src/world/RandomLevelSource.h +++ b/src/world/RandomLevelSource.h @@ -47,7 +47,7 @@ private: floatArray pows; public: - RandomLevelSource(Level *level, __int64 seed, bool generateStructures); + RandomLevelSource(Level *level, int64_t seed, bool generateStructures); ~RandomLevelSource(); public: diff --git a/src/world/RegionFile.cpp b/src/world/RegionFile.cpp index 2cfd9078..dfb7bfe9 100644 --- a/src/world/RegionFile.cpp +++ b/src/world/RegionFile.cpp @@ -58,8 +58,8 @@ RegionFile::RegionFile(ConsoleSaveFile *saveFile, File *path) if ((fileEntry->getFileSize() & 0xfff) != 0) { //byte zero = 0; - DWORD numberOfBytesWritten = 0; - DWORD bytesToWrite = 0x1000 - (fileEntry->getFileSize() & 0xfff); + unsigned long numberOfBytesWritten = 0; + unsigned long bytesToWrite = 0x1000 - (fileEntry->getFileSize() & 0xfff); byte *zeroBytes = new byte[ bytesToWrite ]; ZeroMemory(zeroBytes, bytesToWrite); @@ -95,7 +95,7 @@ RegionFile::RegionFile(ConsoleSaveFile *saveFile, File *path) for (int i = 0; i < SECTOR_INTS; ++i) { unsigned int offset = 0; - DWORD numberOfBytesRead = 0; + unsigned long numberOfBytesRead = 0; if( !m_bIsEmpty ) // 4J added condition, don't read back if we've just created an empty file as we don't immediately write this anymore { m_saveFile->readFile(fileEntry, &offset, 4, &numberOfBytesRead); @@ -115,7 +115,7 @@ RegionFile::RegionFile(ConsoleSaveFile *saveFile, File *path) for (int i = 0; i < SECTOR_INTS; ++i) { int lastModValue = 0; - DWORD numberOfBytesRead = 0; + unsigned long numberOfBytesRead = 0; if( !m_bIsEmpty ) // 4J added condition, don't read back if we've just created an empty file as we don't immediately write this anymore { m_saveFile->readFile(fileEntry, &lastModValue, 4, &numberOfBytesRead); @@ -138,7 +138,7 @@ void RegionFile::writeAllOffsets() // used for the file ConsoleSaveFile conversi // save all the offsets and timestamps m_saveFile->LockSaveAccess(); - DWORD numberOfBytesWritten = 0; + unsigned long numberOfBytesWritten = 0; m_saveFile->setFilePointer( fileEntry, 0, NULL, FILE_BEGIN ); m_saveFile->writeFile(fileEntry,offsets, SECTOR_BYTES ,&numberOfBytesWritten); @@ -158,7 +158,7 @@ RegionFile::~RegionFile() m_saveFile->closeHandle( fileEntry ); } -__int64 RegionFile::lastModified() +int64_t RegionFile::lastModified() { return _lastModified; } @@ -205,7 +205,7 @@ DataInputStream *RegionFile::getChunkDataInputStream(int x, int z) // TODO - was unsigned int decompLength; unsigned int readDecompLength; - DWORD numberOfBytesRead = 0; + unsigned long numberOfBytesRead = 0; // 4J - this differs a bit from the java file format. Java has length stored as an int, then a type as a byte, then length-1 bytes of data // We store length and decompression length as ints, then length bytes of xbox LZX compressed data @@ -379,7 +379,7 @@ void RegionFile::write(int x, int z, byte *data, int length) // TODO - was sync #ifndef _CONTENT_PACAKGE //wprintf(L"Writing chunk (%d,%d) in %ls from new sector %d to %d\n", x,z, fileEntry->data.filename, sectorNumber, sectorNumber + sectorsNeeded - 1); #endif - DWORD numberOfBytesWritten = 0; + unsigned long numberOfBytesWritten = 0; for (int i = 0; i < sectorsNeeded; ++i) { //WriteFile(file,emptySector.data,SECTOR_BYTES,&numberOfBytesWritten,NULL); @@ -405,7 +405,7 @@ void RegionFile::write(int x, int z, byte *data, int length) // TODO - was sync /* write a chunk data to the region file at specified sector number */ void RegionFile::write(int sectorNumber, byte *data, int length, unsigned int compLength) { - DWORD numberOfBytesWritten = 0; + unsigned long numberOfBytesWritten = 0; //SetFilePointer(file,sectorNumber * SECTOR_BYTES,0,FILE_BEGIN); m_saveFile->setFilePointer( fileEntry, sectorNumber * SECTOR_BYTES, NULL, FILE_BEGIN ); @@ -424,7 +424,7 @@ void RegionFile::write(int sectorNumber, byte *data, int length, unsigned int co void RegionFile::zero(int sectorNumber, int length) { - DWORD numberOfBytesWritten = 0; + unsigned long numberOfBytesWritten = 0; //SetFilePointer(file,sectorNumber * SECTOR_BYTES,0,FILE_BEGIN); m_saveFile->setFilePointer( fileEntry, sectorNumber * SECTOR_BYTES, NULL, FILE_BEGIN ); m_saveFile->zeroFile( fileEntry, length, &numberOfBytesWritten ); @@ -450,7 +450,7 @@ bool RegionFile::hasChunk(int x, int z) void RegionFile::insertInitialSectors() { m_saveFile->setFilePointer( fileEntry, 0, NULL, FILE_BEGIN ); - DWORD numberOfBytesWritten = 0; + unsigned long numberOfBytesWritten = 0; byte zeroBytes[ SECTOR_BYTES ]; ZeroMemory(zeroBytes, SECTOR_BYTES); @@ -470,7 +470,7 @@ void RegionFile::setOffset(int x, int z, int offset) insertInitialSectors(); // 4J added } - DWORD numberOfBytesWritten = 0; + unsigned long numberOfBytesWritten = 0; offsets[x + z * 32] = offset; m_saveFile->setFilePointer( fileEntry, (x + z * 32) * 4, NULL, FILE_BEGIN ); @@ -484,7 +484,7 @@ void RegionFile::setTimestamp(int x, int z, int value) insertInitialSectors(); // 4J added } - DWORD numberOfBytesWritten = 0; + unsigned long numberOfBytesWritten = 0; chunkTimestamps[x + z * 32] = value; m_saveFile->setFilePointer( fileEntry, SECTOR_BYTES + (x + z * 32) * 4, NULL, FILE_BEGIN ); diff --git a/src/world/RegionFile.h b/src/world/RegionFile.h index 0717c8c2..3187ba2e 100644 --- a/src/world/RegionFile.h +++ b/src/world/RegionFile.h @@ -24,14 +24,14 @@ private: static byteArray emptySector; File *fileName; - //HANDLE file; + //void* file; ConsoleSaveFile *m_saveFile; int *offsets; int *chunkTimestamps; vector *sectorFree; int sizeDelta; - __int64 _lastModified; + int64_t _lastModified; bool m_bIsEmpty; // 4J added public: @@ -39,7 +39,7 @@ public: ~RegionFile(); /* the modification date of the region file when it was first opened */ - __int64 lastModified(); + int64_t lastModified(); /* gets how much the region file has grown since it was last checked */ int getSizeDelta(); diff --git a/src/world/RegionHillsLayer.cpp b/src/world/RegionHillsLayer.cpp index dad114b0..a1e17524 100644 --- a/src/world/RegionHillsLayer.cpp +++ b/src/world/RegionHillsLayer.cpp @@ -3,7 +3,7 @@ #include "IntCache.h" #include "RegionHillsLayer.h" -RegionHillsLayer::RegionHillsLayer(__int64 seed, shared_ptr parent) : Layer(seed) +RegionHillsLayer::RegionHillsLayer(int64_t seed, shared_ptr parent) : Layer(seed) { this->parent = parent; } diff --git a/src/world/RegionHillsLayer.h b/src/world/RegionHillsLayer.h index 30d7eced..5ad0bb75 100644 --- a/src/world/RegionHillsLayer.h +++ b/src/world/RegionHillsLayer.h @@ -5,7 +5,7 @@ class RegionHillsLayer : public Layer { public: - RegionHillsLayer(__int64 seed, shared_ptr parent); + RegionHillsLayer(int64_t seed, shared_ptr parent); intArray getArea(int xo, int yo, int w, int h); }; \ No newline at end of file diff --git a/src/world/RespawnPacket.cpp b/src/world/RespawnPacket.cpp index 5c04bbeb..a8ec08f7 100644 --- a/src/world/RespawnPacket.cpp +++ b/src/world/RespawnPacket.cpp @@ -19,7 +19,7 @@ RespawnPacket::RespawnPacket() m_hellScale = HELL_LEVEL_MAX_SCALE; } -RespawnPacket::RespawnPacket(char dimension, __int64 mapSeed, int mapHeight, GameType *playerGameType, char difficulty, LevelType *pLevelType, bool newSeaLevel, int newEntityId, int xzSize, int hellScale) +RespawnPacket::RespawnPacket(char dimension, int64_t mapSeed, int mapHeight, GameType *playerGameType, char difficulty, LevelType *pLevelType, bool newSeaLevel, int newEntityId, int xzSize, int hellScale) { this->dimension = dimension; this->mapSeed = mapSeed; diff --git a/src/world/RespawnPacket.h b/src/world/RespawnPacket.h index dc341ea1..3caf1ee3 100644 --- a/src/world/RespawnPacket.h +++ b/src/world/RespawnPacket.h @@ -11,7 +11,7 @@ class RespawnPacket : public Packet, public enable_shared_from_thisparent) : Layer(seed) +RiverInitLayer::RiverInitLayer(int64_t seed, shared_ptrparent) : Layer(seed) { this->parent = parent; } diff --git a/src/world/RiverInitLayer.h b/src/world/RiverInitLayer.h index 6deb50e9..bc8dca1b 100644 --- a/src/world/RiverInitLayer.h +++ b/src/world/RiverInitLayer.h @@ -5,7 +5,7 @@ class RiverInitLayer : public Layer { public: - RiverInitLayer(__int64 seed, shared_ptrparent); + RiverInitLayer(int64_t seed, shared_ptrparent); intArray getArea(int xo, int yo, int w, int h); }; \ No newline at end of file diff --git a/src/world/RiverLayer.cpp b/src/world/RiverLayer.cpp index 8f805bab..14cf3142 100644 --- a/src/world/RiverLayer.cpp +++ b/src/world/RiverLayer.cpp @@ -2,7 +2,7 @@ #include "net.minecraft.world.level.biome.h" #include "net.minecraft.world.level.newbiome.layer.h" -RiverLayer::RiverLayer(__int64 seedMixup, shared_ptrparent) : Layer(seedMixup) +RiverLayer::RiverLayer(int64_t seedMixup, shared_ptrparent) : Layer(seedMixup) { this->parent = parent; } diff --git a/src/world/RiverLayer.h b/src/world/RiverLayer.h index 657ac07c..a76d3fab 100644 --- a/src/world/RiverLayer.h +++ b/src/world/RiverLayer.h @@ -5,6 +5,6 @@ class RiverLayer : public Layer { public: - RiverLayer(__int64 seedMixup, shared_ptrparent); + RiverLayer(int64_t seedMixup, shared_ptrparent); intArray getArea(int xo, int yo, int w, int h); }; \ No newline at end of file diff --git a/src/world/RiverMixerLayer.cpp b/src/world/RiverMixerLayer.cpp index 62dfdd6c..4de49245 100644 --- a/src/world/RiverMixerLayer.cpp +++ b/src/world/RiverMixerLayer.cpp @@ -2,13 +2,13 @@ #include "net.minecraft.world.level.biome.h" #include "net.minecraft.world.level.newbiome.layer.h" -RiverMixerLayer::RiverMixerLayer(__int64 seed, shared_ptrbiomes, shared_ptrrivers) : Layer(seed) +RiverMixerLayer::RiverMixerLayer(int64_t seed, shared_ptrbiomes, shared_ptrrivers) : Layer(seed) { this->biomes = biomes; this->rivers = rivers; } -void RiverMixerLayer::init(__int64 seed) +void RiverMixerLayer::init(int64_t seed) { biomes->init(seed); rivers->init(seed); diff --git a/src/world/RiverMixerLayer.h b/src/world/RiverMixerLayer.h index eec51610..3a069c41 100644 --- a/src/world/RiverMixerLayer.h +++ b/src/world/RiverMixerLayer.h @@ -9,8 +9,8 @@ private: shared_ptrrivers; public: - RiverMixerLayer(__int64 seed, shared_ptrbiomes, shared_ptrrivers); + RiverMixerLayer(int64_t seed, shared_ptrbiomes, shared_ptrrivers); - virtual void init(__int64 seed); + virtual void init(int64_t seed); virtual intArray getArea(int xo, int yo, int w, int h); }; \ No newline at end of file diff --git a/src/world/SetTimePacket.cpp b/src/world/SetTimePacket.cpp index 2f707970..14d3097d 100644 --- a/src/world/SetTimePacket.cpp +++ b/src/world/SetTimePacket.cpp @@ -11,7 +11,7 @@ SetTimePacket::SetTimePacket() time = 0; } -SetTimePacket::SetTimePacket(__int64 time) +SetTimePacket::SetTimePacket(int64_t time) { this->time = time; } diff --git a/src/world/SetTimePacket.h b/src/world/SetTimePacket.h index 5b658a0b..b7d3e645 100644 --- a/src/world/SetTimePacket.h +++ b/src/world/SetTimePacket.h @@ -6,10 +6,10 @@ using namespace std; class SetTimePacket : public Packet, public enable_shared_from_this { public: - __int64 time; + int64_t time; SetTimePacket(); - SetTimePacket(__int64 time); + SetTimePacket(int64_t time); virtual void read(DataInputStream *dis); virtual void write(DataOutputStream *dos); diff --git a/src/world/ShoreLayer.cpp b/src/world/ShoreLayer.cpp index 297571f5..7ae52557 100644 --- a/src/world/ShoreLayer.cpp +++ b/src/world/ShoreLayer.cpp @@ -2,7 +2,7 @@ #include "net.minecraft.world.level.newbiome.layer.h" #include "net.minecraft.world.level.biome.h" -ShoreLayer::ShoreLayer(__int64 seed, shared_ptr parent) : Layer(seed) +ShoreLayer::ShoreLayer(int64_t seed, shared_ptr parent) : Layer(seed) { this->parent = parent; } diff --git a/src/world/ShoreLayer.h b/src/world/ShoreLayer.h index 96aea152..a7053004 100644 --- a/src/world/ShoreLayer.h +++ b/src/world/ShoreLayer.h @@ -4,6 +4,6 @@ class ShoreLayer : public Layer { public: - ShoreLayer(__int64 seed, shared_ptr parent); + ShoreLayer(int64_t seed, shared_ptr parent); virtual intArray getArea(int xo, int yo, int w, int h); }; \ No newline at end of file diff --git a/src/world/SignTileEntity.cpp b/src/world/SignTileEntity.cpp index 2e45bc92..a4135c61 100644 --- a/src/world/SignTileEntity.cpp +++ b/src/world/SignTileEntity.cpp @@ -36,7 +36,7 @@ SignTileEntity::~SignTileEntity() { // TODO ORBIS_STUBBED; #ifndef __ORBIS__ - // 4J-PB - we don't need to verify strings anymore - InputManager.CancelQueuedVerifyStrings(&SignTileEntity::StringVerifyCallback,(LPVOID)this); + // 4J-PB - we don't need to verify strings anymore - InputManager.CancelQueuedVerifyStrings(&SignTileEntity::StringVerifyCallback,(void*)this); #endif } @@ -114,14 +114,14 @@ void SignTileEntity::setChanged() if(!g_NetworkManager.IsLocalGame() && !m_bVerified) //if (pMinecraft->level->isClientSide) { - WCHAR *wcMessages[MAX_SIGN_LINES]; + wchar_t *wcMessages[MAX_SIGN_LINES]; for (int i = 0; i < MAX_SIGN_LINES; ++i) { - wcMessages[i]=new WCHAR [MAX_LINE_LENGTH+1]; - ZeroMemory(wcMessages[i],sizeof(WCHAR)*(MAX_LINE_LENGTH+1)); + wcMessages[i]=new wchar_t [MAX_LINE_LENGTH+1]; + ZeroMemory(wcMessages[i],sizeof(wchar_t)*(MAX_LINE_LENGTH+1)); if(m_wsmessages[i].length()>0) { - memcpy(wcMessages[i],m_wsmessages[i].c_str(),m_wsmessages[i].length()*sizeof(WCHAR)); + memcpy(wcMessages[i],m_wsmessages[i].c_str(),m_wsmessages[i].length()*sizeof(wchar_t)); } } // at this point, we can ask the online string verifier if our sign text is ok @@ -129,7 +129,7 @@ void SignTileEntity::setChanged() m_bVerified=true; #else - if(!InputManager.VerifyStrings((WCHAR**)&wcMessages,MAX_SIGN_LINES,&SignTileEntity::StringVerifyCallback,(LPVOID)this)) + if(!InputManager.VerifyStrings((wchar_t**)&wcMessages,MAX_SIGN_LINES,&SignTileEntity::StringVerifyCallback,(void*)this)) { // Nothing to verify m_bVerified=true; @@ -156,7 +156,7 @@ void SignTileEntity::SetMessage(int iIndex,wstring &wsText) } // 4J-PB - added for string verification -int SignTileEntity::StringVerifyCallback(LPVOID lpParam,STRING_VERIFY_RESPONSE *pResults) +int SignTileEntity::StringVerifyCallback(void* lpParam,STRING_VERIFY_RESPONSE *pResults) { // results will be in m_pStringVerifyResponse SignTileEntity *pClass=(SignTileEntity *)lpParam; diff --git a/src/world/SignTileEntity.h b/src/world/SignTileEntity.h index b963f12f..1a3d6b1d 100644 --- a/src/world/SignTileEntity.h +++ b/src/world/SignTileEntity.h @@ -42,7 +42,7 @@ public: bool isEditable(); void setEditable(bool isEditable); virtual void setChanged(); - static int StringVerifyCallback(LPVOID lpParam,STRING_VERIFY_RESPONSE *pResults); + static int StringVerifyCallback(void* lpParam,STRING_VERIFY_RESPONSE *pResults); // 4J Added virtual shared_ptr clone(); diff --git a/src/world/SkullTileEntity.cpp b/src/world/SkullTileEntity.cpp index ea19b446..99184cf9 100644 --- a/src/world/SkullTileEntity.cpp +++ b/src/world/SkullTileEntity.cpp @@ -13,8 +13,8 @@ SkullTileEntity::SkullTileEntity() void SkullTileEntity::save(CompoundTag *tag) { TileEntity::save(tag); - tag->putByte(L"SkullType", (BYTE) (skullType & 0xff)); - tag->putByte(L"Rot", (BYTE) (rotation & 0xff)); + tag->putByte(L"SkullType", (uint8_t) (skullType & 0xff)); + tag->putByte(L"Rot", (uint8_t) (rotation & 0xff)); tag->putString(L"ExtraType", extraType); } diff --git a/src/world/SkyIslandDimension.cpp b/src/world/SkyIslandDimension.cpp index 0746c92c..aa68bd5e 100644 --- a/src/world/SkyIslandDimension.cpp +++ b/src/world/SkyIslandDimension.cpp @@ -16,7 +16,7 @@ ChunkSource *SkyIslandDimension::createRandomLevelSource() const return new SkyIslandRandomLevelSource(level, level->getSeed()); } -float SkyIslandDimension::getTimeOfDay(__int64 time, float a) const +float SkyIslandDimension::getTimeOfDay(int64_t time, float a) const { return 0.0f; } diff --git a/src/world/SmoothLayer.cpp b/src/world/SmoothLayer.cpp index a5545cc5..e94ae36d 100644 --- a/src/world/SmoothLayer.cpp +++ b/src/world/SmoothLayer.cpp @@ -1,7 +1,7 @@ #include "stdafx.h" #include "net.minecraft.world.level.newbiome.layer.h" -SmoothLayer::SmoothLayer(__int64 seedMixup, shared_ptrparent) : Layer(seedMixup) +SmoothLayer::SmoothLayer(int64_t seedMixup, shared_ptrparent) : Layer(seedMixup) { this->parent = parent; } diff --git a/src/world/SmoothLayer.h b/src/world/SmoothLayer.h index eec3f19e..14e3d152 100644 --- a/src/world/SmoothLayer.h +++ b/src/world/SmoothLayer.h @@ -5,7 +5,7 @@ class SmoothLayer : public Layer { public: - SmoothLayer(__int64 seedMixup, shared_ptrparent); + SmoothLayer(int64_t seedMixup, shared_ptrparent); virtual intArray getArea(int xo, int yo, int w, int h); }; \ No newline at end of file diff --git a/src/world/SmoothZoomLayer.cpp b/src/world/SmoothZoomLayer.cpp index 3e1c55a1..2df34a3b 100644 --- a/src/world/SmoothZoomLayer.cpp +++ b/src/world/SmoothZoomLayer.cpp @@ -2,7 +2,7 @@ #include "net.minecraft.world.level.newbiome.layer.h" #include "System.h" -SmoothZoomLayer::SmoothZoomLayer(__int64 seedMixup, shared_ptrparent) : Layer(seedMixup) +SmoothZoomLayer::SmoothZoomLayer(int64_t seedMixup, shared_ptrparent) : Layer(seedMixup) { this->parent = parent; } @@ -50,7 +50,7 @@ intArray SmoothZoomLayer::getArea(int xo, int yo, int w, int h) return result; } -shared_ptrSmoothZoomLayer::zoom(__int64 seed, shared_ptrsup, int count) +shared_ptrSmoothZoomLayer::zoom(int64_t seed, shared_ptrsup, int count) { shared_ptrresult = sup; for (int i = 0; i < count; i++) diff --git a/src/world/SmoothZoomLayer.h b/src/world/SmoothZoomLayer.h index b2ac4e78..90cc292e 100644 --- a/src/world/SmoothZoomLayer.h +++ b/src/world/SmoothZoomLayer.h @@ -5,8 +5,8 @@ class SmoothZoomLayer : public Layer { public: - SmoothZoomLayer(__int64 seedMixup, shared_ptrparent); + SmoothZoomLayer(int64_t seedMixup, shared_ptrparent); virtual intArray getArea(int xo, int yo, int w, int h); - static shared_ptrzoom(__int64 seed, shared_ptrsup, int count); + static shared_ptrzoom(int64_t seed, shared_ptrsup, int count); }; \ No newline at end of file diff --git a/src/world/Socket.cpp b/src/world/Socket.cpp index afe923d8..109eb730 100644 --- a/src/world/Socket.cpp +++ b/src/world/Socket.cpp @@ -125,7 +125,7 @@ void Socket::setPlayer(INetworkPlayer *player) } } -void Socket::pushDataToQueue(const BYTE * pbData, DWORD dwDataSize, bool fromHost /*= true*/) +void Socket::pushDataToQueue(const uint8_t * pbData, unsigned long dwDataSize, bool fromHost /*= true*/) { int queueIdx = SOCKET_CLIENT_END; if(!fromHost) @@ -509,7 +509,7 @@ void Socket::SocketOutputStreamNetwork::writeWithFlags(byteArray b, unsigned int hostPlayer->SendData(socketPlayer, buffer.pbyData, buffer.dwDataSize, QNET_SENDDATA_RELIABLE | QNET_SENDDATA_SEQUENTIAL | flags); - // DWORD queueSize = hostPlayer->GetSendQueueSize( NULL, QNET_GETSENDQUEUESIZE_BYTES ); + // unsigned long queueSize = hostPlayer->GetSendQueueSize( NULL, QNET_GETSENDQUEUESIZE_BYTES ); // if( queueSize > 24000 ) // { // //printf("Queue size is: %d, forcing doWork()\n",queueSize); diff --git a/src/world/Socket.h b/src/world/Socket.h index 0019f984..3bdf391a 100644 --- a/src/world/Socket.h +++ b/src/world/Socket.h @@ -36,7 +36,7 @@ private: virtual int read(byteArray b); virtual int read(byteArray b, unsigned int offset, unsigned int length); virtual void close(); - virtual __int64 skip(__int64 n) { return n; } // 4J Stu - Not implemented + virtual int64_t skip(int64_t n) { return n; } // 4J Stu - Not implemented virtual void flush() {} }; @@ -68,7 +68,7 @@ private: virtual int read(byteArray b); virtual int read(byteArray b, unsigned int offset, unsigned int length); virtual void close(); - virtual __int64 skip(__int64 n) { return n; } // 4J Stu - Not implemented + virtual int64_t skip(int64_t n) { return n; } // 4J Stu - Not implemented virtual void flush() {} }; class SocketOutputStreamNetwork : public SocketOutputStream @@ -107,7 +107,7 @@ private: // Host only connection class static ServerConnection *s_serverConnection; - BYTE networkPlayerSmallId; + uint8_t networkPlayerSmallId; public: C4JThread::Event* m_socketClosedEvent; @@ -119,7 +119,7 @@ public: Socket(bool response = false); // 4J - Create a local socket, for end 0 or 1 of a connection Socket(INetworkPlayer *player, bool response = false, bool hostLocal = false); // 4J - Create a socket for an INetworkPlayer SocketAddress *getRemoteSocketAddress(); - void pushDataToQueue(const BYTE * pbData, DWORD dwDataSize, bool fromHost = true); + void pushDataToQueue(const uint8_t * pbData, unsigned long dwDataSize, bool fromHost = true); static void addIncomingSocket(Socket *socket); InputStream *getInputStream(bool isServerConnection); void setSoTimeout(int a ); @@ -130,5 +130,5 @@ public: bool isLocal() { return m_hostLocal; } bool isClosing() { return m_endClosed[SOCKET_CLIENT_END] || m_endClosed[SOCKET_SERVER_END]; } - BYTE getSmallId() { return networkPlayerSmallId; } + uint8_t getSmallId() { return networkPlayerSmallId; } }; \ No newline at end of file diff --git a/src/world/SparseDataStorage.cpp b/src/world/SparseDataStorage.cpp index 6db131e7..38225422 100644 --- a/src/world/SparseDataStorage.cpp +++ b/src/world/SparseDataStorage.cpp @@ -40,7 +40,7 @@ SparseDataStorage::SparseDataStorage() // Data and count packs together the pointer to our data and the count of planes allocated - 127 planes allocated in this case #pragma warning ( disable : 4826 ) - dataAndCount = 0x007F000000000000L | (( (__int64) planeIndices ) & 0x0000ffffffffffffL); + dataAndCount = 0x007F000000000000L | (( (int64_t) planeIndices ) & 0x0000ffffffffffffL); #pragma warning ( default : 4826 ) #ifdef DATA_COMPRESSION_STATS count = 128; @@ -59,7 +59,7 @@ SparseDataStorage::SparseDataStorage(bool isUpper) // Data and count packs together the pointer to our data and the count of planes allocated - 127 planes allocated in this case #pragma warning ( disable : 4826 ) - dataAndCount = 0x0000000000000000L | (( (__int64) planeIndices ) & 0x0000ffffffffffffL); + dataAndCount = 0x0000000000000000L | (( (int64_t) planeIndices ) & 0x0000ffffffffffffL); #pragma warning ( default : 4826 ) #ifdef DATA_COMPRESSION_STATS count = 128; @@ -87,7 +87,7 @@ SparseDataStorage::~SparseDataStorage() SparseDataStorage::SparseDataStorage(SparseDataStorage *copyFrom) { // Extra details of source storage - __int64 sourceDataAndCount = copyFrom->dataAndCount; + int64_t sourceDataAndCount = copyFrom->dataAndCount; unsigned char *sourceIndicesAndData = (unsigned char *)(sourceDataAndCount & 0x0000ffffffffffff); int sourceCount = (sourceDataAndCount >> 48 ) & 0xffff; @@ -97,7 +97,7 @@ SparseDataStorage::SparseDataStorage(SparseDataStorage *copyFrom) // AP - I've moved this to be before the memcpy because of a very strange bug on vita. Sometimes dataAndCount wasn't valid in time when ::get was called. // This should never happen and this isn't a proper solution but fixes it for now. #pragma warning ( disable : 4826 ) - dataAndCount = ( sourceDataAndCount & 0xffff000000000000L ) | ( ((__int64) destIndicesAndData ) & 0x0000ffffffffffffL ); + dataAndCount = ( sourceDataAndCount & 0xffff000000000000L ) | ( ((int64_t) destIndicesAndData ) & 0x0000ffffffffffffL ); #pragma warning ( default : 4826 ) XMemCpy( destIndicesAndData, sourceIndicesAndData, sourceCount * 128 + 128 ); @@ -176,9 +176,9 @@ void SparseDataStorage::setData(byteArray dataIn, unsigned int inOffset) // Get new data and count packed info #pragma warning ( disable : 4826 ) - __int64 newDataAndCount = ((__int64) planeIndices) & 0x0000ffffffffffffL; + int64_t newDataAndCount = ((int64_t) planeIndices) & 0x0000ffffffffffffL; #pragma warning ( default : 4826 ) - newDataAndCount |= ((__int64)allocatedPlaneCount) << 48; + newDataAndCount |= ((int64_t)allocatedPlaneCount) << 48; updateDataAndCount( newDataAndCount ); } @@ -380,7 +380,7 @@ void SparseDataStorage::addNewPlane(int y) do { // Get last packed data pointer & count - __int64 lastDataAndCount = dataAndCount; + int64_t lastDataAndCount = dataAndCount; // Unpack count & data pointer int lastLinesUsed = (int)(( lastDataAndCount >> 48 ) & 0xffff); @@ -401,13 +401,13 @@ void SparseDataStorage::addNewPlane(int y) // Get new data and count packed info #pragma warning ( disable : 4826 ) - __int64 newDataAndCount = ((__int64) dataPointer) & 0x0000ffffffffffffL; + int64_t newDataAndCount = ((int64_t) dataPointer) & 0x0000ffffffffffffL; #pragma warning ( default : 4826 ) - newDataAndCount |= ((__int64)linesUsed) << 48; + newDataAndCount |= ((int64_t)linesUsed) << 48; // Attempt to update the data & count atomically. This command will Only succeed if the data stored at // dataAndCount is equal to lastDataAndCount, and will return the value present just before the write took place - __int64 lastDataAndCount2 = InterlockedCompareExchangeRelease64( &dataAndCount, newDataAndCount, lastDataAndCount ); + int64_t lastDataAndCount2 = InterlockedCompareExchangeRelease64( &dataAndCount, newDataAndCount, lastDataAndCount ); if( lastDataAndCount2 == lastDataAndCount ) { @@ -473,19 +473,19 @@ void SparseDataStorage::tick() } // Update storage with a new values for dataAndCount, repeating as necessary if other simultaneous writes happen. -void SparseDataStorage::updateDataAndCount(__int64 newDataAndCount) +void SparseDataStorage::updateDataAndCount(int64_t newDataAndCount) { // Now actually assign this data to the storage. Just repeat until successful, there isn't any useful really that we can merge the results of this // with any other simultaneous writes that might be happening. bool success = false; do { - __int64 lastDataAndCount = dataAndCount; + int64_t lastDataAndCount = dataAndCount; unsigned char *lastDataPointer = (unsigned char *)(lastDataAndCount & 0x0000ffffffffffff); // Attempt to update the data & count atomically. This command will Only succeed if the data stored at // dataAndCount is equal to lastDataAndCount, and will return the value present just before the write took place - __int64 lastDataAndCount2 = InterlockedCompareExchangeRelease64( &dataAndCount, newDataAndCount, lastDataAndCount ); + int64_t lastDataAndCount2 = InterlockedCompareExchangeRelease64( &dataAndCount, newDataAndCount, lastDataAndCount ); if( lastDataAndCount2 == lastDataAndCount ) { @@ -508,7 +508,7 @@ int SparseDataStorage::compress() unsigned char _planeIndices[128]; bool needsCompressed = false; - __int64 lastDataAndCount = dataAndCount; + int64_t lastDataAndCount = dataAndCount; unsigned char *planeIndices = (unsigned char *)(lastDataAndCount & 0x0000ffffffffffff); unsigned char *data = planeIndices + 128; @@ -558,13 +558,13 @@ int SparseDataStorage::compress() // Get new data and count packed info #pragma warning ( disable : 4826 ) - __int64 newDataAndCount = ((__int64) newIndicesAndData) & 0x0000ffffffffffffL; + int64_t newDataAndCount = ((int64_t) newIndicesAndData) & 0x0000ffffffffffffL; #pragma warning ( default : 4826 ) - newDataAndCount |= ((__int64)planesToAlloc) << 48; + newDataAndCount |= ((int64_t)planesToAlloc) << 48; // Attempt to update the data & count atomically. This command will Only succeed if the data stored at // dataAndCount is equal to lastDataAndCount, and will return the value present just before the write took place - __int64 lastDataAndCount2 = InterlockedCompareExchangeRelease64( &dataAndCount, newDataAndCount, lastDataAndCount ); + int64_t lastDataAndCount2 = InterlockedCompareExchangeRelease64( &dataAndCount, newDataAndCount, lastDataAndCount ); if( lastDataAndCount2 != lastDataAndCount ) { @@ -617,9 +617,9 @@ void SparseDataStorage::read(DataInputStream *dis) dis->readFully(wrapper); #pragma warning ( disable : 4826 ) - __int64 newDataAndCount = ((__int64) dataPointer) & 0x0000ffffffffffffL; + int64_t newDataAndCount = ((int64_t) dataPointer) & 0x0000ffffffffffffL; #pragma warning ( default : 4826 ) - newDataAndCount |= ((__int64)count) << 48; + newDataAndCount |= ((int64_t)count) << 48; updateDataAndCount(newDataAndCount); } diff --git a/src/world/SparseDataStorage.h b/src/world/SparseDataStorage.h index 93d5c424..16289cda 100644 --- a/src/world/SparseDataStorage.h +++ b/src/world/SparseDataStorage.h @@ -18,9 +18,9 @@ // To meet these requirements, this class is now implemented using a lock-free system, implemented using a read-copy-update (RCU) type algorithm. Some details... -// (1) The storage details for the class are now packed into a single __int64, which contains both a pointer to the data that is required and a count of how many planes worth +// (1) The storage details for the class are now packed into a single int64_t, which contains both a pointer to the data that is required and a count of how many planes worth // of storage are allocated. This allows the full storage to be updated atomically using compare and exchange operations (implemented with InterlockedCompareExchangeRelease64). -// (2) The data pointer referenced in this __int64 points to an area of memory which is 128 + 128 * plane_count bytes long, where the first 128 bytes stoere the plane indices, and +// (2) The data pointer referenced in this int64_t points to an area of memory which is 128 + 128 * plane_count bytes long, where the first 128 bytes stoere the plane indices, and // the rest of the data is variable in size to accomodate however many planes are required to be stored // (3) The RCU bit of the algorithm means that any read operations don't need to do any checks or locks at all. When the data needs to be updated, a copy of it is made and updated, // then an attempt is made to swap the new data in - if this succeeds then the old data pointer is deleted later at some point where we know nothing will be reading from it anymore. @@ -36,7 +36,7 @@ class SparseDataStorage friend class TileCompressData_SPU; private: // unsigned char planeIndices[128]; - __int64 dataAndCount; // Contains packed-together data pointer (lower 48-bits), and count of lines used (upper 16-bits) + int64_t dataAndCount; // Contains packed-together data pointer (lower 48-bits), and count of lines used (upper 16-bits) // unsigned char *data; // unsigned int allocatedPlaneCount; @@ -64,7 +64,7 @@ public: void addNewPlane(int y); void getPlaneIndicesAndData(unsigned char **planeIndices, unsigned char **data); - void updateDataAndCount(__int64 newDataAndCount); + void updateDataAndCount(int64_t newDataAndCount); int compress(); bool isCompressed(); diff --git a/src/world/SparseLightStorage.cpp b/src/world/SparseLightStorage.cpp index f9a2f0cb..90e73776 100644 --- a/src/world/SparseLightStorage.cpp +++ b/src/world/SparseLightStorage.cpp @@ -40,7 +40,7 @@ SparseLightStorage::SparseLightStorage(bool sky) // Data and count packs together the pointer to our data and the count of planes allocated - 127 planes allocated in this case #pragma warning ( disable : 4826 ) - dataAndCount = 0x007F000000000000L | (( (__int64) planeIndices ) & 0x0000ffffffffffffL); + dataAndCount = 0x007F000000000000L | (( (int64_t) planeIndices ) & 0x0000ffffffffffffL); #pragma warning ( default : 4826 ) #ifdef LIGHT_COMPRESSION_STATS count = 127; @@ -59,7 +59,7 @@ SparseLightStorage::SparseLightStorage(bool sky, bool isUpper) // Data and count packs together the pointer to our data and the count of planes allocated - 0 planes allocated in this case #pragma warning ( disable : 4826 ) - dataAndCount = 0x0000000000000000L | (( (__int64) planeIndices ) & 0x0000ffffffffffffL); + dataAndCount = 0x0000000000000000L | (( (int64_t) planeIndices ) & 0x0000ffffffffffffL); #pragma warning ( default : 4826 ) #ifdef LIGHT_COMPRESSION_STATS count = 0; @@ -87,7 +87,7 @@ SparseLightStorage::~SparseLightStorage() SparseLightStorage::SparseLightStorage(SparseLightStorage *copyFrom) { // Extra details of source storage - __int64 sourceDataAndCount = copyFrom->dataAndCount; + int64_t sourceDataAndCount = copyFrom->dataAndCount; unsigned char *sourceIndicesAndData = (unsigned char *)(sourceDataAndCount & 0x0000ffffffffffff); int sourceCount = (sourceDataAndCount >> 48 ) & 0xffff; @@ -97,7 +97,7 @@ SparseLightStorage::SparseLightStorage(SparseLightStorage *copyFrom) // AP - I've moved this to be before the memcpy because of a very strange bug on vita. Sometimes dataAndCount wasn't valid in time when ::get was called. // This should never happen and this isn't a proper solution but fixes it for now. #pragma warning ( disable : 4826 ) - dataAndCount = ( sourceDataAndCount & 0xffff000000000000L ) | ( ((__int64) destIndicesAndData ) & 0x0000ffffffffffffL ); + dataAndCount = ( sourceDataAndCount & 0xffff000000000000L ) | ( ((int64_t) destIndicesAndData ) & 0x0000ffffffffffffL ); #pragma warning ( default : 4826 ) XMemCpy( destIndicesAndData, sourceIndicesAndData, sourceCount * 128 + 128 ); @@ -180,9 +180,9 @@ void SparseLightStorage::setData(byteArray dataIn, unsigned int inOffset) // Get new data and count packed info #pragma warning ( disable : 4826 ) - __int64 newDataAndCount = ((__int64) planeIndices) & 0x0000ffffffffffffL; + int64_t newDataAndCount = ((int64_t) planeIndices) & 0x0000ffffffffffffL; #pragma warning ( default : 4826 ) - newDataAndCount |= ((__int64)allocatedPlaneCount) << 48; + newDataAndCount |= ((int64_t)allocatedPlaneCount) << 48; updateDataAndCount( newDataAndCount ); } @@ -312,7 +312,7 @@ void SparseLightStorage::setAllBright() } // Data and count packs together the pointer to our data and the count of planes allocated, which is currently zero #pragma warning ( disable : 4826 ) - __int64 newDataAndCount = ( (__int64) planeIndices ) & 0x0000ffffffffffffL; + int64_t newDataAndCount = ( (int64_t) planeIndices ) & 0x0000ffffffffffffL; #pragma warning ( default : 4826 ) updateDataAndCount( newDataAndCount ); @@ -385,7 +385,7 @@ void SparseLightStorage::addNewPlane(int y) do { // Get last packed data pointer & count - __int64 lastDataAndCount = dataAndCount; + int64_t lastDataAndCount = dataAndCount; // Unpack count & data pointer int lastLinesUsed = (int)(( lastDataAndCount >> 48 ) & 0xffff); @@ -407,13 +407,13 @@ void SparseLightStorage::addNewPlane(int y) // Get new data and count packed info #pragma warning ( disable : 4826 ) - __int64 newDataAndCount = ((__int64) dataPointer) & 0x0000ffffffffffffL; + int64_t newDataAndCount = ((int64_t) dataPointer) & 0x0000ffffffffffffL; #pragma warning ( default : 4826 ) - newDataAndCount |= ((__int64)linesUsed) << 48; + newDataAndCount |= ((int64_t)linesUsed) << 48; // Attempt to update the data & count atomically. This command will Only succeed if the data stored at // dataAndCount is equal to lastDataAndCount, and will return the value present just before the write took place - __int64 lastDataAndCount2 = InterlockedCompareExchangeRelease64( &dataAndCount, newDataAndCount, lastDataAndCount ); + int64_t lastDataAndCount2 = InterlockedCompareExchangeRelease64( &dataAndCount, newDataAndCount, lastDataAndCount ); if( lastDataAndCount2 == lastDataAndCount ) { @@ -479,19 +479,19 @@ void SparseLightStorage::tick() } // Update storage with a new values for dataAndCount, repeating as necessary if other simultaneous writes happen. -void SparseLightStorage::updateDataAndCount(__int64 newDataAndCount) +void SparseLightStorage::updateDataAndCount(int64_t newDataAndCount) { // Now actually assign this data to the storage. Just repeat until successful, there isn't any useful really that we can merge the results of this // with any other simultaneous writes that might be happening. bool success = false; do { - __int64 lastDataAndCount = dataAndCount; + int64_t lastDataAndCount = dataAndCount; unsigned char *lastDataPointer = (unsigned char *)(lastDataAndCount & 0x0000ffffffffffff); // Attempt to update the data & count atomically. This command will Only succeed if the data stored at // dataAndCount is equal to lastDataAndCount, and will return the value present just before the write took place - __int64 lastDataAndCount2 = InterlockedCompareExchangeRelease64( &dataAndCount, newDataAndCount, lastDataAndCount ); + int64_t lastDataAndCount2 = InterlockedCompareExchangeRelease64( &dataAndCount, newDataAndCount, lastDataAndCount ); if( lastDataAndCount2 == lastDataAndCount ) { @@ -514,7 +514,7 @@ int SparseLightStorage::compress() unsigned char _planeIndices[128]; bool needsCompressed = false; - __int64 lastDataAndCount = dataAndCount; + int64_t lastDataAndCount = dataAndCount; unsigned char *planeIndices = (unsigned char *)(lastDataAndCount & 0x0000ffffffffffff); unsigned char *data = planeIndices + 128; @@ -575,13 +575,13 @@ int SparseLightStorage::compress() // Get new data and count packed info #pragma warning ( disable : 4826 ) - __int64 newDataAndCount = ((__int64) newIndicesAndData) & 0x0000ffffffffffffL; + int64_t newDataAndCount = ((int64_t) newIndicesAndData) & 0x0000ffffffffffffL; #pragma warning ( default : 4826 ) - newDataAndCount |= ((__int64)planesToAlloc) << 48; + newDataAndCount |= ((int64_t)planesToAlloc) << 48; // Attempt to update the data & count atomically. This command will Only succeed if the data stored at // dataAndCount is equal to lastDataAndCount, and will return the value present just before the write took place - __int64 lastDataAndCount2 = InterlockedCompareExchangeRelease64( &dataAndCount, newDataAndCount, lastDataAndCount ); + int64_t lastDataAndCount2 = InterlockedCompareExchangeRelease64( &dataAndCount, newDataAndCount, lastDataAndCount ); if( lastDataAndCount2 != lastDataAndCount ) { @@ -634,9 +634,9 @@ void SparseLightStorage::read(DataInputStream *dis) dis->readFully(wrapper); #pragma warning ( disable : 4826 ) - __int64 newDataAndCount = ((__int64) dataPointer) & 0x0000ffffffffffffL; + int64_t newDataAndCount = ((int64_t) dataPointer) & 0x0000ffffffffffffL; #pragma warning ( default : 4826 ) - newDataAndCount |= ((__int64)count) << 48; + newDataAndCount |= ((int64_t)count) << 48; updateDataAndCount( newDataAndCount ); } diff --git a/src/world/SparseLightStorage.h b/src/world/SparseLightStorage.h index d05d7645..c4cfbd04 100644 --- a/src/world/SparseLightStorage.h +++ b/src/world/SparseLightStorage.h @@ -20,9 +20,9 @@ // To meet these requirements, this class is now implemented using a lock-free system, implemented using a read-copy-update (RCU) type algorithm. Some details... -// (1) The storage details for the class are now packed into a single __int64, which contains both a pointer to the data that is required and a count of how many planes worth +// (1) The storage details for the class are now packed into a single int64_t, which contains both a pointer to the data that is required and a count of how many planes worth // of storage are allocated. This allows the full storage to be updated atomically using compare and exchange operations (implemented with InterlockedCompareExchangeRelease64). -// (2) The data pointer referenced in this __int64 points to an area of memory which is 128 + 128 * plane_count bytes long, where the first 128 bytes stoere the plane indices, and +// (2) The data pointer referenced in this int64_t points to an area of memory which is 128 + 128 * plane_count bytes long, where the first 128 bytes stoere the plane indices, and // the rest of the data is variable in size to accomodate however many planes are required to be stored // (3) The RCU bit of the algorithm means that any read operations don't need to do any checks or locks at all. When the data needs to be updated, a copy of it is made and updated, // then an attempt is made to swap the new data in - if this succeeds then the old data pointer is deleted later at some point where we know nothing will be reading from it anymore. @@ -38,7 +38,7 @@ class SparseLightStorage friend class TileCompressData_SPU; private: // unsigned char planeIndices[128]; - __int64 dataAndCount; // Contains packed-together data pointer (lower 48-bits), and count of lines used (upper 16-bits) + int64_t dataAndCount; // Contains packed-together data pointer (lower 48-bits), and count of lines used (upper 16-bits) // unsigned char *data; // unsigned int allocatedPlaneCount; @@ -66,7 +66,7 @@ public: void addNewPlane(int y); void getPlaneIndicesAndData(unsigned char **planeIndices, unsigned char **data); - void updateDataAndCount(__int64 newDataAndCount); + void updateDataAndCount(int64_t newDataAndCount); int compress(); bool isCompressed(); diff --git a/src/world/StructureFeature.cpp b/src/world/StructureFeature.cpp index 5e8489f0..31963c23 100644 --- a/src/world/StructureFeature.cpp +++ b/src/world/StructureFeature.cpp @@ -135,10 +135,10 @@ TilePos *StructureFeature::getNearestGeneratedFeature(Level *level, int cellX, i this->level = level; random->setSeed(level->getSeed()); - __int64 xScale = random->nextLong(); - __int64 zScale = random->nextLong(); - __int64 xx = (cellX >> 4) * xScale; - __int64 zz = (cellZ >> 4) * zScale; + int64_t xScale = random->nextLong(); + int64_t zScale = random->nextLong(); + int64_t xx = (cellX >> 4) * xScale; + int64_t zz = (cellZ >> 4) * zScale; random->setSeed(xx ^ zz ^ level->getSeed()); addFeature(level, cellX >> 4, cellZ >> 4, 0, 0, byteArray()); diff --git a/src/world/StructureFeature.h b/src/world/StructureFeature.h index 642e6aad..d742a088 100644 --- a/src/world/StructureFeature.h +++ b/src/world/StructureFeature.h @@ -16,7 +16,7 @@ public: }; protected: - unordered_map<__int64, StructureStart *> cachedStructures; + unordered_map cachedStructures; public: ~StructureFeature(); diff --git a/src/world/SwampRiversLayer.cpp b/src/world/SwampRiversLayer.cpp index 68cef8a8..cd22cae8 100644 --- a/src/world/SwampRiversLayer.cpp +++ b/src/world/SwampRiversLayer.cpp @@ -3,7 +3,7 @@ #include "IntCache.h" #include "SwampRiversLayer.h" -SwampRiversLayer::SwampRiversLayer(__int64 seed, shared_ptr parent) : Layer(seed) +SwampRiversLayer::SwampRiversLayer(int64_t seed, shared_ptr parent) : Layer(seed) { this->parent = parent; } diff --git a/src/world/SwampRiversLayer.h b/src/world/SwampRiversLayer.h index f724ad82..97bab0f4 100644 --- a/src/world/SwampRiversLayer.h +++ b/src/world/SwampRiversLayer.h @@ -5,7 +5,7 @@ class SwampRiversLayer : public Layer { public: - SwampRiversLayer(__int64 seed, shared_ptr parent); + SwampRiversLayer(int64_t seed, shared_ptr parent); intArray getArea(int xo, int yo, int w, int h); }; \ No newline at end of file diff --git a/src/world/System.h b/src/world/System.h index 06e265cc..2c2654b4 100644 --- a/src/world/System.h +++ b/src/world/System.h @@ -20,20 +20,20 @@ public: ArrayCopyFunctionDeclaration(Biome *) ArrayCopyFunctionDeclaration(int) - static __int64 nanoTime(); - static __int64 currentTimeMillis(); - static __int64 currentRealTimeMillis(); // 4J Added to get real-world time for timestamps in saves + static int64_t nanoTime(); + static int64_t currentTimeMillis(); + static int64_t currentRealTimeMillis(); // 4J Added to get real-world time for timestamps in saves static void ReverseUSHORT(unsigned short *pusVal); static void ReverseSHORT(short *psVal); static void ReverseULONG(unsigned long *pulVal); static void ReverseULONG(unsigned int *pulVal); static void ReverseINT(int *piVal); - static void ReverseULONGLONG(__int64 *pullVal); - static void ReverseWCHARA(WCHAR *pwch,int iLen); + static void ReverseULONGLONG(int64_t *pullVal); + static void ReverseWCHARA(wchar_t *pwch,int iLen); }; #define MAKE_FOURCC(ch0, ch1, ch2, ch3) \ - ((DWORD)(BYTE)(ch0) | ((DWORD)(BYTE)(ch1) << 8) | \ - ((DWORD)(BYTE)(ch2) << 16) | ((DWORD)(BYTE)(ch3) << 24 )) + ((unsigned long)(uint8_t)(ch0) | ((unsigned long)(uint8_t)(ch1) << 8) | \ + ((unsigned long)(uint8_t)(ch2) << 16) | ((unsigned long)(uint8_t)(ch3) << 24 )) diff --git a/src/world/Tag.cpp b/src/world/Tag.cpp index 40da99fe..2f077d56 100644 --- a/src/world/Tag.cpp +++ b/src/world/Tag.cpp @@ -52,6 +52,19 @@ void Tag::print(ostream out) out << ""; } +void Tag::print(char* prefix, std::ostream &out) +{ + std::wstring wname = getName(); + std::string name(wname.begin(), wname.end()); + + out << prefix; + out << std::string(getTagName(getId()), getTagName(getId()) + wcslen(getTagName(getId()))); + if (!name.empty()) { + out << "(\"" << name << "\")"; + } + out << ": " << toString() << std::endl; +} + void Tag::print(char *prefix, wostream out) { wstring name = getName(); diff --git a/src/world/Tag.h b/src/world/Tag.h index c3221aea..196b345a 100644 --- a/src/world/Tag.h +++ b/src/world/Tag.h @@ -32,6 +32,7 @@ public: virtual wstring toString() = 0; virtual byte getId() = 0; void print(ostream out); + void print(char* prefix, std::ostream &out); void print(char *prefix, wostream out); wstring getName(); Tag *setName(const wstring& name); diff --git a/src/world/TextureAndGeometryChangePacket.h b/src/world/TextureAndGeometryChangePacket.h index dabe78fa..3844142c 100644 --- a/src/world/TextureAndGeometryChangePacket.h +++ b/src/world/TextureAndGeometryChangePacket.h @@ -9,7 +9,7 @@ public: int id; wstring path; - DWORD dwSkinID; + unsigned long dwSkinID; TextureAndGeometryChangePacket(); TextureAndGeometryChangePacket(shared_ptr e, const wstring &path); diff --git a/src/world/TextureAndGeometryPacket.cpp b/src/world/TextureAndGeometryPacket.cpp index 70f2f516..0537518f 100644 --- a/src/world/TextureAndGeometryPacket.cpp +++ b/src/world/TextureAndGeometryPacket.cpp @@ -30,7 +30,7 @@ TextureAndGeometryPacket::~TextureAndGeometryPacket() // } } -TextureAndGeometryPacket::TextureAndGeometryPacket(const wstring &textureName, PBYTE pbData, DWORD dwBytes) +TextureAndGeometryPacket::TextureAndGeometryPacket(const wstring &textureName, uint8_t* pbData, unsigned long dwBytes) { this->textureName = textureName; @@ -47,7 +47,7 @@ TextureAndGeometryPacket::TextureAndGeometryPacket(const wstring &textureName, P this->uiAnimOverrideBitmask=0; } -TextureAndGeometryPacket::TextureAndGeometryPacket(const wstring &textureName, PBYTE pbData, DWORD dwBytes, DLCSkinFile *pDLCSkinFile) +TextureAndGeometryPacket::TextureAndGeometryPacket(const wstring &textureName, uint8_t* pbData, unsigned long dwBytes, DLCSkinFile *pDLCSkinFile) { this->textureName = textureName; @@ -80,7 +80,7 @@ TextureAndGeometryPacket::TextureAndGeometryPacket(const wstring &textureName, P } } -TextureAndGeometryPacket::TextureAndGeometryPacket(const wstring &textureName, PBYTE pbData, DWORD dwBytes,vector *pvSkinBoxes, unsigned int uiAnimOverrideBitmask) +TextureAndGeometryPacket::TextureAndGeometryPacket(const wstring &textureName, uint8_t* pbData, unsigned long dwBytes,vector *pvSkinBoxes, unsigned int uiAnimOverrideBitmask) { this->textureName = textureName; @@ -101,7 +101,7 @@ TextureAndGeometryPacket::TextureAndGeometryPacket(const wstring &textureName, P } else { - this->dwBoxC = (DWORD)pvSkinBoxes->size(); + this->dwBoxC = (unsigned long)pvSkinBoxes->size(); this->BoxDataA= new SKIN_BOX [this->dwBoxC]; int iCount=0; @@ -122,28 +122,28 @@ void TextureAndGeometryPacket::handle(PacketListener *listener) void TextureAndGeometryPacket::read(DataInputStream *dis) //throws IOException { textureName = dis->readUTF(); - dwSkinID = (DWORD)dis->readInt(); - dwTextureBytes = (DWORD)dis->readShort(); + dwSkinID = (unsigned long)dis->readInt(); + dwTextureBytes = (unsigned long)dis->readShort(); if(dwTextureBytes>0) { - this->pbData= new BYTE [dwTextureBytes]; + this->pbData= new uint8_t [dwTextureBytes]; - for(DWORD i=0;ipbData[i] = dis->readByte(); } } uiAnimOverrideBitmask = dis->readInt(); - dwBoxC = (DWORD)dis->readShort(); + dwBoxC = (unsigned long)dis->readShort(); if(dwBoxC>0) { this->BoxDataA= new SKIN_BOX [dwBoxC]; } - for(DWORD i=0;iBoxDataA[i].ePart = (eBodyPart) dis->readShort(); this->BoxDataA[i].fX = dis->readFloat(); @@ -162,14 +162,14 @@ void TextureAndGeometryPacket::write(DataOutputStream *dos) //throws IOException dos->writeUTF(textureName); dos->writeInt(dwSkinID); dos->writeShort((short)dwTextureBytes); - for(DWORD i=0;iwriteByte(this->pbData[i]); } dos->writeInt(uiAnimOverrideBitmask); dos->writeShort((short)dwBoxC); - for(DWORD i=0;iwriteShort((short)this->BoxDataA[i].ePart); dos->writeFloat(this->BoxDataA[i].fX); diff --git a/src/world/TextureAndGeometryPacket.h b/src/world/TextureAndGeometryPacket.h index 852bb392..852e9032 100644 --- a/src/world/TextureAndGeometryPacket.h +++ b/src/world/TextureAndGeometryPacket.h @@ -11,18 +11,18 @@ class TextureAndGeometryPacket : public Packet, public enable_shared_from_this *pvSkinBoxes, unsigned int uiAnimOverrideBitmask); + TextureAndGeometryPacket(const wstring &textureName, uint8_t* pbData, unsigned long dwBytes); + TextureAndGeometryPacket(const wstring &textureName, uint8_t* pbData, unsigned long dwBytes, DLCSkinFile *pDLCSkinFile); + TextureAndGeometryPacket(const wstring &textureName, uint8_t* pbData, unsigned long dwBytes, vector *pvSkinBoxes, unsigned int uiAnimOverrideBitmask); virtual void handle(PacketListener *listener); virtual void read(DataInputStream *dis); diff --git a/src/world/TexturePacket.cpp b/src/world/TexturePacket.cpp index 77dfdc38..76f0d5b1 100644 --- a/src/world/TexturePacket.cpp +++ b/src/world/TexturePacket.cpp @@ -22,7 +22,7 @@ TexturePacket::~TexturePacket() // } } -TexturePacket::TexturePacket(const wstring &textureName, PBYTE pbData, DWORD dwBytes) +TexturePacket::TexturePacket(const wstring &textureName, uint8_t* pbData, unsigned long dwBytes) { this->textureName = textureName; this->pbData = pbData; @@ -37,13 +37,13 @@ void TexturePacket::handle(PacketListener *listener) void TexturePacket::read(DataInputStream *dis) //throws IOException { textureName = dis->readUTF(); - dwBytes = (DWORD)dis->readShort(); + dwBytes = (unsigned long)dis->readShort(); if(dwBytes>0) { - this->pbData= new BYTE [dwBytes]; + this->pbData= new uint8_t [dwBytes]; - for(DWORD i=0;ipbData[i] = dis->readByte(); } @@ -54,7 +54,7 @@ void TexturePacket::write(DataOutputStream *dos) //throws IOException { dos->writeUTF(textureName); dos->writeShort((short)dwBytes); - for(DWORD i=0;iwriteByte(this->pbData[i]); } diff --git a/src/world/TexturePacket.h b/src/world/TexturePacket.h index c2dce25f..7da3aeb4 100644 --- a/src/world/TexturePacket.h +++ b/src/world/TexturePacket.h @@ -7,12 +7,12 @@ class TexturePacket : public Packet, public enable_shared_from_thisgetSeed()); } -float TheEndDimension::getTimeOfDay(__int64 time, float a) const +float TheEndDimension::getTimeOfDay(int64_t time, float a) const { return 0.0f; } diff --git a/src/world/TheEndDimension.h b/src/world/TheEndDimension.h index 95bd6980..268be6f6 100644 --- a/src/world/TheEndDimension.h +++ b/src/world/TheEndDimension.h @@ -6,7 +6,7 @@ class TheEndDimension : public Dimension public: virtual void init(); virtual ChunkSource *createRandomLevelSource() const; - virtual float getTimeOfDay(__int64 time, float a) const; + virtual float getTimeOfDay(int64_t time, float a) const; virtual float *getSunriseColor(float td, float a); virtual Vec3 *getFogColor(float td, float a) const; virtual bool hasGround(); diff --git a/src/world/TheEndLevelRandomLevelSource.cpp b/src/world/TheEndLevelRandomLevelSource.cpp index 46f3dbab..8216c016 100644 --- a/src/world/TheEndLevelRandomLevelSource.cpp +++ b/src/world/TheEndLevelRandomLevelSource.cpp @@ -9,7 +9,7 @@ #include "net.minecraft.world.level.storage.h" #include "TheEndLevelRandomLevelSource.h" -TheEndLevelRandomLevelSource::TheEndLevelRandomLevelSource(Level *level, __int64 seed) +TheEndLevelRandomLevelSource::TheEndLevelRandomLevelSource(Level *level, int64_t seed) { m_XZSize = END_LEVEL_MIN_WIDTH; @@ -372,8 +372,8 @@ void TheEndLevelRandomLevelSource::postProcess(ChunkSource *parent, int xt, int // We'll be running our postProcess in parallel with getChunk etc. so we need to use a separate random - have used the same initialisation code as // used in RandomLevelSource::postProcess to make sure this random value is consistent for each world generation. pprandom->setSeed(level->getSeed()); - __int64 xScale = pprandom->nextLong() / 2 * 2 + 1; - __int64 zScale = pprandom->nextLong() / 2 * 2 + 1; + int64_t xScale = pprandom->nextLong() / 2 * 2 + 1; + int64_t zScale = pprandom->nextLong() / 2 * 2 + 1; pprandom->setSeed(((xt * xScale) + (zt * zScale)) ^ level->getSeed()); Biome *biome = level->getBiome(xo + 16, zo + 16); diff --git a/src/world/TheEndLevelRandomLevelSource.h b/src/world/TheEndLevelRandomLevelSource.h index 2dc7f131..38b0833b 100644 --- a/src/world/TheEndLevelRandomLevelSource.h +++ b/src/world/TheEndLevelRandomLevelSource.h @@ -30,7 +30,7 @@ private: Level *level; public: - TheEndLevelRandomLevelSource(Level *level, __int64 seed); + TheEndLevelRandomLevelSource(Level *level, int64_t seed); ~TheEndLevelRandomLevelSource(); void prepareHeights(int xOffs, int zOffs, byteArray blocks, BiomeArray biomes); diff --git a/src/world/TheEndPortal.cpp b/src/world/TheEndPortal.cpp index 19d95b1f..75b89839 100644 --- a/src/world/TheEndPortal.cpp +++ b/src/world/TheEndPortal.cpp @@ -8,7 +8,7 @@ #include "net.minecraft.world.entity.player.h" #include "net.minecraft.world.h" -DWORD TheEndPortal::tlsIdx = TlsAlloc(); +unsigned long TheEndPortal::tlsIdx = TlsAlloc(); // 4J - allowAnywhere is a static in java, implementing as TLS here to make thread safe bool TheEndPortal::allowAnywhere() @@ -18,7 +18,7 @@ bool TheEndPortal::allowAnywhere() void TheEndPortal::allowAnywhere(bool set) { - TlsSetValue(tlsIdx,(LPVOID)(set?1:0)); + TlsSetValue(tlsIdx,(void*)(set?1:0)); } TheEndPortal::TheEndPortal(int id, Material *material) : EntityTile(id, material, isSolidRender()) diff --git a/src/world/TheEndPortal.h b/src/world/TheEndPortal.h index 31cddb2d..e581d3cb 100644 --- a/src/world/TheEndPortal.h +++ b/src/world/TheEndPortal.h @@ -4,7 +4,7 @@ class TheEndPortal : public EntityTile { public: - static DWORD tlsIdx; + static unsigned long tlsIdx; // 4J - was just a static but implemented with TLS for our version static bool allowAnywhere(); static void allowAnywhere(bool set); diff --git a/src/world/ThreadName.cpp b/src/world/ThreadName.cpp index f41beb61..f376af30 100644 --- a/src/world/ThreadName.cpp +++ b/src/world/ThreadName.cpp @@ -3,13 +3,13 @@ // From Xbox documentation typedef struct tagTHREADNAME_INFO { - DWORD dwType; // Must be 0x1000 - LPCSTR szName; // Pointer to name (in user address space) - DWORD dwThreadID; // Thread ID (-1 for caller thread) - DWORD dwFlags; // Reserved for future use; must be zero + unsigned long dwType; // Must be 0x1000 + const char* szName; // Pointer to name (in user address space) + unsigned long dwThreadID; // Thread ID (-1 for caller thread) + unsigned long dwFlags; // Reserved for future use; must be zero } THREADNAME_INFO; -void SetThreadName( DWORD dwThreadID, LPCSTR szThreadName ) +void SetThreadName( unsigned long dwThreadID, const char* szThreadName ) { #ifndef __PS3__ THREADNAME_INFO info; @@ -22,7 +22,7 @@ void SetThreadName( DWORD dwThreadID, LPCSTR szThreadName ) #if ( defined _WINDOWS64 | defined _DURANGO ) __try { - RaiseException( 0x406D1388, 0, sizeof(info)/sizeof(DWORD), (ULONG_PTR *)&info ); + RaiseException( 0x406D1388, 0, sizeof(info)/sizeof(unsigned long), (uintptr_t *)&info ); } __except( GetExceptionCode()==0x406D1388 ? EXCEPTION_CONTINUE_EXECUTION : EXCEPTION_EXECUTE_HANDLER ) { @@ -31,7 +31,7 @@ void SetThreadName( DWORD dwThreadID, LPCSTR szThreadName ) #ifdef _XBOX __try { - RaiseException( 0x406D1388, 0, sizeof(info)/sizeof(DWORD), (DWORD *)&info ); + RaiseException( 0x406D1388, 0, sizeof(info)/sizeof(unsigned long), (unsigned long *)&info ); } __except( GetExceptionCode()==0x406D1388 ? EXCEPTION_CONTINUE_EXECUTION : EXCEPTION_EXECUTE_HANDLER ) { diff --git a/src/world/ThreadName.h b/src/world/ThreadName.h index e7afe594..465d9353 100644 --- a/src/world/ThreadName.h +++ b/src/world/ThreadName.h @@ -1,3 +1,3 @@ #pragma once -void SetThreadName( DWORD dwThreadID, LPCSTR szThreadName ); \ No newline at end of file +void SetThreadName( unsigned long dwThreadID, const char* szThreadName ); \ No newline at end of file diff --git a/src/world/TickNextTickData.cpp b/src/world/TickNextTickData.cpp index 95cab285..96771be1 100644 --- a/src/world/TickNextTickData.cpp +++ b/src/world/TickNextTickData.cpp @@ -2,7 +2,7 @@ #include "TickNextTickData.h" -__int64 TickNextTickData::C = 0; +int64_t TickNextTickData::C = 0; TickNextTickData::TickNextTickData(int x, int y, int z, int tileId) { @@ -33,7 +33,7 @@ int TickNextTickData::hashCode() const return (((x * 1024 * 1024) + (z * 1024) + y) * 256) + tileId; } -TickNextTickData *TickNextTickData::delay(__int64 l) +TickNextTickData *TickNextTickData::delay(int64_t l) { this->m_delay = l; return this; diff --git a/src/world/TickNextTickData.h b/src/world/TickNextTickData.h index 41ee99da..0797317a 100644 --- a/src/world/TickNextTickData.h +++ b/src/world/TickNextTickData.h @@ -6,21 +6,21 @@ class TickNextTickData { private: - static __int64 C; + static int64_t C; public: int x, y, z, tileId; - __int64 m_delay; + int64_t m_delay; private: - __int64 c; + int64_t c; public: TickNextTickData(int x, int y, int z, int tileId); bool equals(const void *o) const; int hashCode() const; - TickNextTickData *delay(__int64 l); + TickNextTickData *delay(int64_t l); int compareTo(const TickNextTickData *tnd) const; static bool compare_fnct(const TickNextTickData &x, const TickNextTickData &y); diff --git a/src/world/Tile.cpp b/src/world/Tile.cpp index e0ef8dd9..01f9bb90 100644 --- a/src/world/Tile.cpp +++ b/src/world/Tile.cpp @@ -201,7 +201,7 @@ Tile *Tile::stairs_quartz = NULL; Tile *Tile::woolCarpet = NULL; -DWORD Tile::tlsIdxShape = TlsAlloc(); +unsigned long Tile::tlsIdxShape = TlsAlloc(); Tile::ThreadStorage::ThreadStorage() { @@ -1333,7 +1333,7 @@ void Tile::handleRain(Level *level, int x, int y, int z) { } - void Tile::levelTimeChanged(Level *level, __int64 delta, __int64 newTime) + void Tile::levelTimeChanged(Level *level, int64_t delta, int64_t newTime) { } diff --git a/src/world/Tile.h b/src/world/Tile.h index fa2f5786..b5d67840 100644 --- a/src/world/Tile.h +++ b/src/world/Tile.h @@ -55,7 +55,7 @@ protected: int tileId; ThreadStorage(); }; - static DWORD tlsIdxShape; + static unsigned long tlsIdxShape; public: // Each new thread that needs to use Vec3 pools will need to call one of the following 2 functions, to either create its own // local storage, or share the default storage already allocated by the main thread @@ -636,7 +636,7 @@ public: virtual void playerWillDestroy(Level *level, int x, int y, int z, int data, shared_ptr player); virtual void onRemoving(Level *level, int x, int y, int z, int data); virtual void handleRain(Level *level, int x, int y, int z); - virtual void levelTimeChanged(Level *level, __int64 delta, __int64 newTime); + virtual void levelTimeChanged(Level *level, int64_t delta, int64_t newTime); virtual void registerIcons(IconRegister *iconRegister); virtual wstring getTileItemIconName(); // 4J Using per-item textures now diff --git a/src/world/TileUpdatePacket.cpp b/src/world/TileUpdatePacket.cpp index 6ca37faf..37dd5ee8 100644 --- a/src/world/TileUpdatePacket.cpp +++ b/src/world/TileUpdatePacket.cpp @@ -33,7 +33,7 @@ void TileUpdatePacket::read(DataInputStream *dis) //throws IOException block = (int)dis->readShort() & 0xffff; - BYTE dataLevel = dis->readByte(); + uint8_t dataLevel = dis->readByte(); data = dataLevel & 0xf; levelIdx = (dataLevel>>4) & 0xf; #else @@ -61,7 +61,7 @@ void TileUpdatePacket::write(DataOutputStream *dos) //throws IOException dos->writeInt(z); dos->writeShort(block); - BYTE dataLevel = ((levelIdx & 0xf ) << 4) | (data & 0xf); + uint8_t dataLevel = ((levelIdx & 0xf ) << 4) | (data & 0xf); dos->writeByte(dataLevel); #else // 4J - for our fixed size map, we can pack x & z into 10 bits each (-512 -> 511), y into 8 bits (0 to 255) diff --git a/src/world/UpdateMobEffectPacket.cpp b/src/world/UpdateMobEffectPacket.cpp index dec8d79f..9e2b3136 100644 --- a/src/world/UpdateMobEffectPacket.cpp +++ b/src/world/UpdateMobEffectPacket.cpp @@ -17,7 +17,7 @@ UpdateMobEffectPacket::UpdateMobEffectPacket() UpdateMobEffectPacket::UpdateMobEffectPacket(int entityId, MobEffectInstance *effect) { this->entityId = entityId; - this->effectId = (BYTE) (effect->getId() & 0xff); + this->effectId = (uint8_t) (effect->getId() & 0xff); this->effectAmplifier = (char) (effect->getAmplifier() & 0xff); this->effectDurationTicks = (short) effect->getDuration(); } diff --git a/src/world/UpdateMobEffectPacket.h b/src/world/UpdateMobEffectPacket.h index d17d1be4..0d1455c7 100644 --- a/src/world/UpdateMobEffectPacket.h +++ b/src/world/UpdateMobEffectPacket.h @@ -8,7 +8,7 @@ class UpdateMobEffectPacket : public Packet, public enable_shared_from_thisparent) : Layer(seedMixup) +VoronoiZoom::VoronoiZoom(int64_t seedMixup, shared_ptrparent) : Layer(seedMixup) { this->parent = parent; } diff --git a/src/world/VoronoiZoom.h b/src/world/VoronoiZoom.h index c0738c90..43a8de66 100644 --- a/src/world/VoronoiZoom.h +++ b/src/world/VoronoiZoom.h @@ -5,7 +5,7 @@ class VoronoiZoom : public Layer { public: - VoronoiZoom(__int64 seedMixup, shared_ptrparent); + VoronoiZoom(int64_t seedMixup, shared_ptrparent); virtual intArray getArea(int xo, int yo, int w, int h); diff --git a/src/world/WaterLevelChunk.cpp b/src/world/WaterLevelChunk.cpp index b6dbd05d..19f3e8a1 100644 --- a/src/world/WaterLevelChunk.cpp +++ b/src/world/WaterLevelChunk.cpp @@ -143,7 +143,7 @@ bool WaterLevelChunk::testSetBlocksAndData(byteArray data, int x0, int y0, int z return false; } -Random *WaterLevelChunk::getRandom(__int64 l) +Random *WaterLevelChunk::getRandom(int64_t l) { return new Random((level->getSeed() + x * x * 4987142 + x * 5947611 + z * z * 4392871l + z * 389711) ^ l); } diff --git a/src/world/WaterLevelChunk.h b/src/world/WaterLevelChunk.h index 18dc8a05..43e7e0c6 100644 --- a/src/world/WaterLevelChunk.h +++ b/src/world/WaterLevelChunk.h @@ -39,7 +39,7 @@ public: void setBlocks(byteArray newBlocks, int sub); int setBlocksAndData(byteArray data, int x0, int y0, int z0, int x1, int y1, int z1, int p, bool includeLighting = true); // 4J - added includeLighting parameter; bool testSetBlocksAndData(byteArray data, int x0, int y0, int z0, int x1, int y1, int z1, int p); - Random *getRandom(__int64 l); + Random *getRandom(int64_t l); virtual Biome *getBiome(int x, int z, BiomeSource *biomeSource); virtual void reSyncLighting() {}; // 4J added }; diff --git a/src/world/ZoneFile.cpp b/src/world/ZoneFile.cpp index fc1f36bf..661cb7dd 100644 --- a/src/world/ZoneFile.cpp +++ b/src/world/ZoneFile.cpp @@ -6,7 +6,7 @@ const int ZoneFile::slotsLength = ZonedChunkStorage::CHUNKS_PER_ZONE * ZonedChunkStorage::CHUNKS_PER_ZONE; -ZoneFile::ZoneFile(__int64 key, File file, File entityFile) : slots(slotsLength) +ZoneFile::ZoneFile(int64_t key, File file, File entityFile) : slots(slotsLength) { lastUse = 0; diff --git a/src/world/ZoneFile.h b/src/world/ZoneFile.h index d7b8cc82..0677a6b5 100644 --- a/src/world/ZoneFile.h +++ b/src/world/ZoneFile.h @@ -17,18 +17,18 @@ private: short slotCount; public: - __int64 lastUse; + int64_t lastUse; private: - HANDLE channel; + void* channel; public: - __int64 key; + int64_t key; File file; NbtSlotFile *entityFile; - ZoneFile(__int64 key, File file, File entityFile); + ZoneFile(int64_t key, File file, File entityFile); ~ZoneFile(); void readHeader(); diff --git a/src/world/ZoneIo.cpp b/src/world/ZoneIo.cpp index f1838c86..7a8771ac 100644 --- a/src/world/ZoneIo.cpp +++ b/src/world/ZoneIo.cpp @@ -2,7 +2,7 @@ #include "ByteBuffer.h" #include "ZoneIo.h" -ZoneIo::ZoneIo(HANDLE channel, __int64 pos) +ZoneIo::ZoneIo(void* channel, int64_t pos) { this->channel = channel; this->pos = pos; @@ -21,7 +21,7 @@ void ZoneIo::write(byteArray bb, int size) void ZoneIo::write(ByteBuffer *bb, int size) { - DWORD numberOfBytesWritten; + unsigned long numberOfBytesWritten; SetFilePointer(channel,(int)pos,NULL,NULL); WriteFile(channel,bb->getBuffer(), bb->getSize(),&numberOfBytesWritten,NULL); pos += size; @@ -29,7 +29,7 @@ void ZoneIo::write(ByteBuffer *bb, int size) ByteBuffer *ZoneIo::read(int size) { - DWORD numberOfBytesRead; + unsigned long numberOfBytesRead; byteArray bb = byteArray(size); SetFilePointer(channel,(int)pos,NULL,NULL); ByteBuffer *buff = ByteBuffer::wrap(bb); diff --git a/src/world/ZoneIo.h b/src/world/ZoneIo.h index 22473583..06f0bebb 100644 --- a/src/world/ZoneIo.h +++ b/src/world/ZoneIo.h @@ -6,11 +6,11 @@ class ByteBuffer; class ZoneIo { private: - HANDLE channel; - __int64 pos; + void* channel; + int64_t pos; public: - ZoneIo(HANDLE channel, __int64 pos); + ZoneIo(void* channel, int64_t pos); void write(byteArray bb, int size); void write(ByteBuffer *bb, int size); ByteBuffer *read(int size); diff --git a/src/world/ZonedChunkStorage.cpp b/src/world/ZonedChunkStorage.cpp index b4ee8585..8c6f8fca 100644 --- a/src/world/ZonedChunkStorage.cpp +++ b/src/world/ZonedChunkStorage.cpp @@ -50,7 +50,7 @@ ZoneFile *ZonedChunkStorage::getZoneFile(int x, int z, bool create) int xZone = x >> CHUNKS_PER_ZONE_BITS; int zZone = z >> CHUNKS_PER_ZONE_BITS; - __int64 key = xZone + (zZone << 20l); + int64_t key = xZone + (zZone << 20l); // 4J - was !zoneFiles.containsKey(key) if (zoneFiles.find(key) == zoneFiles.end()) { @@ -63,7 +63,7 @@ ZoneFile *ZonedChunkStorage::getZoneFile(int x, int z, bool create) if ( !file.exists() ) { if (!create) return NULL; - HANDLE ch = CreateFile(wstringtofilename(file.getPath()), GENERIC_READ | GENERIC_WRITE, 0, NULL, OPEN_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL); + void* ch = CreateFile(wstringtofilename(file.getPath()), GENERIC_READ | GENERIC_WRITE, 0, NULL, OPEN_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL); CloseHandle(ch); } @@ -107,8 +107,8 @@ LevelChunk *ZonedChunkStorage::load(Level *level, int x, int z) header->flip(); int xOrg = header->getInt(); int zOrg = header->getInt(); - __int64 time = header->getLong(); - __int64 flags = header->getLong(); + int64_t time = header->getLong(); + int64_t flags = header->getLong(); lc->terrainPopulated = (flags & BIT_TERRAIN_POPULATED) != 0; @@ -121,7 +121,7 @@ LevelChunk *ZonedChunkStorage::load(Level *level, int x, int z) void ZonedChunkStorage::save(Level *level, LevelChunk *lc) { - __int64 flags = 0; + int64_t flags = 0; if (lc->terrainPopulated) flags |= BIT_TERRAIN_POPULATED; ByteBuffer *header = ByteBuffer::allocate(CHUNK_HEADER_SIZE); @@ -147,10 +147,10 @@ void ZonedChunkStorage::tick() tickCount++; if (tickCount % (20 * 10) == 4) { - vector<__int64> toClose; + vector toClose; AUTO_VAR(itEndZF, zoneFiles.end()); - for( unordered_map<__int64, ZoneFile *>::iterator it = zoneFiles.begin(); it != itEndZF; it++ ) + for( unordered_map::iterator it = zoneFiles.begin(); it != itEndZF; it++ ) { ZoneFile *zoneFile = it->second; if (tickCount - zoneFile->lastUse > 20 * 60) @@ -162,7 +162,7 @@ void ZonedChunkStorage::tick() AUTO_VAR(itEndTC, toClose.end()); for (AUTO_VAR(it, toClose.begin()); it != itEndTC; it++) { - __int64 key = *it ; //toClose[i]; + int64_t key = *it ; //toClose[i]; // 4J - removed try/catch // try { char buf[256]; @@ -181,7 +181,7 @@ void ZonedChunkStorage::tick() void ZonedChunkStorage::flush() { AUTO_VAR(itEnd, zoneFiles.end()); - for( unordered_map<__int64, ZoneFile *>::iterator it = zoneFiles.begin(); it != itEnd; it++ ) + for( unordered_map::iterator it = zoneFiles.begin(); it != itEnd; it++ ) { ZoneFile *zoneFile = it->second; // 4J - removed try/catch diff --git a/src/world/ZonedChunkStorage.h b/src/world/ZonedChunkStorage.h index ed7e3b65..b466d8f8 100644 --- a/src/world/ZonedChunkStorage.h +++ b/src/world/ZonedChunkStorage.h @@ -30,8 +30,8 @@ public: File dir; private: - unordered_map<__int64, ZoneFile *> zoneFiles; - __int64 tickCount; + unordered_map zoneFiles; + int64_t tickCount; public: ZonedChunkStorage(File dir); diff --git a/src/world/ZoomLayer.cpp b/src/world/ZoomLayer.cpp index bef24709..c2123785 100644 --- a/src/world/ZoomLayer.cpp +++ b/src/world/ZoomLayer.cpp @@ -2,7 +2,7 @@ #include "net.minecraft.world.level.newbiome.layer.h" #include "System.h" -ZoomLayer::ZoomLayer(__int64 seedMixup, shared_ptrparent) : Layer(seedMixup) +ZoomLayer::ZoomLayer(int64_t seedMixup, shared_ptrparent) : Layer(seedMixup) { this->parent = parent; } @@ -81,7 +81,7 @@ int ZoomLayer::random(int a, int b, int c, int d) return d; } -shared_ptrZoomLayer::zoom(__int64 seed, shared_ptr sup, int count) +shared_ptrZoomLayer::zoom(int64_t seed, shared_ptr sup, int count) { shared_ptrresult = sup; for (int i = 0; i < count; i++) diff --git a/src/world/ZoomLayer.h b/src/world/ZoomLayer.h index f865f088..8ec93c8a 100644 --- a/src/world/ZoomLayer.h +++ b/src/world/ZoomLayer.h @@ -5,7 +5,7 @@ class ZoomLayer : public Layer { public: - ZoomLayer(__int64 seedMixup, shared_ptr parent); + ZoomLayer(int64_t seedMixup, shared_ptr parent); virtual intArray getArea(int xo, int yo, int w, int h); @@ -14,5 +14,5 @@ protected: int random(int a, int b, int c, int d); public: - static shared_ptr zoom(__int64 seed, shared_ptrsup, int count); + static shared_ptr zoom(int64_t seed, shared_ptrsup, int count); }; \ No newline at end of file diff --git a/src/world/compression.cpp b/src/world/compression.cpp index c248624b..d2b0c83f 100644 --- a/src/world/compression.cpp +++ b/src/world/compression.cpp @@ -11,7 +11,7 @@ #endif //__PS3__ -DWORD Compression::tlsIdx = 0; +unsigned long Compression::tlsIdx = 0; Compression::ThreadStorage *Compression::tlsDefault = NULL; Compression::ThreadStorage::ThreadStorage() @@ -54,7 +54,7 @@ Compression *Compression::getCompression() return tls->compression; } -HRESULT Compression::CompressLZXRLE(void *pDestination, unsigned int *pDestSize, void *pSource, unsigned int SrcSize) +int Compression::CompressLZXRLE(void *pDestination, unsigned int *pDestSize, void *pSource, unsigned int SrcSize) { EnterCriticalSection(&rleCompressLock); //static unsigned char rleBuf[1024*100]; @@ -113,7 +113,7 @@ HRESULT Compression::CompressLZXRLE(void *pDestination, unsigned int *pDestSize, return S_OK; } -HRESULT Compression::CompressRLE(void *pDestination, unsigned int *pDestSize, void *pSource, unsigned int SrcSize) +int Compression::CompressRLE(void *pDestination, unsigned int *pDestSize, void *pSource, unsigned int SrcSize) { EnterCriticalSection(&rleCompressLock); //static unsigned char rleBuf[1024*100]; @@ -180,7 +180,7 @@ HRESULT Compression::CompressRLE(void *pDestination, unsigned int *pDestSize, vo return S_OK; } -HRESULT Compression::DecompressLZXRLE(void *pDestination, unsigned int *pDestSize, void *pSource, unsigned int SrcSize) +int Compression::DecompressLZXRLE(void *pDestination, unsigned int *pDestSize, void *pSource, unsigned int SrcSize) { EnterCriticalSection(&rleDecompressLock); // 4J Stu - Fix for #13676 - Crash: Crash while attempting to load a world after updating TU @@ -252,7 +252,7 @@ HRESULT Compression::DecompressLZXRLE(void *pDestination, unsigned int *pDestSiz return S_OK; } -HRESULT Compression::DecompressRLE(void *pDestination, unsigned int *pDestSize, void *pSource, unsigned int SrcSize) +int Compression::DecompressRLE(void *pDestination, unsigned int *pDestSize, void *pSource, unsigned int SrcSize) { EnterCriticalSection(&rleDecompressLock); @@ -297,11 +297,11 @@ HRESULT Compression::DecompressRLE(void *pDestination, unsigned int *pDestSize, } -HRESULT Compression::Compress(void *pDestination, unsigned int *pDestSize, void *pSource, unsigned int SrcSize) +int Compression::Compress(void *pDestination, unsigned int *pDestSize, void *pSource, unsigned int SrcSize) { // Using zlib for x64 compression - 360 is using native 360 compression and PS3 a stubbed non-compressing version of this #if defined __ORBIS__ || defined _DURANGO || defined _WIN64 || defined __PSVITA__ - SIZE_T destSize = (SIZE_T)(*pDestSize); + size_t destSize = (size_t)(*pDestSize); int res = ::compress((Bytef *)pDestination, (uLongf *)&destSize, (Bytef *)pSource, SrcSize); *pDestSize = (unsigned int)destSize; return ( ( res == Z_OK ) ? S_OK : -1 ); @@ -311,14 +311,14 @@ HRESULT Compression::Compress(void *pDestination, unsigned int *pDestSize, void *pDestSize = (unsigned int)destSize; return ( ( res ) ? S_OK : -1 ); #else - SIZE_T destSize = (SIZE_T)(*pDestSize); - HRESULT res = XMemCompress(compressionContext, pDestination, &destSize, pSource, SrcSize); + size_t destSize = (size_t)(*pDestSize); + int res = XMemCompress(compressionContext, pDestination, &destSize, pSource, SrcSize); *pDestSize = (unsigned int)destSize; return res; #endif } -HRESULT Compression::Decompress(void *pDestination, unsigned int *pDestSize, void *pSource, unsigned int SrcSize) +int Compression::Decompress(void *pDestination, unsigned int *pDestSize, void *pSource, unsigned int SrcSize) { if(m_decompressType != m_localDecompressType) // check if we're decompressing data from a different platform @@ -329,7 +329,7 @@ HRESULT Compression::Decompress(void *pDestination, unsigned int *pDestSize, voi // Using zlib for x64 compression - 360 is using native 360 compression and PS3 a stubbed non-compressing version of this #if defined __ORBIS__ || defined _DURANGO || defined _WIN64 || defined __PSVITA__ - SIZE_T destSize = (SIZE_T)(*pDestSize); + size_t destSize = (size_t)(*pDestSize); int res = ::uncompress((Bytef *)pDestination, (uLongf *)&destSize, (Bytef *)pSource, SrcSize); *pDestSize = (unsigned int)destSize; return ( ( res == Z_OK ) ? S_OK : -1 ); @@ -339,8 +339,8 @@ HRESULT Compression::Decompress(void *pDestination, unsigned int *pDestSize, voi *pDestSize = (unsigned int)destSize; return ( ( res ) ? S_OK : -1 ); #else - SIZE_T destSize = (SIZE_T)(*pDestSize); - HRESULT res = XMemDecompress(decompressionContext, pDestination, (SIZE_T *)&destSize, pSource, SrcSize); + size_t destSize = (size_t)(*pDestSize); + int res = XMemDecompress(decompressionContext, pDestination, (size_t *)&destSize, pSource, SrcSize); *pDestSize = (unsigned int)destSize; return res; #endif @@ -348,7 +348,7 @@ HRESULT Compression::Decompress(void *pDestination, unsigned int *pDestSize, voi // MGH - same as VirtualDecompress in PSVitaStubs, but for use on other platforms (so no virtual mem stuff) #ifndef _XBOX -VOID Compression::VitaVirtualDecompress(void *pDestination, unsigned int *pDestSize, void *pSource, unsigned int SrcSize) // (LPVOID buf, SIZE_T dwSize, LPVOID dst) +void Compression::VitaVirtualDecompress(void *pDestination, unsigned int *pDestSize, void *pSource, unsigned int SrcSize) // (void* buf, size_t dwSize, void* dst) { uint8_t *pSrc = (uint8_t *)pSource; int Offset = 0; @@ -383,7 +383,7 @@ VOID Compression::VitaVirtualDecompress(void *pDestination, unsigned int *pDestS #endif -HRESULT Compression::DecompressWithType(void *pDestination, unsigned int *pDestSize, void *pSource, unsigned int SrcSize) +int Compression::DecompressWithType(void *pDestination, unsigned int *pDestSize, void *pSource, unsigned int SrcSize) { switch(m_decompressType) { @@ -395,8 +395,8 @@ HRESULT Compression::DecompressWithType(void *pDestination, unsigned int *pDestS case eCompressionType_LZXRLE: { #if (defined _XBOX || defined _DURANGO || defined _WIN64) - SIZE_T destSize = (SIZE_T)(*pDestSize); - HRESULT res = XMemDecompress(decompressionContext, pDestination, (SIZE_T *)&destSize, pSource, SrcSize); + size_t destSize = (size_t)(*pDestSize); + int res = XMemDecompress(decompressionContext, pDestination, (size_t *)&destSize, pSource, SrcSize); *pDestSize = (unsigned int)destSize; return res; #else @@ -407,7 +407,7 @@ HRESULT Compression::DecompressWithType(void *pDestination, unsigned int *pDestS case eCompressionType_ZLIBRLE: #if (defined __ORBIS__ || defined __PS3__ || defined _DURANGO || defined _WIN64) if (pDestination != NULL) - return ::uncompress((PBYTE)pDestination, (unsigned long *) pDestSize, (PBYTE) pSource, SrcSize); // Decompress + return ::uncompress((uint8_t*)pDestination, (unsigned long *) pDestSize, (uint8_t*) pSource, SrcSize); // Decompress else break; // Cannot decompress when destination is NULL #else assert(0); @@ -420,8 +420,8 @@ HRESULT Compression::DecompressWithType(void *pDestination, unsigned int *pDestS if (pDestination != NULL) { // Read big-endian srcize from array - PBYTE pbDestSize = (PBYTE) pDestSize; - PBYTE pbSource = (PBYTE) pSource; + uint8_t* pbDestSize = (uint8_t*) pDestSize; + uint8_t* pbSource = (uint8_t*) pSource; for (int i = 3; i >= 0; i--) { pbDestSize[3-i] = pbSource[i]; } @@ -436,7 +436,7 @@ HRESULT Compression::DecompressWithType(void *pDestination, unsigned int *pDestS strm.next_out = uncompr.data; strm.avail_out = uncompr.length; // Skip those first 4 bytes - strm.next_in = (PBYTE) pSource + 4; + strm.next_in = (uint8_t*) pSource + 4; strm.avail_in = SrcSize - 4; int hr = inflateInit2(&strm, -15); diff --git a/src/world/compression.h b/src/world/compression.h index 2a0b7902..44d0f93a 100644 --- a/src/world/compression.h +++ b/src/world/compression.h @@ -27,7 +27,7 @@ private: ThreadStorage(); ~ThreadStorage(); }; - static DWORD tlsIdx; + static unsigned long tlsIdx; static ThreadStorage *tlsDefault; public: // Each new thread that needs to use Compression will need to call one of the following 2 functions, to either create its own @@ -39,14 +39,14 @@ public: static Compression *getCompression(); public: - HRESULT Compress(void *pDestination, unsigned int *pDestSize, void *pSource, unsigned int SrcSize); - HRESULT Decompress(void *pDestination, unsigned int *pDestSize, void *pSource, unsigned int SrcSize); - HRESULT CompressLZXRLE(void *pDestination, unsigned int *pDestSize, void *pSource, unsigned int SrcSize); - HRESULT DecompressLZXRLE(void *pDestination, unsigned int *pDestSize, void *pSource, unsigned int SrcSize); - HRESULT CompressRLE(void *pDestination, unsigned int *pDestSize, void *pSource, unsigned int SrcSize); - HRESULT DecompressRLE(void *pDestination, unsigned int *pDestSize, void *pSource, unsigned int SrcSize); + int Compress(void *pDestination, unsigned int *pDestSize, void *pSource, unsigned int SrcSize); + int Decompress(void *pDestination, unsigned int *pDestSize, void *pSource, unsigned int SrcSize); + int CompressLZXRLE(void *pDestination, unsigned int *pDestSize, void *pSource, unsigned int SrcSize); + int DecompressLZXRLE(void *pDestination, unsigned int *pDestSize, void *pSource, unsigned int SrcSize); + int CompressRLE(void *pDestination, unsigned int *pDestSize, void *pSource, unsigned int SrcSize); + int DecompressRLE(void *pDestination, unsigned int *pDestSize, void *pSource, unsigned int SrcSize); #ifndef _XBOX - static VOID VitaVirtualDecompress(void *pDestination, unsigned int *pDestSize, void *pSource, unsigned int SrcSize); + static void VitaVirtualDecompress(void *pDestination, unsigned int *pDestSize, void *pSource, unsigned int SrcSize); #endif void SetDecompressionType(ECompressionTypes type) { m_decompressType = type; } // for loading a save from a different platform (Sony cloud storage cross play) @@ -57,7 +57,7 @@ public: ~Compression(); private: - HRESULT DecompressWithType(void *pDestination, unsigned int *pDestSize, void *pSource, unsigned int SrcSize); + int DecompressWithType(void *pDestination, unsigned int *pDestSize, void *pSource, unsigned int SrcSize); #if defined __ORBIS__ || defined __PS3__ #else diff --git a/src/world/net.minecraft.world.item.h b/src/world/net.minecraft.world.item.h index 0300b954..250aae50 100644 --- a/src/world/net.minecraft.world.item.h +++ b/src/world/net.minecraft.world.item.h @@ -34,7 +34,7 @@ #include "ShearsItem.h" #include "ShovelItem.h" #include "SignItem.h" -#include "SnowBallItem.h" +#include "SnowballItem.h" #include "StoneSlabTileItem.h" #include "TileItem.h" #include "TilePlanterItem.h" diff --git a/src/world/stdafx.h b/src/world/stdafx.h index d9f9cb7e..e15b20e3 100644 --- a/src/world/stdafx.h +++ b/src/world/stdafx.h @@ -10,7 +10,7 @@ #endif #if ( defined _XBOX || defined _WINDOWS64 || defined _DURANGO ) -typedef unsigned __int64 __uint64; +typedef unsigned int64_t uint64_t; #endif #ifdef _WINDOWS64 @@ -25,22 +25,23 @@ typedef unsigned __int64 __uint64; #include #include #include -using INT = int; -using UINT = unsigned int; -using BYTE = uint8_t; -using SHORT = int16_t; -using DWORD = uint32_t; -using ULONGLONG = uint64_t; -using PBYTE = uint8_t*; -using LPVOID = void*; -using LPCWSTR = const wchar_t*; -using LPCSTR = const char*; -using HRESULT = int; -using BOOL = bool; -using __int64 = int64_t; -using __uint64 = uint64_t; -#define ZeroMemory(ptr,size) memset(ptr, 0, size) + +struct LARGE_INTEGER { + union { + struct { unsigned long LowPart; int32_t HighPart; }; + int64_t QuadPart; + }; +}; + +struct FILETIME { + unsigned long dwLowDateTime; + unsigned long dwHighDateTime; +}; + #define CRITICAL_SECTION std::mutex + +#define ZeroMemory(ptr, size) memset(ptr, 0, size) +#define __stdcall #endif #ifdef _DURANGO @@ -254,10 +255,9 @@ void MemSect(int sect); #include "PSVita\Sentient\SentientManager.h" #include "PSVita\Sentient\MinecraftTelemetry.h" #else -/*#include "Orbis\Orbis_App.h" -#include "OrbisMedia\strings.h" -#include "Orbis\Sentient\SentientTelemetryCommon.h" -#include "Orbis\Sentient\MinecraftTelemetry.h"*/ +#include "SDLMedia/strings.h" +#include "SDL/Sentient/SentientTelemetryCommon.h" +#include "SDL/Sentient/MinecraftTelemetry.h" #endif #include "Common/DLC/DLCSkinFile.h" @@ -267,3 +267,31 @@ void MemSect(int sect); #include "Common/GameRules/ConsoleGameRulesConstants.h" #include "Common/GameRules/ConsoleGameRules.h" #include "Common/Telemetry/TelemetryManager.h" + +#ifdef linux +#undef linux +#endif + +#ifdef windows +#undef windows +#endif + +#ifdef macos +#undef macos +#endif + +#ifdef xbox +#undef xbox +#endif + +#ifdef solaris +#undef solaris +#endif + +#ifdef min +#undef min +#endif + +#ifdef max +#undef max +#endif \ No newline at end of file diff --git a/src/world/system.cpp b/src/world/system.cpp index 72727e20..cdce4e86 100644 --- a/src/world/system.cpp +++ b/src/world/system.cpp @@ -16,7 +16,7 @@ template void System::arraycopy(arrayWithLength src, unsigned int s ArrayCopyFunctionDefinition(Node *) ArrayCopyFunctionDefinition(Biome *) -void System::arraycopy(arrayWithLength src, unsigned int srcPos, arrayWithLength *dst, unsigned int dstPos, unsigned int length) +void System::arraycopy(arrayWithLength src, unsigned int srcPos, arrayWithLength *dst, unsigned int dstPos, unsigned int length) { assert( srcPos >=0 && srcPos <= src.length); assert( srcPos + length <= src.length ); @@ -50,7 +50,7 @@ void System::arraycopy(arrayWithLength src, unsigned int srcPos, arrayWithL // //Returns: //The current value of the system timer, in nanoseconds. -__int64 System::nanoTime() +int64_t System::nanoTime() { return GetTickCount() * 1000000LL; } @@ -63,7 +63,7 @@ __int64 System::nanoTime() // //Returns: //the difference, measured in milliseconds, between the current time and midnight, January 1, 1970 UTC. -__int64 System::currentTimeMillis() +int64_t System::currentTimeMillis() { #ifdef __PS3__ // sys_time_get_current_time() obtains the elapsed time since Epoch (1970/01/01 00:00:00 UTC). @@ -72,7 +72,7 @@ __int64 System::currentTimeMillis() sys_time_sec_t sec; sys_time_nsec_t nsec; sys_time_get_current_time(&sec, &nsec); - __int64 msec = (sec * 1000) + (nsec / (1000*1000)); + int64_t msec = (sec * 1000) + (nsec / (1000*1000)); return msec; #elif defined __ORBIS__ @@ -85,7 +85,7 @@ __int64 System::currentTimeMillis() return sceKernelGetProcessTimeWide() / 1000; /* SceDateTime Time; sceRtcGetCurrentClockLocalTime(&Time); - __int64 systTime = (((((((Time.day * 24) + Time.hour) * 60) + Time.minute) * 60) + Time.second) * 1000) + (Time.microsecond / 1000); + int64_t systTime = (((((((Time.day * 24) + Time.hour) * 60) + Time.minute) * 60) + Time.second) * 1000) + (Time.microsecond / 1000); return systTime;*/ #else @@ -106,12 +106,12 @@ __int64 System::currentTimeMillis() } // 4J Stu - Added this so that we can use real-world timestamps in PSVita saves. Particularly required for the save transfers to be smooth -__int64 System::currentRealTimeMillis() +int64_t System::currentRealTimeMillis() { #ifdef __PSVITA__ SceDateTime Time; sceRtcGetCurrentClockLocalTime(&Time); - __int64 systTime = (((((((Time.day * 24) + Time.hour) * 60) + Time.minute) * 60) + Time.second) * 1000) + (Time.microsecond / 1000); + int64_t systTime = (((((((Time.day * 24) + Time.hour) * 60) + Time.minute) * 60) + Time.second) * 1000) + (Time.microsecond / 1000); return systTime; #else return currentTimeMillis(); @@ -175,9 +175,9 @@ void System::ReverseINT(int *piVal) pchVal1[3]=pchVal2[0]; } -void System::ReverseULONGLONG(__int64 *pullVal) +void System::ReverseULONGLONG(int64_t *pullVal) { - __int64 ullValue=*pullVal; + int64_t ullValue=*pullVal; unsigned char *pchVal1=(unsigned char *)pullVal; unsigned char *pchVal2=(unsigned char *)&ullValue; @@ -191,7 +191,7 @@ void System::ReverseULONGLONG(__int64 *pullVal) pchVal1[7]=pchVal2[0]; } -void System::ReverseWCHARA(WCHAR *pwch,int iLen) +void System::ReverseWCHARA(wchar_t *pwch,int iLen) { for(int i=0;i class XLockFreeStack +template +class XLockFreeStack { - std::vector intStack; + std::vector intStack; + mutable std::mutex m_mutex; + public: - XLockFreeStack() { -#ifdef __ORBIS__ - OrbisInit(); // For PS4, we need to make sure Ult is set up for the critical sections to be able to initialise -#endif - InitializeCriticalSectionAndSpinCount(&m_cs,5120); - } - ~XLockFreeStack() { DeleteCriticalSection( &m_cs ); } - void Initialize() {} - void Push(T *data) - { - EnterCriticalSection(&m_cs); - intStack.push_back(data); - LeaveCriticalSection(&m_cs); - } - T *Pop() - { - EnterCriticalSection(&m_cs); - if( intStack.size() ) - { - T* ret = intStack.back(); - intStack.pop_back(); - LeaveCriticalSection(&m_cs); - return ret; - } - else - { - LeaveCriticalSection(&m_cs); - return NULL; - } - } -private: - CRITICAL_SECTION m_cs; + XLockFreeStack() = default; + ~XLockFreeStack() = default; + + void Initialize() {} + + void Push(T* data) + { + std::lock_guard lock(m_mutex); + intStack.push_back(data); + } + + T* Pop() + { + std::lock_guard lock(m_mutex); + + if (intStack.empty()) + return nullptr; + + T* ret = intStack.back(); + intStack.pop_back(); + return ret; + } }; void XMemCpy(void *a, const void *b, size_t s); void XMemSet(void *a, int t, size_t s); void XMemSet128(void *a, int t, size_t s); -void *XPhysicalAlloc(SIZE_T a, ULONG_PTR b, ULONG_PTR c, DWORD d); +void *XPhysicalAlloc(size_t a, uintptr_t b, uintptr_t c, unsigned long d); void XPhysicalFree(void *a); class DLCManager; @@ -197,26 +190,26 @@ const int XUSER_NAME_SIZE = 32; class IQNetPlayer { public: - BYTE GetSmallId(); - void SendData(IQNetPlayer *player, const void *pvData, DWORD dwDataSize, DWORD dwFlags); + uint8_t GetSmallId(); + void SendData(IQNetPlayer *player, const void *pvData, unsigned long dwDataSize, unsigned long dwFlags); bool IsSameSystem(IQNetPlayer *player); - DWORD GetSendQueueSize( IQNetPlayer *player, DWORD dwFlags ); - DWORD GetCurrentRtt(); + unsigned long GetSendQueueSize( IQNetPlayer *player, unsigned long dwFlags ); + unsigned long GetCurrentRtt(); bool IsHost(); bool IsGuest(); bool IsLocal(); PlayerUID GetXuid(); - LPCWSTR GetGamertag(); + const wchar_t* GetGamertag(); int GetSessionIndex(); bool IsTalking(); - bool IsMutedByLocalUser(DWORD dwUserIndex); + bool IsMutedByLocalUser(unsigned long dwUserIndex); bool HasVoice(); bool HasCamera(); int GetUserIndex(); - void SetCustomDataValue(ULONG_PTR ulpCustomDataValue); - ULONG_PTR GetCustomDataValue(); + void SetCustomDataValue(uintptr_t ulpCustomDataValue); + uintptr_t GetCustomDataValue(); private: - ULONG_PTR m_customData; + uintptr_t m_customData; }; const int QNET_GETSENDQUEUESIZE_SECONDARY_TYPE = 0; @@ -225,21 +218,21 @@ const int QNET_GETSENDQUEUESIZE_BYTES = 0; typedef struct { - BYTE bFlags; - BYTE bReserved; - WORD cProbesXmit; - WORD cProbesRecv; - WORD cbData; - BYTE *pbData; - WORD wRttMinInMsecs; - WORD wRttMedInMsecs; - DWORD dwUpBitsPerSec; - DWORD dwDnBitsPerSec; + uint8_t bFlags; + uint8_t bReserved; + uint16_t cProbesXmit; + uint16_t cProbesRecv; + uint16_t cbData; + uint8_t *pbData; + uint16_t wRttMinInMsecs; + uint16_t wRttMedInMsecs; + unsigned long dwUpBitsPerSec; + unsigned long dwDnBitsPerSec; } XNQOSINFO; typedef struct { - UINT cxnqos; - UINT cxnqosPending; + unsigned int cxnqos; + unsigned int cxnqosPending; XNQOSINFO axnqosinfo[1]; } XNQOS; @@ -250,26 +243,26 @@ typedef struct _XSESSION_SEARCHRESULT { } XSESSION_SEARCHRESULT, *PXSESSION_SEARCHRESULT; typedef struct { - DWORD dwContextId; - DWORD dwValue; + unsigned long dwContextId; + unsigned long dwValue; } XUSER_CONTEXT, *PXUSER_CONTEXT; typedef struct _XSESSION_SEARCHRESULT_HEADER { - DWORD dwSearchResults; + unsigned long dwSearchResults; XSESSION_SEARCHRESULT *pResults; } XSESSION_SEARCHRESULT_HEADER, *PXSESSION_SEARCHRESULT_HEADER; typedef struct _XONLINE_FRIEND { PlayerUID xuid; - CHAR szGamertag[XUSER_NAME_SIZE]; - DWORD dwFriendState; + char szGamertag[XUSER_NAME_SIZE]; + unsigned long dwFriendState; SessionID sessionID; - DWORD dwTitleID; + unsigned long dwTitleID; FILETIME ftUserTime; SessionID xnkidInvite; FILETIME gameinviteTime; - DWORD cchRichPresence; -// WCHAR wszRichPresence[MAX_RICHPRESENCE_SIZE]; + unsigned long cchRichPresence; +// wchar_t wszRichPresence[MAX_RICHPRESENCE_SIZE]; } XONLINE_FRIEND, *PXONLINE_FRIEND; class IQNetCallbacks @@ -298,16 +291,16 @@ typedef enum _QNET_STATE class IQNet { public: - HRESULT AddLocalPlayerByUserIndex(DWORD dwUserIndex); + int AddLocalPlayerByUserIndex(unsigned long dwUserIndex); IQNetPlayer *GetHostPlayer(); - IQNetPlayer *GetLocalPlayerByUserIndex(DWORD dwUserIndex); - IQNetPlayer *GetPlayerByIndex(DWORD dwPlayerIndex); - IQNetPlayer *GetPlayerBySmallId(BYTE SmallId); + IQNetPlayer *GetLocalPlayerByUserIndex(unsigned long dwUserIndex); + IQNetPlayer *GetPlayerByIndex(unsigned long dwPlayerIndex); + IQNetPlayer *GetPlayerBySmallId(uint8_t SmallId); IQNetPlayer *GetPlayerByXuid(PlayerUID xuid); - DWORD GetPlayerCount(); + unsigned long GetPlayerCount(); QNET_STATE GetState(); bool IsHost(); - HRESULT JoinGameFromInviteInfo(DWORD dwUserIndex, DWORD dwUserMask, const INVITE_INFO *pInviteInfo); + int JoinGameFromInviteInfo(unsigned long dwUserIndex, unsigned long dwUserMask, const INVITE_INFO *pInviteInfo); void HostGame(); void EndGame(); @@ -327,8 +320,8 @@ void PIXEndNamedEvent(); void PIXSetMarkerDeprecated(int a, char *b, ...); #endif -void XSetThreadProcessor(HANDLE a, int b); -//BOOL XCloseHandle(HANDLE a); +void XSetThreadProcessor(void* a, int b); +//bool XCloseHandle(void* a); const int QNET_SENDDATA_LOW_PRIORITY = 0; const int QNET_SENDDATA_SECONDARY = 0; @@ -341,8 +334,8 @@ const int INVALID_XUID = 0; // typedef struct _STRING_VERIFY_RESPONSE // { -// WORD wNumStrings; -// HRESULT *pStringResult; +// uint16_t wNumStrings; +// int *pStringResult; // } STRING_VERIFY_RESPONSE; const int XCONTENT_MAX_DISPLAYNAME_LENGTH = 256; @@ -353,9 +346,9 @@ typedef int XCONTENTDEVICEID; typedef struct _XCONTENT_DATA { XCONTENTDEVICEID DeviceID; - DWORD dwContentType; - WCHAR szDisplayName[XCONTENT_MAX_DISPLAYNAME_LENGTH]; - CHAR szFileName[XCONTENT_MAX_FILENAME_LENGTH]; + unsigned long dwContentType; + wchar_t szDisplayName[XCONTENT_MAX_DISPLAYNAME_LENGTH]; + char szFileName[XCONTENT_MAX_FILENAME_LENGTH]; } XCONTENT_DATA, *PXCONTENT_DATA; #endif //__PS3__ @@ -364,26 +357,26 @@ static const int XMARKETPLACE_CONTENT_ID_LEN = 4; #ifndef _DURANGO typedef struct _XMARKETPLACE_CONTENTOFFER_INFO { - ULONGLONG qwOfferID; - ULONGLONG qwPreviewOfferID; - DWORD dwOfferNameLength; - WCHAR *wszOfferName; - DWORD dwOfferType; - BYTE contentId[XMARKETPLACE_CONTENT_ID_LEN]; - BOOL fIsUnrestrictedLicense; - DWORD dwLicenseMask; - DWORD dwTitleID; - DWORD dwContentCategory; - DWORD dwTitleNameLength; - WCHAR *wszTitleName; - BOOL fUserHasPurchased; - DWORD dwPackageSize; - DWORD dwInstallSize; - DWORD dwSellTextLength; - WCHAR *wszSellText; - DWORD dwAssetID; - DWORD dwPurchaseQuantity; - DWORD dwPointsPrice; + uint64_t qwOfferID; + uint64_t qwPreviewOfferID; + unsigned long dwOfferNameLength; + wchar_t *wszOfferName; + unsigned long dwOfferType; + uint8_t contentId[XMARKETPLACE_CONTENT_ID_LEN]; + bool fIsUnrestrictedLicense; + unsigned long dwLicenseMask; + unsigned long dwTitleID; + unsigned long dwContentCategory; + unsigned long dwTitleNameLength; + wchar_t *wszTitleName; + bool fUserHasPurchased; + unsigned long dwPackageSize; + unsigned long dwInstallSize; + unsigned long dwSellTextLength; + wchar_t *wszSellText; + unsigned long dwAssetID; + unsigned long dwPurchaseQuantity; + unsigned long dwPointsPrice; } XMARKETPLACE_CONTENTOFFER_INFO, *PXMARKETPLACE_CONTENTOFFER_INFO; typedef enum @@ -405,7 +398,7 @@ const int QNET_SENDDATA_SEQUENTIAL = 0; struct XRNM_SEND_BUFFER { - DWORD dwDataSize; + unsigned long dwDataSize; byte *pbyData; }; @@ -416,30 +409,30 @@ const int D3DPT_QUADLIST = 0; typedef struct _XUSER_SIGNIN_INFO { PlayerUID xuid; - DWORD dwGuestNumber; + unsigned long dwGuestNumber; } XUSER_SIGNIN_INFO, *PXUSER_SIGNIN_INFO; #define XUSER_GET_SIGNIN_INFO_ONLINE_XUID_ONLY 0x00000001 #define XUSER_GET_SIGNIN_INFO_OFFLINE_XUID_ONLY 0x00000002 -DWORD XUserGetSigninInfo( - DWORD dwUserIndex, - DWORD dwFlags, +unsigned long XUserGetSigninInfo( + unsigned long dwUserIndex, + unsigned long dwFlags, PXUSER_SIGNIN_INFO pSigninInfo ); class CXuiStringTable { public: - LPCWSTR Lookup(LPCWSTR szId); - LPCWSTR Lookup(UINT nIndex); + const wchar_t* Lookup(const wchar_t* szId); + const wchar_t* Lookup(unsigned int nIndex); void Clear(); - HRESULT Load(LPCWSTR szId); + int Load(const wchar_t* szId); }; #if !defined(__ORBIS__) && !defined(_XBOX_ONE) -typedef VOID * XMEMDECOMPRESSION_CONTEXT; -typedef VOID * XMEMCOMPRESSION_CONTEXT; +typedef void * XMEMDECOMPRESSION_CONTEXT; +typedef void * XMEMCOMPRESSION_CONTEXT; typedef enum _XMEMCODEC_TYPE { @@ -447,41 +440,41 @@ typedef enum _XMEMCODEC_TYPE XMEMCODEC_LZX = 1 } XMEMCODEC_TYPE; -HRESULT XMemDecompress( +int XMemDecompress( XMEMDECOMPRESSION_CONTEXT Context, - VOID *pDestination, - SIZE_T *pDestSize, - CONST VOID *pSource, - SIZE_T SrcSize + void *pDestination, + size_t *pDestSize, + const void *pSource, + size_t SrcSize ); -HRESULT XMemCompress( +int XMemCompress( XMEMCOMPRESSION_CONTEXT Context, - VOID *pDestination, - SIZE_T *pDestSize, - CONST VOID *pSource, - SIZE_T SrcSize + void *pDestination, + size_t *pDestSize, + const void *pSource, + size_t SrcSize ); -HRESULT XMemCreateCompressionContext( +int XMemCreateCompressionContext( XMEMCODEC_TYPE CodecType, - CONST VOID *pCodecParams, - DWORD Flags, + const void *pCodecParams, + unsigned long Flags, XMEMCOMPRESSION_CONTEXT *pContext ); -HRESULT XMemCreateDecompressionContext( +int XMemCreateDecompressionContext( XMEMCODEC_TYPE CodecType, - CONST VOID *pCodecParams, - DWORD Flags, + const void *pCodecParams, + unsigned long Flags, XMEMDECOMPRESSION_CONTEXT *pContext ); typedef struct _XMEMCODEC_PARAMETERS_LZX { - DWORD Flags; - DWORD WindowSize; - DWORD CompressionPartitionSize; + unsigned long Flags; + unsigned long WindowSize; + unsigned long CompressionPartitionSize; } XMEMCODEC_PARAMETERS_LZX; void XMemDestroyCompressionContext(XMEMCOMPRESSION_CONTEXT Context); @@ -489,26 +482,26 @@ void XMemDestroyDecompressionContext(XMEMDECOMPRESSION_CONTEXT Context); #endif typedef struct { - BYTE type; + uint8_t type; union { - LONG nData; - LONGLONG i64Data; + int32_t nData; + int64_t i64Data; double dblData; struct { - DWORD cbData; - LPWSTR pwszData; + unsigned long cbData; + wchar_t* pwszData; }string; float fData; struct { - DWORD cbData; - PBYTE pbData; + unsigned long cbData; + uint8_t* pbData; }binary; FILETIME ftData; }; } XUSER_DATA, *PXUSER_DATA; typedef struct { - DWORD dwPropertyId; + unsigned long dwPropertyId; XUSER_DATA value; } XUSER_PROPERTY, *PXUSER_PROPERTY; @@ -619,9 +612,9 @@ const int XC_LOCALE_LATIN_AMERICA =240; #if !(defined _DURANGO || defined __PS3__ || defined __ORBIS__ || defined __PSVITA__) -DWORD XGetLanguage(); -DWORD XGetLocale(); -DWORD XEnableGuestSignin(BOOL fEnable); +unsigned long XGetLanguage(); +unsigned long XGetLocale(); +unsigned long XEnableGuestSignin(bool fEnable); #endif class D3DXVECTOR3 @@ -630,7 +623,7 @@ public: D3DXVECTOR3(); D3DXVECTOR3(float,float,float); float x,y,z,pad; - D3DXVECTOR3& operator += ( CONST D3DXVECTOR3& add ); + D3DXVECTOR3& operator += ( const D3DXVECTOR3& add ); }; #define QNET_E_SESSION_FULL 0