aboutsummaryrefslogtreecommitdiff
path: root/Minecraft.Client/HumanoidModel.cpp
diff options
context:
space:
mode:
authorModMaker101 <119018978+ModMaker101@users.noreply.github.com>2026-03-08 19:08:36 -0400
committerGitHub <noreply@github.com>2026-03-08 18:08:36 -0500
commit28614b922fb77149a54da1a87bebfbc98736f296 (patch)
tree7f828ba86a4ee18d0a80d29de64f6199a5412512 /Minecraft.Client/HumanoidModel.cpp
parent88798b501d0cf6287b6f87acb2592676e3cec58d (diff)
Modernize project codebase (#906)
* Fixed boats falling and a TP glitch #266 * Replaced every C-style cast with C++ ones * Replaced every C-style cast with C++ ones * Fixed boats falling and a TP glitch #266 * Updated NULL to nullptr and fixing some type issues * Modernized and fixed a few bugs - Replaced most instances of `NULL` with `nullptr`. - Replaced most `shared_ptr(new ...)` with `make_shared`. - Removed the `nullptr` macro as it was interfering with the actual nullptr keyword in some instances. * Fixing more conflicts * Replace int loops with size_t and start work on overrides * Add safety checks and fix a issue with vector going OOR
Diffstat (limited to 'Minecraft.Client/HumanoidModel.cpp')
-rw-r--r--Minecraft.Client/HumanoidModel.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/Minecraft.Client/HumanoidModel.cpp b/Minecraft.Client/HumanoidModel.cpp
index 05d132fa..c6c6b9f4 100644
--- a/Minecraft.Client/HumanoidModel.cpp
+++ b/Minecraft.Client/HumanoidModel.cpp
@@ -8,7 +8,7 @@
ModelPart * HumanoidModel::AddOrRetrievePart(SKIN_BOX *pBox)
{
- ModelPart *pAttachTo=NULL;
+ ModelPart *pAttachTo=nullptr;
switch(pBox->ePart)
{
@@ -37,17 +37,17 @@ ModelPart * HumanoidModel::AddOrRetrievePart(SKIN_BOX *pBox)
if(pNewBox)
{
- if((pNewBox->getfU()!=(int)pBox->fU) || (pNewBox->getfV()!=(int)pBox->fV))
+ if((pNewBox->getfU()!=static_cast<int>(pBox->fU)) || (pNewBox->getfV()!=static_cast<int>(pBox->fV)))
{
app.DebugPrintf("HumanoidModel::AddOrRetrievePart - Box geometry was found, but with different uvs\n");
- pNewBox=NULL;
+ pNewBox=nullptr;
}
}
- if(pNewBox==NULL)
+ if(pNewBox==nullptr)
{
//app.DebugPrintf("HumanoidModel::AddOrRetrievePart - Adding box to model part\n");
- pNewBox = new ModelPart(this, (int)pBox->fU, (int)pBox->fV);
+ pNewBox = new ModelPart(this, static_cast<int>(pBox->fU), static_cast<int>(pBox->fV));
pNewBox->visible=false;
pNewBox->addHumanoidBox(pBox->fX, pBox->fY, pBox->fZ, pBox->fW, pBox->fH, pBox->fD, 0);
// 4J-PB - don't compile here, since the lighting isn't set up. It'll be compiled on first use.
@@ -142,7 +142,7 @@ HumanoidModel::HumanoidModel(float g, float yOffset, int texWidth, int texHeight
void HumanoidModel::render(shared_ptr<Entity> entity, float time, float r, float bob, float yRot, float xRot, float scale, bool usecompiled)
{
- if(entity != NULL)
+ if(entity != nullptr)
{
m_uiAnimOverrideBitmask=entity->getAnimOverrideBitmask();
}