Renamed and added functions

Renamed functions with skin offset or model offset in there name to have skin adjustment instead. Added two functions in Player.cpp and Player.h to handle model types for player. Altered getModel() function in EntityRenderer.h and moved fuctionallity to EntityRenderer.cpp. Optimized write() function in TextureAndGeometryPacket.cpp with __fastcall (prevents crashes in multiplayer when instances are running on the same PC).
This commit is contained in:
Langtanium 2026-05-06 12:01:37 -07:00
parent 878547dec8
commit e8064d2ee3
21 changed files with 280 additions and 294 deletions

View file

@ -891,10 +891,10 @@ void PlayerConnection::handleTextureAndGeometry(shared_ptr<TextureAndGeometryPac
{
// we don't have the dlc skin, so retrieve the data from the app store
vector<SKIN_BOX *> *pvSkinBoxes = app.GetAdditionalSkinBoxes(packet->dwSkinID);
vector<SKIN_OFFSET *> *pvSkinOffsets = app.GetModelOffsets(packet->dwSkinID);
vector<SKIN_OFFSET *> *pvSkinAdjustments = app.GetSkinAdjustments(packet->dwSkinID);
unsigned int uiAnimOverrideBitmask= app.GetAnimOverrideBitmask(packet->dwSkinID);
send(std::make_shared<TextureAndGeometryPacket>(packet->textureName, pbData, dwTextureBytes, pvSkinBoxes, pvSkinOffsets, uiAnimOverrideBitmask));
send(std::make_shared<TextureAndGeometryPacket>(packet->textureName, pbData, dwTextureBytes, pvSkinBoxes, pvSkinAdjustments, uiAnimOverrideBitmask));
}
}
else
@ -924,7 +924,7 @@ void PlayerConnection::handleTextureAndGeometry(shared_ptr<TextureAndGeometryPac
#ifndef _CONTENT_PACKAGE
wprintf(L"Adding skin offsets for skin id %X, offset count %d\n",packet->dwSkinID,packet->dwOffsetC);
#endif
app.SetSkinOffsets(packet->dwSkinID,packet->OffsetDataA,packet->dwOffsetC);
app.SetSkinAdjustments(packet->dwSkinID,packet->OffsetDataA,packet->dwOffsetC);
}
// Add the anim override
app.SetAnimOverrideBitmask(packet->dwSkinID,packet->uiAnimOverrideBitmask);
@ -975,7 +975,7 @@ void PlayerConnection::handleTextureAndGeometryReceived(const wstring &textureNa
// get the data from the app
DWORD dwSkinID = app.getSkinIdFromPath(textureName);
vector<SKIN_BOX *> *pvSkinBoxes = app.GetAdditionalSkinBoxes(dwSkinID);
vector<SKIN_OFFSET *> *pvSkinOffsets = app.GetModelOffsets(dwSkinID);
vector<SKIN_OFFSET *> *pvSkinOffsets = app.GetSkinAdjustments(dwSkinID);
unsigned int uiAnimOverrideBitmask= app.GetAnimOverrideBitmask(dwSkinID);
send(std::make_shared<TextureAndGeometryPacket>(textureName, pbData, dwTextureBytes, pvSkinBoxes, pvSkinOffsets, uiAnimOverrideBitmask));