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

@@ -57,7 +57,7 @@ void SoundEngine::updateSoundEffectVolume(float fVal) {}
void SoundEngine::add(const wstring& name, File *file) {}
void SoundEngine::addMusic(const wstring& name, File *file) {}
void SoundEngine::addStreaming(const wstring& name, File *file) {}
char *SoundEngine::ConvertSoundPathToName(const wstring& name, bool bConvertSpaces) { return NULL; }
char *SoundEngine::ConvertSoundPathToName(const wstring& name, bool bConvertSpaces) { return nullptr; }
bool SoundEngine::isStreamingWavebankReady() { return true; }
void SoundEngine::playMusicTick() {};
@@ -334,7 +334,7 @@ void SoundEngine::tick(shared_ptr<Mob> *players, float a)
bool bListenerPostionSet = false;
for( size_t i = 0; i < MAX_LOCAL_PLAYERS; i++ )
{
if( players[i] != NULL )
if( players[i] != nullptr )
{
m_ListenerA[i].bValid=true;
F32 x,y,z;
@@ -401,7 +401,7 @@ SoundEngine::SoundEngine()
m_iMusicDelay=0;
m_validListenerCount=0;
m_bHeardTrackA=NULL;
m_bHeardTrackA=nullptr;
// Start the streaming music playing some music from the overworld
SetStreamingSounds(eStream_Overworld_Calm1,eStream_Overworld_piano3,
@@ -547,8 +547,8 @@ void SoundEngine::play(int iSound, float x, float y, float z, float volume, floa
&m_engine,
finalPath,
MA_SOUND_FLAG_ASYNC,
NULL,
NULL,
nullptr,
nullptr,
&s->sound) != MA_SUCCESS)
{
app.DebugPrintf("Failed to initialize sound from file: %s\n", finalPath);
@@ -631,8 +631,8 @@ void SoundEngine::playUI(int iSound, float volume, float pitch)
&m_engine,
finalPath,
MA_SOUND_FLAG_ASYNC,
NULL,
NULL,
nullptr,
nullptr,
&s->sound) != MA_SUCCESS)
{
delete s;
@@ -700,7 +700,7 @@ void SoundEngine::playStreaming(const wstring& name, float x, float y , float z,
for(unsigned int i=0;i<MAX_LOCAL_PLAYERS;i++)
{
if(pMinecraft->localplayers[i]!=NULL)
if(pMinecraft->localplayers[i]!=nullptr)
{
if(pMinecraft->localplayers[i]->dimension==LevelData::DIMENSION_END)
{
@@ -794,7 +794,7 @@ int SoundEngine::getMusicID(int iDomain)
Minecraft *pMinecraft=Minecraft::GetInstance();
// Before the game has started?
if(pMinecraft==NULL)
if(pMinecraft==nullptr)
{
// any track from the overworld
return GetRandomishTrack(m_iStream_Overworld_Min,m_iStream_Overworld_Max);
@@ -927,8 +927,8 @@ int SoundEngine::OpenStreamThreadProc(void* lpParameter)
&soundEngine->m_engine,
soundEngine->m_szStreamName,
MA_SOUND_FLAG_STREAM,
NULL,
NULL,
nullptr,
nullptr,
&soundEngine->m_musicStream);
if (result != MA_SUCCESS)
@@ -1186,7 +1186,7 @@ void SoundEngine::playMusicUpdate()
if( !m_openStreamThread->isRunning() )
{
delete m_openStreamThread;
m_openStreamThread = NULL;
m_openStreamThread = nullptr;
app.DebugPrintf("OpenStreamThreadProc finished. m_musicStreamActive=%d\n", m_musicStreamActive);
@@ -1243,7 +1243,7 @@ void SoundEngine::playMusicUpdate()
if( !m_openStreamThread->isRunning() )
{
delete m_openStreamThread;
m_openStreamThread = NULL;
m_openStreamThread = nullptr;
m_StreamState = eMusicStreamState_Stop;
}
break;
@@ -1279,14 +1279,14 @@ void SoundEngine::playMusicUpdate()
}
if(GetIsPlayingStreamingGameMusic())
{
//if(m_MusicInfo.pCue!=NULL)
//if(m_MusicInfo.pCue!=nullptr)
{
bool playerInEnd = false;
bool playerInNether=false;
Minecraft *pMinecraft = Minecraft::GetInstance();
for(unsigned int i = 0; i < MAX_LOCAL_PLAYERS; ++i)
{
if(pMinecraft->localplayers[i]!=NULL)
if(pMinecraft->localplayers[i]!=nullptr)
{
if(pMinecraft->localplayers[i]->dimension==LevelData::DIMENSION_END)
{
@@ -1417,7 +1417,7 @@ void SoundEngine::playMusicUpdate()
for(unsigned int i=0;i<MAX_LOCAL_PLAYERS;i++)
{
if(pMinecraft->localplayers[i]!=NULL)
if(pMinecraft->localplayers[i]!=nullptr)
{
if(pMinecraft->localplayers[i]->dimension==LevelData::DIMENSION_END)
{