mirror of
https://github.com/4jcraft/4jcraft.git
synced 2026-07-24 06:17:06 +00:00
Use standard sizes in texture pack locators
This commit is contained in:
parent
d48bd03722
commit
e5d5fb07be
|
|
@ -40,13 +40,13 @@ void AbstractTexturePack::loadIcon()
|
||||||
{
|
{
|
||||||
#ifdef _XBOX
|
#ifdef _XBOX
|
||||||
// 4J Stu - Temporary only
|
// 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 ];
|
WCHAR szResourceLocator[ LOCATOR_SIZE ];
|
||||||
|
|
||||||
const ULONG_PTR c_ModuleHandle = (ULONG_PTR)GetModuleHandle(NULL);
|
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");
|
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);
|
HRESULT hr = XuiResourceLoadAllNoLoc(szResourceLocator, &m_iconData, &size);
|
||||||
m_iconSize = static_cast<std::uint32_t>(size);
|
m_iconSize = static_cast<std::uint32_t>(size);
|
||||||
#endif
|
#endif
|
||||||
|
|
@ -56,13 +56,13 @@ void AbstractTexturePack::loadComparison()
|
||||||
{
|
{
|
||||||
#ifdef _XBOX
|
#ifdef _XBOX
|
||||||
// 4J Stu - Temporary only
|
// 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 ];
|
WCHAR szResourceLocator[ LOCATOR_SIZE ];
|
||||||
|
|
||||||
const ULONG_PTR c_ModuleHandle = (ULONG_PTR)GetModuleHandle(NULL);
|
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");
|
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);
|
HRESULT hr = XuiResourceLoadAllNoLoc(szResourceLocator, &m_comparisonData, &size);
|
||||||
m_comparisonSize = static_cast<std::uint32_t>(size);
|
m_comparisonSize = static_cast<std::uint32_t>(size);
|
||||||
#endif
|
#endif
|
||||||
|
|
@ -232,7 +232,7 @@ void AbstractTexturePack::loadDefaultUI()
|
||||||
const ULONG_PTR c_ModuleHandle = (ULONG_PTR)GetModuleHandle(NULL);
|
const ULONG_PTR c_ModuleHandle = (ULONG_PTR)GetModuleHandle(NULL);
|
||||||
|
|
||||||
// Load new skin
|
// 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 ];
|
WCHAR szResourceLocator[ LOCATOR_SIZE ];
|
||||||
|
|
||||||
swprintf(szResourceLocator, LOCATOR_SIZE,L"section://%X,%ls#%ls",c_ModuleHandle,L"media", L"media/skin_Minecraft.xur");
|
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
|
// load from the .xzp file
|
||||||
const ULONG_PTR c_ModuleHandle = (ULONG_PTR)GetModuleHandle(NULL);
|
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 ];
|
WCHAR szResourceLocator[ LOCATOR_SIZE ];
|
||||||
|
|
||||||
// Try and load the HTMLColours.col based off the common XML first, before the deprecated xuiscene_colourtable
|
// 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");
|
wsprintfW(szResourceLocator,L"section://%X,%s#%s",c_ModuleHandle,L"media", L"media/HTMLColours.col");
|
||||||
BYTE *data;
|
std::uint8_t *data;
|
||||||
UINT dataLength;
|
unsigned int dataLength;
|
||||||
if(XuiResourceLoadAll(szResourceLocator, &data, &dataLength) == S_OK)
|
if(XuiResourceLoadAll(szResourceLocator, &data, &dataLength) == S_OK)
|
||||||
{
|
{
|
||||||
m_colourTable->loadColoursFromData(data,dataLength);
|
m_colourTable->loadColoursFromData(data,dataLength);
|
||||||
|
|
@ -376,7 +376,7 @@ std::wstring AbstractTexturePack::getXuiRootPath()
|
||||||
const ULONG_PTR c_ModuleHandle = (ULONG_PTR)GetModuleHandle(NULL);
|
const ULONG_PTR c_ModuleHandle = (ULONG_PTR)GetModuleHandle(NULL);
|
||||||
|
|
||||||
// Load new skin
|
// 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 ];
|
WCHAR szResourceLocator[ LOCATOR_SIZE ];
|
||||||
|
|
||||||
swprintf(szResourceLocator, LOCATOR_SIZE,L"section://%X,%ls#%ls",c_ModuleHandle,L"media", L"media/");
|
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::uint32_t dwSize = 0;
|
||||||
std::uint8_t *pbData = dataFile->getData(dwSize);
|
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 ];
|
WCHAR szResourceLocator[ LOCATOR_SIZE ];
|
||||||
|
|
||||||
// Try and load the HTMLColours.col based off the common XML first, before the deprecated xuiscene_colourtable
|
// 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);
|
swprintf(szResourceLocator, LOCATOR_SIZE,L"memory://%08X,%04X#HTMLColours.col",pbData, dwSize);
|
||||||
BYTE *data;
|
std::uint8_t *data;
|
||||||
UINT dataLength;
|
unsigned int dataLength;
|
||||||
if(XuiResourceLoadAll(szResourceLocator, &data, &dataLength) == S_OK)
|
if(XuiResourceLoadAll(szResourceLocator, &data, &dataLength) == S_OK)
|
||||||
{
|
{
|
||||||
m_colourTable->loadColoursFromData(data,dataLength);
|
m_colourTable->loadColoursFromData(data,dataLength);
|
||||||
|
|
@ -483,7 +483,7 @@ void DLCTexturePack::loadUI()
|
||||||
std::uint32_t dwSize = 0;
|
std::uint32_t dwSize = 0;
|
||||||
std::uint8_t *pbData = dataFile->getData(dwSize);
|
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 ];
|
WCHAR szResourceLocator[ LOCATOR_SIZE ];
|
||||||
swprintf(szResourceLocator, LOCATOR_SIZE,L"memory://%08X,%04X#skin_Minecraft.xur",pbData, dwSize);
|
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::uint32_t dwSize = 0;
|
||||||
std::uint8_t *pbData = dataFile->getData(dwSize);
|
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 ];
|
WCHAR szResourceLocator[ LOCATOR_SIZE ];
|
||||||
swprintf(szResourceLocator, LOCATOR_SIZE,L"memory://%08X,%04X#",pbData, dwSize);
|
swprintf(szResourceLocator, LOCATOR_SIZE,L"memory://%08X,%04X#",pbData, dwSize);
|
||||||
path = szResourceLocator;
|
path = szResourceLocator;
|
||||||
|
|
|
||||||
|
|
@ -17,13 +17,13 @@ void DefaultTexturePack::loadIcon()
|
||||||
{
|
{
|
||||||
#ifdef _XBOX
|
#ifdef _XBOX
|
||||||
// 4J Stu - Temporary only
|
// 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 ];
|
WCHAR szResourceLocator[ LOCATOR_SIZE ];
|
||||||
|
|
||||||
const ULONG_PTR c_ModuleHandle = (ULONG_PTR)GetModuleHandle(NULL);
|
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");
|
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);
|
HRESULT hr = XuiResourceLoadAllNoLoc(szResourceLocator, &m_iconData, &size);
|
||||||
m_iconSize = size;
|
m_iconSize = size;
|
||||||
#else
|
#else
|
||||||
|
|
|
||||||
|
|
@ -79,7 +79,7 @@ void FolderTexturePack::loadUI()
|
||||||
// Load new skin
|
// Load new skin
|
||||||
if(hasFile(L"TexturePack.xzp"))
|
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 ];
|
WCHAR szResourceLocator[ LOCATOR_SIZE ];
|
||||||
|
|
||||||
swprintf(szResourceLocator, LOCATOR_SIZE,L"file://%lsTexturePack.xzp#skin_Minecraft.xur",getPath().c_str());
|
swprintf(szResourceLocator, LOCATOR_SIZE,L"file://%lsTexturePack.xzp#skin_Minecraft.xur",getPath().c_str());
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue