mirror of
https://github.com/4jcraft/4jcraft.git
synced 2026-08-20 09:57:10 +00:00
Remove WinAPI byte allocation in common app
This commit is contained in:
parent
3a98ff640c
commit
506964f2b4
|
|
@ -5353,8 +5353,7 @@ void CMinecraftApp::AddMemoryTextureFile(const std::wstring &wName, std::uint8_t
|
||||||
|
|
||||||
// add this texture to the list of memory texture files - it will then be picked up by the level renderer's AddEntity
|
// add this texture to the list of memory texture files - it will then be picked up by the level renderer's AddEntity
|
||||||
|
|
||||||
pData = (PMEMDATA)new BYTE[sizeof(MEMDATA)];
|
pData = new MEMDATA();
|
||||||
ZeroMemory( pData, sizeof(MEMDATA) );
|
|
||||||
pData->pbData=pbData;
|
pData->pbData=pbData;
|
||||||
pData->dwBytes=dwBytes;
|
pData->dwBytes=dwBytes;
|
||||||
pData->ucRefCount = 1;
|
pData->ucRefCount = 1;
|
||||||
|
|
@ -5382,7 +5381,7 @@ void CMinecraftApp::RemoveMemoryTextureFile(const std::wstring &wName)
|
||||||
#ifndef _CONTENT_PACKAGE
|
#ifndef _CONTENT_PACKAGE
|
||||||
wprintf(L"Erasing the memory texture file data for %ls\n", wName.c_str());
|
wprintf(L"Erasing the memory texture file data for %ls\n", wName.c_str());
|
||||||
#endif
|
#endif
|
||||||
delete [] pData;
|
delete pData;
|
||||||
m_MEM_Files.erase(wName);
|
m_MEM_Files.erase(wName);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -5435,8 +5434,7 @@ void CMinecraftApp::AddMemoryTPDFile(int iConfig, std::uint8_t *pbData, unsigned
|
||||||
AUTO_VAR(it, m_MEM_TPD.find(iConfig));
|
AUTO_VAR(it, m_MEM_TPD.find(iConfig));
|
||||||
if(it == m_MEM_TPD.end())
|
if(it == m_MEM_TPD.end())
|
||||||
{
|
{
|
||||||
pData = (PMEMDATA)new BYTE[sizeof(MEMDATA)];
|
pData = new MEMDATA();
|
||||||
ZeroMemory( pData, sizeof(MEMDATA) );
|
|
||||||
pData->pbData=pbData;
|
pData->pbData=pbData;
|
||||||
pData->dwBytes=dwBytes;
|
pData->dwBytes=dwBytes;
|
||||||
pData->ucRefCount = 1;
|
pData->ucRefCount = 1;
|
||||||
|
|
@ -5456,7 +5454,7 @@ void CMinecraftApp::RemoveMemoryTPDFile(int iConfig)
|
||||||
if(it != m_MEM_TPD.end())
|
if(it != m_MEM_TPD.end())
|
||||||
{
|
{
|
||||||
pData=m_MEM_TPD[iConfig];
|
pData=m_MEM_TPD[iConfig];
|
||||||
delete [] pData;
|
delete pData;
|
||||||
m_MEM_TPD.erase(iConfig);
|
m_MEM_TPD.erase(iConfig);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue