From 85ddd0cca0acf3424c05bcfe11299939c6adb33a Mon Sep 17 00:00:00 2001 From: notmatthewbeshay <92357869+NotMachow@users.noreply.github.com> Date: Tue, 10 Mar 2026 02:18:43 +1100 Subject: [PATCH] Remove Win32 byte types from texture and geometry packets --- .../Packets/TextureAndGeometryPacket.cpp | 28 +++++++++---------- .../Packets/TextureAndGeometryPacket.h | 14 +++++----- 2 files changed, 21 insertions(+), 21 deletions(-) diff --git a/Minecraft.World/Network/Packets/TextureAndGeometryPacket.cpp b/Minecraft.World/Network/Packets/TextureAndGeometryPacket.cpp index 029daa1a6..131d42775 100644 --- a/Minecraft.World/Network/Packets/TextureAndGeometryPacket.cpp +++ b/Minecraft.World/Network/Packets/TextureAndGeometryPacket.cpp @@ -30,7 +30,7 @@ TextureAndGeometryPacket::~TextureAndGeometryPacket() // } } -TextureAndGeometryPacket::TextureAndGeometryPacket(const std::wstring &textureName, PBYTE pbData, DWORD dwBytes) +TextureAndGeometryPacket::TextureAndGeometryPacket(const std::wstring &textureName, std::uint8_t *pbData, std::uint32_t dataBytes) { this->textureName = textureName; @@ -41,13 +41,13 @@ TextureAndGeometryPacket::TextureAndGeometryPacket(const std::wstring &textureNa ss >> this->dwSkinID; this->dwSkinID = MAKE_SKIN_BITMASK(true, this->dwSkinID); this->pbData = pbData; - this->dwTextureBytes = dwBytes; + this->dwTextureBytes = dataBytes; this->dwBoxC = 0; this->BoxDataA=NULL; this->uiAnimOverrideBitmask=0; } -TextureAndGeometryPacket::TextureAndGeometryPacket(const std::wstring &textureName, PBYTE pbData, DWORD dwBytes, DLCSkinFile *pDLCSkinFile) +TextureAndGeometryPacket::TextureAndGeometryPacket(const std::wstring &textureName, std::uint8_t *pbData, std::uint32_t dataBytes, DLCSkinFile *pDLCSkinFile) { this->textureName = textureName; @@ -59,7 +59,7 @@ TextureAndGeometryPacket::TextureAndGeometryPacket(const std::wstring &textureNa this->dwSkinID = MAKE_SKIN_BITMASK(true, this->dwSkinID); this->pbData = pbData; - this->dwTextureBytes = dwBytes; + this->dwTextureBytes = dataBytes; this->uiAnimOverrideBitmask = pDLCSkinFile->getAnimOverrideBitmask(); this->dwBoxC = pDLCSkinFile->getAdditionalBoxesCount(); if(this->dwBoxC!=0) @@ -80,7 +80,7 @@ TextureAndGeometryPacket::TextureAndGeometryPacket(const std::wstring &textureNa } } -TextureAndGeometryPacket::TextureAndGeometryPacket(const std::wstring &textureName, PBYTE pbData, DWORD dwBytes,std::vector *pvSkinBoxes, unsigned int uiAnimOverrideBitmask) +TextureAndGeometryPacket::TextureAndGeometryPacket(const std::wstring &textureName, std::uint8_t *pbData, std::uint32_t dataBytes,std::vector *pvSkinBoxes, unsigned int uiAnimOverrideBitmask) { this->textureName = textureName; @@ -92,7 +92,7 @@ TextureAndGeometryPacket::TextureAndGeometryPacket(const std::wstring &textureNa this->dwSkinID = MAKE_SKIN_BITMASK(true, this->dwSkinID); this->pbData = pbData; - this->dwTextureBytes = dwBytes; + this->dwTextureBytes = dataBytes; this->uiAnimOverrideBitmask = uiAnimOverrideBitmask; if(pvSkinBoxes==NULL) { @@ -101,7 +101,7 @@ TextureAndGeometryPacket::TextureAndGeometryPacket(const std::wstring &textureNa } else { - this->dwBoxC = (DWORD)pvSkinBoxes->size(); + this->dwBoxC = (std::uint32_t)pvSkinBoxes->size(); this->BoxDataA= new SKIN_BOX [this->dwBoxC]; int iCount=0; @@ -123,27 +123,27 @@ void TextureAndGeometryPacket::read(DataInputStream *dis) //throws IOException { textureName = dis->readUTF(); dwSkinID = (DWORD)dis->readInt(); - dwTextureBytes = (DWORD)dis->readShort(); + dwTextureBytes = (std::uint32_t)dis->readShort(); if(dwTextureBytes>0) { - this->pbData= new BYTE [dwTextureBytes]; + this->pbData= new std::uint8_t [dwTextureBytes]; - for(DWORD i=0;ipbData[i] = dis->readByte(); } } uiAnimOverrideBitmask = dis->readInt(); - dwBoxC = (DWORD)dis->readShort(); + dwBoxC = (std::uint32_t)dis->readShort(); if(dwBoxC>0) { this->BoxDataA= new SKIN_BOX [dwBoxC]; } - for(DWORD i=0;iBoxDataA[i].ePart = (eBodyPart) dis->readShort(); this->BoxDataA[i].fX = dis->readFloat(); @@ -162,14 +162,14 @@ void TextureAndGeometryPacket::write(DataOutputStream *dos) //throws IOException dos->writeUTF(textureName); dos->writeInt(dwSkinID); dos->writeShort((short)dwTextureBytes); - for(DWORD i=0;iwriteByte(this->pbData[i]); } dos->writeInt(uiAnimOverrideBitmask); dos->writeShort((short)dwBoxC); - for(DWORD i=0;iwriteShort((short)this->BoxDataA[i].ePart); dos->writeFloat(this->BoxDataA[i].fX); diff --git a/Minecraft.World/Network/Packets/TextureAndGeometryPacket.h b/Minecraft.World/Network/Packets/TextureAndGeometryPacket.h index f1ca1f7cb..9ff7e6930 100644 --- a/Minecraft.World/Network/Packets/TextureAndGeometryPacket.h +++ b/Minecraft.World/Network/Packets/TextureAndGeometryPacket.h @@ -1,5 +1,5 @@ #pragma once - +#include #include "Packet.h" #include "../../../Minecraft.Client/Rendering/Models/Model.h" @@ -12,17 +12,17 @@ class TextureAndGeometryPacket : public Packet, public std::enable_shared_from_t public: std::wstring textureName; DWORD dwSkinID; - PBYTE pbData; - DWORD dwTextureBytes; + std::uint8_t *pbData; + std::uint32_t dwTextureBytes; SKIN_BOX *BoxDataA; - DWORD dwBoxC; + std::uint32_t dwBoxC; unsigned int uiAnimOverrideBitmask; TextureAndGeometryPacket(); ~TextureAndGeometryPacket(); - TextureAndGeometryPacket(const std::wstring &textureName, PBYTE pbData, DWORD dwBytes); - TextureAndGeometryPacket(const std::wstring &textureName, PBYTE pbData, DWORD dwBytes, DLCSkinFile *pDLCSkinFile); - TextureAndGeometryPacket(const std::wstring &textureName, PBYTE pbData, DWORD dwBytes, std::vector *pvSkinBoxes, unsigned int uiAnimOverrideBitmask); + TextureAndGeometryPacket(const std::wstring &textureName, std::uint8_t *pbData, std::uint32_t dataBytes); + TextureAndGeometryPacket(const std::wstring &textureName, std::uint8_t *pbData, std::uint32_t dataBytes, DLCSkinFile *pDLCSkinFile); + TextureAndGeometryPacket(const std::wstring &textureName, std::uint8_t *pbData, std::uint32_t dataBytes, std::vector *pvSkinBoxes, unsigned int uiAnimOverrideBitmask); virtual void handle(PacketListener *listener); virtual void read(DataInputStream *dis);