aboutsummaryrefslogtreecommitdiff
path: root/Minecraft.Client/Orbis
diff options
context:
space:
mode:
authorModMaker101 <119018978+ModMaker101@users.noreply.github.com>2026-03-07 21:56:03 -0500
committerGitHub <noreply@github.com>2026-03-08 09:56:03 +0700
commita9be52c41a02d207233199e98898fe7483d7e817 (patch)
tree71dfaec3a86b05e9ca409b97d8eb9d7f993bfdd0 /Minecraft.Client/Orbis
parent1be5faaea781402e7de06b263eeca4c688b7712c (diff)
Project modernization (#630)
* Fixed boats falling and a TP glitch #266 * Replaced every C-style cast with C++ ones * Replaced every C-style cast with C++ ones * Fixed boats falling and a TP glitch #266 * Updated NULL to nullptr and fixing some type issues * Modernized and fixed a few bugs - Replaced most instances of `NULL` with `nullptr`. - Replaced most `shared_ptr(new ...)` with `make_shared`. - Removed the `nullptr` macro as it was interfering with the actual nullptr keyword in some instances. * Fixing more conflicts * Replace int loops with size_t and start work on overrides
Diffstat (limited to 'Minecraft.Client/Orbis')
-rw-r--r--Minecraft.Client/Orbis/4JLibs/inc/4J_Profile.h2
-rw-r--r--Minecraft.Client/Orbis/4JLibs/inc/4J_Render.h6
-rw-r--r--Minecraft.Client/Orbis/4JLibs/inc/4J_Storage.h8
-rw-r--r--Minecraft.Client/Orbis/Iggy/gdraw/gdraw_orbis.cpp100
-rw-r--r--Minecraft.Client/Orbis/Iggy/gdraw/gdraw_orbis.h6
-rw-r--r--Minecraft.Client/Orbis/Iggy/gdraw/gdraw_orbis_shaders.inl160
-rw-r--r--Minecraft.Client/Orbis/Iggy/gdraw/gdraw_shared.inl86
-rw-r--r--Minecraft.Client/Orbis/Iggy/include/gdraw.h8
-rw-r--r--Minecraft.Client/Orbis/Iggy/include/iggyexpruntime.h4
-rw-r--r--Minecraft.Client/Orbis/Leaderboards/OrbisLeaderboardManager.cpp60
-rw-r--r--Minecraft.Client/Orbis/Network/Orbis_NPToolkit.cpp4
-rw-r--r--Minecraft.Client/Orbis/Network/SQRNetworkManager_Orbis.cpp132
-rw-r--r--Minecraft.Client/Orbis/Network/SQRNetworkManager_Orbis.h2
-rw-r--r--Minecraft.Client/Orbis/Network/SonyCommerce_Orbis.cpp56
-rw-r--r--Minecraft.Client/Orbis/Network/SonyCommerce_Orbis.h4
-rw-r--r--Minecraft.Client/Orbis/Network/SonyHttp_Orbis.cpp16
-rw-r--r--Minecraft.Client/Orbis/Network/SonyRemoteStorage_Orbis.cpp6
-rw-r--r--Minecraft.Client/Orbis/Network/SonyVoiceChat_Orbis.cpp14
-rw-r--r--Minecraft.Client/Orbis/OrbisExtras/OrbisStubs.cpp44
-rw-r--r--Minecraft.Client/Orbis/OrbisExtras/TLSStorage.cpp10
-rw-r--r--Minecraft.Client/Orbis/OrbisExtras/winerror.h2
-rw-r--r--Minecraft.Client/Orbis/Orbis_App.cpp68
-rw-r--r--Minecraft.Client/Orbis/Orbis_App.h2
-rw-r--r--Minecraft.Client/Orbis/Orbis_Minecraft.cpp46
-rw-r--r--Minecraft.Client/Orbis/Orbis_UIController.cpp4
-rw-r--r--Minecraft.Client/Orbis/XML/ATGXmlParser.h2
-rw-r--r--Minecraft.Client/Orbis/user_malloc.cpp6
-rw-r--r--Minecraft.Client/Orbis/user_malloc_for_tls.cpp6
-rw-r--r--Minecraft.Client/Orbis/user_new.cpp28
29 files changed, 446 insertions, 446 deletions
diff --git a/Minecraft.Client/Orbis/4JLibs/inc/4J_Profile.h b/Minecraft.Client/Orbis/4JLibs/inc/4J_Profile.h
index 03651b8f..d988adbf 100644
--- a/Minecraft.Client/Orbis/4JLibs/inc/4J_Profile.h
+++ b/Minecraft.Client/Orbis/4JLibs/inc/4J_Profile.h
@@ -120,7 +120,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/Orbis/4JLibs/inc/4J_Render.h b/Minecraft.Client/Orbis/4JLibs/inc/4J_Render.h
index 6083654d..00210f60 100644
--- a/Minecraft.Client/Orbis/4JLibs/inc/4J_Render.h
+++ b/Minecraft.Client/Orbis/4JLibs/inc/4J_Render.h
@@ -19,8 +19,8 @@ public:
int GetType() { return m_type; }
void *GetBufferPointer() { return m_pBuffer; }
int GetBufferSize() { return m_bufferSize; }
- void Release() { free(m_pBuffer); m_pBuffer = NULL; }
- bool Allocated() { return m_pBuffer != NULL; }
+ void Release() { free(m_pBuffer); m_pBuffer = nullptr; }
+ bool Allocated() { return m_pBuffer != nullptr; }
};
typedef struct
@@ -62,7 +62,7 @@ public:
void InitialiseContext();
void StartFrame(bool actualFrameStart = true);
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/Orbis/4JLibs/inc/4J_Storage.h b/Minecraft.Client/Orbis/4JLibs/inc/4J_Storage.h
index d4d845df..467c7a11 100644
--- a/Minecraft.Client/Orbis/4JLibs/inc/4J_Storage.h
+++ b/Minecraft.Client/Orbis/4JLibs/inc/4J_Storage.h
@@ -28,7 +28,7 @@ typedef struct
int newSaveBlocksUsed;
int iSaveC;
PSAVE_INFO SaveInfoA;
- PSAVE_INFO pCurrentSaveInfo; // Pointer to SAVE_INFO for the save that has just been loaded, or NULL if no save has been loaded (ie this is a newly created game)
+ PSAVE_INFO pCurrentSaveInfo; // Pointer to SAVE_INFO for the save that has just been loaded, or nullptr if no save has been loaded (ie this is a newly created game)
}
SAVE_DETAILS,*PSAVE_DETAILS;
@@ -315,7 +315,7 @@ public:
// Get details of existing savedata
C4JStorage::ESaveGameState GetSavesInfo(int iPad,int ( *Func)(LPVOID lpParam,SAVE_DETAILS *pSaveDetails,const bool),LPVOID lpParam,char *pszSavePackName); // Start search
- PSAVE_DETAILS ReturnSavesInfo(); // Returns result of search (or NULL if not yet received)
+ PSAVE_DETAILS ReturnSavesInfo(); // Returns result of search (or nullptr if not yet received)
void ClearSavesInfo(); // Clears results
C4JStorage::ESaveGameState LoadSaveDataThumbnail(PSAVE_INFO pSaveInfo,int( *Func)(LPVOID lpParam,PBYTE pbThumbnail,DWORD dwThumbnailBytes), LPVOID lpParam); // Get the thumbnail for an individual save referenced by pSaveInfo
@@ -398,8 +398,8 @@ public:
EDLCStatus GetInstalledDLC(int iPad,int( *Func)(LPVOID, int, int),LPVOID lpParam);
CONTENT_DATA& GetDLC(DWORD dw);
DWORD GetAvailableDLCCount( int iPad );
- 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);
void SetDLCProductCode(const char* szProductCode);
diff --git a/Minecraft.Client/Orbis/Iggy/gdraw/gdraw_orbis.cpp b/Minecraft.Client/Orbis/Iggy/gdraw/gdraw_orbis.cpp
index 12233360..33fd6b4a 100644
--- a/Minecraft.Client/Orbis/Iggy/gdraw/gdraw_orbis.cpp
+++ b/Minecraft.Client/Orbis/Iggy/gdraw/gdraw_orbis.cpp
@@ -353,7 +353,7 @@ static void gdraw_defragment_cache(GDrawHandleCache *c, GDrawStats *stats)
// synchronize
compute_to_graphics_sync();
- gdraw->gfxc->setCsShader(NULL);
+ gdraw->gfxc->setCsShader(nullptr);
gdraw->gfxc->setShaderType(Gnm::kShaderTypeGraphics);
// don't need to wait till GPU is done since we never access GPU memory from the
@@ -365,7 +365,7 @@ static void api_free_resource(GDrawHandle *r)
if (!r->cache->is_vertex) {
for (S32 i=0; i < MAX_SAMPLERS; i++)
if (gdraw->active_tex[i] == (GDrawTexture *) r)
- gdraw->active_tex[i] = NULL;
+ gdraw->active_tex[i] = nullptr;
}
}
@@ -410,7 +410,7 @@ static void track_staging_alloc_attempt(U32 size, U32 align)
static void track_staging_alloc_failed()
{
if (gdraw->staging_stats.allocs_attempted == gdraw->staging_stats.allocs_succeeded + 1) { // warn the first time we run out of mem
- IggyGDrawSendWarning(NULL, "GDraw out of staging memory");
+ IggyGDrawSendWarning(nullptr, "GDraw out of staging memory");
}
}
@@ -537,7 +537,7 @@ static void gpu_compute_memset(void *ptr, U32 value, U32 size_in_bytes)
// through the regular caches.
gfxc->flushShaderCachesAndWait(Gnm::kCacheActionWriteBackL2Volatile, 0, Gnm::kStallCommandBufferParserDisable);
gfxc->setShaderType(Gnm::kShaderTypeGraphics);
- gfxc->setCsShader(NULL);
+ gfxc->setCsShader(nullptr);
}
////////////////////////////////////////////////////////////////////////
@@ -549,8 +549,8 @@ GDrawTexture * RADLINK gdraw_orbis_WrappedTextureCreate(Gnm::Texture *tex)
{
GDrawStats stats = {};
GDrawHandle *p = gdraw_res_alloc_begin(gdraw->texturecache, 0, &stats);
- p->handle.tex.gnm_ptr = NULL;
- gdraw_HandleCacheAllocateEnd(p, 0, NULL, GDRAW_HANDLE_STATE_user_owned);
+ p->handle.tex.gnm_ptr = nullptr;
+ gdraw_HandleCacheAllocateEnd(p, 0, nullptr, GDRAW_HANDLE_STATE_user_owned);
gdraw_orbis_WrappedTextureChange((GDrawTexture *) p, tex);
return (GDrawTexture *) p;
}
@@ -583,13 +583,13 @@ static void RADLINK gdraw_SetTextureUniqueID(GDrawTexture *tex, void *old_id, vo
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;
Gnm::Texture gt;
Gnm::SizeAlign sa;
Gnm::DataFormat format = Gnm::kDataFormatR8G8B8A8Unorm;
if (width > MAX_TEXTURE2D_DIM || height > MAX_TEXTURE2D_DIM) {
- IggyGDrawSendWarning(NULL, "GDraw %d x %d texture not supported by hardware (dimension limit %d)", width, height, MAX_TEXTURE2D_DIM);
+ IggyGDrawSendWarning(nullptr, "GDraw %d x %d texture not supported by hardware (dimension limit %d)", width, height, MAX_TEXTURE2D_DIM);
return false;
}
@@ -742,8 +742,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);
- if (t->owner == unique_id || unique_id == NULL) {
+ assert(t != nullptr);
+ if (t->owner == unique_id || unique_id == nullptr) {
if (t->cache == &gdraw->rendertargets) {
gdraw_HandleCacheUnlock(t);
// cache it by simply not freeing it
@@ -863,7 +863,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);
}
@@ -891,19 +891,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;
}
U8 *ptr = (U8 *)gdraw_arena_alloc(&gdraw->rt_arena, gdraw->rt_colorbuffer_sa.m_size, gdraw->rt_colorbuffer_sa.m_align);
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();
- t->raw_ptr = NULL;
+ t->raw_ptr = nullptr;
t->handle.tex.gnm_ptr = ptr;
t->handle.tex.gnm->initFromRenderTarget(&gdraw->rt_colorbuffer, false);
@@ -1065,7 +1065,7 @@ static void set_common_renderstate()
// clear our state caching
memset(gdraw->active_tex, 0, sizeof(gdraw->active_tex));
- gdraw->cur_ps = NULL;
+ gdraw->cur_ps = nullptr;
gdraw->scissor_state = ~0u;
gdraw->blend_mode = -1;
@@ -1230,7 +1230,7 @@ static void eliminate_fast_clear()
}
gfxc->setCbControl(Gnm::kCbModeEliminateFastClear, Gnm::kRasterOpSrcCopy);
- gfxc->setPsShader(NULL);
+ gfxc->setPsShader(nullptr);
set_viewport_raw(r.x0, r.y0, r.x1 - r.x0, r.y1 - r.y0);
set_projection_raw(r.x0, r.x1, r.y1, r.y0);
GDrawStats stats = {}; // we already counted these clears once, so don't add to main stats
@@ -1245,7 +1245,7 @@ static void eliminate_fast_clear()
set_viewport();
set_projection();
- gdraw->cur_ps = NULL;
+ gdraw->cur_ps = nullptr;
gdraw->cur->needs_clear_eliminate = false;
}
@@ -1276,7 +1276,7 @@ static inline U32 pack_color_8888(F32 x, F32 y, F32 z, F32 w)
void gdraw_orbis_ClearWholeRenderTarget(const F32 clear_color_rgba[4])
{
- assert(gdraw->gfxc != NULL); // call after gdraw_orbis_Begin
+ assert(gdraw->gfxc != nullptr); // call after gdraw_orbis_Begin
gdraw->cur = gdraw->frame;
set_common_renderstate();
@@ -1336,16 +1336,16 @@ static void RADLINK gdraw_SetViewSizeAndWorldScale(S32 w, S32 h, F32 scalex, F32
// must include anything necessary for texture creation/update
static void RADLINK gdraw_RenderingBegin(void)
{
- assert(gdraw->gfxc != NULL); // call after gdraw_orbis_Begin
+ assert(gdraw->gfxc != nullptr); // call after gdraw_orbis_Begin
// unbind all shaders
Gnmx::GfxContext *gfxc = gdraw->gfxc;
- gfxc->setVsShader(NULL, 0, (void*)0);
- gfxc->setPsShader(NULL);
- gfxc->setCsShader(NULL);
- gfxc->setLsHsShaders(NULL, 0, (void*)0, NULL, 0);
- gfxc->setEsShader(NULL, 0, (void *) 0);
- gfxc->setGsVsShaders(NULL);
+ gfxc->setVsShader(nullptr, 0, (void*)0);
+ gfxc->setPsShader(nullptr);
+ gfxc->setCsShader(nullptr);
+ gfxc->setLsHsShaders(nullptr, 0, (void*)0, nullptr, 0);
+ gfxc->setEsShader(nullptr, 0, (void *) 0);
+ gfxc->setGsVsShaders(nullptr);
set_common_renderstate();
}
@@ -1406,7 +1406,7 @@ GDRAW_MAYBE_UNUSED static bool mem_is_direct_and_write_combined_or_cached(const
void gdraw_orbis_Begin(sce::Gnmx::GfxContext *context, void *staging_buffer, U32 staging_buf_bytes)
{
- assert(gdraw->gfxc == NULL); // may not nest Begin calls
+ assert(gdraw->gfxc == nullptr); // may not nest Begin calls
// make sure that the memory setup is sensible.
// if any of these asserts fire, please relocate your command buffers
@@ -1426,13 +1426,13 @@ void gdraw_orbis_Begin(sce::Gnmx::GfxContext *context, void *staging_buffer, U32
void gdraw_orbis_End(gdraw_orbis_staging_stats *stats)
{
- assert(gdraw->gfxc != NULL); // please keep Begin / End pairs properly matched
+ assert(gdraw->gfxc != nullptr); // please keep Begin / End pairs properly matched
gdraw_HandleCacheTick(gdraw->texturecache, gdraw->tile_end_fence);
gdraw_HandleCacheTick(gdraw->vbufcache, gdraw->tile_end_fence);
- gdraw_arena_init(&gdraw->staging, NULL, 0);
- gdraw->gfxc = NULL;
+ gdraw_arena_init(&gdraw->staging, nullptr, 0);
+ gdraw->gfxc = nullptr;
if (stats)
*stats = gdraw->staging_stats;
@@ -1440,7 +1440,7 @@ void gdraw_orbis_End(gdraw_orbis_staging_stats *stats)
void gdraw_orbis_EliminateFastClears(void)
{
- assert(gdraw->gfxc != NULL); // call between gdraw_orbis_Begin and gdraw_orbis_End
+ assert(gdraw->gfxc != nullptr); // call between gdraw_orbis_Begin and gdraw_orbis_End
eliminate_fast_clear();
}
@@ -1469,18 +1469,18 @@ 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]) {
- 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);
@@ -1489,9 +1489,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;
@@ -1571,9 +1571,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
// sync on draw completion for this render target
rtt_sync(n->color_buffer->handle.tex.gnm_ptr, gdraw->rt_colorbuffer_sa.m_size >> 8);
@@ -1615,7 +1615,7 @@ static void RADLINK gdraw_ClearID(void)
static RADINLINE void set_texture(U32 texunit, GDrawTexture *tex)
{
assert(texunit < MAX_SAMPLERS);
- assert(tex != NULL);
+ assert(tex != nullptr);
if (gdraw->active_tex[texunit] != tex) {
gdraw->active_tex[texunit] = tex;
@@ -1791,7 +1791,7 @@ static void set_vertex_buffer(const GDraw::VFormatDesc *fmtdesc, void *ptr, U32
gdraw->gfxc->setBuffers(Gnm::kShaderStageVs, 0, fmtdesc->num_attribs, bufs);
}
-static RADINLINE void fence_resources(void *r1, void *r2=NULL, void *r3=NULL, void *r4=NULL)
+static RADINLINE void fence_resources(void *r1, void *r2=nullptr, void *r3=nullptr, void *r4=nullptr)
{
GDrawFence fence = get_next_fence();
if (r1) ((GDrawHandle *) r1)->fence = fence;
@@ -1937,7 +1937,7 @@ static void set_clamp_constant(F32 *constant, GDrawTexture *tex)
static void gdraw_Filter(GDrawRenderState *r, gswf_recti *s, float *tc, int isbevel, GDrawStats *stats)
{
- 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]);
@@ -2236,7 +2236,7 @@ static GDrawHandleCache *make_handle_cache(gdraw_orbis_resourcetype type, U32 al
cache->alloc = gfxalloc_create(gdraw_limits[type].ptr, num_bytes, align, num_handles);
if (!cache->alloc) {
IggyGDrawFree(cache);
- cache = NULL;
+ cache = nullptr;
}
}
@@ -2302,12 +2302,12 @@ int gdraw_orbis_SetResourceMemory(gdraw_orbis_resourcetype type, S32 num_handles
case GDRAW_ORBIS_RESOURCE_texture:
free_handle_cache(gdraw->texturecache);
gdraw->texturecache = make_handle_cache(GDRAW_ORBIS_RESOURCE_texture, GDRAW_ORBIS_TEXTURE_ALIGNMENT);
- return gdraw->texturecache != NULL;
+ return gdraw->texturecache != nullptr;
case GDRAW_ORBIS_RESOURCE_vertexbuffer:
free_handle_cache(gdraw->vbufcache);
gdraw->vbufcache = make_handle_cache(GDRAW_ORBIS_RESOURCE_vertexbuffer, GDRAW_ORBIS_VERTEXBUFFER_ALIGNMENT);
- return gdraw->vbufcache != NULL;
+ return gdraw->vbufcache != nullptr;
default:
return 0;
@@ -2316,9 +2316,9 @@ int gdraw_orbis_SetResourceMemory(gdraw_orbis_resourcetype type, S32 num_handles
void gdraw_orbis_ResetAllResourceMemory()
{
- gdraw_orbis_SetResourceMemory(GDRAW_ORBIS_RESOURCE_rendertarget, 0, NULL, 0);
- gdraw_orbis_SetResourceMemory(GDRAW_ORBIS_RESOURCE_texture, 0, NULL, 0);
- gdraw_orbis_SetResourceMemory(GDRAW_ORBIS_RESOURCE_vertexbuffer, 0, NULL, 0);
+ gdraw_orbis_SetResourceMemory(GDRAW_ORBIS_RESOURCE_rendertarget, 0, nullptr, 0);
+ gdraw_orbis_SetResourceMemory(GDRAW_ORBIS_RESOURCE_texture, 0, nullptr, 0);
+ gdraw_orbis_SetResourceMemory(GDRAW_ORBIS_RESOURCE_vertexbuffer, 0, nullptr, 0);
}
GDrawFunctions *gdraw_orbis_CreateContext(S32 w, S32 h, void *context_shared_mem)
@@ -2326,7 +2326,7 @@ GDrawFunctions *gdraw_orbis_CreateContext(S32 w, S32 h, void *context_shared_mem
U32 cpram_shadow_size = Gnmx::ConstantUpdateEngine::computeCpRamShadowSize();
gdraw = (GDraw *) IggyGDrawMalloc(sizeof(*gdraw) + cpram_shadow_size);
- if (!gdraw) return NULL;
+ if (!gdraw) return nullptr;
memset(gdraw, 0, sizeof(*gdraw));
@@ -2349,7 +2349,7 @@ GDrawFunctions *gdraw_orbis_CreateContext(S32 w, S32 h, void *context_shared_mem
Gnm::DataFormat rtFormat = Gnm::kDataFormatR8G8B8A8Unorm;
Gnm::TileMode tileMode;
GpuAddress::computeSurfaceTileMode(&tileMode, GpuAddress::kSurfaceTypeRwTextureFlat, rtFormat, 1);
- gdraw->rt_colorbuffer_sa = gdraw->rt_colorbuffer.init(gdraw->frametex_width, gdraw->frametex_height, 1, rtFormat, tileMode, Gnm::kNumSamples1, Gnm::kNumFragments1, NULL, NULL);
+ gdraw->rt_colorbuffer_sa = gdraw->rt_colorbuffer.init(gdraw->frametex_width, gdraw->frametex_height, 1, rtFormat, tileMode, Gnm::kNumSamples1, Gnm::kNumFragments1, nullptr, nullptr);
gdraw->rt_colorbuffer.setCmaskFastClearEnable(false);
// shaders and state
@@ -2418,7 +2418,7 @@ void gdraw_orbis_DestroyContext(void)
free_handle_cache(gdraw->texturecache);
free_handle_cache(gdraw->vbufcache);
IggyGDrawFree(gdraw);
- gdraw = NULL;
+ gdraw = nullptr;
}
}
diff --git a/Minecraft.Client/Orbis/Iggy/gdraw/gdraw_orbis.h b/Minecraft.Client/Orbis/Iggy/gdraw/gdraw_orbis.h
index 9fecfb08..13964e07 100644
--- a/Minecraft.Client/Orbis/Iggy/gdraw/gdraw_orbis.h
+++ b/Minecraft.Client/Orbis/Iggy/gdraw/gdraw_orbis.h
@@ -50,7 +50,7 @@ IDOC extern int gdraw_orbis_SetResourceMemory(gdraw_orbis_resourcetype type, S32
currently hold.
SetResourceMemory takes a void* argument for the address of the resource pool.
- Pass in NULL and zero bytes to reset a specific pool.
+ Pass in nullptr and zero bytes to reset a specific pool.
Resource pool memory has certain alignment requirements - see the #defines
above. If you pass in an unaligned pointer, GDraw will automatically clip off
@@ -86,7 +86,7 @@ IDOC extern GDrawFunctions * gdraw_orbis_CreateContext(S32 w, S32 h, void *conte
There can only be one 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_orbis_DestroyContext(void);
/* Destroys the current GDraw context, if any.
@@ -126,7 +126,7 @@ IDOC extern void gdraw_orbis_End(gdraw_orbis_staging_stats *staging_stats);
staging_stats will be filled with stats for the staging buffer, denoting how much memory
was actually used and which allocations were attempted. If you're not interested, just
- pass NULL. */
+ pass nullptr. */
IDOC extern void gdraw_orbis_SetTileOrigin(sce::Gnm::RenderTarget *color, sce::Gnm::DepthRenderTarget *depth, S32 x, S32 y);
/* This sets the main color and depth buffers that GDraw should render to and the
diff --git a/Minecraft.Client/Orbis/Iggy/gdraw/gdraw_orbis_shaders.inl b/Minecraft.Client/Orbis/Iggy/gdraw/gdraw_orbis_shaders.inl
index fc3e31a3..00010f80 100644
--- a/Minecraft.Client/Orbis/Iggy/gdraw/gdraw_orbis_shaders.inl
+++ b/Minecraft.Client/Orbis/Iggy/gdraw/gdraw_orbis_shaders.inl
@@ -517,24 +517,24 @@ static unsigned char pshader_basic_17[412] = {
};
static ShaderCode pshader_basic_arr[18] = {
- { pshader_basic_0, { NULL } },
- { pshader_basic_1, { NULL } },
- { pshader_basic_2, { NULL } },
- { pshader_basic_3, { NULL } },
- { pshader_basic_4, { NULL } },
- { pshader_basic_5, { NULL } },
- { pshader_basic_6, { NULL } },
- { pshader_basic_7, { NULL } },
- { pshader_basic_8, { NULL } },
- { pshader_basic_9, { NULL } },
- { pshader_basic_10, { NULL } },
- { pshader_basic_11, { NULL } },
- { pshader_basic_12, { NULL } },
- { pshader_basic_13, { NULL } },
- { pshader_basic_14, { NULL } },
- { pshader_basic_15, { NULL } },
- { pshader_basic_16, { NULL } },
- { pshader_basic_17, { NULL } },
+ { pshader_basic_0, { nullptr } },
+ { pshader_basic_1, { nullptr } },
+ { pshader_basic_2, { nullptr } },
+ { pshader_basic_3, { nullptr } },
+ { pshader_basic_4, { nullptr } },
+ { pshader_basic_5, { nullptr } },
+ { pshader_basic_6, { nullptr } },
+ { pshader_basic_7, { nullptr } },
+ { pshader_basic_8, { nullptr } },
+ { pshader_basic_9, { nullptr } },
+ { pshader_basic_10, { nullptr } },
+ { pshader_basic_11, { nullptr } },
+ { pshader_basic_12, { nullptr } },
+ { pshader_basic_13, { nullptr } },
+ { pshader_basic_14, { nullptr } },
+ { pshader_basic_15, { nullptr } },
+ { pshader_basic_16, { nullptr } },
+ { pshader_basic_17, { nullptr } },
};
static unsigned char pshader_exceptional_blend_1[440] = {
@@ -917,19 +917,19 @@ static unsigned char pshader_exceptional_blend_12[336] = {
};
static ShaderCode pshader_exceptional_blend_arr[13] = {
- { NULL, { NULL } },
- { pshader_exceptional_blend_1, { NULL } },
- { pshader_exceptional_blend_2, { NULL } },
- { pshader_exceptional_blend_3, { NULL } },
- { pshader_exceptional_blend_4, { NULL } },
- { pshader_exceptional_blend_5, { NULL } },
- { pshader_exceptional_blend_6, { NULL } },
- { pshader_exceptional_blend_7, { NULL } },
- { pshader_exceptional_blend_8, { NULL } },
- { pshader_exceptional_blend_9, { NULL } },
- { pshader_exceptional_blend_10, { NULL } },
- { pshader_exceptional_blend_11, { NULL } },
- { pshader_exceptional_blend_12, { NULL } },
+ { nullptr, { nullptr } },
+ { pshader_exceptional_blend_1, { nullptr } },
+ { pshader_exceptional_blend_2, { nullptr } },
+ { pshader_exceptional_blend_3, { nullptr } },
+ { pshader_exceptional_blend_4, { nullptr } },
+ { pshader_exceptional_blend_5, { nullptr } },
+ { pshader_exceptional_blend_6, { nullptr } },
+ { pshader_exceptional_blend_7, { nullptr } },
+ { pshader_exceptional_blend_8, { nullptr } },
+ { pshader_exceptional_blend_9, { nullptr } },
+ { pshader_exceptional_blend_10, { nullptr } },
+ { pshader_exceptional_blend_11, { nullptr } },
+ { pshader_exceptional_blend_12, { nullptr } },
};
static unsigned char pshader_filter_0[420] = {
@@ -1685,38 +1685,38 @@ static unsigned char pshader_filter_27[412] = {
};
static ShaderCode pshader_filter_arr[32] = {
- { pshader_filter_0, { NULL } },
- { pshader_filter_1, { NULL } },
- { pshader_filter_2, { NULL } },
- { pshader_filter_3, { NULL } },
- { pshader_filter_4, { NULL } },
- { pshader_filter_5, { NULL } },
- { pshader_filter_6, { NULL } },
- { pshader_filter_7, { NULL } },
- { pshader_filter_8, { NULL } },
- { pshader_filter_9, { NULL } },
- { pshader_filter_10, { NULL } },
- { pshader_filter_11, { NULL } },
- { NULL, { NULL } },
- { NULL, { NULL } },
- { NULL, { NULL } },
- { NULL, { NULL } },
- { pshader_filter_16, { NULL } },
- { pshader_filter_17, { NULL } },
- { pshader_filter_18, { NULL } },
- { pshader_filter_19, { NULL } },
- { pshader_filter_20, { NULL } },
- { pshader_filter_21, { NULL } },
- { pshader_filter_22, { NULL } },
- { pshader_filter_23, { NULL } },
- { pshader_filter_24, { NULL } },
- { pshader_filter_25, { NULL } },
- { pshader_filter_26, { NULL } },
- { pshader_filter_27, { NULL } },
- { NULL, { NULL } },
- { NULL, { NULL } },
- { NULL, { NULL } },
- { NULL, { NULL } },
+ { pshader_filter_0, { nullptr } },
+ { pshader_filter_1, { nullptr } },
+ { pshader_filter_2, { nullptr } },
+ { pshader_filter_3, { nullptr } },
+ { pshader_filter_4, { nullptr } },
+ { pshader_filter_5, { nullptr } },
+ { pshader_filter_6, { nullptr } },
+ { pshader_filter_7, { nullptr } },
+ { pshader_filter_8, { nullptr } },
+ { pshader_filter_9, { nullptr } },
+ { pshader_filter_10, { nullptr } },
+ { pshader_filter_11, { nullptr } },
+ { nullptr, { nullptr } },
+ { nullptr, { nullptr } },
+ { nullptr, { nullptr } },
+ { nullptr, { nullptr } },
+ { pshader_filter_16, { nullptr } },
+ { pshader_filter_17, { nullptr } },
+ { pshader_filter_18, { nullptr } },
+ { pshader_filter_19, { nullptr } },
+ { pshader_filter_20, { nullptr } },
+ { pshader_filter_21, { nullptr } },
+ { pshader_filter_22, { nullptr } },
+ { pshader_filter_23, { nullptr } },
+ { pshader_filter_24, { nullptr } },
+ { pshader_filter_25, { nullptr } },
+ { pshader_filter_26, { nullptr } },
+ { pshader_filter_27, { nullptr } },
+ { nullptr, { nullptr } },
+ { nullptr, { nullptr } },
+ { nullptr, { nullptr } },
+ { nullptr, { nullptr } },
};
static unsigned char pshader_blur_2[356] = {
@@ -2024,16 +2024,16 @@ static unsigned char pshader_blur_9[748] = {
};
static ShaderCode pshader_blur_arr[10] = {
- { NULL, { NULL } },
- { NULL, { NULL } },
- { pshader_blur_2, { NULL } },
- { pshader_blur_3, { NULL } },
- { pshader_blur_4, { NULL } },
- { pshader_blur_5, { NULL } },
- { pshader_blur_6, { NULL } },
- { pshader_blur_7, { NULL } },
- { pshader_blur_8, { NULL } },
- { pshader_blur_9, { NULL } },
+ { nullptr, { nullptr } },
+ { nullptr, { nullptr } },
+ { pshader_blur_2, { nullptr } },
+ { pshader_blur_3, { nullptr } },
+ { pshader_blur_4, { nullptr } },
+ { pshader_blur_5, { nullptr } },
+ { pshader_blur_6, { nullptr } },
+ { pshader_blur_7, { nullptr } },
+ { pshader_blur_8, { nullptr } },
+ { pshader_blur_9, { nullptr } },
};
static unsigned char pshader_color_matrix_0[348] = {
@@ -2062,7 +2062,7 @@ static unsigned char pshader_color_matrix_0[348] = {
};
static ShaderCode pshader_color_matrix_arr[1] = {
- { pshader_color_matrix_0, { NULL } },
+ { pshader_color_matrix_0, { nullptr } },
};
static unsigned char pshader_manual_clear_0[164] = {
@@ -2080,7 +2080,7 @@ static unsigned char pshader_manual_clear_0[164] = {
};
static ShaderCode pshader_manual_clear_arr[1] = {
- { pshader_manual_clear_0, { NULL } },
+ { pshader_manual_clear_0, { nullptr } },
};
static unsigned char vshader_vsps4_0[580] = {
@@ -2124,7 +2124,7 @@ static unsigned char vshader_vsps4_0[580] = {
};
static ShaderCode vshader_vsps4_arr[1] = {
- { vshader_vsps4_0, { NULL } },
+ { vshader_vsps4_0, { nullptr } },
};
static unsigned char cshader_tex_upload_0[212] = {
@@ -2145,7 +2145,7 @@ static unsigned char cshader_tex_upload_0[212] = {
};
static ShaderCode cshader_tex_upload_arr[1] = {
- { cshader_tex_upload_0, { NULL } },
+ { cshader_tex_upload_0, { nullptr } },
};
static unsigned char cshader_memset_0[196] = {
@@ -2165,7 +2165,7 @@ static unsigned char cshader_memset_0[196] = {
};
static ShaderCode cshader_memset_arr[1] = {
- { cshader_memset_0, { NULL } },
+ { cshader_memset_0, { nullptr } },
};
static unsigned char cshader_defragment_0[204] = {
@@ -2185,7 +2185,7 @@ static unsigned char cshader_defragment_0[204] = {
};
static ShaderCode cshader_defragment_arr[1] = {
- { cshader_defragment_0, { NULL } },
+ { cshader_defragment_0, { nullptr } },
};
static unsigned char cshader_mipgen_0[340] = {
@@ -2214,6 +2214,6 @@ static unsigned char cshader_mipgen_0[340] = {
};
static ShaderCode cshader_mipgen_arr[1] = {
- { cshader_mipgen_0, { NULL } },
+ { cshader_mipgen_0, { nullptr } },
};
diff --git a/Minecraft.Client/Orbis/Iggy/gdraw/gdraw_shared.inl b/Minecraft.Client/Orbis/Iggy/gdraw/gdraw_shared.inl
index a6b7dda2..1b7c1cc1 100644
--- a/Minecraft.Client/Orbis/Iggy/gdraw/gdraw_shared.inl
+++ b/Minecraft.Client/Orbis/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/Orbis/Iggy/include/gdraw.h b/Minecraft.Client/Orbis/Iggy/include/gdraw.h
index 404a2642..7cc4ddd0 100644
--- a/Minecraft.Client/Orbis/Iggy/include/gdraw.h
+++ b/Minecraft.Client/Orbis/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/Orbis/Iggy/include/iggyexpruntime.h b/Minecraft.Client/Orbis/Iggy/include/iggyexpruntime.h
index 1f1a90a1..a42ccbff 100644
--- a/Minecraft.Client/Orbis/Iggy/include/iggyexpruntime.h
+++ b/Minecraft.Client/Orbis/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/Orbis/Leaderboards/OrbisLeaderboardManager.cpp b/Minecraft.Client/Orbis/Leaderboards/OrbisLeaderboardManager.cpp
index b7662197..b2492381 100644
--- a/Minecraft.Client/Orbis/Leaderboards/OrbisLeaderboardManager.cpp
+++ b/Minecraft.Client/Orbis/Leaderboards/OrbisLeaderboardManager.cpp
@@ -29,7 +29,7 @@ OrbisLeaderboardManager::OrbisLeaderboardManager()
m_myXUID = INVALID_XUID;
- m_scores = NULL; //m_stats = NULL;
+ m_scores = nullptr; //m_stats = nullptr;
m_statsType = eStatsType_Kills;
m_difficulty = 0;
@@ -41,7 +41,7 @@ OrbisLeaderboardManager::OrbisLeaderboardManager()
InitializeCriticalSection(&m_csViewsLock);
m_running = false;
- m_threadScoreboard = NULL;
+ m_threadScoreboard = nullptr;
}
OrbisLeaderboardManager::~OrbisLeaderboardManager()
@@ -181,7 +181,7 @@ bool OrbisLeaderboardManager::getScoreByIds()
SceRtcTick last_sort_date;
SceNpScoreRankNumber mTotalRecord;
- SceNpId *npIds = NULL;
+ SceNpId *npIds = nullptr;
int ret;
@@ -267,7 +267,7 @@ bool OrbisLeaderboardManager::getScoreByIds()
ZeroMemory(comments, sizeof(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
); */
@@ -284,9 +284,9 @@ bool OrbisLeaderboardManager::getScoreByIds()
sceNpScoreDestroyTransactionCtx(ret);
- if (npIds != NULL) delete [] npIds;
- if (ptr != NULL) delete [] ptr;
- if (comments != NULL) delete [] comments;
+ if (npIds != nullptr) delete [] npIds;
+ if (ptr != nullptr) delete [] ptr;
+ if (comments != nullptr) delete [] comments;
return false;
}
@@ -297,9 +297,9 @@ bool OrbisLeaderboardManager::getScoreByIds()
m_eStatsState = eStatsState_Failed;
- if (npIds != NULL) delete [] npIds;
- if (ptr != NULL) delete [] ptr;
- if (comments != NULL) delete [] comments;
+ if (npIds != nullptr) delete [] npIds;
+ if (ptr != nullptr) delete [] ptr;
+ if (comments != nullptr) delete [] comments;
return false;
}
@@ -322,14 +322,14 @@ bool OrbisLeaderboardManager::getScoreByIds()
batch + comments, sizeof(SceNpScoreComment) * tmpNum, //OUT: Comments
- NULL, 0, // GameData. (unused)
+ nullptr, 0, // GameData. (unused)
tmpNum,
&last_sort_date,
&mTotalRecord,
- NULL // Reserved, specify null.
+ nullptr // Reserved, specify null.
);
if (ret == SCE_NP_COMMUNITY_ERROR_ABORTED)
@@ -357,7 +357,7 @@ bool OrbisLeaderboardManager::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;
@@ -390,7 +390,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);
@@ -443,14 +443,14 @@ bool OrbisLeaderboardManager::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)
@@ -471,7 +471,7 @@ bool OrbisLeaderboardManager::getScoreByRange()
delete [] ptr;
delete [] comments;
- m_scores = NULL;
+ m_scores = nullptr;
m_readCount = 0;
m_eStatsState = eStatsState_Ready;
@@ -489,7 +489,7 @@ bool OrbisLeaderboardManager::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++)
@@ -574,12 +574,12 @@ bool OrbisLeaderboardManager::setScore()
rscore.m_score, //IN: new score,
&comment, // Comments
- NULL, // GameInfo
+ nullptr, // GameInfo
&tmp, //OUT: current rank,
- NULL, //compareDate
+ nullptr, //compareDate
- NULL // Reserved, specify null.
+ nullptr // Reserved, specify null.
);
if (ret==SCE_NP_COMMUNITY_SERVER_ERROR_NOT_BEST_SCORE) //0x8002A415
@@ -615,7 +615,7 @@ void OrbisLeaderboardManager::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;
@@ -627,7 +627,7 @@ void OrbisLeaderboardManager::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);
@@ -636,16 +636,16 @@ void OrbisLeaderboardManager::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;
@@ -667,7 +667,7 @@ bool OrbisLeaderboardManager::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);
@@ -762,7 +762,7 @@ void OrbisLeaderboardManager::FlushStats() {}
void OrbisLeaderboardManager::CancelOperation()
{
- m_readListener = NULL;
+ m_readListener = nullptr;
m_eStatsState = eStatsState_Canceled;
if (m_requestId != 0)
@@ -912,7 +912,7 @@ void OrbisLeaderboardManager::fromBase32(void *out, SceNpScoreComment *in)
for (int i = 0; i < SCE_NP_SCORE_COMMENT_MAXLEN; i++)
{
ch[0] = in->utf8Comment[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;
@@ -973,7 +973,7 @@ bool OrbisLeaderboardManager::test_string(string testing)
int ctx = sceNpScoreCreateTransactionCtx(m_titleContext);
if (ctx<0) return false;
- int ret = sceNpScoreCensorComment(ctx, (const char *) &comment, NULL);
+ int ret = sceNpScoreCensorComment(ctx, (const char *) &comment, nullptr);
if (ret == SCE_NP_COMMUNITY_SERVER_ERROR_CENSORED)
{
diff --git a/Minecraft.Client/Orbis/Network/Orbis_NPToolkit.cpp b/Minecraft.Client/Orbis/Network/Orbis_NPToolkit.cpp
index d1c9cf15..5db367d4 100644
--- a/Minecraft.Client/Orbis/Network/Orbis_NPToolkit.cpp
+++ b/Minecraft.Client/Orbis/Network/Orbis_NPToolkit.cpp
@@ -309,7 +309,7 @@ void hexStrToBin(
val <<= 4;
}
else {
- if (pBinBuf != NULL && binOffset < binBufSize) {
+ if (pBinBuf != nullptr && binOffset < binBufSize) {
memcpy(pBinBuf + binOffset, &val, 1);
val = 0;
}
@@ -317,7 +317,7 @@ void hexStrToBin(
}
}
- if (val != 0 && pBinBuf != NULL && binOffset < binBufSize) {
+ if (val != 0 && pBinBuf != nullptr && binOffset < binBufSize) {
memcpy(pBinBuf + binOffset, &val, 1);
}
diff --git a/Minecraft.Client/Orbis/Network/SQRNetworkManager_Orbis.cpp b/Minecraft.Client/Orbis/Network/SQRNetworkManager_Orbis.cpp
index 1b32bce2..7c3e1a66 100644
--- a/Minecraft.Client/Orbis/Network/SQRNetworkManager_Orbis.cpp
+++ b/Minecraft.Client/Orbis/Network/SQRNetworkManager_Orbis.cpp
@@ -17,8 +17,8 @@
// #include "..\PS3Extras\PS3Strings.h"
-int (* SQRNetworkManager_Orbis::s_SignInCompleteCallbackFn)(void *pParam, bool bContinue, int pad) = NULL;
-void * SQRNetworkManager_Orbis::s_SignInCompleteParam = NULL;
+int (* SQRNetworkManager_Orbis::s_SignInCompleteCallbackFn)(void *pParam, bool bContinue, int pad) = nullptr;
+void * SQRNetworkManager_Orbis::s_SignInCompleteParam = nullptr;
sce::Toolkit::NP::PresenceDetails SQRNetworkManager_Orbis::s_lastPresenceInfo;
int64_t SQRNetworkManager_Orbis::s_lastPresenceTime = 0;
@@ -109,8 +109,8 @@ SQRNetworkManager_Orbis::SQRNetworkManager_Orbis(ISQRNetworkManagerListener *lis
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;
m_bRefreshingRestrictionsForInvite = false;
@@ -137,7 +137,7 @@ void SQRNetworkManager_Orbis::Initialise()
int32_t ret = 0;
int32_t libCtxId = 0;
- ret = sceNpInGameMessageInitialize(NP_IN_GAME_MESSAGE_POOL_SIZE, NULL);
+ ret = sceNpInGameMessageInitialize(NP_IN_GAME_MESSAGE_POOL_SIZE, nullptr);
assert (ret >= 0);
libCtxId = ret;
@@ -251,7 +251,7 @@ void SQRNetworkManager_Orbis::InitialiseAfterOnline()
if( s_SignInCompleteCallbackFn )
{
s_SignInCompleteCallbackFn(s_SignInCompleteParam,true,s_SignInCompleteCallbackPad);
- s_SignInCompleteCallbackFn = NULL;
+ s_SignInCompleteCallbackFn = nullptr;
s_SignInCompleteCallbackPad = -1;
}
return;
@@ -334,7 +334,7 @@ void SQRNetworkManager_Orbis::RefreshChatAndContentRestrictionsReturned_HandleIn
SQRNetworkManager_Orbis *netMan = (SQRNetworkManager_Orbis *)pParam;
netMan->m_listener->HandleInviteReceived( ProfileManager.GetPrimaryPad(), netMan->m_gameBootInvite );
- netMan->m_gameBootInvite = NULL;
+ netMan->m_gameBootInvite = nullptr;
netMan->m_bRefreshingRestrictionsForInvite = false;
}
@@ -357,7 +357,7 @@ void SQRNetworkManager_Orbis::Tick()
m_bRefreshingRestrictionsForInvite = true;
ProfileManager.RefreshChatAndContentRestrictions(RefreshChatAndContentRestrictionsReturned_HandleInvite, this);
//m_listener->HandleInviteReceived( ProfileManager.GetPrimaryPad(), m_gameBootInvite );
- //m_gameBootInvite = NULL;
+ //m_gameBootInvite = nullptr;
}
ErrorHandlingTick();
@@ -431,14 +431,14 @@ void SQRNetworkManager_Orbis::Tick()
if(s_SignInCompleteCallbackFn)
{
s_SignInCompleteCallbackFn(s_SignInCompleteParam,false,s_SignInCompleteCallbackPad);
- s_SignInCompleteCallbackFn = NULL;
+ s_SignInCompleteCallbackFn = nullptr;
}
s_SignInCompleteCallbackPad = -1;
}
else if(s_SignInCompleteCallbackFn)
{
s_SignInCompleteCallbackFn(s_SignInCompleteParam, true, s_SignInCompleteCallbackPad);
- s_SignInCompleteCallbackFn = NULL;
+ s_SignInCompleteCallbackFn = nullptr;
s_SignInCompleteCallbackPad = -1;
}
}
@@ -539,7 +539,7 @@ void SQRNetworkManager_Orbis::ErrorHandlingTick()
m_bCallPSNSignInCallback=true;
//s_SignInCompleteCallbackFn(s_SignInCompleteParam,false,s_SignInCompleteCallbackPad);
}
- //s_SignInCompleteCallbackFn = NULL;
+ //s_SignInCompleteCallbackFn = nullptr;
//s_SignInCompleteCallbackPad = -1;
}
app.DebugPrintf("Network error: SNM_INT_STATE_INITIALISE_FAILED\n");
@@ -655,7 +655,7 @@ void SQRNetworkManager_Orbis::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 ) )
{
@@ -685,11 +685,11 @@ bool SQRNetworkManager_Orbis::FriendRoomManagerSearch()
}
// Free up any external data that we received from the previous search
- for( int i = 0; i < m_aFriendSearchResults.size(); i++ )
+ for( size_t i = 0; i < m_aFriendSearchResults.size(); i++ )
{
if(m_aFriendSearchResults[i].m_RoomExtDataReceived)
free(m_aFriendSearchResults[i].m_RoomExtDataReceived);
- m_aFriendSearchResults[i].m_RoomExtDataReceived = NULL;
+ m_aFriendSearchResults[i].m_RoomExtDataReceived = nullptr;
}
m_friendSearchState = SNM_FRIEND_SEARCH_STATE_GETTING_FRIEND_COUNT;
@@ -755,7 +755,7 @@ void SQRNetworkManager_Orbis::FriendSearchTick()
{
m_friendSearchState = SNM_FRIEND_SEARCH_STATE_GETTING_FRIEND_INFO;
delete m_getFriendCountThread;
- m_getFriendCountThread = NULL;
+ m_getFriendCountThread = nullptr;
FriendRoomManagerSearch2();
}
}
@@ -773,7 +773,7 @@ int SQRNetworkManager_Orbis::BasicEventThreadProc( void *lpParameter )
do
{
- ret = sceKernelWaitEqueue(manager->m_basicEventQueue, &event, 1, &outEv, NULL);
+ ret = sceKernelWaitEqueue(manager->m_basicEventQueue, &event, 1, &outEv, nullptr);
// If the sys_event_t we've sent here from the handler has a non-zero data1 element, this is to signify that we should terminate the thread
if( event.udata == 0 )
@@ -979,7 +979,7 @@ SQRNetworkPlayer *SQRNetworkManager_Orbis::GetPlayerByIndex(int idx)
}
else
{
- return NULL;
+ return nullptr;
}
}
@@ -996,7 +996,7 @@ SQRNetworkPlayer *SQRNetworkManager_Orbis::GetPlayerBySmallId(int idx)
}
}
LeaveCriticalSection(&m_csRoomSyncData);
- return NULL;
+ return nullptr;
}
SQRNetworkPlayer *SQRNetworkManager_Orbis::GetPlayerByXuid(PlayerUID xuid)
@@ -1012,7 +1012,7 @@ SQRNetworkPlayer *SQRNetworkManager_Orbis::GetPlayerByXuid(PlayerUID xuid)
}
}
LeaveCriticalSection(&m_csRoomSyncData);
- return NULL;
+ return nullptr;
}
SQRNetworkPlayer *SQRNetworkManager_Orbis::GetLocalPlayerByUserIndex(int idx)
@@ -1028,7 +1028,7 @@ SQRNetworkPlayer *SQRNetworkManager_Orbis::GetLocalPlayerByUserIndex(int idx)
}
}
LeaveCriticalSection(&m_csRoomSyncData);
- return NULL;
+ return nullptr;
}
SQRNetworkPlayer *SQRNetworkManager_Orbis::GetHostPlayer()
@@ -1041,11 +1041,11 @@ SQRNetworkPlayer *SQRNetworkManager_Orbis::GetHostPlayer()
SQRNetworkPlayer *SQRNetworkManager_Orbis::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
@@ -1099,7 +1099,7 @@ bool SQRNetworkManager_Orbis::JoinRoom(SQRNetworkManager_Orbis::SessionSearchRes
{
// 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
@@ -1165,7 +1165,7 @@ void SQRNetworkManager_Orbis::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);
@@ -1274,7 +1274,7 @@ bool SQRNetworkManager_Orbis::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) )
{
@@ -1326,7 +1326,7 @@ bool SQRNetworkManager_Orbis::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();
@@ -1367,7 +1367,7 @@ bool SQRNetworkManager_Orbis::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) )
{
@@ -1388,7 +1388,7 @@ void SQRNetworkManager_Orbis::UpdateRemotePlay()
int localPlayerCount = 0;
for(int i = 0; i < XUSER_MAX_COUNT; i++)
{
- if(GetLocalPlayerByUserIndex(i) != NULL) localPlayerCount++;
+ if(GetLocalPlayerByUserIndex(i) != nullptr) localPlayerCount++;
}
InputManager.SetLocalMultiplayer(localPlayerCount > 1);
}
@@ -1427,7 +1427,7 @@ void SQRNetworkManager_Orbis::SendInviteGUI()
messData.body.assign(body);
messData.dialogFlag = SCE_TOOLKIT_NP_DIALOG_TYPE_USER_EDITABLE;
messData.npIdsCount = 2; // TODO: Set this to the number of available slots
- messData.npIds = NULL;
+ messData.npIds = nullptr;
messData.userInfo.userId = userId;
// Set expire to maximum
@@ -1602,7 +1602,7 @@ void SQRNetworkManager_Orbis::FindOrCreateNonNetworkPlayer(int slot, int playerT
}
}
// 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 )) )
@@ -1669,7 +1669,7 @@ void SQRNetworkManager_Orbis::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;
}
}
}
@@ -1725,7 +1725,7 @@ void SQRNetworkManager_Orbis::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;
}
}
}
@@ -1817,7 +1817,7 @@ void SQRNetworkManager_Orbis::UpdatePlayersFromRoomSyncUIDs()
}
// Host only - add remote players to our internal storage of player slots, and synchronise this with other room members.
-bool SQRNetworkManager_Orbis::AddRemotePlayersAndSync( SceNpMatching2RoomMemberId memberId, int playerMask, bool *isFull/*==NULL*/ )
+bool SQRNetworkManager_Orbis::AddRemotePlayersAndSync( SceNpMatching2RoomMemberId memberId, int playerMask, bool *isFull/*==nullptr*/ )
{
assert( m_isHosting );
@@ -1939,7 +1939,7 @@ void SQRNetworkManager_Orbis::RemoveRemotePlayersAndSync( SceNpMatching2RoomMemb
}
// 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
{
@@ -1984,7 +1984,7 @@ void SQRNetworkManager_Orbis::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
@@ -2037,7 +2037,7 @@ void SQRNetworkManager_Orbis::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
@@ -2159,7 +2159,7 @@ bool SQRNetworkManager_Orbis::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
@@ -2253,7 +2253,7 @@ void SQRNetworkManager_Orbis::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);
@@ -2493,7 +2493,7 @@ bool SQRNetworkManager_Orbis::CreateVoiceRudpConnections(SceNpMatching2RoomId ro
// create this connection if we don't have it already
SQRVoiceConnection* pConnection = SonyVoiceChat_Orbis::getVoiceConnectionFromRoomMemberID(peerMemberId);
- if(pConnection == NULL)
+ if(pConnection == nullptr)
{
// Create an Rudp context for the voice connection, this will happen regardless of whether the peer is client or host
@@ -2573,7 +2573,7 @@ bool SQRNetworkManager_Orbis::CreateRudpConnections(SceNpMatching2RoomId roomId,
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
{
@@ -2611,7 +2611,7 @@ SQRNetworkPlayer *SQRNetworkManager_Orbis::GetPlayerFromRudpCtx(int rudpCtx)
{
return it->second;
}
- return NULL;
+ return nullptr;
}
@@ -2625,7 +2625,7 @@ SQRNetworkPlayer *SQRNetworkManager_Orbis::GetPlayerFromRoomMemberAndLocalIdx(in
return it->second;
}
}
- return NULL;
+ return nullptr;
}
@@ -2720,7 +2720,7 @@ void SQRNetworkManager_Orbis::ContextCallback(SceNpMatching2ContextId id, SceNp
if( manager->m_state == SNM_INT_STATE_IDLE_RECREATING_MATCHING_CONTEXT )
{
manager->SetState( SNM_INT_STATE_IDLE );
- manager->GetExtDataForRoom(0, NULL, NULL, NULL);
+ manager->GetExtDataForRoom(0, nullptr, nullptr, nullptr);
break;
}
@@ -2759,7 +2759,7 @@ void SQRNetworkManager_Orbis::ContextCallback(SceNpMatching2ContextId id, SceNp
// if(s_SignInCompleteCallbackFn)
// {
// s_SignInCompleteCallbackFn(s_SignInCompleteParam, true, 0);
- // s_SignInCompleteCallbackFn = NULL;
+ // s_SignInCompleteCallbackFn = nullptr;
// }
@@ -2966,12 +2966,12 @@ void SQRNetworkManager_Orbis::DefaultRequestCallback(SceNpMatching2ContextId id,
// 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);
}
else
{
- if(pRoomMemberData->roomMemberDataInternal->roomMemberBinAttrInternal->data.ptr == NULL)
+ if(pRoomMemberData->roomMemberDataInternal->roomMemberBinAttrInternal->data.ptr == nullptr)
{
// the host doesn't send out data, so this must be the host we're connecting to
@@ -3213,7 +3213,7 @@ void SQRNetworkManager_Orbis::RoomEventCallback(SceNpMatching2ContextId id, SceN
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 );
}
else
{
@@ -3349,7 +3349,7 @@ void SQRNetworkManager_Orbis::ProcessSignallingEvent(SceNpMatching2ContextId ctx
reqParam.attrId = attrs;
reqParam.attrIdNum = 1;
- sceNpMatching2GetRoomMemberDataInternal( m_matchingContext, &reqParam, NULL, &m_roomMemberDataRequestId);
+ sceNpMatching2GetRoomMemberDataInternal( m_matchingContext, &reqParam, nullptr, &m_roomMemberDataRequestId);
}
break;
}
@@ -3358,7 +3358,7 @@ void SQRNetworkManager_Orbis::ProcessSignallingEvent(SceNpMatching2ContextId ctx
void SQRNetworkManager_Orbis::SignallingEventsTick()
{
EnterCriticalSection(&m_signallingEventListCS);
- for(int i=0;i<m_signallingEventList.size(); i++)
+ for(size_t i=0;i<m_signallingEventList.size(); i++)
{
SignallingEvent& ev = m_signallingEventList[i];
ProcessSignallingEvent(ev.ctxId, ev.roomId, ev.peerMemberId, ev.event, ev.error_code);
@@ -3376,7 +3376,7 @@ int SQRNetworkManager_Orbis::BasicEventCallback(int event, int retCode, uint32_t
ORBIS_STUBBED;
// SQRNetworkManager_Orbis *manager = (SQRNetworkManager_Orbis *)arg;
// // We aren't allowed to actually get the event directly from this callback, so send our own internal event to a thread dedicated to doing this
-// sceKernelTriggerUserEvent(m_basicEventQueue, sc_UserEventHandle, NULL);
+// sceKernelTriggerUserEvent(m_basicEventQueue, sc_UserEventHandle, nullptr);
return 0;
}
@@ -3422,7 +3422,7 @@ void SQRNetworkManager_Orbis::SysUtilCallback(uint64_t status, uint64_t param, v
// {
// s_SignInCompleteCallbackFn(s_SignInCompleteParam,false,0);
// }
-// s_SignInCompleteCallbackFn = NULL;
+// s_SignInCompleteCallbackFn = nullptr;
// }
// return;
// }
@@ -3437,7 +3437,7 @@ void SQRNetworkManager_Orbis::SysUtilCallback(uint64_t status, uint64_t param, v
// {
// s_SignInCompleteCallbackFn(s_SignInCompleteParam,false,0);
// }
-// s_SignInCompleteCallbackFn = NULL;
+// s_SignInCompleteCallbackFn = nullptr;
// }
// }
//
@@ -3534,7 +3534,7 @@ void SQRNetworkManager_Orbis::RudpContextCallback(int ctx_id, int event_id, int
if( dataSize >= sizeof(SQRNetworkPlayer::InitSendData) )
{
SQRNetworkPlayer::InitSendData ISD;
- int bytesRead = sceRudpRead( ctx_id, &ISD, sizeof(SQRNetworkPlayer::InitSendData), 0, NULL );
+ int bytesRead = sceRudpRead( ctx_id, &ISD, sizeof(SQRNetworkPlayer::InitSendData), 0, nullptr );
if( bytesRead == sizeof(SQRNetworkPlayer::InitSendData) )
{
manager->NetworkPlayerInitialDataReceived(playerFrom, &ISD);
@@ -3555,7 +3555,7 @@ void SQRNetworkManager_Orbis::RudpContextCallback(int ctx_id, int event_id, int
if( dataSize > 0 )
{
unsigned char *data = new unsigned char [ dataSize ];
- int bytesRead = sceRudpRead( ctx_id, data, dataSize, 0, NULL );
+ int bytesRead = sceRudpRead( ctx_id, data, dataSize, 0, nullptr );
if( bytesRead > 0 )
{
SQRNetworkPlayer *playerFrom, *playerTo;
@@ -3571,7 +3571,7 @@ void SQRNetworkManager_Orbis::RudpContextCallback(int ctx_id, int event_id, int
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 );
}
@@ -3632,7 +3632,7 @@ void SQRNetworkManager_Orbis::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)
{
@@ -3661,7 +3661,7 @@ void SQRNetworkManager_Orbis::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)
@@ -3722,9 +3722,9 @@ void SQRNetworkManager_Orbis::GetExtDataForRoom( SceNpMatching2RoomId roomId, vo
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;
@@ -3748,14 +3748,14 @@ void SQRNetworkManager_Orbis::GetExtDataForRoom( SceNpMatching2RoomId roomId, vo
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.
@@ -3769,7 +3769,7 @@ void SQRNetworkManager_Orbis::GetExtDataForRoom( SceNpMatching2RoomId roomId, vo
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;
@@ -3907,7 +3907,7 @@ void SQRNetworkManager_Orbis::AttemptPSNSignIn(int (*SignInCompleteCallbackFn)(v
//s_signInCompleteCallbackIfFailed=false;
//s_SignInCompleteCallbackFn(s_SignInCompleteParam, false, iPad);
}
- //s_SignInCompleteCallbackFn = NULL;
+ //s_SignInCompleteCallbackFn = nullptr;
}
}
}
@@ -4145,11 +4145,11 @@ void SQRNetworkManager_Orbis::NotifyRealtimePlusFeature(int iQuadrant)
// bool isSignedIn = ProfileManager.IsSignedInLive(s_SignInCompleteCallbackPad);
//
// s_SignInCompleteCallbackFn(s_SignInCompleteParam, isSignedIn, s_SignInCompleteCallbackPad);
-// s_SignInCompleteCallbackFn = NULL;
+// s_SignInCompleteCallbackFn = nullptr;
// s_SignInCompleteCallbackPad = -1;
// }
// else
// {
-// app.DebugPrintf("============ Calling CallSignInCompleteCallback but s_SignInCompleteCallbackFn is NULL\n");
+// app.DebugPrintf("============ Calling CallSignInCompleteCallback but s_SignInCompleteCallbackFn is nullptr\n");
// }
//} \ No newline at end of file
diff --git a/Minecraft.Client/Orbis/Network/SQRNetworkManager_Orbis.h b/Minecraft.Client/Orbis/Network/SQRNetworkManager_Orbis.h
index cb7cafa9..0217e4c5 100644
--- a/Minecraft.Client/Orbis/Network/SQRNetworkManager_Orbis.h
+++ b/Minecraft.Client/Orbis/Network/SQRNetworkManager_Orbis.h
@@ -139,7 +139,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/Orbis/Network/SonyCommerce_Orbis.cpp b/Minecraft.Client/Orbis/Network/SonyCommerce_Orbis.cpp
index 34ab67e4..67ae639b 100644
--- a/Minecraft.Client/Orbis/Network/SonyCommerce_Orbis.cpp
+++ b/Minecraft.Client/Orbis/Network/SonyCommerce_Orbis.cpp
@@ -9,22 +9,22 @@ bool SonyCommerce_Orbis::m_bCommerceInitialised = false;
// SceNpCommerce2SessionInfo SonyCommerce_Orbis::m_sessionInfo;
SonyCommerce_Orbis::State SonyCommerce_Orbis::m_state = e_state_noSession;
int SonyCommerce_Orbis::m_errorCode = 0;
-LPVOID SonyCommerce_Orbis::m_callbackParam = NULL;
+LPVOID SonyCommerce_Orbis::m_callbackParam = nullptr;
-void* SonyCommerce_Orbis::m_receiveBuffer = NULL;
+void* SonyCommerce_Orbis::m_receiveBuffer = nullptr;
SonyCommerce_Orbis::Event SonyCommerce_Orbis::m_event;
std::queue<SonyCommerce_Orbis::Message> SonyCommerce_Orbis::m_messageQueue;
-std::vector<SonyCommerce_Orbis::ProductInfo>* SonyCommerce_Orbis::m_pProductInfoList = NULL;
-SonyCommerce_Orbis::ProductInfoDetailed* SonyCommerce_Orbis::m_pProductInfoDetailed = NULL;
-SonyCommerce_Orbis::ProductInfo* SonyCommerce_Orbis::m_pProductInfo = NULL;
+std::vector<SonyCommerce_Orbis::ProductInfo>* SonyCommerce_Orbis::m_pProductInfoList = nullptr;
+SonyCommerce_Orbis::ProductInfoDetailed* SonyCommerce_Orbis::m_pProductInfoDetailed = nullptr;
+SonyCommerce_Orbis::ProductInfo* SonyCommerce_Orbis::m_pProductInfo = nullptr;
-SonyCommerce_Orbis::CategoryInfo* SonyCommerce_Orbis::m_pCategoryInfo = NULL;
-const char* SonyCommerce_Orbis::m_pProductID = NULL;
-char* SonyCommerce_Orbis::m_pCategoryID = NULL;
+SonyCommerce_Orbis::CategoryInfo* SonyCommerce_Orbis::m_pCategoryInfo = nullptr;
+const char* SonyCommerce_Orbis::m_pProductID = nullptr;
+char* SonyCommerce_Orbis::m_pCategoryID = nullptr;
SonyCommerce_Orbis::CheckoutInputParams SonyCommerce_Orbis::m_checkoutInputParams;
SonyCommerce_Orbis::DownloadListInputParams SonyCommerce_Orbis::m_downloadInputParams;
-SonyCommerce_Orbis::CallbackFunc SonyCommerce_Orbis::m_callbackFunc = NULL;
+SonyCommerce_Orbis::CallbackFunc SonyCommerce_Orbis::m_callbackFunc = nullptr;
// sys_memory_container_t SonyCommerce_Orbis::m_memContainer = SYS_MEMORY_CONTAINER_ID_INVALID;
bool SonyCommerce_Orbis::m_bUpgradingTrial = false;
@@ -38,7 +38,7 @@ bool SonyCommerce_Orbis::m_contextCreated=false; ///< npcommerce2 cont
SonyCommerce_Orbis::Phase SonyCommerce_Orbis::m_currentPhase = e_phase_stopped; ///< Current commerce2 util
// char SonyCommerce_Orbis::m_commercebuffer[SCE_NP_COMMERCE2_RECV_BUF_SIZE];
-C4JThread* SonyCommerce_Orbis::m_tickThread = NULL;
+C4JThread* SonyCommerce_Orbis::m_tickThread = nullptr;
bool SonyCommerce_Orbis::m_bLicenseChecked=false; // Check the trial/full license for the game
@@ -52,12 +52,12 @@ sce::Toolkit::NP::Utilities::Future<sce::Toolkit::NP::ProductInfoDetailed> g_d
SonyCommerce_Orbis::ProductInfoDetailed s_trialUpgradeProductInfoDetailed;
void SonyCommerce_Orbis::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_Orbis::Init()
@@ -95,7 +95,7 @@ bool SonyCommerce_Orbis::LicenseChecked()
void SonyCommerce_Orbis::CheckForTrialUpgradeKey()
{
- StorageManager.CheckForTrialUpgradeKey(CheckForTrialUpgradeKey_Callback, NULL);
+ StorageManager.CheckForTrialUpgradeKey(CheckForTrialUpgradeKey_Callback, nullptr);
}
int SonyCommerce_Orbis::Shutdown()
@@ -112,7 +112,7 @@ int SonyCommerce_Orbis::Shutdown()
DeleteCriticalSection(&m_queueLock);
// clear any possible callback function
- m_callbackFunc = NULL;
+ m_callbackFunc = nullptr;
return ret;
}
@@ -582,7 +582,7 @@ int SonyCommerce_Orbis::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");
@@ -657,7 +657,7 @@ void SonyCommerce_Orbis::commerce2Handler( const sce::Toolkit::NP::Event& event)
case sce::Toolkit::NP::Event::UserEvent::commerceGotCategoryInfo:
{
copyCategoryInfo(m_pCategoryInfo, g_categoryInfo.get());
- m_pCategoryInfo = NULL;
+ m_pCategoryInfo = nullptr;
m_event = e_event_commerceGotCategoryInfo;
break;
}
@@ -665,7 +665,7 @@ void SonyCommerce_Orbis::commerce2Handler( const sce::Toolkit::NP::Event& event)
case sce::Toolkit::NP::Event::UserEvent::commerceGotProductList:
{
copyProductList(m_pProductInfoList, g_productList.get());
- m_pProductInfoDetailed = NULL;
+ m_pProductInfoDetailed = nullptr;
m_event = e_event_commerceGotProductList;
break;
}
@@ -675,12 +675,12 @@ void SonyCommerce_Orbis::commerce2Handler( const sce::Toolkit::NP::Event& event)
if(m_pProductInfoDetailed)
{
copyDetailedProductInfo(m_pProductInfoDetailed, g_detailedProductInfo.get());
- m_pProductInfoDetailed = NULL;
+ m_pProductInfoDetailed = nullptr;
}
else
{
copyAddDetailedProductInfo(m_pProductInfo, g_detailedProductInfo.get());
- m_pProductInfo = NULL;
+ m_pProductInfo = nullptr;
}
m_event = e_event_commerceGotDetailedProductInfo;
break;
@@ -1027,7 +1027,7 @@ void SonyCommerce_Orbis::processEvent()
case e_event_commerceProductBrowseFinished:
app.DebugPrintf(4,"e_event_commerceProductBrowseFinished succeeded: 0x%x\n", m_errorCode);
- if(m_callbackFunc!=NULL)
+ if(m_callbackFunc!=nullptr)
{
runCallback();
}
@@ -1076,7 +1076,7 @@ void SonyCommerce_Orbis::processEvent()
}
// 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();
}
@@ -1094,7 +1094,7 @@ void SonyCommerce_Orbis::processEvent()
}
// 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();
}
@@ -1154,8 +1154,8 @@ void SonyCommerce_Orbis::CreateSession( CallbackFunc cb, LPVOID lpParam )
m_messageQueue.push(e_message_commerceEnd);
m_event = e_event_commerceSessionCreated;
- if(m_tickThread == NULL)
- m_tickThread = new C4JThread(TickLoop, NULL, "SonyCommerce_Orbis tick");
+ if(m_tickThread == nullptr)
+ m_tickThread = new C4JThread(TickLoop, nullptr, "SonyCommerce_Orbis tick");
if(m_tickThread->isRunning() == false)
{
m_currentPhase = e_phase_idle;
diff --git a/Minecraft.Client/Orbis/Network/SonyCommerce_Orbis.h b/Minecraft.Client/Orbis/Network/SonyCommerce_Orbis.h
index a2a42d57..dc7671f4 100644
--- a/Minecraft.Client/Orbis/Network/SonyCommerce_Orbis.h
+++ b/Minecraft.Client/Orbis/Network/SonyCommerce_Orbis.h
@@ -107,14 +107,14 @@ class SonyCommerce_Orbis : public SonyCommerce
{
assert(m_callbackFunc);
CallbackFunc func = m_callbackFunc;
- m_callbackFunc = NULL;
+ m_callbackFunc = nullptr;
if(func)
func(m_callbackParam, m_errorCode);
m_errorCode = SCE_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/Orbis/Network/SonyHttp_Orbis.cpp b/Minecraft.Client/Orbis/Network/SonyHttp_Orbis.cpp
index 7f7c62d6..3387839f 100644
--- a/Minecraft.Client/Orbis/Network/SonyHttp_Orbis.cpp
+++ b/Minecraft.Client/Orbis/Network/SonyHttp_Orbis.cpp
@@ -100,16 +100,16 @@ void SonyHttp_Orbis::printSslError(SceInt32 sslErr, SceUInt32 sslErrDetail)
void SonyHttp_Orbis::printSslCertInfo(int libsslCtxId,SceSslCert *sslCert)
{
SceInt32 ret;
- SceUChar8 *sboData = NULL ;
+ SceUChar8 *sboData = nullptr ;
SceSize sboLen, counter;
- ret = sceSslGetSerialNumber(libsslCtxId, sslCert, NULL, &sboLen);
+ ret = sceSslGetSerialNumber(libsslCtxId, sslCert, nullptr, &sboLen);
if (ret < 0){
app.DebugPrintf("sceSslGetSerialNumber() returns 0x%x\n", ret);
}
else {
- sboData = (SceUChar8*)malloc(sboLen);
- if ( sboData != NULL ) {
+ sboData = static_cast<SceUChar8 *>(malloc(sboLen));
+ if ( sboData != nullptr ) {
ret = sceSslGetSerialNumber(libsslCtxId, sslCert, sboData, &sboLen);
if (ret < 0){
app.DebugPrintf ("sceSslGetSerialNumber() returns 0x%x\n", ret);
@@ -141,10 +141,10 @@ SceInt32 SonyHttp_Orbis::sslCallback(int libsslCtxId,unsigned int verifyErr,SceS
(void)userArg;
app.DebugPrintf("Ssl callback:\n");
- app.DebugPrintf("\tbase tmpl[%x]\n", (*(SceInt32*)(userArg)) );
+ app.DebugPrintf("\tbase tmpl[%x]\n", (*static_cast<SceInt32 *>(userArg)) );
if (verifyErr != 0){
- printSslError((SceInt32)SCE_HTTPS_ERROR_CERT, verifyErr);
+ printSslError(static_cast<SceInt32>(SCE_HTTPS_ERROR_CERT), verifyErr);
}
for (i = 0; i < certNum; i++){
printSslCertInfo(libsslCtxId,sslCert[i]);
@@ -202,7 +202,7 @@ bool SonyHttp_Orbis::http_get(const char *targetUrl, void** ppOutData, int* pDat
}
/* Register SSL callback */
- ret = sceHttpsSetSslCallback(tmplId, sslCallback, (void*)&tmplId);
+ ret = sceHttpsSetSslCallback(tmplId, sslCallback, static_cast<void *>(&tmplId));
if (ret < 0)
{
app.DebugPrintf("sceHttpsSetSslCallback() error: 0x%08X\n", ret);
@@ -225,7 +225,7 @@ bool SonyHttp_Orbis::http_get(const char *targetUrl, void** ppOutData, int* pDat
}
reqId = ret;
- ret = sceHttpSendRequest(reqId, NULL, 0);
+ ret = sceHttpSendRequest(reqId, nullptr, 0);
if (ret < 0)
{
app.DebugPrintf("sceHttpSendRequest() error: 0x%08X\n", ret);
diff --git a/Minecraft.Client/Orbis/Network/SonyRemoteStorage_Orbis.cpp b/Minecraft.Client/Orbis/Network/SonyRemoteStorage_Orbis.cpp
index e248f602..008879cb 100644
--- a/Minecraft.Client/Orbis/Network/SonyRemoteStorage_Orbis.cpp
+++ b/Minecraft.Client/Orbis/Network/SonyRemoteStorage_Orbis.cpp
@@ -26,7 +26,7 @@ static SceRemoteStorageData s_getDataOutput;
void SonyRemoteStorage_Orbis::staticInternalCallback(const SceRemoteStorageEvent event, int32_t retCode, void * userData)
{
- ((SonyRemoteStorage_Orbis*)userData)->internalCallback(event, retCode);
+ static_cast<SonyRemoteStorage_Orbis *>(userData)->internalCallback(event, retCode);
}
void SonyRemoteStorage_Orbis::internalCallback(const SceRemoteStorageEvent event, int32_t retCode)
{
@@ -196,7 +196,7 @@ bool SonyRemoteStorage_Orbis::init(CallbackFunc cb, LPVOID lpParam)
// memcpy(clientId.id, CLIENT_ID, strlen(CLIENT_ID));
// authParams.pClientId = &clientId;
-// ret = sceNpAuthGetAuthorizationCode(reqId, &authParams, &authCode, NULL);
+// ret = sceNpAuthGetAuthorizationCode(reqId, &authParams, &authCode, nullptr);
// if (ret < 0) {
// app.DebugPrintf("Failed to get auth code 0x%x\n", ret);
// }
@@ -223,7 +223,7 @@ bool SonyRemoteStorage_Orbis::init(CallbackFunc cb, LPVOID lpParam)
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;
diff --git a/Minecraft.Client/Orbis/Network/SonyVoiceChat_Orbis.cpp b/Minecraft.Client/Orbis/Network/SonyVoiceChat_Orbis.cpp
index d869d38b..c075badb 100644
--- a/Minecraft.Client/Orbis/Network/SonyVoiceChat_Orbis.cpp
+++ b/Minecraft.Client/Orbis/Network/SonyVoiceChat_Orbis.cpp
@@ -67,7 +67,7 @@ void LoadPCMVoiceData()
{
char filename[64];
sprintf(filename, "voice%d.pcm", i+1);
- HANDLE file = CreateFile(filename, GENERIC_READ, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
+ HANDLE file = CreateFile(filename, GENERIC_READ, 0, nullptr, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, nullptr);
DWORD dwHigh=0;
g_loadedPCMVoiceDataSizes[i] = GetFileSize(file,&dwHigh);
@@ -75,7 +75,7 @@ void LoadPCMVoiceData()
{
g_loadedPCMVoiceData[i] = new char[g_loadedPCMVoiceDataSizes[i]];
DWORD bytesRead;
- BOOL bSuccess = ReadFile(file, g_loadedPCMVoiceData[i], g_loadedPCMVoiceDataSizes[i], &bytesRead, NULL);
+ BOOL bSuccess = ReadFile(file, g_loadedPCMVoiceData[i], g_loadedPCMVoiceDataSizes[i], &bytesRead, nullptr);
assert(bSuccess);
}
g_loadedPCMVoiceDataPos[i] = 0;
@@ -274,7 +274,7 @@ void SQRVoiceConnection::readRemoteData()
if( dataSize > 0 )
{
VoicePacket packet;
- int bytesRead = sceRudpRead( m_rudpCtx, &packet, dataSize, 0, NULL );
+ int bytesRead = sceRudpRead( m_rudpCtx, &packet, dataSize, 0, nullptr );
unsigned int writeSize;
if( bytesRead > 0 )
{
@@ -468,7 +468,7 @@ void SonyVoiceChat_Orbis::sendAllVoiceData()
if(m_localVoiceDevices[i].isValid())
{
bool bChatRestricted = false;
- ProfileManager.GetChatAndContentRestrictions(i,true,&bChatRestricted,NULL,NULL);
+ ProfileManager.GetChatAndContentRestrictions(i,true,&bChatRestricted,nullptr,nullptr);
if(bChatRestricted)
{
@@ -928,7 +928,7 @@ void SonyVoiceChat_Orbis::initLocalPlayer(int playerIndex)
if(m_localVoiceDevices[playerIndex].isValid() == false)
{
bool chatRestricted = false;
- ProfileManager.GetChatAndContentRestrictions(ProfileManager.GetPrimaryPad(),false,&chatRestricted,NULL,NULL);
+ ProfileManager.GetChatAndContentRestrictions(ProfileManager.GetPrimaryPad(),false,&chatRestricted,nullptr,nullptr);
// create all device ports required
m_localVoiceDevices[playerIndex].init(ProfileManager.getUserID(playerIndex), chatRestricted);
@@ -965,7 +965,7 @@ SQRVoiceConnection* SonyVoiceChat_Orbis::GetVoiceConnectionFromRudpCtx( int Rudp
if(m_remoteConnections[i]->m_rudpCtx == RudpCtx)
return m_remoteConnections[i];
}
- return NULL;
+ return nullptr;
}
void SonyVoiceChat_Orbis::connectPlayerToAll( int playerIndex )
@@ -990,7 +990,7 @@ SQRVoiceConnection* SonyVoiceChat_Orbis::getVoiceConnectionFromRoomMemberID( Sce
}
}
- return NULL;
+ return nullptr;
}
void SonyVoiceChat_Orbis::disconnectLocalPlayer( int localIdx )
diff --git a/Minecraft.Client/Orbis/OrbisExtras/OrbisStubs.cpp b/Minecraft.Client/Orbis/OrbisExtras/OrbisStubs.cpp
index 661a1528..21e73a80 100644
--- a/Minecraft.Client/Orbis/OrbisExtras/OrbisStubs.cpp
+++ b/Minecraft.Client/Orbis/OrbisExtras/OrbisStubs.cpp
@@ -34,7 +34,7 @@ int _wcsicmp( const wchar_t * dst, const wchar_t * src )
{
wchar_t f,l;
- // validation section
+ // validation section
// _VALIDATE_RETURN(dst != NULL, EINVAL, _NLSCMPERROR);
// _VALIDATE_RETURN(src != NULL, EINVAL, _NLSCMPERROR);
@@ -51,7 +51,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++)
@@ -95,8 +95,8 @@ VOID GetLocalTime(LPSYSTEMTIME lpSystemTime)
}
HANDLE CreateEvent(void* lpEventAttributes, BOOL bManualReset, BOOL bInitialState, LPCSTR lpName) { ORBIS_STUBBED; return NULL; }
-VOID Sleep(DWORD dwMilliseconds)
-{
+VOID Sleep(DWORD dwMilliseconds)
+{
C4JThread::Sleep(dwMilliseconds);
}
@@ -203,7 +203,7 @@ VOID InitializeCriticalSection(PCRITICAL_SECTION CriticalSection)
CriticalSection->m_cLock = 0;
assert(err == SCE_OK);
#ifdef _DEBUG
- CriticalSection->m_pOwnerThread = NULL;
+ CriticalSection->m_pOwnerThread = nullptr;
#endif
}
@@ -247,7 +247,7 @@ VOID LeaveCriticalSection(PCRITICAL_SECTION CriticalSection)
int err = scePthreadMutexUnlock(&CriticalSection->mutex);
assert(err == SCE_OK );
#ifdef _DEBUG
- CriticalSection->m_pOwnerThread = NULL;
+ CriticalSection->m_pOwnerThread = nullptr;
#endif
}
@@ -266,8 +266,8 @@ ULONG TryEnterCriticalSection(PCRITICAL_SECTION CriticalSection)
DWORD WaitForMultipleObjects(DWORD nCount, CONST HANDLE *lpHandles,BOOL bWaitAll,DWORD dwMilliseconds) { ORBIS_STUBBED; return 0; }
-BOOL CloseHandle(HANDLE hObject)
-{
+BOOL CloseHandle(HANDLE hObject)
+{
sceFiosFHCloseSync(NULL,(SceFiosFH)((int64_t)hObject));
return true;
// ORBIS_STUBBED;
@@ -342,7 +342,7 @@ public:
if(err != SCE_OK)
{
assert(0);
- return NULL;
+ return nullptr;
}
// work out where the next page should be in virtual addr space, and pass that to the mapping function
void* pageVirtualAddr = ((char*)m_virtualAddr) + m_allocatedSize;
@@ -359,12 +359,12 @@ public:
if(inAddr != pageVirtualAddr) // make sure we actually get the virtual address that we requested
{
assert(0);
- return NULL;
+ return nullptr;
}
if(err != SCE_OK)
{
assert(0);
- return NULL;
+ return nullptr;
}
m_pagesAllocated.push_back(PageInfo(physAddr, pageVirtualAddr, sizeToAdd));
m_allocatedSize += sizeToAdd;
@@ -393,8 +393,8 @@ public:
static std::vector<OrbisVAlloc*> s_orbisVAllocs;
-LPVOID VirtualAlloc(LPVOID lpAddress, SIZE_T dwSize, DWORD flAllocationType, DWORD flProtect)
-{
+LPVOID VirtualAlloc(LPVOID lpAddress, SIZE_T dwSize, DWORD flAllocationType, DWORD flProtect)
+{
if(lpAddress == NULL)
{
void *pAddr = (void*)SCE_KERNEL_APP_MAP_AREA_START_ADDR;
@@ -402,7 +402,7 @@ LPVOID VirtualAlloc(LPVOID lpAddress, SIZE_T dwSize, DWORD flAllocationType, DWO
if( err != SCE_OK )
{
app.DebugPrintf("sceKernelReserveVirtualRange failed: 0x%08X\n", err);
- return NULL;
+ return nullptr;
}
s_orbisVAllocs.push_back(new OrbisVAlloc(pAddr, dwSize));
return (LPVOID)pAddr;
@@ -419,10 +419,10 @@ LPVOID VirtualAlloc(LPVOID lpAddress, SIZE_T dwSize, DWORD flAllocationType, DWO
}
}
assert(0); // failed to find the virtual alloc in our table
- return NULL;
+ return nullptr;
}
}
- return NULL;
+ return nullptr;
}
BOOL VirtualFree(LPVOID lpAddress, SIZE_T dwSize, DWORD dwFreeType)
@@ -483,7 +483,7 @@ BOOL WriteFile(
{
SceFiosFH fh = (SceFiosFH)((int64_t)hFile);
// sceFiosFHReadSync - Non-negative values are the number of bytes read, 0 <= result <= length. Negative values are error codes.
- SceFiosSize bytesRead = sceFiosFHWriteSync(NULL, fh, lpBuffer, (SceFiosSize)nNumberOfBytesToWrite);
+ SceFiosSize bytesRead = sceFiosFHWriteSync(nullptr, fh, lpBuffer, (SceFiosSize)nNumberOfBytesToWrite);
if(bytesRead < 0)
{
// error
@@ -500,7 +500,7 @@ BOOL ReadFile(HANDLE hFile, LPVOID lpBuffer, DWORD nNumberOfBytesToRead, LPDWORD
{
SceFiosFH fh = (SceFiosFH)((int64_t)hFile);
// sceFiosFHReadSync - Non-negative values are the number of bytes read, 0 <= result <= length. Negative values are error codes.
- SceFiosSize bytesRead = sceFiosFHReadSync(NULL, fh, lpBuffer, (SceFiosSize)nNumberOfBytesToRead);
+ SceFiosSize bytesRead = sceFiosFHReadSync(nullptr, fh, lpBuffer, (SceFiosSize)nNumberOfBytesToRead);
*lpNumberOfBytesRead = (DWORD)bytesRead;
if(bytesRead < 0)
{
@@ -520,7 +520,7 @@ BOOL SetFilePointer(HANDLE hFile, LONG lDistanceToMove, PLONG lpDistanceToMoveHi
uint64_t bitsToMove = (int64_t) lDistanceToMove;
SceFiosOffset pos = 0;
- if (lpDistanceToMoveHigh != NULL)
+ if (lpDistanceToMoveHigh != nullptr)
bitsToMove |= ((uint64_t) (*lpDistanceToMoveHigh)) << 32;
SceFiosWhence whence = SCE_FIOS_SEEK_SET;
@@ -581,7 +581,7 @@ HANDLE CreateFileA(LPCSTR lpFileName, DWORD dwDesiredAccess, DWORD dwShareMode,
case TRUNCATE_EXISTING:
break;
}
- int err = sceFiosFHOpenSync(NULL, &fh, filePath, &openParams);
+ int err = sceFiosFHOpenSync(nullptr, &fh, filePath, &openParams);
if(err != SCE_FIOS_OK)
{
@@ -597,7 +597,7 @@ BOOL DeleteFileA(LPCSTR lpFileName) { ORBIS_STUBBED; return false; }
// BOOL XCloseHandle(HANDLE a)
// {
-// sceFiosFHCloseSync(NULL,(SceFiosFH)((int64_t)a));
+// sceFiosFHCloseSync(nullptr,(SceFiosFH)((int64_t)a));
// return true;
// }
@@ -617,7 +617,7 @@ DWORD GetFileAttributesA(LPCSTR lpFileName)
// check if the file exists first
SceFiosStat statData;
- if(sceFiosStatSync(NULL, filePath, &statData) != SCE_FIOS_OK)
+ if(sceFiosStatSync(nullptr, filePath, &statData) != SCE_FIOS_OK)
{
app.DebugPrintf("*** sceFiosStatSync Failed\n");
return -1;
diff --git a/Minecraft.Client/Orbis/OrbisExtras/TLSStorage.cpp b/Minecraft.Client/Orbis/OrbisExtras/TLSStorage.cpp
index 9f17e999..4229b61d 100644
--- a/Minecraft.Client/Orbis/OrbisExtras/TLSStorage.cpp
+++ b/Minecraft.Client/Orbis/OrbisExtras/TLSStorage.cpp
@@ -4,7 +4,7 @@
-TLSStorageOrbis* TLSStorageOrbis::m_pInstance = NULL;
+TLSStorageOrbis* TLSStorageOrbis::m_pInstance = nullptr;
BOOL TLSStorageOrbis::m_activeList[sc_maxSlots];
__thread LPVOID TLSStorageOrbis::m_values[sc_maxSlots];
@@ -16,7 +16,7 @@ TLSStorageOrbis::TLSStorageOrbis()
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 TLSStorageOrbis::Alloc()
if(m_activeList[i] == false)
{
m_activeList[i] = true;
- m_values[i] = NULL;
+ m_values[i] = nullptr;
return i;
}
}
@@ -50,7 +50,7 @@ BOOL TLSStorageOrbis::Free( DWORD _index )
return false; // not been allocated
m_activeList[_index] = false;
- m_values[_index] = NULL;
+ m_values[_index] = nullptr;
return true;
}
@@ -65,7 +65,7 @@ BOOL TLSStorageOrbis::SetValue( DWORD _index, LPVOID _val )
LPVOID TLSStorageOrbis::GetValue( DWORD _index )
{
if(m_activeList[_index] == false)
- return NULL;
+ return nullptr;
return m_values[_index];
}
diff --git a/Minecraft.Client/Orbis/OrbisExtras/winerror.h b/Minecraft.Client/Orbis/OrbisExtras/winerror.h
index 6956d8de..6de91a5d 100644
--- a/Minecraft.Client/Orbis/OrbisExtras/winerror.h
+++ b/Minecraft.Client/Orbis/OrbisExtras/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/Orbis/Orbis_App.cpp b/Minecraft.Client/Orbis/Orbis_App.cpp
index fb40ff74..061f0904 100644
--- a/Minecraft.Client/Orbis/Orbis_App.cpp
+++ b/Minecraft.Client/Orbis/Orbis_App.cpp
@@ -39,7 +39,7 @@ CConsoleMinecraftApp::CConsoleMinecraftApp() : CMinecraftApp()
// debugOverlayCreated = false;
// #endif
- m_ProductListA=NULL;
+ m_ProductListA=nullptr;
m_pRemoteStorage = new SonyRemoteStorage_Orbis;
@@ -106,7 +106,7 @@ SONYDLC *CConsoleMinecraftApp::GetSONYDLCInfo(char *pchTitle)
{
app.DebugPrintf("Couldn't find DLC info for %s\n", pchTitle);
assert(0);
- return NULL;
+ return nullptr;
}
return it->second;
}
@@ -124,7 +124,7 @@ SONYDLC *CConsoleMinecraftApp::GetSONYDLCInfoFromKeyname(char *pchKeyName)
}
}
- return NULL;
+ return nullptr;
}
#define WRAPPED_READFILE(hFile,lpBuffer,nNumberOfBytesToRead,lpNumberOfBytesRead,lpOverlapped) {if(ReadFile(hFile,lpBuffer,nNumberOfBytesToRead,lpNumberOfBytesRead,lpOverlapped)==FALSE) { return FALSE;}}
@@ -133,8 +133,8 @@ 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("orbis/DLCImages/TP01_360x360.png", GENERIC_READ, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
- HANDLE file = CreateFile("orbis/PS4ProductCodes.bin", GENERIC_READ, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
+ //HANDLE file = CreateFile("orbis/DLCImages/TP01_360x360.png", GENERIC_READ, 0, nullptr, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, nullptr);
+ HANDLE file = CreateFile("orbis/PS4ProductCodes.bin", GENERIC_READ, 0, nullptr, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, nullptr);
if( file == INVALID_HANDLE_VALUE )
{
DWORD error = GetLastError();
@@ -149,12 +149,12 @@ BOOL CConsoleMinecraftApp::ReadProductCodes()
{
DWORD bytesRead;
- WRAPPED_READFILE(file,ProductCodes.chProductCode,PRODUCT_CODE_SIZE,&bytesRead,NULL);
- WRAPPED_READFILE(file,ProductCodes.chSaveFolderPrefix,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.chSaveFolderPrefix,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.chSaveFolderPrefix %s\n",ProductCodes.chSaveFolderPrefix);
@@ -165,7 +165,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++)
{
@@ -174,20 +174,20 @@ 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->eDLCType,sizeof(int),&bytesRead,nullptr);
- WRAPPED_READFILE(file,&uiVal,sizeof(int),&bytesRead,NULL);
- WRAPPED_READFILE(file,pDLCInfo->chDLCPicname,sizeof(char)*uiVal,&bytesRead,NULL);
+ WRAPPED_READFILE(file,&uiVal,sizeof(int),&bytesRead,nullptr);
+ WRAPPED_READFILE(file,pDLCInfo->chDLCPicname,sizeof(char)*uiVal,&bytesRead,nullptr);
- WRAPPED_READFILE(file,&pDLCInfo->iFirstSkin,sizeof(int),&bytesRead,NULL);
- WRAPPED_READFILE(file,&pDLCInfo->iConfig,sizeof(int),&bytesRead,NULL);
+ WRAPPED_READFILE(file,&pDLCInfo->iFirstSkin,sizeof(int),&bytesRead,nullptr);
+ WRAPPED_READFILE(file,&pDLCInfo->iConfig,sizeof(int),&bytesRead,nullptr);
// push this into a vector
@@ -310,7 +310,7 @@ void CConsoleMinecraftApp::FreeLocalDLCImages()
{
free(pDLCInfo->pbImageData);
pDLCInfo->dwImageBytes=0;
- pDLCInfo->pbImageData=NULL;
+ pDLCInfo->pbImageData=nullptr;
}
}
}
@@ -323,7 +323,7 @@ int CConsoleMinecraftApp::LoadLocalDLCImage(SONYDLC *pDLCInfo)
sprintf(pchFilename,"orbis/DLCImages/%s_360x360.png",pDLCInfo->chDLCPicname);
// 4J-PB - Read the file containing the product codes. This will be different for the SCEE/SCEA/SCEJ builds
- HANDLE hFile = CreateFile(pchFilename, GENERIC_READ, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
+ HANDLE hFile = CreateFile(pchFilename, GENERIC_READ, 0, nullptr, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, nullptr);
if( hFile == INVALID_HANDLE_VALUE )
{
@@ -339,7 +339,7 @@ int CConsoleMinecraftApp::LoadLocalDLCImage(SONYDLC *pDLCInfo)
DWORD dwBytesRead;
pDLCInfo->pbImageData=(PBYTE)malloc(pDLCInfo->dwImageBytes);
- if(ReadFile(hFile,pDLCInfo->pbImageData,pDLCInfo->dwImageBytes,&dwBytesRead,NULL)==FALSE)
+ if(ReadFile(hFile,pDLCInfo->pbImageData,pDLCInfo->dwImageBytes,&dwBytesRead,nullptr)==FALSE)
{
// failed
free(pDLCInfo->pbImageData);
@@ -375,7 +375,7 @@ void CConsoleMinecraftApp::TemporaryCreateGameStart()
{
////////////////////////////////////////////////////////////////////////////////////////////// From CScene_Main::OnInit
- app.setLevelGenerationOptions(NULL);
+ app.setLevelGenerationOptions(nullptr);
// From CScene_Main::RunPlayGame
Minecraft *pMinecraft=Minecraft::GetInstance();
@@ -404,7 +404,7 @@ void CConsoleMinecraftApp::TemporaryCreateGameStart()
NetworkGameInitData *param = new NetworkGameInitData();
param->seed = seedValue;
- param->saveData = NULL;
+ param->saveData = nullptr;
app.SetGameHostOption(eGameHostOption_Difficulty,0);
app.SetGameHostOption(eGameHostOption_FriendsOfFriends,0);
@@ -620,7 +620,7 @@ SonyCommerce::CategoryInfo *CConsoleMinecraftApp::GetCategoryInfo()
{
if(m_bCommerceCategoriesRetrieved==false)
{
- return NULL;
+ return nullptr;
}
return &m_CategoryInfo;
@@ -636,10 +636,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;
@@ -665,7 +665,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];
for ( SonyCommerce::ProductInfo& : *pProductList )
@@ -727,7 +727,7 @@ std::vector<SonyCommerce::ProductInfo>* CConsoleMinecraftApp::GetProductList(int
{
if((m_bCommerceProductListRetrieved==false) || (m_bProductListAdditionalDetailsRetrieved==false) )
{
- return NULL;
+ return nullptr;
}
return &m_ProductListA[iIndex];
@@ -1175,7 +1175,7 @@ int CConsoleMinecraftApp::Callback_SaveGameIncompleteMessageBoxReturned(void *pP
StorageManager.CancelIncompleteOperation();
break;
case C4JStorage::EMessage_ResultThirdOption:
- ui.NavigateToScene(iPad, eUIScene_InGameSaveManagementMenu, NULL, eUILayer_Error, eUIGroup_Fullscreen);
+ ui.NavigateToScene(iPad, eUIScene_InGameSaveManagementMenu, nullptr, eUILayer_Error, eUIGroup_Fullscreen);
break;
}
return 0;
@@ -1186,7 +1186,7 @@ bool CConsoleMinecraftApp::CheckForEmptyStore(int iPad)
SonyCommerce::CategoryInfo *pCategories=app.GetCategoryInfo();
bool bEmptyStore=true;
- if(pCategories!=NULL)
+ if(pCategories!=nullptr)
{
if(pCategories->countOfProducts>0)
{
@@ -1244,7 +1244,7 @@ void CConsoleMinecraftApp::PatchAvailableDialogTick()
UINT uiIDA[1];
uiIDA[0]=IDS_PRO_NOTONLINE_DECLINE;
- ui.RequestMessageBox(IDS_ONLINE_SERVICE_TITLE, IDS_CONTENT_RESTRICTION_PATCH_AVAILABLE, uiIDA, 1, ProfileManager.GetPrimaryPad(), NULL, NULL, app.GetStringTable());
+ ui.RequestMessageBox(IDS_ONLINE_SERVICE_TITLE, IDS_CONTENT_RESTRICTION_PATCH_AVAILABLE, uiIDA, 1, ProfileManager.GetPrimaryPad(), nullptr, nullptr, app.GetStringTable());
m_bPatchAvailableDialogRunning=false;
}
}
diff --git a/Minecraft.Client/Orbis/Orbis_App.h b/Minecraft.Client/Orbis/Orbis_App.h
index 1c09579f..06b6e83a 100644
--- a/Minecraft.Client/Orbis/Orbis_App.h
+++ b/Minecraft.Client/Orbis/Orbis_App.h
@@ -86,7 +86,7 @@ public:
// BANNED LEVEL LIST
virtual void ReadBannedList(int iPad, eTMSAction action=(eTMSAction)0, bool bCallback=false) {}
- C4JStringTable *GetStringTable() { return NULL;}
+ C4JStringTable *GetStringTable() { return nullptr;}
// original code
virtual void TemporaryCreateGameStart();
diff --git a/Minecraft.Client/Orbis/Orbis_Minecraft.cpp b/Minecraft.Client/Orbis/Orbis_Minecraft.cpp
index 20b9dd03..7531b25d 100644
--- a/Minecraft.Client/Orbis/Orbis_Minecraft.cpp
+++ b/Minecraft.Client/Orbis/Orbis_Minecraft.cpp
@@ -363,7 +363,7 @@ HRESULT InitD3D( IDirect3DDevice9 **ppDevice,
return pD3D->CreateDevice(
0,
D3DDEVTYPE_HAL,
- NULL,
+ nullptr,
D3DCREATE_HARDWARE_VERTEXPROCESSING|D3DCREATE_BUFFER_2_FRAMES,
pd3dPP,
ppDevice );
@@ -382,16 +382,16 @@ void MemSect(int sect)
#endif
#ifndef __ORBIS__
-HINSTANCE g_hInst = NULL;
-HWND g_hWnd = NULL;
+HINSTANCE g_hInst = nullptr;
+HWND g_hWnd = nullptr;
D3D_DRIVER_TYPE g_driverType = D3D_DRIVER_TYPE_NULL;
D3D_FEATURE_LEVEL g_featureLevel = D3D_FEATURE_LEVEL_11_0;
-ID3D11Device* g_pd3dDevice = NULL;
-ID3D11DeviceContext* g_pImmediateContext = NULL;
-IDXGISwapChain* g_pSwapChain = NULL;
-ID3D11RenderTargetView* g_pRenderTargetView = NULL;
-ID3D11DepthStencilView* g_pDepthStencilView = NULL;
-ID3D11Texture2D* g_pDepthStencilBuffer = NULL;
+ID3D11Device* g_pd3dDevice = nullptr;
+ID3D11DeviceContext* g_pImmediateContext = nullptr;
+IDXGISwapChain* g_pSwapChain = nullptr;
+ID3D11RenderTargetView* g_pRenderTargetView = nullptr;
+ID3D11DepthStencilView* g_pDepthStencilView = nullptr;
+ID3D11Texture2D* g_pDepthStencilBuffer = nullptr;
//
// FUNCTION: WndProc(HWND, UINT, WPARAM, LPARAM)
@@ -456,7 +456,7 @@ ATOM MyRegisterClass(HINSTANCE hInstance)
wcex.cbWndExtra = 0;
wcex.hInstance = hInstance;
wcex.hIcon = LoadIcon(hInstance, "Minecraft");
- wcex.hCursor = LoadCursor(NULL, IDC_ARROW);
+ wcex.hCursor = LoadCursor(nullptr, IDC_ARROW);
wcex.hbrBackground = (HBRUSH)(COLOR_WINDOW+1);
wcex.lpszMenuName = "Minecraft";
wcex.lpszClassName = "MinecraftClass";
@@ -480,7 +480,7 @@ BOOL InitInstance(HINSTANCE hInstance, int nCmdShow)
g_hInst = hInstance; // Store instance handle in our global variable
g_hWnd = CreateWindow("MinecraftClass", "Minecraft", WS_OVERLAPPEDWINDOW,
- CW_USEDEFAULT, 0, CW_USEDEFAULT, 0, NULL, NULL, hInstance, NULL);
+ CW_USEDEFAULT, 0, CW_USEDEFAULT, 0, nullptr, nullptr, hInstance, nullptr);
if (!g_hWnd)
{
@@ -544,7 +544,7 @@ HRESULT InitDevice()
for( UINT driverTypeIndex = 0; driverTypeIndex < numDriverTypes; driverTypeIndex++ )
{
g_driverType = driverTypes[driverTypeIndex];
- hr = D3D11CreateDeviceAndSwapChain( NULL, g_driverType, NULL, createDeviceFlags, featureLevels, numFeatureLevels,
+ hr = D3D11CreateDeviceAndSwapChain( nullptr, g_driverType, nullptr, createDeviceFlags, featureLevels, numFeatureLevels,
D3D11_SDK_VERSION, &sd, &g_pSwapChain, &g_pd3dDevice, &g_featureLevel, &g_pImmediateContext );
if( HRESULT_SUCCEEDED( hr ) )
break;
@@ -553,7 +553,7 @@ HRESULT InitDevice()
return hr;
// Create a render target view
- ID3D11Texture2D* pBackBuffer = NULL;
+ ID3D11Texture2D* pBackBuffer = nullptr;
hr = g_pSwapChain->GetBuffer( 0, __uuidof( ID3D11Texture2D ), ( LPVOID* )&pBackBuffer );
if( FAILED( hr ) )
return hr;
@@ -572,7 +572,7 @@ HRESULT InitDevice()
descDepth.BindFlags = D3D11_BIND_DEPTH_STENCIL;
descDepth.CPUAccessFlags = 0;
descDepth.MiscFlags = 0;
- hr = g_pd3dDevice->CreateTexture2D(&descDepth, NULL, &g_pDepthStencilBuffer);
+ hr = g_pd3dDevice->CreateTexture2D(&descDepth, nullptr, &g_pDepthStencilBuffer);
D3D11_DEPTH_STENCIL_VIEW_DESC descDSView;
descDSView.Format = DXGI_FORMAT_D24_UNORM_S8_UINT;
@@ -581,7 +581,7 @@ HRESULT InitDevice()
hr = g_pd3dDevice->CreateDepthStencilView(g_pDepthStencilBuffer, &descDSView, &g_pDepthStencilView);
- hr = g_pd3dDevice->CreateRenderTargetView( pBackBuffer, NULL, &g_pRenderTargetView );
+ hr = g_pd3dDevice->CreateRenderTargetView( pBackBuffer, nullptr, &g_pRenderTargetView );
pBackBuffer->Release();
if( FAILED( hr ) )
return hr;
@@ -774,7 +774,7 @@ int main(int argc, const char *argv[] )
MSG msg = {0};
while( WM_QUIT != msg.message )
{
- if( PeekMessage( &msg, NULL, 0, 0, PM_REMOVE ) )
+ if( PeekMessage( &msg, nullptr, 0, 0, PM_REMOVE ) )
{
TranslateMessage( &msg );
DispatchMessage( &msg );
@@ -920,7 +920,7 @@ int main(int argc, const char *argv[] )
StorageManager.Init(0,app.GetString(IDS_DEFAULT_SAVENAME),"savegame.dat",FIFTY_ONE_MB,&CConsoleMinecraftApp::DisplaySavingMessage,(LPVOID)&app,"");
StorageManager.SetSaveTitleExtraFileSuffix(app.GetString(IDS_SAVE_SUBTITLE_SUFFIX));
StorageManager.SetDLCInfoMap(app.GetSonyDLCMap());
- 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();
@@ -940,7 +940,7 @@ int main(int argc, const char *argv[] )
}
// 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 );
@@ -1090,7 +1090,7 @@ int main(int argc, const char *argv[] )
// Minecraft::main () used to call Minecraft::Start, but this takes ~2.5 seconds, so now running this in another thread
// so we can do some basic renderer calls whilst it is happening. This is at attempt to stop getting TRC failure on SubmitDone taking > 5 seconds on boot
- C4JThread *minecraftThread = new C4JThread(&StartMinecraftThreadProc, NULL, "Running minecraft start");
+ C4JThread *minecraftThread = new C4JThread(&StartMinecraftThreadProc, nullptr, "Running minecraft start");
minecraftThread->Run();
do
{
@@ -1195,7 +1195,7 @@ int main(int argc, const char *argv[] )
// We should track down why though...
app.DebugPrintf("---init sound engine()\n");
- pMinecraft->soundEngine->init(NULL);
+ pMinecraft->soundEngine->init(nullptr);
while (TRUE)
{
@@ -1250,7 +1250,7 @@ int main(int argc, const char *argv[] )
else
{
MemSect(28);
- pMinecraft->soundEngine->tick(NULL, 0.0f);
+ pMinecraft->soundEngine->tick(nullptr, 0.0f);
MemSect(0);
pMinecraft->textures->tick(true,false);
IntCache::Reset();
@@ -1491,7 +1491,7 @@ uint8_t *mallocAndCreateUTF8ArrayFromString(int iID)
uint8_t * AddRichPresenceString(int iID)
{
uint8_t *strUtf8 = mallocAndCreateUTF8ArrayFromString(iID);
- if( strUtf8 != NULL )
+ if( strUtf8 != nullptr )
{
vRichPresenceStrings.push_back(strUtf8);
}
@@ -1501,7 +1501,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/Orbis/Orbis_UIController.cpp b/Minecraft.Client/Orbis/Orbis_UIController.cpp
index 38cc79e9..a6ed530e 100644
--- a/Minecraft.Client/Orbis/Orbis_UIController.cpp
+++ b/Minecraft.Client/Orbis/Orbis_UIController.cpp
@@ -182,7 +182,7 @@ void ConsoleUIController::render()
throttle++;
#else
- gdraw_orbis_End(NULL);
+ gdraw_orbis_End(nullptr);
#endif
#endif
@@ -252,7 +252,7 @@ GDrawTexture *ConsoleUIController::getSubstitutionTexture(int textureId)
GDrawTexture *gdrawTex = gdraw_orbis_WrappedTextureCreate(tex);
return gdrawTex;
- return NULL;
+ return nullptr;
}
void ConsoleUIController::destroySubstitutionTexture(void *destroyCallBackData, GDrawTexture *handle)
diff --git a/Minecraft.Client/Orbis/XML/ATGXmlParser.h b/Minecraft.Client/Orbis/XML/ATGXmlParser.h
index 75142e3e..12f59737 100644
--- a/Minecraft.Client/Orbis/XML/ATGXmlParser.h
+++ b/Minecraft.Client/Orbis/XML/ATGXmlParser.h
@@ -138,7 +138,7 @@ private:
DWORD m_dwCharsTotal;
DWORD m_dwCharsConsumed;
- BYTE m_pReadBuf[ XML_READ_BUFFER_SIZE + 2 ]; // room for a trailing NULL
+ BYTE m_pReadBuf[ XML_READ_BUFFER_SIZE + 2 ]; // room for a trailing nullptr
WCHAR m_pWriteBuf[ XML_WRITE_BUFFER_SIZE ];
BYTE* m_pReadPtr;
diff --git a/Minecraft.Client/Orbis/user_malloc.cpp b/Minecraft.Client/Orbis/user_malloc.cpp
index 1628abbe..b8eac08f 100644
--- a/Minecraft.Client/Orbis/user_malloc.cpp
+++ b/Minecraft.Client/Orbis/user_malloc.cpp
@@ -54,7 +54,7 @@ int user_malloc_init(void)
return 1;
}
- addr = NULL;
+ addr = nullptr;
//E Map direct memory to the process address space
res = sceKernelMapDirectMemory(&addr, s_heapLength, SCE_KERNEL_PROT_CPU_READ | SCE_KERNEL_PROT_CPU_WRITE, 0, s_memStart, s_memAlign);
if (res < 0) {
@@ -64,7 +64,7 @@ int user_malloc_init(void)
//E Generate mspace
s_mspace = sceLibcMspaceCreate("User Malloc", addr, s_heapLength, 0);
- if (s_mspace == NULL) {
+ if (s_mspace == nullptr) {
//E Error handling
return 1;
}
@@ -77,7 +77,7 @@ int user_malloc_finalize(void)
{
int res;
- if (s_mspace != NULL) {
+ if (s_mspace != nullptr) {
//E Free mspace
//J mspace を解放する
res = sceLibcMspaceDestroy(s_mspace);
diff --git a/Minecraft.Client/Orbis/user_malloc_for_tls.cpp b/Minecraft.Client/Orbis/user_malloc_for_tls.cpp
index d1a8d255..d862b6b9 100644
--- a/Minecraft.Client/Orbis/user_malloc_for_tls.cpp
+++ b/Minecraft.Client/Orbis/user_malloc_for_tls.cpp
@@ -39,7 +39,7 @@ int user_malloc_init_for_tls(void)
return 1;
}
- addr = NULL;
+ addr = nullptr;
//E Map direct memory to the process address space
//J ダイレクトメモリをプロセスアドレス空間にマップする
res = sceKernelMapDirectMemory(&addr, HEAP_SIZE, SCE_KERNEL_PROT_CPU_READ | SCE_KERNEL_PROT_CPU_WRITE, 0, s_memStart, s_memAlign);
@@ -52,7 +52,7 @@ int user_malloc_init_for_tls(void)
//E Generate mspace
//J mspace を生成する
s_mspace = sceLibcMspaceCreate("User Malloc For TLS", addr, HEAP_SIZE, 0);
- if (s_mspace == NULL) {
+ if (s_mspace == nullptr) {
//E Error handling
//J エラー処理
return 1;
@@ -67,7 +67,7 @@ int user_malloc_fini_for_tls(void)
{
int res;
- if (s_mspace != NULL) {
+ if (s_mspace != nullptr) {
//E Free mspace
//J mspace を解放する
res = sceLibcMspaceDestroy(s_mspace);
diff --git a/Minecraft.Client/Orbis/user_new.cpp b/Minecraft.Client/Orbis/user_new.cpp
index 83aa3f8c..e3108354 100644
--- a/Minecraft.Client/Orbis/user_new.cpp
+++ b/Minecraft.Client/Orbis/user_new.cpp
@@ -26,13 +26,13 @@ void *user_new(std::size_t size) throw(std::bad_alloc)
if (size == 0)
size = 1;
- while ((ptr = (void *)std::malloc(size)) == NULL) {
+ while ((ptr = (void *)std::malloc(size)) == nullptr) {
//E Obtain new_handler
//J new_handler を取得する
std::new_handler handler = std::get_new_handler();
- //E When new_handler is a NULL pointer, bad_alloc is send. If not, new_handler is called.
- //J new_handler が NULL ポインタの場合、bad_alloc を送出する、そうでない場合、new_handler を呼び出す
+ //E When new_handler is a nullptr pointer, bad_alloc is send. If not, new_handler is called.
+ //J new_handler が nullptr ポインタの場合、bad_alloc を送出する、そうでない場合、new_handler を呼び出す
if (!handler)
{
assert(0);//throw std::bad_alloc();
@@ -54,27 +54,27 @@ void *user_new(std::size_t size, const std::nothrow_t& x) throw()
// if (size == 0)
// size = 1;
//
-// while ((ptr = (void *)std::malloc(size)) == NULL) {
+// while ((ptr = (void *)std::malloc(size)) == nullptr) {
// //E Obtain new_handler
// //J new_handler を取得する
// std::new_handler handler = std::get_new_handler();
//
-// //E When new_handler is a NULL pointer, NULL is returned.
-// //J new_handler が NULL ポインタの場合、NULL を返す
+// //E When new_handler is a nullptr pointer, nullptr is returned.
+// //J new_handler が nullptr ポインタの場合、nullptr を返す
// if (!handler)
-// return NULL;
+// return nullptr;
//
-// //E Call new_handler. If new_handler sends bad_alloc, NULL is returned.
-// //J new_handler を呼び出す、new_handler が bad_alloc を送出した場合、NULL を返す
+// //E Call new_handler. If new_handler sends bad_alloc, nullptr is returned.
+// //J new_handler を呼び出す、new_handler が bad_alloc を送出した場合、nullptr を返す
// try {
// (*handler)();
// } catch (std::bad_alloc) {
-// return NULL;
+// return nullptr;
// }
// }
// return ptr;
assert(0);
- return NULL;
+ return nullptr;
}
//E Replace operator new[].
@@ -95,9 +95,9 @@ void *user_new_array(std::size_t size, const std::nothrow_t& x) throw()
//J operator delete と置き換わる
void user_delete(void *ptr) throw()
{
- //E In the case of the NULL pointer, no action will be taken.
- //J NULL ポインタの場合、何も行わない
- if (ptr != NULL)
+ //E In the case of the nullptr pointer, no action will be taken.
+ //J nullptr ポインタの場合、何も行わない
+ if (ptr != nullptr)
std::free(ptr);
}