mirror of
https://github.com/4jcraft/4jcraft.git
synced 2026-10-04 04:19:04 +00:00
Remove Win32 byte types from colour tables
This commit is contained in:
parent
474d8b2896
commit
f5326bfe3b
|
|
@ -314,20 +314,20 @@ void ColourTable::staticCtor()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ColourTable::ColourTable(PBYTE pbData, DWORD dwLength)
|
ColourTable::ColourTable(std::uint8_t *pbData, std::uint32_t dataLength)
|
||||||
{
|
{
|
||||||
loadColoursFromData(pbData, dwLength);
|
loadColoursFromData(pbData, dataLength);
|
||||||
}
|
}
|
||||||
|
|
||||||
ColourTable::ColourTable(ColourTable *defaultColours, PBYTE pbData, DWORD dwLength)
|
ColourTable::ColourTable(ColourTable *defaultColours, std::uint8_t *pbData, std::uint32_t dataLength)
|
||||||
{
|
{
|
||||||
// 4J Stu - Default the colours that of the table passed in
|
// 4J Stu - Default the colours that of the table passed in
|
||||||
XMemCpy( (void *)m_colourValues, (void *)defaultColours->m_colourValues, sizeof(int) * eMinecraftColour_COUNT);
|
XMemCpy( (void *)m_colourValues, (void *)defaultColours->m_colourValues, sizeof(int) * eMinecraftColour_COUNT);
|
||||||
loadColoursFromData(pbData, dwLength);
|
loadColoursFromData(pbData, dataLength);
|
||||||
}
|
}
|
||||||
void ColourTable::loadColoursFromData(PBYTE pbData, DWORD dwLength)
|
void ColourTable::loadColoursFromData(std::uint8_t *pbData, std::uint32_t dataLength)
|
||||||
{
|
{
|
||||||
byteArray src(pbData, dwLength);
|
byteArray src(pbData, dataLength);
|
||||||
|
|
||||||
ByteArrayInputStream bais(src);
|
ByteArrayInputStream bais(src);
|
||||||
DataInputStream dis(&bais);
|
DataInputStream dis(&bais);
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,5 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
|
#include <cstdint>
|
||||||
|
|
||||||
class ColourTable
|
class ColourTable
|
||||||
{
|
{
|
||||||
|
|
@ -11,13 +12,13 @@ private:
|
||||||
public:
|
public:
|
||||||
static void staticCtor();
|
static void staticCtor();
|
||||||
|
|
||||||
ColourTable(PBYTE pbData, DWORD dwLength);
|
ColourTable(std::uint8_t *pbData, std::uint32_t dataLength);
|
||||||
ColourTable(ColourTable *defaultColours, PBYTE pbData, DWORD dwLength);
|
ColourTable(ColourTable *defaultColours, std::uint8_t *pbData, std::uint32_t dataLength);
|
||||||
|
|
||||||
unsigned int getColour(eMinecraftColour id);
|
unsigned int getColour(eMinecraftColour id);
|
||||||
unsigned int getColor(eMinecraftColour id) { return getColour(id); }
|
unsigned int getColor(eMinecraftColour id) { return getColour(id); }
|
||||||
|
|
||||||
void loadColoursFromData(PBYTE pbData, DWORD dwLength);
|
void loadColoursFromData(std::uint8_t *pbData, std::uint32_t dataLength);
|
||||||
void setColour(const std::wstring &colourName, int value);
|
void setColour(const std::wstring &colourName, int value);
|
||||||
void setColour(const std::wstring &colourName, const std::wstring &value);
|
void setColour(const std::wstring &colourName, const std::wstring &value);
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue