From 55231bb8d3e1a4e2752ac3d444c4287eb0ca4e8b Mon Sep 17 00:00:00 2001 From: void_17 <61356189+void2012@users.noreply.github.com> Date: Fri, 6 Mar 2026 02:11:18 +0700 Subject: Remove AUTO_VAR macro and _toString function (#592) --- Minecraft.World/TextureAndGeometryPacket.cpp | 28 +++++++++++++--------------- 1 file changed, 13 insertions(+), 15 deletions(-) (limited to 'Minecraft.World/TextureAndGeometryPacket.cpp') diff --git a/Minecraft.World/TextureAndGeometryPacket.cpp b/Minecraft.World/TextureAndGeometryPacket.cpp index 70f2f516..d28fc862 100644 --- a/Minecraft.World/TextureAndGeometryPacket.cpp +++ b/Minecraft.World/TextureAndGeometryPacket.cpp @@ -6,7 +6,7 @@ -TextureAndGeometryPacket::TextureAndGeometryPacket() +TextureAndGeometryPacket::TextureAndGeometryPacket() { this->textureName = L""; this->dwTextureBytes = 0; @@ -16,21 +16,21 @@ TextureAndGeometryPacket::TextureAndGeometryPacket() uiAnimOverrideBitmask=0; } -TextureAndGeometryPacket::~TextureAndGeometryPacket() +TextureAndGeometryPacket::~TextureAndGeometryPacket() { // can't free these - they're used elsewhere // if(this->BoxDataA!=NULL) // { // delete [] this->BoxDataA; // } -// +// // if(this->pbData!=NULL) // { // delete [] this->pbData; // } } -TextureAndGeometryPacket::TextureAndGeometryPacket(const wstring &textureName, PBYTE pbData, DWORD dwBytes) +TextureAndGeometryPacket::TextureAndGeometryPacket(const wstring &textureName, PBYTE pbData, DWORD dwBytes) { this->textureName = textureName; @@ -47,7 +47,7 @@ TextureAndGeometryPacket::TextureAndGeometryPacket(const wstring &textureName, P this->uiAnimOverrideBitmask=0; } -TextureAndGeometryPacket::TextureAndGeometryPacket(const wstring &textureName, PBYTE pbData, DWORD dwBytes, DLCSkinFile *pDLCSkinFile) +TextureAndGeometryPacket::TextureAndGeometryPacket(const wstring &textureName, PBYTE pbData, DWORD dwBytes, DLCSkinFile *pDLCSkinFile) { this->textureName = textureName; @@ -68,11 +68,10 @@ TextureAndGeometryPacket::TextureAndGeometryPacket(const wstring &textureName, P vector *pSkinBoxes=pDLCSkinFile->getAdditionalBoxes(); int iCount=0; - for(AUTO_VAR(it, pSkinBoxes->begin());it != pSkinBoxes->end(); ++it) + for(auto& pSkinBox : *pSkinBoxes) { - SKIN_BOX *pSkinBox=*it; this->BoxDataA[iCount++]=*pSkinBox; - } + } } else { @@ -80,7 +79,7 @@ TextureAndGeometryPacket::TextureAndGeometryPacket(const wstring &textureName, P } } -TextureAndGeometryPacket::TextureAndGeometryPacket(const wstring &textureName, PBYTE pbData, DWORD dwBytes,vector *pvSkinBoxes, unsigned int uiAnimOverrideBitmask) +TextureAndGeometryPacket::TextureAndGeometryPacket(const wstring &textureName, PBYTE pbData, DWORD dwBytes,vector *pvSkinBoxes, unsigned int uiAnimOverrideBitmask) { this->textureName = textureName; @@ -105,16 +104,15 @@ TextureAndGeometryPacket::TextureAndGeometryPacket(const wstring &textureName, P this->BoxDataA= new SKIN_BOX [this->dwBoxC]; int iCount=0; - for(AUTO_VAR(it, pvSkinBoxes->begin());it != pvSkinBoxes->end(); ++it) + for(auto& pSkinBox : *pvSkinBoxes) { - SKIN_BOX *pSkinBox=*it; this->BoxDataA[iCount++]=*pSkinBox; - } + } } } -void TextureAndGeometryPacket::handle(PacketListener *listener) +void TextureAndGeometryPacket::handle(PacketListener *listener) { listener->handleTextureAndGeometry(shared_from_this()); } @@ -157,7 +155,7 @@ void TextureAndGeometryPacket::read(DataInputStream *dis) //throws IOException } } -void TextureAndGeometryPacket::write(DataOutputStream *dos) //throws IOException +void TextureAndGeometryPacket::write(DataOutputStream *dos) //throws IOException { dos->writeUTF(textureName); dos->writeInt(dwSkinID); @@ -183,7 +181,7 @@ void TextureAndGeometryPacket::write(DataOutputStream *dos) //throws IOException } } -int TextureAndGeometryPacket::getEstimatedSize() +int TextureAndGeometryPacket::getEstimatedSize() { return 4096+ +sizeof(int) + sizeof(float)*8*4; } -- cgit v1.2.3