Use standard buffer types for in-memory textures

This commit is contained in:
notmatthewbeshay 2026-03-10 19:53:51 +11:00
parent c4947ce99a
commit 37aa3463be
8 changed files with 34 additions and 30 deletions

View file

@ -2241,8 +2241,8 @@ void ClientConnection::handleTexture(std::shared_ptr<TexturePacket> packet)
#ifndef _CONTENT_PACKAGE
wprintf(L"Client received request for custom texture %ls\n",packet->textureName.c_str());
#endif
PBYTE pbData=NULL;
DWORD dwBytes=0;
std::uint8_t *pbData=NULL;
unsigned int dwBytes=0;
app.GetMemFileDetails(packet->textureName,&pbData,&dwBytes);
if(dwBytes!=0)
@ -2273,8 +2273,8 @@ void ClientConnection::handleTextureAndGeometry(std::shared_ptr<TextureAndGeomet
#ifndef _CONTENT_PACKAGE
wprintf(L"Client received request for custom texture and geometry %ls\n",packet->textureName.c_str());
#endif
PBYTE pbData=NULL;
DWORD dwBytes=0;
std::uint8_t *pbData=NULL;
unsigned int dwBytes=0;
app.GetMemFileDetails(packet->textureName,&pbData,&dwBytes);
DLCSkinFile *pDLCSkinFile = app.m_dlcManager.getSkinFile(packet->textureName);

View file

@ -802,8 +802,8 @@ void PlayerConnection::handleTexture(std::shared_ptr<TexturePacket> packet)
#ifndef _CONTENT_PACKAGE
wprintf(L"Server received request for custom texture %ls\n",packet->textureName.c_str());
#endif
PBYTE pbData=NULL;
DWORD dwBytes=0;
std::uint8_t *pbData=NULL;
unsigned int dwBytes=0;
app.GetMemFileDetails(packet->textureName,&pbData,&dwBytes);
if(dwBytes!=0)
@ -836,8 +836,8 @@ void PlayerConnection::handleTextureAndGeometry(std::shared_ptr<TextureAndGeomet
#ifndef _CONTENT_PACKAGE
wprintf(L"Server received request for custom texture %ls\n",packet->textureName.c_str());
#endif
PBYTE pbData=NULL;
DWORD dwTextureBytes=0;
std::uint8_t *pbData=NULL;
unsigned int dwTextureBytes=0;
app.GetMemFileDetails(packet->textureName,&pbData,&dwTextureBytes);
DLCSkinFile *pDLCSkinFile = app.m_dlcManager.getSkinFile(packet->textureName);
@ -900,8 +900,8 @@ void PlayerConnection::handleTextureReceived(const std::wstring &textureName)
AUTO_VAR(it, find( m_texturesRequested.begin(), m_texturesRequested.end(), textureName ));
if( it != m_texturesRequested.end() )
{
PBYTE pbData=NULL;
DWORD dwBytes=0;
std::uint8_t *pbData=NULL;
unsigned int dwBytes=0;
app.GetMemFileDetails(textureName,&pbData,&dwBytes);
if(dwBytes!=0)
@ -918,8 +918,8 @@ void PlayerConnection::handleTextureAndGeometryReceived(const std::wstring &text
AUTO_VAR(it, find( m_texturesRequested.begin(), m_texturesRequested.end(), textureName ));
if( it != m_texturesRequested.end() )
{
PBYTE pbData=NULL;
DWORD dwTextureBytes=0;
std::uint8_t *pbData=NULL;
unsigned int dwTextureBytes=0;
app.GetMemFileDetails(textureName,&pbData,&dwTextureBytes);
DLCSkinFile *pDLCSkinFile=app.m_dlcManager.getSkinFile(textureName);

View file

@ -1,5 +1,7 @@
#pragma once
#include <cstdint>
typedef struct
{
wchar_t *wchFilename;
@ -13,9 +15,9 @@ TMS_FILE;
typedef struct
{
PBYTE pbData;
DWORD dwBytes;
BYTE ucRefCount;
std::uint8_t *pbData;
unsigned int dwBytes;
std::uint8_t ucRefCount;
}
MEMDATA,*PMEMDATA;

View file

@ -5318,7 +5318,7 @@ bool CMinecraftApp::isXuidDeadmau5(PlayerUID xuid)
return false;
}
void CMinecraftApp::AddMemoryTextureFile(const std::wstring &wName,PBYTE pbData,DWORD dwBytes)
void CMinecraftApp::AddMemoryTextureFile(const std::wstring &wName, std::uint8_t *pbData, unsigned int dwBytes)
{
EnterCriticalSection(&csMemFilesLock);
// check it's not already in
@ -5413,7 +5413,7 @@ bool CMinecraftApp::IsFileInMemoryTextures(const std::wstring &wName)
return val;
}
void CMinecraftApp::GetMemFileDetails(const std::wstring &wName,PBYTE *ppbData,DWORD *pdwBytes)
void CMinecraftApp::GetMemFileDetails(const std::wstring &wName, std::uint8_t **ppbData, unsigned int *pdwBytes)
{
EnterCriticalSection(&csMemFilesLock);
AUTO_VAR(it, m_MEM_Files.find(wName));

View file

@ -1,5 +1,7 @@
#pragma once
#include <cstdint>
//using namespace std;
#include "Audio/Consoles_SoundEngine.h"
@ -339,9 +341,9 @@ public:
bool isXuidNotch(PlayerUID xuid);
bool isXuidDeadmau5(PlayerUID xuid);
void AddMemoryTextureFile(const std::wstring &wName, PBYTE pbData, DWORD dwBytes);
void AddMemoryTextureFile(const std::wstring &wName, std::uint8_t *pbData, unsigned int dwBytes);
void RemoveMemoryTextureFile(const std::wstring &wName);
void GetMemFileDetails(const std::wstring &wName,PBYTE *ppbData,DWORD *pdwBytes);
void GetMemFileDetails(const std::wstring &wName, std::uint8_t **ppbData, unsigned int *pdwBytes);
bool IsFileInMemoryTextures(const std::wstring &wName);
// Texture Pack Data files (icon, banner, comparison shot & text)

View file

@ -855,8 +855,8 @@ bool UIScene_DLCOffersMenu::UpdateDisplay(MARKETPLACE_CONTENTOFFER_INFO& xOffer)
{
if(hasRegisteredSubstitutionTexture(cString)==false)
{
BYTE *pData=NULL;
DWORD dwSize=0;
std::uint8_t *pData=NULL;
unsigned int dwSize=0;
app.GetMemFileDetails(cString,&pData,&dwSize);
// set the image
#ifdef _XBOX_ONE
@ -920,4 +920,4 @@ void UIScene_DLCOffersMenu::HandleDLCInstalled()
//}
#endif
#endif

View file

@ -449,9 +449,9 @@ HRESULT CScene_DLCOffers::GetDLCInfo( int iOfferC, bool bUpdateOnly )
DLC_INFO *dlc = app.GetDLCInfoForFullOfferID(xOffer.qwOfferID);
if (dlc != NULL)
{
BYTE *pData=NULL;
std::uint8_t *pData=NULL;
UINT uiSize=0;
DWORD dwSize=0;
unsigned int dwSize=0;
WCHAR *cString = dlc->wchBanner;
// is the file in the TMS XZP?
@ -702,9 +702,9 @@ HRESULT CScene_DLCOffers::OnNotifySelChanged(HXUIOBJ hObjSource, XUINotifySelCha
if (dlc != NULL)
{
BYTE *pImage=NULL;
std::uint8_t *pImage=NULL;
UINT uiSize=0;
DWORD dwSize=0;
unsigned int dwSize=0;
WCHAR *cString = dlc->wchBanner;
@ -811,8 +811,8 @@ HRESULT CScene_DLCOffers::OnTimer(XUIMessageTimer *pData,BOOL& rfHandled)
if(bPresent)
{
BYTE *pImage=NULL;
DWORD dwSize=0;
std::uint8_t *pImage=NULL;
unsigned int dwSize=0;
if(m_hXuiBrush!=NULL)
{

View file

@ -1014,8 +1014,8 @@ MemTexture *Textures::addMemTexture(const std::wstring& name,MemTextureProcessor
if(texture == NULL)
{
// can we find it in the app mem files?
PBYTE pbData=NULL;
DWORD dwBytes=0;
std::uint8_t *pbData=NULL;
unsigned int dwBytes=0;
app.GetMemFileDetails(name,&pbData,&dwBytes);
if(dwBytes!=0)