Replace all windows types

This commit is contained in:
murdle
2026-03-01 20:06:25 +02:00
parent fd7d6b7a35
commit 5b984ad854
790 changed files with 11101 additions and 9193 deletions

View File

@@ -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();

View File

@@ -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; }

View File

@@ -13,7 +13,7 @@ private:
wstring title;
wstring desc;
Achievement *ach;
__int64 startTime;
int64_t startTime;
ItemRenderer *ir;
bool isHelper;

View File

@@ -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;

View File

@@ -12,7 +12,7 @@ class ArchiveFile
{
protected:
File m_sourcefile;
BYTE *m_cachedData;
uint8_t *m_cachedData;
typedef struct _MetaData
{

View File

@@ -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)
{

View File

@@ -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();

View File

@@ -20,7 +20,7 @@
int Chunk::updates = 0;
#ifdef _LARGE_WORLDS
DWORD Chunk::tlsIdx = TlsAlloc();
unsigned long Chunk::tlsIdx = TlsAlloc();
void Chunk::CreateNewThreadStorage()
{

View File

@@ -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();

View File

@@ -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<LoginPacket> 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<LoginPacket> 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<LoginPacket> 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<PreLoginPacket> 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<PreLoginPacket> 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<PreLoginPacket> 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<PreLoginPacket> 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<PreLoginPacket> 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<PreLoginPacket> 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<PreLoginPacket> 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<PreLoginPacket> 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<PreLoginPacket> 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<LoginPacket>( 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<TexturePacket> 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_ptr<TextureAndGeometryPac
#ifndef _CONTENT_PACKAGE
wprintf(L"Client received request for custom texture and geometry %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);
DLCSkinFile *pDLCSkinFile = app.m_dlcManager.getSkinFile(packet->textureName);
@@ -2871,7 +2871,7 @@ void ClientConnection::handleGameEvent(shared_ptr<GameEventPacket> 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<CustomPayloadPacket> 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<UpdateProgressPacket> pac
void ClientConnection::handleUpdateGameRuleProgressPacket(shared_ptr<UpdateGameRuleProgressPacket> 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__)

View File

@@ -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);

View File

@@ -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;

View File

@@ -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

View File

@@ -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;

View File

@@ -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",

View File

@@ -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);

View File

@@ -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);
};

View File

@@ -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

File diff suppressed because it is too large Load Diff

View File

@@ -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<PlayerUID, PBYTE, PlayerUID::Hash> m_GTS_Files;
unordered_map<PlayerUID, uint8_t*, PlayerUID::Hash> m_GTS_Files;
#else
unordered_map<PlayerUID, PBYTE> m_GTS_Files;
unordered_map<PlayerUID, uint8_t*> 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 <FEATURE_DATA *> 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<PlayerUID,MOJANG_DATA *, PlayerUID::Hash > MojangData;
static unordered_map<int, char * > DLCTextures_PackID; // for mash-up packs & texture packs
static unordered_map<string,DLC_INFO * > DLCInfo;
static unordered_map<wstring, ULONGLONG > DLCInfo_SkinName; // skin name, full offer id
static unordered_map<wstring, uint64_t > DLCInfo_SkinName; // skin name, full offer id
#elif defined(_DURANGO)
static unordered_map<PlayerUID,MOJANG_DATA *, PlayerUID::Hash > MojangData;
static unordered_map<int, wstring > DLCTextures_PackID; // for mash-up packs & texture packs
@@ -628,10 +628,10 @@ private:
static unordered_map<wstring, wstring > DLCInfo_SkinName; // skin name, full offer id
#else
static unordered_map<PlayerUID,MOJANG_DATA * > MojangData;
static unordered_map<int, ULONGLONG > DLCTextures_PackID; // for mash-up packs & texture packs
static unordered_map<ULONGLONG,DLC_INFO * > DLCInfo_Trial; // full offerid, dlc_info
static unordered_map<ULONGLONG,DLC_INFO * > DLCInfo_Full; // full offerid, dlc_info
static unordered_map<wstring, ULONGLONG > DLCInfo_SkinName; // skin name, full offer id
static unordered_map<int, uint64_t > DLCTextures_PackID; // for mash-up packs & texture packs
static unordered_map<uint64_t,DLC_INFO * > DLCInfo_Trial; // full offerid, dlc_info
static unordered_map<uint64_t,DLC_INFO * > DLCInfo_Full; // full offerid, dlc_info
static unordered_map<wstring, uint64_t > 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<wstring,DLC_INFO * > *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<DLCRequest *> m_DLCDownloadQueue;
vector<TMSPPRequest *> 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<ModelPart *> * SetAdditionalSkinBoxes(DWORD dwSkinID, vector<SKIN_BOX *> *pvSkinBoxA);
vector<ModelPart *> *GetAdditionalModelParts(DWORD dwSkinID);
vector<SKIN_BOX *> *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<ModelPart *> * SetAdditionalSkinBoxes(unsigned long dwSkinID, vector<SKIN_BOX *> *pvSkinBoxA);
vector<ModelPart *> *GetAdditionalModelParts(unsigned long dwSkinID);
vector<SKIN_BOX *> *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<DWORD, vector<ModelPart *> *> m_AdditionalModelParts;
unordered_map<DWORD, vector<SKIN_BOX *> *> m_AdditionalSkinBoxes;
unordered_map<DWORD, unsigned int> m_AnimOverrides;
unordered_map<unsigned long, vector<ModelPart *> *> m_AdditionalModelParts;
unordered_map<unsigned long, vector<SKIN_BOX *> *> m_AdditionalSkinBoxes;
unordered_map<unsigned long, unsigned int> m_AnimOverrides;
bool m_bResetNether;
DWORD m_dwRequiredTexturePackID;
unsigned long m_dwRequiredTexturePackID;
#ifdef _XBOX_ONE
vector <PBYTE> m_vTMSPPData;
vector <uint8_t*> m_vTMSPPData;
#endif
#if ( defined __PS3__ || defined __ORBIS__ || defined _DURANGO || defined __PSVITA__)
@@ -870,18 +870,18 @@ public:
void LocaleAndLanguageInit();
void getLocale(vector<wstring> &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_map<int, wstring>m_localeA;
unordered_map<wstring, int>m_eMCLangA;
unordered_map<wstring, int>m_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;

View File

@@ -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<int, EAudioParameterType> parameterMapping;
unsigned int uiCurrentByte=0;
@@ -145,26 +145,26 @@ bool DLCAudioFile::processDLCDataFile(PBYTE pbData, DWORD dwLength)
for(unsigned int i=0;i<uiParameterTypeCount;i++)
{
// Map DLC strings to application strings, then store the DLC index mapping to application index
wstring parameterName((WCHAR *)pParams->wchData);
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;i<uiFileCount;i++)
{
dwTemp+=sizeof(C4JStorage::DLC_FILE_DETAILS)+pFile->dwWchCount*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;i<uiFileCount;i++)
@@ -182,14 +182,14 @@ bool DLCAudioFile::processDLCDataFile(PBYTE pbData, DWORD dwLength)
if(it != parameterMapping.end() )
{
addParameter(type,(EAudioParameterType)pParams->dwType,(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];

View File

@@ -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<int, wstring> m_parameters;
vector<wstring> m_parameters[e_AudioType_Max];

View File

@@ -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);
}

View File

@@ -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);
};

View File

@@ -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);

View File

@@ -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; }
};

View File

@@ -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""; }

View File

@@ -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;

View File

@@ -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);
};

View File

@@ -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)
{

View File

@@ -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; }
};

View File

@@ -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);
}

View File

@@ -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; }
};

View File

@@ -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 &paramN
{
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 &paramN
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<int, DLCManager::EDLCParameterType> 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;i<uiParameterCount;i++)
{
// Map DLC strings to application strings, then store the DLC index mapping to application index
wstring parameterName((WCHAR *)pParams->wchData);
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;i<uiFileCount;i++)
{
dwTemp+=sizeof(C4JStorage::DLC_FILE_DETAILS)+pFile->dwWchCount*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;i<uiFileCount;i++)
@@ -435,7 +435,7 @@ bool DLCManager::processDLCDataFile(DWORD &dwFilesProcessed, PBYTE pbData, DWORD
}
else if(type != e_DLCType_PackConfig)
{
dlcFile = pack->addFile(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<int, DLCManager::EDLCParameterType> parameterMapping;
unsigned int uiCurrentByte=0;
@@ -603,13 +603,13 @@ DWORD DLCManager::retrievePackID(PBYTE pbData, DWORD dwLength, DLCPack *pack)
for(unsigned int i=0;i<uiParameterCount;i++)
{
// Map DLC strings to application strings, then store the DLC index mapping to application index
wstring parameterName((WCHAR *)pParams->wchData);
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;i<uiFileCount;i++)
{
dwTemp+=sizeof(C4JStorage::DLC_FILE_DETAILS)+pFile->dwWchCount*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;i<uiFileCount;i++)
@@ -644,7 +644,7 @@ DWORD DLCManager::retrievePackID(PBYTE pbData, DWORD dwLength, DLCPack *pack)
{
if(it->second==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];
}

View File

@@ -48,20 +48,20 @@ public:
e_DLCParamType_Max,
};
static WCHAR *wchTypeNamesA[e_DLCParamType_Max];
static wchar_t *wchTypeNamesA[e_DLCParamType_Max];
private:
vector<DLCPack *> m_packs;
//bool m_bNeedsUpdated;
bool m_bNeedsCorruptCheck;
DWORD m_dwUnnamedCorruptDLCCount;
unsigned long m_dwUnnamedCorruptDLCCount;
public:
DLCManager();
~DLCManager();
static EDLCParameterType getParameterType(const wstring &paramName);
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);
};

View File

@@ -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)

View File

@@ -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 &param);
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);

View File

@@ -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;
}

View File

@@ -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);

View File

@@ -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;

View File

@@ -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);

View File

@@ -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;

View File

@@ -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);
};

View File

@@ -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);

View File

@@ -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);

View File

@@ -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);

View File

@@ -18,7 +18,7 @@ private:
public:
AddItemRuleDefinition();
virtual void writeAttributes(DataOutputStream *, UINT numAttributes);
virtual void writeAttributes(DataOutputStream *, unsigned int numAttributes);
virtual void getChildren(vector<GameRuleDefinition *> *children);
virtual ConsoleGameRules::EGameRuleType getActionType() { return ConsoleGameRules::eGameRuleType_AddItem; }

View File

@@ -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);

View File

@@ -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);

View File

@@ -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;
}

View File

@@ -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);
};

View File

@@ -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);

View File

@@ -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();

View File

@@ -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);

View File

@@ -23,7 +23,7 @@ public:
virtual void getChildren(vector<GameRuleDefinition *> *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

View File

@@ -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);

View File

@@ -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);

View File

@@ -14,7 +14,7 @@ public:
typedef struct _ValueType
{
union{
__int64 i64;
int64_t i64;
int i;
char c;
bool b;

View File

@@ -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);

View File

@@ -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<GameRuleDefinition *> *);
virtual GameRuleDefinition *addChild(ConsoleGameRules::EGameRuleType ruleType);

View File

@@ -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<wstring> tagsAndAtts;
for (UINT i = 0; i < numStrings; i++)
for (unsigned int i = 0; i < numStrings; i++)
tagsAndAtts.push_back( contentDis->readUTF() );
unordered_map<int, ConsoleGameRules::EGameRuleType> 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<int, ConsoleGameRules::EGameRuleAttr> 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<wstring> *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<wstring> *tags
void GameRuleManager::readChildren(DataInputStream *dis, vector<wstring> *tagsAndAtts, unordered_map<int, ConsoleGameRules::EGameRuleType> *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() )
{

View File

@@ -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<wstring> *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.

View File

@@ -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<int64_t>(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; }

View File

@@ -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<ApplySchematicRuleDefinition *> 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<GameRuleDefinition *> *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<wstring, ConsoleSchematicFile *> *getUnfinishedSchematicFiles();

View File

@@ -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)
{
}

View File

@@ -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);

View File

@@ -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)
{

View File

@@ -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);

View File

@@ -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);

View File

@@ -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; }

View File

@@ -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);

View File

@@ -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);

View File

@@ -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;

View File

@@ -26,7 +26,7 @@ public:
virtual void getChildren(vector<GameRuleDefinition *> *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> player);

View File

@@ -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);

View File

@@ -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);

View File

@@ -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);

View File

@@ -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);

View File

@@ -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);

View File

@@ -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);

View File

@@ -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<GameRuleDefinition *> *children)

View File

@@ -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);

View File

@@ -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);

View File

@@ -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);

View File

@@ -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)

View File

@@ -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);

View File

@@ -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<FriendSessionInfo *> *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

View File

@@ -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<FriendSessionInfo *> *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;

View File

@@ -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)
{
}

View File

@@ -64,7 +64,7 @@ private:
IQNet * m_pIQNet; // pointer to QNet interface
HANDLE m_notificationListener;
void* m_notificationListener;
vector<IQNetPlayer *> 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<FriendSessionInfo *> *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();

View File

@@ -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<FriendSessionInfo *> *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 );

View File

@@ -84,7 +84,7 @@ private:
#endif
SQRNetworkManager * m_pSQRNet; // pointer to SQRNetworkManager interface
HANDLE m_notificationListener;
void* m_notificationListener;
vector<SQRNetworkPlayer *> 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<FriendSessionInfo *> *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();

View File

@@ -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 &params)
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<ProductInfo>* productList, const char *categoryId)
void SonyCommerce::GetProductList( CallbackFunc cb, void* lpParam, std::vector<ProductInfo>* 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;

View File

@@ -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<ProductInfo>* 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<ProductInfo>* 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;

View File

@@ -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)

View File

@@ -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;

View File

@@ -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 <20>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 <20>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;

View File

@@ -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;

View File

@@ -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())
{

View File

@@ -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);

Some files were not shown because too many files have changed in this diff Show More