4jcraft/Minecraft.Client/Platform/Common/DLC/DLCColourTableFile.cpp
MatthewBeshay dfb0e3b03e refactor: replace NULL with nullptr across C++ codebase
Excludes vendored C libs (zlib, Miles, DirectXMath, boost, Iggy).
2026-03-30 16:25:52 +11:00

26 lines
930 B
C++

#include "../../Minecraft.World/Platform/stdafx.h"
#include "DLCManager.h"
#include "DLCColourTableFile.h"
#include "../../Minecraft.Client/Minecraft.h"
#include "../../Minecraft.Client/Textures/Packs/TexturePackRepository.h"
#include "../../Minecraft.Client/Textures/Packs/TexturePack.h"
DLCColourTableFile::DLCColourTableFile(const std::wstring& path)
: DLCFile(DLCManager::e_DLCType_ColourTable, path) {
m_colourTable = nullptr;
}
DLCColourTableFile::~DLCColourTableFile() {
if (m_colourTable != nullptr) {
app.DebugPrintf("Deleting DLCColourTableFile data\n");
delete m_colourTable;
}
}
void DLCColourTableFile::addData(std::uint8_t* pbData,
std::uint32_t dataBytes) {
ColourTable* defaultColourTable =
Minecraft::GetInstance()->skins->getDefault()->getColourTable();
m_colourTable = new ColourTable(defaultColourTable, pbData, dataBytes);
}