aboutsummaryrefslogtreecommitdiff
path: root/Minecraft.Client/Common/DLC/DLCAudioFile.cpp
diff options
context:
space:
mode:
authorModMaker101 <119018978+ModMaker101@users.noreply.github.com>2026-03-08 19:08:36 -0400
committerGitHub <noreply@github.com>2026-03-08 18:08:36 -0500
commit28614b922fb77149a54da1a87bebfbc98736f296 (patch)
tree7f828ba86a4ee18d0a80d29de64f6199a5412512 /Minecraft.Client/Common/DLC/DLCAudioFile.cpp
parent88798b501d0cf6287b6f87acb2592676e3cec58d (diff)
Modernize project codebase (#906)
* 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 * Add safety checks and fix a issue with vector going OOR
Diffstat (limited to 'Minecraft.Client/Common/DLC/DLCAudioFile.cpp')
-rw-r--r--Minecraft.Client/Common/DLC/DLCAudioFile.cpp18
1 files changed, 9 insertions, 9 deletions
diff --git a/Minecraft.Client/Common/DLC/DLCAudioFile.cpp b/Minecraft.Client/Common/DLC/DLCAudioFile.cpp
index 7116f62d..ee0cb7a7 100644
--- a/Minecraft.Client/Common/DLC/DLCAudioFile.cpp
+++ b/Minecraft.Client/Common/DLC/DLCAudioFile.cpp
@@ -8,7 +8,7 @@
DLCAudioFile::DLCAudioFile(const wstring &path) : DLCFile(DLCManager::e_DLCType_Audio,path)
{
- m_pbData = NULL;
+ m_pbData = nullptr;
m_dwBytes = 0;
}
@@ -40,7 +40,7 @@ DLCAudioFile::EAudioParameterType DLCAudioFile::getParameterType(const wstring &
{
if(paramName.compare(wchTypeNamesA[i]) == 0)
{
- type = (EAudioParameterType)i;
+ type = static_cast<EAudioParameterType>(i);
break;
}
}
@@ -87,7 +87,7 @@ void DLCAudioFile::addParameter(EAudioType type, EAudioParameterType ptype, cons
{
i++;
}
- int iLast=(int)creditValue.find_last_of(L" ",i);
+ size_t iLast=creditValue.find_last_of(L" ", i);
switch(XGetLanguage())
{
case XC_LANGUAGE_JAPANESE:
@@ -96,7 +96,7 @@ void DLCAudioFile::addParameter(EAudioType type, EAudioParameterType ptype, cons
iLast = maximumChars;
break;
default:
- iLast=(int)creditValue.find_last_of(L" ",i);
+ iLast=creditValue.find_last_of(L" ", i);
break;
}
@@ -133,7 +133,7 @@ bool DLCAudioFile::processDLCDataFile(PBYTE pbData, DWORD dwLength)
if(uiVersion < CURRENT_AUDIO_VERSION_NUM)
{
- if(pbData!=NULL) delete [] pbData;
+ if(pbData!=nullptr) delete [] pbData;
app.DebugPrintf("DLC version of %d is too old to be read\n", uiVersion);
return false;
}
@@ -145,7 +145,7 @@ bool DLCAudioFile::processDLCDataFile(PBYTE pbData, DWORD dwLength)
for(unsigned int i=0;i<uiParameterTypeCount;i++)
{
// Map DLC strings to application strings, then store the DLC index mapping to application index
- wstring parameterName((WCHAR *)pParams->wchData);
+ wstring parameterName(static_cast<WCHAR *>(pParams->wchData));
EAudioParameterType type = getParameterType(parameterName);
if( type != e_AudioParamType_Invalid )
{
@@ -169,7 +169,7 @@ bool DLCAudioFile::processDLCDataFile(PBYTE pbData, DWORD dwLength)
for(unsigned int i=0;i<uiFileCount;i++)
{
- EAudioType type = (EAudioType)pFile->dwType;
+ EAudioType type = static_cast<EAudioType>(pFile->dwType);
// Params
unsigned int uiParameterCount=*(unsigned int *)pbTemp;
pbTemp+=sizeof(int);
@@ -182,7 +182,7 @@ bool DLCAudioFile::processDLCDataFile(PBYTE pbData, DWORD dwLength)
if(it != parameterMapping.end() )
{
- addParameter(type,(EAudioParameterType)pParams->dwType,(WCHAR *)pParams->wchData);
+ addParameter(type,static_cast<EAudioParameterType>(pParams->dwType),(WCHAR *)pParams->wchData);
}
pbTemp+=sizeof(C4JStorage::DLC_FILE_PARAM)+(sizeof(WCHAR)*pParams->dwWchCount);
pParams = (C4JStorage::DLC_FILE_PARAM *)pbTemp;
@@ -198,7 +198,7 @@ bool DLCAudioFile::processDLCDataFile(PBYTE pbData, DWORD dwLength)
return true;
}
-int DLCAudioFile::GetCountofType(DLCAudioFile::EAudioType eType)
+int DLCAudioFile::GetCountofType(EAudioType eType)
{
return m_parameters[eType].size();
}