mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/4jcraft.git
synced 2026-05-23 15:54:32 +00:00
Use standard sizes in texture pack locators
This commit is contained in:
@@ -40,13 +40,13 @@ void AbstractTexturePack::loadIcon()
|
||||
{
|
||||
#ifdef _XBOX
|
||||
// 4J Stu - Temporary only
|
||||
const DWORD LOCATOR_SIZE = 256; // Use this to allocate space to hold a ResourceLocator string
|
||||
static const int LOCATOR_SIZE = 256; // Use this to allocate space to hold a ResourceLocator string
|
||||
WCHAR szResourceLocator[ LOCATOR_SIZE ];
|
||||
|
||||
const ULONG_PTR c_ModuleHandle = (ULONG_PTR)GetModuleHandle(NULL);
|
||||
swprintf(szResourceLocator, LOCATOR_SIZE ,L"section://%X,%ls#%ls",c_ModuleHandle,L"media", L"media/Graphics/TexturePackIcon.png");
|
||||
|
||||
UINT size = 0;
|
||||
unsigned int size = 0;
|
||||
HRESULT hr = XuiResourceLoadAllNoLoc(szResourceLocator, &m_iconData, &size);
|
||||
m_iconSize = static_cast<std::uint32_t>(size);
|
||||
#endif
|
||||
@@ -56,13 +56,13 @@ void AbstractTexturePack::loadComparison()
|
||||
{
|
||||
#ifdef _XBOX
|
||||
// 4J Stu - Temporary only
|
||||
const DWORD LOCATOR_SIZE = 256; // Use this to allocate space to hold a ResourceLocator string
|
||||
static const int LOCATOR_SIZE = 256; // Use this to allocate space to hold a ResourceLocator string
|
||||
WCHAR szResourceLocator[ LOCATOR_SIZE ];
|
||||
|
||||
const ULONG_PTR c_ModuleHandle = (ULONG_PTR)GetModuleHandle(NULL);
|
||||
swprintf(szResourceLocator, LOCATOR_SIZE ,L"section://%X,%ls#%ls",c_ModuleHandle,L"media", L"media/Graphics/DefaultPack_Comparison.png");
|
||||
|
||||
UINT size = 0;
|
||||
unsigned int size = 0;
|
||||
HRESULT hr = XuiResourceLoadAllNoLoc(szResourceLocator, &m_comparisonData, &size);
|
||||
m_comparisonSize = static_cast<std::uint32_t>(size);
|
||||
#endif
|
||||
@@ -232,7 +232,7 @@ void AbstractTexturePack::loadDefaultUI()
|
||||
const ULONG_PTR c_ModuleHandle = (ULONG_PTR)GetModuleHandle(NULL);
|
||||
|
||||
// Load new skin
|
||||
const DWORD LOCATOR_SIZE = 256; // Use this to allocate space to hold a ResourceLocator string
|
||||
static const int LOCATOR_SIZE = 256; // Use this to allocate space to hold a ResourceLocator string
|
||||
WCHAR szResourceLocator[ LOCATOR_SIZE ];
|
||||
|
||||
swprintf(szResourceLocator, LOCATOR_SIZE,L"section://%X,%ls#%ls",c_ModuleHandle,L"media", L"media/skin_Minecraft.xur");
|
||||
@@ -291,13 +291,13 @@ void AbstractTexturePack::loadDefaultHTMLColourTable()
|
||||
// load from the .xzp file
|
||||
const ULONG_PTR c_ModuleHandle = (ULONG_PTR)GetModuleHandle(NULL);
|
||||
|
||||
const DWORD LOCATOR_SIZE = 256; // Use this to allocate space to hold a ResourceLocator string
|
||||
static const int LOCATOR_SIZE = 256; // Use this to allocate space to hold a ResourceLocator string
|
||||
WCHAR szResourceLocator[ LOCATOR_SIZE ];
|
||||
|
||||
// Try and load the HTMLColours.col based off the common XML first, before the deprecated xuiscene_colourtable
|
||||
wsprintfW(szResourceLocator,L"section://%X,%s#%s",c_ModuleHandle,L"media", L"media/HTMLColours.col");
|
||||
BYTE *data;
|
||||
UINT dataLength;
|
||||
std::uint8_t *data;
|
||||
unsigned int dataLength;
|
||||
if(XuiResourceLoadAll(szResourceLocator, &data, &dataLength) == S_OK)
|
||||
{
|
||||
m_colourTable->loadColoursFromData(data,dataLength);
|
||||
@@ -376,7 +376,7 @@ std::wstring AbstractTexturePack::getXuiRootPath()
|
||||
const ULONG_PTR c_ModuleHandle = (ULONG_PTR)GetModuleHandle(NULL);
|
||||
|
||||
// Load new skin
|
||||
const DWORD LOCATOR_SIZE = 256; // Use this to allocate space to hold a ResourceLocator string
|
||||
static const int LOCATOR_SIZE = 256; // Use this to allocate space to hold a ResourceLocator string
|
||||
WCHAR szResourceLocator[ LOCATOR_SIZE ];
|
||||
|
||||
swprintf(szResourceLocator, LOCATOR_SIZE,L"section://%X,%ls#%ls",c_ModuleHandle,L"media", L"media/");
|
||||
|
||||
@@ -225,13 +225,13 @@ void DLCTexturePack::loadColourTable()
|
||||
std::uint32_t dwSize = 0;
|
||||
std::uint8_t *pbData = dataFile->getData(dwSize);
|
||||
|
||||
const DWORD LOCATOR_SIZE = 256; // Use this to allocate space to hold a ResourceLocator string
|
||||
static const int LOCATOR_SIZE = 256; // Use this to allocate space to hold a ResourceLocator string
|
||||
WCHAR szResourceLocator[ LOCATOR_SIZE ];
|
||||
|
||||
// Try and load the HTMLColours.col based off the common XML first, before the deprecated xuiscene_colourtable
|
||||
swprintf(szResourceLocator, LOCATOR_SIZE,L"memory://%08X,%04X#HTMLColours.col",pbData, dwSize);
|
||||
BYTE *data;
|
||||
UINT dataLength;
|
||||
std::uint8_t *data;
|
||||
unsigned int dataLength;
|
||||
if(XuiResourceLoadAll(szResourceLocator, &data, &dataLength) == S_OK)
|
||||
{
|
||||
m_colourTable->loadColoursFromData(data,dataLength);
|
||||
@@ -483,7 +483,7 @@ void DLCTexturePack::loadUI()
|
||||
std::uint32_t dwSize = 0;
|
||||
std::uint8_t *pbData = dataFile->getData(dwSize);
|
||||
|
||||
const DWORD LOCATOR_SIZE = 256; // Use this to allocate space to hold a ResourceLocator string
|
||||
static const int LOCATOR_SIZE = 256; // Use this to allocate space to hold a ResourceLocator string
|
||||
WCHAR szResourceLocator[ LOCATOR_SIZE ];
|
||||
swprintf(szResourceLocator, LOCATOR_SIZE,L"memory://%08X,%04X#skin_Minecraft.xur",pbData, dwSize);
|
||||
|
||||
@@ -557,7 +557,7 @@ std::wstring DLCTexturePack::getXuiRootPath()
|
||||
std::uint32_t dwSize = 0;
|
||||
std::uint8_t *pbData = dataFile->getData(dwSize);
|
||||
|
||||
const DWORD LOCATOR_SIZE = 256; // Use this to allocate space to hold a ResourceLocator string
|
||||
static const int LOCATOR_SIZE = 256; // Use this to allocate space to hold a ResourceLocator string
|
||||
WCHAR szResourceLocator[ LOCATOR_SIZE ];
|
||||
swprintf(szResourceLocator, LOCATOR_SIZE,L"memory://%08X,%04X#",pbData, dwSize);
|
||||
path = szResourceLocator;
|
||||
|
||||
@@ -17,13 +17,13 @@ void DefaultTexturePack::loadIcon()
|
||||
{
|
||||
#ifdef _XBOX
|
||||
// 4J Stu - Temporary only
|
||||
const DWORD LOCATOR_SIZE = 256; // Use this to allocate space to hold a ResourceLocator string
|
||||
static const int LOCATOR_SIZE = 256; // Use this to allocate space to hold a ResourceLocator string
|
||||
WCHAR szResourceLocator[ LOCATOR_SIZE ];
|
||||
|
||||
const ULONG_PTR c_ModuleHandle = (ULONG_PTR)GetModuleHandle(NULL);
|
||||
swprintf(szResourceLocator, LOCATOR_SIZE ,L"section://%X,%ls#%ls",c_ModuleHandle,L"media", L"media/Graphics/TexturePackIcon.png");
|
||||
|
||||
UINT size = 0;
|
||||
unsigned int size = 0;
|
||||
HRESULT hr = XuiResourceLoadAllNoLoc(szResourceLocator, &m_iconData, &size);
|
||||
m_iconSize = size;
|
||||
#else
|
||||
|
||||
@@ -79,7 +79,7 @@ void FolderTexturePack::loadUI()
|
||||
// Load new skin
|
||||
if(hasFile(L"TexturePack.xzp"))
|
||||
{
|
||||
const DWORD LOCATOR_SIZE = 256; // Use this to allocate space to hold a ResourceLocator string
|
||||
static const int LOCATOR_SIZE = 256; // Use this to allocate space to hold a ResourceLocator string
|
||||
WCHAR szResourceLocator[ LOCATOR_SIZE ];
|
||||
|
||||
swprintf(szResourceLocator, LOCATOR_SIZE,L"file://%lsTexturePack.xzp#skin_Minecraft.xur",getPath().c_str());
|
||||
|
||||
Reference in New Issue
Block a user