aboutsummaryrefslogtreecommitdiff
path: root/Minecraft.Client/PS3
diff options
context:
space:
mode:
authorqwasdrizzel <145519042+qwasdrizzel@users.noreply.github.com>2026-03-16 21:44:26 -0500
committerGitHub <noreply@github.com>2026-03-16 21:44:26 -0500
commitce739f6045ec72127491286ea3f3f21e537c1b55 (patch)
treef33bd42a47c1b4a7b2153a7fb77127ee3b407db9 /Minecraft.Client/PS3
parent255a18fe8e9b57377975f82e2b227afe2a12eda0 (diff)
parent5a59f5d146b43811dde6a5a0245ee9875d7b5cd1 (diff)
Merge branch 'smartcmd:main' into main
Diffstat (limited to 'Minecraft.Client/PS3')
-rw-r--r--Minecraft.Client/PS3/4JLibs/STO_TitleSmallStorage.cpp16
-rw-r--r--Minecraft.Client/PS3/4JLibs/inc/4J_Input.h4
-rw-r--r--Minecraft.Client/PS3/4JLibs/inc/4J_Profile.h2
-rw-r--r--Minecraft.Client/PS3/4JLibs/inc/4J_Render.h6
-rw-r--r--Minecraft.Client/PS3/4JLibs/inc/4J_Storage.h10
-rw-r--r--Minecraft.Client/PS3/Audio/PS3_SoundEngine.cpp8
-rw-r--r--Minecraft.Client/PS3/Iggy/gdraw/gdraw_ps3gcm.cpp84
-rw-r--r--Minecraft.Client/PS3/Iggy/gdraw/gdraw_ps3gcm.h2
-rw-r--r--Minecraft.Client/PS3/Iggy/gdraw/gdraw_ps3gcm_shaders.inl154
-rw-r--r--Minecraft.Client/PS3/Iggy/gdraw/gdraw_shared.inl86
-rw-r--r--Minecraft.Client/PS3/Iggy/include/gdraw.h8
-rw-r--r--Minecraft.Client/PS3/Iggy/include/iggyexpruntime.h4
-rw-r--r--Minecraft.Client/PS3/Iggy/include/rrCore.h56
-rw-r--r--Minecraft.Client/PS3/Leaderboards/PS3LeaderboardManager.cpp52
-rw-r--r--Minecraft.Client/PS3/Media/splashes.txt2
-rw-r--r--Minecraft.Client/PS3/Miles/include/mss.h428
-rw-r--r--Minecraft.Client/PS3/Miles/include/rrCore.h56
-rw-r--r--Minecraft.Client/PS3/Network/SQRNetworkManager_PS3.cpp128
-rw-r--r--Minecraft.Client/PS3/Network/SQRNetworkManager_PS3.h2
-rw-r--r--Minecraft.Client/PS3/Network/SonyCommerce_PS3.cpp52
-rw-r--r--Minecraft.Client/PS3/Network/SonyCommerce_PS3.h4
-rw-r--r--Minecraft.Client/PS3/Network/SonyHttp_PS3.cpp54
-rw-r--r--Minecraft.Client/PS3/Network/SonyRemoteStorage_PS3.cpp92
-rw-r--r--Minecraft.Client/PS3/Network/SonyVoiceChat.cpp14
-rw-r--r--Minecraft.Client/PS3/PS3Extras/C4JSpursJob.cpp14
-rw-r--r--Minecraft.Client/PS3/PS3Extras/C4JSpursJob.h4
-rw-r--r--Minecraft.Client/PS3/PS3Extras/C4JThread_SPU.cpp2
-rw-r--r--Minecraft.Client/PS3/PS3Extras/EdgeZLib.cpp10
-rw-r--r--Minecraft.Client/PS3/PS3Extras/HeapInspector/Server/HeapInspectorServerTypes.h4
-rw-r--r--Minecraft.Client/PS3/PS3Extras/PS3Strings.cpp8
-rw-r--r--Minecraft.Client/PS3/PS3Extras/Ps3Stubs.cpp20
-rw-r--r--Minecraft.Client/PS3/PS3Extras/Ps3Stubs.h90
-rw-r--r--Minecraft.Client/PS3/PS3Extras/Ps3Types.h11
-rw-r--r--Minecraft.Client/PS3/PS3Extras/ShutdownManager.cpp4
-rw-r--r--Minecraft.Client/PS3/PS3Extras/TLSStorage.cpp10
-rw-r--r--Minecraft.Client/PS3/PS3Extras/winerror.h2
-rw-r--r--Minecraft.Client/PS3/PS3_App.cpp66
-rw-r--r--Minecraft.Client/PS3/PS3_App.h2
-rw-r--r--Minecraft.Client/PS3/PS3_Minecraft.cpp37
-rw-r--r--Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/BedTile_SPU.h4
-rw-r--r--Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/ButtonTile_SPU.h2
-rw-r--r--Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/CakeTile_SPU.h2
-rw-r--r--Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/CauldronTile_SPU.h2
-rw-r--r--Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/ChunkRebuildData.cpp130
-rw-r--r--Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/DoorTile_SPU.h2
-rw-r--r--Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/FenceGateTile_SPU.h2
-rw-r--r--Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/FenceTile_SPU.cpp2
-rw-r--r--Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/FenceTile_SPU.h2
-rw-r--r--Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/HalfSlabTile_SPU.cpp2
-rw-r--r--Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/HalfSlabTile_SPU.h2
-rw-r--r--Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/Icon_SPU.h20
-rw-r--r--Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/LiquidTile_SPU.cpp4
-rw-r--r--Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/PistonBaseTile_SPU.h2
-rw-r--r--Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/PistonExtensionTile_SPU.h2
-rw-r--r--Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/PistonMovingPiece_SPU.h2
-rw-r--r--Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/PortalTile_SPU.h2
-rw-r--r--Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/PressurePlateTile_SPU.h2
-rw-r--r--Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/RailTile_SPU.h2
-rw-r--r--Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/RedStoneDustTile_SPU.h2
-rw-r--r--Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/SignTile_SPU.h2
-rw-r--r--Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/StairTile_SPU.h2
-rw-r--r--Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/StemTile_SPU.h2
-rw-r--r--Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/Tesselator_SPU.cpp44
-rw-r--r--Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/TheEndPortalFrameTile_SPU.h2
-rw-r--r--Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/ThinFenceTile_SPU.cpp2
-rw-r--r--Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/ThinFenceTile_SPU.h2
-rw-r--r--Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/TileRenderer_SPU.cpp306
-rw-r--r--Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/TileRenderer_SPU.h4
-rw-r--r--Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/Tile_SPU.cpp36
-rw-r--r--Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/Tile_SPU.h4
-rw-r--r--Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/TopSnowTile_SPU.h2
-rw-r--r--Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/TrapDoorTile_SPU.h2
-rw-r--r--Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/VineTile_SPU.h2
-rw-r--r--Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/stubs_SPU.h6
-rw-r--r--Minecraft.Client/PS3/SPU_Tasks/CompressedTile/CompressedTileStorage_SPU.cpp8
-rw-r--r--Minecraft.Client/PS3/SPU_Tasks/CompressedTile/SparseDataStorage_SPU.h6
-rw-r--r--Minecraft.Client/PS3/SPU_Tasks/CompressedTile/SparseLightStorage_SPU.h6
77 files changed, 1121 insertions, 1115 deletions
diff --git a/Minecraft.Client/PS3/4JLibs/STO_TitleSmallStorage.cpp b/Minecraft.Client/PS3/4JLibs/STO_TitleSmallStorage.cpp
index f3d2729f..bb7c88c7 100644
--- a/Minecraft.Client/PS3/4JLibs/STO_TitleSmallStorage.cpp
+++ b/Minecraft.Client/PS3/4JLibs/STO_TitleSmallStorage.cpp
@@ -58,7 +58,7 @@ int32_t CTSS::doLookupTitleSmallStorage(void)
{
int32_t ret = 0;
int32_t transId = 0;
- void *data=NULL;
+ void *data=nullptr;
size_t dataSize=0;
SceNpId npId;
@@ -100,7 +100,7 @@ int32_t CTSS::doLookupTitleSmallStorage(void)
//memset(&npclient_info, 0x00, sizeof(npclient_info));
data = malloc(SCE_NET_NP_TSS_MAX_SIZE);
- if (data == NULL)
+ if (data == nullptr)
{
printf("out of memory: can't allocate memory for titleSmallStorage\n");
ret = -1;
@@ -121,7 +121,7 @@ int32_t CTSS::doLookupTitleSmallStorage(void)
// data,
// SCE_NET_NP_TSS_MAX_SIZE,
// &dataSize,
-// NULL);
+// nullptr);
// if (ret < 0)
// {
// printf("sceNpLookupTitleSmallStorage() failed. ret = 0x%x\n", ret);
@@ -150,7 +150,7 @@ int32_t CTSS::doLookupTitleSmallStorage(void)
size_t dataSize;
SceNpTssSlotId slotId=SLOTID;
SceNpTssDataStatus dataStatus;
- const char *ptr =NULL;
+ const char *ptr =nullptr;
size_t recvdSize=0;
size_t totalSize=0;
size_t recvSize=0;
@@ -163,7 +163,7 @@ int32_t CTSS::doLookupTitleSmallStorage(void)
sizeof(SceNpTssDataStatus),
ptr,
recvSize,
- NULL);
+ nullptr);
if (ret < 0)
{
// Error handling
@@ -174,10 +174,10 @@ int32_t CTSS::doLookupTitleSmallStorage(void)
// Processing when there is no data
goto finish;
}
- if (ptr == NULL)
+ if (ptr == nullptr)
{
ptr = malloc(dataStatus.contentLength);
- if (ptr == NULL){
+ if (ptr == nullptr){
// Error handling
goto error;
}
@@ -197,7 +197,7 @@ error:
ret = sceNpLookupDestroyTransactionCtx(transId);
printf("sceNpLookupDestroyTransactionCtx() done. ret = 0x%x\n", ret);
}
- if (data != NULL)
+ if (data != nullptr)
{
free(data);
}
diff --git a/Minecraft.Client/PS3/4JLibs/inc/4J_Input.h b/Minecraft.Client/PS3/4JLibs/inc/4J_Input.h
index 6f51bba5..9d46e741 100644
--- a/Minecraft.Client/PS3/4JLibs/inc/4J_Input.h
+++ b/Minecraft.Client/PS3/4JLibs/inc/4J_Input.h
@@ -130,8 +130,8 @@ public:
void SetMenuDisplayed(int iPad, bool bVal);
-// EKeyboardResult RequestKeyboard(UINT uiTitle, UINT uiText, UINT uiDesc, DWORD dwPad, WCHAR *pwchResult, UINT uiResultSize,int( *Func)(LPVOID,const bool),LPVOID lpParam,EKeyboardMode eMode,C4JStringTable *pStringTable=NULL);
-// EKeyboardResult RequestKeyboard(UINT uiTitle, LPCWSTR pwchDefault, UINT uiDesc, DWORD dwPad, WCHAR *pwchResult, UINT uiResultSize,int( *Func)(LPVOID,const bool),LPVOID lpParam, EKeyboardMode eMode,C4JStringTable *pStringTable=NULL);
+// EKeyboardResult RequestKeyboard(UINT uiTitle, UINT uiText, UINT uiDesc, DWORD dwPad, WCHAR *pwchResult, UINT uiResultSize,int( *Func)(LPVOID,const bool),LPVOID lpParam,EKeyboardMode eMode,C4JStringTable *pStringTable=nullptr);
+// EKeyboardResult RequestKeyboard(UINT uiTitle, LPCWSTR pwchDefault, UINT uiDesc, DWORD dwPad, WCHAR *pwchResult, UINT uiResultSize,int( *Func)(LPVOID,const bool),LPVOID lpParam, EKeyboardMode eMode,C4JStringTable *pStringTable=nullptr);
EKeyboardResult RequestKeyboard(LPCWSTR Title, LPCWSTR Text, DWORD dwPad, UINT uiMaxChars, int( *Func)(LPVOID,const bool),LPVOID lpParam,C_4JInput::EKeyboardMode eMode);
void DestroyKeyboard();
void GetText(uint16_t *UTF16String);
diff --git a/Minecraft.Client/PS3/4JLibs/inc/4J_Profile.h b/Minecraft.Client/PS3/4JLibs/inc/4J_Profile.h
index 888c38cc..4a65dcb9 100644
--- a/Minecraft.Client/PS3/4JLibs/inc/4J_Profile.h
+++ b/Minecraft.Client/PS3/4JLibs/inc/4J_Profile.h
@@ -109,7 +109,7 @@ public:
// ACHIEVEMENTS & AWARDS
void RegisterAward(int iAwardNumber,int iGamerconfigID, eAwardType eType, bool bLeaderboardAffected=false,
- CXuiStringTable*pStringTable=NULL, int iTitleStr=-1, int iTextStr=-1, int iAcceptStr=-1, char *pszThemeName=NULL, unsigned int uiThemeSize=0L);
+ CXuiStringTable*pStringTable=nullptr, int iTitleStr=-1, int iTextStr=-1, int iAcceptStr=-1, char *pszThemeName=nullptr, unsigned int uiThemeSize=0L);
int GetAwardId(int iAwardNumber);
eAwardType GetAwardType(int iAwardNumber);
bool CanBeAwarded(int iQuadrant, int iAwardNumber);
diff --git a/Minecraft.Client/PS3/4JLibs/inc/4J_Render.h b/Minecraft.Client/PS3/4JLibs/inc/4J_Render.h
index d55f440b..1b68695f 100644
--- a/Minecraft.Client/PS3/4JLibs/inc/4J_Render.h
+++ b/Minecraft.Client/PS3/4JLibs/inc/4J_Render.h
@@ -17,8 +17,8 @@ public:
int GetType() { return m_type; }
void *GetBufferPointer() { return m_pBuffer; }
int GetBufferSize() { return m_bufferSize; }
- void Release() { delete m_pBuffer; m_pBuffer = NULL; }
- bool Allocated() { return m_pBuffer != NULL; }
+ void Release() { delete m_pBuffer; m_pBuffer = nullptr; }
+ bool Allocated() { return m_pBuffer != nullptr; }
};
typedef struct
@@ -60,7 +60,7 @@ public:
void InitialiseContext();
void StartFrame();
void Present();
- void Clear(int flags, D3D11_RECT *pRect = NULL);
+ void Clear(int flags, D3D11_RECT *pRect = nullptr);
void SetClearColour(const float colourRGBA[4]);
bool IsWidescreen();
bool IsHiDef();
diff --git a/Minecraft.Client/PS3/4JLibs/inc/4J_Storage.h b/Minecraft.Client/PS3/4JLibs/inc/4J_Storage.h
index 3950bbad..b95325b3 100644
--- a/Minecraft.Client/PS3/4JLibs/inc/4J_Storage.h
+++ b/Minecraft.Client/PS3/4JLibs/inc/4J_Storage.h
@@ -293,7 +293,7 @@ typedef struct
// Messages
C4JStorage::EMessageResult RequestMessageBox(UINT uiTitle, UINT uiText, UINT *uiOptionA,UINT uiOptionC, DWORD dwPad=USER_INDEX_ANY,
- int( *Func)(LPVOID,int,const C4JStorage::EMessageResult)=NULL,LPVOID lpParam=NULL, StringTable *pStringTable=NULL, WCHAR *pwchFormatString=NULL,DWORD dwFocusButton=0);
+ int( *Func)(LPVOID,int,const C4JStorage::EMessageResult)=nullptr,LPVOID lpParam=nullptr, StringTable *pStringTable=nullptr, WCHAR *pwchFormatString=nullptr,DWORD dwFocusButton=0);
C4JStorage::EMessageResult GetMessageBoxResult();
@@ -350,7 +350,7 @@ typedef struct
void FreeSaveData();
void SetSaveDataSize(unsigned int uiBytes); // after a successful compression, update the size of the gamedata
- //void SaveSaveData(unsigned int uiBytes,PBYTE pbThumbnail=NULL,DWORD cbThumbnail=0,PBYTE pbTextData=NULL, DWORD dwTextLen=0);
+ //void SaveSaveData(unsigned int uiBytes,PBYTE pbThumbnail=nullptr,DWORD cbThumbnail=0,PBYTE pbTextData=nullptr, DWORD dwTextLen=0);
C4JStorage::ESaveGameState SaveSaveData(int( *Func)(LPVOID ,const bool),LPVOID lpParam, bool bDataFileOnly = false);
void CopySaveDataToNewSave(PBYTE pbThumbnail,DWORD cbThumbnail,WCHAR *wchNewName,int ( *Func)(LPVOID lpParam, bool), LPVOID lpParam);
void SetSaveDeviceSelected(unsigned int uiPad,bool bSelected);
@@ -383,8 +383,8 @@ typedef struct
DWORD GetAvailableDLCCount( int iPad);
CONTENT_DATA& GetDLC(DWORD dw);
C4JStorage::EDLCStatus GetInstalledDLC(int iPad,int( *Func)(LPVOID, int, int),LPVOID lpParam);
- DWORD MountInstalledDLC(int iPad,DWORD dwDLC,int( *Func)(LPVOID, int, DWORD,DWORD),LPVOID lpParam,LPCSTR szMountDrive = NULL);
- DWORD UnmountInstalledDLC(LPCSTR szMountDrive = NULL);
+ DWORD MountInstalledDLC(int iPad,DWORD dwDLC,int( *Func)(LPVOID, int, DWORD,DWORD),LPVOID lpParam,LPCSTR szMountDrive = nullptr);
+ DWORD UnmountInstalledDLC(LPCSTR szMountDrive = nullptr);
void GetMountedDLCFileList(const char* szMountDrive, std::vector<std::string>& fileList);
std::string GetMountedPath(std::string szMount);
C4JStorage::ETMSStatus ReadTMSFile(int iQuadrant,eGlobalStorage eStorageFacility,C4JStorage::eTMS_FileType eFileType, WCHAR *pwchFilename,BYTE **ppBuffer,DWORD *pdwBufferSize,int( *Func)(LPVOID, WCHAR *,int, bool, int),LPVOID lpParam, int iAction) { return C4JStorage::ETMSStatus_Idle; }
@@ -400,7 +400,7 @@ typedef struct
bool CheckForTrialUpgradeKey(void( *Func)(LPVOID, bool),LPVOID lpParam);
- C4JStorage::ETMSStatus TMSPP_ReadFile(int iPad,C4JStorage::eGlobalStorage eStorageFacility,C4JStorage::eTMS_FILETYPEVAL eFileTypeVal,LPCSTR szFilename,int( *Func)(LPVOID,int,int,PTMSPP_FILEDATA, LPCSTR)/*=NULL*/,LPVOID lpParam/*=NULL*/, int iUserData/*=0*/) {return C4JStorage::ETMSStatus_Idle;}
+ C4JStorage::ETMSStatus TMSPP_ReadFile(int iPad,C4JStorage::eGlobalStorage eStorageFacility,C4JStorage::eTMS_FILETYPEVAL eFileTypeVal,LPCSTR szFilename,int( *Func)(LPVOID,int,int,PTMSPP_FILEDATA, LPCSTR)/*=nullptr*/,LPVOID lpParam/*=nullptr*/, int iUserData/*=0*/) {return C4JStorage::ETMSStatus_Idle;}
// PROFILE DATA
int SetDefaultOptionsCallback(int( *Func)(LPVOID,PROFILESETTINGS *, const int iPad),LPVOID lpParam);
diff --git a/Minecraft.Client/PS3/Audio/PS3_SoundEngine.cpp b/Minecraft.Client/PS3/Audio/PS3_SoundEngine.cpp
index fcce5f05..1c7edba3 100644
--- a/Minecraft.Client/PS3/Audio/PS3_SoundEngine.cpp
+++ b/Minecraft.Client/PS3/Audio/PS3_SoundEngine.cpp
@@ -37,7 +37,7 @@ int SoundEngine::initAudioHardware( int minimum_chans )
a_config.channel = ch_pcm;
a_config.encoder = CELL_AUDIO_OUT_CODING_TYPE_LPCM;
a_config.downMixer = CELL_AUDIO_OUT_DOWNMIXER_NONE; /* No downmixer is used */
- cellAudioOutConfigure( CELL_AUDIO_OUT_PRIMARY, &a_config, NULL, 0 );
+ cellAudioOutConfigure( CELL_AUDIO_OUT_PRIMARY, &a_config, nullptr, 0 );
ret = ch_pcm;
}
@@ -51,7 +51,7 @@ int SoundEngine::initAudioHardware( int minimum_chans )
a_config.channel = 6;
a_config.encoder = CELL_AUDIO_OUT_CODING_TYPE_LPCM;
a_config.downMixer = CELL_AUDIO_OUT_DOWNMIXER_TYPE_B;
- if ( cellAudioOutConfigure( CELL_AUDIO_OUT_PRIMARY, &a_config, NULL, 0 ) != CELL_OK )
+ if ( cellAudioOutConfigure( CELL_AUDIO_OUT_PRIMARY, &a_config, nullptr, 0 ) != CELL_OK )
{
return 0; // error - the downmixer didn't init
}
@@ -83,7 +83,7 @@ int SoundEngine::initAudioHardware( int minimum_chans )
ret = 8;
}
- if ( cellAudioOutConfigure( CELL_AUDIO_OUT_PRIMARY, &a_config, NULL, 0 ) == CELL_OK )
+ if ( cellAudioOutConfigure( CELL_AUDIO_OUT_PRIMARY, &a_config, nullptr, 0 ) == CELL_OK )
{
break;
}
@@ -94,7 +94,7 @@ int SoundEngine::initAudioHardware( int minimum_chans )
a_config.channel = 2;
a_config.encoder = CELL_AUDIO_OUT_CODING_TYPE_LPCM;
a_config.downMixer = CELL_AUDIO_OUT_DOWNMIXER_TYPE_A;
- if ( cellAudioOutConfigure( CELL_AUDIO_OUT_PRIMARY, &a_config, NULL, 0 ) != CELL_OK )
+ if ( cellAudioOutConfigure( CELL_AUDIO_OUT_PRIMARY, &a_config, nullptr, 0 ) != CELL_OK )
{
return 0; // error - downmixer didn't work
}
diff --git a/Minecraft.Client/PS3/Iggy/gdraw/gdraw_ps3gcm.cpp b/Minecraft.Client/PS3/Iggy/gdraw/gdraw_ps3gcm.cpp
index 997e8d83..e8bd0367 100644
--- a/Minecraft.Client/PS3/Iggy/gdraw/gdraw_ps3gcm.cpp
+++ b/Minecraft.Client/PS3/Iggy/gdraw/gdraw_ps3gcm.cpp
@@ -751,7 +751,7 @@ static void api_free_resource(GDrawHandle *r)
S32 i;
for (i=0; i < MAX_SAMPLERS; i++)
if (gdraw->active_tex[i] == (GDrawTexture *) r)
- gdraw->active_tex[i] = NULL;
+ gdraw->active_tex[i] = nullptr;
}
static void RADLINK gdraw_UnlockHandles(GDrawStats *stats)
@@ -772,7 +772,7 @@ extern GDrawTexture *gdraw_GCM_WrappedTextureCreate(CellGcmTexture *gcm_tex)
memset(&stats, 0, sizeof(stats));
GDrawHandle *p = gdraw_res_alloc_begin(gdraw->texturecache, 0, &stats); // it may need to free one item to give us a handle
p->handle.tex.gcm_ptr = 0;
- gdraw_HandleCacheAllocateEnd(p, 0, NULL, GDRAW_HANDLE_STATE_user_owned);
+ gdraw_HandleCacheAllocateEnd(p, 0, nullptr, GDRAW_HANDLE_STATE_user_owned);
gdraw_GCM_WrappedTextureChange((GDrawTexture *) p, gcm_tex);
return (GDrawTexture *) p;
}
@@ -816,11 +816,11 @@ static bool is_texture_swizzled(S32 w, S32 h)
static rrbool RADLINK gdraw_MakeTextureBegin(void *owner, S32 width, S32 height, gdraw_texture_format gformat, U32 flags, GDraw_MakeTexture_ProcessingInfo *p, GDrawStats *stats)
{
S32 bytes_pixel = 4;
- GDrawHandle *t = NULL;
+ GDrawHandle *t = nullptr;
bool swizzled = false;
if (width > 4096 || height > 4096) {
- IggyGDrawSendWarning(NULL, "GDraw %d x %d texture not supported by hardware (dimension size limit 4096)", width, height);
+ IggyGDrawSendWarning(nullptr, "GDraw %d x %d texture not supported by hardware (dimension size limit 4096)", width, height);
return false;
}
@@ -893,7 +893,7 @@ static rrbool RADLINK gdraw_MakeTextureBegin(void *owner, S32 width, S32 height,
if (swizzled || (flags & GDRAW_MAKETEXTURE_FLAGS_mipmap)) {
rrbool ok;
- assert(p->temp_buffer != NULL);
+ assert(p->temp_buffer != nullptr);
ok = gdraw_MipmapBegin(&gdraw->mipmap, width, height, mipmaps,
bytes_pixel, p->temp_buffer, p->temp_buffer_bytes);
assert(ok); // this should never hit unless the temp_buffer is way too small
@@ -1023,8 +1023,8 @@ static void RADLINK gdraw_UpdateTextureEnd(GDrawTexture *t, void *unique_id, GDr
static void RADLINK gdraw_FreeTexture(GDrawTexture *tt, void *unique_id, GDrawStats *stats)
{
GDrawHandle *t = (GDrawHandle *) tt;
- assert(t != NULL); // @GDRAW_ASSERT
- if (t->owner == unique_id || unique_id == NULL) {
+ assert(t != nullptr); // @GDRAW_ASSERT
+ if (t->owner == unique_id || unique_id == nullptr) {
if (t->cache == &gdraw->rendertargets) {
gdraw_HandleCacheUnlock(t);
// cache it by simply not freeing it
@@ -1121,7 +1121,7 @@ static rrbool RADLINK gdraw_TryLockVertexBuffer(GDrawVertexBuffer *vb, void *uni
static void RADLINK gdraw_FreeVertexBuffer(GDrawVertexBuffer *vb, void *unique_id, GDrawStats *stats)
{
GDrawHandle *h = (GDrawHandle *) vb;
- assert(h != NULL); // @GDRAW_ASSERT
+ assert(h != nullptr); // @GDRAW_ASSERT
if (h->owner == unique_id)
gdraw_res_kill(h, stats);
}
@@ -1152,19 +1152,19 @@ static GDrawHandle *get_color_rendertarget(GDrawStats *stats)
t = gdraw_HandleCacheAllocateBegin(&gdraw->rendertargets);
if (!t) {
- IggyGDrawSendWarning(NULL, "GDraw rendertarget allocation failed: hit handle limit");
+ IggyGDrawSendWarning(nullptr, "GDraw rendertarget allocation failed: hit handle limit");
return t;
}
void *ptr = gdraw_arena_alloc(&gdraw->rt_arena, size, 1);
if (!ptr) {
- IggyGDrawSendWarning(NULL, "GDraw rendertarget allocation failed: out of rendertarget texture memory");
+ IggyGDrawSendWarning(nullptr, "GDraw rendertarget allocation failed: out of rendertarget texture memory");
gdraw_HandleCacheAllocateFail(t);
- return NULL;
+ return nullptr;
}
t->fence = get_next_fence(); // we're about to start using it immediately, so...
- t->raw_ptr = NULL;
+ t->raw_ptr = nullptr;
t->handle.tex.gcm_ptr = ptr;
@@ -1329,14 +1329,14 @@ static void set_common_renderstate()
// reset our state caching
for (i=0; i < MAX_SAMPLERS; i++) {
- gdraw->active_tex[i] = NULL;
+ gdraw->active_tex[i] = nullptr;
cellGcmSetTextureControl(gcm, i, CELL_GCM_FALSE, 0, 0, 0);
}
assert(gdraw->aa_tex.offset != 0); // if you hit this, your initialization is screwed up.
set_rsx_texture(gdraw->gcm, AATEX_SAMPLER, &gdraw->aa_tex, GDRAW_WRAP_clamp, 0);
- gdraw->cur_fprog = NULL;
+ gdraw->cur_fprog = nullptr;
gdraw->vert_format = -1;
gdraw->scissor_state = ~0u;
gdraw->blend_mode = -1;
@@ -1363,7 +1363,7 @@ static void clear_renderstate(void)
static void set_render_target()
{
- GcmTexture *tex = NULL;
+ GcmTexture *tex = nullptr;
S32 i;
CellGcmSurface surf = gdraw->main_surface;
@@ -1384,7 +1384,7 @@ static void set_render_target()
// invalidate current textures (need to reset them to force L1 texture cache flush)
for (i=0; i < MAX_SAMPLERS; ++i)
- gdraw->active_tex[i] = NULL;
+ gdraw->active_tex[i] = nullptr;
}
////////////////////////////////////////////////////////////////////////
@@ -1513,19 +1513,19 @@ static rrbool RADLINK gdraw_TextureDrawBufferBegin(gswf_recti *region, gdraw_tex
GDrawFramebufferState *n = gdraw->cur+1;
GDrawHandle *t;
if (gdraw->tw == 0 || gdraw->th == 0) {
- IggyGDrawSendWarning(NULL, "GDraw warning: w=0,h=0 rendertarget");
+ IggyGDrawSendWarning(nullptr, "GDraw warning: w=0,h=0 rendertarget");
return false;
}
if (n >= &gdraw->frame[MAX_RENDER_STACK_DEPTH]) {
assert(0);
- IggyGDrawSendWarning(NULL, "GDraw rendertarget nesting exceeds MAX_RENDER_STACK_DEPTH");
+ IggyGDrawSendWarning(nullptr, "GDraw rendertarget nesting exceeds MAX_RENDER_STACK_DEPTH");
return false;
}
if (owner) {
// @TODO implement
- t = NULL;
+ t = nullptr;
assert(0); // nyi
} else {
t = get_color_rendertarget(stats);
@@ -1534,9 +1534,9 @@ static rrbool RADLINK gdraw_TextureDrawBufferBegin(gswf_recti *region, gdraw_tex
}
n->color_buffer = t;
- assert(n->color_buffer != NULL); // @GDRAW_ASSERT
+ assert(n->color_buffer != nullptr); // @GDRAW_ASSERT
- n->cached = owner != NULL;
+ n->cached = owner != nullptr;
if (owner) {
n->base_x = region->x0;
n->base_y = region->y0;
@@ -1617,9 +1617,9 @@ static GDrawTexture *RADLINK gdraw_TextureDrawBufferEnd(GDrawStats *stats)
assert(m >= gdraw->frame); // bug in Iggy -- unbalanced
if (m != gdraw->frame) {
- assert(m->color_buffer != NULL); // @GDRAW_ASSERT
+ assert(m->color_buffer != nullptr); // @GDRAW_ASSERT
}
- assert(n->color_buffer != NULL); // @GDRAW_ASSERT
+ assert(n->color_buffer != nullptr); // @GDRAW_ASSERT
// wait for render to texture operation to finish
// can't put down a backend fence directly, there might still be
@@ -1694,7 +1694,7 @@ static void set_fragment_para(GDraw * RADRESTRICT gd, U32 ucode_offs, int para,
if (para == -1)
return;
- gd->cur_fprog = NULL; // need to re-set shader after patching
+ gd->cur_fprog = nullptr; // need to re-set shader after patching
const U64 *inv = (const U64 *) values;
const int *patch_offs = (const int *) para;
@@ -1728,7 +1728,7 @@ static void set_fragment_para(GDraw * RADRESTRICT gd, U32 ucode_offs, int para,
static RADINLINE void set_texture(S32 texunit, GDrawTexture *tex)
{
assert(texunit < MAX_SAMPLERS);
- assert(tex != NULL);
+ assert(tex != nullptr);
if (gdraw->active_tex[texunit] != tex) {
gdraw->active_tex[texunit] = tex;
@@ -1983,7 +1983,7 @@ static RADINLINE void set_vertex_decl(GDraw * RADRESTRICT gd, CellGcmContextData
// Draw triangles with a given renderstate
//
-static RADINLINE void fence_resources(GDraw * RADRESTRICT gd, void *r1, void *r2=NULL, void *r3=NULL, void *r4=NULL)
+static RADINLINE void fence_resources(GDraw * RADRESTRICT gd, void *r1, void *r2=nullptr, void *r3=nullptr, void *r4=nullptr)
{
GDrawFence fence;
fence.value = gd->next_fence_index;
@@ -2046,7 +2046,7 @@ static void RADLINK gdraw_DrawIndexedTriangles(GDrawRenderState *r, GDrawPrimiti
while (pos < p->num_indices) {
S32 vert_count = RR_MIN(p->num_indices - pos, verts_per_chunk);
void *ring = gdraw_bufring_alloc(&gd->dyn_vb, vert_count * vsize, CELL_GCM_VERTEX_TEXTURE_CACHE_LINE_SIZE);
- assert(ring != NULL); // we specifically chunked so this alloc succeeds!
+ assert(ring != nullptr); // we specifically chunked so this alloc succeeds!
// prepare for painting...
cellGcmSetInvalidateVertexCache(gcm);
@@ -2083,7 +2083,7 @@ static void RADLINK gdraw_DrawIndexedTriangles(GDrawRenderState *r, GDrawPrimiti
S32 vert_count = RR_MIN(p->num_vertices - pos, verts_per_chunk);
U32 chunk_bytes = vert_count * vsize;
void *ring = gdraw_bufring_alloc(&gd->dyn_vb, chunk_bytes, CELL_GCM_VERTEX_TEXTURE_CACHE_LINE_SIZE);
- assert(ring != NULL); // we picked the chunk size so this alloc succeeds!
+ assert(ring != nullptr); // we picked the chunk size so this alloc succeeds!
memcpy(ring, (U8 *)p->vertices + pos * vsize, chunk_bytes);
cellGcmSetInvalidateVertexCache(gcm);
@@ -2203,7 +2203,7 @@ static void gdraw_Filter(GDrawRenderState *r, gswf_recti *s, float *tc, int isbe
{
ProgramWithCachedVariableLocations *prg = &gdraw->filter_prog[isbevel][r->filter_mode];
U32 ucode_offs = prg->cfg.offset;
- if (!gdraw_TextureDrawBufferBegin(s, GDRAW_TEXTURE_FORMAT_rgba32, GDRAW_TEXTUREDRAWBUFFER_FLAGS_needs_color | GDRAW_TEXTUREDRAWBUFFER_FLAGS_needs_alpha, NULL, stats))
+ if (!gdraw_TextureDrawBufferBegin(s, GDRAW_TEXTURE_FORMAT_rgba32, GDRAW_TEXTUREDRAWBUFFER_FLAGS_needs_color | GDRAW_TEXTUREDRAWBUFFER_FLAGS_needs_alpha, nullptr, stats))
return;
set_texture(0, r->tex[0]);
@@ -2287,14 +2287,14 @@ static void RADLINK gdraw_FilterQuad(GDrawRenderState *r, S32 x0, S32 y0, S32 x1
assert(0);
}
} else {
- GDrawHandle *blend_tex = NULL;
+ GDrawHandle *blend_tex = nullptr;
GDraw *gd = gdraw;
// for crazy blend modes, we need to read back from the framebuffer
// and do the blending in the pixel shader. so we need to copy the
// relevant pixels from our active render target into a texture.
if (r->blend_mode == GDRAW_BLEND_special &&
- (blend_tex = get_color_rendertarget(stats)) != NULL) {
+ (blend_tex = get_color_rendertarget(stats)) != nullptr) {
// slightly different logic depending on whether we were rendering
// to the main color buffer or a render target, because the former
// has tile origin-based coordinates while the latter don't. also,
@@ -2344,7 +2344,7 @@ static void create_fragment_program(ProgramWithCachedVariableLocations *p, Progr
cellGcmCgGetUCode(p->program, &ucode_main, &ucode_size);
ucode_local = gdraw_arena_alloc(&gdraw->local_arena, ucode_size + 400, CELL_GCM_FRAGMENT_UCODE_LOCAL_ALIGN_OFFSET); // 400 for overfetch
- assert(ucode_local != NULL); // if this triggers, it's a GDraw bug
+ assert(ucode_local != nullptr); // if this triggers, it's a GDraw bug
memcpy(ucode_local, ucode_main, ucode_size);
cellGcmCgGetCgbFragmentProgramConfiguration(p->program, &p->cfg, 0, 1, 0);
@@ -2408,7 +2408,7 @@ static GDrawHandleCache *make_handle_cache(gdraw_gcm_resourcetype type, U32 alig
U32 header_size = is_vertex ? 0 : sizeof(GcmTexture) * num_handles;
if (!num_handles)
- return NULL;
+ return nullptr;
GDrawHandleCache *cache = (GDrawHandleCache *) IggyGDrawMalloc(cache_size + header_size);
if (cache) {
@@ -2427,7 +2427,7 @@ static GDrawHandleCache *make_handle_cache(gdraw_gcm_resourcetype type, U32 alig
cache->alloc = gfxalloc_create(gdraw_mem[type].ptr, num_bytes, align, num_handles);
if (!cache->alloc) {
IggyGDrawFree(cache);
- cache = NULL;
+ cache = nullptr;
}
}
@@ -2496,14 +2496,14 @@ int gdraw_GCM_SetResourceMemory(gdraw_gcm_resourcetype type, S32 num_handles, vo
free_handle_cache(gdraw->texturecache);
gdraw->texturecache = make_handle_cache(GDRAW_GCM_RESOURCE_texture, CELL_GCM_TEXTURE_SWIZZLE_ALIGN_OFFSET);
gdraw->tex_loc = get_location(ptr);
- return gdraw->texturecache != NULL;
+ return gdraw->texturecache != nullptr;
case GDRAW_GCM_RESOURCE_vertexbuffer:
free_handle_cache(gdraw->vbufcache);
gdraw->vbufcache = make_handle_cache(GDRAW_GCM_RESOURCE_vertexbuffer, CELL_GCM_SURFACE_LINEAR_ALIGN_OFFSET);
gdraw->vbuf_base = ptr ? (U8 *) ptr - addr2offs(ptr) : 0;
gdraw->vbuf_loc = get_location(ptr);
- return gdraw->vbufcache != NULL;
+ return gdraw->vbufcache != nullptr;
case GDRAW_GCM_RESOURCE_dyn_vertexbuffer:
gdraw_bufring_shutdown(&gdraw->dyn_vb);
@@ -2549,10 +2549,10 @@ int gdraw_GCM_SetRendertargetMemory(void *ptr, S32 num_bytes, S32 width, S32 hei
void gdraw_GCM_ResetAllResourceMemory()
{
- gdraw_GCM_SetResourceMemory(GDRAW_GCM_RESOURCE_texture, 0, NULL, 0);
- gdraw_GCM_SetResourceMemory(GDRAW_GCM_RESOURCE_vertexbuffer, 0, NULL, 0);
- gdraw_GCM_SetResourceMemory(GDRAW_GCM_RESOURCE_dyn_vertexbuffer, 0, NULL, 0);
- gdraw_GCM_SetRendertargetMemory(NULL, 0, 0, 0, 0);
+ gdraw_GCM_SetResourceMemory(GDRAW_GCM_RESOURCE_texture, 0, nullptr, 0);
+ gdraw_GCM_SetResourceMemory(GDRAW_GCM_RESOURCE_vertexbuffer, 0, nullptr, 0);
+ gdraw_GCM_SetResourceMemory(GDRAW_GCM_RESOURCE_dyn_vertexbuffer, 0, nullptr, 0);
+ gdraw_GCM_SetRendertargetMemory(nullptr, 0, 0, 0, 0);
}
GDrawFunctions *gdraw_GCM_CreateContext(CellGcmContextData *gcm, void *local_workmem, U8 rsx_label_index)
@@ -2560,7 +2560,7 @@ GDrawFunctions *gdraw_GCM_CreateContext(CellGcmContextData *gcm, void *local_wor
S32 i;
gdraw = (GDraw *) IggyGDrawMalloc(sizeof(*gdraw)); // make sure gdraw struct is PPU cache line aligned
- if (!gdraw) return NULL;
+ if (!gdraw) return nullptr;
memset(gdraw, 0, sizeof(*gdraw));
@@ -2648,7 +2648,7 @@ void gdraw_GCM_DestroyContext(void)
free_handle_cache(gdraw->texturecache);
free_handle_cache(gdraw->vbufcache);
IggyGDrawFree(gdraw);
- gdraw = NULL;
+ gdraw = nullptr;
}
}
diff --git a/Minecraft.Client/PS3/Iggy/gdraw/gdraw_ps3gcm.h b/Minecraft.Client/PS3/Iggy/gdraw/gdraw_ps3gcm.h
index f8ec8705..cf691d06 100644
--- a/Minecraft.Client/PS3/Iggy/gdraw/gdraw_ps3gcm.h
+++ b/Minecraft.Client/PS3/Iggy/gdraw/gdraw_ps3gcm.h
@@ -108,7 +108,7 @@ IDOC extern GDrawFunctions * gdraw_GCM_CreateContext(CellGcmContextData *gcm, vo
There can only be one GCM GDraw context active at any one time.
If initialization fails for some reason (the main reason would be an out of memory condition),
- NULL is returned. Otherwise, you can pass the return value to IggySetGDraw. */
+ nullptr is returned. Otherwise, you can pass the return value to IggySetGDraw. */
IDOC extern void gdraw_GCM_DestroyContext(void);
/* Destroys the current GDraw context, if any. */
diff --git a/Minecraft.Client/PS3/Iggy/gdraw/gdraw_ps3gcm_shaders.inl b/Minecraft.Client/PS3/Iggy/gdraw/gdraw_ps3gcm_shaders.inl
index 811f524a..4d3c91bb 100644
--- a/Minecraft.Client/PS3/Iggy/gdraw/gdraw_ps3gcm_shaders.inl
+++ b/Minecraft.Client/PS3/Iggy/gdraw/gdraw_ps3gcm_shaders.inl
@@ -273,24 +273,24 @@ static int pshader_basic_econst[28] = {
};
static ProgramWithCachedVariableLocations pshader_basic_arr[18] = {
- { { pshader_basic_0 }, { NULL }, { -1, 7, -1, -1, -1, } },
- { { pshader_basic_1 }, { NULL }, { -1, 7, -1, (int) (intptr_t) (pshader_basic_econst + 0), -1, } },
- { { pshader_basic_2 }, { NULL }, { -1, 7, -1, (int) (intptr_t) (pshader_basic_econst + 0), -1, } },
- { { pshader_basic_3 }, { NULL }, { 0, 7, -1, -1, -1, } },
- { { pshader_basic_4 }, { NULL }, { 0, 7, -1, (int) (intptr_t) (pshader_basic_econst + 2), -1, } },
- { { pshader_basic_5 }, { NULL }, { 0, 7, -1, (int) (intptr_t) (pshader_basic_econst + 4), -1, } },
- { { pshader_basic_6 }, { NULL }, { 0, 7, -1, -1, -1, } },
- { { pshader_basic_7 }, { NULL }, { 0, 7, -1, (int) (intptr_t) (pshader_basic_econst + 6), -1, } },
- { { pshader_basic_8 }, { NULL }, { 0, 7, -1, (int) (intptr_t) (pshader_basic_econst + 6), -1, } },
- { { pshader_basic_9 }, { NULL }, { 0, 7, -1, -1, -1, } },
- { { pshader_basic_10 }, { NULL }, { 0, 7, -1, (int) (intptr_t) (pshader_basic_econst + 8), -1, } },
- { { pshader_basic_11 }, { NULL }, { 0, 7, -1, (int) (intptr_t) (pshader_basic_econst + 10), -1, } },
- { { pshader_basic_12 }, { NULL }, { 0, 7, -1, -1, (int) (intptr_t) (pshader_basic_econst + 12), } },
- { { pshader_basic_13 }, { NULL }, { 0, 7, -1, (int) (intptr_t) (pshader_basic_econst + 16), (int) (intptr_t) (pshader_basic_econst + 18), } },
- { { pshader_basic_14 }, { NULL }, { 0, 7, -1, (int) (intptr_t) (pshader_basic_econst + 22), (int) (intptr_t) (pshader_basic_econst + 24), } },
- { { pshader_basic_15 }, { NULL }, { 0, 7, -1, -1, -1, } },
- { { pshader_basic_16 }, { NULL }, { 0, 7, -1, (int) (intptr_t) (pshader_basic_econst + 2), -1, } },
- { { pshader_basic_17 }, { NULL }, { 0, 7, -1, (int) (intptr_t) (pshader_basic_econst + 6), -1, } },
+ { { pshader_basic_0 }, { nullptr }, { -1, 7, -1, -1, -1, } },
+ { { pshader_basic_1 }, { nullptr }, { -1, 7, -1, static_cast<int>((intptr_t)(pshader_basic_econst + 0)), -1, } },
+ { { pshader_basic_2 }, { nullptr }, { -1, 7, -1, static_cast<int>((intptr_t)(pshader_basic_econst + 0)), -1, } },
+ { { pshader_basic_3 }, { nullptr }, { 0, 7, -1, -1, -1, } },
+ { { pshader_basic_4 }, { nullptr }, { 0, 7, -1, static_cast<int>((intptr_t)(pshader_basic_econst + 2)), -1, } },
+ { { pshader_basic_5 }, { nullptr }, { 0, 7, -1, static_cast<int>((intptr_t)(pshader_basic_econst + 4)), -1, } },
+ { { pshader_basic_6 }, { nullptr }, { 0, 7, -1, -1, -1, } },
+ { { pshader_basic_7 }, { nullptr }, { 0, 7, -1, static_cast<int>((intptr_t)(pshader_basic_econst + 6)), -1, } },
+ { { pshader_basic_8 }, { nullptr }, { 0, 7, -1, static_cast<int>((intptr_t)(pshader_basic_econst + 6)), -1, } },
+ { { pshader_basic_9 }, { nullptr }, { 0, 7, -1, -1, -1, } },
+ { { pshader_basic_10 }, { nullptr }, { 0, 7, -1, static_cast<int>((intptr_t)(pshader_basic_econst + 8)), -1, } },
+ { { pshader_basic_11 }, { nullptr }, { 0, 7, -1, static_cast<int>((intptr_t)(pshader_basic_econst + 10)), -1, } },
+ { { pshader_basic_12 }, { nullptr }, { 0, 7, -1, -1, static_cast<int>((intptr_t)(pshader_basic_econst + 12)), } },
+ { { pshader_basic_13 }, { nullptr }, { 0, 7, -1, static_cast<int>((intptr_t)(pshader_basic_econst + 16)), static_cast<int>((intptr_t)(pshader_basic_econst + 18)), } },
+ { { pshader_basic_14 }, { nullptr }, { 0, 7, -1, static_cast<int>((intptr_t)(pshader_basic_econst + 22)), static_cast<int>((intptr_t)(pshader_basic_econst + 24)), } },
+ { { pshader_basic_15 }, { nullptr }, { 0, 7, -1, -1, -1, } },
+ { { pshader_basic_16 }, { nullptr }, { 0, 7, -1, static_cast<int>((intptr_t)(pshader_basic_econst + 2)), -1, } },
+ { { pshader_basic_17 }, { nullptr }, { 0, 7, -1, static_cast<int>((intptr_t)(pshader_basic_econst + 6)), -1, } },
};
static unsigned char pshader_exceptional_blend_1[368] = {
@@ -536,19 +536,19 @@ static int pshader_exceptional_blend_econst[4] = {
};
static ProgramWithCachedVariableLocations pshader_exceptional_blend_arr[13] = {
- { { NULL }, { NULL }, { -1, -1, -1, -1, } },
- { { pshader_exceptional_blend_1 }, { NULL }, { 0, 1, -1, (int) (intptr_t) (pshader_exceptional_blend_econst + 0), } },
- { { pshader_exceptional_blend_2 }, { NULL }, { 0, 1, -1, (int) (intptr_t) (pshader_exceptional_blend_econst + 0), } },
- { { pshader_exceptional_blend_3 }, { NULL }, { 0, 1, -1, (int) (intptr_t) (pshader_exceptional_blend_econst + 0), } },
- { { pshader_exceptional_blend_4 }, { NULL }, { 0, 1, -1, (int) (intptr_t) (pshader_exceptional_blend_econst + 0), } },
- { { pshader_exceptional_blend_5 }, { NULL }, { 0, 1, -1, (int) (intptr_t) (pshader_exceptional_blend_econst + 0), } },
- { { pshader_exceptional_blend_6 }, { NULL }, { 0, 1, -1, (int) (intptr_t) (pshader_exceptional_blend_econst + 0), } },
- { { pshader_exceptional_blend_7 }, { NULL }, { 0, 1, -1, (int) (intptr_t) (pshader_exceptional_blend_econst + 0), } },
- { { pshader_exceptional_blend_8 }, { NULL }, { 0, 1, -1, (int) (intptr_t) (pshader_exceptional_blend_econst + 0), } },
- { { pshader_exceptional_blend_9 }, { NULL }, { 0, 1, -1, (int) (intptr_t) (pshader_exceptional_blend_econst + 0), } },
- { { pshader_exceptional_blend_10 }, { NULL }, { 0, 1, -1, (int) (intptr_t) (pshader_exceptional_blend_econst + 0), } },
- { { pshader_exceptional_blend_11 }, { NULL }, { 0, 1, -1, (int) (intptr_t) (pshader_exceptional_blend_econst + 2), } },
- { { pshader_exceptional_blend_12 }, { NULL }, { 0, 1, -1, (int) (intptr_t) (pshader_exceptional_blend_econst + 2), } },
+ { { nullptr }, { nullptr }, { -1, -1, -1, -1, } },
+ { { pshader_exceptional_blend_1 }, { nullptr }, { 0, 1, -1, static_cast<int>((intptr_t)(pshader_exceptional_blend_econst + 0)), } },
+ { { pshader_exceptional_blend_2 }, { nullptr }, { 0, 1, -1, static_cast<int>((intptr_t)(pshader_exceptional_blend_econst + 0)), } },
+ { { pshader_exceptional_blend_3 }, { nullptr }, { 0, 1, -1, static_cast<int>((intptr_t)(pshader_exceptional_blend_econst + 0)), } },
+ { { pshader_exceptional_blend_4 }, { nullptr }, { 0, 1, -1, static_cast<int>((intptr_t)(pshader_exceptional_blend_econst + 0)), } },
+ { { pshader_exceptional_blend_5 }, { nullptr }, { 0, 1, -1, static_cast<int>((intptr_t)(pshader_exceptional_blend_econst + 0)), } },
+ { { pshader_exceptional_blend_6 }, { nullptr }, { 0, 1, -1, static_cast<int>((intptr_t)(pshader_exceptional_blend_econst + 0)), } },
+ { { pshader_exceptional_blend_7 }, { nullptr }, { 0, 1, -1, static_cast<int>((intptr_t)(pshader_exceptional_blend_econst + 0)), } },
+ { { pshader_exceptional_blend_8 }, { nullptr }, { 0, 1, -1, static_cast<int>((intptr_t)(pshader_exceptional_blend_econst + 0)), } },
+ { { pshader_exceptional_blend_9 }, { nullptr }, { 0, 1, -1, static_cast<int>((intptr_t)(pshader_exceptional_blend_econst + 0)), } },
+ { { pshader_exceptional_blend_10 }, { nullptr }, { 0, 1, -1, static_cast<int>((intptr_t)(pshader_exceptional_blend_econst + 0)), } },
+ { { pshader_exceptional_blend_11 }, { nullptr }, { 0, 1, -1, static_cast<int>((intptr_t)(pshader_exceptional_blend_econst + 2)), } },
+ { { pshader_exceptional_blend_12 }, { nullptr }, { 0, 1, -1, static_cast<int>((intptr_t)(pshader_exceptional_blend_econst + 2)), } },
};
static unsigned char pshader_filter_0[416] = {
@@ -1121,38 +1121,38 @@ static int pshader_filter_econst[90] = {
};
static ProgramWithCachedVariableLocations pshader_filter_arr[32] = {
- { { pshader_filter_0 }, { NULL }, { 0, 1, (int) (intptr_t) (pshader_filter_econst + 0), (int) (intptr_t) (pshader_filter_econst + 2), -1, (int) (intptr_t) (pshader_filter_econst + 5), (int) (intptr_t) (pshader_filter_econst + 8), -1, } },
- { { pshader_filter_1 }, { NULL }, { 0, 1, (int) (intptr_t) (pshader_filter_econst + 11), (int) (intptr_t) (pshader_filter_econst + 2), -1, (int) (intptr_t) (pshader_filter_econst + 5), (int) (intptr_t) (pshader_filter_econst + 8), -1, } },
- { { pshader_filter_2 }, { NULL }, { 0, 1, -1, (int) (intptr_t) (pshader_filter_econst + 13), 2, (int) (intptr_t) (pshader_filter_econst + 16), (int) (intptr_t) (pshader_filter_econst + 5), -1, } },
- { { pshader_filter_3 }, { NULL }, { 0, 1, -1, (int) (intptr_t) (pshader_filter_econst + 13), 2, (int) (intptr_t) (pshader_filter_econst + 16), (int) (intptr_t) (pshader_filter_econst + 5), -1, } },
- { { pshader_filter_4 }, { NULL }, { 0, 1, (int) (intptr_t) (pshader_filter_econst + 19), (int) (intptr_t) (pshader_filter_econst + 2), -1, (int) (intptr_t) (pshader_filter_econst + 5), (int) (intptr_t) (pshader_filter_econst + 8), -1, } },
- { { pshader_filter_5 }, { NULL }, { 0, 1, (int) (intptr_t) (pshader_filter_econst + 11), (int) (intptr_t) (pshader_filter_econst + 2), -1, (int) (intptr_t) (pshader_filter_econst + 5), (int) (intptr_t) (pshader_filter_econst + 8), -1, } },
- { { pshader_filter_6 }, { NULL }, { 0, 1, -1, (int) (intptr_t) (pshader_filter_econst + 2), 2, (int) (intptr_t) (pshader_filter_econst + 5), (int) (intptr_t) (pshader_filter_econst + 8), -1, } },
- { { pshader_filter_7 }, { NULL }, { 0, 1, -1, (int) (intptr_t) (pshader_filter_econst + 13), 2, (int) (intptr_t) (pshader_filter_econst + 16), (int) (intptr_t) (pshader_filter_econst + 5), -1, } },
- { { pshader_filter_8 }, { NULL }, { -1, 1, (int) (intptr_t) (pshader_filter_econst + 21), -1, -1, -1, (int) (intptr_t) (pshader_filter_econst + 24), -1, } },
- { { pshader_filter_9 }, { NULL }, { -1, -1, (int) (intptr_t) (pshader_filter_econst + 27), -1, -1, -1, -1, -1, } },
- { { pshader_filter_10 }, { NULL }, { 0, 1, -1, (int) (intptr_t) (pshader_filter_econst + 2), 2, (int) (intptr_t) (pshader_filter_econst + 5), (int) (intptr_t) (pshader_filter_econst + 8), -1, } },
- { { pshader_filter_11 }, { NULL }, { 0, -1, -1, (int) (intptr_t) (pshader_filter_econst + 29), 2, (int) (intptr_t) (pshader_filter_econst + 32), -1, -1, } },
- { { NULL }, { NULL }, { -1, -1, -1, -1, -1, -1, -1, -1, } },
- { { NULL }, { NULL }, { -1, -1, -1, -1, -1, -1, -1, -1, } },
- { { NULL }, { NULL }, { -1, -1, -1, -1, -1, -1, -1, -1, } },
- { { NULL }, { NULL }, { -1, -1, -1, -1, -1, -1, -1, -1, } },
- { { pshader_filter_16 }, { NULL }, { 0, 1, (int) (intptr_t) (pshader_filter_econst + 35), (int) (intptr_t) (pshader_filter_econst + 37), -1, (int) (intptr_t) (pshader_filter_econst + 41), (int) (intptr_t) (pshader_filter_econst + 46), (int) (intptr_t) (pshader_filter_econst + 49), } },
- { { pshader_filter_17 }, { NULL }, { 0, 1, (int) (intptr_t) (pshader_filter_econst + 47), (int) (intptr_t) (pshader_filter_econst + 37), -1, (int) (intptr_t) (pshader_filter_econst + 41), (int) (intptr_t) (pshader_filter_econst + 51), (int) (intptr_t) (pshader_filter_econst + 35), } },
- { { pshader_filter_18 }, { NULL }, { 0, 1, -1, (int) (intptr_t) (pshader_filter_econst + 37), 2, (int) (intptr_t) (pshader_filter_econst + 54), (int) (intptr_t) (pshader_filter_econst + 59), -1, } },
- { { pshader_filter_19 }, { NULL }, { 0, 1, -1, (int) (intptr_t) (pshader_filter_econst + 62), 2, (int) (intptr_t) (pshader_filter_econst + 41), (int) (intptr_t) (pshader_filter_econst + 66), -1, } },
- { { pshader_filter_20 }, { NULL }, { 0, 1, (int) (intptr_t) (pshader_filter_econst + 35), (int) (intptr_t) (pshader_filter_econst + 37), -1, (int) (intptr_t) (pshader_filter_econst + 41), (int) (intptr_t) (pshader_filter_econst + 46), (int) (intptr_t) (pshader_filter_econst + 49), } },
- { { pshader_filter_21 }, { NULL }, { 0, 1, (int) (intptr_t) (pshader_filter_econst + 47), (int) (intptr_t) (pshader_filter_econst + 37), -1, (int) (intptr_t) (pshader_filter_econst + 41), (int) (intptr_t) (pshader_filter_econst + 51), (int) (intptr_t) (pshader_filter_econst + 35), } },
- { { pshader_filter_22 }, { NULL }, { 0, 1, -1, (int) (intptr_t) (pshader_filter_econst + 69), 2, (int) (intptr_t) (pshader_filter_econst + 41), (int) (intptr_t) (pshader_filter_econst + 73), -1, } },
- { { pshader_filter_23 }, { NULL }, { 0, 1, -1, (int) (intptr_t) (pshader_filter_econst + 62), 2, (int) (intptr_t) (pshader_filter_econst + 41), (int) (intptr_t) (pshader_filter_econst + 66), -1, } },
- { { pshader_filter_24 }, { NULL }, { 0, 1, (int) (intptr_t) (pshader_filter_econst + 35), (int) (intptr_t) (pshader_filter_econst + 37), -1, (int) (intptr_t) (pshader_filter_econst + 41), (int) (intptr_t) (pshader_filter_econst + 46), (int) (intptr_t) (pshader_filter_econst + 49), } },
- { { pshader_filter_25 }, { NULL }, { 0, -1, (int) (intptr_t) (pshader_filter_econst + 76), (int) (intptr_t) (pshader_filter_econst + 37), -1, (int) (intptr_t) (pshader_filter_econst + 41), -1, (int) (intptr_t) (pshader_filter_econst + 67), } },
- { { pshader_filter_26 }, { NULL }, { 0, 1, -1, (int) (intptr_t) (pshader_filter_econst + 78), 2, (int) (intptr_t) (pshader_filter_econst + 82), (int) (intptr_t) (pshader_filter_econst + 87), -1, } },
- { { pshader_filter_27 }, { NULL }, { 0, -1, -1, (int) (intptr_t) (pshader_filter_econst + 37), 2, (int) (intptr_t) (pshader_filter_econst + 41), -1, -1, } },
- { { NULL }, { NULL }, { -1, -1, -1, -1, -1, -1, -1, -1, } },
- { { NULL }, { NULL }, { -1, -1, -1, -1, -1, -1, -1, -1, } },
- { { NULL }, { NULL }, { -1, -1, -1, -1, -1, -1, -1, -1, } },
- { { NULL }, { NULL }, { -1, -1, -1, -1, -1, -1, -1, -1, } },
+ { { pshader_filter_0 }, { nullptr }, { 0, 1, static_cast<int>((intptr_t)(pshader_filter_econst + 0)), static_cast<int>((intptr_t)(pshader_filter_econst + 2)), -1, static_cast<int>((intptr_t)(pshader_filter_econst + 5)), static_cast<int>((intptr_t)(pshader_filter_econst + 8)), -1, } },
+ { { pshader_filter_1 }, { nullptr }, { 0, 1, static_cast<int>((intptr_t)(pshader_filter_econst + 11)), static_cast<int>((intptr_t)(pshader_filter_econst + 2)), -1, static_cast<int>((intptr_t)(pshader_filter_econst + 5)), static_cast<int>((intptr_t)(pshader_filter_econst + 8)), -1, } },
+ { { pshader_filter_2 }, { nullptr }, { 0, 1, -1, static_cast<int>((intptr_t)(pshader_filter_econst + 13)), 2, static_cast<int>((intptr_t)(pshader_filter_econst + 16)), static_cast<int>((intptr_t)(pshader_filter_econst + 5)), -1, } },
+ { { pshader_filter_3 }, { nullptr }, { 0, 1, -1, static_cast<int>((intptr_t)(pshader_filter_econst + 13)), 2, static_cast<int>((intptr_t)(pshader_filter_econst + 16)), static_cast<int>((intptr_t)(pshader_filter_econst + 5)), -1, } },
+ { { pshader_filter_4 }, { nullptr }, { 0, 1, static_cast<int>((intptr_t)(pshader_filter_econst + 19)), static_cast<int>((intptr_t)(pshader_filter_econst + 2)), -1, static_cast<int>((intptr_t)(pshader_filter_econst + 5)), static_cast<int>((intptr_t)(pshader_filter_econst + 8)), -1, } },
+ { { pshader_filter_5 }, { nullptr }, { 0, 1, static_cast<int>((intptr_t)(pshader_filter_econst + 11)), static_cast<int>((intptr_t)(pshader_filter_econst + 2)), -1, static_cast<int>((intptr_t)(pshader_filter_econst + 5)), static_cast<int>((intptr_t)(pshader_filter_econst + 8)), -1, } },
+ { { pshader_filter_6 }, { nullptr }, { 0, 1, -1, static_cast<int>((intptr_t)(pshader_filter_econst + 2)), 2, static_cast<int>((intptr_t)(pshader_filter_econst + 5)), static_cast<int>((intptr_t)(pshader_filter_econst + 8)), -1, } },
+ { { pshader_filter_7 }, { nullptr }, { 0, 1, -1, static_cast<int>((intptr_t)(pshader_filter_econst + 13)), 2, static_cast<int>((intptr_t)(pshader_filter_econst + 16)), static_cast<int>((intptr_t)(pshader_filter_econst + 5)), -1, } },
+ { { pshader_filter_8 }, { nullptr }, { -1, 1, static_cast<int>((intptr_t)(pshader_filter_econst + 21)), -1, -1, -1, static_cast<int>((intptr_t)(pshader_filter_econst + 24)), -1, } },
+ { { pshader_filter_9 }, { nullptr }, { -1, -1, static_cast<int>((intptr_t)(pshader_filter_econst + 27)), -1, -1, -1, -1, -1, } },
+ { { pshader_filter_10 }, { nullptr }, { 0, 1, -1, static_cast<int>((intptr_t)(pshader_filter_econst + 2)), 2, static_cast<int>((intptr_t)(pshader_filter_econst + 5)), static_cast<int>((intptr_t)(pshader_filter_econst + 8)), -1, } },
+ { { pshader_filter_11 }, { nullptr }, { 0, -1, -1, static_cast<int>((intptr_t)(pshader_filter_econst + 29)), 2, static_cast<int>((intptr_t)(pshader_filter_econst + 32)), -1, -1, } },
+ { { nullptr }, { nullptr }, { -1, -1, -1, -1, -1, -1, -1, -1, } },
+ { { nullptr }, { nullptr }, { -1, -1, -1, -1, -1, -1, -1, -1, } },
+ { { nullptr }, { nullptr }, { -1, -1, -1, -1, -1, -1, -1, -1, } },
+ { { nullptr }, { nullptr }, { -1, -1, -1, -1, -1, -1, -1, -1, } },
+ { { pshader_filter_16 }, { nullptr }, { 0, 1, static_cast<int>((intptr_t)(pshader_filter_econst + 35)), static_cast<int>((intptr_t)(pshader_filter_econst + 37)), -1, static_cast<int>((intptr_t)(pshader_filter_econst + 41)), static_cast<int>((intptr_t)(pshader_filter_econst + 46)), static_cast<int>((intptr_t)(pshader_filter_econst + 49)), } },
+ { { pshader_filter_17 }, { nullptr }, { 0, 1, static_cast<int>((intptr_t)(pshader_filter_econst + 47)), static_cast<int>((intptr_t)(pshader_filter_econst + 37)), -1, static_cast<int>((intptr_t)(pshader_filter_econst + 41)), static_cast<int>((intptr_t)(pshader_filter_econst + 51)), static_cast<int>((intptr_t)(pshader_filter_econst + 35)), } },
+ { { pshader_filter_18 }, { nullptr }, { 0, 1, -1, static_cast<int>((intptr_t)(pshader_filter_econst + 37)), 2, static_cast<int>((intptr_t)(pshader_filter_econst + 54)), static_cast<int>((intptr_t)(pshader_filter_econst + 59)), -1, } },
+ { { pshader_filter_19 }, { nullptr }, { 0, 1, -1, static_cast<int>((intptr_t)(pshader_filter_econst + 62)), 2, static_cast<int>((intptr_t)(pshader_filter_econst + 41)), static_cast<int>((intptr_t)(pshader_filter_econst + 66)), -1, } },
+ { { pshader_filter_20 }, { nullptr }, { 0, 1, static_cast<int>((intptr_t)(pshader_filter_econst + 35)), static_cast<int>((intptr_t)(pshader_filter_econst + 37)), -1, static_cast<int>((intptr_t)(pshader_filter_econst + 41)), static_cast<int>((intptr_t)(pshader_filter_econst + 46)), static_cast<int>((intptr_t)(pshader_filter_econst + 49)), } },
+ { { pshader_filter_21 }, { nullptr }, { 0, 1, static_cast<int>((intptr_t)(pshader_filter_econst + 47)), static_cast<int>((intptr_t)(pshader_filter_econst + 37)), -1, static_cast<int>((intptr_t)(pshader_filter_econst + 41)), static_cast<int>((intptr_t)(pshader_filter_econst + 51)), static_cast<int>((intptr_t)(pshader_filter_econst + 35)), } },
+ { { pshader_filter_22 }, { nullptr }, { 0, 1, -1, static_cast<int>((intptr_t)(pshader_filter_econst + 69)), 2, static_cast<int>((intptr_t)(pshader_filter_econst + 41)), static_cast<int>((intptr_t)(pshader_filter_econst + 73)), -1, } },
+ { { pshader_filter_23 }, { nullptr }, { 0, 1, -1, static_cast<int>((intptr_t)(pshader_filter_econst + 62)), 2, static_cast<int>((intptr_t)(pshader_filter_econst + 41)), static_cast<int>((intptr_t)(pshader_filter_econst + 66)), -1, } },
+ { { pshader_filter_24 }, { nullptr }, { 0, 1, static_cast<int>((intptr_t)(pshader_filter_econst + 35)), static_cast<int>((intptr_t)(pshader_filter_econst + 37)), -1, static_cast<int>((intptr_t)(pshader_filter_econst + 41)), static_cast<int>((intptr_t)(pshader_filter_econst + 46)), static_cast<int>((intptr_t)(pshader_filter_econst + 49)), } },
+ { { pshader_filter_25 }, { nullptr }, { 0, -1, static_cast<int>((intptr_t)(pshader_filter_econst + 76)), static_cast<int>((intptr_t)(pshader_filter_econst + 37)), -1, static_cast<int>((intptr_t)(pshader_filter_econst + 41)), -1, static_cast<int>((intptr_t)(pshader_filter_econst + 67)), } },
+ { { pshader_filter_26 }, { nullptr }, { 0, 1, -1, static_cast<int>((intptr_t)(pshader_filter_econst + 78)), 2, static_cast<int>((intptr_t)(pshader_filter_econst + 82)), static_cast<int>((intptr_t)(pshader_filter_econst + 87)), -1, } },
+ { { pshader_filter_27 }, { nullptr }, { 0, -1, -1, static_cast<int>((intptr_t)(pshader_filter_econst + 37)), 2, static_cast<int>((intptr_t)(pshader_filter_econst + 41)), -1, -1, } },
+ { { nullptr }, { nullptr }, { -1, -1, -1, -1, -1, -1, -1, -1, } },
+ { { nullptr }, { nullptr }, { -1, -1, -1, -1, -1, -1, -1, -1, } },
+ { { nullptr }, { nullptr }, { -1, -1, -1, -1, -1, -1, -1, -1, } },
+ { { nullptr }, { nullptr }, { -1, -1, -1, -1, -1, -1, -1, -1, } },
};
static unsigned char pshader_blur_2[368] = {
@@ -1560,16 +1560,16 @@ static int pshader_blur_econst[256] = {
};
static ProgramWithCachedVariableLocations pshader_blur_arr[10] = {
- { { NULL }, { NULL }, { -1, -1, -1, } },
- { { NULL }, { NULL }, { -1, -1, -1, } },
- { { pshader_blur_2 }, { NULL }, { 0, (int) (intptr_t) (pshader_blur_econst + 0), (int) (intptr_t) (pshader_blur_econst + 13), } },
- { { pshader_blur_3 }, { NULL }, { 0, (int) (intptr_t) (pshader_blur_econst + 18), (int) (intptr_t) (pshader_blur_econst + 33), } },
- { { pshader_blur_4 }, { NULL }, { 0, (int) (intptr_t) (pshader_blur_econst + 40), (int) (intptr_t) (pshader_blur_econst + 57), } },
- { { pshader_blur_5 }, { NULL }, { 0, (int) (intptr_t) (pshader_blur_econst + 66), (int) (intptr_t) (pshader_blur_econst + 85), } },
- { { pshader_blur_6 }, { NULL }, { 0, (int) (intptr_t) (pshader_blur_econst + 96), (int) (intptr_t) (pshader_blur_econst + 117), } },
- { { pshader_blur_7 }, { NULL }, { 0, (int) (intptr_t) (pshader_blur_econst + 130), (int) (intptr_t) (pshader_blur_econst + 153), } },
- { { pshader_blur_8 }, { NULL }, { 0, (int) (intptr_t) (pshader_blur_econst + 168), (int) (intptr_t) (pshader_blur_econst + 193), } },
- { { pshader_blur_9 }, { NULL }, { 0, (int) (intptr_t) (pshader_blur_econst + 210), (int) (intptr_t) (pshader_blur_econst + 237), } },
+ { { nullptr }, { nullptr }, { -1, -1, -1, } },
+ { { nullptr }, { nullptr }, { -1, -1, -1, } },
+ { { pshader_blur_2 }, { nullptr }, { 0, static_cast<int>((intptr_t)(pshader_blur_econst + 0)), static_cast<int>((intptr_t)(pshader_blur_econst + 13)), } },
+ { { pshader_blur_3 }, { nullptr }, { 0, static_cast<int>((intptr_t)(pshader_blur_econst + 18)), static_cast<int>((intptr_t)(pshader_blur_econst + 33)), } },
+ { { pshader_blur_4 }, { nullptr }, { 0, static_cast<int>((intptr_t)(pshader_blur_econst + 40)), static_cast<int>((intptr_t)(pshader_blur_econst + 57)), } },
+ { { pshader_blur_5 }, { nullptr }, { 0, static_cast<int>((intptr_t)(pshader_blur_econst + 66)), static_cast<int>((intptr_t)(pshader_blur_econst + 85)), } },
+ { { pshader_blur_6 }, { nullptr }, { 0, static_cast<int>((intptr_t)(pshader_blur_econst + 96)), static_cast<int>((intptr_t)(pshader_blur_econst + 117)), } },
+ { { pshader_blur_7 }, { nullptr }, { 0, static_cast<int>((intptr_t)(pshader_blur_econst + 130)), static_cast<int>((intptr_t)(pshader_blur_econst + 153)), } },
+ { { pshader_blur_8 }, { nullptr }, { 0, static_cast<int>((intptr_t)(pshader_blur_econst + 168)), static_cast<int>((intptr_t)(pshader_blur_econst + 193)), } },
+ { { pshader_blur_9 }, { nullptr }, { 0, static_cast<int>((intptr_t)(pshader_blur_econst + 210)), static_cast<int>((intptr_t)(pshader_blur_econst + 237)), } },
};
static unsigned char pshader_color_matrix_0[336] = {
@@ -1598,7 +1598,7 @@ static int pshader_color_matrix_econst[12] = {
};
static ProgramWithCachedVariableLocations pshader_color_matrix_arr[1] = {
- { { pshader_color_matrix_0 }, { NULL }, { 0, (int) (intptr_t) (pshader_color_matrix_econst + 0), } },
+ { { pshader_color_matrix_0 }, { nullptr }, { 0, static_cast<int>((intptr_t)(pshader_color_matrix_econst + 0)), } },
};
static unsigned char vshader_vsps3_0[272] = {
@@ -1655,8 +1655,8 @@ static unsigned char vshader_vsps3_2[240] = {
};
static ProgramWithCachedVariableLocations vshader_vsps3_arr[3] = {
- { { vshader_vsps3_0 }, { NULL }, { } },
- { { vshader_vsps3_1 }, { NULL }, { } },
- { { vshader_vsps3_2 }, { NULL }, { } },
+ { { vshader_vsps3_0 }, { nullptr }, { } },
+ { { vshader_vsps3_1 }, { nullptr }, { } },
+ { { vshader_vsps3_2 }, { nullptr }, { } },
};
diff --git a/Minecraft.Client/PS3/Iggy/gdraw/gdraw_shared.inl b/Minecraft.Client/PS3/Iggy/gdraw/gdraw_shared.inl
index 86293ab6..6f8dd9c0 100644
--- a/Minecraft.Client/PS3/Iggy/gdraw/gdraw_shared.inl
+++ b/Minecraft.Client/PS3/Iggy/gdraw/gdraw_shared.inl
@@ -226,7 +226,7 @@ static void debug_check_raw_values(GDrawHandleCache *c)
s = s->next;
}
s = c->active;
- while (s != NULL) {
+ while (s != nullptr) {
assert(s->raw_ptr != t->raw_ptr);
s = s->next;
}
@@ -368,7 +368,7 @@ static void gdraw_HandleTransitionInsertBefore(GDrawHandle *t, GDrawHandleState
{
check_lists(t->cache);
assert(t->state != GDRAW_HANDLE_STATE_sentinel); // sentinels should never get here!
- assert(t->state != (U32) new_state); // code should never call "transition" if it's not transitioning!
+ assert(t->state != static_cast<U32>(new_state)); // code should never call "transition" if it's not transitioning!
// unlink from prev state
t->prev->next = t->next;
t->next->prev = t->prev;
@@ -433,7 +433,7 @@ static rrbool gdraw_HandleCacheLockStats(GDrawHandle *t, void *owner, GDrawStats
static rrbool gdraw_HandleCacheLock(GDrawHandle *t, void *owner)
{
- return gdraw_HandleCacheLockStats(t, owner, NULL);
+ return gdraw_HandleCacheLockStats(t, owner, nullptr);
}
static void gdraw_HandleCacheUnlock(GDrawHandle *t)
@@ -461,11 +461,11 @@ static void gdraw_HandleCacheInit(GDrawHandleCache *c, S32 num_handles, S32 byte
c->is_thrashing = false;
c->did_defragment = false;
for (i=0; i < GDRAW_HANDLE_STATE__count; i++) {
- c->state[i].owner = NULL;
- c->state[i].cache = NULL; // should never follow cache link from sentinels!
+ c->state[i].owner = nullptr;
+ c->state[i].cache = nullptr; // should never follow cache link from sentinels!
c->state[i].next = c->state[i].prev = &c->state[i];
#ifdef GDRAW_MANAGE_MEM
- c->state[i].raw_ptr = NULL;
+ c->state[i].raw_ptr = nullptr;
#endif
c->state[i].fence.value = 0;
c->state[i].bytes = 0;
@@ -478,7 +478,7 @@ static void gdraw_HandleCacheInit(GDrawHandleCache *c, S32 num_handles, S32 byte
c->handle[i].bytes = 0;
c->handle[i].state = GDRAW_HANDLE_STATE_free;
#ifdef GDRAW_MANAGE_MEM
- c->handle[i].raw_ptr = NULL;
+ c->handle[i].raw_ptr = nullptr;
#endif
}
c->state[GDRAW_HANDLE_STATE_free].next = &c->handle[0];
@@ -486,10 +486,10 @@ static void gdraw_HandleCacheInit(GDrawHandleCache *c, S32 num_handles, S32 byte
c->prev_frame_start.value = 0;
c->prev_frame_end.value = 0;
#ifdef GDRAW_MANAGE_MEM
- c->alloc = NULL;
+ c->alloc = nullptr;
#endif
#ifdef GDRAW_MANAGE_MEM_TWOPOOL
- c->alloc_other = NULL;
+ c->alloc_other = nullptr;
#endif
check_lists(c);
}
@@ -497,14 +497,14 @@ static void gdraw_HandleCacheInit(GDrawHandleCache *c, S32 num_handles, S32 byte
static GDrawHandle *gdraw_HandleCacheAllocateBegin(GDrawHandleCache *c)
{
GDrawHandle *free_list = &c->state[GDRAW_HANDLE_STATE_free];
- GDrawHandle *t = NULL;
+ GDrawHandle *t = nullptr;
if (free_list->next != free_list) {
t = free_list->next;
gdraw_HandleTransitionTo(t, GDRAW_HANDLE_STATE_alloc);
t->bytes = 0;
t->owner = 0;
#ifdef GDRAW_MANAGE_MEM
- t->raw_ptr = NULL;
+ t->raw_ptr = nullptr;
#endif
#ifdef GDRAW_CORRUPTION_CHECK
t->has_check_value = false;
@@ -563,7 +563,7 @@ static GDrawHandle *gdraw_HandleCacheGetLRU(GDrawHandleCache *c)
// at the front of the LRU list are the oldest ones, since in-use resources
// will get appended on every transition from "locked" to "live".
GDrawHandle *sentinel = &c->state[GDRAW_HANDLE_STATE_live];
- return (sentinel->next != sentinel) ? sentinel->next : NULL;
+ return (sentinel->next != sentinel) ? sentinel->next : nullptr;
}
static void gdraw_HandleCacheTick(GDrawHandleCache *c, GDrawFence now)
@@ -778,7 +778,7 @@ static GDrawTexture *gdraw_BlurPass(GDrawFunctions *g, GDrawBlurInfo *c, GDrawRe
if (!g->TextureDrawBufferBegin(draw_bounds, GDRAW_TEXTURE_FORMAT_rgba32, GDRAW_TEXTUREDRAWBUFFER_FLAGS_needs_color | GDRAW_TEXTUREDRAWBUFFER_FLAGS_needs_alpha, 0, gstats))
return r->tex[0];
- c->BlurPass(r, taps, data, draw_bounds, tc, (F32) c->h / c->frametex_height, clamp, gstats);
+ c->BlurPass(r, taps, data, draw_bounds, tc, static_cast<F32>(c->h) / c->frametex_height, clamp, gstats);
return g->TextureDrawBufferEnd(gstats);
}
@@ -830,7 +830,7 @@ static GDrawTexture *gdraw_BlurPassDownsample(GDrawFunctions *g, GDrawBlurInfo *
assert(clamp[0] <= clamp[2]);
assert(clamp[1] <= clamp[3]);
- c->BlurPass(r, taps, data, &z, tc, (F32) c->h / c->frametex_height, clamp, gstats);
+ c->BlurPass(r, taps, data, &z, tc, static_cast<F32>(c->h) / c->frametex_height, clamp, gstats);
return g->TextureDrawBufferEnd(gstats);
}
@@ -842,7 +842,7 @@ static void gdraw_BlurAxis(S32 axis, GDrawFunctions *g, GDrawBlurInfo *c, GDrawR
GDrawTexture *t;
F32 data[MAX_TAPS][4];
S32 off_axis = 1-axis;
- S32 w = ((S32) ceil((blur_width-1)/2))*2+1; // 1.2 => 3, 2.8 => 3, 3.2 => 5
+ S32 w = static_cast<S32>(ceil((blur_width - 1) / 2))*2+1; // 1.2 => 3, 2.8 => 3, 3.2 => 5
F32 edge_weight = 1 - (w - blur_width)/2; // 3 => 0 => 1; 1.2 => 1.8 => 0.9 => 0.1
F32 inverse_weight = 1.0f / blur_width;
@@ -949,7 +949,7 @@ static void gdraw_BlurAxis(S32 axis, GDrawFunctions *g, GDrawBlurInfo *c, GDrawR
// max coverage is 25 samples, or a filter width of 13. with 7 taps, we sample
// 13 samples in one pass, max coverage is 13*13 samples or (13*13-1)/2 width,
// which is ((2T-1)*(2T-1)-1)/2 or (4T^2 - 4T + 1 -1)/2 or 2T^2 - 2T or 2T*(T-1)
- S32 w_mip = (S32) ceil(linear_remap(w, MAX_TAPS+1, MAX_TAPS*MAX_TAPS, 2, MAX_TAPS));
+ S32 w_mip = static_cast<S32>(ceil(linear_remap(w, MAX_TAPS+1, MAX_TAPS*MAX_TAPS, 2, MAX_TAPS)));
S32 downsample = w_mip;
F32 sample_spacing = texel;
if (downsample < 2) downsample = 2;
@@ -1095,7 +1095,7 @@ static void make_pool_aligned(void **start, S32 *num_bytes, U32 alignment)
if (addr_aligned != addr_orig) {
S32 diff = (S32) (addr_aligned - addr_orig);
if (*num_bytes < diff) {
- *start = NULL;
+ *start = nullptr;
*num_bytes = 0;
return;
} else {
@@ -1132,7 +1132,7 @@ static void *gdraw_arena_alloc(GDrawArena *arena, U32 size, U32 align)
UINTa remaining = arena->end - arena->current;
UINTa total_size = (ptr - arena->current) + size;
if (remaining < total_size) // doesn't fit
- return NULL;
+ return nullptr;
arena->current = ptr + size;
return ptr;
@@ -1157,7 +1157,7 @@ static void *gdraw_arena_alloc(GDrawArena *arena, U32 size, U32 align)
// (i.e. block->next->prev == block->prev->next == block)
// - All allocated blocks are also kept in a hash table, indexed by their
// pointer (to allow free to locate the corresponding block_info quickly).
-// There's a single-linked, NULL-terminated list of elements in each hash
+// There's a single-linked, nullptr-terminated list of elements in each hash
// bucket.
// - The physical block list is ordered. It always contains all currently
// active blocks and spans the whole managed memory range. There are no
@@ -1166,7 +1166,7 @@ static void *gdraw_arena_alloc(GDrawArena *arena, U32 size, U32 align)
// they are coalesced immediately.
// - The maximum number of blocks that could ever be necessary is allocated
// on initialization. All block_infos not currently in use are kept in a
-// single-linked, NULL-terminated list of unused blocks. Every block is either
+// single-linked, nullptr-terminated list of unused blocks. Every block is either
// in the physical block list or the unused list, and the total number of
// blocks is constant.
// These invariants always hold before and after an allocation/free.
@@ -1384,7 +1384,7 @@ static void gfxalloc_check2(gfx_allocator *alloc)
static gfx_block_info *gfxalloc_pop_unused(gfx_allocator *alloc)
{
- GFXALLOC_ASSERT(alloc->unused_list != NULL);
+ GFXALLOC_ASSERT(alloc->unused_list != nullptr);
GFXALLOC_ASSERT(alloc->unused_list->is_unused);
GFXALLOC_IF_CHECK(GFXALLOC_ASSERT(alloc->num_unused);)
@@ -1457,7 +1457,7 @@ static gfx_allocator *gfxalloc_create(void *mem, U32 mem_size, U32 align, U32 ma
U32 i, max_blocks, size;
if (!align || (align & (align - 1)) != 0) // align must be >0 and a power of 2
- return NULL;
+ return nullptr;
// for <= max_allocs live allocs, there's <= 2*max_allocs+1 blocks. worst case:
// [free][used][free] .... [free][used][free]
@@ -1465,7 +1465,7 @@ static gfx_allocator *gfxalloc_create(void *mem, U32 mem_size, U32 align, U32 ma
size = sizeof(gfx_allocator) + max_blocks * sizeof(gfx_block_info);
a = (gfx_allocator *) IggyGDrawMalloc(size);
if (!a)
- return NULL;
+ return nullptr;
memset(a, 0, size);
@@ -1506,16 +1506,16 @@ static gfx_allocator *gfxalloc_create(void *mem, U32 mem_size, U32 align, U32 ma
a->blocks[i].is_unused = 1;
gfxalloc_check(a);
- debug_complete_check(a, NULL, 0,0);
+ debug_complete_check(a, nullptr, 0,0);
return a;
}
static void *gfxalloc_alloc(gfx_allocator *alloc, U32 size_in_bytes)
{
- gfx_block_info *cur, *best = NULL;
+ gfx_block_info *cur, *best = nullptr;
U32 i, best_wasted = ~0u;
U32 size = size_in_bytes;
-debug_complete_check(alloc, NULL, 0,0);
+debug_complete_check(alloc, nullptr, 0,0);
gfxalloc_check(alloc);
GFXALLOC_IF_CHECK(GFXALLOC_ASSERT(alloc->num_blocks == alloc->num_alloc + alloc->num_free + alloc->num_unused);)
GFXALLOC_IF_CHECK(GFXALLOC_ASSERT(alloc->num_free <= alloc->num_blocks+1);)
@@ -1565,7 +1565,7 @@ gfxalloc_check(alloc);
debug_check_overlap(alloc->cache, best->ptr, best->size);
return best->ptr;
} else
- return NULL; // not enough space!
+ return nullptr; // not enough space!
}
static void gfxalloc_free(gfx_allocator *alloc, void *ptr)
@@ -1735,7 +1735,7 @@ static void gdraw_DefragmentMain(GDrawHandleCache *c, U32 flags, GDrawStats *sta
// (unused for allocated blocks, we'll use it to store a back-pointer to the corresponding handle)
for (b = alloc->blocks[0].next_phys; b != alloc->blocks; b=b->next_phys)
if (!b->is_free)
- b->prev = NULL;
+ b->prev = nullptr;
// go through all handles and store a pointer to the handle in the corresponding memory block
for (i=0; i < c->max_handles; i++)
@@ -1748,7 +1748,7 @@ static void gdraw_DefragmentMain(GDrawHandleCache *c, U32 flags, GDrawStats *sta
break;
}
- GFXALLOC_ASSERT(b != NULL); // didn't find this block anywhere!
+ GFXALLOC_ASSERT(b != nullptr); // didn't find this block anywhere!
}
// clear alloc hash table (we rebuild it during defrag)
@@ -1910,7 +1910,7 @@ static rrbool gdraw_CanDefragment(GDrawHandleCache *c)
static rrbool gdraw_MigrateResource(GDrawHandle *t, GDrawStats *stats)
{
GDrawHandleCache *c = t->cache;
- void *ptr = NULL;
+ void *ptr = nullptr;
assert(t->state == GDRAW_HANDLE_STATE_live || t->state == GDRAW_HANDLE_STATE_locked || t->state == GDRAW_HANDLE_STATE_pinned);
// anything we migrate should be in the "other" (old) pool
@@ -2300,7 +2300,7 @@ static void gdraw_bufring_init(gdraw_bufring * RADRESTRICT ring, void *ptr, U32
static void gdraw_bufring_shutdown(gdraw_bufring * RADRESTRICT ring)
{
- ring->cur = NULL;
+ ring->cur = nullptr;
ring->seg_size = 0;
}
@@ -2310,7 +2310,7 @@ static void *gdraw_bufring_alloc(gdraw_bufring * RADRESTRICT ring, U32 size, U32
gdraw_bufring_seg *seg;
if (size > ring->seg_size)
- return NULL; // nope, won't fit
+ return nullptr; // nope, won't fit
assert(align <= ring->align);
@@ -2415,7 +2415,7 @@ static rrbool gdraw_res_free_lru(GDrawHandleCache *c, GDrawStats *stats)
// was it referenced since end of previous frame (=in this frame)?
// if some, we're thrashing; report it to the user, but only once per frame.
if (c->prev_frame_end.value < r->fence.value && !c->is_thrashing) {
- IggyGDrawSendWarning(NULL, c->is_vertex ? "GDraw Thrashing vertex memory" : "GDraw Thrashing texture memory");
+ IggyGDrawSendWarning(nullptr, c->is_vertex ? "GDraw Thrashing vertex memory" : "GDraw Thrashing texture memory");
c->is_thrashing = true;
}
@@ -2435,8 +2435,8 @@ static GDrawHandle *gdraw_res_alloc_outofmem(GDrawHandleCache *c, GDrawHandle *t
{
if (t)
gdraw_HandleCacheAllocateFail(t);
- IggyGDrawSendWarning(NULL, c->is_vertex ? "GDraw Out of static vertex buffer %s" : "GDraw Out of texture %s", failed_type);
- return NULL;
+ IggyGDrawSendWarning(nullptr, c->is_vertex ? "GDraw Out of static vertex buffer %s" : "GDraw Out of texture %s", failed_type);
+ return nullptr;
}
#ifndef GDRAW_MANAGE_MEM
@@ -2445,7 +2445,7 @@ static GDrawHandle *gdraw_res_alloc_begin(GDrawHandleCache *c, S32 size, GDrawSt
{
GDrawHandle *t;
if (size > c->total_bytes)
- gdraw_res_alloc_outofmem(c, NULL, "memory (single resource larger than entire pool)");
+ gdraw_res_alloc_outofmem(c, nullptr, "memory (single resource larger than entire pool)");
else {
// given how much data we're going to allocate, throw out
// data until there's "room" (this basically lets us use
@@ -2453,7 +2453,7 @@ static GDrawHandle *gdraw_res_alloc_begin(GDrawHandleCache *c, S32 size, GDrawSt
// packing it and being exact)
while (c->bytes_free < size) {
if (!gdraw_res_free_lru(c, stats)) {
- gdraw_res_alloc_outofmem(c, NULL, "memory");
+ gdraw_res_alloc_outofmem(c, nullptr, "memory");
break;
}
}
@@ -2468,8 +2468,8 @@ static GDrawHandle *gdraw_res_alloc_begin(GDrawHandleCache *c, S32 size, GDrawSt
// we'd trade off cost of regenerating)
if (gdraw_res_free_lru(c, stats)) {
t = gdraw_HandleCacheAllocateBegin(c);
- if (t == NULL) {
- gdraw_res_alloc_outofmem(c, NULL, "handles");
+ if (t == nullptr) {
+ gdraw_res_alloc_outofmem(c, nullptr, "handles");
}
}
}
@@ -2513,7 +2513,7 @@ static void gdraw_res_kill(GDrawHandle *r, GDrawStats *stats)
{
GDRAW_FENCE_FLUSH(); // dead list is sorted by fence index - make sure all fence values are current.
- r->owner = NULL;
+ r->owner = nullptr;
gdraw_HandleCacheInsertDead(r);
gdraw_res_reap(r->cache, stats);
}
@@ -2521,11 +2521,11 @@ static void gdraw_res_kill(GDrawHandle *r, GDrawStats *stats)
static GDrawHandle *gdraw_res_alloc_begin(GDrawHandleCache *c, S32 size, GDrawStats *stats)
{
GDrawHandle *t;
- void *ptr = NULL;
+ void *ptr = nullptr;
gdraw_res_reap(c, stats); // NB this also does GDRAW_FENCE_FLUSH();
if (size > c->total_bytes)
- return gdraw_res_alloc_outofmem(c, NULL, "memory (single resource larger than entire pool)");
+ return gdraw_res_alloc_outofmem(c, nullptr, "memory (single resource larger than entire pool)");
// now try to allocate a handle
t = gdraw_HandleCacheAllocateBegin(c);
@@ -2537,7 +2537,7 @@ static GDrawHandle *gdraw_res_alloc_begin(GDrawHandleCache *c, S32 size, GDrawSt
gdraw_res_free_lru(c, stats);
t = gdraw_HandleCacheAllocateBegin(c);
if (!t)
- return gdraw_res_alloc_outofmem(c, NULL, "handles");
+ return gdraw_res_alloc_outofmem(c, nullptr, "handles");
}
// try to allocate first
diff --git a/Minecraft.Client/PS3/Iggy/include/gdraw.h b/Minecraft.Client/PS3/Iggy/include/gdraw.h
index 404a2642..7cc4ddd0 100644
--- a/Minecraft.Client/PS3/Iggy/include/gdraw.h
+++ b/Minecraft.Client/PS3/Iggy/include/gdraw.h
@@ -356,13 +356,13 @@ IDOC typedef struct GDrawPrimitive
IDOC typedef void RADLINK gdraw_draw_indexed_triangles(GDrawRenderState *r, GDrawPrimitive *prim, GDrawVertexBuffer *buf, GDrawStats *stats);
/* Draws a collection of indexed triangles, ignoring special filters or blend modes.
- If buf is NULL, then the pointers in 'prim' are machine pointers, and
+ If buf is nullptr, then the pointers in 'prim' are machine pointers, and
you need to make a copy of the data (note currently all triangles
implementing strokes (wide lines) go this path).
- If buf is non-NULL, then use the appropriate vertex buffer, and the
+ If buf is non-nullptr, then use the appropriate vertex buffer, and the
pointers in prim are actually offsets from the beginning of the
- vertex buffer -- i.e. offset = (char*) prim->whatever - (char*) NULL;
+ vertex buffer -- i.e. offset = (char*) prim->whatever - (char*) nullptr;
(note there are separate spaces for vertices and indices; e.g. the
first mesh in a given vertex buffer will normally have a 0 offset
for the vertices and a 0 offset for the indices)
@@ -455,7 +455,7 @@ IDOC typedef GDrawTexture * RADLINK gdraw_make_texture_end(GDraw_MakeTexture_Pro
/* Ends specification of a new texture.
$:info The same handle initially passed to $gdraw_make_texture_begin
- $:return Handle for the newly created texture, or NULL if an error occured
+ $:return Handle for the newly created texture, or nullptr if an error occured
*/
IDOC typedef rrbool RADLINK gdraw_update_texture_begin(GDrawTexture *tex, void *unique_id, GDrawStats *stats);
diff --git a/Minecraft.Client/PS3/Iggy/include/iggyexpruntime.h b/Minecraft.Client/PS3/Iggy/include/iggyexpruntime.h
index 1f1a90a1..a42ccbff 100644
--- a/Minecraft.Client/PS3/Iggy/include/iggyexpruntime.h
+++ b/Minecraft.Client/PS3/Iggy/include/iggyexpruntime.h
@@ -25,8 +25,8 @@ IDOC RADEXPFUNC HIGGYEXP RADEXPLINK IggyExpCreate(char *ip_address, S32 port, vo
$:storage A small block of storage that needed to store the $HIGGYEXP, must be at least $IGGYEXP_MIN_STORAGE
$:storage_size_in_bytes The size of the block pointer to by <tt>storage</tt>
-Returns a NULL HIGGYEXP if the IP address/hostname can't be resolved, or no Iggy Explorer
-can be contacted at the specified address/port. Otherwise returns a non-NULL $HIGGYEXP
+Returns a nullptr HIGGYEXP if the IP address/hostname can't be resolved, or no Iggy Explorer
+can be contacted at the specified address/port. Otherwise returns a non-nullptr $HIGGYEXP
which you can pass to $IggyUseExplorer. */
IDOC RADEXPFUNC void RADEXPLINK IggyExpDestroy(HIGGYEXP p);
diff --git a/Minecraft.Client/PS3/Iggy/include/rrCore.h b/Minecraft.Client/PS3/Iggy/include/rrCore.h
index e88b5f8c..17ebee3a 100644
--- a/Minecraft.Client/PS3/Iggy/include/rrCore.h
+++ b/Minecraft.Client/PS3/Iggy/include/rrCore.h
@@ -114,8 +114,8 @@
#define __RADLITTLEENDIAN__
#ifdef __i386__
#define __RADX86__
- #else
- #define __RADARM__
+ #else
+ #define __RADARM__
#endif
#define RADINLINE inline
#define RADRESTRICT __restrict
@@ -132,7 +132,7 @@
#define __RADX86__
#else
#error Unknown processor
-#endif
+#endif
#define __RADLITTLEENDIAN__
#define RADINLINE inline
#define RADRESTRICT __restrict
@@ -155,7 +155,7 @@
#define __RADNACL__
#define __RAD32__
#define __RADLITTLEENDIAN__
- #define __RADX86__
+ #define __RADX86__
#define RADINLINE inline
#define RADRESTRICT __restrict
@@ -196,7 +196,7 @@
#define __RAD64REGS__
#define __RADLITTLEENDIAN__
#define RADINLINE inline
- #define RADRESTRICT __restrict
+ #define RADRESTRICT __restrict
#undef RADSTRUCT
#define RADSTRUCT struct __attribute__((__packed__))
@@ -265,7 +265,7 @@
#endif
#undef RADSTRUCT
#define RADSTRUCT struct __attribute__((__packed__))
-
+
#elif defined(CAFE) // has to be before HOLLYWOOD_REV since it also defines it
#define __RADWIIU__
@@ -480,7 +480,7 @@
#undef RADRESTRICT /* could have been defined above... */
#define RADRESTRICT __restrict
-
+
#undef RADSTRUCT
#define RADSTRUCT struct __attribute__((__packed__))
#endif
@@ -885,7 +885,7 @@
#define RAD_ALIGN(type,var,num) type __declspec(align(num)) var
#else
// NOTE: / / is a guaranteed parse error in C/C++.
- #define RAD_ALIGN(type,var,num) RAD_ALIGN_USED_BUT_NOT_DEFINED / /
+ #define RAD_ALIGN(type,var,num) RAD_ALIGN_USED_BUT_NOT_DEFINED / /
#endif
// WARNING : RAD_TLS should really only be used for debug/tools stuff
@@ -917,8 +917,8 @@
#define RAD_S32 signed int
// But pointers are 64 bits.
#if (_MSC_VER >= 1300 && defined(_Wp64) && _Wp64 )
- #define RAD_SINTa __w64 signed __int64
- #define RAD_UINTa __w64 unsigned __int64
+ #define RAD_SINTa __w64 signed long long
+ #define RAD_UINTa __w64 unsigned long long
#else // non-vc.net compiler or /Wp64 turned off
#define RAD_UINTa unsigned long long
#define RAD_SINTa signed long long
@@ -976,8 +976,8 @@
#define RAD_U64 unsigned long long
#define RAD_S64 signed long long
#elif defined(__RADX64__) || defined(__RAD32__)
- #define RAD_U64 unsigned __int64
- #define RAD_S64 signed __int64
+ #define RAD_U64 unsigned long long
+ #define RAD_S64 signed long long
#else
// 16-bit
typedef RADSTRUCT RAD_U64 // do this so that we don't accidentally use U64s
@@ -1134,7 +1134,7 @@
// helpers for doing an if ( ) with expect :
// if ( RAD_LIKELY(expr) ) { ... }
-
+
#define RAD_LIKELY(expr) RAD_EXPECT(expr,1)
#define RAD_UNLIKELY(expr) RAD_EXPECT(expr,0)
@@ -1324,7 +1324,7 @@
__pragma(warning(push)) \
__pragma(warning(disable:4127)) \
} while(0) \
- __pragma(warning(pop))
+ __pragma(warning(pop))
#define RAD_STATEMENT_END_TRUE \
__pragma(warning(push)) \
@@ -1333,10 +1333,10 @@
__pragma(warning(pop))
#else
- #define RAD_USE_STANDARD_LOOP_CONSTRUCT
+ #define RAD_USE_STANDARD_LOOP_CONSTRUCT
#endif
#else
- #define RAD_USE_STANDARD_LOOP_CONSTRUCT
+ #define RAD_USE_STANDARD_LOOP_CONSTRUCT
#endif
#ifdef RAD_USE_STANDARD_LOOP_CONSTRUCT
@@ -1345,7 +1345,7 @@
#define RAD_STATEMENT_END_FALSE \
} while ( (void)0,0 )
-
+
#define RAD_STATEMENT_END_TRUE \
} while ( (void)1,1 )
@@ -1355,7 +1355,7 @@
RAD_STATEMENT_START \
code \
RAD_STATEMENT_END_FALSE
-
+
#define RAD_INFINITE_LOOP( code ) \
RAD_STATEMENT_START \
code \
@@ -1363,7 +1363,7 @@
// Must be placed after variable declarations for code compiled as .c
-#if defined(_MSC_VER) && _MSC_VER >= 1700 // in 2012 aka 11.0 and later
+#if defined(_MSC_VER) && _MSC_VER >= 1700 // in 2012 aka 11.0 and later
# define RR_UNUSED_VARIABLE(x) (void) x
#else
# define RR_UNUSED_VARIABLE(x) (void)(sizeof(x))
@@ -1473,7 +1473,7 @@
// just to make gcc shut up about derefing null :
#define RR_MEMBER_OFFSET_PTR(type,member,ptr) ( (SINTa) &(((type *)(ptr))->member) - (SINTa)(ptr) )
#define RR_MEMBER_SIZE_PTR(type,member,ptr) ( sizeof( ((type *) (ptr))->member) )
-
+
// MEMBER_TO_OWNER takes a pointer to a member and gives you back the base of the object
// you should then RR_ASSERT( &(ret->member) == ptr );
#define RR_MEMBER_TO_OWNER(type,member,ptr) (type *)( ((char *)(ptr)) - RR_MEMBER_OFFSET_PTR(type,member,ptr) )
@@ -1482,7 +1482,7 @@
// Cache / prefetch macros :
// RR_PREFETCH for various platforms :
-//
+//
// RR_PREFETCH_SEQUENTIAL : prefetch memory for reading in a sequential scan
// platforms that automatically prefetch sequential (eg. PC) should be a no-op here
// RR_PREFETCH_WRITE_INVALIDATE : prefetch memory for writing - contents of memory are undefined
@@ -1707,7 +1707,7 @@ extern fp_rrDisplayAssertion * g_fp_rrDisplayAssertion;
#define rrDisplayAssertion(i,n,l,f,m) ( ( g_fp_rrDisplayAssertion ) ? (*g_fp_rrDisplayAssertion)(i,n,l,f,m) : 1 )
//-----------------------------------------------------------
-
+
// RAD_NO_BREAK : option if you don't like your assert to break
// CB : RR_BREAK is *always* a break ; RR_ASSERT_BREAK is optional
#ifdef RAD_NO_BREAK
@@ -1725,7 +1725,7 @@ extern fp_rrDisplayAssertion * g_fp_rrDisplayAssertion;
#define RR_ASSERT_LITE_ALWAYS(exp) RAD_STATEMENT_WRAPPER( if ( ! (exp) ) { RR_ASSERT_BREAK(); } )
//-----------------------------------
-#ifdef RR_DO_ASSERTS
+#ifdef RR_DO_ASSERTS
#define RR_ASSERT(exp) RR_ASSERT_ALWAYS(exp)
#define RR_ASSERT_LITE(exp) RR_ASSERT_LITE_ALWAYS(exp)
@@ -1883,7 +1883,7 @@ unsigned long __cdecl _byteswap_ulong (unsigned long _Long);
#define RR_BSWAP16 _byteswap_ushort
#define RR_BSWAP32 _byteswap_ulong
-unsigned __int64 __cdecl _byteswap_uint64 (unsigned __int64 val);
+unsigned long long __cdecl _byteswap_uint64 (unsigned long long val);
#pragma intrinsic(_byteswap_uint64)
#define RR_BSWAP64 _byteswap_uint64
@@ -1909,7 +1909,7 @@ RADFORCEINLINE unsigned long RR_BSWAP32 (unsigned long _Long)
return _Long;
}
-RADFORCEINLINE unsigned __int64 RR_BSWAP64 (unsigned __int64 _Long)
+RADFORCEINLINE unsigned long long RR_BSWAP64 (unsigned long long _Long)
{
__asm {
mov eax, DWORD PTR _Long
@@ -2250,10 +2250,10 @@ void __storewordbytereverse (unsigned int val, int offset, void *bas
#if ( defined(_MSC_VER) && _MSC_VER >= 1300)
-unsigned __int64 __cdecl _rotl64(unsigned __int64 _Val, int _Shift);
+unsigned long long __cdecl _rotl64(unsigned long long _Val, int _Shift);
#pragma intrinsic(_rotl64)
-#define RR_ROTL64(x,k) _rotl64((unsigned __int64)(x),(int)(k))
+#define RR_ROTL64(x,k) _rotl64((unsigned long long)(x),(int)(k))
#elif defined(__RADCELL__)
@@ -2262,7 +2262,7 @@ unsigned __int64 __cdecl _rotl64(unsigned __int64 _Val, int _Shift);
#elif defined(__RADLINUX__) || defined(__RADMACAPI__)
-//APTODO: Just to compile linux. Should we be doing better than this? If not, combine with above.
+//APTODO: Just to compile linux. Should we be doing better than this? If not, combine with above.
#define RR_ROTL64(u64,num) ( ( (u64) << (num) ) | ( (u64) >> (64 - (num))) )
#else
diff --git a/Minecraft.Client/PS3/Leaderboards/PS3LeaderboardManager.cpp b/Minecraft.Client/PS3/Leaderboards/PS3LeaderboardManager.cpp
index 38380bfb..27406186 100644
--- a/Minecraft.Client/PS3/Leaderboards/PS3LeaderboardManager.cpp
+++ b/Minecraft.Client/PS3/Leaderboards/PS3LeaderboardManager.cpp
@@ -30,7 +30,7 @@ PS3LeaderboardManager::PS3LeaderboardManager()
m_myXUID = INVALID_XUID;
- m_scores = NULL; //m_stats = NULL;
+ m_scores = nullptr; //m_stats = nullptr;
m_statsType = eStatsType_Kills;
m_difficulty = 0;
@@ -42,7 +42,7 @@ PS3LeaderboardManager::PS3LeaderboardManager()
InitializeCriticalSection(&m_csViewsLock);
m_running = false;
- m_threadScoreboard = NULL;
+ m_threadScoreboard = nullptr;
}
PS3LeaderboardManager::~PS3LeaderboardManager()
@@ -196,7 +196,7 @@ bool PS3LeaderboardManager::getScoreByIds()
CellRtcTick last_sort_date;
SceNpScoreRankNumber mTotalRecord;
- SceNpId *npIds = NULL;
+ SceNpId *npIds = nullptr;
int ret;
@@ -246,7 +246,7 @@ bool PS3LeaderboardManager::getScoreByIds()
sceNpScoreDestroyTransactionCtx(ret);
- if (npIds != NULL) delete [] npIds;
+ if (npIds != nullptr) delete [] npIds;
return false;
}
else if (ret < 0)
@@ -256,7 +256,7 @@ bool PS3LeaderboardManager::getScoreByIds()
m_eStatsState = eStatsState_Failed;
- if (npIds != NULL) delete [] npIds;
+ if (npIds != nullptr) delete [] npIds;
return false;
}
else
@@ -270,7 +270,7 @@ bool PS3LeaderboardManager::getScoreByIds()
comments = new SceNpScoreComment[num];
/* app.DebugPrintf("sceNpScoreGetRankingByNpId(\n\t transaction=%i,\n\t boardID=0,\n\t npId=%i,\n\t friendCount*sizeof(SceNpId)=%i*%i=%i,\
- rankData=%i,\n\t friendCount*sizeof(SceNpScorePlayerRankData)=%i,\n\t NULL, 0, NULL, 0,\n\t friendCount=%i,\n...\n",
+ rankData=%i,\n\t friendCount*sizeof(SceNpScorePlayerRankData)=%i,\n\t nullptr, 0, nullptr, 0,\n\t friendCount=%i,\n...\n",
transaction, npId, friendCount, sizeof(SceNpId), friendCount*sizeof(SceNpId),
rankData, friendCount*sizeof(SceNpScorePlayerRankData), friendCount
); */
@@ -285,14 +285,14 @@ bool PS3LeaderboardManager::getScoreByIds()
comments, sizeof(SceNpScoreComment) * num, //OUT: Comments
- NULL, 0, // GameData. (unused)
+ nullptr, 0, // GameData. (unused)
num,
&last_sort_date,
&mTotalRecord,
- NULL // Reserved, specify null.
+ nullptr // Reserved, specify null.
);
if (ret == SCE_NP_COMMUNITY_ERROR_ABORTED)
@@ -319,7 +319,7 @@ bool PS3LeaderboardManager::getScoreByIds()
delete [] comments;
delete [] npIds;
- m_scores = NULL;
+ m_scores = nullptr;
m_readCount = 0;
m_maxRank = num;
@@ -335,7 +335,7 @@ bool PS3LeaderboardManager::getScoreByIds()
m_readCount = num;
// Filter scorers and construct output structure.
- if (m_scores != NULL) delete [] m_scores;
+ if (m_scores != nullptr) delete [] m_scores;
m_scores = new ReadScore[m_readCount];
convertToOutput(m_readCount, m_scores, ptr, comments);
m_maxRank = m_readCount;
@@ -368,7 +368,7 @@ error3:
delete [] ptr;
delete [] comments;
error2:
- if (npIds != NULL) delete [] npIds;
+ if (npIds != nullptr) delete [] npIds;
error1:
if (m_eStatsState != eStatsState_Canceled) m_eStatsState = eStatsState_Failed;
app.DebugPrintf("[LeaderboardManger] getScoreByIds() FAILED, ret=0x%X\n", ret);
@@ -422,14 +422,14 @@ bool PS3LeaderboardManager::getScoreByRange()
comments, sizeof(SceNpScoreComment) * num, //OUT: Comment Data
- NULL, 0, // GameData.
+ nullptr, 0, // GameData.
num,
&last_sort_date,
&m_maxRank, // 'Total number of players registered in the target scoreboard.'
- NULL // Reserved, specify null.
+ nullptr // Reserved, specify null.
);
if (ret == SCE_NP_COMMUNITY_ERROR_ABORTED)
@@ -454,7 +454,7 @@ bool PS3LeaderboardManager::getScoreByRange()
delete [] ptr;
delete [] comments;
- m_scores = NULL;
+ m_scores = nullptr;
m_readCount = 0;
m_eStatsState = eStatsState_Ready;
@@ -472,7 +472,7 @@ bool PS3LeaderboardManager::getScoreByRange()
//m_stats = ptr; //Maybe: addPadding(num,ptr);
- if (m_scores != NULL) delete [] m_scores;
+ if (m_scores != nullptr) delete [] m_scores;
m_readCount = ret;
m_scores = new ReadScore[m_readCount];
for (int i=0; i<m_readCount; i++)
@@ -558,11 +558,11 @@ bool PS3LeaderboardManager::setScore()
rscore.m_score, //IN: new score,
&comment, // Comments
- NULL, // GameInfo
+ nullptr, // GameInfo
&tmp, //OUT: current rank,
- NULL // Reserved, specify null.
+ nullptr // Reserved, specify null.
);
if (ret==SCE_NP_COMMUNITY_SERVER_ERROR_NOT_BEST_SCORE) //0x8002A415
@@ -600,7 +600,7 @@ void PS3LeaderboardManager::Tick()
{
case eStatsState_Ready:
{
- assert(m_scores != NULL || m_readCount == 0);
+ assert(m_scores != nullptr || m_readCount == 0);
view.m_numQueries = m_readCount;
view.m_queries = m_scores;
@@ -612,7 +612,7 @@ void PS3LeaderboardManager::Tick()
if (view.m_numQueries > 0)
ret = eStatsReturn_Success;
- if (m_readListener != NULL)
+ if (m_readListener != nullptr)
{
app.DebugPrintf("[LeaderboardManager] OnStatsReadComplete(%i, %i, _), m_readCount=%i.\n", ret, m_maxRank, m_readCount);
m_readListener->OnStatsReadComplete(ret, m_maxRank, view);
@@ -621,16 +621,16 @@ void PS3LeaderboardManager::Tick()
m_eStatsState = eStatsState_Idle;
delete [] m_scores;
- m_scores = NULL;
+ m_scores = nullptr;
}
break;
case eStatsState_Failed:
{
view.m_numQueries = 0;
- view.m_queries = NULL;
+ view.m_queries = nullptr;
- if ( m_readListener != NULL )
+ if ( m_readListener != nullptr )
m_readListener->OnStatsReadComplete(eStatsReturn_NetworkError, 0, view);
m_eStatsState = eStatsState_Idle;
@@ -652,7 +652,7 @@ bool PS3LeaderboardManager::OpenSession()
{
if (m_openSessions == 0)
{
- if (m_threadScoreboard == NULL)
+ if (m_threadScoreboard == nullptr)
{
m_threadScoreboard = new C4JThread(&scoreboardThreadEntry, this, "4JScoreboard");
m_threadScoreboard->SetProcessor(CPU_CORE_LEADERBOARDS);
@@ -747,7 +747,7 @@ void PS3LeaderboardManager::FlushStats() {}
void PS3LeaderboardManager::CancelOperation()
{
- m_readListener = NULL;
+ m_readListener = nullptr;
m_eStatsState = eStatsState_Canceled;
if (m_transactionCtx != 0)
@@ -897,7 +897,7 @@ void PS3LeaderboardManager::fromBase32(void *out, SceNpScoreComment *in)
for (int i = 0; i < SCE_NP_SCORE_COMMENT_MAXLEN; i++)
{
ch[0] = in->data[i];
- unsigned char fivebits = strtol(ch, NULL, 32) << 3;
+ unsigned char fivebits = strtol(ch, nullptr, 32) << 3;
int sByte = (i*5) / 8;
int eByte = (5+(i*5)) / 8;
@@ -958,7 +958,7 @@ bool PS3LeaderboardManager::test_string(string testing)
int ctx = sceNpScoreCreateTransactionCtx(m_titleContext);
if (ctx<0) return false;
- int ret = sceNpScoreCensorComment(ctx, (const void *) &comment, NULL);
+ int ret = sceNpScoreCensorComment(ctx, (const void *) &comment, nullptr);
if (ret == SCE_NP_COMMUNITY_SERVER_ERROR_CENSORED)
{
diff --git a/Minecraft.Client/PS3/Media/splashes.txt b/Minecraft.Client/PS3/Media/splashes.txt
index 7f7835c6..df4a4be1 100644
--- a/Minecraft.Client/PS3/Media/splashes.txt
+++ b/Minecraft.Client/PS3/Media/splashes.txt
@@ -43,7 +43,7 @@ Dungeon!
Exclusive!
The bee's knees!
Down with O.P.P.!
-Closed source!
+Closed source xD!
Classy!
Wow!
Not on steam!
diff --git a/Minecraft.Client/PS3/Miles/include/mss.h b/Minecraft.Client/PS3/Miles/include/mss.h
index 531dcbc9..8fe0a74d 100644
--- a/Minecraft.Client/PS3/Miles/include/mss.h
+++ b/Minecraft.Client/PS3/Miles/include/mss.h
@@ -39,7 +39,7 @@
// doc system stuff
#ifndef EXPAPI
-#define EXPAPI
+#define EXPAPI
#endif
#ifndef EXPTYPE
#define EXPTYPE
@@ -69,10 +69,10 @@
// For docs
EXPGROUP(_NullGroup)
#define MilesVersion "9.3m" EXPMACRO
-#define MilesMajorVersion 9 EXPMACRO
+#define MilesMajorVersion 9 EXPMACRO
#define MilesMinorVersion 3 EXPMACRO
-#define MilesBuildNumber 11 EXPMACRO
-#define MilesCustomization 0 EXPMACRO
+#define MilesBuildNumber 11 EXPMACRO
+#define MilesCustomization 0 EXPMACRO
EXPGROUP(_RootGroup)
@@ -273,14 +273,14 @@ typedef void VOIDFUNC(void);
//================
EXPGROUP(Basic Types)
-#define AILCALL EXPTAG(AILCALL)
+#define AILCALL EXPTAG(AILCALL)
/*
Internal calling convention that all external Miles functions use.
Usually cdecl or stdcall on Windows.
*/
-#define AILCALLBACK EXPTAG(AILCALLBACK docproto)
+#define AILCALLBACK EXPTAG(AILCALLBACK docproto)
/*
Calling convention that user supplied callbacks <b>from</b> Miles use.
@@ -326,7 +326,7 @@ RADDEFSTART
typedef CHAR *LPSTR, *PSTR;
#ifdef IS_WIN64
- typedef unsigned __int64 ULONG_PTR, *PULONG_PTR;
+ typedef unsigned long long ULONG_PTR, *PULONG_PTR;
#else
#ifdef _Wp64
#if !defined(__midl) && (defined(_X86_) || defined(_M_IX86)) && _MSC_VER >= 1300
@@ -348,13 +348,13 @@ RADDEFSTART
typedef struct HWAVEOUT__ *HWAVEOUT;
typedef HWAVEIN *LPHWAVEIN;
typedef HWAVEOUT *LPHWAVEOUT;
-
+
#ifndef WAVE_MAPPER
#define WAVE_MAPPER ((UINT)-1)
#endif
typedef struct waveformat_tag *LPWAVEFORMAT;
-
+
typedef struct HMIDIOUT__ *HMIDIOUT;
typedef HMIDIOUT *LPHMIDIOUT;
typedef struct HWND__ *HWND;
@@ -368,9 +368,9 @@ RADDEFSTART
// If compiling MSS DLL, use __declspec(dllexport) for both
// declarations and definitions
//
-
+
#ifdef IS_WIN32
-
+
#if !defined(FORNONWIN) && !defined(__RADNTBUILDLINUX__)
#define AILLIBCALLBACK __stdcall
#define AILCALL __stdcall
@@ -382,20 +382,20 @@ RADDEFSTART
#define AILCALLBACK __cdecl
#define AILEXPORT __cdecl
#endif
-
+
#ifdef __RADINDLL__
#define DXDEC __declspec(dllexport)
#define DXDEF __declspec(dllexport)
#else
-
+
#if defined( __BORLANDC__ ) || defined( MSS_SPU_PROCESS )
#define DXDEC extern
#else
#define DXDEC __declspec(dllimport)
#endif
-
+
#endif
-
+
#ifdef IS_WIN64
#define MSSDLLNAME "MSS64.DLL"
#define MSS_REDIST_DIR_NAME "redist64"
@@ -403,11 +403,11 @@ RADDEFSTART
#define MSSDLLNAME "MSS32.DLL"
#define MSS_REDIST_DIR_NAME "redist"
#endif
-
+
#define MSS_DIR_SEP "\\"
#define MSS_DIR_UP ".." MSS_DIR_SEP
#define MSS_DIR_UP_TWO MSS_DIR_UP MSS_DIR_UP
-
+
#endif
typedef void * LPVOID;
@@ -420,7 +420,7 @@ RADDEFSTART
#define AILLIBCALLBACK
#define AILCALL
#define AILEXPORT
- #define AILCALLBACK
+ #define AILCALLBACK
#elif defined(__RADX86__)
#define AILLIBCALLBACK __attribute__((cdecl))
#define AILCALL __attribute__((cdecl))
@@ -437,7 +437,7 @@ RADDEFSTART
#define DXDEC extern
#define DXDEF
#endif
-
+
#ifdef __RADX64__
#define MSS_REDIST_DIR_NAME "redist/x64"
#elif defined(IS_X86)
@@ -447,7 +447,7 @@ RADDEFSTART
#else
#error "No Redist Dir Specified"
#endif
-
+
#define MSS_DIR_SEP "/"
#define MSS_DIR_UP ".." MSS_DIR_SEP
#define MSS_DIR_UP_TWO MSS_DIR_UP MSS_DIR_UP
@@ -714,7 +714,7 @@ typedef enum
#ifndef FILE_ERRS
#define FILE_ERRS
-
+
#define AIL_NO_ERROR 0
#define AIL_IO_ERROR 1
#define AIL_OUT_OF_MEMORY 2
@@ -736,9 +736,9 @@ EXPTYPEBEGIN typedef SINTa HMSSENUM;
EXPTYPEEND
/*
specifies a type used to enumerate through a list of properties.
-
+
$:MSS_FIRST use this value to start the enumeration process.
-
+
The Miles enumeration functions all work similarly - you set a local variable of type HMSSENUM to MSS_FIRST and then call
the enumeration function until it returns 0.
@@ -751,7 +751,7 @@ the enumeration function until it returns 0.
// Preference names and default values
//
-#define AIL_MM_PERIOD 0
+#define AIL_MM_PERIOD 0
#define DEFAULT_AMP 1 // Default MM timer period = 5 msec.
#define AIL_TIMERS 1
@@ -1877,7 +1877,7 @@ typedef struct _S3DSTATE // Portion of HSAMPLE that deals with 3D posi
F32 lowpass_3D; // low pass cutoff computed by falloff graph. -1 if not affected.
F32 spread;
-
+
HSAMPLE owner; // May be NULL if used for temporary/internal calculations
AILFALLOFFCB falloff_function; // User function for min/max distance calculations, if desired
@@ -1915,7 +1915,7 @@ typedef struct _SAMPLE // Sample instance
S32 index; // Numeric index of this sample
SMPBUF buf[8]; // Source data buffers
-
+
U32 src_fract; // Fractional part of source address
U32 mix_delay; // ms until start mixing (decreased every buffer mix)
@@ -1924,7 +1924,7 @@ typedef struct _SAMPLE // Sample instance
U64 mix_bytes; // total number of bytes sent to the mixer for this sample.
S32 group_id; // ID for grouped operations.
-
+
// size of the next dynamic arrays
U32 chan_buf_alloced;
U32 chan_buf_used;
@@ -1946,10 +1946,10 @@ typedef struct _SAMPLE // Sample instance
// these are dynamic arrays
F32 *auto_3D_channel_levels; // Channel levels set by 3D positioner (always 1.0 if not 3D-positioned)
F32 *speaker_levels; // one level per speaker (multiplied after user or 3D)
-
+
S8 *speaker_enum_to_source_chan; // array[MSS_SPEAKER_xx] = -1 if not present, else channel #
// 99% of the time this is a 1:1 mapping and is zero.
-
+
S32 lp_any_on; // are any of the low pass filters on?
S32 user_channels_need_deinterlace; // do any of the user channels require a stereo sample to be deinterlaced?
@@ -1989,7 +1989,7 @@ typedef struct _SAMPLE // Sample instance
U32 low_pass_changed; // bit mask for what channels changed.
-
+
S32 bus; // Bus assignment for this sample.
S32 bus_comp_sends; // Which buses this bus routes compressor input to.
S32 bus_comp_installed; // Nonzero if we have a compressor installed.
@@ -2042,7 +2042,7 @@ typedef struct _SAMPLE // Sample instance
SPINFO pipeline[N_SAMPLE_STAGES];
S32 n_active_filters; // # of SP_FILTER_n stages active
-
+
//
// 3D-related state for all platforms (including Xbox)
//
@@ -2113,14 +2113,14 @@ DXDEC void AILCALL AIL_serve(void);
#ifdef IS_MAC
typedef void * LPSTR;
-
+
#define WHDR_DONE 0
-
+
typedef struct _WAVEIN
{
long temp;
} * HWAVEIN;
-
+
typedef struct _WAVEHDR
{
S32 dwFlags;
@@ -2133,7 +2133,7 @@ DXDEC void AILCALL AIL_serve(void);
S32 dwLoops;
void * lpNext;
U32 * reserved;
-
+
} WAVEHDR, * LPWAVEHDR;
#endif
@@ -2145,7 +2145,7 @@ typedef struct _DIG_INPUT_DRIVER *HDIGINPUT; // Handle to digital input driver
#ifdef IS_MAC
#define AIL_DIGITAL_INPUT_DEFAULT 0
-
+
typedef struct _DIG_INPUT_DRIVER // Handle to digital input driver
{
U32 tag; // HDIN
@@ -2478,7 +2478,7 @@ typedef struct _DIG_DRIVER // Handle to digital audio driver
U32 last_ds_play;
U32 last_ds_write;
U32 last_ds_move;
-
+
#endif
#ifdef IS_X86
@@ -2661,7 +2661,7 @@ typedef struct _SEQUENCE // XMIDI sequence state table
void const *EVNT;
U8 const *EVNT_ptr; // Current event pointer
-
+
U8 *ICA; // Indirect Controller Array
AILPREFIXCB prefix_callback; // XMIDI Callback Prefix handler
@@ -3121,13 +3121,13 @@ DXDEC S32 AILCALL AIL_timer_thread_handle(void* o_handle);
#elif defined(__RADANDROID__)
DXDEC void AILCALL AIL_set_asset_manager(void* asset_manager);
-
+
DXDEC RADSS_OPEN_FUNC AILCALL RADSS_SLESInstallDriver(UINTa, UINTa);
#define AIL_open_digital_driver(frequency, bits, channel, flags) \
AIL_open_generic_digital_driver(frequency, bits, channel, flags, RADSS_SLESInstallDriver(0, 0))
-
+
#elif defined(IS_PSP2)
DXDEC RADSS_OPEN_FUNC AILCALL RADSS_PSP2InstallDriver(UINTa, UINTa);
@@ -3221,7 +3221,7 @@ DXDEC S32 AILCALL AIL_digital_handle_reacquire
{
Str255 version_name;
} MSS_VersionType;
-
+
#define AIL_MSS_version(str,len) \
{ \
long _res = HOpenResFile(0,0,"\p" MSSDLLNAME,fsRdPerm); \
@@ -3269,11 +3269,11 @@ DXDEC S32 AILCALL AIL_digital_handle_reacquire
} \
} \
}
-
+
#endif
DXDEC S32 AILCALL AIL_digital_handle_release(HDIGDRIVER drvr);
-
+
DXDEC S32 AILCALL AIL_digital_handle_reacquire
(HDIGDRIVER drvr);
@@ -3339,18 +3339,18 @@ DXDEC EXPAPI void AILCALL AIL_push_system_state(HDIGDRIVER dig, U32 flags, S16 c
$* <b>MILES_PUSH_VOLUME</b> - When present, master volume will be affected in addition to sample state.
If MILES_PUSH_RESET is present, the master volume will be set to 1.0f, otherwise it will be retained and only
- affected when popped.
+ affected when popped.
$-
- If you want more control over whether a sample will be affected by a push or a pop operation,
+ If you want more control over whether a sample will be affected by a push or a pop operation,
see $AIL_set_sample_level_mask.
-
+
*/
DXDEC EXPAPI void AILCALL AIL_pop_system_state(HDIGDRIVER dig, S16 crossfade_ms);
/*
- Pops the current system state and returns the system to the way it
+ Pops the current system state and returns the system to the way it
was before the last push.
$:dig The driver to pop.
@@ -3374,7 +3374,7 @@ DXDEC EXPAPI void AILCALL AIL_set_sample_level_mask(HSAMPLE S, U8 mask);
$:S The sample to set the mask for.
$:mask The bitmask of levels for which the sample will play.
- Under normal push/pop operations, a sample's mask is set when it is
+ Under normal push/pop operations, a sample's mask is set when it is
started to the level the system is at. If the system is pushed
without a reset, then the mask is adjusted to include the new level.
When a system is popped, if the sample is going to continue playing,
@@ -3435,7 +3435,7 @@ DXDEC EXPAPI HSAMPLE AILCALL AIL_allocate_bus(HDIGDRIVER dig);
$:return The HSAMPLE for the new bus.
A bus allows you to treat a group of samples as one sample. With the bus sample you can
- do almost all of the things you can do with a normal sample handle. The only exception
+ do almost all of the things you can do with a normal sample handle. The only exception
is you can't adjust the playback rate of the sample.
Use $AIL_bus_sample_handle to get the HSAMPLE associated with a bus.
@@ -3495,7 +3495,7 @@ DXDEC EXPAPI S32 AILCALL AIL_sample_bus(HSAMPLE S);
DXDEC EXPAPI S32 AILCALL AIL_install_bus_compressor(HDIGDRIVER dig, S32 bus_index, SAMPLESTAGE filter_stage, S32 input_bus_index);
/*
- Installs the Compressor filter on to a bus, using another bus as the input for
+ Installs the Compressor filter on to a bus, using another bus as the input for
compression/limiting.
$:dig The driver the busses exist on.
@@ -3508,7 +3508,7 @@ DXDEC EXPAPI S32 AILCALL AIL_install_bus_compressor(HDIGDRIVER dig, S32 bus_inde
its signal strength to the filter, allowing it to attenuate the bus_index bus based
on another bus's contents.
- To control the compressor parameters, access the bus's HSAMPLE via $AIL_bus_sample_handle and
+ To control the compressor parameters, access the bus's HSAMPLE via $AIL_bus_sample_handle and
use $AIL_sample_stage_property exactly as you would any other filter. The filter's properties
are documented under $(Compressor Filter)
*/
@@ -4325,7 +4325,7 @@ typedef void (AILCALLBACK* AILSTREAMCB) (HSTREAM stream);
#define MSS_STREAM_CHUNKS 8
-typedef struct _STREAM
+typedef struct _STREAM
{
S32 block_oriented; // 1 if this is an ADPCM or ASI-compressed stream
S32 using_ASI; // 1 if using ASI decoder to uncompress stream data
@@ -4349,7 +4349,7 @@ typedef struct _STREAM
S32 read_IO_index; // index of buffer to be loaded into Miles next
S32 bufsize; // size of each buffer
-
+
U32 datarate; // datarate in bytes per second
S32 filerate; // original datarate of the file
S32 filetype; // file format type
@@ -4987,7 +4987,7 @@ typedef struct
OGG_INFO;
DXDEC void AILCALL AIL_inspect_Ogg (OGG_INFO *inspection_state,
- U8 *Ogg_file_image,
+ U8 *Ogg_file_image,
S32 Ogg_file_size);
DXDEC S32 AILCALL AIL_enumerate_Ogg_pages (OGG_INFO *inspection_state);
@@ -5102,10 +5102,10 @@ DXDEC HDIGDRIVER AILCALL AIL_primary_digital_driver (HDIGDRIVER new_primary);
// 3D-related calls
//
-DXDEC S32 AILCALL AIL_room_type (HDIGDRIVER dig,
+DXDEC S32 AILCALL AIL_room_type (HDIGDRIVER dig,
S32 bus_index);
-DXDEC void AILCALL AIL_set_room_type (HDIGDRIVER dig,
+DXDEC void AILCALL AIL_set_room_type (HDIGDRIVER dig,
S32 bus_index,
S32 room_type);
@@ -5180,7 +5180,7 @@ DXDEC EXPAPI void AILCALL AIL_set_sample_3D_lowpass_falloff(HSAMPLE S, MSS
$:graph The array of points to use as the graph.
$:pointcount The number of points passed in. Must be less than or equal to MILES_MAX_FALLOFF_GRAPH_POINTS. Passing 0 removes the graph.
- This marks a sample as having a low pass cutoff that varies as a function of distance to the listener. If
+ This marks a sample as having a low pass cutoff that varies as a function of distance to the listener. If
a sample has such a graph, $AIL_set_sample_low_pass_cut_off will be called constantly, and thus shouldn't be
called otherwise.
@@ -5195,8 +5195,8 @@ DXDEC EXPAPI void AILCALL AIL_set_sample_3D_exclusion_falloff(HSAMPLE S, M
$:graph The array of points to use as the graph.
$:pointcount The number of points passed in. Must be less than or equal to MILES_MAX_FALLOFF_GRAPH_POINTS. Passing 0 removes the graph.
- This marks a sample as having an exclusion that varies as a function of distance to the listener. If
- a sample has such a graph, auto_3D_wet_atten will be disabled to prevent double affects, as exclusion
+ This marks a sample as having an exclusion that varies as a function of distance to the listener. If
+ a sample has such a graph, auto_3D_wet_atten will be disabled to prevent double affects, as exclusion
affects reverb wet level.
The graph is evaluated the same as $AIL_set_sample_3D_volume_falloff.
@@ -5230,7 +5230,7 @@ DXDEC EXPAPI void AILCALL AIL_set_sample_3D_position_segments(HSAMPLE S, MSSVECT
other computations (cones, falloffs, etc). Spatialization is done using all segments as a directional
source.
- If there is neither spread falloff nor volume falloff specified, spread will be automatically applied
+ If there is neither spread falloff nor volume falloff specified, spread will be automatically applied
when the listener is within min_distance to the closest point. See $AIL_set_sample_3D_spread_falloff
and $AIL_set_sample_3D_volume_falloff.
@@ -5243,7 +5243,7 @@ DXDEC EXPAPI void AILCALL AIL_set_sample_3D_spread(HSAMPLE S, F32 spread);
$:S Sample to affect.
$:spread The value to set the spread to.
- Spread is how much the directionality of a sample "spreads" to more speakers - emulating
+ Spread is how much the directionality of a sample "spreads" to more speakers - emulating
the effect a sound has when it occupies more than a point source. For instance, a sound
point source that sits directly to the left of the listener would have a very strong left
speaker signal, and a fairly weak right speaker signal. Via spread, the signal would be
@@ -5392,7 +5392,7 @@ EXPGROUP(Miles High Level Event System)
EXPTYPE typedef struct MSSSOUNDBANK {};
/*
Internal structure.
-
+
Use $HMSOUNDBANK instead.
*/
@@ -5401,7 +5401,7 @@ EXPTYPE typedef struct MSSSOUNDBANK {};
EXPTYPE typedef struct SoundBank *HMSOUNDBANK;
/*
Describes a handle to an open sound bank.
-
+
This handle typedef refers to an open soundbank which is usually obtained from the $AIL_add_soundbank function.
*/
@@ -5424,7 +5424,7 @@ DXDEC EXPAPI void AILCALL AIL_close_soundbank(HMSOUNDBANK bank);
Close a soundbank previously opened with $AIL_open_soundbank.
$:bank Soundbank to close.
-
+
Close a soundbank previously opened with $AIL_open_soundbank. Presets/events loaded from
this soundbank are no longer valid.
*/
@@ -5448,7 +5448,7 @@ DXDEC EXPAPI char const * AILCALL AIL_get_soundbank_name(HMSOUNDBANK bank);
$:return A pointer to the name of the sound bank, or 0 if the bank is invalid.
- The name of the bank is the name used in asset names. This is distinct from the
+ The name of the bank is the name used in asset names. This is distinct from the
file name of the bank.
The return value should not be deleted.
@@ -5457,7 +5457,7 @@ DXDEC EXPAPI char const * AILCALL AIL_get_soundbank_name(HMSOUNDBANK bank);
DXDEC EXPAPI S32 AILCALL AIL_get_soundbank_mem_usage(HMSOUNDBANK bank);
/*
Returns the amount of data used by the soundbank management structures.
-
+
$:bank Soundbank to query.
$:return Total memory allocated.
@@ -5476,7 +5476,7 @@ DXDEC EXPAPI S32 AILCALL AIL_enumerate_sound_presets(HMSOUNDBANK bank, HMSSENUM*
$:return Returns 0 when enumeration is complete.
Enumerates the sound presets available inside of a bank file. Example usage:
-
+
${
HMSSENUM Token = MSS_FIRST;
const char* PresetName = 0;
@@ -5503,7 +5503,7 @@ DXDEC EXPAPI S32 AILCALL AIL_enumerate_environment_presets(HMSOUNDBANK bank, HMS
$:return Returns 0 when enumeration is complete.
Enumerates the environment presets available inside of a bank file. Example usage:
-
+
${
HMSSENUM Token = MSS_FIRST;
const char* PresetName = 0;
@@ -5530,7 +5530,7 @@ DXDEC EXPAPI S32 AILCALL AIL_enumerate_sound_assets(HMSOUNDBANK bank, HMSSENUM*
$:return Returns 0 when enumeration is complete.
Enumerates the sounds available inside of a bank file. Example usage:
-
+
${
HMSSENUM Token = MSS_FIRST;
const char* SoundName = 0;
@@ -5549,7 +5549,7 @@ DXDEC EXPAPI S32 AILCALL AIL_enumerate_sound_assets(HMSOUNDBANK bank, HMSSENUM*
Note that name should NOT be deleted by the caller - this points at memory owned by
Miles.
*/
-
+
DXDEC EXPAPI S32 AILCALL AIL_enumerate_events(HMSOUNDBANK bank, HMSSENUM* next, char const * list, char const ** name);
/*
Enumerate the events stored in a soundbank.
@@ -5561,7 +5561,7 @@ DXDEC EXPAPI S32 AILCALL AIL_enumerate_events(HMSOUNDBANK bank, HMSSENUM* next,
$:return Returns 0 when enumeration is complete.
Enumerates the events available inside of a bank file. Example usage:
-
+
${
HMSSENUM Token = MSS_FIRST;
const char* EventName = 0;
@@ -5624,7 +5624,7 @@ DXDEC EXPAPI S32 AILCALL AIL_apply_sound_preset(HSAMPLE sample, HMSOUNDBANK bank
$:return Returns 0 on fail - check for sample/bank validity, and that the preset is in the correct bank.
This will alter the properties on a given sample, based on the given preset.
-*/
+*/
DXDEC EXPAPI S32 AILCALL AIL_unapply_raw_sound_preset(HSAMPLE sample, void* preset);
/*
@@ -5644,7 +5644,7 @@ DXDEC EXPAPI S32 AILCALL AIL_unapply_sound_preset(HSAMPLE sample, HMSOUNDBANK ba
$:return Returns 0 on fail - check for sample/bank validity, and that the preset is in the correct bank.
Presets may or may not affect any given property. Only the properties affected by the specified
- preset will have their values restored to default.
+ preset will have their values restored to default.
*/
typedef S32 (*MilesResolveFunc)(void* context, char const* exp, S32 explen, EXPOUT void* output, S32 isfloat);
@@ -5658,7 +5658,7 @@ typedef S32 (*MilesResolveFunc)(void* context, char const* exp, S32 explen, EXPO
$:isfloat nonzero if the output needs to be a float.
The function callback should convert variable expressions in to an output value of the
- requested type.
+ requested type.
*/
DXDEC EXPAPI S32 AILCALL AIL_resolve_raw_sound_preset(void* preset, void* context, MilesResolveFunc eval);
@@ -5777,7 +5777,7 @@ DXDEC EXPAPI S32 AILCALL AIL_sound_asset_info(HMSOUNDBANK bank, char const* name
$:name The name of the sound asset to find.
$:out_name Optional - Pointer to a buffer that is filled with the sound filename to use for loading.
$:out_info Pointer to a $MILESBANKSOUNDINFO structure that is filled with meta data about the sound asset.
- $:return Returns the byte size of the buffer required for out_name.
+ $:return Returns the byte size of the buffer required for out_name.
This function must be called in order to resolve the sound asset name to
something that can be used by miles. To ensure safe buffer containment, call
@@ -5832,7 +5832,7 @@ typedef struct _MEMDUMP* HMEMDUMP;
ReturnType = "HMSSEVENTCONSTRUCT", "An empty event to be passed to the various step addition functions, or 0 if out of memory."
- Discussion = "Primarily designed for offline use, this function is the first step in
+ Discussion = "Primarily designed for offline use, this function is the first step in
creating an event that can be consumed by the MilesEvent system. Usage is as follows:
HMSSEVENTCONSTRUCT hEvent = AIL_create_event();
@@ -5850,7 +5850,7 @@ typedef struct _MEMDUMP* HMEMDUMP;
Note that if immediately passed to AIL_enqueue_event(), the memory must remain valid until the following
$AIL_complete_event_queue_processing.
-
+
Events are generally tailored to the MilesEvent system, even though there is nothing preventing you
from writing your own event system, or creation ui.
"
@@ -5906,7 +5906,7 @@ EXPTYPEEND
/*
Determines the usage of the sound names list in the $AIL_add_start_sound_event_step.
- $:MILES_START_STEP_RANDOM Randomly select from the list, and allow the same
+ $:MILES_START_STEP_RANDOM Randomly select from the list, and allow the same
sound to play twice in a row. This is the only selection type that doesn't require
a state variable.
$:MILES_START_STEP_NO_REPEATS Randomly select from the list, but prevent the last sound from being the same.
@@ -5926,10 +5926,10 @@ EXPTYPEEND
Name = "AIL_add_start_sound_event_step", "Adds a step to a given event to start a sound with the given specifications."
In = "HMSSEVENTCONSTRUCT", "i_Event", "The event to add the step to."
- In = "const char*", "i_SoundNames", "The names and associated weights for the event step to choose from.
- If there are multiple names listed, the sound will be chosen at random based on the given weights. This
+ In = "const char*", "i_SoundNames", "The names and associated weights for the event step to choose from.
+ If there are multiple names listed, the sound will be chosen at random based on the given weights. This
string is of the form 'BankName1/SoundName1:Weight1:BankName2/SoundName2:Weight2:' etc. The string must always
- terminate in a ':'. Weight must be between 0 and 200. To provide a null sound to randomly choose to not play anything, use
+ terminate in a ':'. Weight must be between 0 and 200. To provide a null sound to randomly choose to not play anything, use
an empty string as an entry."
In = "const char*", "i_PresetName", "[optional] The name of the preset, of the form 'PresetList/PresetName'"
@@ -5944,7 +5944,7 @@ EXPTYPEEND
In = "U8", "i_CanLoad", "If nonzero, the sound is allowed to hit the disk instead of only accessing cached sounds. If true, this might cause a hitch."
In = "U16", "i_Delay", "The minimum delay in ms to apply to the sound before start."
In = "U16", "i_DelayMax", "The maximum delay in ms to apply to the sound before start."
- In = "U8", "i_Priority", "The priority to assign to the sound. If a sound encounters a limit based on its labels, it will evict any sound
+ In = "U8", "i_Priority", "The priority to assign to the sound. If a sound encounters a limit based on its labels, it will evict any sound
with a priority strictly less than the given priority."
In = "U8", "i_LoopCount", "The loop count as per AIL_set_sample_loop_count."
In = "const char*", "i_StartOffset", "[optional] The name of the marker to use as the sound's initial offset."
@@ -5969,19 +5969,19 @@ DXDEC
S32
AILCALL
AIL_add_start_sound_event_step(
- HMSSEVENTCONSTRUCT i_Event,
+ HMSSEVENTCONSTRUCT i_Event,
const char* i_SoundNames,
- const char* i_PresetName,
+ const char* i_PresetName,
U8 i_PresetIsDynamic,
const char* i_EventName,
const char* i_StartMarker, const char* i_EndMarker,
char const* i_StateVar, char const* i_VarInit,
- const char* i_Labels, U32 i_Streaming, U8 i_CanLoad,
+ const char* i_Labels, U32 i_Streaming, U8 i_CanLoad,
U16 i_Delay, U16 i_DelayMax, U8 i_Priority, U8 i_LoopCount,
const char* i_StartOffset,
F32 i_VolMin, F32 i_VolMax, F32 i_PitchMin, F32 i_PitchMax,
F32 i_FadeInTime,
- U8 i_EvictionType,
+ U8 i_EvictionType,
U8 i_SelectType
);
@@ -6004,7 +6004,7 @@ AIL_add_start_sound_event_step(
In order to release the data loaded by this event, AIL_add_uncache_sounds_event_step() needs to
be called with the same parameters.
-
+
If you are using MilesEvent, the data is refcounted so the sound will not be freed until all
samples using it complete."
}
@@ -6089,7 +6089,7 @@ DXDEC
S32
AILCALL
AIL_add_control_sounds_event_step(
- HMSSEVENTCONSTRUCT i_Event,
+ HMSSEVENTCONSTRUCT i_Event,
const char* i_Labels, const char* i_MarkerStart, const char* i_MarkerEnd, const char* i_Position,
const char* i_PresetName,
U8 i_PresetApplyType,
@@ -6191,7 +6191,7 @@ DXDEC EXPAPI S32 AILCALL AIL_add_setblend_event_step(HMSSEVENTCONSTRUCT i_Event,
Defines a named blend function to be referenced by a blended sound later.
$:i_Event The event to add the step to.
- $:i_Name The name of the blend. This is the name that will be
+ $:i_Name The name of the blend. This is the name that will be
referenced by the state variable in start sound, as well as the variable name
to set by the game to update the blend for an instance.
$:i_SoundCount The number of sounds this blend will affect. Max 10.
@@ -6226,7 +6226,7 @@ DXDEC EXPAPI S32 AILCALL AIL_add_setblend_event_step(HMSSEVENTCONSTRUCT i_Event,
Miles max sample count."
}
*/
-DXDEC S32 AILCALL
+DXDEC S32 AILCALL
AIL_add_sound_limit_event_step(HMSSEVENTCONSTRUCT i_Event, char const* i_LimitName, const char* i_SoundLimits);
/*!
@@ -6257,8 +6257,8 @@ AIL_add_sound_limit_event_step(HMSSEVENTCONSTRUCT i_Event, char const* i_LimitNa
AIL_add_persist_preset_event_step(hEvent, 0, `"Underwater`", 0);"
}
*/
-DXDEC S32 AILCALL
-AIL_add_persist_preset_event_step(HMSSEVENTCONSTRUCT i_Event, const char* i_PresetName, const char* i_PersistName,
+DXDEC S32 AILCALL
+AIL_add_persist_preset_event_step(HMSSEVENTCONSTRUCT i_Event, const char* i_PresetName, const char* i_PersistName,
const char* i_Labels, U8 i_IsDynamic
);
@@ -6272,13 +6272,13 @@ DXDEC EXPAPI S32 AILCALL AIL_get_event_contents(HMSOUNDBANK bank, char const * n
thus shouldn't be checked via strlen, etc.
$:return Returns 0 on fail.
- Normally, event contents are meant to be handled by the Miles high-level system via $AIL_enqueue_event,
+ Normally, event contents are meant to be handled by the Miles high-level system via $AIL_enqueue_event,
rather than inspected directly.
*/
DXDEC EXPAPI S32 AILCALL AIL_add_clear_state_event_step(HMSSEVENTCONSTRUCT i_Event);
/*
- Clears all persistent state in the runtime.
+ Clears all persistent state in the runtime.
$:i_Event The event to add the step to.
@@ -6311,7 +6311,7 @@ DXDEC EXPAPI S32 AILCALL AIL_add_enable_limit_event_step(HMSSEVENTCONSTRUCT i_Ev
DXDEC EXPAPI S32 AILCALL AIL_add_set_lfo_event_step(HMSSEVENTCONSTRUCT i_Event, char const* i_Name, char const* i_Base, char const* i_Amp, char const* i_Freq, S32 i_Invert, S32 i_Polarity, S32 i_Waveform, S32 i_DutyCycle, S32 i_IsLFO);
/*
Adds a step to define a variable that oscillates over time.
-
+
$:i_Event The event to add the step to.
$:i_Name The nane of the variable to oscillate.
$:i_Base The value to oscillate around, or a variable name to use as the base.
@@ -6327,15 +6327,15 @@ DXDEC EXPAPI S32 AILCALL AIL_add_set_lfo_event_step(HMSSEVENTCONSTRUCT i_Event,
DXDEC EXPAPI S32 AILCALL AIL_add_move_var_event_step(HMSSEVENTCONSTRUCT i_Event, char const* i_Name, const F32 i_Times[2], const S32 i_InterpolationTypes[2], const F32 i_Values[3]);
/*
Adds a step to set and move a variable over time on a curve.
-
+
$:i_Event The event to add the step to.
$:i_Name The variable to move.
$:i_Times The midpoint and final times for the curves
$:i_InterpolationTypes The curve type for the two curves - Curve In (0), Curve Out (1), S-Curve (2), Linear (3)
$:i_Values The initial, midpoint, and final values for the variable.
-
+
The variable is locked to this curve over the timeperiod - no interpolation from a previous value is done.
-
+
If an existing move var exists when the new one is added, the old one is replaced.
*/
@@ -6450,7 +6450,7 @@ struct EVENT_STEP_INFO
U8 isdynamic;
} persist;
- struct
+ struct
{
MSSSTRINGC name;
MSSSTRINGC labels;
@@ -6522,7 +6522,7 @@ struct EVENT_STEP_INFO
the string location of the next event step in the buffer."
Discussion = "This function parses the event string in to a struct for usage by the user. This function should only be
- used by the MilesEvent system. It returns the pointer to the next step to be passed to this function to get the
+ used by the MilesEvent system. It returns the pointer to the next step to be passed to this function to get the
next step. In this manner it can be used in a loop:
// Create an event to stop all sounds.
@@ -6610,11 +6610,11 @@ EXPTYPE typedef void* HEVENTSYSTEM;
DXDEC EXPAPI HEVENTSYSTEM AILCALL AIL_startup_event_system(HDIGDRIVER dig, S32 command_buf_len, EXPOUT char* memory_buf, S32 memory_len);
/*
Initializes the Miles Event system and associates it with an open digital driver.
-
+
$:dig The digital sound driver that this event system should use.
$:command_buf_len An optional number of bytes to use for the command buffer. If you pass 0, a reasonable default will be used (currently 5K).
- $:memory_buf An optional pointer to a memory buffer buffer that the event system will use for all event allocations.
- Note that the sound data itself is not stored in this buffer - it is only for internal buffers, the command buffer, and instance data.
+ $:memory_buf An optional pointer to a memory buffer buffer that the event system will use for all event allocations.
+ Note that the sound data itself is not stored in this buffer - it is only for internal buffers, the command buffer, and instance data.
Use 0 to let Miles to allocate this buffer itself.
$:memory_len If memory_buf is non-null, then this parameter provides the length. If memory_buf is null, the Miles will
allocate this much memory for internal buffers. If both memory_buf and memory_len are null, the Miles will allocate reasonable default (currently 64K).
@@ -6633,8 +6633,8 @@ DXDEC EXPAPI HEVENTSYSTEM AILCALL AIL_add_event_system(HDIGDRIVER dig);
$:return A handle to the event system to use in various high level functions.
Both systems will access the same set of loaded soundbanks, and are updated when $AIL_begin_event_queue_processing is called.
-
- To enqueue events to the new system, use $AIL_enqueue_event_system.
+
+ To enqueue events to the new system, use $AIL_enqueue_event_system.
To iterate the sounds for the new system, pass the $HEVENTSYSTEM as the first parameter to $AIL_enumerate_sound_instances.
@@ -6646,7 +6646,7 @@ DXDEC EXPAPI HEVENTSYSTEM AILCALL AIL_add_event_system(HDIGDRIVER dig);
DXDEC EXPAPI void AILCALL AIL_shutdown_event_system( void );
/*
Shuts down the Miles event system.
-
+
This function will closes everything in the event system - it ignores reference counts. It will free
all event memory, sound banks, and samples used by the system.
*/
@@ -6660,10 +6660,10 @@ DXDEC EXPAPI HMSOUNDBANK AILCALL AIL_add_soundbank(char const * filename, char c
$:return The handle to the newly loaded soundbank (zero on failure).
This function opens the sound bank and makes it available to the event system. The filename
- is the name on the media, and the name is the symbolic name you used in the Miles Sound Studio.
+ is the name on the media, and the name is the symbolic name you used in the Miles Sound Studio.
You might, for example, be using a soundbank with a platform extension, like: 'gamebank_ps3.msscmp',
and while using the name 'gamebank' for authoring and auditioning.
-
+
Sound data is not loaded when this function is called - it is only loaded when the relevant Cache Sounds
is played, or a sound requiring it plays.
@@ -6685,7 +6685,7 @@ DXDEC EXPAPI S32 AILCALL AIL_release_soundbank(HMSOUNDBANK bank);
Any other data references still existing (queued events, persisted presets, etc) will report errors when used,
but will not crash.
-
+
Releasing a sound bank does not free any cached sounds loaded from the bank - any sounds from the bank should be freed
via a Purge Sounds event step. If this does not occur, the sound data will still be loaded, but the
sound metadata will be gone, so Start Sound events will not work. Purge Sounds will still work.
@@ -6698,24 +6698,24 @@ DXDEC U8 const * AILCALL AIL_find_event(HMSOUNDBANK bank,char const* event_name)
(EXPAPI removed to prevent release in docs)
Searches for an event by name in the event system.
-
+
$:bank The soundbank to search within, or 0 to search all open banks (which is the normal case).
$:event_name The name of the event to find. This name should be of the form "soundbank/event_list/event_name".
$:return A pointer to the event contents (or 0, if the event isn't found).
-
+
This function is normally used as the event parameter for $AIL_enqueue_event. It
searches one or all open soundbanks for a particular event name.
-
- <b>This is deprecated</b>. If you know the event name, you should use $AIL_enqueue_event_by_name, or $AIL_enqueue_event with
+
+ <b>This is deprecated</b>. If you know the event name, you should use $AIL_enqueue_event_by_name, or $AIL_enqueue_event with
MILESEVENT_ENQUEUE_BY_NAME.
-
+
Events that are not enqueued by name can not be tracked by the Auditioner.
*/
DXDEC EXPAPI U64 AILCALL AIL_enqueue_event_system(HEVENTSYSTEM system, U8 const * event, void* user_buffer, S32 user_buffer_len, S32 enqueue_flags, U64 apply_to_ID );
/*
Enqueue an event to a specific system. Used only if you have multiple event systems running.
-
+
$:system The event system to attach the event to.
$:return See $AIL_enqueue_event for return description.
@@ -6728,10 +6728,10 @@ DXDEC EXPAPI U64 AILCALL AIL_enqueue_event_by_name(char const* name);
$:name The full name of the event, eg "soundbank/path/to/event".
$:return See $AIL_enqueue_event for return description.
-
- This is the most basic way to enqueue an event. It enqueues an event by name, and as a result the event will be tracked by the auditioner.
-
- For when you need more control over the event, but still want it to be tracked by the auditioner, it is equivalent
+
+ This is the most basic way to enqueue an event. It enqueues an event by name, and as a result the event will be tracked by the auditioner.
+
+ For when you need more control over the event, but still want it to be tracked by the auditioner, it is equivalent
to calling $AIL_enqueue_event_end_named($AIL_enqueue_event_start(), name)
For introduction to the auditioning system, see $integrating_events.
@@ -6743,9 +6743,9 @@ DXDEC EXPAPI S32 AILCALL AIL_enqueue_event_start();
$:return A token used for passing to functions that add data to the event.
- This is used to pass more data to an event that will be executed. For instance, if
+ This is used to pass more data to an event that will be executed. For instance, if
an event is going to spatialize a sound, but there's no need to move the sound over the course of
- its lifetime, you can add positional data to the event via $AIL_enqueue_event_position. When a
+ its lifetime, you can add positional data to the event via $AIL_enqueue_event_position. When a
sound is started it will use that for its initial position, and there is no need to do any
game object <-> event id tracking.
@@ -6762,7 +6762,7 @@ DXDEC EXPAPI S32 AILCALL AIL_enqueue_event_start();
The enqueue process is still completely thread safe. No locks are used, however only 8
enqueues can be "assembling" at the same time - if more than that occur, the $AIL_enqueue_event_start
- will yield the thread until a slot is open.
+ will yield the thread until a slot is open.
The ONLY time that should happen is if events enqueues are started but never ended:
@@ -6838,7 +6838,7 @@ DXDEC EXPAPI S32 AILCALL AIL_enqueue_event_buffer(S32* token, void* user_buffer,
user buffer contents, and then exposed during sound enumeration. This is equivalent in spirit to
the void* value that often accompanies callbacks. In this case, user_buffer_len is ignored, as
user_buffer is never dereferenced.
- $* <b>Buffer</b> If user_buffer_is_ptr is 0, then user_buffer_len bytes are copied from user_buffer and
+ $* <b>Buffer</b> If user_buffer_is_ptr is 0, then user_buffer_len bytes are copied from user_buffer and
carried with the event. During sound enumeration this buffer is made available, and you never have to
worry about memory management.
$-
@@ -6855,7 +6855,7 @@ DXDEC EXPAPI S32 AILCALL AIL_enqueue_event_buffer(S32* token, void* user_buffer,
data->game_stat = 1;
data->needed_info = 2;
- // Pointer - the "data" pointer will be copied directly, so we can't free() "data" until after the sound
+ // Pointer - the "data" pointer will be copied directly, so we can't free() "data" until after the sound
// completes and we're done using it in the enumeration loop.
S32 ptr_token = AIL_enqueue_event_start();
AIL_enqueue_event_buffer(&ptr_token, data, 0, 1);
@@ -6874,7 +6874,7 @@ DXDEC EXPAPI S32 AILCALL AIL_enqueue_event_buffer(S32* token, void* user_buffer,
data.game_stat = 1;
data.needed_info = 2;
- // Buffer - the "data" structure will be copied internally, so we can free() the data - or just use
+ // Buffer - the "data" structure will be copied internally, so we can free() the data - or just use
// a stack variable like this
S32 buf_token = AIL_enqueue_event_start();
AIL_enqueue_event_buffer(&buf_token, &data, sizeof(data), 0);
@@ -6895,7 +6895,7 @@ DXDEC EXPAPI S32 AILCALL AIL_enqueue_event_variablef(S32* token, char const* nam
$:value The value of the variable to set.
$:return 0 if the enqueue buffer is full
- When a sound starts, the given variable will be set to the given value prior to any possible
+ When a sound starts, the given variable will be set to the given value prior to any possible
references being used by presets.
*/
@@ -6904,7 +6904,7 @@ DXDEC EXPAPI S32 AILCALL AIL_enqueue_event_filter(S32* token, U64 apply_to_ID);
Limits the effects of the event to sounds started by the given ID.
$:token A token created with $AIL_enqueue_event_start
- $:apply_to_ID The ID to use for filtering. This can be either a sound or event ID. For an
+ $:apply_to_ID The ID to use for filtering. This can be either a sound or event ID. For an
event, it will apply to all sounds started by the event, and any events queued by that event.
$:return 0 if the enqueue buffer is full
@@ -6932,7 +6932,7 @@ DXDEC EXPAPI S32 AILCALL AIL_enqueue_event_selection(S32* token, U32 selection);
$:selection The value to use for selecting the sound to play.
$:return 0 if the enqueue buffer is full
- The selection index is used to programatically select a sound from the
+ The selection index is used to programatically select a sound from the
loaded banks. The index passed in replaces any numeric value at the end
of the sound name existing in any start sound event step. For example, if
a start sound event plays "mybank/sound1", and the event is queued with
@@ -6969,52 +6969,52 @@ DXDEC EXPAPI U64 AILCALL AIL_enqueue_event_end_named(S32 token, char const* even
As with all of the enqueue functions it is completely thread-safe.
Upon completion of this function, the enqueue slot is release and available for another
- $AIL_enqueue_event_start.
+ $AIL_enqueue_event_start.
*/
DXDEC EXPAPI U64 AILCALL AIL_enqueue_event(U8 const * event_or_name, void* user_buffer, S32 user_buffer_len, S32 enqueue_flags, U64 apply_to_ID );
/*
Enqueue an event to be processed by the next $AIL_begin_event_queue_processing function.
-
- $:event_or_name Pointer to the event contents to queue, or the name of the event to find and queue.
+
+ $:event_or_name Pointer to the event contents to queue, or the name of the event to find and queue.
If an event, the contents must be valid until the next call to $AIL_begin_event_queue_processing.
If a name, the string is copied internally and does not have any lifetime requirements, and MILES_ENQUEUE_BY_NAME must be present in enqueue_flags.
- $:user_buffer Pointer to a user buffer. Depending on $(AIL_enqueue_event::enqueue_flags), this pointer can be saved directly, or its contents copied into the sound instance.
- This data is then accessible later, when enumerating the instances.
+ $:user_buffer Pointer to a user buffer. Depending on $(AIL_enqueue_event::enqueue_flags), this pointer can be saved directly, or its contents copied into the sound instance.
+ This data is then accessible later, when enumerating the instances.
$:user_buffer_len Size of the buffer pointed to by user_buffer.
$:enqueue_flags Optional $MILESEVENTENQUEUEFLAGS logically OR'd together that control how to enqueue this event (default is 0).
$:apply_to_ID Optional value that is used for events that affect sound instances. Normally,
- when Miles triggers one of these event steps, it matches the name and labels stored with the event step. However, if
+ when Miles triggers one of these event steps, it matches the name and labels stored with the event step. However, if
you specify an apply_to_ID value, then event step will only run on sounds that matches this QueuedID,InstanceID,or EventID too. This is how you
- execute events only specific sound instances. QueuedIDs are returned from each call $AIL_enqueue_event.
+ execute events only specific sound instances. QueuedIDs are returned from each call $AIL_enqueue_event.
InstanceIDs and EventIDs are returned from $AIL_enumerate_sound_instances.
- $:return On success, returns QueuedID value that is unique to this queued event for the rest of this
+ $:return On success, returns QueuedID value that is unique to this queued event for the rest of this
program run (you can use this ID to uniquely identify sounds triggered from this event).
-
+
This function enqueues an event to be triggered - this is how you begin execution of an event. First, you
queue it, and then later (usually once a game frame), you call $AIL_begin_event_queue_processing to
execute an event.
-
- This function is very lightweight. It does nothing more than post the event and data to a
+
+ This function is very lightweight. It does nothing more than post the event and data to a
command buffer that gets executed via $AIL_begin_event_queue_processing.
The user_buffer parameter can be used in different ways. If no flags are passed in, then
Miles will copy the data from user_buffer (user_buffer_len bytes long) and store the data with
the queued sound - you can then free the user_buffer data completely! This lets Miles keep track
- of all your sound related memory directly and is the normal way to use the system (it is very
+ of all your sound related memory directly and is the normal way to use the system (it is very
convenient once you get used to it).
If you instead pass the MILESEVENT_ENQUEUE_BUFFER_PTR flag, then user_buffer pointer will
simply be associated with each sound that this event may start. In this case, user_buffer_len
is ignored.
-
- In both cases, when you later enumerate the sound instances, you can access your sound data
+
+ In both cases, when you later enumerate the sound instances, you can access your sound data
with the $(MILESEVENTSOUNDINFO::UserBuffer) field.
-
+
You can call this function from any number threads - it's designed to be called from anywhere in your game.
If you want events you queue to be captured by Miles Studio, then they have to be passed by name. This can be done
- by either using the convenience function $AIL_enqueue_event_by_name, or by using the MILESEVENT_ENQUEUE_BY_NAME flag and
+ by either using the convenience function $AIL_enqueue_event_by_name, or by using the MILESEVENT_ENQUEUE_BY_NAME flag and
passing the name in event_or_name. For introduction to the auditioning system, see $integrating_events.
*/
@@ -7044,23 +7044,23 @@ DXDEC EXPAPI S32 AILCALL AIL_begin_event_queue_processing( void );
/*
Begin execution of all of the enqueued events.
- $:return Return 0 on failure. The only failures are unrecoverable errors in the queued events
+ $:return Return 0 on failure. The only failures are unrecoverable errors in the queued events
(out of memory, bank file not found, bad data, etc). You can get the specific error by
calling $AIL_last_error.
-
+
This function executes all the events currently in the queue. This is where all major
processing takes place in the event system.
-
+
Once you execute this functions, then sound instances will be in one of three states:
-
+
$(MILESEVENTSOUNDSTATUS::MILESEVENT_SOUND_STATUS_PENDING)[MILESEVENT_SOUND_STATUS_PENDING] - these are new sound instances that were
created by events that had a "Start Sound Step". Note that these instances aren't audible yet,
so that you have a chance to modify game driven properties (like the 3D position)
- on the sound before Miles begins to play it.
-
+ on the sound before Miles begins to play it.
+
$(MILESEVENTSOUNDSTATUS::MILESEVENT_SOUND_STATUS_PLAYING)[MILESEVENT_SOUND_STATUS_PLAYING] - these are sound instances that were previously
started and are continuing to play (you might update the 3D position for these, for example).
-
+
$(MILESEVENTSOUNDSTATUS::MILESEVENT_SOUND_STATUS_COMPLETE)[MILESEVENT_SOUND_STATUS_COMPLETE] - these are sound instances that finished playing
since the last this frame (you might use this status to free any game related memory, for example).
@@ -7082,7 +7082,7 @@ ${
MILESEVENTSOUNDINFO Info;
HMSSENUM SoundEnum = MSS_FIRST;
- while ( $AIL_enumerate_sound_instances( &SoundEnum, MILESEVENT_SOUND_STATUS_PENDING | MILESEVENT_SOUND_STATUS_COMPLETE, 0, &Info ) )
+ while ( $AIL_enumerate_sound_instances( &SoundEnum, MILESEVENT_SOUND_STATUS_PENDING | MILESEVENT_SOUND_STATUS_COMPLETE, 0, &Info ) )
{
game_type * game_data = (game_type*) Info.UserBuffer; // returns the game_data pointer from the enqueue
@@ -7098,13 +7098,13 @@ ${
}
}
- $AIL_complete_event_queue_processing( );
- $}
-
- Note that if any event step drastically fails, the rest of the command queue is
+ $AIL_complete_event_queue_processing( );
+ $}
+
+ Note that if any event step drastically fails, the rest of the command queue is
skipped, and this function returns 0! For this reason, you shouldn't assume
that a start sound event will always result in a completed sound later.
-
+
Therefore, you should allocate memory that you want associated with a sound instance
during the enumeration loop, rather than at enqueue time. Otherwise, you
need to detect that the sound didn't start and then free the memory (which can be complicated).
@@ -7120,7 +7120,7 @@ EXPTYPE typedef struct _MILESEVENTSOUNDINFO
HSTREAM Stream;
void* UserBuffer;
S32 UserBufferLen;
- S32 Status;
+ S32 Status;
U32 Flags;
S32 UsedDelay;
F32 UsedVolume;
@@ -7130,10 +7130,10 @@ EXPTYPE typedef struct _MILESEVENTSOUNDINFO
} MILESEVENTSOUNDINFO;
/*
Sound instance data that is associated with each active sound instance.
-
+
$:QueuedID A unique ID that identifies the queued event that started this sound. Returned from each call to $AIL_enqueue_event.
$:EventID A unique ID that identifies the actual event that started this sound. This is the same as QueuedID unless the sound
- was started by a completion event or a event exec step. In that case, the QueuedID represents the ID returned from
+ was started by a completion event or a event exec step. In that case, the QueuedID represents the ID returned from
$AIL_enqueue_event, and EventID represents the completion event.
$:InstanceID A unique ID that identified this specific sound instance (note that one QueuedID can trigger multiple InstanceIDs).
$:Sample The $HSAMPLE for this playing sound.
@@ -7148,7 +7148,7 @@ EXPTYPE typedef struct _MILESEVENTSOUNDINFO
$:UsedSound The name of the sound used as a result of randomization. This pointer should NOT be deleted
and is only valid for the until the next call in to Miles.
$:HasCompletionEvent Nonzero if the sound will fire an event upon completion.
-
+
This structure is returned by the $AIL_enumerate_sound_instances function. It
returns information about an active sound instance.
*/
@@ -7157,7 +7157,7 @@ DXDEC EXPAPI void AILCALL AIL_set_variable_int(UINTa context, char const* name,
/*
Sets a named variable that the designer can reference in the tool.
- $:context The context the variable is set for. Can be either a $HEVENTSYSTEM
+ $:context The context the variable is set for. Can be either a $HEVENTSYSTEM
to set a global variable for a specific system, 0 to set a global variable
for the default system, or an $HMSSENUM from $AIL_enumerate_sound_instances.
$:name The name of the variable to set.
@@ -7183,14 +7183,14 @@ DXDEC EXPAPI void AILCALL AIL_set_variable_int(UINTa context, char const* name,
// A preset referencing "MyVar" for FirstSound will get 10. Any other sound will
// get 20.
$}
-
+
*/
DXDEC EXPAPI void AILCALL AIL_set_variable_float(UINTa context, char const* name, F32 value);
/*
Sets a named variable that the designer can reference in the tool.
- $:context The context the variable is set for. Can be either a $HEVENTSYSTEM
+ $:context The context the variable is set for. Can be either a $HEVENTSYSTEM
to set a global variable for a specific system, 0 to set a global variable
for the default system, or an $HMSSENUM from $AIL_enumerate_sound_instances.
$:name The name of the variable to set.
@@ -7265,7 +7265,7 @@ DXDEC EXPAPI void AILCALL AIL_set_sound_start_offset(HMSSENUM sound, S32 offset,
the sound starting. Generally you don't need to do this manually, since the sound designer should do
this, however if you need to restart a sound that stopped - for example a stream that went to error -
you will have to set the start position via code.
-
+
However, since there can be a delay between the time the sound is first seen in the sound iteration and
the time it gets set to the data, start positions set via the low level miles calls can get lost, so
use this.
@@ -7281,11 +7281,11 @@ DXDEC EXPAPI S32 AILCALL AIL_enumerate_sound_instances(HEVENTSYSTEM system, HMSS
$:statuses Or-ed list of status values to enumerate. Use 0 for all status types.
$:label_query A query to match sound instance labels against. Use 0 to skip label matching.
$:search_for_ID Match only instances that have a QueuedID,InstanceID,or EventID that matches this value. Use 0 to skip ID matching.
- $:info Returns the data for each sound instance.
+ $:info Returns the data for each sound instance.
$:return Returns 0 when enumeration is complete.
Enumerates the sound instances. This will generally be used between
- calls to $AIL_begin_event_queue_processing and $AIL_complete_event_queue_processing to
+ calls to $AIL_begin_event_queue_processing and $AIL_complete_event_queue_processing to
manage the sound instances.
The label_query is a list of labels to match, separated by commas. By default, comma-separated
@@ -7302,11 +7302,11 @@ DXDEC EXPAPI S32 AILCALL AIL_enumerate_sound_instances(HEVENTSYSTEM system, HMSS
$(MILESEVENTSOUNDSTATUS::MILESEVENT_SOUND_STATUS_PENDING)[MILESEVENT_SOUND_STATUS_PENDING] - these are new sound instances that were
created by events that had a "Start Sound Step". Note that these instances aren't audible yet,
so that you have a chance to modify game driven properties (like the 3D position)
- on the sound before Miles begins to play it.
-
+ on the sound before Miles begins to play it.
+
$(MILESEVENTSOUNDSTATUS::MILESEVENT_SOUND_STATUS_PLAYING)[MILESEVENT_SOUND_STATUS_PLAYING] - these are sound instances that were previously
started and are continuing to play (you might update the 3D position for these, for example).
-
+
$(MILESEVENTSOUNDSTATUS::MILESEVENT_SOUND_STATUS_COMPLETE)[MILESEVENT_SOUND_STATUS_COMPLETE] - these are sound instances that finished playing
since the last this frame (you might use this status to free any game related memory, for example).
@@ -7315,7 +7315,7 @@ ${
HMSSENUM SoundEnum = MSS_FIRST;
MILESEVENTSOUNDINFO Info;
- while ( $AIL_enumerate_sound_instances( &SoundEnum, 0, 0, &Info ) )
+ while ( $AIL_enumerate_sound_instances( &SoundEnum, 0, 0, &Info ) )
{
if ( Info.Status != MILESEVENT_SOUND_STATUS_COMPLETE )
{
@@ -7330,23 +7330,23 @@ $}
EXPTYPEBEGIN typedef S32 MILESEVENTSOUNDSTATUS;
#define MILESEVENT_SOUND_STATUS_PENDING 0x1
-#define MILESEVENT_SOUND_STATUS_PLAYING 0x2
+#define MILESEVENT_SOUND_STATUS_PLAYING 0x2
#define MILESEVENT_SOUND_STATUS_COMPLETE 0x4
EXPTYPEEND
/*
Specifies the status of a sound instance.
-
+
$:MILESEVENT_SOUND_STATUS_PENDING New sound instances that were
created by events that had a "Start Sound Step". Note that these instances aren't audible yet,
so that you have a chance to modify game driven properties (like the 3D position)
- on the sound before Miles begins to play it.
-
+ on the sound before Miles begins to play it.
+
$:MILESEVENT_SOUND_STATUS_PLAYING Sound instances that were previously
started and are continuing to play (you might update the 3D position for these, for example).
-
+
$:MILESEVENT_SOUND_STATUS_COMPLETE Sound instances that finished playing
since the last this frame (you might use this status to free any game related memory, for example).
-
+
These are the status values that each sound instance can have. Use $AIL_enumerate_sound_instances to retrieve them.
*/
@@ -7360,13 +7360,13 @@ EXPTYPEBEGIN typedef U32 MILESEVENTSOUNDFLAG;
EXPTYPEEND
/*
Specifies the status of a sound instance.
-
+
$:MILESEVENT_SOUND_FLAG_MISSING_SOUND The event system tried to look up the sound requested from a Start Sound event
and couldn't find anything in the loaded banks.
$:MILESEVENT_SOUND_FLAG_EVICTED The sound was evicted due to a sound instance limit being hit. Another sound was selected
as being higher priority, and this sound was stopped as a result. This can be the result of either a Label Sound Limit,
or a limit on the sound itself.
- $:MILESEVENT_SOUND_FLAG_WAITING_ASYNC The sound is pending because the data for it is currently being loaded.
+ $:MILESEVENT_SOUND_FLAG_WAITING_ASYNC The sound is pending because the data for it is currently being loaded.
The sound will start when sufficient data has been loaded to hopefully avoid a skip.
$:MILESEVENT_SONUD_FLAG_PENDING_ASYNC The sound has started playing, but the data still isn't completely loaded, and it's possible
that the sound playback will catch up to the read position under poor I/O conditions.
@@ -7375,7 +7375,7 @@ EXPTYPEEND
sound data is asynchronously loaded, or specify the sound in a Cache Sounds step prior to attempting to start it.
$:MILESEVENT_SOUND_FLAG_FAILED_ASYNC The sound tried to load and the asynchronous I/O operation failed - most likely either the media
was removed during load, or the file was not found.
-
+
These are the flag values that each sound instance can have. Use $AIL_enumerate_sound_instances to retrieve them. Instances
may have more than one flag, logically 'or'ed together.
*/
@@ -7383,16 +7383,16 @@ EXPTYPEEND
DXDEC EXPAPI S32 AILCALL AIL_complete_event_queue_processing( void );
/*
Completes the queue processing (which is started with $AIL_begin_event_queue_processing ).
-
+
$:return Returns 0 on failure.
- This function must be called as a pair with $AIL_begin_event_queue_processing.
-
- In $AIL_begin_event_queue_processing, all the new sound instances are queued up, but they haven't
- started playing yet. Old sound instances that have finished playing are still valid - they
- haven't been freed yet. $AIL_complete_event_queue_processing actually starts the sound instances
+ This function must be called as a pair with $AIL_begin_event_queue_processing.
+
+ In $AIL_begin_event_queue_processing, all the new sound instances are queued up, but they haven't
+ started playing yet. Old sound instances that have finished playing are still valid - they
+ haven't been freed yet. $AIL_complete_event_queue_processing actually starts the sound instances
and frees the completed ones - it's the 2nd half of the event processing.
-
+
Usually you call $AIL_enumerate_sound_instances before this function to manage all the sound
instances.
*/
@@ -7400,7 +7400,7 @@ DXDEC EXPAPI S32 AILCALL AIL_complete_event_queue_processing( void );
DXDEC EXPAPI U64 AILCALL AIL_stop_sound_instances(char const * label_query, U64 apply_to_ID);
/*
Allows the programmer to manually enqueue a stop sound event into the event system.
-
+
$:label_query A query to match sound instance labels against. Use 0 to skip label matching.
$:apply_to_ID An optional value returned from a previous $AIL_enqueue_event or $AIL_enumerate_sound_instances that
tells Miles to stop only those instances who's QueuedID,InstanceID,or EventID matches this value.
@@ -7408,7 +7408,7 @@ DXDEC EXPAPI U64 AILCALL AIL_stop_sound_instances(char const * label_query, U64
Enqueues an event to stop all sounds matching the specified label query (see $AIL_enumerate_sound_instances
for a description of the label_query format).
-
+
Usually the programmer should trigger a named event that the sound designed can fill out to stop the necessary sounds,
however, if a single sound (for example associated with an enemy that the player just killed) needs to be stopped,
this function accomplishes that, and is captured by the auditioner for replay.
@@ -7417,7 +7417,7 @@ DXDEC EXPAPI U64 AILCALL AIL_stop_sound_instances(char const * label_query, U64
DXDEC EXPAPI U64 AILCALL AIL_pause_sound_instances(char const * label_query, U64 apply_to_ID);
/*
Allows the programmer to manually enqueue a pause sound event into the event system.
-
+
$:label_query A query to match sound instance labels against. Use 0 to skip label matching.
$:apply_to_ID An optional value returned from a previous $AIL_enqueue_event or $AIL_enumerate_sound_instances that
tells Miles to pause only those instances who's QueuedID,InstanceID,or EventID matches this value.
@@ -7425,7 +7425,7 @@ DXDEC EXPAPI U64 AILCALL AIL_pause_sound_instances(char const * label_query, U64
Enqueues an event to pause all sounds matching the specified label query (see $AIL_enumerate_sound_instances
for a description of the label_query format).
-
+
Usually the programmer should trigger a named event that the sound designed can fill out to pause the necessary sounds,
however, if a single sound (for example associated with an enemy that has been put in to stasis) needs to be paused,
this function accomplishes that, and is captured by the auditioner for replay.
@@ -7434,7 +7434,7 @@ DXDEC EXPAPI U64 AILCALL AIL_pause_sound_instances(char const * label_query, U64
DXDEC EXPAPI U64 AILCALL AIL_resume_sound_instances(char const * label_query, U64 apply_to_ID);
/*
Allows the programmer to manually enqueue a resume sound event into the event system.
-
+
$:label_query A query to match sound instance labels against. Use 0 to skip label matching.
$:apply_to_ID An optional value returned from a previous $AIL_enqueue_event or $AIL_enumerate_sound_instances that
tells Miles to resume only those instances who's QueuedID,InstanceID,or EventID matches this value.
@@ -7442,17 +7442,17 @@ DXDEC EXPAPI U64 AILCALL AIL_resume_sound_instances(char const * label_query, U6
Enqueues an event to resume all sounds matching the specified label query (see $AIL_enumerate_sound_instances
for a description of the label_query format).
-
+
Usually the programmer should trigger a named event that the sound designed can fill out to resume the necessary sounds,
however, if a single sound (for example associated with an enemy that has been restored from stasis) needs to be resumed,
this function accomplishes that, and is captured by the auditioner for replay.
*/
-DXDEC EXPAPI U64 AILCALL AIL_start_sound_instance(HMSOUNDBANK bank, char const * sound, U8 loop_count,
+DXDEC EXPAPI U64 AILCALL AIL_start_sound_instance(HMSOUNDBANK bank, char const * sound, U8 loop_count,
S32 should_stream, char const * labels, void* user_buffer, S32 user_buffer_len, S32 enqueue_flags );
/*
Allows the programmer to manually enqueue a start sound event into the event system.
-
+
$:bank The bank containing the sound to start.
$:sound The name of the sound file to start, including bank name, e.g. "BankName/SoundName"
$:loop_count The loop count to assign to the sound. 0 for infinite, 1 for play once, or just the number of times to loop.
@@ -7463,10 +7463,10 @@ DXDEC EXPAPI U64 AILCALL AIL_start_sound_instance(HMSOUNDBANK bank, char const *
$:enqueue_flags See the enqueue_flags description in $AIL_enqueue_event.
$:return Returns a non-zero EnqueueID on success.
- Enqueues an event to start the specified sound asset.
-
+ Enqueues an event to start the specified sound asset.
+
Usually the programmer should trigger an event that the sound designer has specifically
- create to start the appropriate sounds, but this function gives the programmer
+ create to start the appropriate sounds, but this function gives the programmer
manual control, if necessary. <b>This function is not captured by the auditioner.</b>
*/
@@ -7488,7 +7488,7 @@ DXDEC EXPAPI S32 AILCALL AIL_set_sound_label_limits(HEVENTSYSTEM system, char co
Every time an event triggers a sound to be played, the sound limits are checked, and, if exceeded, a sound is dropped (based
on the settings in the event step).
-
+
Usually event limits are set by a sound designer via an event, but this lets the programmer override the limits at runtime.
Note that this replaces those events, it does not supplement.
*/
@@ -7503,7 +7503,7 @@ DXDEC EXPAPI S32 AILCALL AIL_enumerate_preset_persists(HEVENTSYSTEM system, HMSS
that this pointer can change frame to frame and should be immediately copied to a client-allocated
buffer if persistence is desired.
$:return Returns 0 when enumeration is complete.
-
+
This function lets you enumerate all the persisting presets that are currently active in the system. It
is mostly a debugging aid.
*/
@@ -7511,12 +7511,12 @@ DXDEC EXPAPI S32 AILCALL AIL_enumerate_preset_persists(HEVENTSYSTEM system, HMSS
DXDEC EXPAPI char * AILCALL AIL_text_dump_event_system(void);
/*
Returns a big string describing the current state of the event system.
-
- $:return String description of current systems state.
+
+ $:return String description of current systems state.
This function is a debugging aid - it can be used to show all of the active allocations,
active sounds, etc.
-
+
You must delete the pointer returned from this function with $AIL_mem_free_lock.
*/
@@ -7535,7 +7535,7 @@ EXPTYPE typedef struct _MILESEVENTSTATE
} MILESEVENTSTATE;
/*
returns the current state of the Miles Event System.
-
+
$:CommandBufferSize The size of the command buffer in bytes. See also the $AIL_startup_event_system.
$:HeapSize The total size of memory used by the event system for management structures, and is allocated during startup. This does not include loaded file sizes.
$:HeapRemaining The number of bytes in HeapSize that is remaining.
@@ -7615,7 +7615,7 @@ EXPTYPE typedef struct _MILESBANKFUNCTIONS
} MILESBANKFUNCTIONS;
/*
specifies callbacks for each of the Miles event system.
-
+
$:FreeAll Callback that tells you to free all user-side bank memory.
$:GetPreset Callback to retrieve a sound preset.
$:GetEnvironment Callback to retrieve an environment preset.
@@ -7645,13 +7645,13 @@ DXDEC EXPAPI void AILCALL AIL_set_event_sample_functions(HSAMPLE (*CreateSampleC
In the callback, SoundName is the name of the asset in Miles Studio, and SoundFileName
is the value returned from Container_GetSound() (see also $AIL_set_event_bank_functions).
-
+
*/
DXDEC EXPAPI void AILCALL AIL_set_event_bank_functions(MILESBANKFUNCTIONS const * Functions);
/*
Allows you to override the internal bank file resource management..
-
+
$:Functions A pointer to a structure containing all the callback functions.
This function is used to completely override the high-level resource management system.
@@ -7856,7 +7856,7 @@ EXPTYPEEND
$:MILES_PLAT_IPHONE Apple iDevices
$:MILES_PLAT_LINUX Linux Flavors
$:MILES_PLAT_WII Nintendo Wii
- $:MILES_PLAT_PSP2 Sony NGP
+ $:MILES_PLAT_PSP2 Sony NGP
Values representing the various platforms the high level tool allows.
*/
@@ -7891,11 +7891,11 @@ EXPGROUP(Miles High Level Event System)
DXDEC EXPAPI void AILCALL AIL_event_system_state(HEVENTSYSTEM system, MILESEVENTSTATE* state);
/*
Returns an information structure about the current state of the Miles Event System.
-
+
$:system The system to retrieve information for, or zero for the default system.
$:state A pointer to a structure to receive the state information.
- This function is a debugging aid - it returns information for the event system.
+ This function is a debugging aid - it returns information for the event system.
*/
DXDEC EXPAPI U32 AILCALL AIL_event_system_command_queue_remaining();
@@ -7923,7 +7923,7 @@ DXDEC EXPAPI S32 AILCALL AIL_get_event_length(char const* i_EventName);
// Callback for the error handler.
EXPAPI typedef void AILCALLBACK AILEVENTERRORCB(S64 i_RelevantId, char const* i_Resource);
/*
- The function prototype to use for a callback that will be made when the event system
+ The function prototype to use for a callback that will be made when the event system
encounters an unrecoverable error.
$:i_RelevantId The ID of the asset that encountered the error, as best known. EventID or SoundID.
@@ -7937,7 +7937,7 @@ EXPAPI typedef void AILCALLBACK AILEVENTERRORCB(S64 i_RelevantId, char const* i_
EXPAPI typedef S32 AILCALLBACK MSS_USER_RAND( void );
/*
The function definition to use when defining your own random function.
-
+
You can define a function with this prototype and pass it to $AIL_register_random
if you want to tie the Miles random calls in with your game's (for logging and such).
*/
@@ -7953,7 +7953,7 @@ DXDEC EXPAPI void AILCALL AIL_set_event_error_callback(AILEVENTERRORCB * i_Error
can sometimes be somewhat invisible. This function allows you to see what went wrong,
when it went wrong.
- The basic usage is to have the callback check $AIL_last_error() for the overall category of
+ The basic usage is to have the callback check $AIL_last_error() for the overall category of
failure. The parameter passed to the callback might provide some context, but it can and will
be zero on occasion. Generally it will represent the resource string that is being worked on when the error
occurred.
@@ -8009,7 +8009,7 @@ typedef C8 * (AILCALL *FLT_ERROR)(void);
typedef HDRIVERSTATE (AILCALL *FLT_OPEN_DRIVER) (MSS_ALLOC_TYPE * palloc,
MSS_FREE_TYPE * pfree,
- UINTa user,
+ UINTa user,
HDIGDRIVER dig, void * memory);
typedef FLTRESULT (AILCALL *FLT_CLOSE_DRIVER) (HDRIVERSTATE state);
diff --git a/Minecraft.Client/PS3/Miles/include/rrCore.h b/Minecraft.Client/PS3/Miles/include/rrCore.h
index e88b5f8c..17ebee3a 100644
--- a/Minecraft.Client/PS3/Miles/include/rrCore.h
+++ b/Minecraft.Client/PS3/Miles/include/rrCore.h
@@ -114,8 +114,8 @@
#define __RADLITTLEENDIAN__
#ifdef __i386__
#define __RADX86__
- #else
- #define __RADARM__
+ #else
+ #define __RADARM__
#endif
#define RADINLINE inline
#define RADRESTRICT __restrict
@@ -132,7 +132,7 @@
#define __RADX86__
#else
#error Unknown processor
-#endif
+#endif
#define __RADLITTLEENDIAN__
#define RADINLINE inline
#define RADRESTRICT __restrict
@@ -155,7 +155,7 @@
#define __RADNACL__
#define __RAD32__
#define __RADLITTLEENDIAN__
- #define __RADX86__
+ #define __RADX86__
#define RADINLINE inline
#define RADRESTRICT __restrict
@@ -196,7 +196,7 @@
#define __RAD64REGS__
#define __RADLITTLEENDIAN__
#define RADINLINE inline
- #define RADRESTRICT __restrict
+ #define RADRESTRICT __restrict
#undef RADSTRUCT
#define RADSTRUCT struct __attribute__((__packed__))
@@ -265,7 +265,7 @@
#endif
#undef RADSTRUCT
#define RADSTRUCT struct __attribute__((__packed__))
-
+
#elif defined(CAFE) // has to be before HOLLYWOOD_REV since it also defines it
#define __RADWIIU__
@@ -480,7 +480,7 @@
#undef RADRESTRICT /* could have been defined above... */
#define RADRESTRICT __restrict
-
+
#undef RADSTRUCT
#define RADSTRUCT struct __attribute__((__packed__))
#endif
@@ -885,7 +885,7 @@
#define RAD_ALIGN(type,var,num) type __declspec(align(num)) var
#else
// NOTE: / / is a guaranteed parse error in C/C++.
- #define RAD_ALIGN(type,var,num) RAD_ALIGN_USED_BUT_NOT_DEFINED / /
+ #define RAD_ALIGN(type,var,num) RAD_ALIGN_USED_BUT_NOT_DEFINED / /
#endif
// WARNING : RAD_TLS should really only be used for debug/tools stuff
@@ -917,8 +917,8 @@
#define RAD_S32 signed int
// But pointers are 64 bits.
#if (_MSC_VER >= 1300 && defined(_Wp64) && _Wp64 )
- #define RAD_SINTa __w64 signed __int64
- #define RAD_UINTa __w64 unsigned __int64
+ #define RAD_SINTa __w64 signed long long
+ #define RAD_UINTa __w64 unsigned long long
#else // non-vc.net compiler or /Wp64 turned off
#define RAD_UINTa unsigned long long
#define RAD_SINTa signed long long
@@ -976,8 +976,8 @@
#define RAD_U64 unsigned long long
#define RAD_S64 signed long long
#elif defined(__RADX64__) || defined(__RAD32__)
- #define RAD_U64 unsigned __int64
- #define RAD_S64 signed __int64
+ #define RAD_U64 unsigned long long
+ #define RAD_S64 signed long long
#else
// 16-bit
typedef RADSTRUCT RAD_U64 // do this so that we don't accidentally use U64s
@@ -1134,7 +1134,7 @@
// helpers for doing an if ( ) with expect :
// if ( RAD_LIKELY(expr) ) { ... }
-
+
#define RAD_LIKELY(expr) RAD_EXPECT(expr,1)
#define RAD_UNLIKELY(expr) RAD_EXPECT(expr,0)
@@ -1324,7 +1324,7 @@
__pragma(warning(push)) \
__pragma(warning(disable:4127)) \
} while(0) \
- __pragma(warning(pop))
+ __pragma(warning(pop))
#define RAD_STATEMENT_END_TRUE \
__pragma(warning(push)) \
@@ -1333,10 +1333,10 @@
__pragma(warning(pop))
#else
- #define RAD_USE_STANDARD_LOOP_CONSTRUCT
+ #define RAD_USE_STANDARD_LOOP_CONSTRUCT
#endif
#else
- #define RAD_USE_STANDARD_LOOP_CONSTRUCT
+ #define RAD_USE_STANDARD_LOOP_CONSTRUCT
#endif
#ifdef RAD_USE_STANDARD_LOOP_CONSTRUCT
@@ -1345,7 +1345,7 @@
#define RAD_STATEMENT_END_FALSE \
} while ( (void)0,0 )
-
+
#define RAD_STATEMENT_END_TRUE \
} while ( (void)1,1 )
@@ -1355,7 +1355,7 @@
RAD_STATEMENT_START \
code \
RAD_STATEMENT_END_FALSE
-
+
#define RAD_INFINITE_LOOP( code ) \
RAD_STATEMENT_START \
code \
@@ -1363,7 +1363,7 @@
// Must be placed after variable declarations for code compiled as .c
-#if defined(_MSC_VER) && _MSC_VER >= 1700 // in 2012 aka 11.0 and later
+#if defined(_MSC_VER) && _MSC_VER >= 1700 // in 2012 aka 11.0 and later
# define RR_UNUSED_VARIABLE(x) (void) x
#else
# define RR_UNUSED_VARIABLE(x) (void)(sizeof(x))
@@ -1473,7 +1473,7 @@
// just to make gcc shut up about derefing null :
#define RR_MEMBER_OFFSET_PTR(type,member,ptr) ( (SINTa) &(((type *)(ptr))->member) - (SINTa)(ptr) )
#define RR_MEMBER_SIZE_PTR(type,member,ptr) ( sizeof( ((type *) (ptr))->member) )
-
+
// MEMBER_TO_OWNER takes a pointer to a member and gives you back the base of the object
// you should then RR_ASSERT( &(ret->member) == ptr );
#define RR_MEMBER_TO_OWNER(type,member,ptr) (type *)( ((char *)(ptr)) - RR_MEMBER_OFFSET_PTR(type,member,ptr) )
@@ -1482,7 +1482,7 @@
// Cache / prefetch macros :
// RR_PREFETCH for various platforms :
-//
+//
// RR_PREFETCH_SEQUENTIAL : prefetch memory for reading in a sequential scan
// platforms that automatically prefetch sequential (eg. PC) should be a no-op here
// RR_PREFETCH_WRITE_INVALIDATE : prefetch memory for writing - contents of memory are undefined
@@ -1707,7 +1707,7 @@ extern fp_rrDisplayAssertion * g_fp_rrDisplayAssertion;
#define rrDisplayAssertion(i,n,l,f,m) ( ( g_fp_rrDisplayAssertion ) ? (*g_fp_rrDisplayAssertion)(i,n,l,f,m) : 1 )
//-----------------------------------------------------------
-
+
// RAD_NO_BREAK : option if you don't like your assert to break
// CB : RR_BREAK is *always* a break ; RR_ASSERT_BREAK is optional
#ifdef RAD_NO_BREAK
@@ -1725,7 +1725,7 @@ extern fp_rrDisplayAssertion * g_fp_rrDisplayAssertion;
#define RR_ASSERT_LITE_ALWAYS(exp) RAD_STATEMENT_WRAPPER( if ( ! (exp) ) { RR_ASSERT_BREAK(); } )
//-----------------------------------
-#ifdef RR_DO_ASSERTS
+#ifdef RR_DO_ASSERTS
#define RR_ASSERT(exp) RR_ASSERT_ALWAYS(exp)
#define RR_ASSERT_LITE(exp) RR_ASSERT_LITE_ALWAYS(exp)
@@ -1883,7 +1883,7 @@ unsigned long __cdecl _byteswap_ulong (unsigned long _Long);
#define RR_BSWAP16 _byteswap_ushort
#define RR_BSWAP32 _byteswap_ulong
-unsigned __int64 __cdecl _byteswap_uint64 (unsigned __int64 val);
+unsigned long long __cdecl _byteswap_uint64 (unsigned long long val);
#pragma intrinsic(_byteswap_uint64)
#define RR_BSWAP64 _byteswap_uint64
@@ -1909,7 +1909,7 @@ RADFORCEINLINE unsigned long RR_BSWAP32 (unsigned long _Long)
return _Long;
}
-RADFORCEINLINE unsigned __int64 RR_BSWAP64 (unsigned __int64 _Long)
+RADFORCEINLINE unsigned long long RR_BSWAP64 (unsigned long long _Long)
{
__asm {
mov eax, DWORD PTR _Long
@@ -2250,10 +2250,10 @@ void __storewordbytereverse (unsigned int val, int offset, void *bas
#if ( defined(_MSC_VER) && _MSC_VER >= 1300)
-unsigned __int64 __cdecl _rotl64(unsigned __int64 _Val, int _Shift);
+unsigned long long __cdecl _rotl64(unsigned long long _Val, int _Shift);
#pragma intrinsic(_rotl64)
-#define RR_ROTL64(x,k) _rotl64((unsigned __int64)(x),(int)(k))
+#define RR_ROTL64(x,k) _rotl64((unsigned long long)(x),(int)(k))
#elif defined(__RADCELL__)
@@ -2262,7 +2262,7 @@ unsigned __int64 __cdecl _rotl64(unsigned __int64 _Val, int _Shift);
#elif defined(__RADLINUX__) || defined(__RADMACAPI__)
-//APTODO: Just to compile linux. Should we be doing better than this? If not, combine with above.
+//APTODO: Just to compile linux. Should we be doing better than this? If not, combine with above.
#define RR_ROTL64(u64,num) ( ( (u64) << (num) ) | ( (u64) >> (64 - (num))) )
#else
diff --git a/Minecraft.Client/PS3/Network/SQRNetworkManager_PS3.cpp b/Minecraft.Client/PS3/Network/SQRNetworkManager_PS3.cpp
index 8ab30beb..a1a57443 100644
--- a/Minecraft.Client/PS3/Network/SQRNetworkManager_PS3.cpp
+++ b/Minecraft.Client/PS3/Network/SQRNetworkManager_PS3.cpp
@@ -19,8 +19,8 @@
#include "..\PS3Extras\PS3Strings.h"
#include "PS3\Network\SonyRemoteStorage_PS3.h"
-int (* SQRNetworkManager_PS3::s_SignInCompleteCallbackFn)(void *pParam, bool bContinue, int pad) = NULL;
-void * SQRNetworkManager_PS3::s_SignInCompleteParam = NULL;
+int (* SQRNetworkManager_PS3::s_SignInCompleteCallbackFn)(void *pParam, bool bContinue, int pad) = nullptr;
+void * SQRNetworkManager_PS3::s_SignInCompleteParam = nullptr;
SceNpBasicPresenceDetails2 SQRNetworkManager_PS3::s_lastPresenceInfo = { 0 };
int SQRNetworkManager_PS3::s_resendPresenceCountdown = 0;
bool SQRNetworkManager_PS3::s_presenceStatusDirty = false;
@@ -96,8 +96,8 @@ SQRNetworkManager_PS3::SQRNetworkManager_PS3(ISQRNetworkManagerListener *listene
m_isInSession = false;
m_offlineGame = false;
m_offlineSQR = false;
- m_aServerId = NULL;
- m_gameBootInvite = NULL;
+ m_aServerId = nullptr;
+ m_gameBootInvite = nullptr;
m_onlineStatus = false;
m_bLinkDisconnected = false;
@@ -151,7 +151,7 @@ void SQRNetworkManager_PS3::Initialise()
// Initialise RUDP
#ifdef __PS3__
- ret = cellRudpInit(NULL);
+ ret = cellRudpInit(nullptr);
#else
const int RUDP_POOL_SIZE = (500 * 1024); // TODO - find out what we need, this size is copied from library reference
uint8_t *rudp_pool = (uint8_t *)malloc(RUDP_POOL_SIZE);
@@ -258,7 +258,7 @@ void SQRNetworkManager_PS3::InitialiseAfterOnline()
if( s_SignInCompleteCallbackFn )
{
s_SignInCompleteCallbackFn(s_SignInCompleteParam,true,0);
- s_SignInCompleteCallbackFn = NULL;
+ s_SignInCompleteCallbackFn = nullptr;
}
return;
}
@@ -268,7 +268,7 @@ void SQRNetworkManager_PS3::InitialiseAfterOnline()
int ret = 0;
if( !m_matching2initialised)
{
- ret = sceNpMatching2Init2(0, 0, NULL);
+ ret = sceNpMatching2Init2(0, 0, nullptr);
}
#else
SceNpMatching2InitializeParameter initParam;
@@ -339,7 +339,7 @@ void SQRNetworkManager_PS3::Tick()
if( ( m_gameBootInvite ) && ( s_safeToRespondToGameBootInvite ) )
{
m_listener->HandleInviteReceived( ProfileManager.GetPrimaryPad(), m_gameBootInvite );
- m_gameBootInvite = NULL;
+ m_gameBootInvite = nullptr;
}
ErrorHandlingTick();
@@ -399,12 +399,12 @@ void SQRNetworkManager_PS3::Tick()
if( s_signInCompleteCallbackIfFailed )
{
s_SignInCompleteCallbackFn(s_SignInCompleteParam,false,0);
- s_SignInCompleteCallbackFn = NULL;
+ s_SignInCompleteCallbackFn = nullptr;
}
else if(s_SignInCompleteCallbackFn)
{
s_SignInCompleteCallbackFn(s_SignInCompleteParam, true, 0);
- s_SignInCompleteCallbackFn = NULL;
+ s_SignInCompleteCallbackFn = nullptr;
}
}
}
@@ -421,7 +421,7 @@ void SQRNetworkManager_PS3::ErrorHandlingTick()
{
s_SignInCompleteCallbackFn(s_SignInCompleteParam,false,0);
}
- s_SignInCompleteCallbackFn = NULL;
+ s_SignInCompleteCallbackFn = nullptr;
}
app.DebugPrintf("Network error: SNM_INT_STATE_INITIALISE_FAILED\n");
if( m_isInSession && m_offlineGame) // m_offlineSQR ) // MGH - changed this to m_offlineGame, as m_offlineSQR can be true when running an online game but the init has failed because the servers are down
@@ -531,7 +531,7 @@ void SQRNetworkManager_PS3::UpdateExternalRoomData()
reqParam.roomBinAttrExternalNum = 1;
reqParam.roomBinAttrExternal = &roomBinAttr;
- int ret = sceNpMatching2SetRoomDataExternal ( m_matchingContext, &reqParam, NULL, &m_setRoomDataRequestId );
+ int ret = sceNpMatching2SetRoomDataExternal ( m_matchingContext, &reqParam, nullptr, &m_setRoomDataRequestId );
app.DebugPrintf(CMinecraftApp::USER_RR,"sceNpMatching2SetRoomDataExternal returns 0x%x, number of players %d\n",ret,((char *)m_joinExtData)[174]);
if( ( ret < 0 ) || ForceErrorPoint( SNM_FORCE_ERROR_SET_EXTERNAL_ROOM_DATA ) )
{
@@ -564,7 +564,7 @@ bool SQRNetworkManager_PS3::FriendRoomManagerSearch()
for( int i = 0; i < m_searchResultCount; i++ )
{
free(m_aSearchResultRoomExtDataReceived[i]);
- m_aSearchResultRoomExtDataReceived[i] = NULL;
+ m_aSearchResultRoomExtDataReceived[i] = nullptr;
}
m_friendSearchState = SNM_FRIEND_SEARCH_STATE_GETTING_FRIEND_COUNT;
@@ -639,7 +639,7 @@ void SQRNetworkManager_PS3::FriendSearchTick()
{
m_friendSearchState = SNM_FRIEND_SEARCH_STATE_GETTING_FRIEND_INFO;
delete m_getFriendCountThread;
- m_getFriendCountThread = NULL;
+ m_getFriendCountThread = nullptr;
FriendRoomManagerSearch2();
}
}
@@ -813,7 +813,7 @@ SQRNetworkPlayer *SQRNetworkManager_PS3::GetPlayerByIndex(int idx)
}
else
{
- return NULL;
+ return nullptr;
}
}
@@ -830,7 +830,7 @@ SQRNetworkPlayer *SQRNetworkManager_PS3::GetPlayerBySmallId(int idx)
}
}
LeaveCriticalSection(&m_csRoomSyncData);
- return NULL;
+ return nullptr;
}
SQRNetworkPlayer *SQRNetworkManager_PS3::GetPlayerByXuid(PlayerUID xuid)
@@ -846,7 +846,7 @@ SQRNetworkPlayer *SQRNetworkManager_PS3::GetPlayerByXuid(PlayerUID xuid)
}
}
LeaveCriticalSection(&m_csRoomSyncData);
- return NULL;
+ return nullptr;
}
SQRNetworkPlayer *SQRNetworkManager_PS3::GetLocalPlayerByUserIndex(int idx)
@@ -862,7 +862,7 @@ SQRNetworkPlayer *SQRNetworkManager_PS3::GetLocalPlayerByUserIndex(int idx)
}
}
LeaveCriticalSection(&m_csRoomSyncData);
- return NULL;
+ return nullptr;
}
SQRNetworkPlayer *SQRNetworkManager_PS3::GetHostPlayer()
@@ -875,11 +875,11 @@ SQRNetworkPlayer *SQRNetworkManager_PS3::GetHostPlayer()
SQRNetworkPlayer *SQRNetworkManager_PS3::GetPlayerIfReady(SQRNetworkPlayer *player)
{
- if( player == NULL ) return NULL;
+ if( player == nullptr ) return nullptr;
if( player->IsReady() ) return player;
- return NULL;
+ return nullptr;
}
// Update state internally
@@ -930,7 +930,7 @@ bool SQRNetworkManager_PS3::JoinRoom(SQRNetworkManager_PS3::SessionSearchResult
{
// Set up the presence info we would like to synchronise out when we have fully joined the game
CPlatformNetworkManagerSony::SetSQRPresenceInfoFromExtData(&s_lastPresenceSyncInfo, searchResult->m_extData, searchResult->m_sessionId.m_RoomId, searchResult->m_sessionId.m_ServerId);
- return JoinRoom(searchResult->m_sessionId.m_RoomId, searchResult->m_sessionId.m_ServerId, localPlayerMask, NULL);
+ return JoinRoom(searchResult->m_sessionId.m_RoomId, searchResult->m_sessionId.m_ServerId, localPlayerMask, nullptr);
}
// Join room with a specified roomId. This is used when joining from an invite, as well as by the previous method
@@ -996,7 +996,7 @@ void SQRNetworkManager_PS3::LeaveRoom(bool bActuallyLeaveRoom)
reqParam.roomId = m_room;
SetState(SNM_INT_STATE_LEAVING);
- int ret = sceNpMatching2LeaveRoom( m_matchingContext, &reqParam, NULL, &m_leaveRoomRequestId );
+ int ret = sceNpMatching2LeaveRoom( m_matchingContext, &reqParam, nullptr, &m_leaveRoomRequestId );
if( ( ret < 0 ) || ForceErrorPoint(SNM_FORCE_ERROR_LEAVE_ROOM) )
{
SetState(SNM_INT_STATE_LEAVING_FAILED);
@@ -1100,7 +1100,7 @@ bool SQRNetworkManager_PS3::AddLocalPlayerByUserIndex(int idx)
reqParam.roomMemberBinAttrInternalNum = 1;
reqParam.roomMemberBinAttrInternal = &binAttr;
- int ret = sceNpMatching2SetRoomMemberDataInternal( m_matchingContext, &reqParam, NULL, &m_setRoomMemberInternalDataRequestId );
+ int ret = sceNpMatching2SetRoomMemberDataInternal( m_matchingContext, &reqParam, nullptr, &m_setRoomMemberInternalDataRequestId );
if( ( ret < 0 ) || ForceErrorPoint(SNM_FORCE_ERROR_SET_ROOM_MEMBER_DATA_INTERNAL) )
{
@@ -1148,7 +1148,7 @@ bool SQRNetworkManager_PS3::RemoveLocalPlayerByUserIndex(int idx)
// And do any adjusting necessary to the mappings from this room data, to the SQRNetworkPlayers.
// This will also delete the SQRNetworkPlayer and do all the callbacks that requires etc.
MapRoomSlotPlayers(roomSlotPlayerCount);
- m_aRoomSlotPlayers[m_roomSyncData.getPlayerCount()] = NULL;
+ m_aRoomSlotPlayers[m_roomSyncData.getPlayerCount()] = nullptr;
// Sync this back out to our networked clients...
SyncRoomData();
@@ -1184,7 +1184,7 @@ bool SQRNetworkManager_PS3::RemoveLocalPlayerByUserIndex(int idx)
reqParam.roomMemberBinAttrInternalNum = 1;
reqParam.roomMemberBinAttrInternal = &binAttr;
- int ret = sceNpMatching2SetRoomMemberDataInternal( m_matchingContext, &reqParam, NULL, &m_setRoomMemberInternalDataRequestId );
+ int ret = sceNpMatching2SetRoomMemberDataInternal( m_matchingContext, &reqParam, nullptr, &m_setRoomMemberInternalDataRequestId );
if( ( ret < 0 ) || ForceErrorPoint(SNM_FORCE_ERROR_SET_ROOM_MEMBER_DATA_INTERNAL2) )
{
@@ -1216,7 +1216,7 @@ void SQRNetworkManager_PS3::SendInviteGUI()
msg.mainType = SCE_NP_BASIC_MESSAGE_MAIN_TYPE_INVITE;
msg.subType = SCE_NP_BASIC_MESSAGE_INVITE_SUBTYPE_ACTION_ACCEPT;
msg.msgFeatures = SCE_NP_BASIC_MESSAGE_FEATURES_BOOTABLE;
- msg.npids = NULL;
+ msg.npids = nullptr;
msg.count = 0;
uint8_t *subject = mallocAndCreateUTF8ArrayFromString(IDS_INVITATION_SUBJECT_MAX_18_CHARS);
@@ -1284,7 +1284,7 @@ void SQRNetworkManager_PS3::FindOrCreateNonNetworkPlayer(int slot, int playerTyp
}
}
// Create the player - non-network players can be considered complete as soon as we create them as we aren't waiting on their network connections becoming complete, so can flag them as such and notify via callback
- PlayerUID *pUID = NULL;
+ PlayerUID *pUID = nullptr;
PlayerUID localUID;
if( ( playerType == SQRNetworkPlayer::SNP_TYPE_LOCAL ) ||
m_isHosting && ( playerType == SQRNetworkPlayer::SNP_TYPE_HOST ) )
@@ -1351,7 +1351,7 @@ void SQRNetworkManager_PS3::MapRoomSlotPlayers(int roomSlotPlayerCount/*=-1*/)
if( m_aRoomSlotPlayers[i]->m_type != SQRNetworkPlayer::SNP_TYPE_REMOTE )
{
m_vecTempPlayers.push_back(m_aRoomSlotPlayers[i]);
- m_aRoomSlotPlayers[i] = NULL;
+ m_aRoomSlotPlayers[i] = nullptr;
}
}
}
@@ -1407,7 +1407,7 @@ void SQRNetworkManager_PS3::MapRoomSlotPlayers(int roomSlotPlayerCount/*=-1*/)
if( m_aRoomSlotPlayers[i]->m_type != SQRNetworkPlayer::SNP_TYPE_LOCAL )
{
m_vecTempPlayers.push_back(m_aRoomSlotPlayers[i]);
- m_aRoomSlotPlayers[i] = NULL;
+ m_aRoomSlotPlayers[i] = nullptr;
}
}
}
@@ -1499,7 +1499,7 @@ void SQRNetworkManager_PS3::UpdatePlayersFromRoomSyncUIDs()
}
// Host only - add remote players to our internal storage of player slots, and synchronise this with other room members.
-bool SQRNetworkManager_PS3::AddRemotePlayersAndSync( SceNpMatching2RoomMemberId memberId, int playerMask, bool *isFull/*==NULL*/ )
+bool SQRNetworkManager_PS3::AddRemotePlayersAndSync( SceNpMatching2RoomMemberId memberId, int playerMask, bool *isFull/*==nullptr*/ )
{
assert( m_isHosting );
@@ -1618,7 +1618,7 @@ void SQRNetworkManager_PS3::RemoveRemotePlayersAndSync( SceNpMatching2RoomMember
}
// Zero last element, that isn't part of the currently sized array anymore
memset(&m_roomSyncData.players[m_roomSyncData.getPlayerCount()],0,sizeof(PlayerSyncData));
- m_aRoomSlotPlayers[m_roomSyncData.getPlayerCount()] = NULL;
+ m_aRoomSlotPlayers[m_roomSyncData.getPlayerCount()] = nullptr;
}
else
{
@@ -1660,7 +1660,7 @@ void SQRNetworkManager_PS3::RemoveNetworkPlayers( int mask )
{
if( m_aRoomSlotPlayers[i] == player )
{
- m_aRoomSlotPlayers[i] = NULL;
+ m_aRoomSlotPlayers[i] = nullptr;
}
}
// And delete the reference from the ctx->player map
@@ -1711,7 +1711,7 @@ void SQRNetworkManager_PS3::SyncRoomData()
roomBinAttr.size = sizeof( m_roomSyncData );
reqParam.roomBinAttrInternalNum = 1;
reqParam.roomBinAttrInternal = &roomBinAttr;
- sceNpMatching2SetRoomDataInternal ( m_matchingContext, &reqParam, NULL, &m_setRoomDataRequestId );
+ sceNpMatching2SetRoomDataInternal ( m_matchingContext, &reqParam, nullptr, &m_setRoomDataRequestId );
}
// Check if the matching context is valid, and if not attempt to create one. If to do this requires starting an asynchronous process, then sets the internal state to the state passed in
@@ -1724,7 +1724,7 @@ bool SQRNetworkManager_PS3::GetMatchingContext(eSQRNetworkManagerInternalState a
int ret = 0;
if( !m_matching2initialised)
{
- ret = sceNpMatching2Init2(0, 0, NULL);
+ ret = sceNpMatching2Init2(0, 0, nullptr);
}
if( ret < 0 )
{
@@ -1797,7 +1797,7 @@ bool SQRNetworkManager_PS3::GetServerContext()
bool SQRNetworkManager_PS3::GetServerContext2()
{
// Get list of server IDs of servers allocated to the application
- int serverCount = sceNpMatching2GetServerIdListLocal( m_matchingContext, NULL, 0 );
+ int serverCount = sceNpMatching2GetServerIdListLocal( m_matchingContext, nullptr, 0 );
// If an error is returned here, we need to destroy and recerate our server - if this goes ok we should come back through this path again
if( ( serverCount == SCE_NP_MATCHING2_ERROR_CONTEXT_UNAVAILABLE ) || // This error has been seen (occasionally) in a normal working environment
( serverCount == SCE_NP_MATCHING2_ERROR_CONTEXT_NOT_STARTED ) ) // Also checking for this as a means of simulating the previous error
@@ -1852,7 +1852,7 @@ bool SQRNetworkManager_PS3::GetServerContext(SceNpMatching2ServerId serverId)
{
// Get list of server IDs of servers allocated to the application. We don't actually need to do this, but it is as good a way as any to try a matching2 service and check that
// the context *really* is valid.
- int serverCount = sceNpMatching2GetServerIdListLocal( m_matchingContext, NULL, 0 );
+ int serverCount = sceNpMatching2GetServerIdListLocal( m_matchingContext, nullptr, 0 );
// If an error is returned here, we need to destroy and recerate our server - if this goes ok we should come back through this path again
if( ( serverCount == SCE_NP_MATCHING2_ERROR_CONTEXT_UNAVAILABLE ) || // This error has been seen (occasionally) in a normal working environment
( serverCount == SCE_NP_MATCHING2_ERROR_CONTEXT_NOT_STARTED ) ) // Also checking for this as a means of simulating the previous error
@@ -1906,7 +1906,7 @@ void SQRNetworkManager_PS3::ServerContextTick()
reqParam.serverId = m_serverId;
SetState((m_state==SNM_INT_STATE_HOSTING_SERVER_FOUND)?SNM_INT_STATE_HOSTING_SERVER_SEARCH_CREATING_CONTEXT:SNM_INT_STATE_JOINING_SERVER_SEARCH_CREATING_CONTEXT);
// Found a server - now try and create a context for it
- int ret = sceNpMatching2CreateServerContext( m_matchingContext, &reqParam, NULL, &m_serverContextRequestId );
+ int ret = sceNpMatching2CreateServerContext( m_matchingContext, &reqParam, nullptr, &m_serverContextRequestId );
if ( ( ret < 0 ) || ForceErrorPoint(SNM_FORCE_ERROR_CREATE_SERVER_CONTEXT) )
{
SetState((m_state==SNM_INT_STATE_HOSTING_SERVER_FOUND)?SNM_INT_STATE_HOSTING_SERVER_SEARCH_FAILED:SNM_INT_STATE_JOINING_SERVER_SEARCH_FAILED);
@@ -1958,7 +1958,7 @@ void SQRNetworkManager_PS3::RoomCreateTick()
SetState(SNM_INT_STATE_HOSTING_CREATE_ROOM_CREATING_ROOM);
app.DebugPrintf(CMinecraftApp::USER_RR,">> Creating room start\n");
s_roomStartTime = System::currentTimeMillis();
- int ret = sceNpMatching2CreateJoinRoom( m_matchingContext, &reqParam, NULL, &m_createRoomRequestId );
+ int ret = sceNpMatching2CreateJoinRoom( m_matchingContext, &reqParam, nullptr, &m_createRoomRequestId );
if ( ( ret < 0 ) || ForceErrorPoint(SNM_FORCE_ERROR_CREATE_JOIN_ROOM) )
{
SetState(SNM_INT_STATE_HOSTING_CREATE_ROOM_FAILED);
@@ -2105,7 +2105,7 @@ bool SQRNetworkManager_PS3::SelectRandomServer()
// Kick off the search - we'll get a callback to DefaultRequestCallback with the result from this
app.DebugPrintf(CMinecraftApp::USER_RR,"Kicking off sceNpMatching2GetServerInfo for server id %d\n",reqParam.serverId);
- int ret = sceNpMatching2GetServerInfo( m_matchingContext, &reqParam, NULL, &m_serverSearchRequestId);
+ int ret = sceNpMatching2GetServerInfo( m_matchingContext, &reqParam, nullptr, &m_serverSearchRequestId);
if ( ( ret < 0 ) || ForceErrorPoint(SNM_FORCE_ERROR_GET_SERVER_INFO) )
{
// Jump straight to an error state for this server
@@ -2125,7 +2125,7 @@ void SQRNetworkManager_PS3::DeleteServerContext()
reqParam.serverId = m_serverId;
m_serverContextValid = false;
SetState(SNM_INT_STATE_SERVER_DELETING_CONTEXT);
- int ret = sceNpMatching2DeleteServerContext( m_matchingContext, &reqParam, NULL, &m_serverContextRequestId );
+ int ret = sceNpMatching2DeleteServerContext( m_matchingContext, &reqParam, nullptr, &m_serverContextRequestId );
if ( ( ret < 0 ) || ForceErrorPoint(SNM_FORCE_ERROR_DELETE_SERVER_CONTEXT) )
{
ResetToIdle();
@@ -2203,7 +2203,7 @@ bool SQRNetworkManager_PS3::CreateRudpConnections(SceNpMatching2RoomId roomId, S
if ( ( ret < 0 ) || ForceErrorPoint(SNM_FORCE_ERROR_CREATE_RUDP_CONTEXT) ) return false;
if( m_isHosting )
{
- m_RudpCtxToPlayerMap[ rudpCtx ] = new SQRNetworkPlayer( this, SQRNetworkPlayer::SNP_TYPE_REMOTE, true, playersMemberId, i, rudpCtx, NULL );
+ m_RudpCtxToPlayerMap[ rudpCtx ] = new SQRNetworkPlayer( this, SQRNetworkPlayer::SNP_TYPE_REMOTE, true, playersMemberId, i, rudpCtx, nullptr );
}
else
{
@@ -2237,7 +2237,7 @@ SQRNetworkPlayer *SQRNetworkManager_PS3::GetPlayerFromRudpCtx(int rudpCtx)
{
return it->second;
}
- return NULL;
+ return nullptr;
}
SQRNetworkPlayer *SQRNetworkManager_PS3::GetPlayerFromRoomMemberAndLocalIdx(int roomMember, int localIdx)
@@ -2249,7 +2249,7 @@ SQRNetworkPlayer *SQRNetworkManager_PS3::GetPlayerFromRoomMemberAndLocalIdx(int
return it->second;
}
}
- return NULL;
+ return nullptr;
}
@@ -2342,7 +2342,7 @@ void SQRNetworkManager_PS3::ContextCallback(SceNpMatching2ContextId id, SceNpMa
{
manager->SetState( SNM_INT_STATE_IDLE );
- manager->GetExtDataForRoom(0, NULL, NULL, NULL);
+ manager->GetExtDataForRoom(0, nullptr, nullptr, nullptr);
break;
}
@@ -2373,7 +2373,7 @@ void SQRNetworkManager_PS3::ContextCallback(SceNpMatching2ContextId id, SceNpMa
// if(s_SignInCompleteCallbackFn)
// {
// s_SignInCompleteCallbackFn(s_SignInCompleteParam, true, 0);
-// s_SignInCompleteCallbackFn = NULL;
+// s_SignInCompleteCallbackFn = nullptr;
// }
@@ -2510,7 +2510,7 @@ void SQRNetworkManager_PS3::DefaultRequestCallback(SceNpMatching2ContextId id, S
}
}
- // If there was some problem getting data, then silently ignore as we don't want to go any further with a NULL data pointer, and this will just be indicating that the networking context
+ // If there was some problem getting data, then silently ignore as we don't want to go any further with a nullptr data pointer, and this will just be indicating that the networking context
// is invalid which will be picked up elsewhere to shut everything down properly
if( dataError )
{
@@ -2706,7 +2706,7 @@ void SQRNetworkManager_PS3::DefaultRequestCallback(SceNpMatching2ContextId id, S
// Set flag to indicate whether we were kicked for being out of room or not
reqParam.optData.data[0] = isFull ? 1 : 0;
reqParam.optData.len = 1;
- int ret = sceNpMatching2KickoutRoomMember(manager->m_matchingContext, &reqParam, NULL, &manager->m_kickRequestId);
+ int ret = sceNpMatching2KickoutRoomMember(manager->m_matchingContext, &reqParam, nullptr, &manager->m_kickRequestId);
app.DebugPrintf(CMinecraftApp::USER_RR,"sceNpMatching2KickoutRoomMember returns error 0x%x\n",ret);
break;
}
@@ -2814,7 +2814,7 @@ void SQRNetworkManager_PS3::RoomEventCallback(SceNpMatching2ContextId id, SceNpM
case SCE_NP_MATCHING2_ROOM_EVENT_RoomDestroyed:
{
SonyVoiceChat::signalRoomDestroyed();
- SceNpMatching2RoomUpdateInfo *pUpdateInfo=NULL;
+ SceNpMatching2RoomUpdateInfo *pUpdateInfo=nullptr;
if( dataSize <= SCE_NP_MATCHING2_EVENT_DATA_MAX_SIZE_RoomUpdateInfo )
{
@@ -2937,7 +2937,7 @@ void SQRNetworkManager_PS3::RoomEventCallback(SceNpMatching2ContextId id, SceNpM
reqParam.roomMemberBinAttrInternalNum = 1;
reqParam.roomMemberBinAttrInternal = &binAttr;
- int ret = sceNpMatching2SetRoomMemberDataInternal( manager->m_matchingContext, &reqParam, NULL, &manager->m_setRoomMemberInternalDataRequestId );
+ int ret = sceNpMatching2SetRoomMemberDataInternal( manager->m_matchingContext, &reqParam, nullptr, &manager->m_setRoomMemberInternalDataRequestId );
}
}
@@ -3037,7 +3037,7 @@ void SQRNetworkManager_PS3::SignallingCallback(SceNpMatching2ContextId ctxId, Sc
reqParam.attrId = attrs;
reqParam.attrIdNum = 1;
- sceNpMatching2GetRoomMemberDataInternal( manager->m_matchingContext, &reqParam, NULL, &manager->m_roomMemberDataRequestId);
+ sceNpMatching2GetRoomMemberDataInternal( manager->m_matchingContext, &reqParam, nullptr, &manager->m_roomMemberDataRequestId);
}
else
{
@@ -3118,7 +3118,7 @@ void SQRNetworkManager_PS3::SysUtilCallback(uint64_t status, uint64_t param, voi
{
s_SignInCompleteCallbackFn(s_SignInCompleteParam,false,0);
}
- s_SignInCompleteCallbackFn = NULL;
+ s_SignInCompleteCallbackFn = nullptr;
}
return;
}
@@ -3133,7 +3133,7 @@ void SQRNetworkManager_PS3::SysUtilCallback(uint64_t status, uint64_t param, voi
{
s_SignInCompleteCallbackFn(s_SignInCompleteParam,false,0);
}
- s_SignInCompleteCallbackFn = NULL;
+ s_SignInCompleteCallbackFn = nullptr;
}
}
@@ -3204,7 +3204,7 @@ void SQRNetworkManager_PS3::RudpContextCallback(int ctx_id, int event_id, int er
if( dataSize >= sizeof(SQRNetworkPlayer::InitSendData) )
{
SQRNetworkPlayer::InitSendData ISD;
- unsigned int bytesRead = cellRudpRead( ctx_id, &ISD, sizeof(SQRNetworkPlayer::InitSendData), 0, NULL );
+ unsigned int bytesRead = cellRudpRead( ctx_id, &ISD, sizeof(SQRNetworkPlayer::InitSendData), 0, nullptr );
if( bytesRead == sizeof(SQRNetworkPlayer::InitSendData) )
{
manager->NetworkPlayerInitialDataReceived(playerFrom, &ISD);
@@ -3225,7 +3225,7 @@ void SQRNetworkManager_PS3::RudpContextCallback(int ctx_id, int event_id, int er
if( dataSize > 0 )
{
unsigned char *data = new unsigned char [ dataSize ];
- unsigned int bytesRead = cellRudpRead( ctx_id, data, dataSize, 0, NULL );
+ unsigned int bytesRead = cellRudpRead( ctx_id, data, dataSize, 0, nullptr );
if( bytesRead > 0 )
{
SQRNetworkPlayer *playerFrom, *playerTo;
@@ -3241,7 +3241,7 @@ void SQRNetworkManager_PS3::RudpContextCallback(int ctx_id, int event_id, int er
playerFrom = manager->m_aRoomSlotPlayers[0];
playerTo = manager->GetPlayerFromRudpCtx( ctx_id );
}
- if( ( playerFrom != NULL ) && ( playerTo != NULL ) )
+ if( ( playerFrom != nullptr ) && ( playerTo != nullptr ) )
{
manager->m_listener->HandleDataReceived( playerFrom, playerTo, data, bytesRead );
}
@@ -3306,7 +3306,7 @@ void SQRNetworkManager_PS3::ServerContextValid_CreateRoom()
int ret = -1;
if( !ForceErrorPoint(SNM_FORCE_ERROR_GET_WORLD_INFO_LIST) )
{
- ret = sceNpMatching2GetWorldInfoList( m_matchingContext, &reqParam, NULL, &m_getWorldRequestId);
+ ret = sceNpMatching2GetWorldInfoList( m_matchingContext, &reqParam, nullptr, &m_getWorldRequestId);
}
if (ret < 0)
{
@@ -3335,7 +3335,7 @@ void SQRNetworkManager_PS3::ServerContextValid_JoinRoom()
reqParam.roomMemberBinAttrInternalNum = 1;
reqParam.roomMemberBinAttrInternal = &binAttr;
- int ret = sceNpMatching2JoinRoom( m_matchingContext, &reqParam, NULL, &m_joinRoomRequestId );
+ int ret = sceNpMatching2JoinRoom( m_matchingContext, &reqParam, nullptr, &m_joinRoomRequestId );
if ( (ret < 0) || ForceErrorPoint(SNM_FORCE_ERROR_JOIN_ROOM) )
{
if( ret == SCE_NP_MATCHING2_SERVER_ERROR_NAT_TYPE_MISMATCH)
@@ -3386,9 +3386,9 @@ void SQRNetworkManager_PS3::GetExtDataForRoom( SceNpMatching2RoomId roomId, void
static SceNpMatching2RoomId aRoomId[1];
static SceNpMatching2AttributeId attr[1];
- // All parameters will be NULL if this is being called a second time, after creating a new matching context via one of the paths below (using GetMatchingContext).
- // NULL parameters therefore basically represents an attempt to retry the last sceNpMatching2GetRoomDataExternalList
- if( extData != NULL )
+ // All parameters will be nullptr if this is being called a second time, after creating a new matching context via one of the paths below (using GetMatchingContext).
+ // nullptr parameters therefore basically represents an attempt to retry the last sceNpMatching2GetRoomDataExternalList
+ if( extData != nullptr )
{
aRoomId[0] = roomId;
attr[0] = SCE_NP_MATCHING2_ROOM_BIN_ATTR_EXTERNAL_1_ID;
@@ -3412,14 +3412,14 @@ void SQRNetworkManager_PS3::GetExtDataForRoom( SceNpMatching2RoomId roomId, void
return;
}
- // Kicked off an asynchronous thing that will create a matching context, and then call this method back again (with NULL params) once done, so we can reattempt. Don't do anything more now.
+ // Kicked off an asynchronous thing that will create a matching context, and then call this method back again (with nullptr params) once done, so we can reattempt. Don't do anything more now.
if( m_state == SNM_INT_STATE_IDLE_RECREATING_MATCHING_CONTEXT )
{
app.DebugPrintf("Having to recreate matching context, setting state to SNM_INT_STATE_IDLE_RECREATING_MATCHING_CONTEXT\n");
return;
}
- int ret = sceNpMatching2GetRoomDataExternalList( m_matchingContext, &reqParam, NULL, &m_roomDataExternalListRequestId );
+ int ret = sceNpMatching2GetRoomDataExternalList( m_matchingContext, &reqParam, nullptr, &m_roomDataExternalListRequestId );
// If we hadn't properly detected that a matching context was unvailable, we might still get an error indicating that it is from the previous call. Handle similarly, but we need
// to destroy the context first.
@@ -3434,7 +3434,7 @@ void SQRNetworkManager_PS3::GetExtDataForRoom( SceNpMatching2RoomId roomId, void
m_FriendSessionUpdatedFn(false, m_pParamFriendSessionUpdated);
return;
};
- // Kicked off an asynchronous thing that will create a matching context, and then call this method back again (with NULL params) once done, so we can reattempt. Don't do anything more now.
+ // Kicked off an asynchronous thing that will create a matching context, and then call this method back again (with nullptr params) once done, so we can reattempt. Don't do anything more now.
if( m_state == SNM_INT_STATE_IDLE_RECREATING_MATCHING_CONTEXT )
{
return;
@@ -3530,7 +3530,7 @@ void SQRNetworkManager_PS3::AttemptPSNSignIn(int (*SignInCompleteCallbackFn)(voi
{
s_SignInCompleteCallbackFn(s_SignInCompleteParam,false,0);
}
- s_SignInCompleteCallbackFn = NULL;
+ s_SignInCompleteCallbackFn = nullptr;
}
}
}
diff --git a/Minecraft.Client/PS3/Network/SQRNetworkManager_PS3.h b/Minecraft.Client/PS3/Network/SQRNetworkManager_PS3.h
index 6143bbb5..4953b08f 100644
--- a/Minecraft.Client/PS3/Network/SQRNetworkManager_PS3.h
+++ b/Minecraft.Client/PS3/Network/SQRNetworkManager_PS3.h
@@ -125,7 +125,7 @@ private:
void LocalDataSend(SQRNetworkPlayer *playerFrom, SQRNetworkPlayer *playerTo, const void *data, unsigned int dataSize);
int GetSessionIndex(SQRNetworkPlayer *player);
- bool AddRemotePlayersAndSync( SceNpMatching2RoomMemberId memberId, int playerMask, bool *isFull = NULL );
+ bool AddRemotePlayersAndSync( SceNpMatching2RoomMemberId memberId, int playerMask, bool *isFull = nullptr );
void RemoveRemotePlayersAndSync( SceNpMatching2RoomMemberId memberId, int mask );
void RemoveNetworkPlayers( int mask );
void SetLocalPlayersAndSync();
diff --git a/Minecraft.Client/PS3/Network/SonyCommerce_PS3.cpp b/Minecraft.Client/PS3/Network/SonyCommerce_PS3.cpp
index 230e0309..7bd10110 100644
--- a/Minecraft.Client/PS3/Network/SonyCommerce_PS3.cpp
+++ b/Minecraft.Client/PS3/Network/SonyCommerce_PS3.cpp
@@ -9,22 +9,22 @@ bool SonyCommerce_PS3::m_bCommerceInitialised = false;
SceNpCommerce2SessionInfo SonyCommerce_PS3::m_sessionInfo;
SonyCommerce_PS3::State SonyCommerce_PS3::m_state = e_state_noSession;
int SonyCommerce_PS3::m_errorCode = 0;
-LPVOID SonyCommerce_PS3::m_callbackParam = NULL;
+LPVOID SonyCommerce_PS3::m_callbackParam = nullptr;
-void* SonyCommerce_PS3::m_receiveBuffer = NULL;
+void* SonyCommerce_PS3::m_receiveBuffer = nullptr;
SonyCommerce_PS3::Event SonyCommerce_PS3::m_event;
std::queue<SonyCommerce_PS3::Message> SonyCommerce_PS3::m_messageQueue;
-std::vector<SonyCommerce_PS3::ProductInfo>* SonyCommerce_PS3::m_pProductInfoList = NULL;
-SonyCommerce_PS3::ProductInfoDetailed* SonyCommerce_PS3::m_pProductInfoDetailed = NULL;
-SonyCommerce_PS3::ProductInfo* SonyCommerce_PS3::m_pProductInfo = NULL;
+std::vector<SonyCommerce_PS3::ProductInfo>* SonyCommerce_PS3::m_pProductInfoList = nullptr;
+SonyCommerce_PS3::ProductInfoDetailed* SonyCommerce_PS3::m_pProductInfoDetailed = nullptr;
+SonyCommerce_PS3::ProductInfo* SonyCommerce_PS3::m_pProductInfo = nullptr;
-SonyCommerce_PS3::CategoryInfo* SonyCommerce_PS3::m_pCategoryInfo = NULL;
-const char* SonyCommerce_PS3::m_pProductID = NULL;
-char* SonyCommerce_PS3::m_pCategoryID = NULL;
+SonyCommerce_PS3::CategoryInfo* SonyCommerce_PS3::m_pCategoryInfo = nullptr;
+const char* SonyCommerce_PS3::m_pProductID = nullptr;
+char* SonyCommerce_PS3::m_pCategoryID = nullptr;
SonyCommerce_PS3::CheckoutInputParams SonyCommerce_PS3::m_checkoutInputParams;
SonyCommerce_PS3::DownloadListInputParams SonyCommerce_PS3::m_downloadInputParams;
-SonyCommerce_PS3::CallbackFunc SonyCommerce_PS3::m_callbackFunc = NULL;
+SonyCommerce_PS3::CallbackFunc SonyCommerce_PS3::m_callbackFunc = nullptr;
sys_memory_container_t SonyCommerce_PS3::m_memContainer = SYS_MEMORY_CONTAINER_ID_INVALID;
bool SonyCommerce_PS3::m_bUpgradingTrial = false;
@@ -40,19 +40,19 @@ bool SonyCommerce_PS3::m_contextCreated=false; ///< npcommerce2 context ID c
SonyCommerce_PS3::Phase SonyCommerce_PS3::m_currentPhase = e_phase_stopped; ///< Current commerce2 util
char SonyCommerce_PS3::m_commercebuffer[SCE_NP_COMMERCE2_RECV_BUF_SIZE];
-C4JThread* SonyCommerce_PS3::m_tickThread = NULL;
+C4JThread* SonyCommerce_PS3::m_tickThread = nullptr;
bool SonyCommerce_PS3::m_bLicenseChecked=false; // Check the trial/full license for the game
SonyCommerce_PS3::ProductInfoDetailed s_trialUpgradeProductInfoDetailed;
void SonyCommerce_PS3::Delete()
{
- m_pProductInfoList=NULL;
- m_pProductInfoDetailed=NULL;
- m_pProductInfo=NULL;
- m_pCategoryInfo = NULL;
- m_pProductID = NULL;
- m_pCategoryID = NULL;
+ m_pProductInfoList=nullptr;
+ m_pProductInfoDetailed=nullptr;
+ m_pProductInfo=nullptr;
+ m_pCategoryInfo = nullptr;
+ m_pProductID = nullptr;
+ m_pCategoryID = nullptr;
}
void SonyCommerce_PS3::Init()
{
@@ -106,11 +106,11 @@ void SonyCommerce_PS3::CheckForTrialUpgradeKey()
// 4J-PB - If we are the blu ray disc then we are the full version
if(StorageManager.GetBootTypeDisc())
{
- CheckForTrialUpgradeKey_Callback(NULL,true);
+ CheckForTrialUpgradeKey_Callback(nullptr,true);
}
else
{
- StorageManager.CheckForTrialUpgradeKey(CheckForTrialUpgradeKey_Callback, NULL);
+ StorageManager.CheckForTrialUpgradeKey(CheckForTrialUpgradeKey_Callback, nullptr);
}
}
@@ -498,7 +498,7 @@ int SonyCommerce_PS3::getDetailedProductInfo(ProductInfoDetailed *pInfo, const c
if (categoryId && categoryId[0] != 0) {
ret = sceNpCommerce2GetProductInfoStart(requestId, categoryId, productId);
} else {
- ret = sceNpCommerce2GetProductInfoStart(requestId, NULL, productId);
+ ret = sceNpCommerce2GetProductInfoStart(requestId, nullptr, productId);
}
if (ret < 0) {
sceNpCommerce2DestroyReq(requestId);
@@ -766,7 +766,7 @@ int SonyCommerce_PS3::checkout(CheckoutInputParams &params)
}
}
- for (int i = 0; i < params.skuIds.size(); i++) {
+ for (size_t i = 0; i < params.skuIds.size(); i++) {
skuIdsTemp[i] = (const char *)(*iter);
iter++;
}
@@ -794,7 +794,7 @@ int SonyCommerce_PS3::downloadList(DownloadListInputParams &params)
}
}
- for (int i = 0; i < params.skuIds.size(); i++) {
+ for (size_t i = 0; i < params.skuIds.size(); i++) {
skuIdsTemp[i] = (const char *)(*iter);
iter++;
}
@@ -887,7 +887,7 @@ int SonyCommerce_PS3::createContext()
}
// Create commerce2 context
- ret = sceNpCommerce2CreateCtx(SCE_NP_COMMERCE2_VERSION, &npId, commerce2Handler, NULL, &m_contextId);
+ ret = sceNpCommerce2CreateCtx(SCE_NP_COMMERCE2_VERSION, &npId, commerce2Handler, nullptr, &m_contextId);
if (ret < 0)
{
app.DebugPrintf(4,"createContext sceNpCommerce2CreateCtx problem\n");
@@ -1325,7 +1325,7 @@ void SonyCommerce_PS3::processEvent()
m_memContainer = SYS_MEMORY_CONTAINER_ID_INVALID;
// 4J-PB - if there's been an error - like dlc already purchased, the runcallback has already happened, and will crash this time
- if(m_callbackFunc!=NULL)
+ if(m_callbackFunc!=nullptr)
{
runCallback();
}
@@ -1349,7 +1349,7 @@ void SonyCommerce_PS3::processEvent()
m_memContainer = SYS_MEMORY_CONTAINER_ID_INVALID;
// 4J-PB - if there's been an error - like dlc already purchased, the runcallback has already happened, and will crash this time
- if(m_callbackFunc!=NULL)
+ if(m_callbackFunc!=nullptr)
{
runCallback();
}
@@ -1410,8 +1410,8 @@ void SonyCommerce_PS3::CreateSession( CallbackFunc cb, LPVOID lpParam )
EnterCriticalSection(&m_queueLock);
setCallback(cb,lpParam);
m_messageQueue.push(e_message_commerceCreateSession);
- if(m_tickThread == NULL)
- m_tickThread = new C4JThread(TickLoop, NULL, "SonyCommerce_PS3 tick");
+ if(m_tickThread == nullptr)
+ m_tickThread = new C4JThread(TickLoop, nullptr, "SonyCommerce_PS3 tick");
if(m_tickThread->isRunning() == false)
{
m_currentPhase = e_phase_idle;
diff --git a/Minecraft.Client/PS3/Network/SonyCommerce_PS3.h b/Minecraft.Client/PS3/Network/SonyCommerce_PS3.h
index 1f43341a..05b48cf8 100644
--- a/Minecraft.Client/PS3/Network/SonyCommerce_PS3.h
+++ b/Minecraft.Client/PS3/Network/SonyCommerce_PS3.h
@@ -114,14 +114,14 @@ class SonyCommerce_PS3 : public SonyCommerce
{
assert(m_callbackFunc);
CallbackFunc func = m_callbackFunc;
- m_callbackFunc = NULL;
+ m_callbackFunc = nullptr;
if(func)
func(m_callbackParam, m_errorCode);
m_errorCode = CELL_OK;
}
static void setCallback(CallbackFunc cb,LPVOID lpParam)
{
- assert(m_callbackFunc == NULL);
+ assert(m_callbackFunc == nullptr);
m_callbackFunc = cb;
m_callbackParam = lpParam;
}
diff --git a/Minecraft.Client/PS3/Network/SonyHttp_PS3.cpp b/Minecraft.Client/PS3/Network/SonyHttp_PS3.cpp
index d38a1bc9..4e681354 100644
--- a/Minecraft.Client/PS3/Network/SonyHttp_PS3.cpp
+++ b/Minecraft.Client/PS3/Network/SonyHttp_PS3.cpp
@@ -10,10 +10,10 @@
static const int sc_SSLPoolSize = (512 * 1024U);
static const int sc_CookiePoolSize = (256 * 1024U);
-void* SonyHttp_PS3::uriPool = NULL;
-void* SonyHttp_PS3::httpPool = NULL;
-void* SonyHttp_PS3::sslPool = NULL;
-void* SonyHttp_PS3::cookiePool = NULL;
+void* SonyHttp_PS3::uriPool = nullptr;
+void* SonyHttp_PS3::httpPool = nullptr;
+void* SonyHttp_PS3::sslPool = nullptr;
+void* SonyHttp_PS3::cookiePool = nullptr;
CellHttpClientId SonyHttp_PS3::client;
CellHttpTransId SonyHttp_PS3::trans;
bool SonyHttp_PS3:: bInitialised = false;
@@ -22,31 +22,31 @@ bool SonyHttp_PS3:: bInitialised = false;
bool SonyHttp_PS3::loadCerts(size_t *numBufPtr, CellHttpsData **caListPtr)
{
- CellHttpsData *caList = NULL;
+ CellHttpsData *caList = nullptr;
size_t size = 0;
int ret = 0;
- char *buf = NULL;
+ char *buf = nullptr;
- caList = (CellHttpsData *)malloc(sizeof(CellHttpsData)*2);
- if (NULL == caList) {
+ caList = static_cast<CellHttpsData *>(malloc(sizeof(CellHttpsData) * 2));
+ if (nullptr == caList) {
app.DebugPrintf("failed to malloc cert data");
return false;
}
- ret = cellSslCertificateLoader(CELL_SSL_LOAD_CERT_ALL, NULL, 0, &size);
+ ret = cellSslCertificateLoader(CELL_SSL_LOAD_CERT_ALL, nullptr, 0, &size);
if (ret < 0) {
app.DebugPrintf("cellSslCertifacateLoader() failed(1): 0x%08x", ret);
return ret;
}
- buf = (char*)malloc(size);
- if (NULL == buf) {
+ buf = static_cast<char *>(malloc(size));
+ if (nullptr == buf) {
app.DebugPrintf("failed to malloc cert buffer");
free(caList);
return false;
}
- ret = cellSslCertificateLoader(CELL_SSL_LOAD_CERT_ALL, buf, size, NULL);
+ ret = cellSslCertificateLoader(CELL_SSL_LOAD_CERT_ALL, buf, size, nullptr);
if (ret < 0) {
app.DebugPrintf("cellSslCertifacateLoader() failed(2): 0x%08x", ret);
free(buf);
@@ -72,7 +72,7 @@ bool SonyHttp_PS3::init()
/*E startup procedures */
httpPool = malloc(sc_HTTPPoolSize);
- if (httpPool == NULL) {
+ if (httpPool == nullptr) {
app.DebugPrintf("failed to malloc libhttp memory pool\n");
return false;
}
@@ -84,7 +84,7 @@ bool SonyHttp_PS3::init()
}
cookiePool = malloc(sc_CookiePoolSize);
- if (cookiePool == NULL) {
+ if (cookiePool == nullptr) {
app.DebugPrintf("failed to malloc ssl memory pool\n");
return false;
}
@@ -97,7 +97,7 @@ bool SonyHttp_PS3::init()
sslPool = malloc(sc_SSLPoolSize);
- if (sslPool == NULL) {
+ if (sslPool == nullptr) {
app.DebugPrintf("failed to malloc ssl memory pool\n");
return false;
}
@@ -109,7 +109,7 @@ bool SonyHttp_PS3::init()
}
size_t numBuf = 0;
- CellHttpsData *caList = NULL;
+ CellHttpsData *caList = nullptr;
if(!loadCerts(&numBuf, &caList))
return false;
@@ -153,18 +153,18 @@ bool SonyHttp_PS3::parseUri(const char* szUri, CellHttpUri& parsedUri)
{
/*E the main part */
size_t poolSize = 0;
- int ret = cellHttpUtilParseUri(NULL, szUri, NULL, 0, &poolSize);
+ int ret = cellHttpUtilParseUri(nullptr, szUri, nullptr, 0, &poolSize);
if (0 > ret)
{
app.DebugPrintf("error parsing URI... (0x%x)\n\n", ret);
return false;
}
- if (NULL == (uriPool = malloc(poolSize)))
+ if (nullptr == (uriPool = malloc(poolSize)))
{
app.DebugPrintf("error mallocing uriPool (%d)\n", poolSize);
return false;
}
- ret = cellHttpUtilParseUri(&parsedUri, szUri, uriPool, poolSize, NULL);
+ ret = cellHttpUtilParseUri(&parsedUri, szUri, uriPool, poolSize, nullptr);
if (0 > ret)
{
free(uriPool);
@@ -185,7 +185,7 @@ void* SonyHttp_PS3::getData(const char* url, int* pDataSize)
size_t localRecv = 0;
if(!parseUri(url, uri))
- return NULL;
+ return nullptr;
app.DebugPrintf(" scheme: %s\n", uri.scheme);
app.DebugPrintf(" hostname: %s\n", uri.hostname);
@@ -199,10 +199,10 @@ void* SonyHttp_PS3::getData(const char* url, int* pDataSize)
if (0 > ret)
{
app.DebugPrintf("failed to create http transaction... (0x%x)\n\n", ret);
- return NULL;
+ return nullptr;
}
- ret = cellHttpSendRequest(trans, NULL, 0, NULL);
+ ret = cellHttpSendRequest(trans, nullptr, 0, nullptr);
if (0 > ret)
{
app.DebugPrintf("failed to complete http transaction... (0x%x)\n\n", ret);
@@ -219,7 +219,7 @@ void* SonyHttp_PS3::getData(const char* url, int* pDataSize)
app.DebugPrintf("failed to receive http response... (0x%x)\n\n", ret);
cellHttpDestroyTransaction(trans);
trans = 0;
- return NULL;
+ return nullptr;
}
app.DebugPrintf("Status Code is %d\n", code);
}
@@ -232,19 +232,19 @@ void* SonyHttp_PS3::getData(const char* url, int* pDataSize)
app.DebugPrintf("Only supporting data that has a content length : CELL_HTTP_ERROR_NO_CONTENT_LENGTH\n", ret);
cellHttpDestroyTransaction(trans);
trans = 0;
- return NULL;
+ return nullptr;
}
else
{
app.DebugPrintf("error in receiving content length... (0x%x)\n\n", ret);
cellHttpDestroyTransaction(trans);
trans = 0;
- return NULL;
+ return nullptr;
}
}
int bufferSize = length;
- char* buffer = (char*)malloc(bufferSize+1);
+ char* buffer = static_cast<char *>(malloc(bufferSize + 1));
recvd = 0;
@@ -261,7 +261,7 @@ void* SonyHttp_PS3::getData(const char* url, int* pDataSize)
free(buffer);
cellHttpDestroyTransaction(trans);
trans = 0;
- return NULL;
+ return nullptr;
}
else
{
diff --git a/Minecraft.Client/PS3/Network/SonyRemoteStorage_PS3.cpp b/Minecraft.Client/PS3/Network/SonyRemoteStorage_PS3.cpp
index bdd58e17..ab7b4770 100644
--- a/Minecraft.Client/PS3/Network/SonyRemoteStorage_PS3.cpp
+++ b/Minecraft.Client/PS3/Network/SonyRemoteStorage_PS3.cpp
@@ -27,21 +27,25 @@
void SonyRemoteStorage_PS3::npauthhandler(int event, int result, void *arg)
{
#ifdef __PS3__
- if (event != SCE_NP_MANAGER_EVENT_GOT_TICKET || result <= 0)
+ if (event != SCE_NP_MANAGER_EVENT_GOT_TICKET || result <= 0)
{
app.DebugPrintf("Could not retrieve ticket: 0x%x\n", result);
- }
- else
+ }
+ else
{
psnTicketSize = result;
psnTicket = malloc(psnTicketSize);
- if (psnTicket == NULL)
+<<<<<<< HEAD
+ if (psnTicket == nullptr)
+=======
+ if (psnTicket == NULL)
+>>>>>>> origin/main
{
app.DebugPrintf("Failed to allocate for ticket\n");
}
int ret = sceNpManagerGetTicket(psnTicket, &psnTicketSize);
- if (ret < 0)
+ if (ret < 0)
{
app.DebugPrintf("Could not retrieve ticket: 0x%x\n", ret);
free(psnTicket);
@@ -60,7 +64,7 @@ int SonyRemoteStorage_PS3::initPreconditions()
SceNpId npId;
ret = sceNpManagerGetNpId(&npId);
- if(ret < 0)
+ if(ret < 0)
{
return ret;
}
@@ -68,17 +72,17 @@ int SonyRemoteStorage_PS3::initPreconditions()
ticketVersion.major = 3;
ticketVersion.minor = 0;
ret = sceNpManagerRequestTicket2(&npId, &ticketVersion, TICKETING_SERVICE_ID, NULL, 0, NULL, 0);
- if(ret < 0)
+ if(ret < 0)
{
return ret;
}
m_waitingForTicket = true;
- while(m_waitingForTicket)
+ while(m_waitingForTicket)
{
cellSysutilCheckCallback();
sys_timer_usleep(50000); //50 milliseconds.
}
- if(psnTicket == NULL)
+ if(psnTicket == nullptr)
return -1;
return 0;
@@ -86,7 +90,7 @@ int SonyRemoteStorage_PS3::initPreconditions()
void SonyRemoteStorage_PS3::staticInternalCallback(const SceRemoteStorageEvent event, int32_t retCode, void * userData)
{
- ((SonyRemoteStorage_PS3*)userData)->internalCallback(event, retCode);
+ static_cast<SonyRemoteStorage_PS3 *>(userData)->internalCallback(event, retCode);
}
void SonyRemoteStorage_PS3::internalCallback(const SceRemoteStorageEvent event, int32_t retCode)
@@ -104,12 +108,12 @@ void SonyRemoteStorage_PS3::internalCallback(const SceRemoteStorageEvent event,
break;
case GET_DATA_RESULT:
- if(retCode >= 0)
+ if(retCode >= 0)
{
app.DebugPrintf("Get Data success \n");
m_status = e_getDataSucceeded;
- }
- else
+ }
+ else
{
app.DebugPrintf("An error occurred while Get Data was being processed. retCode: 0x%x \n", retCode);
m_status = e_error;
@@ -126,12 +130,12 @@ void SonyRemoteStorage_PS3::internalCallback(const SceRemoteStorageEvent event,
break;
case GET_STATUS_RESULT:
- if(retCode >= 0)
+ if(retCode >= 0)
{
app.DebugPrintf("Get Status success \n");
app.DebugPrintf("Remaining Syncs for this user: %llu\n", outputGetStatus->remainingSyncs);
app.DebugPrintf("Number of files on the cloud: %d\n", outputGetStatus->numFiles);
- for(int i = 0; i < outputGetStatus->numFiles; i++)
+ for(int i = 0; i < outputGetStatus->numFiles; i++)
{
app.DebugPrintf("\n*** File %d information: ***\n", (i + 1));
app.DebugPrintf("File name: %s \n", outputGetStatus->data[i].fileName);
@@ -142,8 +146,8 @@ void SonyRemoteStorage_PS3::internalCallback(const SceRemoteStorageEvent event,
app.DebugPrintf("Visibility: \"%s\" \n", (outputGetStatus->data[i].visibility == 0)?"Private":((outputGetStatus->data[i].visibility == 1)?"Public read only":"Public read and write"));
}
m_status = e_getStatusSucceeded;
- }
- else
+ }
+ else
{
app.DebugPrintf("An error occurred while Get Status was being processed. retCode: 0x%x \n", retCode);
m_status = e_error;
@@ -158,12 +162,12 @@ void SonyRemoteStorage_PS3::internalCallback(const SceRemoteStorageEvent event,
break;
case SET_DATA_RESULT:
- if(retCode >= 0)
+ if(retCode >= 0)
{
app.DebugPrintf("Set Data success \n");
m_status = e_setDataSucceeded;
- }
- else
+ }
+ else
{
app.DebugPrintf("An error occurred while Set Data was being processed. retCode: 0x%x \n", retCode);
m_status = e_error;
@@ -230,7 +234,7 @@ bool SonyRemoteStorage_PS3::init(CallbackFunc cb, LPVOID lpParam)
params.callback = staticInternalCallback;
params.userData = this;
params.thread.threadAffinity = 0; //Not used in PS3
- params.thread.threadPriority = 1000; //Must be between [0-3071], being 0 the highest.
+ params.thread.threadPriority = 1000; //Must be between [0-3071], being 0 the highest.
params.psnTicket = psnTicket;
params.psnTicketSize = psnTicketSize;
strcpy(params.clientId, CLIENT_ID);
@@ -239,27 +243,27 @@ bool SonyRemoteStorage_PS3::init(CallbackFunc cb, LPVOID lpParam)
params.timeout.receiveMs = 120 * 1000; //120 seconds is the default
params.timeout.sendMs = 120 * 1000; //120 seconds is the default
params.pool.memPoolSize = 7 * 1024 * 1024;
- if(m_memPoolBuffer == NULL)
+ if(m_memPoolBuffer == nullptr)
m_memPoolBuffer = malloc(params.pool.memPoolSize);
params.pool.memPoolBuffer = m_memPoolBuffer;
// SceRemoteStorageAbortReqParams abortParams;
ret = sceRemoteStorageInit(params);
- if(ret >= 0 || ret == SCE_REMOTE_STORAGE_ERROR_ALREADY_INITIALISED)
+ if(ret >= 0 || ret == SCE_REMOTE_STORAGE_ERROR_ALREADY_INITIALISED)
{
// abortParams.requestId = ret;
//ret = sceRemoteStorageAbort(abortParams);
app.DebugPrintf("Session will be created \n");
- //if(ret >= 0)
+ //if(ret >= 0)
//{
// printf("Session aborted \n");
- //} else
+ //} else
//{
// printf("Error aborting session: 0x%x \n", ret);
//}
- }
- else
+ }
+ else
{
app.DebugPrintf("Error creating session: 0x%x \n", ret);
return false;
@@ -279,12 +283,12 @@ bool SonyRemoteStorage_PS3::getRemoteFileInfo(SceRemoteStorageStatus* pInfo, Cal
reqId = sceRemoteStorageGetStatus(params, outputGetStatus);
m_status = e_getStatusInProgress;
- if(reqId >= 0)
+ if(reqId >= 0)
{
app.DebugPrintf("Get Status request sent \n");
return true;
- }
- else
+ }
+ else
{
app.DebugPrintf("Error sending Get Status request: 0x%x \n", reqId);
return false;
@@ -303,11 +307,11 @@ void SonyRemoteStorage_PS3::abort()
params.requestId = reqId;
int ret = sceRemoteStorageAbort(params);
- if(ret >= 0)
+ if(ret >= 0)
{
app.DebugPrintf("Abort request done \n");
- }
- else
+ }
+ else
{
app.DebugPrintf("Error in Abort request: 0x%x \n", ret);
}
@@ -343,9 +347,9 @@ bool SonyRemoteStorage_PS3::setDataInternal()
bool bHostOptionsRead;
DWORD uiTexturePack;
char seed[22];
- app.GetImageTextData(m_thumbnailData, m_thumbnailDataSize,(unsigned char *)seed, uiHostOptions, bHostOptionsRead, uiTexturePack);
+ app.GetImageTextData(m_thumbnailData, m_thumbnailDataSize,reinterpret_cast<unsigned char *>(seed), uiHostOptions, bHostOptionsRead, uiTexturePack);
- __int64 iSeed = strtoll(seed,NULL,10);
+ int64_t iSeed = strtoll(seed, nullptr,10);
char seedHex[17];
sprintf(seedHex,"%016llx",iSeed);
memcpy(descData.m_seed,seedHex,16); // Don't copy null
@@ -377,14 +381,14 @@ bool SonyRemoteStorage_PS3::setDataInternal()
reqId = sceRemoteStorageSetData(params);
app.DebugPrintf("\n*******************************\n");
- if(reqId >= 0)
+ if(reqId >= 0)
{
app.DebugPrintf("Set Data request sent \n");
m_bTransferStarted = true;
m_status = e_setDataInProgress;
return true;
- }
- else
+ }
+ else
{
app.DebugPrintf("Error sending Set Data request: 0x%x \n", reqId);
return false;
@@ -406,12 +410,12 @@ bool SonyRemoteStorage_PS3::getData( const char* remotePath, const char* localPa
reqId = sceRemoteStorageGetData(params, &outputGetData);
app.DebugPrintf("\n*******************************\n");
- if(reqId >= 0)
+ if(reqId >= 0)
{
app.DebugPrintf("Get Data request sent \n");
m_bTransferStarted = true;
m_status = e_getDataInProgress;
- } else
+ } else
{
app.DebugPrintf("Error sending Get Data request: 0x%x \n", reqId);
}
@@ -430,20 +434,20 @@ void SonyRemoteStorage_PS3::runCallback()
int SonyRemoteStorage_PS3::SaveCompressCallback(LPVOID lpParam,bool bRes)
{
- SonyRemoteStorage_PS3* pRS = (SonyRemoteStorage_PS3*)lpParam;
+ SonyRemoteStorage_PS3* pRS = static_cast<SonyRemoteStorage_PS3 *>(lpParam);
pRS->m_compressedSaveState = e_state_Idle;
return 0;
}
int SonyRemoteStorage_PS3::LoadCompressCallback(void *pParam,bool bIsCorrupt, bool bIsOwner)
{
- SonyRemoteStorage_PS3* pRS = (SonyRemoteStorage_PS3*)pParam;
+ SonyRemoteStorage_PS3* pRS = static_cast<SonyRemoteStorage_PS3 *>(pParam);
int origFilesize = StorageManager.GetSaveSize();
void* pOrigSaveData = malloc(origFilesize);
unsigned int retFilesize;
StorageManager.GetSaveData( pOrigSaveData, &retFilesize );
// check if this save file is already compressed
- if(*((int*)pOrigSaveData) != 0)
+ if(*static_cast<int *>(pOrigSaveData) != 0)
{
app.DebugPrintf("compressing save data\n");
@@ -451,7 +455,7 @@ int SonyRemoteStorage_PS3::LoadCompressCallback(void *pParam,bool bIsCorrupt, bo
// We add 4 bytes to the start so that we can signal compressed data
// And another 4 bytes to store the decompressed data size
unsigned int compLength = origFilesize+8;
- byte *compData = (byte *)malloc( compLength );
+ byte *compData = static_cast<byte *>(malloc(compLength));
Compression::UseDefaultThreadStorage();
Compression::getCompression()->Compress(compData+8,&compLength,pOrigSaveData,origFilesize);
ZeroMemory(compData,8);
diff --git a/Minecraft.Client/PS3/Network/SonyVoiceChat.cpp b/Minecraft.Client/PS3/Network/SonyVoiceChat.cpp
index 41c52bed..7a4d95aa 100644
--- a/Minecraft.Client/PS3/Network/SonyVoiceChat.cpp
+++ b/Minecraft.Client/PS3/Network/SonyVoiceChat.cpp
@@ -49,7 +49,7 @@ void SonyVoiceChat::init( SQRNetworkManager_PS3* pNetMan )
sm_pNetworkManager = pNetMan;
setState(AVC_STATE_CHAT_INIT);
- ProfileManager.GetChatAndContentRestrictions(0,false,&sm_isChatRestricted,NULL,NULL);
+ ProfileManager.GetChatAndContentRestrictions(0,false,&sm_isChatRestricted,nullptr,nullptr);
}
void SonyVoiceChat::shutdown()
@@ -225,11 +225,11 @@ void SonyVoiceChat::eventcb( CellSysutilAvc2EventId event_id, CellSysutilAvc2Eve
{ CELL_AVC2_EVENT_LEAVE_FAILED, eventcb_leave },
{ CELL_AVC2_EVENT_UNLOAD_SUCCEEDED, eventcb_unload },
{ CELL_AVC2_EVENT_UNLOAD_FAILED, eventcb_unload },
- { CELL_AVC2_EVENT_SYSTEM_NEW_MEMBER_JOINED, NULL },
- { CELL_AVC2_EVENT_SYSTEM_MEMBER_LEFT, NULL },
- { CELL_AVC2_EVENT_SYSTEM_SESSION_ESTABLISHED, NULL },
- { CELL_AVC2_EVENT_SYSTEM_SESSION_CANNOT_ESTABLISHED,NULL },
- { CELL_AVC2_EVENT_SYSTEM_SESSION_DISCONNECTED, NULL },
+ { CELL_AVC2_EVENT_SYSTEM_NEW_MEMBER_JOINED, nullptr },
+ { CELL_AVC2_EVENT_SYSTEM_MEMBER_LEFT, nullptr },
+ { CELL_AVC2_EVENT_SYSTEM_SESSION_ESTABLISHED, nullptr },
+ { CELL_AVC2_EVENT_SYSTEM_SESSION_CANNOT_ESTABLISHED,nullptr },
+ { CELL_AVC2_EVENT_SYSTEM_SESSION_DISCONNECTED, nullptr },
{ CELL_AVC2_EVENT_SYSTEM_VOICE_DETECTED, eventcb_voiceDetected },
};
@@ -258,7 +258,7 @@ int SonyVoiceChat::load()
ret = cellSysutilAvc2LoadAsync( sm_pNetworkManager->m_matchingContext,
SYS_MEMORY_CONTAINER_ID_INVALID,
eventcb,
- NULL,
+ nullptr,
&g_chat_avc2param );
if( ret != CELL_OK )
{
diff --git a/Minecraft.Client/PS3/PS3Extras/C4JSpursJob.cpp b/Minecraft.Client/PS3/PS3Extras/C4JSpursJob.cpp
index fd8ddd9a..bce76078 100644
--- a/Minecraft.Client/PS3/PS3Extras/C4JSpursJob.cpp
+++ b/Minecraft.Client/PS3/PS3Extras/C4JSpursJob.cpp
@@ -16,13 +16,13 @@ static const unsigned int NUM_SUBMIT_JOBS = 128;
#define DMA_ALIGNMENT (128)
#define JOBHEADER_SYMBOL(JobName) _binary_jqjob_##JobName##_jobbin2_jobheader
-C4JSpursJobQueue* C4JSpursJobQueue::m_pMainJobQueue = NULL;
+C4JSpursJobQueue* C4JSpursJobQueue::m_pMainJobQueue = nullptr;
uint16_t C4JSpursJobQueue::Port::s_jobTagBitmask = 0;
-C4JSpursJobQueue::Port* C4JSpursJobQueue::Port::s_allocatedPorts[16] = {NULL,NULL,NULL,NULL,
- NULL,NULL,NULL,NULL,
- NULL,NULL,NULL,NULL,
- NULL,NULL,NULL,NULL };
+C4JSpursJobQueue::Port* C4JSpursJobQueue::Port::s_allocatedPorts[16] = {nullptr,nullptr,nullptr,nullptr,
+ nullptr,nullptr,nullptr,nullptr,
+ nullptr,nullptr,nullptr,nullptr,
+ nullptr,nullptr,nullptr,nullptr };
bool C4JSpursJobQueue::Port::s_initialised;
CRITICAL_SECTION C4JSpursJobQueue::Port::s_lock;
@@ -43,7 +43,7 @@ C4JSpursJobQueue::C4JSpursJobQueue()
//E create jobQueue
pJobQueue = (JobQueue<JOB_QUEUE_DEPTH>*)memalign(CELL_SPURS_JOBQUEUE_ALIGN, sizeof(JobQueue<JOB_QUEUE_DEPTH>));
- assert(pJobQueue != NULL);
+ assert(pJobQueue != nullptr);
ret = JobQueue<JOB_QUEUE_DEPTH>::create( pJobQueue,
spurs,
@@ -168,7 +168,7 @@ int C4JSpursJobQueue::Port::getFreeJobTag()
void C4JSpursJobQueue::Port::releaseJobTag( int tag )
{
s_jobTagBitmask &= ~(1<<tag);
- s_allocatedPorts[tag] = NULL;
+ s_allocatedPorts[tag] = nullptr;
}
void C4JSpursJobQueue::Port::destroyAll()
diff --git a/Minecraft.Client/PS3/PS3Extras/C4JSpursJob.h b/Minecraft.Client/PS3/PS3Extras/C4JSpursJob.h
index bd77f6d1..273bf0cb 100644
--- a/Minecraft.Client/PS3/PS3Extras/C4JSpursJob.h
+++ b/Minecraft.Client/PS3/PS3Extras/C4JSpursJob.h
@@ -28,7 +28,7 @@
//
// void CompressedTileStorage::compress_SPUSendEvent(int upgradeBlock/*=-1*/)
// {
-// if(g_pCompressSPUThread == NULL)
+// if(g_pCompressSPUThread == nullptr)
// {
// sys_event_port_create(&g_basicEventPort, SYS_EVENT_PORT_LOCAL, SYS_EVENT_PORT_NO_NAME);
// sys_event_queue_attribute_t queue_attr = {SYS_SYNC_PRIORITY, SYS_PPU_QUEUE};
@@ -194,7 +194,7 @@ private:
cell::Spurs::JobQueue::JobQueue<JOB_QUEUE_DEPTH> *pJobQueue;
public:
- static C4JSpursJobQueue& getMainJobQueue() {if(m_pMainJobQueue == NULL) m_pMainJobQueue = new C4JSpursJobQueue; return *m_pMainJobQueue;}
+ static C4JSpursJobQueue& getMainJobQueue() {if(m_pMainJobQueue == nullptr) m_pMainJobQueue = new C4JSpursJobQueue; return *m_pMainJobQueue;}
C4JSpursJobQueue();
void shutdown();
diff --git a/Minecraft.Client/PS3/PS3Extras/C4JThread_SPU.cpp b/Minecraft.Client/PS3/PS3Extras/C4JThread_SPU.cpp
index 94d7ef87..56dd9878 100644
--- a/Minecraft.Client/PS3/PS3Extras/C4JThread_SPU.cpp
+++ b/Minecraft.Client/PS3/PS3Extras/C4JThread_SPU.cpp
@@ -17,7 +17,7 @@
static const bool sc_verbose = true;
-cell::Spurs::Spurs2* C4JThread_SPU::ms_spurs2Object = NULL;
+cell::Spurs::Spurs2* C4JThread_SPU::ms_spurs2Object = nullptr;
void C4JThread_SPU::initSPURS()
{
diff --git a/Minecraft.Client/PS3/PS3Extras/EdgeZLib.cpp b/Minecraft.Client/PS3/PS3Extras/EdgeZLib.cpp
index 2b0a523f..53a8639d 100644
--- a/Minecraft.Client/PS3/PS3Extras/EdgeZLib.cpp
+++ b/Minecraft.Client/PS3/PS3Extras/EdgeZLib.cpp
@@ -3,7 +3,7 @@
#include "EdgeZLib.h"
#include "edge/zlib/edgezlib_ppu.h"
-static CellSpurs* s_pSpurs = NULL;
+static CellSpurs* s_pSpurs = nullptr;
//Set this to 5 if you want deflate/inflate to run in parallel on 5 SPUs.
@@ -12,7 +12,7 @@ const uint32_t kMaxNumDeflateQueueEntries = 64;
static CellSpursEventFlag s_eventFlagDeflate; //Cannot be on stack
static CellSpursTaskset s_taskSetDeflate; //Cannot be on stack
static EdgeZlibDeflateQHandle s_deflateQueue;
-static void* s_pDeflateQueueBuffer = NULL;
+static void* s_pDeflateQueueBuffer = nullptr;
static void* s_pDeflateTaskContext[kNumDeflateTasks];
static uint32_t s_numElementsToCompress; //Cannot be on stack
@@ -22,7 +22,7 @@ const uint32_t kMaxNumInflateQueueEntries = 64;
static CellSpursEventFlag s_eventFlagInflate; //Cannot be on stack
static CellSpursTaskset s_taskSetInflate; //Cannot be on stack
static EdgeZlibInflateQHandle s_inflateQueue;
-static void* s_pInflateQueueBuffer = NULL;
+static void* s_pInflateQueueBuffer = nullptr;
static void* s_pInflateTaskContext[kNumInflateTasks];
static uint32_t s_numElementsToDecompress; //Cannot be on stack
@@ -195,9 +195,9 @@ bool EdgeZLib::Compress(void* pDestination, uint32_t* pDestSize, const void* pSo
// The Deflate Task will wake up and process this work.
//
//////////////////////////////////////////////////////////////////////////
- uint32_t* pDst = NULL;
+ uint32_t* pDst = nullptr;
bool findingSizeOnly = false;
- if(pDestination == NULL && *pDestSize == 0)
+ if(pDestination == nullptr && *pDestSize == 0)
{
pDst = (uint32_t*)malloc(SrcSize);
findingSizeOnly = true;
diff --git a/Minecraft.Client/PS3/PS3Extras/HeapInspector/Server/HeapInspectorServerTypes.h b/Minecraft.Client/PS3/PS3Extras/HeapInspector/Server/HeapInspectorServerTypes.h
index 134059db..4582b206 100644
--- a/Minecraft.Client/PS3/PS3Extras/HeapInspector/Server/HeapInspectorServerTypes.h
+++ b/Minecraft.Client/PS3/PS3Extras/HeapInspector/Server/HeapInspectorServerTypes.h
@@ -16,8 +16,8 @@ typedef unsigned int uint32;
typedef unsigned long long uint64;
typedef long long int64;
#else
- typedef unsigned __int64 uint64;
- typedef __int64 int64;
+ typedef unsigned long long uint64;
+ typedef long long int64;
#endif
typedef char int8;
diff --git a/Minecraft.Client/PS3/PS3Extras/PS3Strings.cpp b/Minecraft.Client/PS3/PS3Extras/PS3Strings.cpp
index 03d916ab..442aab06 100644
--- a/Minecraft.Client/PS3/PS3Extras/PS3Strings.cpp
+++ b/Minecraft.Client/PS3/PS3Extras/PS3Strings.cpp
@@ -13,18 +13,18 @@ uint8_t *mallocAndCreateUTF8ArrayFromString(int iID)
if( (cd = l10n_get_converter( L10N_UTF16, L10N_UTF8 )) == -1 )
{
app.DebugPrintf("l10n_get_converter: no such converter\n");
- return NULL;
+ return nullptr;
}
- l10n_convert_str( cd, wchString, &src_len, NULL, &dst_len );
- uint8_t *strUtf8=(uint8_t *)malloc(dst_len);
+ l10n_convert_str( cd, wchString, &src_len, nullptr, &dst_len );
+ uint8_t *strUtf8=static_cast<uint8_t *>(malloc(dst_len));
memset(strUtf8,0,dst_len);
result = l10n_convert_str( cd, wchString, &src_len, strUtf8, &dst_len );
if( result != ConversionOK )
{
app.DebugPrintf("l10n_convert: conversion error : 0x%x\n", result);
- return NULL;
+ return nullptr;
}
return strUtf8;
diff --git a/Minecraft.Client/PS3/PS3Extras/Ps3Stubs.cpp b/Minecraft.Client/PS3/PS3Extras/Ps3Stubs.cpp
index 2177739a..c11a8593 100644
--- a/Minecraft.Client/PS3/PS3Extras/Ps3Stubs.cpp
+++ b/Minecraft.Client/PS3/PS3Extras/Ps3Stubs.cpp
@@ -74,8 +74,8 @@ int _wcsicmp( const wchar_t * dst, const wchar_t * src )
wchar_t f,l;
// validation section
- // _VALIDATE_RETURN(dst != NULL, EINVAL, _NLSCMPERROR);
- // _VALIDATE_RETURN(src != NULL, EINVAL, _NLSCMPERROR);
+ // _VALIDATE_RETURN(dst != nullptr, EINVAL, _NLSCMPERROR);
+ // _VALIDATE_RETURN(src != nullptr, EINVAL, _NLSCMPERROR);
do {
f = towlower(*dst);
@@ -90,7 +90,7 @@ size_t wcsnlen(const wchar_t *wcs, size_t maxsize)
{
size_t n;
-// Note that we do not check if s == NULL, because we do not
+// Note that we do not check if s == nullptr, because we do not
// return errno_t...
for (n = 0; n < maxsize && *wcs; n++, wcs++)
@@ -134,7 +134,7 @@ VOID GetLocalTime(LPSYSTEMTIME lpSystemTime)
lpSystemTime->wMilliseconds = cellRtcGetMicrosecond(&dateTime)/1000;
}
-HANDLE CreateEvent(void* lpEventAttributes, BOOL bManualReset, BOOL bInitialState, LPCSTR lpName) { PS3_STUBBED; return NULL; }
+HANDLE CreateEvent(void* lpEventAttributes, BOOL bManualReset, BOOL bInitialState, LPCSTR lpName) { PS3_STUBBED; return nullptr; }
VOID Sleep(DWORD dwMilliseconds)
{
C4JThread::Sleep(dwMilliseconds);
@@ -267,8 +267,8 @@ BOOL TlsSetValue(DWORD dwTlsIndex, LPVOID lpTlsValue) { return TLSStoragePS3::In
LPVOID VirtualAlloc(LPVOID lpAddress, SIZE_T dwSize, DWORD flAllocationType, DWORD flProtect)
{
int err;
- sys_addr_t newAddress = NULL;
- if(lpAddress == NULL)
+ sys_addr_t newAddress = nullptr;
+ if(lpAddress == nullptr)
{
// reserve, and possibly commit also
int commitSize = 0;
@@ -382,7 +382,7 @@ BOOL SetFilePointer(HANDLE hFile, LONG lDistanceToMove, PLONG lpDistanceToMoveHi
int fd = (int) hFile;
uint64_t pos = 0, bitsToMove = (int64_t) lDistanceToMove;
- if (lpDistanceToMoveHigh != NULL)
+ if (lpDistanceToMoveHigh != nullptr)
bitsToMove |= ((uint64_t) (*lpDistanceToMoveHigh)) << 32;
int whence = 0;
@@ -490,7 +490,7 @@ HANDLE CreateFileA(LPCSTR lpFileName, DWORD dwDesiredAccess, DWORD dwShareMode,
}
else
{
- err = cellFsOpen(filePath, flags, &fd ,NULL, 0);
+ err = cellFsOpen(filePath, flags, &fd ,nullptr, 0);
iFilesOpen++;
//printf("\n\nFiles Open - %d\n\n",iFilesOpen);
}
@@ -671,11 +671,11 @@ HANDLE FindFirstFileA(LPCSTR lpFileName, LPWIN32_FIND_DATA lpFindFileData) { PS3
BOOL FindNextFileA(HANDLE hFindFile, LPWIN32_FIND_DATAA lpFindFileData) { PS3_STUBBED; return false;}
errno_t _itoa_s(int _Value, char * _DstBuf, size_t _Size, int _Radix) { if(_Radix==10) sprintf(_DstBuf,"%d",_Value); else if(_Radix==16) sprintf(_DstBuf,"%lx",_Value); else return -1; return 0; }
-errno_t _i64toa_s(__int64 _Val, char * _DstBuf, size_t _Size, int _Radix) { if(_Radix==10) sprintf(_DstBuf,"%lld",_Val); else return -1; return 0; }
+errno_t _i64toa_s(int64_t _Val, char * _DstBuf, size_t _Size, int _Radix) { if(_Radix==10) sprintf(_DstBuf,"%lld",_Val); else return -1; return 0; }
int _wtoi(const wchar_t *_Str)
{
- return wcstol(_Str, NULL, 10);
+ return wcstol(_Str, nullptr, 10);
}
diff --git a/Minecraft.Client/PS3/PS3Extras/Ps3Stubs.h b/Minecraft.Client/PS3/PS3Extras/Ps3Stubs.h
index f24a3b92..8f1b489d 100644
--- a/Minecraft.Client/PS3/PS3Extras/Ps3Stubs.h
+++ b/Minecraft.Client/PS3/PS3Extras/Ps3Stubs.h
@@ -29,7 +29,7 @@ LPVOID TlsGetValue(DWORD dwTlsIndex);
BOOL TlsSetValue(DWORD dwTlsIndex, LPVOID lpTlsValue);
-typedef struct _RECT
+typedef struct _RECT
{
LONG left;
LONG top;
@@ -53,16 +53,16 @@ typedef int errno_t;
// // The following field is used for blocking when there is contention for
// // the resource
// //
-//
+//
// union {
// ULONG_PTR RawEvent[4];
// } Synchronization;
-//
+//
// //
// // The following three fields control entering and exiting the critical
// // section for the resource
// //
-//
+//
// LONG LockCount;
// LONG RecursionCount;
// HANDLE OwningThread;
@@ -219,7 +219,7 @@ typedef struct _MEMORYSTATUS {
#define THREAD_PRIORITY_IDLE THREAD_BASE_PRIORITY_IDLE
#define WAIT_TIMEOUT 258L
-#define STATUS_ABANDONED_WAIT_0 ((DWORD )0x00000080L)
+#define STATUS_ABANDONED_WAIT_0 ((DWORD )0x00000080L)
#define WAIT_ABANDONED ((STATUS_ABANDONED_WAIT_0 ) + 0 )
#define MAXUINT_PTR (~((UINT_PTR)0))
@@ -261,17 +261,17 @@ typedef struct _MEMORYSTATUS {
#define GENERIC_EXECUTE (0x20000000L)
#define GENERIC_ALL (0x10000000L)
-#define FILE_SHARE_READ 0x00000001
-#define FILE_SHARE_WRITE 0x00000002
-#define FILE_SHARE_DELETE 0x00000004
-#define FILE_ATTRIBUTE_READONLY 0x00000001
-#define FILE_ATTRIBUTE_HIDDEN 0x00000002
-#define FILE_ATTRIBUTE_SYSTEM 0x00000004
-#define FILE_ATTRIBUTE_DIRECTORY 0x00000010
-#define FILE_ATTRIBUTE_ARCHIVE 0x00000020
-#define FILE_ATTRIBUTE_DEVICE 0x00000040
-#define FILE_ATTRIBUTE_NORMAL 0x00000080
-#define FILE_ATTRIBUTE_TEMPORARY 0x00000100
+#define FILE_SHARE_READ 0x00000001
+#define FILE_SHARE_WRITE 0x00000002
+#define FILE_SHARE_DELETE 0x00000004
+#define FILE_ATTRIBUTE_READONLY 0x00000001
+#define FILE_ATTRIBUTE_HIDDEN 0x00000002
+#define FILE_ATTRIBUTE_SYSTEM 0x00000004
+#define FILE_ATTRIBUTE_DIRECTORY 0x00000010
+#define FILE_ATTRIBUTE_ARCHIVE 0x00000020
+#define FILE_ATTRIBUTE_DEVICE 0x00000040
+#define FILE_ATTRIBUTE_NORMAL 0x00000080
+#define FILE_ATTRIBUTE_TEMPORARY 0x00000100
#define FILE_FLAG_WRITE_THROUGH 0x80000000
#define FILE_FLAG_OVERLAPPED 0x40000000
@@ -291,38 +291,38 @@ typedef struct _MEMORYSTATUS {
#define OPEN_ALWAYS 4
#define TRUNCATE_EXISTING 5
-#define PAGE_NOACCESS 0x01
-#define PAGE_READONLY 0x02
-#define PAGE_READWRITE 0x04
-#define PAGE_WRITECOPY 0x08
-#define PAGE_EXECUTE 0x10
-#define PAGE_EXECUTE_READ 0x20
-#define PAGE_EXECUTE_READWRITE 0x40
-#define PAGE_EXECUTE_WRITECOPY 0x80
-#define PAGE_GUARD 0x100
-#define PAGE_NOCACHE 0x200
-#define PAGE_WRITECOMBINE 0x400
-#define PAGE_USER_READONLY 0x1000
-#define PAGE_USER_READWRITE 0x2000
-#define MEM_COMMIT 0x1000
-#define MEM_RESERVE 0x2000
-#define MEM_DECOMMIT 0x4000
-#define MEM_RELEASE 0x8000
-#define MEM_FREE 0x10000
-#define MEM_PRIVATE 0x20000
-#define MEM_RESET 0x80000
-#define MEM_TOP_DOWN 0x100000
-#define MEM_NOZERO 0x800000
-#define MEM_LARGE_PAGES 0x20000000
-#define MEM_HEAP 0x40000000
-#define MEM_16MB_PAGES 0x80000000
+#define PAGE_NOACCESS 0x01
+#define PAGE_READONLY 0x02
+#define PAGE_READWRITE 0x04
+#define PAGE_WRITECOPY 0x08
+#define PAGE_EXECUTE 0x10
+#define PAGE_EXECUTE_READ 0x20
+#define PAGE_EXECUTE_READWRITE 0x40
+#define PAGE_EXECUTE_WRITECOPY 0x80
+#define PAGE_GUARD 0x100
+#define PAGE_NOCACHE 0x200
+#define PAGE_WRITECOMBINE 0x400
+#define PAGE_USER_READONLY 0x1000
+#define PAGE_USER_READWRITE 0x2000
+#define MEM_COMMIT 0x1000
+#define MEM_RESERVE 0x2000
+#define MEM_DECOMMIT 0x4000
+#define MEM_RELEASE 0x8000
+#define MEM_FREE 0x10000
+#define MEM_PRIVATE 0x20000
+#define MEM_RESET 0x80000
+#define MEM_TOP_DOWN 0x100000
+#define MEM_NOZERO 0x800000
+#define MEM_LARGE_PAGES 0x20000000
+#define MEM_HEAP 0x40000000
+#define MEM_16MB_PAGES 0x80000000
#define IGNORE 0 // Ignore signal
#define INFINITE 0xFFFFFFFF // Infinite timeout
#define WAIT_FAILED ((DWORD)0xFFFFFFFF)
-#define STATUS_WAIT_0 ((DWORD )0x00000000L)
+#define STATUS_WAIT_0 ((DWORD )0x00000000L)
#define WAIT_OBJECT_0 ((STATUS_WAIT_0 ) + 0 )
-#define STATUS_PENDING ((DWORD )0x00000103L)
+#define STATUS_PENDING ((DWORD )0x00000103L)
#define STILL_ACTIVE STATUS_PENDING
DWORD GetLastError(VOID);
@@ -364,11 +364,11 @@ VOID OutputDebugString(LPCSTR lpOutputString);
VOID OutputDebugStringA(LPCSTR lpOutputString);
errno_t _itoa_s(int _Value, char * _DstBuf, size_t _Size, int _Radix);
-errno_t _i64toa_s(__int64 _Val, char * _DstBuf, size_t _Size, int _Radix);
+errno_t _i64toa_s(int64_t _Val, char * _DstBuf, size_t _Size, int _Radix);
int _wtoi(const wchar_t *_Str);
-#define __declspec(a)
+#define __declspec(a)
extern "C" int _wcsicmp (const wchar_t * dst, const wchar_t * src);
size_t wcsnlen(const wchar_t *wcs, size_t maxsize);
diff --git a/Minecraft.Client/PS3/PS3Extras/Ps3Types.h b/Minecraft.Client/PS3/PS3Extras/Ps3Types.h
index d3d8cc6a..fe003c4a 100644
--- a/Minecraft.Client/PS3/PS3Extras/Ps3Types.h
+++ b/Minecraft.Client/PS3/PS3Extras/Ps3Types.h
@@ -7,7 +7,8 @@
#define BOOST_ENABLE_ASSERT_HANDLER
#include <typeinfo>
-#include <stddef.h>
+#include <cstdint>
+#include <cstddef>
#include <boost/typeof/typeof.hpp>
#include <boost/tr1/memory.hpp>
#include "boost/tr1/unordered_map.hpp"
@@ -110,21 +111,19 @@ typedef unsigned int *PUINT;
typedef unsigned char byte;
-typedef long long __int64;
-typedef unsigned long long __uint64;
typedef unsigned long DWORD;
typedef int INT;
typedef unsigned long ULONG_PTR, *PULONG_PTR;
typedef ULONG_PTR SIZE_T, *PSIZE_T;
-typedef __int64 LONG64, *PLONG64;
+typedef long long LONG64, *PLONG64;
#define VOID void
typedef char CHAR;
typedef short SHORT;
typedef long LONG;
-typedef __int64 LONGLONG;
-typedef __uint64 ULONGLONG;
+typedef int64_t LONGLONG;
+typedef uint64_t ULONGLONG;
#define CONST const
diff --git a/Minecraft.Client/PS3/PS3Extras/ShutdownManager.cpp b/Minecraft.Client/PS3/PS3Extras/ShutdownManager.cpp
index e7eca53f..a04e45d9 100644
--- a/Minecraft.Client/PS3/PS3Extras/ShutdownManager.cpp
+++ b/Minecraft.Client/PS3/PS3Extras/ShutdownManager.cpp
@@ -16,12 +16,12 @@ C4JThread::EventArray *ShutdownManager::s_eventArray[eThreadIdCount];
void ShutdownManager::Initialise()
{
#ifdef __PS3__
- cellSysutilRegisterCallback( 1, SysUtilCallback, NULL );
+ cellSysutilRegisterCallback( 1, SysUtilCallback, nullptr );
for( int i = 0; i < eThreadIdCount; i++ )
{
s_threadShouldRun[i] = true;
s_threadRunning[i] = 0;
- s_eventArray[i] = NULL;
+ s_eventArray[i] = nullptr;
}
// Special case for storage manager, which we will manually set now to be considered as running - this will be unset by StorageManager.ExitRequest if required
s_threadRunning[eStorageManagerThreads] = true;
diff --git a/Minecraft.Client/PS3/PS3Extras/TLSStorage.cpp b/Minecraft.Client/PS3/PS3Extras/TLSStorage.cpp
index 0906802d..a3b09d6d 100644
--- a/Minecraft.Client/PS3/PS3Extras/TLSStorage.cpp
+++ b/Minecraft.Client/PS3/PS3Extras/TLSStorage.cpp
@@ -4,7 +4,7 @@
-TLSStoragePS3* TLSStoragePS3::m_pInstance = NULL;
+TLSStoragePS3* TLSStoragePS3::m_pInstance = nullptr;
BOOL TLSStoragePS3::m_activeList[sc_maxSlots];
__thread LPVOID TLSStoragePS3::m_values[sc_maxSlots];
@@ -16,7 +16,7 @@ TLSStoragePS3::TLSStoragePS3()
for(int i=0;i<sc_maxSlots; i++)
{
m_activeList[i] = false;
- m_values[i] = NULL;
+ m_values[i] = nullptr;
}
}
@@ -37,7 +37,7 @@ int TLSStoragePS3::Alloc()
if(m_activeList[i] == false)
{
m_activeList[i] = true;
- m_values[i] = NULL;
+ m_values[i] = nullptr;
return i;
}
}
@@ -51,7 +51,7 @@ BOOL TLSStoragePS3::Free( DWORD _index )
return false; // not been allocated
m_activeList[_index] = false;
- m_values[_index] = NULL;
+ m_values[_index] = nullptr;
return true;
}
@@ -66,7 +66,7 @@ BOOL TLSStoragePS3::SetValue( DWORD _index, LPVOID _val )
LPVOID TLSStoragePS3::GetValue( DWORD _index )
{
if(m_activeList[_index] == false)
- return NULL;
+ return nullptr;
return m_values[_index];
}
diff --git a/Minecraft.Client/PS3/PS3Extras/winerror.h b/Minecraft.Client/PS3/PS3Extras/winerror.h
index 88763467..b9a4549c 100644
--- a/Minecraft.Client/PS3/PS3Extras/winerror.h
+++ b/Minecraft.Client/PS3/PS3Extras/winerror.h
@@ -3551,7 +3551,7 @@
//
// MessageText:
//
-// The password is too complex to be converted to a LAN Manager password. The LAN Manager password returned is a NULL string.
+// The password is too complex to be converted to a LAN Manager password. The LAN Manager password returned is a nullptr string.
//
#define ERROR_NULL_LM_PASSWORD 1304L
diff --git a/Minecraft.Client/PS3/PS3_App.cpp b/Minecraft.Client/PS3/PS3_App.cpp
index e5e23933..762866fb 100644
--- a/Minecraft.Client/PS3/PS3_App.cpp
+++ b/Minecraft.Client/PS3/PS3_App.cpp
@@ -35,7 +35,7 @@ CConsoleMinecraftApp::CConsoleMinecraftApp() : CMinecraftApp()
// debugOverlayCreated = false;
// #endif
- m_ProductListA=NULL;
+ m_ProductListA=nullptr;
m_bBootedFromDiscPatch=false;
memset(m_usrdirPathBDPatch,0,128);
m_pRemoteStorage = new SonyRemoteStorage_PS3;
@@ -117,7 +117,7 @@ BOOL CConsoleMinecraftApp::ReadProductCodes()
char chDLCTitle[64];
// 4J-PB - Read the file containing the product codes. This will be different for the SCEE/SCEA/SCEJ builds
- HANDLE file = CreateFile("PS3/PS3ProductCodes.bin", GENERIC_READ, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
+ HANDLE file = CreateFile("PS3/PS3ProductCodes.bin", GENERIC_READ, 0, nullptr, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, nullptr);
if( file == INVALID_HANDLE_VALUE )
{
//DWORD error = GetLastError();
@@ -132,14 +132,14 @@ BOOL CConsoleMinecraftApp::ReadProductCodes()
{
DWORD bytesRead;
- WRAPPED_READFILE(file,ProductCodes.chProductCode,PRODUCT_CODE_SIZE,&bytesRead,NULL);
- WRAPPED_READFILE(file,ProductCodes.chDiscProductCode,PRODUCT_CODE_SIZE,&bytesRead,NULL);
- WRAPPED_READFILE(file,ProductCodes.chSaveFolderPrefix,SAVEFOLDERPREFIX_SIZE,&bytesRead,NULL);
- WRAPPED_READFILE(file,ProductCodes.chDiscSaveFolderPrefix,SAVEFOLDERPREFIX_SIZE,&bytesRead,NULL);
- WRAPPED_READFILE(file,ProductCodes.chCommerceCategory,COMMERCE_CATEGORY_SIZE,&bytesRead,NULL);
- WRAPPED_READFILE(file,ProductCodes.chTexturePackID,SCE_NP_COMMERCE2_CATEGORY_ID_LEN,&bytesRead,NULL);
- WRAPPED_READFILE(file,ProductCodes.chUpgradeKey,UPGRADE_KEY_SIZE,&bytesRead,NULL);
- WRAPPED_READFILE(file,ProductCodes.chSkuPostfix,SKU_POSTFIX_SIZE,&bytesRead,NULL);
+ WRAPPED_READFILE(file,ProductCodes.chProductCode,PRODUCT_CODE_SIZE,&bytesRead,nullptr);
+ WRAPPED_READFILE(file,ProductCodes.chDiscProductCode,PRODUCT_CODE_SIZE,&bytesRead,nullptr);
+ WRAPPED_READFILE(file,ProductCodes.chSaveFolderPrefix,SAVEFOLDERPREFIX_SIZE,&bytesRead,nullptr);
+ WRAPPED_READFILE(file,ProductCodes.chDiscSaveFolderPrefix,SAVEFOLDERPREFIX_SIZE,&bytesRead,nullptr);
+ WRAPPED_READFILE(file,ProductCodes.chCommerceCategory,COMMERCE_CATEGORY_SIZE,&bytesRead,nullptr);
+ WRAPPED_READFILE(file,ProductCodes.chTexturePackID,SCE_NP_COMMERCE2_CATEGORY_ID_LEN,&bytesRead,nullptr);
+ WRAPPED_READFILE(file,ProductCodes.chUpgradeKey,UPGRADE_KEY_SIZE,&bytesRead,nullptr);
+ WRAPPED_READFILE(file,ProductCodes.chSkuPostfix,SKU_POSTFIX_SIZE,&bytesRead,nullptr);
app.DebugPrintf("ProductCodes.chProductCode %s\n",ProductCodes.chProductCode);
app.DebugPrintf("ProductCodes.chDiscProductCode %s\n",ProductCodes.chDiscProductCode);
@@ -152,7 +152,7 @@ BOOL CConsoleMinecraftApp::ReadProductCodes()
// DLC
unsigned int uiDLC;
- WRAPPED_READFILE(file,&uiDLC,sizeof(int),&bytesRead,NULL);
+ WRAPPED_READFILE(file,&uiDLC,sizeof(int),&bytesRead,nullptr);
for(unsigned int i=0;i<uiDLC;i++)
{
@@ -161,16 +161,16 @@ BOOL CConsoleMinecraftApp::ReadProductCodes()
memset(chDLCTitle,0,64);
unsigned int uiVal;
- WRAPPED_READFILE(file,&uiVal,sizeof(int),&bytesRead,NULL);
- WRAPPED_READFILE(file,pDLCInfo->chDLCKeyname,sizeof(char)*uiVal,&bytesRead,NULL);
+ WRAPPED_READFILE(file,&uiVal,sizeof(int),&bytesRead,nullptr);
+ WRAPPED_READFILE(file,pDLCInfo->chDLCKeyname,sizeof(char)*uiVal,&bytesRead,nullptr);
- WRAPPED_READFILE(file,&uiVal,sizeof(int),&bytesRead,NULL);
- WRAPPED_READFILE(file,chDLCTitle,sizeof(char)*uiVal,&bytesRead,NULL);
+ WRAPPED_READFILE(file,&uiVal,sizeof(int),&bytesRead,nullptr);
+ WRAPPED_READFILE(file,chDLCTitle,sizeof(char)*uiVal,&bytesRead,nullptr);
app.DebugPrintf("DLC title %s\n",chDLCTitle);
- WRAPPED_READFILE(file,&pDLCInfo->eDLCType,sizeof(int),&bytesRead,NULL);
- WRAPPED_READFILE(file,&pDLCInfo->iFirstSkin,sizeof(int),&bytesRead,NULL);
- WRAPPED_READFILE(file,&pDLCInfo->iConfig,sizeof(int),&bytesRead,NULL);
+ WRAPPED_READFILE(file,&pDLCInfo->eDLCType,sizeof(int),&bytesRead,nullptr);
+ WRAPPED_READFILE(file,&pDLCInfo->iFirstSkin,sizeof(int),&bytesRead,nullptr);
+ WRAPPED_READFILE(file,&pDLCInfo->iConfig,sizeof(int),&bytesRead,nullptr);
// push this into a vector
@@ -345,7 +345,7 @@ void CConsoleMinecraftApp::FatalLoadError()
}
app.DebugPrintf("Requesting Message Box for Fatal Error\n");
- EMsgBoxResult eResult=InputManager.RequestMessageBox(EMSgBoxType_None,0,NULL,this,(char *)u8Message,0);
+ EMsgBoxResult eResult=InputManager.RequestMessageBox(EMSgBoxType_None,0,nullptr,this,(char *)u8Message,0);
while ((eResult==EMsgBox_Busy) || (eResult==EMsgBox_SysUtilBusy))
{
@@ -359,7 +359,7 @@ void CConsoleMinecraftApp::FatalLoadError()
_Exit(0);
}
app.DebugPrintf("Requesting Message Box for Fatal Error again due to BUSY\n");
- eResult=InputManager.RequestMessageBox(EMSgBoxType_None,0,NULL,this,(char *)u8Message,0);
+ eResult=InputManager.RequestMessageBox(EMSgBoxType_None,0,nullptr,this,(char *)u8Message,0);
}
while(1)
@@ -469,7 +469,7 @@ void CConsoleMinecraftApp::FreeLocalTMSFiles(eTMSFileType eType)
LoadSaveDataThreadParam* LoadSaveFromDisk(const wstring& pathName)
{
File saveFile(pathName);
- __int64 fileSize = saveFile.length();
+ int64_t fileSize = saveFile.length();
FileInputStream fis(saveFile);
byteArray ba(fileSize);
fis.read(ba);
@@ -483,7 +483,7 @@ void CConsoleMinecraftApp::TemporaryCreateGameStart()
{
////////////////////////////////////////////////////////////////////////////////////////////// From CScene_Main::OnInit
- app.setLevelGenerationOptions(NULL);
+ app.setLevelGenerationOptions(nullptr);
// From CScene_Main::RunPlayGame
Minecraft *pMinecraft=Minecraft::GetInstance();
@@ -507,8 +507,8 @@ void CConsoleMinecraftApp::TemporaryCreateGameStart()
StorageManager.SetSaveTitle(wWorldName.c_str());
bool isFlat = false;
- __int64 seedValue = 0;//BiomeSource::findSeed(isFlat?LevelType::lvl_flat:LevelType::lvl_normal); // 4J - was (new Random())->nextLong() - now trying to actually find a seed to suit our requirements
-// __int64 seedValue = 0xfd97203ebdbf5c6f;
+ int64_t seedValue = 0;//BiomeSource::findSeed(isFlat?LevelType::lvl_flat:LevelType::lvl_normal); // 4J - was (new Random())->nextLong() - now trying to actually find a seed to suit our requirements
+// int64_t seedValue = 0xfd97203ebdbf5c6f;
unsigned int seedLow = (unsigned int )(seedValue & 0xffffffff);
unsigned int seedHigh = (unsigned int )(seedValue>>32);
#ifndef _CONTENT_PACKAGE
@@ -521,7 +521,7 @@ void CConsoleMinecraftApp::TemporaryCreateGameStart()
#ifdef SAVE_GAME_TO_LOAD
param->saveData = LoadSaveFromDisk(wstring(SAVE_GAME_TO_LOAD));
#else
- param->saveData = NULL;
+ param->saveData = nullptr;
#endif
app.SetGameHostOption(eGameHostOption_Difficulty,0);
app.SetGameHostOption(eGameHostOption_FriendsOfFriends,0);
@@ -728,7 +728,7 @@ SonyCommerce::CategoryInfo *CConsoleMinecraftApp::GetCategoryInfo()
{
if(m_bCommerceCategoriesRetrieved==false)
{
- return NULL;
+ return nullptr;
}
return &m_CategoryInfo;
@@ -742,10 +742,10 @@ void CConsoleMinecraftApp::ClearCommerceDetails()
pProductList->clear();
}
- if(m_ProductListA!=NULL)
+ if(m_ProductListA!=nullptr)
{
delete [] m_ProductListA;
- m_ProductListA=NULL;
+ m_ProductListA=nullptr;
}
m_ProductListRetrievedC=0;
@@ -769,7 +769,7 @@ void CConsoleMinecraftApp::GetDLCSkuIDFromProductList(char * pchDLCProductID, ch
// find the DLC
for(int i=0;i<m_ProductListCategoriesC;i++)
{
- for(int j=0;j<m_ProductListA[i].size();j++)
+ for(size_t j=0;j<m_ProductListA[i].size();j++)
{
std::vector<SonyCommerce::ProductInfo>* pProductList=&m_ProductListA[i];
auto itEnd = pProductList->end();
@@ -831,7 +831,7 @@ std::vector<SonyCommerce::ProductInfo>* CConsoleMinecraftApp::GetProductList(int
{
if((m_bCommerceProductListRetrieved==false) || (m_bProductListAdditionalDetailsRetrieved==false) )
{
- return NULL;
+ return nullptr;
}
return &m_ProductListA[iIndex];
@@ -842,7 +842,7 @@ bool CConsoleMinecraftApp::DLCAlreadyPurchased(char *pchTitle)
// find the DLC
for(int i=0;i<m_ProductListCategoriesC;i++)
{
- for(int j=0;j<m_ProductListA[i].size();j++)
+ for(size_t j=0;j<m_ProductListA[i].size();j++)
{
std::vector<SonyCommerce::ProductInfo>* pProductList=&m_ProductListA[i];
auto itEnd = pProductList->end();
@@ -1181,7 +1181,7 @@ char *PatchFilelist[] =
- NULL
+ nullptr
};
bool CConsoleMinecraftApp::IsFileInPatchList(LPCSTR lpFileName)
@@ -1226,7 +1226,7 @@ bool CConsoleMinecraftApp::CheckForEmptyStore(int iPad)
SonyCommerce::CategoryInfo *pCategories=app.GetCategoryInfo();
bool bEmptyStore=true;
- if(pCategories!=NULL)
+ if(pCategories!=nullptr)
{
if(pCategories->countOfProducts>0)
{
diff --git a/Minecraft.Client/PS3/PS3_App.h b/Minecraft.Client/PS3/PS3_App.h
index d1ecdb6f..f9293b6f 100644
--- a/Minecraft.Client/PS3/PS3_App.h
+++ b/Minecraft.Client/PS3/PS3_App.h
@@ -88,7 +88,7 @@ public:
// void SetVoiceChatAndUGCRestricted(bool bRestricted);
// bool GetVoiceChatAndUGCRestricted(void);
- StringTable *GetStringTable() { return NULL;}
+ StringTable *GetStringTable() { return nullptr;}
// original code
virtual void TemporaryCreateGameStart();
diff --git a/Minecraft.Client/PS3/PS3_Minecraft.cpp b/Minecraft.Client/PS3/PS3_Minecraft.cpp
index 53b47d2d..fb987a9e 100644
--- a/Minecraft.Client/PS3/PS3_Minecraft.cpp
+++ b/Minecraft.Client/PS3/PS3_Minecraft.cpp
@@ -86,6 +86,7 @@ char secureFileId[CELL_SAVEDATA_SECUREFILEID_SIZE] =
#include "..\..\Minecraft.Client\Tesselator.h"
#include "..\Common\Console_Awards_enum.h"
#include "..\..\Minecraft.Client\Options.h"
+#include "..\GameRenderer.h"
#include "Sentient\SentientManager.h"
#include "..\..\Minecraft.World\IntCache.h"
#include "..\Textures.h"
@@ -355,9 +356,9 @@ void MemSect(int sect)
#endif
-ID3D11Device* g_pd3dDevice = NULL;
-ID3D11DeviceContext* g_pImmediateContext = NULL;
-IDXGISwapChain* g_pSwapChain = NULL;
+ID3D11Device* g_pd3dDevice = nullptr;
+ID3D11DeviceContext* g_pImmediateContext = nullptr;
+IDXGISwapChain* g_pSwapChain = nullptr;
bool g_bBootedFromInvite = false;
//--------------------------------------------------------------------------------------
@@ -419,7 +420,7 @@ static void * load_file( char const * name )
void debugSaveGameDirect()
{
- C4JThread* thread = new C4JThread(&IUIScene_PauseMenu::SaveWorldThreadProc, NULL, "debugSaveGameDirect");
+ C4JThread* thread = new C4JThread(&IUIScene_PauseMenu::SaveWorldThreadProc, nullptr, "debugSaveGameDirect");
thread->Run();
thread->WaitForCompletion(1000);
}
@@ -446,7 +447,7 @@ int simpleMessageBoxCallback( UINT uiTitle, UINT uiText,
ui.RequestMessageBox( uiTitle, uiText,
uiOptionA, uiOptionC, dwPad,
Func, lpParam, app.GetStringTable(),
- NULL, 0
+ nullptr, 0
);
return 0;
@@ -632,7 +633,7 @@ int LoadSysModules()
DEBUG_PRINTF("contentInfoPath - %s\n",contentInfoPath);
DEBUG_PRINTF("usrdirPath - %s\n",usrdirPath);
- ret=cellGamePatchCheck(&sizeBD,NULL);
+ ret=cellGamePatchCheck(&sizeBD,nullptr);
if(ret < 0)
{
DEBUG_PRINTF("cellGamePatchCheck() Error: 0x%x\n", ret);
@@ -838,7 +839,7 @@ int main()
else
ui.init(1280,480);
- app.CommerceInit(); // MGH - moved this here so GetCommerce isn't NULL
+ app.CommerceInit(); // MGH - moved this here so GetCommerce isn't nullptr
// 4J-PB - Kick of the check for trial or full version - requires ui to be initialised
app.GetCommerce()->CheckForTrialUpgradeKey();
@@ -861,7 +862,7 @@ int main()
}
// Create an XAudio2 mastering voice (utilized by XHV2 when voice data is mixed to main speakers)
- hr = g_pXAudio2->CreateMasteringVoice(&g_pXAudio2MasteringVoice, XAUDIO2_DEFAULT_CHANNELS, XAUDIO2_DEFAULT_SAMPLERATE, 0, 0, NULL);
+ hr = g_pXAudio2->CreateMasteringVoice(&g_pXAudio2MasteringVoice, XAUDIO2_DEFAULT_CHANNELS, XAUDIO2_DEFAULT_SAMPLERATE, 0, 0, nullptr);
if ( FAILED( hr ) )
{
app.DebugPrintf( "Creating XAudio2 mastering voice failed (err = 0x%08x)!\n", hr );
@@ -976,24 +977,24 @@ int main()
free(szTemp);
StorageManager.SetDefaultImages((PBYTE)baOptionsIcon.data, baOptionsIcon.length,(PBYTE)baSaveImage.data, baSaveImage.length,(PBYTE)baSaveThumbnail.data, baSaveThumbnail.length);
- if(baOptionsIcon.data!=NULL)
+ if(baOptionsIcon.data!=nullptr)
{
delete [] baOptionsIcon.data;
}
- if(baSaveThumbnail.data!=NULL)
+ if(baSaveThumbnail.data!=nullptr)
{
delete [] baSaveThumbnail.data;
}
- if(baSaveImage.data!=NULL)
+ if(baSaveImage.data!=nullptr)
{
delete [] baSaveImage.data;
}
wstring wsName=L"Graphics\\SaveChest.png";
byteArray baSaveLoadIcon = app.getArchiveFile(wsName);
- if(baSaveLoadIcon.data!=NULL)
+ if(baSaveLoadIcon.data!=nullptr)
{
StorageManager.SetSaveLoadIcon((PBYTE)baSaveLoadIcon.data, baSaveLoadIcon.length);
delete [] baSaveLoadIcon.data;
@@ -1038,7 +1039,7 @@ int main()
}*/
// set the achievement text for a trial achievement, now we have the string table loaded
- ProfileManager.SetTrialTextStringTable(NULL, IDS_CONFIRM_OK, IDS_CONFIRM_CANCEL);
+ ProfileManager.SetTrialTextStringTable(nullptr, IDS_CONFIRM_OK, IDS_CONFIRM_CANCEL);
ProfileManager.SetTrialAwardText(eAwardType_Achievement,IDS_UNLOCK_TITLE,IDS_UNLOCK_ACHIEVEMENT_TEXT);
#ifndef __PS3__
ProfileManager.SetTrialAwardText(eAwardType_GamerPic,IDS_UNLOCK_TITLE,IDS_UNLOCK_GAMERPIC_TEXT);
@@ -1108,7 +1109,7 @@ int main()
// It's ok to do this for the primary PSN player here - it has this data locally. All other players need to do it on PSN sign in.
// bool bChatRestricted=false;
-// ProfileManager.GetChatAndContentRestrictions(0,&bChatRestricted,NULL,NULL);
+// ProfileManager.GetChatAndContentRestrictions(0,&bChatRestricted,nullptr,nullptr);
// 4J-PB - really want to wait until we've read the options, so we can set the right language if they've chosen one other than the default
// bool bOptionsRead=false;
@@ -1197,7 +1198,7 @@ int main()
else
{
MemSect(28);
- pMinecraft->soundEngine->tick(NULL, 0.0f);
+ pMinecraft->soundEngine->tick(nullptr, 0.0f);
MemSect(0);
pMinecraft->textures->tick(true,false);
IntCache::Reset();
@@ -1245,6 +1246,8 @@ int main()
ui.tick();
ui.render();
+ pMinecraft->gameRenderer->ApplyGammaPostProcess();
+
// Present the frame.
PIXBeginNamedEvent(0,"Frame present");
RenderManager.Present();
@@ -1366,7 +1369,7 @@ vector<uint8_t *> vRichPresenceStrings;
uint8_t * AddRichPresenceString(int iID)
{
uint8_t *strUtf8 = mallocAndCreateUTF8ArrayFromString(iID);
- if( strUtf8 != NULL )
+ if( strUtf8 != nullptr )
{
vRichPresenceStrings.push_back(strUtf8);
}
@@ -1376,7 +1379,7 @@ uint8_t * AddRichPresenceString(int iID)
void FreeRichPresenceStrings()
{
uint8_t *strUtf8;
- for(int i=0;i<vRichPresenceStrings.size();i++)
+ for(size_t i=0;i<vRichPresenceStrings.size();i++)
{
strUtf8=vRichPresenceStrings.at(i);
free(strUtf8);
diff --git a/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/BedTile_SPU.h b/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/BedTile_SPU.h
index 8196032e..929cc0d1 100644
--- a/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/BedTile_SPU.h
+++ b/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/BedTile_SPU.h
@@ -17,10 +17,10 @@ public:
BedTile_SPU(int id) : Tile_SPU(id) {}
- virtual Icon_SPU *getTexture(int face, int data) { return NULL; }
+ virtual Icon_SPU *getTexture(int face, int data) { return nullptr; }
virtual int getRenderShape() { return Tile_SPU::SHAPE_BED; }
virtual bool isSolidRender(bool isServerLevel = false) { return false; }
- virtual void updateShape(LevelSource *level, int x, int y, int z, int forceData = -1, TileEntity* forceEntity = NULL) // 4J added forceData, forceEntity param
+ virtual void updateShape(LevelSource *level, int x, int y, int z, int forceData = -1, TileEntity* forceEntity = nullptr) // 4J added forceData, forceEntity param
{
setShape();
}
diff --git a/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/ButtonTile_SPU.h b/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/ButtonTile_SPU.h
index f34a5ec9..1009396c 100644
--- a/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/ButtonTile_SPU.h
+++ b/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/ButtonTile_SPU.h
@@ -18,7 +18,7 @@ public:
virtual bool blocksLight() { return false; }
virtual bool isSolidRender(bool isServerLevel = false) { return false; }
virtual bool isCubeShaped() { return false; }
- virtual void updateShape(ChunkRebuildData *level, int x, int y, int z, int forceData = -1, TileEntity* forceEntity = NULL) // 4J added forceData, forceEntity param
+ virtual void updateShape(ChunkRebuildData *level, int x, int y, int z, int forceData = -1, TileEntity* forceEntity = nullptr) // 4J added forceData, forceEntity param
{
int data = level->getData(x, y, z);
int dir = data & 7;
diff --git a/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/CakeTile_SPU.h b/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/CakeTile_SPU.h
index 07eb3d86..e617e84c 100644
--- a/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/CakeTile_SPU.h
+++ b/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/CakeTile_SPU.h
@@ -5,7 +5,7 @@ class CakeTile_SPU : public Tile_SPU
{
public:
CakeTile_SPU(int id) : Tile_SPU(id) {}
- virtual void updateShape(ChunkRebuildData *level, int x, int y, int z, int forceData = -1, TileEntity* forceEntity = NULL) // 4J added forceData, forceEntity param
+ virtual void updateShape(ChunkRebuildData *level, int x, int y, int z, int forceData = -1, TileEntity* forceEntity = nullptr) // 4J added forceData, forceEntity param
{
int d = level->getData(x, y, z);
float r = 1 / 16.0f;
diff --git a/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/CauldronTile_SPU.h b/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/CauldronTile_SPU.h
index 2854b48b..199fceb6 100644
--- a/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/CauldronTile_SPU.h
+++ b/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/CauldronTile_SPU.h
@@ -6,7 +6,7 @@ class CauldronTile_SPU : public Tile_SPU
{
public:
CauldronTile_SPU(int id) : Tile_SPU(id) {}
- virtual Icon_SPU *getTexture(int face, int data) { return NULL; }
+ virtual Icon_SPU *getTexture(int face, int data) { return nullptr; }
//@Override
// virtual void updateDefaultShape();
virtual bool isSolidRender(bool isServerLevel = false) { return false; }
diff --git a/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/ChunkRebuildData.cpp b/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/ChunkRebuildData.cpp
index 1cb5e2ee..ac71c572 100644
--- a/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/ChunkRebuildData.cpp
+++ b/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/ChunkRebuildData.cpp
@@ -241,12 +241,12 @@ void ChunkRebuildData::createTileData()
m_tileData.signalSource.set(i, Tile::tiles[i]->isSignalSource());
m_tileData.cubeShaped.set(i, Tile::tiles[i]->isCubeShaped());
- m_tileData.xx0[i] = (float)Tile::tiles[i]->getShapeX0();
- m_tileData.yy0[i] = (float)Tile::tiles[i]->getShapeY0();
- m_tileData.zz0[i] = (float)Tile::tiles[i]->getShapeZ0();
- m_tileData.xx1[i] = (float)Tile::tiles[i]->getShapeX1();
- m_tileData.yy1[i] = (float)Tile::tiles[i]->getShapeY1();
- m_tileData.zz1[i] = (float)Tile::tiles[i]->getShapeZ1();
+ m_tileData.xx0[i] = static_cast<float>(Tile::tiles[i]->getShapeX0());
+ m_tileData.yy0[i] = static_cast<float>(Tile::tiles[i]->getShapeY0());
+ m_tileData.zz0[i] = static_cast<float>(Tile::tiles[i]->getShapeZ0());
+ m_tileData.xx1[i] = static_cast<float>(Tile::tiles[i]->getShapeX1());
+ m_tileData.yy1[i] = static_cast<float>(Tile::tiles[i]->getShapeY1());
+ m_tileData.zz1[i] = static_cast<float>(Tile::tiles[i]->getShapeZ1());
Icon* pTex = Tile::tiles[i]->icon;
if(pTex)
{
@@ -269,17 +269,17 @@ void ChunkRebuildData::createTileData()
setIconSPUFromIcon(&m_tileData.grass_iconSideOverlay, Tile::grass->iconSideOverlay);
// ThinFence
- setIconSPUFromIcon(&m_tileData.ironFence_EdgeTexture, ((ThinFenceTile*)Tile::ironFence)->getEdgeTexture());
- setIconSPUFromIcon(&m_tileData.thinGlass_EdgeTexture, ((ThinFenceTile*)Tile::thinGlass)->getEdgeTexture());
+ setIconSPUFromIcon(&m_tileData.ironFence_EdgeTexture, static_cast<ThinFenceTile *>(Tile::ironFence)->getEdgeTexture());
+ setIconSPUFromIcon(&m_tileData.thinGlass_EdgeTexture, static_cast<ThinFenceTile *>(Tile::thinGlass)->getEdgeTexture());
//FarmTile
- setIconSPUFromIcon(&m_tileData.farmTile_Dry, ((FarmTile*)Tile::farmland)->iconDry);
- setIconSPUFromIcon(&m_tileData.farmTile_Wet, ((FarmTile*)Tile::farmland)->iconWet);
+ setIconSPUFromIcon(&m_tileData.farmTile_Dry, static_cast<FarmTile *>(Tile::farmland)->iconDry);
+ setIconSPUFromIcon(&m_tileData.farmTile_Wet, static_cast<FarmTile *>(Tile::farmland)->iconWet);
// DoorTile
for(int i=0;i<8; i++)
{
- setIconSPUFromIcon(&m_tileData.doorTile_Icons[i], ((DoorTile*)Tile::door_wood)->icons[i]);
+ setIconSPUFromIcon(&m_tileData.doorTile_Icons[i], static_cast<DoorTile *>(Tile::door_wood)->icons[i]);
// we're not supporting flipped icons, so manually flip here
if(i>=4)
m_tileData.doorTile_Icons[i].flipHorizontal();
@@ -291,20 +291,20 @@ void ChunkRebuildData::createTileData()
// SandStoneTile
for(int i=0;i<3; i++)
- setIconSPUFromIcon(&m_tileData.sandStone_icons[i], ((SandStoneTile*)Tile::sandStone)->icons[i]);
- setIconSPUFromIcon(&m_tileData.sandStone_iconTop, ((SandStoneTile*)Tile::sandStone)->iconTop);
- setIconSPUFromIcon(&m_tileData.sandStone_iconBottom, ((SandStoneTile*)Tile::sandStone)->iconBottom);
+ setIconSPUFromIcon(&m_tileData.sandStone_icons[i], static_cast<SandStoneTile *>(Tile::sandStone)->icons[i]);
+ setIconSPUFromIcon(&m_tileData.sandStone_iconTop, static_cast<SandStoneTile *>(Tile::sandStone)->iconTop);
+ setIconSPUFromIcon(&m_tileData.sandStone_iconBottom, static_cast<SandStoneTile *>(Tile::sandStone)->iconBottom);
// WoodTile
// assert(WoodTile_SPU::WOOD_NAMES_LENGTH == 4);
for(int i=0;i<4; i++)
- setIconSPUFromIcon(&m_tileData.woodTile_icons[i], ((WoodTile*)Tile::wood)->icons[i]);
+ setIconSPUFromIcon(&m_tileData.woodTile_icons[i], static_cast<WoodTile *>(Tile::wood)->icons[i]);
// TreeTile
// assert(TreeTile_SPU::TREE_NAMES_LENGTH == 4);
for(int i=0;i<4; i++)
- setIconSPUFromIcon(&m_tileData.treeTile_icons[i], ((TreeTile*)Tile::treeTrunk)->icons[i]);
- setIconSPUFromIcon(&m_tileData.treeTile_iconTop, ((TreeTile*)Tile::treeTrunk)->iconTop);
+ setIconSPUFromIcon(&m_tileData.treeTile_icons[i], static_cast<TreeTile *>(Tile::treeTrunk)->icons[i]);
+ setIconSPUFromIcon(&m_tileData.treeTile_iconTop, static_cast<TreeTile *>(Tile::treeTrunk)->iconTop);
// LeafTile
for(int i=0;i<2; i++)
@@ -313,12 +313,12 @@ void ChunkRebuildData::createTileData()
// CropTile
for(int i=0;i<8; i++)
- setIconSPUFromIcon(&m_tileData.cropTile_icons[i], ((CropTile*)Tile::crops)->icons[i]);
+ setIconSPUFromIcon(&m_tileData.cropTile_icons[i], static_cast<CropTile *>(Tile::crops)->icons[i]);
// FurnaceTile
- setIconSPUFromIcon(&m_tileData.furnaceTile_iconTop, ((FurnaceTile*)Tile::furnace)->iconTop);
- setIconSPUFromIcon(&m_tileData.furnaceTile_iconFront, ((FurnaceTile*)Tile::furnace)->iconFront);
- setIconSPUFromIcon(&m_tileData.furnaceTile_iconFront_lit, ((FurnaceTile*)Tile::furnace_lit)->iconFront);
+ setIconSPUFromIcon(&m_tileData.furnaceTile_iconTop, static_cast<FurnaceTile *>(Tile::furnace)->iconTop);
+ setIconSPUFromIcon(&m_tileData.furnaceTile_iconFront, static_cast<FurnaceTile *>(Tile::furnace)->iconFront);
+ setIconSPUFromIcon(&m_tileData.furnaceTile_iconFront_lit, static_cast<FurnaceTile *>(Tile::furnace_lit)->iconFront);
//LiquidTile
setIconSPUFromIcon(&m_tileData.liquidTile_iconWaterStill, (Tile::water)->icons[0]);
@@ -332,64 +332,64 @@ void ChunkRebuildData::createTileData()
// Sapling
for(int i=0;i<4;i++)
- setIconSPUFromIcon(&m_tileData.sapling_icons[i], ((Sapling*)Tile::sapling)->icons[i]);
+ setIconSPUFromIcon(&m_tileData.sapling_icons[i], static_cast<Sapling *>(Tile::sapling)->icons[i]);
- m_tileData.glassTile_allowSame = ((GlassTile*)Tile::glass)->allowSame;
- m_tileData.iceTile_allowSame = ((IceTile*)Tile::ice)->allowSame;
+ m_tileData.glassTile_allowSame = static_cast<GlassTile *>(Tile::glass)->allowSame;
+ m_tileData.iceTile_allowSame = static_cast<IceTile *>(Tile::ice)->allowSame;
// DispenserTile
- setIconSPUFromIcon(&m_tileData.dispenserTile_iconTop, ((DispenserTile*)Tile::dispenser)->iconTop);
- setIconSPUFromIcon(&m_tileData.dispenserTile_iconFront, ((DispenserTile*)Tile::dispenser)->iconFront);
- setIconSPUFromIcon(&m_tileData.dispenserTile_iconFrontVertical, ((DispenserTile*)Tile::dispenser)->iconFrontVertical);
+ setIconSPUFromIcon(&m_tileData.dispenserTile_iconTop, static_cast<DispenserTile *>(Tile::dispenser)->iconTop);
+ setIconSPUFromIcon(&m_tileData.dispenserTile_iconFront, static_cast<DispenserTile *>(Tile::dispenser)->iconFront);
+ setIconSPUFromIcon(&m_tileData.dispenserTile_iconFrontVertical, static_cast<DispenserTile *>(Tile::dispenser)->iconFrontVertical);
// RailTile
- setIconSPUFromIcon(&m_tileData.railTile_iconTurn, ((RailTile*)Tile::rail)->iconTurn);
- setIconSPUFromIcon(&m_tileData.railTile_iconTurnGolden, ((RailTile*)Tile::goldenRail)->iconTurn);
+ setIconSPUFromIcon(&m_tileData.railTile_iconTurn, static_cast<RailTile *>(Tile::rail)->iconTurn);
+ setIconSPUFromIcon(&m_tileData.railTile_iconTurnGolden, static_cast<RailTile *>(Tile::goldenRail)->iconTurn);
for(int i=0;i<2;i++)
- setIconSPUFromIcon(&m_tileData.detectorRailTile_icons[i], ((DetectorRailTile*)Tile::detectorRail)->icons[i]);
+ setIconSPUFromIcon(&m_tileData.detectorRailTile_icons[i], static_cast<DetectorRailTile *>(Tile::detectorRail)->icons[i]);
// tntTile
- setIconSPUFromIcon(&m_tileData.tntTile_iconBottom, ((TntTile*)Tile::tnt)->iconBottom);
- setIconSPUFromIcon(&m_tileData.tntTile_iconTop, ((TntTile*)Tile::tnt)->iconTop);
+ setIconSPUFromIcon(&m_tileData.tntTile_iconBottom, static_cast<TntTile *>(Tile::tnt)->iconBottom);
+ setIconSPUFromIcon(&m_tileData.tntTile_iconTop, static_cast<TntTile *>(Tile::tnt)->iconTop);
// workbenchTile
- setIconSPUFromIcon(&m_tileData.workBench_iconFront, ((WorkbenchTile*)Tile::workBench)->iconFront);
- setIconSPUFromIcon(&m_tileData.workBench_iconTop, ((WorkbenchTile*)Tile::workBench)->iconTop);
+ setIconSPUFromIcon(&m_tileData.workBench_iconFront, static_cast<WorkbenchTile *>(Tile::workBench)->iconFront);
+ setIconSPUFromIcon(&m_tileData.workBench_iconTop, static_cast<WorkbenchTile *>(Tile::workBench)->iconTop);
// cactusTile
- setIconSPUFromIcon(&m_tileData.cactusTile_iconTop, ((CactusTile*)Tile::cactus)->iconTop);
- setIconSPUFromIcon(&m_tileData.cactusTile_iconBottom, ((CactusTile*)Tile::cactus)->iconBottom);
+ setIconSPUFromIcon(&m_tileData.cactusTile_iconTop, static_cast<CactusTile *>(Tile::cactus)->iconTop);
+ setIconSPUFromIcon(&m_tileData.cactusTile_iconBottom, static_cast<CactusTile *>(Tile::cactus)->iconBottom);
// recordPlayer
- setIconSPUFromIcon(&m_tileData.recordPlayer_iconTop, ((RecordPlayerTile*)Tile::recordPlayer)->iconTop);
+ setIconSPUFromIcon(&m_tileData.recordPlayer_iconTop, static_cast<RecordPlayerTile *>(Tile::recordPlayer)->iconTop);
// pumpkin
- setIconSPUFromIcon(&m_tileData.pumpkinTile_iconTop, ((PumpkinTile*)Tile::pumpkin)->iconTop);
- setIconSPUFromIcon(&m_tileData.pumpkinTile_iconFace, ((PumpkinTile*)Tile::pumpkin)->iconFace);
- setIconSPUFromIcon(&m_tileData.pumpkinTile_iconFaceLit, ((PumpkinTile*)Tile::litPumpkin)->iconFace);
+ setIconSPUFromIcon(&m_tileData.pumpkinTile_iconTop, static_cast<PumpkinTile *>(Tile::pumpkin)->iconTop);
+ setIconSPUFromIcon(&m_tileData.pumpkinTile_iconFace, static_cast<PumpkinTile *>(Tile::pumpkin)->iconFace);
+ setIconSPUFromIcon(&m_tileData.pumpkinTile_iconFaceLit, static_cast<PumpkinTile *>(Tile::litPumpkin)->iconFace);
// cakeTile
- setIconSPUFromIcon(&m_tileData.cakeTile_iconTop, ((CakeTile*)Tile::cake)->iconTop);
- setIconSPUFromIcon(&m_tileData.cakeTile_iconBottom, ((CakeTile*)Tile::cake)->iconBottom);
- setIconSPUFromIcon(&m_tileData.cakeTile_iconInner, ((CakeTile*)Tile::cake)->iconInner);
+ setIconSPUFromIcon(&m_tileData.cakeTile_iconTop, static_cast<CakeTile *>(Tile::cake)->iconTop);
+ setIconSPUFromIcon(&m_tileData.cakeTile_iconBottom, static_cast<CakeTile *>(Tile::cake)->iconBottom);
+ setIconSPUFromIcon(&m_tileData.cakeTile_iconInner, static_cast<CakeTile *>(Tile::cake)->iconInner);
// SmoothStoneBrickTile
for(int i=0;i<4;i++)
- setIconSPUFromIcon(&m_tileData.smoothStoneBrick_icons[i], ((SmoothStoneBrickTile*)Tile::stoneBrickSmooth)->icons[i]);
+ setIconSPUFromIcon(&m_tileData.smoothStoneBrick_icons[i], static_cast<SmoothStoneBrickTile *>(Tile::stoneBrickSmooth)->icons[i]);
// HugeMushroomTile
for(int i=0;i<2;i++)
- setIconSPUFromIcon(&m_tileData.hugeMushroom_icons[i], ((HugeMushroomTile*)Tile::hugeMushroom1)->icons[i]);
- setIconSPUFromIcon(&m_tileData.hugeMushroom_iconStem, ((HugeMushroomTile*)Tile::hugeMushroom1)->iconStem);
- setIconSPUFromIcon(&m_tileData.hugeMushroom_iconInside, ((HugeMushroomTile*)Tile::hugeMushroom1)->iconInside);
+ setIconSPUFromIcon(&m_tileData.hugeMushroom_icons[i], static_cast<HugeMushroomTile *>(Tile::hugeMushroom1)->icons[i]);
+ setIconSPUFromIcon(&m_tileData.hugeMushroom_iconStem, static_cast<HugeMushroomTile *>(Tile::hugeMushroom1)->iconStem);
+ setIconSPUFromIcon(&m_tileData.hugeMushroom_iconInside, static_cast<HugeMushroomTile *>(Tile::hugeMushroom1)->iconInside);
// MelonTile
- setIconSPUFromIcon(&m_tileData.melonTile_iconTop, ((MelonTile*)Tile::melon)->iconTop);
+ setIconSPUFromIcon(&m_tileData.melonTile_iconTop, static_cast<MelonTile *>(Tile::melon)->iconTop);
// StemTile
- setIconSPUFromIcon(&m_tileData.stemTile_iconAngled, ((StemTile*)Tile::melonStem)->iconAngled);
+ setIconSPUFromIcon(&m_tileData.stemTile_iconAngled, static_cast<StemTile *>(Tile::melonStem)->iconAngled);
// MycelTile
setIconSPUFromIcon(&m_tileData.mycelTile_iconTop, (Tile::mycel)->iconTop);
@@ -397,14 +397,14 @@ void ChunkRebuildData::createTileData()
// NetherStalkTile
for(int i=0;i<3;i++)
- setIconSPUFromIcon(&m_tileData.netherStalk_icons[i], ((NetherStalkTile*)Tile::netherStalk)->icons[i]);
+ setIconSPUFromIcon(&m_tileData.netherStalk_icons[i], static_cast<NetherStalkTile *>(Tile::netherStalk)->icons[i]);
// EnchantmentTableTile
- setIconSPUFromIcon(&m_tileData.enchantmentTable_iconTop, ((EnchantmentTableTile*)Tile::enchantTable)->iconTop);
- setIconSPUFromIcon(&m_tileData.enchantmentTable_iconBottom, ((EnchantmentTableTile*)Tile::enchantTable)->iconBottom);
+ setIconSPUFromIcon(&m_tileData.enchantmentTable_iconTop, static_cast<EnchantmentTableTile *>(Tile::enchantTable)->iconTop);
+ setIconSPUFromIcon(&m_tileData.enchantmentTable_iconBottom, static_cast<EnchantmentTableTile *>(Tile::enchantTable)->iconBottom);
//BrewingStandTile
- setIconSPUFromIcon(&m_tileData.brewingStand_iconBase, ((BrewingStandTile*)Tile::brewingStand)->iconBase);
+ setIconSPUFromIcon(&m_tileData.brewingStand_iconBase, static_cast<BrewingStandTile *>(Tile::brewingStand)->iconBase);
//RedStoneDust
setIconSPUFromIcon(&m_tileData.redStoneDust_iconCross, (Tile::redStoneDust)->iconCross);
@@ -412,32 +412,32 @@ void ChunkRebuildData::createTileData()
setIconSPUFromIcon(&m_tileData.redStoneDust_iconCrossOver, (Tile::redStoneDust)->iconCrossOver);
setIconSPUFromIcon(&m_tileData.redStoneDust_iconLineOver, (Tile::redStoneDust)->iconLineOver);
- setIconSPUFromIcon(&m_tileData.stoneSlab_iconSide, ((StoneSlabTile*)(Tile::stoneSlab))->iconSide);
+ setIconSPUFromIcon(&m_tileData.stoneSlab_iconSide, static_cast<StoneSlabTile *>(Tile::stoneSlab)->iconSide);
for(int i=0;i<16;i++)
- setIconSPUFromIcon(&m_tileData.clothTile_icons[i], ((ClothTile*)Tile::cloth)->icons[i]);
+ setIconSPUFromIcon(&m_tileData.clothTile_icons[i], static_cast<ClothTile *>(Tile::cloth)->icons[i]);
// CarrotTile
for(int i=0;i<4;i++)
- setIconSPUFromIcon(&m_tileData.carrot_icons[i], ((CarrotTile*)Tile::carrots)->icons[i]);
+ setIconSPUFromIcon(&m_tileData.carrot_icons[i], static_cast<CarrotTile *>(Tile::carrots)->icons[i]);
// PotatoTile
for(int i=0;i<4;i++)
- setIconSPUFromIcon(&m_tileData.potato_icons[i], ((PotatoTile*)Tile::potatoes)->icons[i]);
+ setIconSPUFromIcon(&m_tileData.potato_icons[i], static_cast<PotatoTile *>(Tile::potatoes)->icons[i]);
// AnvilTile
for(int i=0;i<3;i++)
- setIconSPUFromIcon(&m_tileData.anvil_icons[i], ((AnvilTile*)Tile::anvil)->icons[i]);
+ setIconSPUFromIcon(&m_tileData.anvil_icons[i], static_cast<AnvilTile *>(Tile::anvil)->icons[i]);
// QuartzBlockTile
for(int i=0;i<5;i++)
- setIconSPUFromIcon(&m_tileData.quartzBlock_icons[i], ((QuartzBlockTile*)Tile::quartzBlock)->icons[i]);
+ setIconSPUFromIcon(&m_tileData.quartzBlock_icons[i], static_cast<QuartzBlockTile *>(Tile::quartzBlock)->icons[i]);
- setIconSPUFromIcon(&m_tileData.quartzBlock_iconChiseledTop, ((QuartzBlockTile*)Tile::quartzBlock)->iconChiseledTop);
- setIconSPUFromIcon(&m_tileData.quartzBlock_iconLinesTop, ((QuartzBlockTile*)Tile::quartzBlock)->iconLinesTop);
- setIconSPUFromIcon(&m_tileData.quartzBlock_iconTop, ((QuartzBlockTile*)Tile::quartzBlock)->iconTop);
- setIconSPUFromIcon(&m_tileData.quartzBlock_iconBottom, ((QuartzBlockTile*)Tile::quartzBlock)->iconBottom);
+ setIconSPUFromIcon(&m_tileData.quartzBlock_iconChiseledTop, static_cast<QuartzBlockTile *>(Tile::quartzBlock)->iconChiseledTop);
+ setIconSPUFromIcon(&m_tileData.quartzBlock_iconLinesTop, static_cast<QuartzBlockTile *>(Tile::quartzBlock)->iconLinesTop);
+ setIconSPUFromIcon(&m_tileData.quartzBlock_iconTop, static_cast<QuartzBlockTile *>(Tile::quartzBlock)->iconTop);
+ setIconSPUFromIcon(&m_tileData.quartzBlock_iconBottom, static_cast<QuartzBlockTile *>(Tile::quartzBlock)->iconBottom);
}
// extern int g_lastHitBlockX;
@@ -696,7 +696,7 @@ bool ChunkRebuildData::isEmptyTile(int x, int y, int z)
bool ChunkRebuildData::isSolidRenderTile(int x, int y, int z)
{
TileRef_SPU tile(getTile(x,y,z));
- if (tile.getPtr() == NULL) return false;
+ if (tile.getPtr() == nullptr) return false;
// 4J - addition here to make rendering big blocks of leaves more efficient. Normally leaves never consider themselves as solid, so
@@ -727,7 +727,7 @@ bool ChunkRebuildData::isSolidRenderTile(int x, int y, int z)
bool ChunkRebuildData::isSolidBlockingTile(int x, int y, int z)
{
TileRef_SPU tile(getTile(x, y, z));
- if (tile.getPtr() == NULL) return false;
+ if (tile.getPtr() == nullptr) return false;
bool ret = tile->getMaterial()->blocksMotion() && tile->isCubeShaped();
return ret;
}
diff --git a/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/DoorTile_SPU.h b/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/DoorTile_SPU.h
index f6671db4..2fcb1514 100644
--- a/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/DoorTile_SPU.h
+++ b/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/DoorTile_SPU.h
@@ -24,7 +24,7 @@ public:
virtual bool blocksLight() { return false; }
virtual bool isSolidRender(bool isServerLevel = false) { return false; }
virtual int getRenderShape() { return Tile_SPU::SHAPE_DOOR; }
- virtual void updateShape(ChunkRebuildData *level, int x, int y, int z, int forceData = -1, TileEntity* forceEntity = NULL); // 4J added forceData, forceEntity param
+ virtual void updateShape(ChunkRebuildData *level, int x, int y, int z, int forceData = -1, TileEntity* forceEntity = nullptr); // 4J added forceData, forceEntity param
int getDir(ChunkRebuildData *level, int x, int y, int z);
bool isOpen(ChunkRebuildData *level, int x, int y, int z);
diff --git a/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/FenceGateTile_SPU.h b/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/FenceGateTile_SPU.h
index 6e86d1f0..5e99cc32 100644
--- a/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/FenceGateTile_SPU.h
+++ b/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/FenceGateTile_SPU.h
@@ -12,7 +12,7 @@ public:
Icon_SPU *getTexture(int face, int data) { return TileRef_SPU(wood_Id)->getTexture(face); }
static int getDirection(int data) { return (data & DIRECTION_MASK); }
- virtual void updateShape(ChunkRebuildData *level, int x, int y, int z, int forceData = -1, TileEntity* forceEntity = NULL) // 4J added forceData, forceEntity param // Brought forward from 1.2.3
+ virtual void updateShape(ChunkRebuildData *level, int x, int y, int z, int forceData = -1, TileEntity* forceEntity = nullptr) // 4J added forceData, forceEntity param // Brought forward from 1.2.3
{
int data = getDirection(level->getData(x, y, z));
if (data == Direction::NORTH || data == Direction::SOUTH)
diff --git a/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/FenceTile_SPU.cpp b/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/FenceTile_SPU.cpp
index fcb3baef..63c206d1 100644
--- a/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/FenceTile_SPU.cpp
+++ b/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/FenceTile_SPU.cpp
@@ -59,7 +59,7 @@ bool FenceTile_SPU::connectsTo(ChunkRebuildData *level, int x, int y, int z)
return true;
}
TileRef_SPU tileInstance(tile);
- if (tileInstance.getPtr() != NULL)
+ if (tileInstance.getPtr() != nullptr)
{
if (tileInstance->getMaterial()->isSolidBlocking() && tileInstance->isCubeShaped())
{
diff --git a/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/FenceTile_SPU.h b/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/FenceTile_SPU.h
index 50a775fb..bed2e3b7 100644
--- a/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/FenceTile_SPU.h
+++ b/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/FenceTile_SPU.h
@@ -5,7 +5,7 @@ class FenceTile_SPU : public Tile_SPU
{
public:
FenceTile_SPU(int id) : Tile_SPU(id) {}
- virtual void updateShape(ChunkRebuildData *level, int x, int y, int z, int forceData = -1, TileEntity* forceEntity = NULL); // 4J added forceData, forceEntity param
+ virtual void updateShape(ChunkRebuildData *level, int x, int y, int z, int forceData = -1, TileEntity* forceEntity = nullptr); // 4J added forceData, forceEntity param
virtual bool blocksLight();
virtual bool isSolidRender(bool isServerLevel = false);
virtual int getRenderShape();
diff --git a/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/HalfSlabTile_SPU.cpp b/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/HalfSlabTile_SPU.cpp
index 1cf83821..1dba9757 100644
--- a/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/HalfSlabTile_SPU.cpp
+++ b/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/HalfSlabTile_SPU.cpp
@@ -3,7 +3,7 @@
#include "Facing_SPU.h"
#include "ChunkRebuildData.h"
-void HalfSlabTile_SPU::updateShape(ChunkRebuildData *level, int x, int y, int z, int forceData /* = -1 */, TileEntity* forceEntity /* = NULL */)
+void HalfSlabTile_SPU::updateShape(ChunkRebuildData *level, int x, int y, int z, int forceData /* = -1 */, TileEntity* forceEntity /* = nullptr */)
{
if (fullSize())
{
diff --git a/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/HalfSlabTile_SPU.h b/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/HalfSlabTile_SPU.h
index fd525e96..c89581ad 100644
--- a/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/HalfSlabTile_SPU.h
+++ b/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/HalfSlabTile_SPU.h
@@ -9,7 +9,7 @@ public:
static const int TOP_SLOT_BIT = 8;
HalfSlabTile_SPU(int id) : Tile_SPU(id) {}
- virtual void updateShape(ChunkRebuildData *level, int x, int y, int z, int forceData = -1, TileEntity* forceEntity = NULL); // 4J added forceData, forceEntity param
+ virtual void updateShape(ChunkRebuildData *level, int x, int y, int z, int forceData = -1, TileEntity* forceEntity = nullptr); // 4J added forceData, forceEntity param
virtual void updateDefaultShape();
virtual bool isSolidRender(bool isServerLevel);
virtual bool shouldRenderFace(ChunkRebuildData *level, int x, int y, int z, int face);
diff --git a/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/Icon_SPU.h b/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/Icon_SPU.h
index f4ba6ccf..0597c1fc 100644
--- a/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/Icon_SPU.h
+++ b/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/Icon_SPU.h
@@ -24,29 +24,29 @@ public:
void set(int16_t _x, int16_t _y, int16_t _w, int16_t _h, int texWidth, int texHeight)
{
- x0 = (int16_t)(4096 * (float(_x) / texWidth));
- y0 = (int16_t)(4096 * (float(_y) / texHeight));
- x1 = x0 + (int16_t)(4096 * (float(_w) / texWidth));
- y1 = y0 + (int16_t)(4096 * (float(_h) / texHeight));
+ x0 = static_cast<int16_t>(4096 * (float(_x) / texWidth));
+ y0 = static_cast<int16_t>(4096 * (float(_y) / texHeight));
+ x1 = x0 + static_cast<int16_t>(4096 * (float(_w) / texWidth));
+ y1 = y0 + static_cast<int16_t>(4096 * (float(_h) / texHeight));
}
void flipHorizontal() { int16_t temp = x0; x0 = x1; x1 = temp; }
void flipVertical() { int16_t temp = y0; y0 = y1; y1 = temp; }
- float getU0() const { return (float(x0) / 4096) + UVAdjust; }//sc_texWidth) + getUAdjust(); }
- float getU1() const { return (float(x1) / 4096.0f) - UVAdjust; } //sc_texWidth) - getUAdjust(); }
+ float getU0() const { return (static_cast<float>(x0) / 4096) + UVAdjust; }//sc_texWidth) + getUAdjust(); }
+ float getU1() const { return (static_cast<float>(x1) / 4096.0f) - UVAdjust; } //sc_texWidth) - getUAdjust(); }
float getU(double offset) const
{
float diff = getU1() - getU0();
- return getU0() + (diff * ((float) offset / 16));//SharedConstants::WORLD_RESOLUTION));
+ return getU0() + (diff * (static_cast<float>(offset) / 16));//SharedConstants::WORLD_RESOLUTION));
}
- float getV0() const { return (float(y0) / 4096.0f) + UVAdjust; } //sc_texHeight) + getVAdjust(); }
- float getV1() const { return (float(y1) / 4096.0f) - UVAdjust; } //sc_texHeight) - getVAdjust(); }
+ float getV0() const { return (static_cast<float>(y0) / 4096.0f) + UVAdjust; } //sc_texHeight) + getVAdjust(); }
+ float getV1() const { return (static_cast<float>(y1) / 4096.0f) - UVAdjust; } //sc_texHeight) - getVAdjust(); }
float getV(double offset) const
{
float diff = getV1() - getV0();
- return getV0() + (diff * ((float) offset / 16)); //SharedConstants::WORLD_RESOLUTION));
+ return getV0() + (diff * (static_cast<float>(offset) / 16)); //SharedConstants::WORLD_RESOLUTION));
}
// virtual wstring getName() const = 0;
diff --git a/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/LiquidTile_SPU.cpp b/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/LiquidTile_SPU.cpp
index 7f13fd4f..fa075e71 100644
--- a/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/LiquidTile_SPU.cpp
+++ b/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/LiquidTile_SPU.cpp
@@ -211,12 +211,12 @@ double LiquidTile_SPU::getSlopeAngle(ChunkRebuildData *level, int x, int y, int
if (m->getID() == Material_SPU::water_Id)
{
TileRef_SPU tRef(Tile_SPU::water_Id);
- flow = ((LiquidTile_SPU*)tRef.getPtr())->getFlow(level, x, y, z);
+ flow = static_cast<LiquidTile_SPU *>(tRef.getPtr())->getFlow(level, x, y, z);
}
if (m->getID() == Material_SPU::lava_Id)
{
TileRef_SPU tRef(Tile_SPU::lava_Id);
- flow = ((LiquidTile_SPU*)tRef.getPtr())->getFlow(level, x, y, z);
+ flow = static_cast<LiquidTile_SPU *>(tRef.getPtr())->getFlow(level, x, y, z);
}
if (flow.x == 0 && flow.z == 0) return -1000;
return atan2(flow.z, flow.x) - MATH_PI / 2;
diff --git a/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/PistonBaseTile_SPU.h b/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/PistonBaseTile_SPU.h
index e8411c88..81ba68c1 100644
--- a/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/PistonBaseTile_SPU.h
+++ b/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/PistonBaseTile_SPU.h
@@ -8,7 +8,7 @@ class PistonBaseTile_SPU : public Tile_SPU
public:
PistonBaseTile_SPU(int id) : Tile_SPU(id) {}
// virtual void updateShape(float x0, float y0, float z0, float x1, float y1, float z1);
- virtual Icon_SPU *getTexture(int face, int data) { return NULL; }
+ virtual Icon_SPU *getTexture(int face, int data) { return nullptr; }
virtual int getRenderShape() { return SHAPE_PISTON_BASE; }
virtual bool isSolidRender(bool isServerLevel = false) { return false; }
diff --git a/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/PistonExtensionTile_SPU.h b/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/PistonExtensionTile_SPU.h
index d5460492..ee559eff 100644
--- a/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/PistonExtensionTile_SPU.h
+++ b/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/PistonExtensionTile_SPU.h
@@ -6,7 +6,7 @@ class PistonExtensionTile_SPU : public Tile_SPU
public:
PistonExtensionTile_SPU(int id) : Tile_SPU(id) {}
- virtual Icon_SPU *getTexture(int face, int data) { return NULL; }
+ virtual Icon_SPU *getTexture(int face, int data) { return nullptr; }
virtual int getRenderShape() { return SHAPE_PISTON_EXTENSION; }
virtual bool isSolidRender(bool isServerLevel = false) { return false; }
// virtual void updateShape(LevelSource *level, int x, int y, int z, int forceData = -1, shared_ptr<TileEntity> forceEntity = shared_ptr<TileEntity>()); // 4J added forceData, forceEntity param
diff --git a/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/PistonMovingPiece_SPU.h b/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/PistonMovingPiece_SPU.h
index 48fc52e9..6ea12648 100644
--- a/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/PistonMovingPiece_SPU.h
+++ b/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/PistonMovingPiece_SPU.h
@@ -10,7 +10,7 @@ public:
virtual int getRenderShape() { return SHAPE_INVISIBLE; }
virtual bool isSolidRender(bool isServerLevel = false) { return false; }
- virtual void updateShape(LevelSource *level, int x, int y, int z, int forceData = -1, TileEntity* forceEntity = NULL) // 4J added forceData, forceEntity param
+ virtual void updateShape(LevelSource *level, int x, int y, int z, int forceData = -1, TileEntity* forceEntity = nullptr) // 4J added forceData, forceEntity param
{
// should never get here.
}
diff --git a/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/PortalTile_SPU.h b/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/PortalTile_SPU.h
index f01313a1..a5a4652d 100644
--- a/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/PortalTile_SPU.h
+++ b/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/PortalTile_SPU.h
@@ -5,7 +5,7 @@ class PortalTile_SPU : public HalfTransparentTile_SPU
{
public:
PortalTile_SPU(int id): HalfTransparentTile_SPU(id) {}
- virtual void updateShape(ChunkRebuildData *level, int x, int y, int z, int forceData = -1, TileEntity* forceEntity = NULL) // 4J added forceData, forceEntity param
+ virtual void updateShape(ChunkRebuildData *level, int x, int y, int z, int forceData = -1, TileEntity* forceEntity = nullptr) // 4J added forceData, forceEntity param
{
if (level->getTile(x - 1, y, z) == id || level->getTile(x + 1, y, z) == id)
{
diff --git a/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/PressurePlateTile_SPU.h b/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/PressurePlateTile_SPU.h
index 133ec52e..6742e6f6 100644
--- a/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/PressurePlateTile_SPU.h
+++ b/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/PressurePlateTile_SPU.h
@@ -16,6 +16,6 @@ public:
virtual bool isSolidRender(bool isServerLevel = false);
virtual bool blocksLight();
- virtual void updateShape(ChunkRebuildData *level, int x, int y, int z, int forceData = -1, TileEntity* forceEntity = NULL); // 4J added forceData, forceEntity param
+ virtual void updateShape(ChunkRebuildData *level, int x, int y, int z, int forceData = -1, TileEntity* forceEntity = nullptr); // 4J added forceData, forceEntity param
virtual void updateDefaultShape();
};
diff --git a/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/RailTile_SPU.h b/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/RailTile_SPU.h
index 615ebec9..2f8639d4 100644
--- a/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/RailTile_SPU.h
+++ b/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/RailTile_SPU.h
@@ -10,7 +10,7 @@ public:
RailTile_SPU(int id) : Tile_SPU(id) {}
virtual bool isSolidRender(bool isServerLevel = false) { return false; }
- virtual void updateShape(ChunkRebuildData *level, int x, int y, int z, int forceData = -1, TileEntity* forceEntity = NULL) // 4J added forceData, forceEntity param
+ virtual void updateShape(ChunkRebuildData *level, int x, int y, int z, int forceData = -1, TileEntity* forceEntity = nullptr) // 4J added forceData, forceEntity param
{
int data = level->getData(x, y, z);
if (data >= 2 && data <= 5)
diff --git a/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/RedStoneDustTile_SPU.h b/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/RedStoneDustTile_SPU.h
index 0e461118..218cbd64 100644
--- a/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/RedStoneDustTile_SPU.h
+++ b/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/RedStoneDustTile_SPU.h
@@ -26,7 +26,7 @@ public:
case TEXTURE_CROSS_OVERLAY: return &ms_pTileData->redStoneDust_iconCrossOver;
case TEXTURE_LINE_OVERLAY: return &ms_pTileData->redStoneDust_iconLineOver;
}
- return NULL;
+ return nullptr;
}
static bool shouldConnectTo(ChunkRebuildData *level, int x, int y, int z, int direction)
diff --git a/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/SignTile_SPU.h b/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/SignTile_SPU.h
index 7fe54d99..74bdb95d 100644
--- a/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/SignTile_SPU.h
+++ b/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/SignTile_SPU.h
@@ -16,7 +16,7 @@ public:
}
Icon_SPU *getTexture(int face, int data){ return TileRef_SPU(wood_Id)->getTexture(face); }
- void updateShape(ChunkRebuildData *level, int x, int y, int z, int forceData = -1, TileEntity* forceEntity = NULL) // 4J added forceData, forceEntity param
+ void updateShape(ChunkRebuildData *level, int x, int y, int z, int forceData = -1, TileEntity* forceEntity = nullptr) // 4J added forceData, forceEntity param
{
if (onGround()) return;
int face = level->getData(x, y, z);
diff --git a/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/StairTile_SPU.h b/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/StairTile_SPU.h
index eefa36b2..ca5ba279 100644
--- a/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/StairTile_SPU.h
+++ b/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/StairTile_SPU.h
@@ -15,7 +15,7 @@ public:
public:
StairTile_SPU(int id) : Tile_SPU(id) {}
- void updateShape(ChunkRebuildData *level, int x, int y, int z, int forceData = -1, TileEntity* forceEntity = NULL); // 4J added forceData, forceEntity param
+ void updateShape(ChunkRebuildData *level, int x, int y, int z, int forceData = -1, TileEntity* forceEntity = nullptr); // 4J added forceData, forceEntity param
bool isSolidRender(bool isServerLevel = false);
int getRenderShape();
void setBaseShape(ChunkRebuildData *level, int x, int y, int z);
diff --git a/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/StemTile_SPU.h b/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/StemTile_SPU.h
index 89cd3739..4923e862 100644
--- a/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/StemTile_SPU.h
+++ b/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/StemTile_SPU.h
@@ -35,7 +35,7 @@ public:
this->setShape(0.5f - ss, 0, 0.5f - ss, 0.5f + ss, 0.25f, 0.5f + ss);
}
- virtual void updateShape(ChunkRebuildData *level, int x, int y, int z, int forceData = -1, TileEntity* forceEntity = NULL) // 4J added forceData, forceEntity param
+ virtual void updateShape(ChunkRebuildData *level, int x, int y, int z, int forceData = -1, TileEntity* forceEntity = nullptr) // 4J added forceData, forceEntity param
{
ms_pTileData->yy1[id] = (level->getData(x, y, z) * 2 + 2) / 16.0f;
float ss = 0.125f;
diff --git a/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/Tesselator_SPU.cpp b/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/Tesselator_SPU.cpp
index 3d1007af..efcd44f0 100644
--- a/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/Tesselator_SPU.cpp
+++ b/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/Tesselator_SPU.cpp
@@ -68,7 +68,7 @@ typedef unsigned short hfloat;
hfloat convertFloatToHFloat(float f)
{
unsigned int x = *(unsigned int *)&f;
- unsigned int sign = (unsigned short)(x >> 31);
+ unsigned int sign = static_cast<unsigned short>(x >> 31);
unsigned int mantissa;
unsigned int exp;
hfloat hf;
@@ -90,8 +90,8 @@ hfloat convertFloatToHFloat(float f)
// 16-bit half-float representation stores number as Inf
mantissa = 0;
}
- hf = (((hfloat)sign) << 15) | (hfloat)(HALF_FLOAT_MAX_BIASED_EXP) |
- (hfloat)(mantissa >> 13);
+ hf = (static_cast<hfloat>(sign) << 15) | static_cast<hfloat>(HALF_FLOAT_MAX_BIASED_EXP) |
+ static_cast<hfloat>(mantissa >> 13);
}
// check if exponent is <= -15
else if (exp <= HALF_FLOAT_MIN_BIASED_EXP_AS_SINGLE_FP_EXP)
@@ -101,13 +101,13 @@ hfloat convertFloatToHFloat(float f)
exp = (HALF_FLOAT_MIN_BIASED_EXP_AS_SINGLE_FP_EXP - exp) >> 23;
mantissa >>= (14 + exp);
- hf = (((hfloat)sign) << 15) | (hfloat)(mantissa);
+ hf = (static_cast<hfloat>(sign) << 15) | static_cast<hfloat>(mantissa);
}
else
{
- hf = (((hfloat)sign) << 15) |
- (hfloat)((exp - HALF_FLOAT_MIN_BIASED_EXP_AS_SINGLE_FP_EXP) >> 13) |
- (hfloat)(mantissa >> 13);
+ hf = (static_cast<hfloat>(sign) << 15) |
+ static_cast<hfloat>((exp - HALF_FLOAT_MIN_BIASED_EXP_AS_SINGLE_FP_EXP) >> 13) |
+ static_cast<hfloat>(mantissa >> 13);
}
return hf;
@@ -115,8 +115,8 @@ hfloat convertFloatToHFloat(float f)
float convertHFloatToFloat(hfloat hf)
{
- unsigned int sign = (unsigned int)(hf >> 15);
- unsigned int mantissa = (unsigned int)(hf & ((1 << 10) - 1));
+ unsigned int sign = static_cast<unsigned int>(hf >> 15);
+ unsigned int mantissa = static_cast<unsigned int>(hf & ((1 << 10) - 1));
unsigned int exp = (unsigned int)(hf & HALF_FLOAT_MAX_BIASED_EXP);
unsigned int f;
@@ -170,7 +170,7 @@ float convertHFloatToFloat(hfloat hf)
//
Tesselator_SPU *Tesselator_SPU::getInstance()
{
- return NULL;
+ return nullptr;
// return (Tesselator_SPU *)TlsGetValue(tlsIdx);
}
@@ -329,12 +329,12 @@ void Tesselator_SPU::tex2(int tex2)
void Tesselator_SPU::color(float r, float g, float b)
{
- color((int) (r * 255), (int) (g * 255), (int) (b * 255));
+ color(static_cast<int>(r * 255), static_cast<int>(g * 255), static_cast<int>(b * 255));
}
void Tesselator_SPU::color(float r, float g, float b, float a)
{
- color((int) (r * 255), (int) (g * 255), (int) (b * 255), (int) (a * 255));
+ color(static_cast<int>(r * 255), static_cast<int>(g * 255), static_cast<int>(b * 255), static_cast<int>(a * 255));
}
void Tesselator_SPU::color(int r, int g, int b)
@@ -539,7 +539,7 @@ void Tesselator_SPU::vertex(float x, float y, float z)
// see comments in packCompactQuad() for exact format
if( useCompactFormat360 )
{
- unsigned int ucol = (unsigned int)col;
+ unsigned int ucol = static_cast<unsigned int>(col);
#ifdef _XBOX
// Pack as 4:4:4 RGB_
@@ -564,7 +564,7 @@ void Tesselator_SPU::vertex(float x, float y, float z)
unsigned short packedcol = ((col & 0xf8000000 ) >> 16 ) |
((col & 0x00fc0000 ) >> 13 ) |
((col & 0x0000f800 ) >> 11 );
- int ipackedcol = ((int)packedcol) & 0xffff; // 0 to 65535 range
+ int ipackedcol = static_cast<int>(packedcol) & 0xffff; // 0 to 65535 range
ipackedcol -= 32768; // -32768 to 32767 range
ipackedcol &= 0xffff;
@@ -597,12 +597,12 @@ void Tesselator_SPU::vertex(float x, float y, float z)
pShortData[7] = ((INT_ROUND(tex2V * (8192.0f/256.0f)))&0xffff);
incData(4);
#else
- pShortData[0] = (((int)((x + xo ) * 1024.0f))&0xffff);
- pShortData[1] = (((int)((y + yo ) * 1024.0f))&0xffff);
- pShortData[2] = (((int)((z + zo ) * 1024.0f))&0xffff);
+ pShortData[0] = (static_cast<int>((x + xo) * 1024.0f)&0xffff);
+ pShortData[1] = (static_cast<int>((y + yo) * 1024.0f)&0xffff);
+ pShortData[2] = (static_cast<int>((z + zo) * 1024.0f)&0xffff);
pShortData[3] = ipackedcol;
- pShortData[4] = (((int)(uu * 8192.0f))&0xffff);
- pShortData[5] = (((int)(v * 8192.0f))&0xffff);
+ pShortData[4] = (static_cast<int>(uu * 8192.0f)&0xffff);
+ pShortData[5] = (static_cast<int>(v * 8192.0f)&0xffff);
pShortData[6] = ((int16_t*)&_tex2)[0];
pShortData[7] = ((int16_t*)&_tex2)[1];
incData(4);
@@ -723,9 +723,9 @@ void Tesselator_SPU::noColor()
void Tesselator_SPU::normal(float x, float y, float z)
{
hasNormal = true;
- byte xx = (byte) (x * 127);
- byte yy = (byte) (y * 127);
- byte zz = (byte) (z * 127);
+ byte xx = static_cast<byte>(x * 127);
+ byte yy = static_cast<byte>(y * 127);
+ byte zz = static_cast<byte>(z * 127);
_normal = (xx & 0xff) | ((yy & 0xff) << 8) | ((zz & 0xff) << 16);
}
diff --git a/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/TheEndPortalFrameTile_SPU.h b/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/TheEndPortalFrameTile_SPU.h
index 8aab31a3..87d87bcf 100644
--- a/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/TheEndPortalFrameTile_SPU.h
+++ b/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/TheEndPortalFrameTile_SPU.h
@@ -5,7 +5,7 @@ class TheEndPortalFrameTile_SPU : public Tile_SPU
{
public:
TheEndPortalFrameTile_SPU(int id) : Tile_SPU(id) {}
- virtual Icon_SPU *getTexture(int face, int data) { return NULL; }
+ virtual Icon_SPU *getTexture(int face, int data) { return nullptr; }
virtual bool isSolidRender(bool isServerLevel = false) { return false; }
virtual int getRenderShape() { return SHAPE_PORTAL_FRAME; }
// virtual void updateDefaultShape();
diff --git a/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/ThinFenceTile_SPU.cpp b/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/ThinFenceTile_SPU.cpp
index 20393f6e..9e7d30de 100644
--- a/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/ThinFenceTile_SPU.cpp
+++ b/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/ThinFenceTile_SPU.cpp
@@ -74,7 +74,7 @@ Icon_SPU *ThinFenceTile_SPU::getEdgeTexture()
#ifndef SN_TARGET_PS3_SPU
assert(0);
#endif
- return NULL;
+ return nullptr;
}
bool ThinFenceTile_SPU::attachsTo(int tile)
diff --git a/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/ThinFenceTile_SPU.h b/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/ThinFenceTile_SPU.h
index 61c39201..8f7b601b 100644
--- a/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/ThinFenceTile_SPU.h
+++ b/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/ThinFenceTile_SPU.h
@@ -11,7 +11,7 @@ public:
virtual int getRenderShape();
virtual bool shouldRenderFace(ChunkRebuildData *level, int x, int y, int z, int face);
virtual void updateDefaultShape();
- virtual void updateShape(ChunkRebuildData *level, int x, int y, int z, int forceData = -1, TileEntity* forceEntity = NULL); // 4J added forceData, forceEntity param
+ virtual void updateShape(ChunkRebuildData *level, int x, int y, int z, int forceData = -1, TileEntity* forceEntity = nullptr); // 4J added forceData, forceEntity param
virtual Icon_SPU *getEdgeTexture();
bool attachsTo(int tile);
};
diff --git a/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/TileRenderer_SPU.cpp b/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/TileRenderer_SPU.cpp
index ab9b2c94..22c3a26d 100644
--- a/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/TileRenderer_SPU.cpp
+++ b/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/TileRenderer_SPU.cpp
@@ -71,7 +71,7 @@ const float smallUV = ( 1.0f / 16.0f );
void TileRenderer_SPU::_init()
{
- fixedTexture = NULL;
+ fixedTexture = nullptr;
xFlipTexture = false;
noCulling = false;
blsmooth = 1;
@@ -103,7 +103,7 @@ TileRenderer_SPU::TileRenderer_SPU( ChunkRebuildData* level )
TileRenderer_SPU::TileRenderer_SPU()
{
- this->level = NULL;
+ this->level = nullptr;
_init();
}
@@ -122,12 +122,12 @@ void TileRenderer_SPU::setFixedTexture( Icon_SPU *fixedTexture )
void TileRenderer_SPU::clearFixedTexture()
{
- this->fixedTexture = NULL;
+ this->fixedTexture = nullptr;
}
bool TileRenderer_SPU::hasFixedTexture()
{
- return fixedTexture != NULL;
+ return fixedTexture != nullptr;
}
void TileRenderer_SPU::setShape(float x0, float y0, float z0, float x1, float y1, float z1)
@@ -270,7 +270,7 @@ bool TileRenderer_SPU::tesselateInWorld( Tile_SPU* tt, int x, int y, int z, int
retVal = tesselateStemInWorld( tt, x, y, z );
break;
case Tile_SPU::SHAPE_LILYPAD:
- retVal = tesselateLilypadInWorld( (WaterlilyTile_SPU*)tt, x, y, z );
+ retVal = tesselateLilypadInWorld( static_cast<WaterlilyTile_SPU *>(tt), x, y, z );
break;
case Tile_SPU::SHAPE_ROWS:
retVal = tesselateRowInWorld( tt, x, y, z );
@@ -279,7 +279,7 @@ bool TileRenderer_SPU::tesselateInWorld( Tile_SPU* tt, int x, int y, int z, int
retVal = tesselateTorchInWorld( tt, x, y, z );
break;
case Tile_SPU::SHAPE_FIRE:
- retVal = tesselateFireInWorld( (FireTile_SPU *)tt, x, y, z );
+ retVal = tesselateFireInWorld( static_cast<FireTile_SPU *>(tt), x, y, z );
break;
case Tile_SPU::SHAPE_RED_DUST:
retVal = tesselateDustInWorld( tt, x, y, z );
@@ -291,19 +291,19 @@ bool TileRenderer_SPU::tesselateInWorld( Tile_SPU* tt, int x, int y, int z, int
retVal = tesselateDoorInWorld( tt, x, y, z );
break;
case Tile_SPU::SHAPE_RAIL:
- retVal = tesselateRailInWorld( ( RailTile_SPU* )tt, x, y, z );
+ retVal = tesselateRailInWorld( static_cast<RailTile_SPU *>(tt), x, y, z );
break;
case Tile_SPU::SHAPE_STAIRS:
- retVal = tesselateStairsInWorld( (StairTile_SPU *)tt, x, y, z );
+ retVal = tesselateStairsInWorld( static_cast<StairTile_SPU *>(tt), x, y, z );
break;
case Tile_SPU::SHAPE_EGG:
- retVal = tesselateEggInWorld((EggTile_SPU*) tt, x, y, z);
+ retVal = tesselateEggInWorld(static_cast<EggTile_SPU *>(tt), x, y, z);
break;
case Tile_SPU::SHAPE_FENCE:
- retVal = tesselateFenceInWorld( ( FenceTile_SPU* )tt, x, y, z );
+ retVal = tesselateFenceInWorld( static_cast<FenceTile_SPU *>(tt), x, y, z );
break;
case Tile_SPU::SHAPE_WALL:
- retVal = tesselateWallInWorld( (WallTile_SPU *) tt, x, y, z);
+ retVal = tesselateWallInWorld( static_cast<WallTile_SPU *>(tt), x, y, z);
break;
case Tile_SPU::SHAPE_LEVER:
retVal = tesselateLeverInWorld( tt, x, y, z );
@@ -318,7 +318,7 @@ bool TileRenderer_SPU::tesselateInWorld( Tile_SPU* tt, int x, int y, int z, int
retVal = tesselateBedInWorld( tt, x, y, z );
break;
case Tile_SPU::SHAPE_DIODE:
- retVal = tesselateDiodeInWorld( (DiodeTile_SPU *)tt, x, y, z );
+ retVal = tesselateDiodeInWorld( static_cast<DiodeTile_SPU *>(tt), x, y, z );
break;
case Tile_SPU::SHAPE_PISTON_BASE:
retVal = tesselatePistonBaseInWorld( tt, x, y, z, false, forceData );
@@ -333,7 +333,7 @@ bool TileRenderer_SPU::tesselateInWorld( Tile_SPU* tt, int x, int y, int z, int
retVal = tesselateVineInWorld( tt, x, y, z );
break;
case Tile_SPU::SHAPE_FENCE_GATE:
- retVal = tesselateFenceGateInWorld( ( FenceGateTile_SPU* )tt, x, y, z );
+ retVal = tesselateFenceGateInWorld( static_cast<FenceGateTile_SPU *>(tt), x, y, z );
break;
case Tile_SPU::SHAPE_CAULDRON:
retVal = tesselateCauldronInWorld((CauldronTile_SPU* ) tt, x, y, z);
@@ -345,7 +345,7 @@ bool TileRenderer_SPU::tesselateInWorld( Tile_SPU* tt, int x, int y, int z, int
retVal = tesselateAnvilInWorld((AnvilTile_SPU *) tt, x, y, z);
break;
case Tile_SPU::SHAPE_BREWING_STAND:
- retVal = tesselateBrewingStandInWorld((BrewingStandTile_SPU* ) tt, x, y, z);
+ retVal = tesselateBrewingStandInWorld(static_cast<BrewingStandTile_SPU *>(tt), x, y, z);
break;
case Tile_SPU::SHAPE_PORTAL_FRAME:
retVal = tesselateAirPortalFrameInWorld((TheEndPortalFrameTile *)tt, x, y, z);
@@ -838,7 +838,7 @@ bool TileRenderer_SPU::tesselateFlowerPotInWorld(FlowerPotTile_SPU *tt, int x, i
float xOff = 0;
float yOff = 4;
float zOff = 0;
- Tile *plant = NULL;
+ Tile *plant = nullptr;
switch (type)
{
@@ -858,7 +858,7 @@ bool TileRenderer_SPU::tesselateFlowerPotInWorld(FlowerPotTile_SPU *tt, int x, i
t->addOffset(xOff / 16.0f, yOff / 16.0f, zOff / 16.0f);
- if (plant != NULL)
+ if (plant != nullptr)
{
tesselateInWorld(plant, x, y, z);
}
@@ -1099,23 +1099,23 @@ bool TileRenderer_SPU::tesselateTorchInWorld( Tile_SPU* tt, int x, int y, int z
float h = 0.20f;
if ( dir == 1 )
{
- tesselateTorch( tt, (float)x - r2, (float)y + h, (float)z, -r, 0.0f, 0 );
+ tesselateTorch( tt, static_cast<float>(x) - r2, static_cast<float>(y) + h, static_cast<float>(z), -r, 0.0f, 0 );
}
else if ( dir == 2 )
{
- tesselateTorch( tt, (float)x + r2, (float)y + h, (float)z, +r, 0.0f, 0 );
+ tesselateTorch( tt, static_cast<float>(x) + r2, static_cast<float>(y) + h, static_cast<float>(z), +r, 0.0f, 0 );
}
else if ( dir == 3 )
{
- tesselateTorch( tt, (float)x, (float)y + h, z - r2, 0.0f, -r, 0 );
+ tesselateTorch( tt, static_cast<float>(x), static_cast<float>(y) + h, z - r2, 0.0f, -r, 0 );
}
else if ( dir == 4 )
{
- tesselateTorch( tt, (float)x, (float)y + h, (float)z + r2, 0.0f, +r, 0 );
+ tesselateTorch( tt, static_cast<float>(x), static_cast<float>(y) + h, static_cast<float>(z) + r2, 0.0f, +r, 0 );
}
else
{
- tesselateTorch( tt, (float)x, (float)y, (float)z, 0.0f, 0.0f, 0 );
+ tesselateTorch( tt, static_cast<float>(x), static_cast<float>(y), static_cast<float>(z), 0.0f, 0.0f, 0 );
}
return true;
@@ -1724,7 +1724,7 @@ bool TileRenderer_SPU::tesselateLeverInWorld( Tile_SPU* tt, int x, int y, int z
}
}
- Vec3* c0 = NULL, *c1 = NULL, *c2 = NULL, *c3 = NULL;
+ Vec3* c0 = nullptr, *c1 = nullptr, *c2 = nullptr, *c3 = nullptr;
for ( int i = 0; i < 6; i++ )
{
if ( i == 0 )
@@ -1897,7 +1897,7 @@ bool TileRenderer_SPU::tesselateTripwireSourceInWorld(Tile_SPU *tt, int x, int y
corners[i]->z += z + 0.5;
}
- Vec3 *c0 = NULL, *c1 = NULL, *c2 = NULL, *c3 = NULL;
+ Vec3 *c0 = nullptr, *c1 = nullptr, *c2 = nullptr, *c3 = nullptr;
int stickX0 = 7;
int stickX1 = 9;
int stickY0 = 9;
@@ -2321,15 +2321,15 @@ bool TileRenderer_SPU::tesselateFireInWorld( FireTile_SPU* tt, int x, int y, int
float z0_ = z + 0.5f - 0.3f;
float z1_ = z + 0.5f + 0.3f;
- t->vertexUV( ( float )( x0_ ), ( float )( y + h ), ( float )( z + 1 ), ( float )( u1 ), ( float )( v0 ) );
- t->vertexUV( ( float )( x0 ), ( float )( y + 0 ), ( float )( z + 1 ), ( float )( u1 ), ( float )( v1 ) );
- t->vertexUV( ( float )( x0 ), ( float )( y + 0 ), ( float )( z + 0 ), ( float )( u0 ), ( float )( v1 ) );
- t->vertexUV( ( float )( x0_ ), ( float )( y + h ), ( float )( z + 0 ), ( float )( u0 ), ( float )( v0 ) );
+ t->vertexUV( ( float )( x0_ ), ( float )( y + h ), static_cast<float>(z + 1), ( float )( u1 ), ( float )( v0 ) );
+ t->vertexUV( ( float )( x0 ), static_cast<float>(y + 0), static_cast<float>(z + 1), ( float )( u1 ), ( float )( v1 ) );
+ t->vertexUV( ( float )( x0 ), static_cast<float>(y + 0), static_cast<float>(z + 0), ( float )( u0 ), ( float )( v1 ) );
+ t->vertexUV( ( float )( x0_ ), ( float )( y + h ), static_cast<float>(z + 0), ( float )( u0 ), ( float )( v0 ) );
- t->vertexUV( ( float )( x1_ ), ( float )( y + h ), ( float )( z + 0 ), ( float )( u1 ), ( float )( v0 ) );
- t->vertexUV( ( float )( x1 ), ( float )( y + 0 ), ( float )( z + 0 ), ( float )( u1 ), ( float )( v1 ) );
- t->vertexUV( ( float )( x1 ), ( float )( y + 0 ), ( float )( z + 1 ), ( float )( u0 ), ( float )( v1 ) );
- t->vertexUV( ( float )( x1_ ), ( float )( y + h ), ( float )( z + 1 ), ( float )( u0 ), ( float )( v0 ) );
+ t->vertexUV( ( float )( x1_ ), ( float )( y + h ), static_cast<float>(z + 0), ( float )( u1 ), ( float )( v0 ) );
+ t->vertexUV( ( float )( x1 ), static_cast<float>(y + 0), static_cast<float>(z + 0), ( float )( u1 ), ( float )( v1 ) );
+ t->vertexUV( ( float )( x1 ), static_cast<float>(y + 0), static_cast<float>(z + 1), ( float )( u0 ), ( float )( v1 ) );
+ t->vertexUV( ( float )( x1_ ), ( float )( y + h ), static_cast<float>(z + 1), ( float )( u0 ), ( float )( v0 ) );
tex = secondTex;
u0 = tex->getU0();
@@ -2337,15 +2337,15 @@ bool TileRenderer_SPU::tesselateFireInWorld( FireTile_SPU* tt, int x, int y, int
u1 = tex->getU1();
v1 = tex->getV1();
- t->vertexUV( ( float )( x + 1 ), ( float )( y + h ), ( float )( z1_ ), ( float )( u1 ), ( float )( v0 ) );
- t->vertexUV( ( float )( x + 1 ), ( float )( y + 0 ), ( float )( z1 ), ( float )( u1 ), ( float )( v1 ) );
- t->vertexUV( ( float )( x + 0 ), ( float )( y + 0 ), ( float )( z1 ), ( float )( u0 ), ( float )( v1 ) );
- t->vertexUV( ( float )( x + 0 ), ( float )( y + h ), ( float )( z1_ ), ( float )( u0 ), ( float )( v0 ) );
+ t->vertexUV( static_cast<float>(x + 1), ( float )( y + h ), ( float )( z1_ ), ( float )( u1 ), ( float )( v0 ) );
+ t->vertexUV( static_cast<float>(x + 1), static_cast<float>(y + 0), ( float )( z1 ), ( float )( u1 ), ( float )( v1 ) );
+ t->vertexUV( static_cast<float>(x + 0), static_cast<float>(y + 0), ( float )( z1 ), ( float )( u0 ), ( float )( v1 ) );
+ t->vertexUV( static_cast<float>(x + 0), ( float )( y + h ), ( float )( z1_ ), ( float )( u0 ), ( float )( v0 ) );
- t->vertexUV( ( float )( x + 0 ), ( float )( y + h ), ( float )( z0_ ), ( float )( u1 ), ( float )( v0 ) );
- t->vertexUV( ( float )( x + 0 ), ( float )( y + 0 ), ( float )( z0 ), ( float )( u1 ), ( float )( v1 ) );
- t->vertexUV( ( float )( x + 1 ), ( float )( y + 0 ), ( float )( z0 ), ( float )( u0 ), ( float )( v1 ) );
- t->vertexUV( ( float )( x + 1 ), ( float )( y + h ), ( float )( z0_ ), ( float )( u0 ), ( float )( v0 ) );
+ t->vertexUV( static_cast<float>(x + 0), ( float )( y + h ), ( float )( z0_ ), ( float )( u1 ), ( float )( v0 ) );
+ t->vertexUV( static_cast<float>(x + 0), static_cast<float>(y + 0), ( float )( z0 ), ( float )( u1 ), ( float )( v1 ) );
+ t->vertexUV( static_cast<float>(x + 1), static_cast<float>(y + 0), ( float )( z0 ), ( float )( u0 ), ( float )( v1 ) );
+ t->vertexUV( static_cast<float>(x + 1), ( float )( y + h ), ( float )( z0_ ), ( float )( u0 ), ( float )( v0 ) );
x0 = x + 0.5f - 0.5f;
x1 = x + 0.5f + 0.5f;
@@ -2357,15 +2357,15 @@ bool TileRenderer_SPU::tesselateFireInWorld( FireTile_SPU* tt, int x, int y, int
z0_ = z + 0.5f - 0.4f;
z1_ = z + 0.5f + 0.4f;
- t->vertexUV( ( float )( x0_ ), ( float )( y + h ), ( float )( z + 0 ), ( float )( u0 ), ( float )( v0 ) );
- t->vertexUV( ( float )( x0 ), ( float )( y + 0 ), ( float )( z + 0 ), ( float )( u0 ), ( float )( v1 ) );
- t->vertexUV( ( float )( x0 ), ( float )( y + 0 ), ( float )( z + 1 ), ( float )( u1 ), ( float )( v1 ) );
- t->vertexUV( ( float )( x0_ ), ( float )( y + h ), ( float )( z + 1 ), ( float )( u1 ), ( float )( v0 ) );
+ t->vertexUV( ( float )( x0_ ), ( float )( y + h ), static_cast<float>(z + 0), ( float )( u0 ), ( float )( v0 ) );
+ t->vertexUV( ( float )( x0 ), static_cast<float>(y + 0), static_cast<float>(z + 0), ( float )( u0 ), ( float )( v1 ) );
+ t->vertexUV( ( float )( x0 ), static_cast<float>(y + 0), static_cast<float>(z + 1), ( float )( u1 ), ( float )( v1 ) );
+ t->vertexUV( ( float )( x0_ ), ( float )( y + h ), static_cast<float>(z + 1), ( float )( u1 ), ( float )( v0 ) );
- t->vertexUV( ( float )( x1_ ), ( float )( y + h ), ( float )( z + 1 ), ( float )( u0 ), ( float )( v0 ) );
- t->vertexUV( ( float )( x1 ), ( float )( y + 0 ), ( float )( z + 1 ), ( float )( u0 ), ( float )( v1 ) );
- t->vertexUV( ( float )( x1 ), ( float )( y + 0 ), ( float )( z + 0 ), ( float )( u1 ), ( float )( v1 ) );
- t->vertexUV( ( float )( x1_ ), ( float )( y + h ), ( float )( z + 0 ), ( float )( u1 ), ( float )( v0 ) );
+ t->vertexUV( ( float )( x1_ ), ( float )( y + h ), static_cast<float>(z + 1), ( float )( u0 ), ( float )( v0 ) );
+ t->vertexUV( ( float )( x1 ), static_cast<float>(y + 0), static_cast<float>(z + 1), ( float )( u0 ), ( float )( v1 ) );
+ t->vertexUV( ( float )( x1 ), static_cast<float>(y + 0), static_cast<float>(z + 0), ( float )( u1 ), ( float )( v1 ) );
+ t->vertexUV( ( float )( x1_ ), ( float )( y + h ), static_cast<float>(z + 0), ( float )( u1 ), ( float )( v0 ) );
tex = firstTex;
u0 = tex->getU0();
@@ -2373,15 +2373,15 @@ bool TileRenderer_SPU::tesselateFireInWorld( FireTile_SPU* tt, int x, int y, int
u1 = tex->getU1();
v1 = tex->getV1();
- t->vertexUV( ( float )( x + 0 ), ( float )( y + h ), ( float )( z1_ ), ( float )( u0 ), ( float )( v0 ) );
- t->vertexUV( ( float )( x + 0 ), ( float )( y + 0 ), ( float )( z1 ), ( float )( u0 ), ( float )( v1 ) );
- t->vertexUV( ( float )( x + 1 ), ( float )( y + 0 ), ( float )( z1 ), ( float )( u1 ), ( float )( v1 ) );
- t->vertexUV( ( float )( x + 1 ), ( float )( y + h ), ( float )( z1_ ), ( float )( u1 ), ( float )( v0 ) );
+ t->vertexUV( static_cast<float>(x + 0), ( float )( y + h ), ( float )( z1_ ), ( float )( u0 ), ( float )( v0 ) );
+ t->vertexUV( static_cast<float>(x + 0), static_cast<float>(y + 0), ( float )( z1 ), ( float )( u0 ), ( float )( v1 ) );
+ t->vertexUV( static_cast<float>(x + 1), static_cast<float>(y + 0), ( float )( z1 ), ( float )( u1 ), ( float )( v1 ) );
+ t->vertexUV( static_cast<float>(x + 1), ( float )( y + h ), ( float )( z1_ ), ( float )( u1 ), ( float )( v0 ) );
- t->vertexUV( ( float )( x + 1 ), ( float )( y + h ), ( float )( z0_ ), ( float )( u0 ), ( float )( v0 ) );
- t->vertexUV( ( float )( x + 1 ), ( float )( y + 0 ), ( float )( z0 ), ( float )( u0 ), ( float )( v1 ) );
- t->vertexUV( ( float )( x + 0 ), ( float )( y + 0 ), ( float )( z0 ), ( float )( u1 ), ( float )( v1 ) );
- t->vertexUV( ( float )( x + 0 ), ( float )( y + h ), ( float )( z0_ ), ( float )( u1 ), ( float )( v0 ) );
+ t->vertexUV( static_cast<float>(x + 1), ( float )( y + h ), ( float )( z0_ ), ( float )( u0 ), ( float )( v0 ) );
+ t->vertexUV( static_cast<float>(x + 1), static_cast<float>(y + 0), ( float )( z0 ), ( float )( u0 ), ( float )( v1 ) );
+ t->vertexUV( static_cast<float>(x + 0), static_cast<float>(y + 0), ( float )( z0 ), ( float )( u1 ), ( float )( v1 ) );
+ t->vertexUV( static_cast<float>(x + 0), ( float )( y + h ), ( float )( z0_ ), ( float )( u1 ), ( float )( v0 ) );
}
else
{
@@ -2425,10 +2425,10 @@ bool TileRenderer_SPU::tesselateFireInWorld( FireTile_SPU* tt, int x, int y, int
{
t->vertexUV( ( float )( x + 1 - r ), ( float )( y + h + yo ), ( float )( z +
0.0f ), ( float )( u0 ), ( float )( v0 ) );
- t->vertexUV( ( float )( x + 1 - 0 ), ( float )( y + 0 + yo ), ( float )( z +
- 0.0f ), ( float )( u0 ), ( float )( v1 ) );
- t->vertexUV( ( float )( x + 1 - 0 ), ( float )( y + 0 + yo ), ( float )( z +
- 1.0f ), ( float )( u1 ), ( float )( v1 ) );
+ t->vertexUV( static_cast<float>(x + 1 - 0), ( float )( y + 0 + yo ), ( float )( z +
+ 0.0f ), ( float )( u0 ), ( float )( v1 ) );
+ t->vertexUV( static_cast<float>(x + 1 - 0), ( float )( y + 0 + yo ), ( float )( z +
+ 1.0f ), ( float )( u1 ), ( float )( v1 ) );
t->vertexUV( ( float )( x + 1 - r ), ( float )( y + h + yo ), ( float )( z +
1.0f ), ( float )( u1 ), ( float )( v0 ) );
@@ -2504,14 +2504,14 @@ bool TileRenderer_SPU::tesselateFireInWorld( FireTile_SPU* tt, int x, int y, int
if ( ( ( x + y + z ) & 1 ) == 0 )
{
- t->vertexUV( ( float )( x0_ ), ( float )( y + h ), ( float )( z +
- 0 ), ( float )( u1 ), ( float )( v0 ) );
- t->vertexUV( ( float )( x0 ), ( float )( y + 0 ), ( float )( z +
- 0 ), ( float )( u1 ), ( float )( v1 ) );
- t->vertexUV( ( float )( x0 ), ( float )( y + 0 ), ( float )( z +
- 1 ), ( float )( u0 ), ( float )( v1 ) );
- t->vertexUV( ( float )( x0_ ), ( float )( y + h ), ( float )( z +
- 1 ), ( float )( u0 ), ( float )( v0 ) );
+ t->vertexUV( ( float )( x0_ ), ( float )( y + h ), static_cast<float>(z +
+ 0), ( float )( u1 ), ( float )( v0 ) );
+ t->vertexUV( ( float )( x0 ), static_cast<float>(y + 0), static_cast<float>(z +
+ 0), ( float )( u1 ), ( float )( v1 ) );
+ t->vertexUV( ( float )( x0 ), static_cast<float>(y + 0), static_cast<float>(z +
+ 1), ( float )( u0 ), ( float )( v1 ) );
+ t->vertexUV( ( float )( x0_ ), ( float )( y + h ), static_cast<float>(z +
+ 1), ( float )( u0 ), ( float )( v0 ) );
tex = secondTex;
u0 = tex->getU0();
@@ -2523,10 +2523,10 @@ bool TileRenderer_SPU::tesselateFireInWorld( FireTile_SPU* tt, int x, int y, int
1.0f ), ( float )( u1 ), ( float )( v0 ) );
t->vertexUV( ( float )( x1 ), ( float )( y + 0.0f ), ( float )( z +
1.0f ), ( float )( u1 ), ( float )( v1 ) );
- t->vertexUV( ( float )( x1 ), ( float )( y + 0.0f ), ( float )( z +
- 0 ), ( float )( u0 ), ( float )( v1 ) );
- t->vertexUV( ( float )( x1_ ), ( float )( y + h ), ( float )( z +
- 0 ), ( float )( u0 ), ( float )( v0 ) );
+ t->vertexUV( ( float )( x1 ), ( float )( y + 0.0f ), static_cast<float>(z +
+ 0), ( float )( u0 ), ( float )( v1 ) );
+ t->vertexUV( ( float )( x1_ ), ( float )( y + h ), static_cast<float>(z +
+ 0), ( float )( u0 ), ( float )( v0 ) );
}
else
{
@@ -2789,15 +2789,15 @@ bool TileRenderer_SPU::tesselateRailInWorld( RailTile_SPU* tt, int x, int y, int
float r = 1 / 16.0f;
- float x0 = ( float )( x + 1 );
- float x1 = ( float )( x + 1 );
- float x2 = ( float )( x + 0 );
- float x3 = ( float )( x + 0 );
+ float x0 = static_cast<float>(x + 1);
+ float x1 = static_cast<float>(x + 1);
+ float x2 = static_cast<float>(x + 0);
+ float x3 = static_cast<float>(x + 0);
- float z0 = ( float )( z + 0 );
- float z1 = ( float )( z + 1 );
- float z2 = ( float )( z + 1 );
- float z3 = ( float )( z + 0 );
+ float z0 = static_cast<float>(z + 0);
+ float z1 = static_cast<float>(z + 1);
+ float z2 = static_cast<float>(z + 1);
+ float z3 = static_cast<float>(z + 0);
float y0 = ( float )( y + r );
float y1 = ( float )( y + r );
@@ -2806,24 +2806,24 @@ bool TileRenderer_SPU::tesselateRailInWorld( RailTile_SPU* tt, int x, int y, int
if ( data == 1 || data == 2 || data == 3 || data == 7 )
{
- x0 = x3 = ( float )( x + 1 );
- x1 = x2 = ( float )( x + 0 );
- z0 = z1 = ( float )( z + 1 );
- z2 = z3 = ( float )( z + 0 );
+ x0 = x3 = static_cast<float>(x + 1);
+ x1 = x2 = static_cast<float>(x + 0);
+ z0 = z1 = static_cast<float>(z + 1);
+ z2 = z3 = static_cast<float>(z + 0);
}
else if ( data == 8 )
{
- x0 = x1 = ( float )( x + 0 );
- x2 = x3 = ( float )( x + 1 );
- z0 = z3 = ( float )( z + 1 );
- z1 = z2 = ( float )( z + 0 );
+ x0 = x1 = static_cast<float>(x + 0);
+ x2 = x3 = static_cast<float>(x + 1);
+ z0 = z3 = static_cast<float>(z + 1);
+ z1 = z2 = static_cast<float>(z + 0);
}
else if ( data == 9 )
{
- x0 = x3 = ( float )( x + 0 );
- x1 = x2 = ( float )( x + 1 );
- z0 = z1 = ( float )( z + 0 );
- z2 = z3 = ( float )( z + 1 );
+ x0 = x3 = static_cast<float>(x + 0);
+ x1 = x2 = static_cast<float>(x + 1);
+ z0 = z1 = static_cast<float>(z + 0);
+ z2 = z3 = static_cast<float>(z + 1);
}
if ( data == 2 || data == 4 )
@@ -3555,9 +3555,9 @@ bool TileRenderer_SPU::tesselateCrossInWorld( Tile_SPU* tt, int x, int y, int z
}
t->color( br * r, br * g, br * b );
- float xt = (float)x;
- float yt = (float)y;
- float zt = (float)z;
+ float xt = static_cast<float>(x);
+ float yt = static_cast<float>(y);
+ float zt = static_cast<float>(z);
if (tt->id == Tile_SPU::tallgrass_Id)
{
@@ -3575,7 +3575,7 @@ bool TileRenderer_SPU::tesselateCrossInWorld( Tile_SPU* tt, int x, int y, int z
bool TileRenderer_SPU::tesselateStemInWorld( Tile_SPU* _tt, int x, int y, int z )
{
- StemTile_SPU* tt = ( StemTile_SPU* )_tt;
+ StemTile_SPU* tt = static_cast<StemTile_SPU *>(_tt);
Tesselator_SPU* t = getTesselator();
float br;
@@ -3805,7 +3805,7 @@ bool TileRenderer_SPU::tesselateLilypadInWorld(WaterlilyTile_SPU *tt, int x, int
int64_t seed = (x * 3129871) ^ (z * 116129781l) ^ (y);
seed = seed * seed * 42317861 + seed * 11;
- int dir = (int) ((seed >> 16) & 0x3);
+ int dir = static_cast<int>((seed >> 16) & 0x3);
@@ -4017,7 +4017,7 @@ bool TileRenderer_SPU::tesselateWaterInWorld( Tile_SPU* tt, int x, int y, int z
{
changed = true;
Icon_SPU *tex = getTexture( tt, 1, data );
- float angle = ( float )LiquidTile_SPU::getSlopeAngle( level, x, y, z, m );
+ float angle = static_cast<float>(LiquidTile_SPU::getSlopeAngle(level, x, y, z, m));
if ( angle > -999 )
{
tex = getTexture( tt, 2, data );
@@ -4112,8 +4112,8 @@ bool TileRenderer_SPU::tesselateWaterInWorld( Tile_SPU* tt, int x, int y, int z
{
hh0 = ( float )( h0 );
hh1 = ( float )( h3 );
- x0 = ( float )( x );
- x1 = ( float )( x + 1 );
+ x0 = static_cast<float>(x);
+ x1 = static_cast<float>(x + 1);
z0 = ( float )( z + offs);
z1 = ( float )( z + offs);
}
@@ -4121,8 +4121,8 @@ bool TileRenderer_SPU::tesselateWaterInWorld( Tile_SPU* tt, int x, int y, int z
{
hh0 = ( float )( h2 );
hh1 = ( float )( h1 );
- x0 = ( float )( x + 1 );
- x1 = ( float )( x );
+ x0 = static_cast<float>(x + 1);
+ x1 = static_cast<float>(x);
z0 = ( float )( z + 1 - offs);
z1 = ( float )( z + 1 - offs);
}
@@ -4132,8 +4132,8 @@ bool TileRenderer_SPU::tesselateWaterInWorld( Tile_SPU* tt, int x, int y, int z
hh1 = ( float )( h0 );
x0 = ( float )( x + offs);
x1 = ( float )( x + offs);
- z0 = ( float )( z + 1 );
- z1 = ( float )( z );
+ z0 = static_cast<float>(z + 1);
+ z1 = static_cast<float>(z);
}
else
{
@@ -4141,8 +4141,8 @@ bool TileRenderer_SPU::tesselateWaterInWorld( Tile_SPU* tt, int x, int y, int z
hh1 = ( float )( h2 );
x0 = ( float )( x + 1 - offs);
x1 = ( float )( x + 1 - offs);
- z0 = ( float )( z );
- z1 = ( float )( z + 1 );
+ z0 = static_cast<float>(z);
+ z1 = static_cast<float>(z + 1);
}
@@ -4172,8 +4172,8 @@ bool TileRenderer_SPU::tesselateWaterInWorld( Tile_SPU* tt, int x, int y, int z
t->color( c11 * br * r, c11 * br * g, c11 * br * b );
t->vertexUV( ( float )( x0 ), ( float )( y + hh0 ), ( float )( z0 ), ( float )( u0 ), ( float )( v01 ) );
t->vertexUV( ( float )( x1 ), ( float )( y + hh1 ), ( float )( z1 ), ( float )( u1 ), ( float )( v02 ) );
- t->vertexUV( ( float )( x1 ), ( float )( y + 0 ), ( float )( z1 ), ( float )( u1 ), ( float )( v1 ) );
- t->vertexUV( ( float )( x0 ), ( float )( y + 0 ), ( float )( z0 ), ( float )( u0 ), ( float )( v1 ) );
+ t->vertexUV( ( float )( x1 ), static_cast<float>(y + 0), ( float )( z1 ), ( float )( u1 ), ( float )( v1 ) );
+ t->vertexUV( ( float )( x0 ), static_cast<float>(y + 0), ( float )( z0 ), ( float )( u0 ), ( float )( v1 ) );
}
@@ -4586,7 +4586,7 @@ bool TileRenderer_SPU::tesselateBlockInWorldWithAmbienceOcclusionTexLighting( Ti
else
{
/*#ifdef _DEBUG
- if(dynamic_cast<StairTile *>(tt)!=NULL)
+ if(dynamic_cast<StairTile *>(tt)!=nullptr)
{
// stair tile
faceFlags |= tt->shouldRenderFace( level, pX, pY - 1, pZ, 0 ) ? 0x01 : 0;
@@ -4786,7 +4786,7 @@ bool TileRenderer_SPU::tesselateBlockInWorldWithAmbienceOcclusionTexLighting( Ti
c4g *= ll4;
c4b *= ll4;
- renderFaceDown( tt, ( float )pX, ( float )pY, ( float )pZ, getTexture( tt, level, pX, pY, pZ, 0 ) );
+ renderFaceDown( tt, static_cast<float>(pX), static_cast<float>(pY), static_cast<float>(pZ), getTexture( tt, level, pX, pY, pZ, 0 ) );
}
if ( faceFlags & 0x02 )
{
@@ -4878,7 +4878,7 @@ bool TileRenderer_SPU::tesselateBlockInWorldWithAmbienceOcclusionTexLighting( Ti
c4b *= ll4;
- renderFaceUp( tt, ( float )pX, ( float )pY, ( float )pZ, getTexture( tt, level, pX, pY, pZ, 1 ) );
+ renderFaceUp( tt, static_cast<float>(pX), static_cast<float>(pY), static_cast<float>(pZ), getTexture( tt, level, pX, pY, pZ, 1 ) );
}
if ( faceFlags & 0x04 )
{
@@ -4946,14 +4946,14 @@ bool TileRenderer_SPU::tesselateBlockInWorldWithAmbienceOcclusionTexLighting( Ti
float _ll2 = (ll00z + ll0Yz + llX0z + llXYz) / 4.0f;
float _ll3 = (ll0yz + ll00z + llXyz + llX0z) / 4.0f;
float _ll4 = (llxyz + llx0z + ll0yz + ll00z) / 4.0f;
- ll1 = (float) (_ll1 * tileShapeY1 * (1.0 - tileShapeX0) + _ll2 * tileShapeY0 * tileShapeX0 + _ll3 * (1.0 - tileShapeY1) * tileShapeX0 + _ll4 * (1.0 - tileShapeY1)
- * (1.0 - tileShapeX0));
- ll2 = (float) (_ll1 * tileShapeY1 * (1.0 - tileShapeX1) + _ll2 * tileShapeY1 * tileShapeX1 + _ll3 * (1.0 - tileShapeY1) * tileShapeX1 + _ll4 * (1.0 - tileShapeY1)
- * (1.0 - tileShapeX1));
- ll3 = (float) (_ll1 * tileShapeY0 * (1.0 - tileShapeX1) + _ll2 * tileShapeY0 * tileShapeX1 + _ll3 * (1.0 - tileShapeY0) * tileShapeX1 + _ll4 * (1.0 - tileShapeY0)
- * (1.0 - tileShapeX1));
- ll4 = (float) (_ll1 * tileShapeY0 * (1.0 - tileShapeX0) + _ll2 * tileShapeY0 * tileShapeX0 + _ll3 * (1.0 - tileShapeY0) * tileShapeX0 + _ll4 * (1.0 - tileShapeY0)
- * (1.0 - tileShapeX0));
+ ll1 = static_cast<float>(_ll1 * tileShapeY1 * (1.0 - tileShapeX0) + _ll2 * tileShapeY0 * tileShapeX0 + _ll3 * (1.0 - tileShapeY1) * tileShapeX0 + _ll4 * (1.0 - tileShapeY1)
+ * (1.0 - tileShapeX0));
+ ll2 = static_cast<float>(_ll1 * tileShapeY1 * (1.0 - tileShapeX1) + _ll2 * tileShapeY1 * tileShapeX1 + _ll3 * (1.0 - tileShapeY1) * tileShapeX1 + _ll4 * (1.0 - tileShapeY1)
+ * (1.0 - tileShapeX1));
+ ll3 = static_cast<float>(_ll1 * tileShapeY0 * (1.0 - tileShapeX1) + _ll2 * tileShapeY0 * tileShapeX1 + _ll3 * (1.0 - tileShapeY0) * tileShapeX1 + _ll4 * (1.0 - tileShapeY0)
+ * (1.0 - tileShapeX1));
+ ll4 = static_cast<float>(_ll1 * tileShapeY0 * (1.0 - tileShapeX0) + _ll2 * tileShapeY0 * tileShapeX0 + _ll3 * (1.0 - tileShapeY0) * tileShapeX0 + _ll4 * (1.0 - tileShapeY0)
+ * (1.0 - tileShapeX0));
int _tc1 = blend(ccx0z, ccxYz, cc0Yz, cc00z);
int _tc2 = blend(cc0Yz, ccX0z, ccXYz, cc00z);
@@ -4998,7 +4998,7 @@ bool TileRenderer_SPU::tesselateBlockInWorldWithAmbienceOcclusionTexLighting( Ti
Icon_SPU *tex = getTexture(tt, level, pX, pY, pZ, 2);
- renderNorth( tt, ( float )pX, ( float )pY, ( float )pZ, tex );
+ renderNorth( tt, static_cast<float>(pX), static_cast<float>(pY), static_cast<float>(pZ), tex );
if ( fancy && (tex == &Tile_SPU::ms_pTileData->iconData[Tile_SPU::grass_Id] && !hasFixedTexture() ))
{
@@ -5015,7 +5015,7 @@ bool TileRenderer_SPU::tesselateBlockInWorldWithAmbienceOcclusionTexLighting( Ti
c3b *= pBaseBlue;
c4b *= pBaseBlue;
bool prev = t->setMipmapEnable( false ); // 4J added - this is rendering the little bit of grass at the top of the side of dirt, don't mipmap it
- renderNorth( tt, ( float )pX, ( float )pY, ( float )pZ, GrassTile_SPU::getSideTextureOverlay() );
+ renderNorth( tt, static_cast<float>(pX), static_cast<float>(pY), static_cast<float>(pZ), GrassTile_SPU::getSideTextureOverlay() );
t->setMipmapEnable( prev );
}
}
@@ -5082,14 +5082,14 @@ bool TileRenderer_SPU::tesselateBlockInWorldWithAmbienceOcclusionTexLighting( Ti
float _ll4 = (ll00Z + ll0YZ + llX0Z + llXYZ) / 4.0f;
float _ll3 = (ll0yZ + ll00Z + llXyZ + llX0Z) / 4.0f;
float _ll2 = (llxyZ + llx0Z + ll0yZ + ll00Z) / 4.0f;
- ll1 = (float) (_ll1 * tileShapeY1 * (1.0 - tileShapeX0) + _ll4 * tileShapeY1 * tileShapeX0 + _ll3 * (1.0 - tileShapeY1) * tileShapeX0 + _ll2 * (1.0 - tileShapeY1)
- * (1.0 - tileShapeX0));
- ll2 = (float) (_ll1 * tileShapeY0 * (1.0 - tileShapeX0) + _ll4 * tileShapeY0 * tileShapeX0 + _ll3 * (1.0 - tileShapeY0) * tileShapeX0 + _ll2 * (1.0 - tileShapeY0)
- * (1.0 - tileShapeX0));
- ll3 = (float) (_ll1 * tileShapeY0 * (1.0 - tileShapeX1) + _ll4 * tileShapeY0 * tileShapeX1 + _ll3 * (1.0 - tileShapeY0) * tileShapeX1 + _ll2 * (1.0 - tileShapeY0)
- * (1.0 - tileShapeX1));
- ll4 = (float) (_ll1 * tileShapeY1 * (1.0 - tileShapeX1) + _ll4 * tileShapeY1 * tileShapeX1 + _ll3 * (1.0 - tileShapeY1) * tileShapeX1 + _ll2 * (1.0 - tileShapeY1)
- * (1.0 - tileShapeX1));
+ ll1 = static_cast<float>(_ll1 * tileShapeY1 * (1.0 - tileShapeX0) + _ll4 * tileShapeY1 * tileShapeX0 + _ll3 * (1.0 - tileShapeY1) * tileShapeX0 + _ll2 * (1.0 - tileShapeY1)
+ * (1.0 - tileShapeX0));
+ ll2 = static_cast<float>(_ll1 * tileShapeY0 * (1.0 - tileShapeX0) + _ll4 * tileShapeY0 * tileShapeX0 + _ll3 * (1.0 - tileShapeY0) * tileShapeX0 + _ll2 * (1.0 - tileShapeY0)
+ * (1.0 - tileShapeX0));
+ ll3 = static_cast<float>(_ll1 * tileShapeY0 * (1.0 - tileShapeX1) + _ll4 * tileShapeY0 * tileShapeX1 + _ll3 * (1.0 - tileShapeY0) * tileShapeX1 + _ll2 * (1.0 - tileShapeY0)
+ * (1.0 - tileShapeX1));
+ ll4 = static_cast<float>(_ll1 * tileShapeY1 * (1.0 - tileShapeX1) + _ll4 * tileShapeY1 * tileShapeX1 + _ll3 * (1.0 - tileShapeY1) * tileShapeX1 + _ll2 * (1.0 - tileShapeY1)
+ * (1.0 - tileShapeX1));
int _tc1 = blend(ccx0Z, ccxYZ, cc0YZ, cc00Z);
int _tc4 = blend(cc0YZ, ccX0Z, ccXYZ, cc00Z);
@@ -5134,7 +5134,7 @@ bool TileRenderer_SPU::tesselateBlockInWorldWithAmbienceOcclusionTexLighting( Ti
c4g *= ll4;
c4b *= ll4;
Icon_SPU *tex = getTexture(tt, level, pX, pY, pZ, 3);
- renderSouth( tt, ( float )pX, ( float )pY, ( float )pZ, getTexture(tt, level, pX, pY, pZ, 3 ) );
+ renderSouth( tt, static_cast<float>(pX), static_cast<float>(pY), static_cast<float>(pZ), getTexture(tt, level, pX, pY, pZ, 3 ) );
if ( fancy && (tex == &Tile_SPU::ms_pTileData->iconData[Tile_SPU::grass_Id] && !hasFixedTexture() ))
{
@@ -5151,7 +5151,7 @@ bool TileRenderer_SPU::tesselateBlockInWorldWithAmbienceOcclusionTexLighting( Ti
c3b *= pBaseBlue;
c4b *= pBaseBlue;
bool prev = t->setMipmapEnable( false ); // 4J added - this is rendering the little bit of grass at the top of the side of dirt, don't mipmap it
- renderSouth( tt, ( float )pX, ( float )pY, ( float )pZ, GrassTile_SPU::getSideTextureOverlay() );
+ renderSouth( tt, static_cast<float>(pX), static_cast<float>(pY), static_cast<float>(pZ), GrassTile_SPU::getSideTextureOverlay() );
t->setMipmapEnable( prev );
}
}
@@ -5217,14 +5217,14 @@ bool TileRenderer_SPU::tesselateBlockInWorldWithAmbienceOcclusionTexLighting( Ti
float _ll1 = (llx00 + llx0Z + llxY0 + llxYZ) / 4.0f;
float _ll2 = (llx0z + llx00 + llxYz + llxY0) / 4.0f;
float _ll3 = (llxyz + llxy0 + llx0z + llx00) / 4.0f;
- ll1 = (float) (_ll1 * tileShapeY1 * tileShapeZ1 + _ll2 * tileShapeY1 * (1.0 - tileShapeZ1) + _ll3 * (1.0 - tileShapeY1) * (1.0 - tileShapeZ1) + _ll4 * (1.0 - tileShapeY1)
- * tileShapeZ1);
- ll2 = (float) (_ll1 * tileShapeY1 * tileShapeZ0 + _ll2 * tileShapeY1 * (1.0 - tileShapeZ0) + _ll3 * (1.0 - tileShapeY1) * (1.0 - tileShapeZ0) + _ll4 * (1.0 - tileShapeY1)
- * tileShapeZ0);
- ll3 = (float) (_ll1 * tileShapeY0 * tileShapeZ0 + _ll2 * tileShapeY0 * (1.0 - tileShapeZ0) + _ll3 * (1.0 - tileShapeY0) * (1.0 - tileShapeZ0) + _ll4 * (1.0 - tileShapeY0)
- * tileShapeZ0);
- ll4 = (float) (_ll1 * tileShapeY0 * tileShapeZ1 + _ll2 * tileShapeY0 * (1.0 - tileShapeZ1) + _ll3 * (1.0 - tileShapeY0) * (1.0 - tileShapeZ1) + _ll4 * (1.0 - tileShapeY0)
- * tileShapeZ1);
+ ll1 = static_cast<float>(_ll1 * tileShapeY1 * tileShapeZ1 + _ll2 * tileShapeY1 * (1.0 - tileShapeZ1) + _ll3 * (1.0 - tileShapeY1) * (1.0 - tileShapeZ1) + _ll4 * (1.0 - tileShapeY1)
+ * tileShapeZ1);
+ ll2 = static_cast<float>(_ll1 * tileShapeY1 * tileShapeZ0 + _ll2 * tileShapeY1 * (1.0 - tileShapeZ0) + _ll3 * (1.0 - tileShapeY1) * (1.0 - tileShapeZ0) + _ll4 * (1.0 - tileShapeY1)
+ * tileShapeZ0);
+ ll3 = static_cast<float>(_ll1 * tileShapeY0 * tileShapeZ0 + _ll2 * tileShapeY0 * (1.0 - tileShapeZ0) + _ll3 * (1.0 - tileShapeY0) * (1.0 - tileShapeZ0) + _ll4 * (1.0 - tileShapeY0)
+ * tileShapeZ0);
+ ll4 = static_cast<float>(_ll1 * tileShapeY0 * tileShapeZ1 + _ll2 * tileShapeY0 * (1.0 - tileShapeZ1) + _ll3 * (1.0 - tileShapeY0) * (1.0 - tileShapeZ1) + _ll4 * (1.0 - tileShapeY0)
+ * tileShapeZ1);
int _tc4 = blend(ccxy0, ccxyZ, ccx0Z, ccx00);
int _tc1 = blend(ccx0Z, ccxY0, ccxYZ, ccx00);
@@ -5269,7 +5269,7 @@ bool TileRenderer_SPU::tesselateBlockInWorldWithAmbienceOcclusionTexLighting( Ti
c4g *= ll4;
c4b *= ll4;
Icon_SPU *tex = getTexture(tt, level, pX, pY, pZ, 4);
- renderWest( tt, ( float )pX, ( float )pY, ( float )pZ, tex );
+ renderWest( tt, static_cast<float>(pX), static_cast<float>(pY), static_cast<float>(pZ), tex );
if ( fancy && (tex == &Tile_SPU::ms_pTileData->iconData[Tile_SPU::grass_Id] && !hasFixedTexture() ))
{
@@ -5286,7 +5286,7 @@ bool TileRenderer_SPU::tesselateBlockInWorldWithAmbienceOcclusionTexLighting( Ti
c3b *= pBaseBlue;
c4b *= pBaseBlue;
bool prev = t->setMipmapEnable( false ); // 4J added - this is rendering the little bit of grass at the top of the side of dirt, don't mipmap it
- renderWest( tt, ( float )pX, ( float )pY, ( float )pZ, GrassTile_SPU::getSideTextureOverlay() );
+ renderWest( tt, static_cast<float>(pX), static_cast<float>(pY), static_cast<float>(pZ), GrassTile_SPU::getSideTextureOverlay() );
t->setMipmapEnable( prev );
}
}
@@ -5352,14 +5352,14 @@ bool TileRenderer_SPU::tesselateBlockInWorldWithAmbienceOcclusionTexLighting( Ti
float _ll2 = (llXyz + llXy0 + llX0z + llX00) / 4.0f;
float _ll3 = (llX0z + llX00 + llXYz + llXY0) / 4.0f;
float _ll4 = (llX00 + llX0Z + llXY0 + llXYZ) / 4.0f;
- ll1 = (float) (_ll1 * (1.0 - tileShapeY0) * tileShapeZ1 + _ll2 * (1.0 - tileShapeY0) * (1.0 - tileShapeZ1) + _ll3 * tileShapeY0 * (1.0 - tileShapeZ1) + _ll4 * tileShapeY0
- * tileShapeZ1);
- ll2 = (float) (_ll1 * (1.0 - tileShapeY0) * tileShapeZ0 + _ll2 * (1.0 - tileShapeY0) * (1.0 - tileShapeZ0) + _ll3 * tileShapeY0 * (1.0 - tileShapeZ0) + _ll4 * tileShapeY0
- * tileShapeZ0);
- ll3 = (float) (_ll1 * (1.0 - tileShapeY1) * tileShapeZ0 + _ll2 * (1.0 - tileShapeY1) * (1.0 - tileShapeZ0) + _ll3 * tileShapeY1 * (1.0 - tileShapeZ0) + _ll4 * tileShapeY1
- * tileShapeZ0);
- ll4 = (float) (_ll1 * (1.0 - tileShapeY1) * tileShapeZ1 + _ll2 * (1.0 - tileShapeY1) * (1.0 - tileShapeZ1) + _ll3 * tileShapeY1 * (1.0 - tileShapeZ1) + _ll4 * tileShapeY1
- * tileShapeZ1);
+ ll1 = static_cast<float>(_ll1 * (1.0 - tileShapeY0) * tileShapeZ1 + _ll2 * (1.0 - tileShapeY0) * (1.0 - tileShapeZ1) + _ll3 * tileShapeY0 * (1.0 - tileShapeZ1) + _ll4 * tileShapeY0
+ * tileShapeZ1);
+ ll2 = static_cast<float>(_ll1 * (1.0 - tileShapeY0) * tileShapeZ0 + _ll2 * (1.0 - tileShapeY0) * (1.0 - tileShapeZ0) + _ll3 * tileShapeY0 * (1.0 - tileShapeZ0) + _ll4 * tileShapeY0
+ * tileShapeZ0);
+ ll3 = static_cast<float>(_ll1 * (1.0 - tileShapeY1) * tileShapeZ0 + _ll2 * (1.0 - tileShapeY1) * (1.0 - tileShapeZ0) + _ll3 * tileShapeY1 * (1.0 - tileShapeZ0) + _ll4 * tileShapeY1
+ * tileShapeZ0);
+ ll4 = static_cast<float>(_ll1 * (1.0 - tileShapeY1) * tileShapeZ1 + _ll2 * (1.0 - tileShapeY1) * (1.0 - tileShapeZ1) + _ll3 * tileShapeY1 * (1.0 - tileShapeZ1) + _ll4 * tileShapeY1
+ * tileShapeZ1);
int _tc1 = blend(ccXy0, ccXyZ, ccX0Z, ccX00);
int _tc4 = blend(ccX0Z, ccXY0, ccXYZ, ccX00);
@@ -5405,7 +5405,7 @@ bool TileRenderer_SPU::tesselateBlockInWorldWithAmbienceOcclusionTexLighting( Ti
c4b *= ll4;
Icon_SPU *tex = getTexture(tt, level, pX, pY, pZ, 5);
- renderEast( tt, ( float )pX, ( float )pY, ( float )pZ, tex );
+ renderEast( tt, static_cast<float>(pX), static_cast<float>(pY), static_cast<float>(pZ), tex );
if ( fancy && (tex == &Tile_SPU::ms_pTileData->iconData[Tile_SPU::grass_Id] && !hasFixedTexture() ))
{
c1r *= pBaseRed;
@@ -5422,7 +5422,7 @@ bool TileRenderer_SPU::tesselateBlockInWorldWithAmbienceOcclusionTexLighting( Ti
c4b *= pBaseBlue;
bool prev = t->setMipmapEnable( false ); // 4J added - this is rendering the little bit of grass at the top of the side of dirt, don't mipmap it
- renderEast( tt, ( float )pX, ( float )pY, ( float )pZ, GrassTile_SPU::getSideTextureOverlay() );
+ renderEast( tt, static_cast<float>(pX), static_cast<float>(pY), static_cast<float>(pZ), GrassTile_SPU::getSideTextureOverlay() );
t->setMipmapEnable( prev );
}
}
@@ -6005,8 +6005,8 @@ int TileRenderer_SPU::blend( int a, int b, int c, int def )
int TileRenderer_SPU::blend(int a, int b, int c, int d, float fa, float fb, float fc, float fd)
{
- int top = (int) ((float) ((a >> 16) & 0xff) * fa + (float) ((b >> 16) & 0xff) * fb + (float) ((c >> 16) & 0xff) * fc + (float) ((d >> 16) & 0xff) * fd) & 0xff;
- int bottom = (int) ((float) (a & 0xff) * fa + (float) (b & 0xff) * fb + (float) (c & 0xff) * fc + (float) (d & 0xff) * fd) & 0xff;
+ int top = static_cast<int>((float)((a >> 16) & 0xff) * fa + (float)((b >> 16) & 0xff) * fb + (float)((c >> 16) & 0xff) * fc + (float)((d >> 16) & 0xff) * fd) & 0xff;
+ int bottom = static_cast<int>((float)(a & 0xff) * fa + (float)(b & 0xff) * fb + (float)(c & 0xff) * fc + (float)(d & 0xff) * fd) & 0xff;
return (top << 16) | bottom;
}
@@ -7626,7 +7626,7 @@ Icon_SPU *TileRenderer_SPU::getTexture(Tile_SPU *tile)
Icon_SPU *TileRenderer_SPU::getTextureOrMissing(Icon_SPU *Icon_SPU)
{
- if (Icon_SPU == NULL)
+ if (Icon_SPU == nullptr)
{
assert(0);
// return minecraft->textures->getMissingIcon_SPU(Icon_SPU::TYPE_TERRAIN);
diff --git a/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/TileRenderer_SPU.h b/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/TileRenderer_SPU.h
index 2c484faa..3f34a778 100644
--- a/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/TileRenderer_SPU.h
+++ b/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/TileRenderer_SPU.h
@@ -72,8 +72,8 @@ public:
void tesselateInWorldFixedTexture( Tile_SPU* tile, int x, int y, int z, Icon_SPU *fixedTexture ); // 4J renamed to differentiate from tesselateInWorld
void tesselateInWorldNoCulling( Tile_SPU* tile, int x, int y, int z, int forceData = -1,
- TileEntity* forceEntity = NULL ); // 4J added forceData, forceEntity param
- bool tesselateInWorld( Tile_SPU* tt, int x, int y, int z, int forceData = -1, TileEntity* forceEntity = NULL ); // 4J added forceData, forceEntity param
+ TileEntity* forceEntity = nullptr ); // 4J added forceData, forceEntity param
+ bool tesselateInWorld( Tile_SPU* tt, int x, int y, int z, int forceData = -1, TileEntity* forceEntity = nullptr ); // 4J added forceData, forceEntity param
private:
bool tesselateAirPortalFrameInWorld(TheEndPortalFrameTile *tt, int x, int y, int z);
diff --git a/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/Tile_SPU.cpp b/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/Tile_SPU.cpp
index f2dfeaac..c5a9be4d 100644
--- a/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/Tile_SPU.cpp
+++ b/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/Tile_SPU.cpp
@@ -92,7 +92,7 @@
#include <new>
#include "AnvilTile_SPU.h"
-TileData_SPU* Tile_SPU::ms_pTileData = NULL;
+TileData_SPU* Tile_SPU::ms_pTileData = nullptr;
Tile_SPU Tile_SPU::m_tiles[256];
@@ -181,7 +181,7 @@ Icon_SPU *Tile_SPU::getTexture(ChunkRebuildData *level, int x, int y, int z, int
}
- Icon_SPU *icon = NULL;
+ Icon_SPU *icon = nullptr;
if(opaque)
{
LeafTile_SPU::setFancy(false);
@@ -215,13 +215,13 @@ Icon_SPU *Tile_SPU::getTexture(int face)
// void Tile_SPU::addAABBs(Level *level, int x, int y, int z, AABB *box, AABBList *boxes, Entity *source)
// {
// AABB *aabb = getAABB(level, x, y, z);
-// if (aabb != NULL && box->intersects(aabb)) boxes->push_back(aabb);
+// if (aabb != nullptr && box->intersects(aabb)) boxes->push_back(aabb);
// }
//
// void Tile_SPU::addAABBs(Level *level, int x, int y, int z, AABB *box, AABBList *boxes)
// {
// AABB *aabb = getAABB(level, x, y, z);
-// if (aabb != NULL && box->intersects(aabb)) boxes->push_back(aabb);
+// if (aabb != nullptr && box->intersects(aabb)) boxes->push_back(aabb);
// }
//
// AABB *Tile_SPU::getAABB(Level *level, int x, int y, int z)
@@ -368,18 +368,18 @@ Icon_SPU *Tile_SPU::getTexture(int face)
// Vec3 *zh0 = a->clipZ(b, zz0);
// Vec3 *zh1 = a->clipZ(b, zz1);
//
-// Vec3 *closest = NULL;
+// Vec3 *closest = nullptr;
//
-// if (containsX(xh0) && (closest == NULL || a->distanceTo(xh0) < a->distanceTo(closest))) closest = xh0;
-// if (containsX(xh1) && (closest == NULL || a->distanceTo(xh1) < a->distanceTo(closest))) closest = xh1;
-// if (containsY(yh0) && (closest == NULL || a->distanceTo(yh0) < a->distanceTo(closest))) closest = yh0;
-// if (containsY(yh1) && (closest == NULL || a->distanceTo(yh1) < a->distanceTo(closest))) closest = yh1;
-// if (containsZ(zh0) && (closest == NULL || a->distanceTo(zh0) < a->distanceTo(closest))) closest = zh0;
-// if (containsZ(zh1) && (closest == NULL || a->distanceTo(zh1) < a->distanceTo(closest))) closest = zh1;
+// if (containsX(xh0) && (closest == nullptr || a->distanceTo(xh0) < a->distanceTo(closest))) closest = xh0;
+// if (containsX(xh1) && (closest == nullptr || a->distanceTo(xh1) < a->distanceTo(closest))) closest = xh1;
+// if (containsY(yh0) && (closest == nullptr || a->distanceTo(yh0) < a->distanceTo(closest))) closest = yh0;
+// if (containsY(yh1) && (closest == nullptr || a->distanceTo(yh1) < a->distanceTo(closest))) closest = yh1;
+// if (containsZ(zh0) && (closest == nullptr || a->distanceTo(zh0) < a->distanceTo(closest))) closest = zh0;
+// if (containsZ(zh1) && (closest == nullptr || a->distanceTo(zh1) < a->distanceTo(closest))) closest = zh1;
//
// LeaveCriticalSection(&m_csShape);
//
-// if (closest == NULL) return NULL;
+// if (closest == nullptr) return nullptr;
//
// int face = -1;
//
@@ -395,19 +395,19 @@ Icon_SPU *Tile_SPU::getTexture(int face)
//
// bool Tile_SPU::containsX(Vec3 *v)
// {
-// if( v == NULL) return false;
+// if( v == nullptr) return false;
// return v->y >= yy0 && v->y <= yy1 && v->z >= zz0 && v->z <= zz1;
// }
//
// bool Tile_SPU::containsY(Vec3 *v)
// {
-// if( v == NULL) return false;
+// if( v == nullptr) return false;
// return v->x >= xx0 && v->x <= xx1 && v->z >= zz0 && v->z <= zz1;
// }
//
// bool Tile_SPU::containsZ(Vec3 *v)
// {
-// if( v == NULL) return false;
+// if( v == nullptr) return false;
// return v->x >= xx0 && v->x <= xx1 && v->y >= yy0 && v->y <= yy1;
// }
//
@@ -516,7 +516,7 @@ void Tile_SPU::updateDefaultShape()
// // 4J Stu - Special case - only record a crop destroy if is fully grown
// if(id==Tile_SPU::crops_Id)
// {
-// if( Tile_SPU::crops->getResource(data, NULL, 0) > 0 )
+// if( Tile_SPU::crops->getResource(data, nullptr, 0) > 0 )
// player->awardStat(Stats::blocksMined[id], 1);
// }
// else
@@ -533,7 +533,7 @@ void Tile_SPU::updateDefaultShape()
// if (isCubeShaped() && !isEntityTile[id] && EnchantmentHelper::hasSilkTouch(player->inventory))
// {
// shared_ptr<ItemInstance> item = getSilkTouchItemInstance(data);
-// if (item != NULL)
+// if (item != nullptr)
// {
// popResource(level, x, y, z, item);
// }
@@ -625,7 +625,7 @@ float Tile_SPU::getShadeBrightness(ChunkRebuildData *level, int x, int y, int z)
Tile_SPU* Tile_SPU::createFromID( int tileID )
{
if(tileID == 0)
- return NULL;
+ return nullptr;
if(m_tiles[tileID].id != -1)
return &m_tiles[tileID];
diff --git a/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/Tile_SPU.h b/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/Tile_SPU.h
index 484823ef..e3d11f04 100644
--- a/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/Tile_SPU.h
+++ b/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/Tile_SPU.h
@@ -242,7 +242,7 @@ public:
Icon_SPU *getTexture(int face, int data);
Icon_SPU *getTexture(int face);
public:
- void updateShape(ChunkRebuildData *level, int x, int y, int z, int forceData = -1, TileEntity* forceEntity = NULL); // 4J added forceData, forceEntity param
+ void updateShape(ChunkRebuildData *level, int x, int y, int z, int forceData = -1, TileEntity* forceEntity = nullptr); // 4J added forceData, forceEntity param
double getShapeX0();
double getShapeX1();
double getShapeY0();
@@ -465,7 +465,7 @@ public:
double getShapeZ1() { return ms_pTileData->zz1[id]; }
Material_SPU* getMaterial();
- virtual void updateShape(ChunkRebuildData *level, int x, int y, int z, int forceData = -1, TileEntity* forceEntity = NULL); // 4J added forceData, forceEntity param
+ virtual void updateShape(ChunkRebuildData *level, int x, int y, int z, int forceData = -1, TileEntity* forceEntity = nullptr); // 4J added forceData, forceEntity param
virtual void updateDefaultShape();
virtual void setShape(float x0, float y0, float z0, float x1, float y1, float z1);
virtual float getBrightness(ChunkRebuildData *level, int x, int y, int z);
diff --git a/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/TopSnowTile_SPU.h b/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/TopSnowTile_SPU.h
index 2b5f86a5..43cffbf8 100644
--- a/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/TopSnowTile_SPU.h
+++ b/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/TopSnowTile_SPU.h
@@ -14,7 +14,7 @@ public:
bool blocksLight() { return false; }
bool isSolidRender(bool isServerLevel = false) { return false; }
bool isCubeShaped() { return false; }
- void updateShape(ChunkRebuildData *level, int x, int y, int z, int forceData = -1, TileEntity* forceEntity = NULL) // 4J added forceData, forceEntity param
+ void updateShape(ChunkRebuildData *level, int x, int y, int z, int forceData = -1, TileEntity* forceEntity = nullptr) // 4J added forceData, forceEntity param
{
int height = level->getData(x, y, z) & HEIGHT_MASK;
float o = 2 * (1 + height) / 16.0f;
diff --git a/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/TrapDoorTile_SPU.h b/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/TrapDoorTile_SPU.h
index 6f096a17..4f72c543 100644
--- a/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/TrapDoorTile_SPU.h
+++ b/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/TrapDoorTile_SPU.h
@@ -21,7 +21,7 @@ public:
bool isSolidRender(bool isServerLevel = false) { return false; }
bool isCubeShaped() { return false; }
int getRenderShape() { return Tile_SPU::SHAPE_BLOCK;}
- void updateShape(ChunkRebuildData *level, int x, int y, int z, int forceData = -1, TileEntity* forceEntity = NULL) // 4J added forceData, forceEntity param
+ void updateShape(ChunkRebuildData *level, int x, int y, int z, int forceData = -1, TileEntity* forceEntity = nullptr) // 4J added forceData, forceEntity param
{
setShape(level->getData(x, y, z));
}
diff --git a/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/VineTile_SPU.h b/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/VineTile_SPU.h
index e2f4a4ad..7d94e750 100644
--- a/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/VineTile_SPU.h
+++ b/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/VineTile_SPU.h
@@ -27,7 +27,7 @@ public:
return false;
}
- virtual void updateShape(ChunkRebuildData *level, int x, int y, int z, int forceData = -1, TileEntity* forceEntity = NULL) // 4J added forceData, forceEntity param
+ virtual void updateShape(ChunkRebuildData *level, int x, int y, int z, int forceData = -1, TileEntity* forceEntity = nullptr) // 4J added forceData, forceEntity param
{
const float thickness = 1.0f / 16.0f;
diff --git a/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/stubs_SPU.h b/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/stubs_SPU.h
index e298ae2d..7065210f 100644
--- a/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/stubs_SPU.h
+++ b/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/stubs_SPU.h
@@ -172,15 +172,15 @@ public:
// {
// public:
// ZipFile(File *file) {}
-// InputStream *getInputStream(ZipEntry *entry) { return NULL; }
-// ZipEntry *getEntry(const wstring& name) {return NULL;}
+// InputStream *getInputStream(ZipEntry *entry) { return nullptr; }
+// ZipEntry *getEntry(const wstring& name) {return nullptr;}
// void close() {}
// };
//
// class ImageIO
// {
// public:
-// static BufferedImage *read(InputStream *in) { return NULL; }
+// static BufferedImage *read(InputStream *in) { return nullptr; }
// };
//
// class Keyboard
diff --git a/Minecraft.Client/PS3/SPU_Tasks/CompressedTile/CompressedTileStorage_SPU.cpp b/Minecraft.Client/PS3/SPU_Tasks/CompressedTile/CompressedTileStorage_SPU.cpp
index dc134eca..16ea17bb 100644
--- a/Minecraft.Client/PS3/SPU_Tasks/CompressedTile/CompressedTileStorage_SPU.cpp
+++ b/Minecraft.Client/PS3/SPU_Tasks/CompressedTile/CompressedTileStorage_SPU.cpp
@@ -315,7 +315,7 @@ void TileCompressData_SPU::loadAndUncompressLowerSection(int block, int x0, int
// tile IDs first
// ---------------------------
- if(m_lowerBlocks[block] != NULL)
+ if(m_lowerBlocks[block] != nullptr)
{
int dmaSize = padTo16(m_lowerBlocksSize[block]);
DmaData_SPU::getAndWait(m_pTileStorage->getDataPtr(), (uint32_t)m_lowerBlocks[block], dmaSize);
@@ -366,7 +366,7 @@ void TileCompressData_SPU::loadAndUncompressLowerSection(int block, int x0, int
void TileCompressData_SPU::loadAndUncompressUpperSection(int block, int x0, int z0, int x1, int z1)
{
- if(m_upperBlocks[block] != NULL)
+ if(m_upperBlocks[block] != nullptr)
{
int dmaSize = padTo16(m_upperBlocksSize[block]);
DmaData_SPU::getAndWait(m_pTileStorage->getDataPtr(), (uint32_t)m_upperBlocks[block], dmaSize);
@@ -507,7 +507,7 @@ void TileCompressData_SPU::setForChunk( Region* region, int x0, int y0, int z0 )
}
else
{
- m_lowerBlocks[i*3+j] = NULL;
+ m_lowerBlocks[i*3+j] = nullptr;
m_lowerBlocksSize[i*3+j] = 0;
m_lowerSkyLight[i*3+j] = 0;
m_lowerBlockLight[i*3+j] = 0;
@@ -527,7 +527,7 @@ void TileCompressData_SPU::setForChunk( Region* region, int x0, int y0, int z0 )
}
else
{
- m_upperBlocks[i*3+j] = NULL;
+ m_upperBlocks[i*3+j] = nullptr;
m_upperBlocksSize[i*3+j] = 0;
m_upperSkyLight[i*3+j] = 0;
m_upperBlockLight[i*3+j] = 0;
diff --git a/Minecraft.Client/PS3/SPU_Tasks/CompressedTile/SparseDataStorage_SPU.h b/Minecraft.Client/PS3/SPU_Tasks/CompressedTile/SparseDataStorage_SPU.h
index 30266d7f..3b7ae2c8 100644
--- a/Minecraft.Client/PS3/SPU_Tasks/CompressedTile/SparseDataStorage_SPU.h
+++ b/Minecraft.Client/PS3/SPU_Tasks/CompressedTile/SparseDataStorage_SPU.h
@@ -17,9 +17,9 @@
// To meet these requirements, this class is now implemented using a lock-free system, implemented using a read-copy-update (RCU) type algorithm. Some details...
-// (1) The storage details for the class are now packed into a single __int64, which contains both a pointer to the data that is required and a count of how many planes worth
+// (1) The storage details for the class are now packed into a single int64_t, which contains both a pointer to the data that is required and a count of how many planes worth
// of storage are allocated. This allows the full storage to be updated atomically using compare and exchange operations (implemented with InterlockedCompareExchangeRelease64).
-// (2) The data pointer referenced in this __int64 points to an area of memory which is 128 + 128 * plane_count bytes long, where the first 128 bytes stoere the plane indices, and
+// (2) The data pointer referenced in this int64_t points to an area of memory which is 128 + 128 * plane_count bytes long, where the first 128 bytes stoere the plane indices, and
// the rest of the data is variable in size to accomodate however many planes are required to be stored
// (3) The RCU bit of the algorithm means that any read operations don't need to do any checks or locks at all. When the data needs to be updated, a copy of it is made and updated,
// then an attempt is made to swap the new data in - if this succeeds then the old data pointer is deleted later at some point where we know nothing will be reading from it anymore.
@@ -33,7 +33,7 @@ class SparseDataStorage_SPU
{
private:
// unsigned char planeIndices[128];
- unsigned char* m_pData;
+ unsigned char* m_pData;
// unsigned char *data;
// unsigned int allocatedPlaneCount;
diff --git a/Minecraft.Client/PS3/SPU_Tasks/CompressedTile/SparseLightStorage_SPU.h b/Minecraft.Client/PS3/SPU_Tasks/CompressedTile/SparseLightStorage_SPU.h
index 01b2aa6e..728d1fe5 100644
--- a/Minecraft.Client/PS3/SPU_Tasks/CompressedTile/SparseLightStorage_SPU.h
+++ b/Minecraft.Client/PS3/SPU_Tasks/CompressedTile/SparseLightStorage_SPU.h
@@ -20,9 +20,9 @@
// To meet these requirements, this class is now implemented using a lock-free system, implemented using a read-copy-update (RCU) type algorithm. Some details...
-// (1) The storage details for the class are now packed into a single __int64, which contains both a pointer to the data that is required and a count of how many planes worth
+// (1) The storage details for the class are now packed into a single int64_t, which contains both a pointer to the data that is required and a count of how many planes worth
// of storage are allocated. This allows the full storage to be updated atomically using compare and exchange operations (implemented with InterlockedCompareExchangeRelease64).
-// (2) The data pointer referenced in this __int64 points to an area of memory which is 128 + 128 * plane_count bytes long, where the first 128 bytes stoere the plane indices, and
+// (2) The data pointer referenced in this int64_t points to an area of memory which is 128 + 128 * plane_count bytes long, where the first 128 bytes stoere the plane indices, and
// the rest of the data is variable in size to accomodate however many planes are required to be stored
// (3) The RCU bit of the algorithm means that any read operations don't need to do any checks or locks at all. When the data needs to be updated, a copy of it is made and updated,
// then an attempt is made to swap the new data in - if this succeeds then the old data pointer is deleted later at some point where we know nothing will be reading from it anymore.
@@ -36,7 +36,7 @@ class SparseLightStorage_SPU
{
private:
// unsigned char planeIndices[128];
- unsigned char* m_pData;
+ unsigned char* m_pData;
// unsigned char *data;
// unsigned int allocatedPlaneCount;