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
This commit is contained in:
ModMaker101
2026-03-07 21:56:03 -05:00
committed by GitHub
parent 1be5faaea7
commit a9be52c41a
1373 changed files with 19903 additions and 19449 deletions

View File

@@ -11,7 +11,7 @@ bool MinecraftDynamicConfigurations::s_bUpdatedConfigs[MinecraftDynamicConfigura
MinecraftDynamicConfigurations::EDynamic_Configs MinecraftDynamicConfigurations::s_eCurrentConfig = MinecraftDynamicConfigurations::eDynamic_Config_Max;
size_t MinecraftDynamicConfigurations::s_currentConfigSize = 0;
size_t MinecraftDynamicConfigurations::s_dataWrittenSize = 0;
byte *MinecraftDynamicConfigurations::s_dataWritten = NULL;
byte *MinecraftDynamicConfigurations::s_dataWritten = nullptr;
void MinecraftDynamicConfigurations::Tick()
{
@@ -43,7 +43,7 @@ void MinecraftDynamicConfigurations::UpdateNextConfiguration()
{
if(!s_bUpdatedConfigs[i])
{
update = (EDynamic_Configs)i;
update = static_cast<EDynamic_Configs>(i);
break;
}
}
@@ -57,7 +57,7 @@ void MinecraftDynamicConfigurations::UpdateConfiguration(EDynamic_Configs id)
{
app.DebugPrintf("DynamicConfig: Attempting to update dynamic configuration %d\n", id);
HRESULT hr = Sentient::SenDynamicConfigGetSize( id, &s_currentConfigSize, &MinecraftDynamicConfigurations::GetSizeCompletedCallback, NULL);
HRESULT hr = Sentient::SenDynamicConfigGetSize( id, &s_currentConfigSize, &MinecraftDynamicConfigurations::GetSizeCompletedCallback, nullptr);
switch(hr)
{
@@ -76,7 +76,7 @@ void MinecraftDynamicConfigurations::UpdateConfiguration(EDynamic_Configs id)
break;
case E_POINTER:
app.DebugPrintf("DynamicConfig: Failed to get size for config as pointer is invalid\n");
//The out_size pointer is NULL.
//The out_size pointer is nullptr.
break;
}
if(FAILED(hr) )
@@ -97,7 +97,7 @@ void MinecraftDynamicConfigurations::GetSizeCompletedCallback(HRESULT taskResult
&s_dataWrittenSize,
s_dataWritten,
&MinecraftDynamicConfigurations::GetDataCompletedCallback,
NULL
nullptr
);
switch(hr)
@@ -115,8 +115,8 @@ void MinecraftDynamicConfigurations::GetSizeCompletedCallback(HRESULT taskResult
//Sentient is not initialized. You must call SentientInitialize before you call this function.
break;
case E_POINTER:
app.DebugPrintf("DynamicConfig: Failed to get bytes for config as pointer is NULL\n");
//The out_size pointer is NULL.
app.DebugPrintf("DynamicConfig: Failed to get bytes for config as pointer is nullptr\n");
//The out_size pointer is nullptr.
break;
}
if(FAILED(hr) )
@@ -160,7 +160,7 @@ void MinecraftDynamicConfigurations::GetDataCompletedCallback(HRESULT taskResu
}
delete [] s_dataWritten;
s_dataWritten = NULL;
s_dataWritten = nullptr;
s_bUpdatedConfigs[s_eCurrentConfig] = true;
UpdateNextConfiguration();