Check if skin texture height is 64 or 32, slim skins, better slim skins parameters, zombie villager fix.

Co-authored-by: ItzSonicFaner <165782267+ItzSonicFaner@users.noreply.github.com>
Reviewed-on: https://codeberg.org/piebot/LegacyEvolved/pulls/1
Co-authored-by: ItzSonicFaner <itzsonicfaner@noreply.codeberg.org>
Co-committed-by: ItzSonicFaner <itzsonicfaner@noreply.codeberg.org>
This commit is contained in:
ItzSonicFaner 2026-03-27 15:35:15 +01:00 committed by neoapps-dev
parent 3919152a95
commit 84c228e80f
54 changed files with 983 additions and 103 deletions

View file

@ -8,7 +8,9 @@
#include "../../ModelPart.h"
#include "../../Options.h"
#include "../../../Minecraft.World/net.minecraft.world.entity.player.h"
#include "Skins.h"
#include "UIControl_PlayerSkinPreview.h"
#include <string>
//#define SKIN_PREVIEW_BOB_ANIM
#define SKIN_PREVIEW_WALKING_ANIM
@ -257,7 +259,24 @@ void UIControl_PlayerSkinPreview::render(EntityRenderer *renderer, double x, dou
glPushMatrix();
glDisable(GL_CULL_FACE);
HumanoidModel *model = static_cast<HumanoidModel *>(renderer->getModel());
HumanoidModel *model;
Textures *textures = Minecraft::GetInstance()->textures;
int skinId = textures->loadMemTexture(m_customTextureUrl, m_backupTexture) - 37;
if (slim[skinId] == true)
{
if (textures->getHeight(m_customTextureUrl, m_backupTexture) == 64)
model = static_cast<HumanoidModel *>(renderer->getNewModelSlim());
else if (textures->getHeight(m_customTextureUrl, m_backupTexture) == 32)
model = static_cast<HumanoidModel *>(renderer->getModelSlim());
}
else
{
if (textures->getHeight(m_customTextureUrl, m_backupTexture) == 64)
model = static_cast<HumanoidModel *>(renderer->getNewModel());
else if (textures->getHeight(m_customTextureUrl, m_backupTexture) == 32)
model = static_cast<HumanoidModel *>(renderer->getModel());
}
//getAttackAnim(mob, a);
//if (armor != nullptr) armor->attackTime = model->attackTime;

View file

@ -24,6 +24,16 @@ const WCHAR *UIScene_SkinSelectMenu::wchDefaultNamesA[]=
L"Prisoner Steve",
L"Cyclist Steve",
L"Boxer Steve",
L"Developer Steve",
L"Alex",
L"Tuxedo Alex",
L"Boxer Alex",
L"Prisoner Alex",
L"Tennis Alex",
L"Cyclist Alex",
L"Athlete Alex",
L"Swedish Alex",
L"Developer Alex",
};
UIScene_SkinSelectMenu::UIScene_SkinSelectMenu(int iPad, void *initData, UILayer *parentLayer) : UIScene(iPad, parentLayer)
@ -993,6 +1003,36 @@ TEXTURE_NAME UIScene_SkinSelectMenu::getTextureId(int skinIndex)
case eDefaultSkins_Skin7:
texture = TN_MOB_CHAR7;
break;
case eDefaultSkins_Skin8:
texture = TN_MOB_CHAR8;
break;
case eDefaultSkins_Skin9:
texture = TN_MOB_CHAR9;
break;
case eDefaultSkins_Skin10:
texture = TN_MOB_CHAR10;
break;
case eDefaultSkins_Skin11:
texture = TN_MOB_CHAR11;
break;
case eDefaultSkins_Skin12:
texture = TN_MOB_CHAR12;
break;
case eDefaultSkins_Skin13:
texture = TN_MOB_CHAR13;
break;
case eDefaultSkins_Skin14:
texture = TN_MOB_CHAR14;
break;
case eDefaultSkins_Skin15:
texture = TN_MOB_CHAR15;
break;
case eDefaultSkins_Skin16:
texture = TN_MOB_CHAR16;
break;
case eDefaultSkins_Skin17:
texture = TN_MOB_CHAR17;
break;
};
return texture;

View file

@ -192,4 +192,4 @@ private:
#ifdef __PSVITA__
CRITICAL_SECTION m_DLCInstallCS; // to prevent a race condition between the install and the mounted callback
#endif
};
};

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.2 KiB

After

Width:  |  Height:  |  Size: 4.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.1 KiB

After

Width:  |  Height:  |  Size: 4.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.5 KiB

After

Width:  |  Height:  |  Size: 4.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.2 KiB

After

Width:  |  Height:  |  Size: 4.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.4 KiB

After

Width:  |  Height:  |  Size: 4.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.3 KiB

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

View file

@ -19,6 +19,9 @@ ResourceLocation EntityRenderer::SHADOW_LOCATION = ResourceLocation(TN__CLAMP__M
EntityRenderer::EntityRenderer()
{
model = nullptr;
modelSlim = nullptr;
newModel = nullptr;
newModelSlim = nullptr;
tileRenderer = new TileRenderer();
shadowRadius = 0;
shadowStrength = 1.0f;

View file

@ -30,6 +30,9 @@ private:
protected:
Model *model; // TODO 4J: Check why exactly this is here, it seems to get shadowed by classes inheriting from this by their own
Model *modelSlim;
Model *newModel;
Model *newModelSlim;
protected:
TileRenderer *tileRenderer; // 4J - changed to protected so derived classes can use instead of shadowing their own
@ -68,5 +71,8 @@ public:
public:
// 4J Added
virtual Model *getModel() { return model; }
virtual Model *getModelSlim() { return modelSlim; }
virtual Model *getNewModel() { return newModel; }
virtual Model *getNewModelSlim() { return newModelSlim; }
virtual void SetItemFrame(bool bSet) {}
};

View file

@ -1,7 +1,7 @@
#include "stdafx.h"
#include "HumanoidModel.h"
#include "../Minecraft.World/Mth.h"
#include "../Minecraft.World/Entity.h"
#include "..\Minecraft.World\Mth.h"
#include "..\Minecraft.World\Entity.h"
#include "ModelPart.h"
// 4J added
@ -30,6 +30,21 @@ ModelPart * HumanoidModel::AddOrRetrievePart(SKIN_BOX *pBox)
case eBodyPart_Leg1:
pAttachTo=leg1;
break;
case eBodyPart_Jacket:
pAttachTo=jacket;
break;
case eBodyPart_Sleeve0:
pAttachTo=sleeve0;
break;
case eBodyPart_Sleeve1:
pAttachTo=sleeve1;
break;
case eBodyPart_Pants0:
pAttachTo=pants0;
break;
case eBodyPart_Pants1:
pAttachTo=pants1;
break;
}
// first check this box doesn't already exist
@ -58,11 +73,17 @@ ModelPart * HumanoidModel::AddOrRetrievePart(SKIN_BOX *pBox)
return pNewBox;
}
void HumanoidModel::_init(float g, float yOffset, int texWidth, int texHeight)
void HumanoidModel::_init(float g, float yOffset, int texWidth, int texHeight, bool slimHands, bool mirror, bool force32)
{
this->texWidth = texWidth;
this->texHeight = texHeight;
jacket = nullptr;
sleeve0 = nullptr;
sleeve1 = nullptr;
pants0 = nullptr;
pants1 = nullptr;
m_fYOffset=yOffset;
cloak = new ModelPart(this, 0, 0);
cloak->addHumanoidBox(-5, -0, -1, 10, 16, 1, g); // Cloak
@ -78,28 +99,90 @@ void HumanoidModel::_init(float g, float yOffset, int texWidth, int texHeight)
hair->addHumanoidBox(-4, -8, -4, 8, 8, 8, g + 0.5f); // Head
hair->setPos(0, 0 + yOffset, 0);
if ((texWidth == 64 && texHeight == 64) && !force32)
{
jacket = new ModelPart(this, 16, 32);
jacket->addHumanoidBox(-4, 0, -2, 8, 12, 4, g + 0.5);
jacket->setPos(0, 0 + yOffset, 0);
}
body = new ModelPart(this, 16, 16);
body->addHumanoidBox(-4, 0, -2, 8, 12, 4, g); // Body
body->setPos(0, 0 + yOffset, 0);
arm0 = new ModelPart(this, 24 + 16, 16);
arm0->addHumanoidBox(-3, -2, -2, 4, 12, 4, g); // Arm0
arm0->setPos(-5, 2 + yOffset, 0);
if ((texWidth == 64 && texHeight == 64) && !force32)
{
arm0 = new ModelPart(this, 24 + 16, 16);
arm1 = new ModelPart(this, 16 + 16, 48);
arm1 = new ModelPart(this, 24 + 16, 16);
arm1->bMirror = true;
arm1->addHumanoidBox(-1, -2, -2, 4, 12, 4, g); // Arm1
sleeve0 = new ModelPart(this, 24 + 16, 32);
sleeve1 = new ModelPart(this, 32 + 16, 48);
if (slimHands == false)
{
sleeve0->addHumanoidBox(-3, -2, -2, 4, 12, 4, g + 0.5);
sleeve1->addHumanoidBox(-1, -2, -2, 4, 12, 4, g + 0.5);
}
else if (slimHands == true)
{
sleeve0->addHumanoidBox(-2, -2, -2, 3, 12, 4, g + 0.5);
sleeve1->addHumanoidBox(-1, -2, -2, 3, 12, 4, g + 0.5);
}
sleeve0->setPos(-5, 2 + yOffset, 0);
sleeve1->setPos(5, 2 + yOffset, 0);
}
else if ((texWidth == 64 && texHeight == 32) || force32)
{
arm0 = new ModelPart(this, 24 + 16, 16);
arm1 = new ModelPart(this, 24 + 16, 16);
}
if (slimHands == false)
{
arm0->addHumanoidBox(-3, -2, -2, 4, 12, 4, g);
arm1->addHumanoidBox(-1, -2, -2, 4, 12, 4, g);
}
else if (slimHands == true)
{
arm0->addHumanoidBox(-2, -2, -2, 3, 12, 4, g);
arm1->addHumanoidBox(-1, -2, -2, 3, 12, 4, g);
}
arm0->setPos(-5, 2 + yOffset, 0);
arm1->setPos(5, 2 + yOffset, 0);
leg0 = new ModelPart(this, 0, 16);
if (mirror == true)
arm1->bMirror = true;
if ((texWidth == 64 && texHeight == 64) && !force32)
{
leg0 = new ModelPart(this, 0, 16);
leg1 = new ModelPart(this, 16, 48);
pants0 = new ModelPart(this, 0, 32);
pants0->addHumanoidBox(-2, 0, -2, 4, 12, 4, g + 0.5);
pants0->setPos(-1.9, 12 + yOffset, 0);
pants1 = new ModelPart(this, 0, 48);
pants1->addHumanoidBox(-2, 0, -2, 4, 12, 4, g + 0.5);
pants1->setPos(1.9, 12 + yOffset, 0);
}
else if ((texWidth == 64 && texHeight == 32) || force32)
{
leg0 = new ModelPart(this, 0, 16);
leg1 = new ModelPart(this, 0, 16);
}
leg0->addHumanoidBox(-2, 0, -2, 4, 12, 4, g); // Leg0
leg0->setPos(-1.9, 12 + yOffset, 0);
leg1 = new ModelPart(this, 0, 16);
leg1->bMirror = true;
leg1->addHumanoidBox(-2, 0, -2, 4, 12, 4, g); // Leg1
leg1->setPos(1.9, 12 + yOffset, 0);
if (mirror == true)
leg1->bMirror = true;
// 4J added - compile now to avoid random performance hit first time cubes are rendered
// 4J Stu - Not just performance, but alpha+depth tests don't work right unless we compile here
cloak->compile(1.0f/16.0f);
@ -112,6 +195,17 @@ void HumanoidModel::_init(float g, float yOffset, int texWidth, int texHeight)
leg1->compile(1.0f/16.0f);
hair->compile(1.0f/16.0f);
if (jacket != 0)
jacket->compile(1.0f/16.0f);
if (sleeve0 != 0)
sleeve0->compile(1.0f/16.0f);
if (sleeve1 != 0)
sleeve1->compile(1.0f/16.0f);
if (pants0 != 0)
pants0->compile(1.0f/16.0f);
if (pants1 != 0)
pants1->compile(1.0f/16.0f);
holdingLeftHand=0;
holdingRightHand=0;
sneaking=false;
@ -125,19 +219,35 @@ void HumanoidModel::_init(float g, float yOffset, int texWidth, int texHeight)
m_uiAnimOverrideBitmask = 0L;
}
HumanoidModel::HumanoidModel() : Model()
{
_init(0, 0, 64, 32);
_init(0, 0, 64, 32, false, true, false);
}
HumanoidModel::HumanoidModel(float g) : Model()
{
_init(g, 0, 64, 32);
_init(g, 0, 64, 32, false, true, false);
}
HumanoidModel::HumanoidModel(float g, float yOffset, int texWidth, int texHeight) : Model()
{
_init(g,yOffset,texWidth,texHeight);
_init(g,yOffset,texWidth,texHeight, false, true, false);
}
HumanoidModel::HumanoidModel(float g, float yOffset, int texWidth, int texHeight, bool slimHands) : Model()
{
_init(g,yOffset,texWidth,texHeight, slimHands, true, false);
}
HumanoidModel::HumanoidModel(float g, float yOffset, int texWidth, int texHeight, bool slimHands, bool mirror) : Model()
{
_init(g,yOffset,texWidth,texHeight, slimHands, mirror, false);
}
HumanoidModel::HumanoidModel(float g, float yOffset, int texWidth, int texHeight, bool slimHands, bool mirror, bool force32) : Model()
{
_init(g,yOffset,texWidth,texHeight, slimHands, mirror, force32);
}
void HumanoidModel::render(shared_ptr<Entity> entity, float time, float r, float bob, float yRot, float xRot, float scale, bool usecompiled)
@ -166,6 +276,18 @@ void HumanoidModel::render(shared_ptr<Entity> entity, float time, float r, float
leg0->render(scale, usecompiled);
leg1->render(scale, usecompiled);
hair->render(scale, usecompiled);
if (jacket)
jacket->render(scale, usecompiled);
if (sleeve0)
sleeve0->render(scale, usecompiled);
if (sleeve1)
sleeve1->render(scale, usecompiled);
if (pants0)
pants0->render(scale, usecompiled);
if (pants1)
pants1->render(scale, usecompiled);
glPopMatrix();
}
else
@ -177,6 +299,17 @@ void HumanoidModel::render(shared_ptr<Entity> entity, float time, float r, float
leg0->render(scale, usecompiled,(m_uiAnimOverrideBitmask&(1<<eAnim_DisableRenderLeg0))>0);
leg1->render(scale, usecompiled,(m_uiAnimOverrideBitmask&(1<<eAnim_DisableRenderLeg1))>0);
hair->render(scale, usecompiled,(m_uiAnimOverrideBitmask&(1<<eAnim_DisableRenderHair))>0);
if (jacket)
jacket->render(scale, usecompiled,(m_uiAnimOverrideBitmask&(1<<eAnim_DisableRenderJacket))>0);
if (sleeve0)
sleeve0->render(scale, usecompiled,(m_uiAnimOverrideBitmask&(1<<eAnim_DisableRenderSleeve0))>0);
if (sleeve1)
sleeve1->render(scale, usecompiled,(m_uiAnimOverrideBitmask&(1<<eAnim_DisableRenderSleeve1))>0);
if (pants0)
pants0->render(scale, usecompiled,(m_uiAnimOverrideBitmask&(1<<eAnim_DisableRenderPants0))>0);
if (pants1)
pants1->render(scale, usecompiled,(m_uiAnimOverrideBitmask&(1<<eAnim_DisableRenderPants1))>0);
}
}
@ -191,6 +324,9 @@ void HumanoidModel::setupAnim(float time, float r, float bob, float yRot, float
hair->xRot = head->xRot;
body->z = 0.0f;
if (jacket)
jacket->z = 0.0f;
// Does the skin have an override for anim?
if(uiBitmaskOverrideAnim&(1<<eAnim_ArmsDown))
@ -200,6 +336,17 @@ void HumanoidModel::setupAnim(float time, float r, float bob, float yRot, float
arm0->zRot = 0.0f;
arm1->zRot = 0.0f;
if (sleeve0)
{
sleeve0->xRot=0.0f;
sleeve0->zRot=0.0f;
}
if (sleeve1)
{
sleeve1->xRot=0.0f;
sleeve1->zRot=0.0f;
}
}
else if(uiBitmaskOverrideAnim&(1<<eAnim_ArmsOutFront))
{
@ -207,6 +354,18 @@ void HumanoidModel::setupAnim(float time, float r, float bob, float yRot, float
arm1->xRot=-HALF_PI;
arm0->zRot = 0.0f;
arm1->zRot = 0.0f;
if (sleeve0)
{
sleeve0->xRot=-HALF_PI;
sleeve0->zRot=0.0f;
}
if (sleeve1)
{
sleeve1->xRot=-HALF_PI;
sleeve1->zRot=0.0f;
}
}
else if(uiBitmaskOverrideAnim&(1<<eAnim_SingleArms))
{
@ -214,6 +373,18 @@ void HumanoidModel::setupAnim(float time, float r, float bob, float yRot, float
arm1->xRot = (Mth::cos(time * 0.6662f + PI) * 2.0f) * r * 0.5f;
arm0->zRot = 0.0f;
arm1->zRot = 0.0f;
if (sleeve0)
{
sleeve0->xRot=(Mth::cos(time * 0.6662f + PI) * 2.0f) * r * 0.5f;
sleeve0->zRot=0.0f;
}
if (sleeve1)
{
sleeve1->xRot=(Mth::cos(time * 0.6662f + PI) * 2.0f) * r * 0.5f;
sleeve1->zRot=0.0f;
}
}
// 4J-PB - Weeping Angel - does't look good holding something in the arm that's up
else if((uiBitmaskOverrideAnim&(1<<eAnim_StatueOfLiberty)) && (holdingRightHand==0) && (attackTime==0.0f))
@ -222,6 +393,18 @@ void HumanoidModel::setupAnim(float time, float r, float bob, float yRot, float
arm0->zRot = -0.3f;
arm1->xRot = ( Mth::cos(time * 0.6662f) * 2.0f) * r * 0.5f;
arm1->zRot = 0.0f;
if (sleeve0)
{
sleeve0->xRot=-PI;
sleeve0->zRot=-0.3f;
}
if (sleeve1)
{
sleeve1->xRot=( Mth::cos(time * 0.6662f) * 2.0f) * r * 0.5f;
sleeve1->zRot=0.0f;
}
}
else
{
@ -229,6 +412,18 @@ void HumanoidModel::setupAnim(float time, float r, float bob, float yRot, float
arm1->xRot = ( Mth::cos(time * 0.6662f) * 2.0f) * r * 0.5f;
arm0->zRot = 0.0f;
arm1->zRot = 0.0f;
if (sleeve0)
{
sleeve0->xRot=(Mth::cos(time * 0.6662f + PI) * 2.0f) * r * 0.5f;
sleeve0->zRot=0.0f;
}
if (sleeve1)
{
sleeve1->xRot=( Mth::cos(time * 0.6662f) * 2.0f) * r * 0.5f;
sleeve1->zRot=0.0f;
}
}
// arm0.zRot = ((float) (util.Mth.cos(time * 0.2312f) + 1) * 1) * r;
@ -239,9 +434,15 @@ void HumanoidModel::setupAnim(float time, float r, float bob, float yRot, float
leg0->yRot = 0.0f;
leg1->yRot = 0.0f;
if (pants0)
pants0->yRot=0.0f;
if (pants1)
pants1->yRot=0.0f;
if (riding)
{
if ((uiBitmaskOverrideAnim&(1<<eAnim_SmallModel)) == 0)
if(uiBitmaskOverrideAnim&(1<<eAnim_SmallModel) == 0)
{
arm0->xRot += -HALF_PI * 0.4f;
arm1->xRot += -HALF_PI * 0.4f;
@ -249,6 +450,24 @@ void HumanoidModel::setupAnim(float time, float r, float bob, float yRot, float
leg1->xRot = -HALF_PI * 0.8f;
leg0->yRot = HALF_PI * 0.2f;
leg1->yRot = -HALF_PI * 0.2f;
if (sleeve0)
sleeve0->xRot+=-HALF_PI * 0.4f;
if (sleeve1)
sleeve1->xRot+=-HALF_PI * 0.4f;
if (pants0)
{
pants0->xRot=-HALF_PI * 0.8f;
pants0->yRot=HALF_PI * 0.2f;
}
if (pants1)
{
pants1->xRot=-HALF_PI * 0.8f;
pants1->yRot=-HALF_PI * 0.2f;
}
}
else
{
@ -256,8 +475,18 @@ void HumanoidModel::setupAnim(float time, float r, float bob, float yRot, float
arm1->xRot += -HALF_PI * 0.4f;
leg0->xRot = -HALF_PI * 0.4f;
leg1->xRot = -HALF_PI * 0.4f;
leg0->yRot = HALF_PI * 0.2f;
leg1->yRot = -HALF_PI * 0.2f;
if (sleeve0)
sleeve0->xRot+=-HALF_PI * 0.4f;
if (sleeve1)
sleeve1->xRot+=-HALF_PI * 0.4f;
if (pants0)
pants0->xRot=-HALF_PI * 0.4f;
if (pants1)
pants1->xRot=-HALF_PI * 0.4f;
}
}
else if(idle && !sneaking )
@ -266,6 +495,18 @@ void HumanoidModel::setupAnim(float time, float r, float bob, float yRot, float
leg1->xRot = -HALF_PI;
leg0->yRot = HALF_PI * 0.2f;
leg1->yRot = -HALF_PI * 0.2f;
if (pants0)
{
pants0->xRot=-HALF_PI;
pants0->yRot=HALF_PI * 0.2f;
}
if (pants1)
{
pants1->xRot=-HALF_PI;
pants1->yRot=-HALF_PI * 0.2f;
}
}
else if(uiBitmaskOverrideAnim&(1<<eAnim_NoLegAnim))
{
@ -274,31 +515,68 @@ void HumanoidModel::setupAnim(float time, float r, float bob, float yRot, float
leg1->xRot=0.0f;
leg1->zRot=0.0f;
leg0->yRot = 0.0f;
leg1->yRot = 0.0f;
leg1->yRot = 0.0f;
if (pants0)
{
pants0->xRot=0.0f;
pants0->zRot=0.0f;
pants0->yRot=0.0f;
}
if (pants1)
{
pants1->xRot=0.0f;
pants1->zRot=0.0f;
pants1->yRot=0.0f;
}
}
else if(uiBitmaskOverrideAnim&(1<<eAnim_SingleLegs))
{
leg0->xRot = ( Mth::cos(time * 0.6662f) * 1.4f) * r;
leg1->xRot = ( Mth::cos(time * 0.6662f) * 1.4f) * r;
if (pants0)
pants0->xRot=( Mth::cos(time * 0.6662f) * 1.4f) * r;
if (pants1)
pants1->xRot=( Mth::cos(time * 0.6662f) * 1.4f) * r;
}
else
{
leg0->xRot = ( Mth::cos(time * 0.6662f) * 1.4f) * r;
leg1->xRot = ( Mth::cos(time * 0.6662f + PI) * 1.4f) * r;
}
if (pants0)
pants0->xRot=( Mth::cos(time * 0.6662f) * 1.4f) * r;
if (pants1)
pants1->xRot=( Mth::cos(time * 0.6662f + PI) * 1.4f) * r;
}
if (holdingLeftHand != 0)
{
arm1->xRot = arm1->xRot * 0.5f - HALF_PI * 0.2f * holdingLeftHand;
if (sleeve1)
sleeve1->xRot=sleeve1->xRot * 0.5f - HALF_PI * 0.2f * holdingLeftHand;
}
if (holdingRightHand != 0)
{
arm0->xRot = arm0->xRot * 0.5f - HALF_PI * 0.2f * holdingRightHand;
if (sleeve0)
sleeve0->xRot=sleeve0->xRot * 0.5f - HALF_PI * 0.2f * holdingRightHand;
}
arm0->yRot = 0.0f;
arm1->yRot = 0.0f;
if (sleeve0)
sleeve0->yRot=0.0f;
if (sleeve1)
sleeve1->yRot=0.0f;
if (attackTime > -9990.0f)
{
float swing = attackTime;
@ -311,6 +589,20 @@ void HumanoidModel::setupAnim(float time, float r, float bob, float yRot, float
arm1->yRot += body->yRot;
arm1->xRot += body->yRot;
if (sleeve0)
{
sleeve0->z=Mth::sin(body->yRot) * 5.0f;
sleeve0->x=-Mth::cos(body->yRot) * 5.0f;
sleeve0->yRot+=body->yRot;
}
if (sleeve1)
{
sleeve1->z=-Mth::sin(body->yRot) * 5.0f;
sleeve1->x=Mth::cos(body->yRot) * 5.0f;
sleeve1->yRot+=body->yRot;
sleeve1->xRot+=body->yRot;
}
swing = 1.0f - attackTime;
swing *= swing;
swing *= swing;
@ -318,15 +610,27 @@ void HumanoidModel::setupAnim(float time, float r, float bob, float yRot, float
float aa = Mth::sin(swing * PI);
float bb = Mth::sin(attackTime * PI) * -(head->xRot - 0.7f) * 0.75f;
arm0->xRot -= aa * 1.2f + bb; // 4J - changed 1.2 -> 1.2f
arm0->yRot += body->yRot * 2.0f;
arm0->yRot += body->yRot * 2.0f;
if (sleeve0)
{
sleeve0->xRot -= aa * 1.2f + bb;
sleeve0->yRot += body->yRot * 2.0f;
}
if((uiBitmaskOverrideAnim&(1<<eAnim_StatueOfLiberty))&& (holdingRightHand==0) && (attackTime==0.0f))
{
arm0->zRot -= Mth::sin(attackTime * PI) * -0.4f;
if (sleeve0)
sleeve0->zRot -= Mth::sin(attackTime * PI) * -0.4f;
}
else
{
arm0->zRot = Mth::sin(attackTime * PI) * -0.4f;
if (sleeve0)
sleeve0->zRot = Mth::sin(attackTime * PI) * -0.4f;
}
}
@ -343,6 +647,12 @@ void HumanoidModel::setupAnim(float time, float r, float bob, float yRot, float
arm0->yRot -= iss * 0.5f; // This factor and the following to the general arm movement through the life of the swing
arm0->xRot -= iss * 1.2f;
if (sleeve0)
{
sleeve0->xRot = -Mth::abs(Mth::cos(eating_t / 4.0f * PI) * 0.1f) * (eating_swing > 0.2 ? 1.0f : 0.0f) * 2.0f;
sleeve0->yRot -= iss * 0.5f;
sleeve0->xRot -= iss * 1.2f;
}
}
if (sneaking)
@ -366,6 +676,39 @@ void HumanoidModel::setupAnim(float time, float r, float bob, float yRot, float
hair->y = +1.0f;
ear->y = +1.0f;
cloak->y = 0.0f;
if (jacket)
{
jacket->xRot = -0.5f;
jacket->z = 2.0f;
jacket->y = 0.0f;
}
if (sleeve0)
{
sleeve0->xRot += 0.4f;
sleeve0->y = 2.0f;
}
if (sleeve1)
{
sleeve1->xRot += 0.4f;
sleeve1->y = 2.0f;
}
if (pants0)
{
pants0->xRot -= 0.0f;
pants0->z = -4.0f;
pants0->y = +9.0f;
}
if (pants1)
{
pants1->xRot -= 0.0f;
pants1->z = -4.0f;
pants1->y = +9.0f;
}
}
else
{
@ -385,6 +728,38 @@ void HumanoidModel::setupAnim(float time, float r, float bob, float yRot, float
hair->y = +1.0f;
ear->y = +1.0f;
cloak->y = 0.0f;
if (jacket)
{
jacket->xRot = 0.5f;
jacket->y = 0.0f;
}
if (sleeve0)
{
sleeve0->xRot += 0.4f;
sleeve0->y = 2.0f;
}
if (sleeve1)
{
sleeve1->xRot += 0.4f;
sleeve1->y = 2.0f;
}
if (pants0)
{
pants0->xRot -= 0.0f;
pants0->z = +4.0f;
pants0->y = +9.0f;
}
if (pants1)
{
pants1->xRot -= 0.0f;
pants1->z = +4.0f;
pants1->y = +9.0f;
}
}
}
else
@ -393,6 +768,15 @@ void HumanoidModel::setupAnim(float time, float r, float bob, float yRot, float
leg0->z = 0.1f;
leg1->z = 0.1f;
if (jacket)
jacket->xRot = 0.0f;
if (pants0)
pants0->z = 0.1f;
if (pants1)
pants1->z = 0.1f;
if(!riding && idle)
{
leg0->y = 22.0f;
@ -404,6 +788,17 @@ void HumanoidModel::setupAnim(float time, float r, float bob, float yRot, float
hair->y = 10.0f;
ear->y = 11.0f;
cloak->y = 10.0f;
if (jacket)
jacket->y = 10.0f;
if (sleeve0)
sleeve0->y = 12.0f;
if (sleeve1)
sleeve1->y = 12.0f;
if (pants0)
pants0->y = 22.0f;
if (pants1)
pants1->y = 22.0f;
}
else
{
@ -416,15 +811,37 @@ void HumanoidModel::setupAnim(float time, float r, float bob, float yRot, float
hair->y = 0.0f;
ear->y = 1.0f;
cloak->y = 0.0f;
if (jacket)
jacket->y = 0.0f;
if (sleeve0)
sleeve0->y = 2.0f;
if (sleeve1)
sleeve1->y = 2.0f;
if (pants0)
pants0->y = 12.0f;
if (pants1)
pants1->y = 12.0f;
}
}
arm0->zRot += ((Mth::cos(bob * 0.09f)) * 0.05f + 0.05f);
arm1->zRot -= ((Mth::cos(bob * 0.09f)) * 0.05f + 0.05f);
arm0->xRot += ((Mth::sin(bob * 0.067f)) * 0.05f);
arm1->xRot -= ((Mth::sin(bob * 0.067f)) * 0.05f);
if (sleeve0)
{
sleeve0->xRot += ((Mth::sin(bob * 0.067f)) * 0.05f);
sleeve0->zRot += ((Mth::cos(bob * 0.09f)) * 0.05f + 0.05f);
}
if (sleeve1)
{
sleeve1->xRot -= ((Mth::sin(bob * 0.067f)) * 0.05f);
sleeve1->zRot -= ((Mth::cos(bob * 0.09f)) * 0.05f + 0.05f);
}
if (bowAndArrow)
{
float attack2 = 0.0f;
@ -442,6 +859,26 @@ void HumanoidModel::setupAnim(float time, float r, float bob, float yRot, float
arm1->zRot -= ((float) (Mth::cos(bob * 0.09f)) * 0.05f + 0.05f);
arm0->xRot += ((float) (Mth::sin(bob * 0.067f)) * 0.05f);
arm1->xRot -= ((float) (Mth::sin(bob * 0.067f)) * 0.05f);
if (sleeve0)
{
sleeve0->zRot = 0.0f;
sleeve0->yRot = -(0.1f - attack2 * 0.6f) + head->yRot;
sleeve0->xRot = -HALF_PI + head->xRot;
sleeve0->xRot -= attack2 * 1.2f - attack * 0.4f;
sleeve0->zRot += ((float) (Mth::cos(bob * 0.09f)) * 0.05f + 0.05f);
sleeve0->xRot += ((float) (Mth::sin(bob * 0.067f)) * 0.05f);
}
if (sleeve1)
{
sleeve1->zRot = 0.0f;
sleeve1->yRot = +(0.1f - attack2 * 0.6f) + head->yRot + 0.4f;
sleeve1->xRot = -HALF_PI + head->xRot;
sleeve1->xRot -= attack2 * 1.2f - attack * 0.4f;
sleeve1->zRot -= ((float) (Mth::cos(bob * 0.09f)) * 0.05f + 0.05f);
sleeve1->xRot -= ((float) (Mth::sin(bob * 0.067f)) * 0.05f);
}
}
}
}
@ -477,18 +914,41 @@ void HumanoidModel::render(HumanoidModel *model, float scale, bool usecompiled)
hair->xRot = head->xRot;
body->yRot = model->body->yRot;
if (jacket)
jacket->yRot = model->jacket->yRot;
arm0->xRot = model->arm0->xRot;
arm0->yRot = model->arm0->yRot;
arm0->zRot = model->arm0->zRot;
if (sleeve0)
{
sleeve0->xRot = model->sleeve0->xRot;
sleeve0->yRot = model->sleeve0->yRot;
sleeve0->zRot = model->sleeve0->zRot;
}
arm1->xRot = model->arm1->xRot;
arm1->yRot = model->arm1->yRot;
arm1->zRot = model->arm1->zRot;
if (sleeve1)
{
sleeve1->xRot = model->sleeve1->xRot;
sleeve1->yRot = model->sleeve1->yRot;
sleeve1->zRot = model->sleeve1->zRot;
}
leg0->xRot = model->leg0->xRot;
leg1->xRot = model->leg1->xRot;
if (pants0)
pants0->xRot = model->pants0->xRot;
if (pants1)
pants1->xRot = model->pants1->xRot;
head->render(scale, usecompiled,(m_uiAnimOverrideBitmask&(1<<eAnim_DisableRenderHead))>0);
body->render(scale, usecompiled,(m_uiAnimOverrideBitmask&(1<<eAnim_DisableRenderTorso))>0);
arm0->render(scale, usecompiled,(m_uiAnimOverrideBitmask&(1<<eAnim_DisableRenderArm0))>0);
@ -496,4 +956,15 @@ void HumanoidModel::render(HumanoidModel *model, float scale, bool usecompiled)
leg0->render(scale, usecompiled,(m_uiAnimOverrideBitmask&(1<<eAnim_DisableRenderLeg0))>0);
leg1->render(scale, usecompiled,(m_uiAnimOverrideBitmask&(1<<eAnim_DisableRenderLeg1))>0);
hair->render(scale, usecompiled,(m_uiAnimOverrideBitmask&(1<<eAnim_DisableRenderHair))>0);
}
if (jacket)
jacket->render(scale, usecompiled,(m_uiAnimOverrideBitmask&(1<<eAnim_DisableRenderJacket))>0);
if (sleeve0)
sleeve0->render(scale, usecompiled,(m_uiAnimOverrideBitmask&(1<<eAnim_DisableRenderSleeve0))>0);
if (sleeve1)
sleeve1->render(scale, usecompiled,(m_uiAnimOverrideBitmask&(1<<eAnim_DisableRenderSleeve1))>0);
if (pants0)
pants0->render(scale, usecompiled,(m_uiAnimOverrideBitmask&(1<<eAnim_DisableRenderPants0))>0);
if (pants1)
pants1->render(scale, usecompiled,(m_uiAnimOverrideBitmask&(1<<eAnim_DisableRenderPants1))>0);
}

View file

@ -4,7 +4,7 @@
class HumanoidModel : public Model
{
public:
ModelPart *head, *hair, *body, *arm0, *arm1, *leg0, *leg1, *ear, *cloak;
ModelPart *head, *hair, *body, *jacket, *arm0, *sleeve0, *arm1, *sleeve1, *leg0, *pants0, *leg1, *pants1, *ear, *cloak;
//ModelPart *hat;
int holdingLeftHand;
@ -37,8 +37,12 @@ public:
eAnim_DisableRenderLeg0,
eAnim_DisableRenderLeg1,
eAnim_DisableRenderHair,
eAnim_SmallModel // Maggie Simpson for riding horse, etc
eAnim_SmallModel,
eAnim_DisableRenderJacket,
eAnim_DisableRenderSleeve0,
eAnim_DisableRenderSleeve1,
eAnim_DisableRenderPants0,
eAnim_DisableRenderPants1
};
static const unsigned int m_staticBitmaskIgnorePlayerCustomAnimSetting= (1<<HumanoidModel::eAnim_ForceAnim) |
@ -47,13 +51,21 @@ public:
(1<<HumanoidModel::eAnim_DisableRenderTorso) |
(1<<HumanoidModel::eAnim_DisableRenderLeg0) |
(1<<HumanoidModel::eAnim_DisableRenderLeg1) |
(1<<HumanoidModel::eAnim_DisableRenderHair);
(1<<HumanoidModel::eAnim_DisableRenderHair) |
(1<<HumanoidModel::eAnim_DisableRenderJacket) |
(1<<HumanoidModel::eAnim_DisableRenderSleeve0) |
(1<<HumanoidModel::eAnim_DisableRenderSleeve1) |
(1<<HumanoidModel::eAnim_DisableRenderPants0) |
(1<<HumanoidModel::eAnim_DisableRenderPants1);
void _init(float g, float yOffset, int texWidth, int texHeight); // 4J added
void _init(float g, float yOffset, int texWidth, int texHeight, bool slimHands, bool mirror, bool force32); // 4J added
HumanoidModel();
HumanoidModel(float g);
HumanoidModel(float g, float yOffset, int texWidth, int texHeight);
HumanoidModel(float g, float yOffset, int texWidth, int texHeight);
HumanoidModel(float g, float yOffset, int texWidth, int texHeight, bool slimHands);
HumanoidModel(float g, float yOffset, int texWidth, int texHeight, bool slimHands, bool mirror);
HumanoidModel(float g, float yOffset, int texWidth, int texHeight, bool slimHands, bool mirror, bool force32);
virtual void render(shared_ptr<Entity> entity, float time, float r, float bob, float yRot, float xRot, float scale, bool usecompiled);
virtual void setupAnim(float time, float r, float bob, float yRot, float xRot, float scale, shared_ptr<Entity> entity, unsigned int uiBitmaskOverrideAnim = 0);
void renderHair(float scale, bool usecompiled);

View file

@ -8,14 +8,26 @@
#include "../Minecraft.World/Arrow.h"
#include "../Minecraft.World/Mth.h"
#include "../Minecraft.World/Player.h"
#include "Skins.h"
ResourceLocation LivingEntityRenderer::ENCHANT_GLINT_LOCATION = ResourceLocation(TN__BLUR__MISC_GLINT);
int LivingEntityRenderer::MAX_ARMOR_LAYERS = 4;
LivingEntityRenderer::LivingEntityRenderer(Model *model, float shadow)
LivingEntityRenderer::LivingEntityRenderer(Model *model, float shadow, bool slimHands, bool createNewVar)
{
this->model = model;
if (slimHands == true)
this->modelSlim = new HumanoidModel(0, 0, 64, 32, true);
if (createNewVar)
{
this->newModel = new HumanoidModel(0, 0, 64, 64, false, false);
if (slimHands == true)
this->newModelSlim = new HumanoidModel(0, 0, 64, 64, true, false);
}
shadowRadius = shadow;
armor = nullptr;
}
@ -43,22 +55,47 @@ void LivingEntityRenderer::render(shared_ptr<Entity> _mob, double x, double y, d
}
shared_ptr<LivingEntity> mob = dynamic_pointer_cast<LivingEntity>(_mob);
shared_ptr<Player> player = dynamic_pointer_cast<Player>(_mob);
Model *resModel;
if (mob == nullptr)
{
return;
}
app.DebugPrintf("LivingEntityRenderer::render called for type %d\n", _mob->GetType());
glPushMatrix();
glDisable(GL_CULL_FACE);
model->attackTime = getAttackAnim(mob, a);
if (armor != nullptr) armor->attackTime = model->attackTime;
model->riding = mob->isRiding();
if (armor != nullptr) armor->riding = model->riding;
model->young = mob->isBaby();
if (armor != nullptr) armor->young = model->young;
if (player != nullptr)
{
Textures *textures = Minecraft::GetInstance()->textures;
int skinId = player->getPlayerDefaultSkin() - 1;
int defaultSkin = player->getPlayerDefaultSkin() + 35;
if (slim[skinId] == true)
{
if (textures->getHeight(player->customTextureUrl, defaultSkin) == 64)
resModel = static_cast<HumanoidModel *>(newModelSlim);
else if (textures->getHeight(player->customTextureUrl, defaultSkin) == 32)
resModel = static_cast<HumanoidModel *>(modelSlim);
}
else
{
if (textures->getHeight(player->customTextureUrl, defaultSkin) == 64)
resModel = static_cast<HumanoidModel *>(newModel);
else if (textures->getHeight(player->customTextureUrl, defaultSkin) == 32)
resModel = static_cast<HumanoidModel *>(model);
}
}
else
resModel = model;
resModel->attackTime = getAttackAnim(mob, a);
if (armor != nullptr) armor->attackTime = resModel->attackTime;
resModel->riding = mob->isRiding();
if (armor != nullptr) armor->riding = resModel->riding;
resModel->young = mob->isBaby();
if (armor != nullptr) armor->young = resModel->young;
/*try*/
{
@ -104,7 +141,7 @@ void LivingEntityRenderer::render(shared_ptr<Entity> _mob, double x, double y, d
if (ws > 1) ws = 1;
glEnable(GL_ALPHA_TEST);
model->prepareMobModel(mob, wp, ws, a);
resModel->prepareMobModel(mob, wp, ws, a);
renderModel(mob, wp, ws, bob, headRot - bodyRot, headRotx, fScale);
for (int i = 0; i < MAX_ARMOR_LAYERS; i++)
@ -188,7 +225,7 @@ void LivingEntityRenderer::render(shared_ptr<Entity> _mob, double x, double y, d
if (mob->hurtTime > 0 || mob->deathTime > 0)
{
glColor4f(br, 0, 0, 0.4f);
model->render(mob, wp, ws, bob, headRot - bodyRot, headRotx, fScale, false);
resModel->render(mob, wp, ws, bob, headRot - bodyRot, headRotx, fScale, false);
for (int i = 0; i < MAX_ARMOR_LAYERS; i++)
{
if (prepareArmorOverlay(mob, i, a) >= 0)
@ -206,7 +243,7 @@ void LivingEntityRenderer::render(shared_ptr<Entity> _mob, double x, double y, d
float b = ((overlayColor) & 0xff) / 255.0f;
float aa = ((overlayColor >> 24) & 0xff) / 255.0f;
glColor4f(r, g, b, aa);
model->render(mob, wp, ws, bob, headRot - bodyRot, headRotx, fScale, false);
resModel->render(mob, wp, ws, bob, headRot - bodyRot, headRotx, fScale, false);
for (int i = 0; i < MAX_ARMOR_LAYERS; i++)
{
if (prepareArmorOverlay(mob, i, a) >= 0)
@ -243,10 +280,37 @@ void LivingEntityRenderer::render(shared_ptr<Entity> _mob, double x, double y, d
void LivingEntityRenderer::renderModel(shared_ptr<LivingEntity> mob, float wp, float ws, float bob, float headRotMinusBodyRot, float headRotx, float scale)
{
shared_ptr<Player> player = dynamic_pointer_cast<Player>(mob);
Model *resModel;
if (player != nullptr)
{
Textures *textures = Minecraft::GetInstance()->textures;
int skinId = player->getPlayerDefaultSkin() - 1;
int defaultSkin = player->getPlayerDefaultSkin() + 35;
if (slim[skinId] == true)
{
if (textures->getHeight(player->customTextureUrl, defaultSkin) == 64)
resModel = static_cast<HumanoidModel *>(newModelSlim);
else if (textures->getHeight(player->customTextureUrl, defaultSkin) == 32)
resModel = static_cast<HumanoidModel *>(modelSlim);
}
else
{
if (textures->getHeight(player->customTextureUrl, defaultSkin) == 64)
resModel = static_cast<HumanoidModel *>(newModel);
else if (textures->getHeight(player->customTextureUrl, defaultSkin) == 32)
resModel = static_cast<HumanoidModel *>(model);
}
}
else
resModel = model;
bindTexture(mob);
if (!mob->isInvisible())
{
model->render(mob, wp, ws, bob, headRotMinusBodyRot, headRotx, scale, true);
resModel->render(mob, wp, ws, bob, headRotMinusBodyRot, headRotx, scale, true);
}
else if(!mob->isInvisibleTo(dynamic_pointer_cast<Player>(Minecraft::GetInstance()->player)))
{
@ -256,7 +320,7 @@ void LivingEntityRenderer::renderModel(shared_ptr<LivingEntity> mob, float wp, f
glEnable(GL_BLEND);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
glAlphaFunc(GL_GREATER, 1.0f / 255.0f);
model->render(mob, wp, ws, bob, headRotMinusBodyRot, headRotx, scale, true);
resModel->render(mob, wp, ws, bob, headRotMinusBodyRot, headRotx, scale, true);
glDisable(GL_BLEND);
glAlphaFunc(GL_GREATER, .1f);
glPopMatrix();
@ -264,7 +328,7 @@ void LivingEntityRenderer::renderModel(shared_ptr<LivingEntity> mob, float wp, f
}
else
{
model->setupAnim(wp, ws, bob, headRotMinusBodyRot, headRotx, scale, mob);
resModel->setupAnim(wp, ws, bob, headRotMinusBodyRot, headRotx, scale, mob);
}
}
@ -314,7 +378,35 @@ void LivingEntityRenderer::additionalRendering(shared_ptr<LivingEntity> mob, flo
void LivingEntityRenderer::renderArrows(shared_ptr<LivingEntity> mob, float a)
{
shared_ptr<Player> player = dynamic_pointer_cast<Player>(mob);
Model *resModel;
if (player != nullptr)
{
Textures *textures = Minecraft::GetInstance()->textures;
int skinId = player->getPlayerDefaultSkin() - 1;
int defaultSkin = player->getPlayerDefaultSkin() + 35;
if (slim[skinId] == true)
{
if (textures->getHeight(player->customTextureUrl, defaultSkin) == 64)
resModel = static_cast<HumanoidModel *>(newModelSlim);
else if (textures->getHeight(player->customTextureUrl, defaultSkin) == 32)
resModel = static_cast<HumanoidModel *>(modelSlim);
}
else
{
if (textures->getHeight(player->customTextureUrl, defaultSkin) == 64)
resModel = static_cast<HumanoidModel *>(newModel);
else if (textures->getHeight(player->customTextureUrl, defaultSkin) == 32)
resModel = static_cast<HumanoidModel *>(model);
}
}
else
resModel = model;
int arrowCount = mob->getArrowCount();
if (arrowCount > 0)
{
shared_ptr<Entity> arrow = std::make_shared<Arrow>(mob->level, mob->x, mob->y, mob->z);
@ -323,7 +415,10 @@ void LivingEntityRenderer::renderArrows(shared_ptr<LivingEntity> mob, float a)
for (int i = 0; i < arrowCount; i++)
{
glPushMatrix();
ModelPart *modelPart = model->getRandomModelPart(random);
ModelPart *modelPart;
modelPart = resModel->getRandomModelPart(random);
Cube *cube = modelPart->cubes[random.nextInt(modelPart->cubes.size())];
modelPart->translateTo(1 / 16.0f);
float xd = random.nextFloat();
@ -358,7 +453,7 @@ void LivingEntityRenderer::renderArrows(shared_ptr<LivingEntity> mob, float a)
int LivingEntityRenderer::prepareArmorOverlay(shared_ptr<LivingEntity> mob, int layer, float a)
{
return -1;
return prepareArmor(mob, layer, a);
}
int LivingEntityRenderer::prepareArmor(shared_ptr<LivingEntity> mob, int layer, float a)
@ -502,7 +597,7 @@ void LivingEntityRenderer::renderNameTag(shared_ptr<LivingEntity> mob, const wst
constexpr float s = 1 / 60.0f * size;
glPushMatrix();
glTranslatef(static_cast<float>(x), static_cast<float>(y) + mob->bbHeight + 0.5f, static_cast<float>(z));
glTranslatef(static_cast<float>(x) + 0, static_cast<float>(y) + mob->bbHeight + 0.5f, static_cast<float>(z));
glNormal3f(0, 1, 0);
glRotatef(-this->entityRenderDispatcher->playerRotY, 0, 1, 0);

View file

@ -1,7 +1,7 @@
#pragma once
#include "ResourceLocation.h"
#include "EntityRenderer.h"
#include "../Minecraft.World/LivingEntity.h"
#include "..\Minecraft.World\LivingEntity.h"
class LivingEntity;
@ -19,7 +19,7 @@ protected:
Model *armor;
public:
LivingEntityRenderer(Model *model, float shadow);
LivingEntityRenderer(Model *model, float shadow, bool slimHands = 0, bool createNewVar = 0);
virtual void render(shared_ptr<Entity> mob, double x, double y, double z, float rot, float a);
virtual void setArmor(Model *armor);

View file

@ -13,6 +13,7 @@
#include "../Minecraft.World/net.minecraft.world.level.tile.h"
#include "../Minecraft.World/net.minecraft.h"
#include "../Minecraft.World/StringHelpers.h"
#include "Skins.h"
static unsigned int nametagColorForIndex(int index)
{
@ -55,9 +56,12 @@ static unsigned int nametagColorForIndex(int index)
ResourceLocation PlayerRenderer::DEFAULT_LOCATION = ResourceLocation(TN_MOB_CHAR);
PlayerRenderer::PlayerRenderer() : LivingEntityRenderer( new HumanoidModel(0), 0.5f )
PlayerRenderer::PlayerRenderer() : LivingEntityRenderer( new HumanoidModel(0), 0.5f, true, true )
{
humanoidModel = static_cast<HumanoidModel *>(model);
humanoidModel = static_cast<HumanoidModel *>(model);
humanoidModelSlim = static_cast<HumanoidModel *>(modelSlim);
newHumanoidModel = static_cast<HumanoidModel *>(newModel);
newHumanoidModelSlim = static_cast<HumanoidModel *>(newModelSlim);
armorParts1 = new HumanoidModel(1.0f);
armorParts2 = new HumanoidModel(0.5f);
@ -160,12 +164,43 @@ void PlayerRenderer::render(shared_ptr<Entity> _mob, double x, double y, double
// 4J - dynamic cast required because we aren't using templates/generics in our version
shared_ptr<Player> mob = dynamic_pointer_cast<Player>(_mob);
HumanoidModel *resModel;
if(mob == nullptr) return;
if(mob->hasInvisiblePrivilege()) return;
if (mob != nullptr)
{
Textures *textures = Minecraft::GetInstance()->textures;
int skinId = mob->getPlayerDefaultSkin() - 1;
int defaultSkin = mob->getPlayerDefaultSkin() + 35;
if (slim[skinId] == true)
{
if (textures->getHeight(mob->customTextureUrl, defaultSkin) == 64)
resModel = static_cast<HumanoidModel *>(newHumanoidModelSlim);
else if (textures->getHeight(mob->customTextureUrl, defaultSkin) == 32)
resModel = static_cast<HumanoidModel *>(humanoidModelSlim);
}
else
{
if (textures->getHeight(mob->customTextureUrl, defaultSkin) == 64)
resModel = static_cast<HumanoidModel *>(newHumanoidModel);
else if (textures->getHeight(mob->customTextureUrl, defaultSkin) == 32)
resModel = static_cast<HumanoidModel *>(humanoidModel);
}
}
else
resModel = humanoidModel;
/*if (mob != nullptr && newHumanoidModelSlim != nullptr && (mob->getCustomSkin() >= 10 && mob->getCustomSkin() <= 18)) resModel = newHumanoidModelSlim;
else if (mob != nullptr && newHumanoidModel != nullptr && (mob->getCustomSkin() >= 2 && mob->getCustomSkin() <= 9)) resModel = newHumanoidModel;
else resModel = humanoidModel;*/
shared_ptr<ItemInstance> item = mob->inventory->getSelected();
armorParts1->holdingRightHand = armorParts2->holdingRightHand = humanoidModel->holdingRightHand = item != nullptr ? 1 : 0;
armorParts1->holdingRightHand = armorParts2->holdingRightHand = resModel->holdingRightHand = item != nullptr ? 1 : 0;
if (item != nullptr)
{
if (mob->getUseItemDuration() > 0)
@ -173,11 +208,11 @@ void PlayerRenderer::render(shared_ptr<Entity> _mob, double x, double y, double
UseAnim anim = item->getUseAnimation();
if (anim == UseAnim_block)
{
armorParts1->holdingRightHand = armorParts2->holdingRightHand = humanoidModel->holdingRightHand = 3;
armorParts1->holdingRightHand = armorParts2->holdingRightHand = resModel->holdingRightHand = 3;
}
else if (anim == UseAnim_bow)
{
armorParts1->bowAndArrow = armorParts2->bowAndArrow = humanoidModel->bowAndArrow = true;
armorParts1->bowAndArrow = armorParts2->bowAndArrow = resModel->bowAndArrow = true;
}
}
}
@ -187,17 +222,17 @@ void PlayerRenderer::render(shared_ptr<Entity> _mob, double x, double y, double
// These factors are largely lifted from ItemInHandRenderer to try and keep the 3rd person eating animation as similar as possible
float t = (mob->getUseItemDuration() - a + 1);
float swing = 1 - (t / item->getUseDuration());
armorParts1->eating = armorParts2->eating = humanoidModel->eating = true;
armorParts1->eating_t = armorParts2->eating_t = humanoidModel->eating_t = t;
armorParts1->eating_swing = armorParts2->eating_swing = humanoidModel->eating_swing = swing;
armorParts1->eating = armorParts2->eating = resModel->eating = true;
armorParts1->eating_t = armorParts2->eating_t = resModel->eating_t = t;
armorParts1->eating_swing = armorParts2->eating_swing = resModel->eating_swing = swing;
}
else
{
armorParts1->eating = armorParts2->eating = humanoidModel->eating = false;
armorParts1->eating = armorParts2->eating = resModel->eating = false;
}
armorParts1->sneaking = armorParts2->sneaking = humanoidModel->sneaking = mob->isSneaking();
armorParts1->sneaking = armorParts2->sneaking = resModel->sneaking = mob->isSneaking();
double yp = y - mob->heightOffset;
if (mob->isSneaking() && !mob->instanceof(eTYPE_LOCALPLAYER))
{
@ -209,20 +244,20 @@ void PlayerRenderer::render(shared_ptr<Entity> _mob, double x, double y, double
{
if(mob->isIdle())
{
humanoidModel->idle=true;
resModel->idle=true;
armorParts1->idle=true;
armorParts2->idle=true;
}
else
{
humanoidModel->idle=false;
resModel->idle=false;
armorParts1->idle=false;
armorParts2->idle=false;
}
}
else
{
humanoidModel->idle=false;
resModel->idle=false;
armorParts1->idle=false;
armorParts2->idle=false;
}
@ -248,10 +283,9 @@ void PlayerRenderer::render(shared_ptr<Entity> _mob, double x, double y, double
pModelPart->visible=false;
}
}
armorParts1->bowAndArrow = armorParts2->bowAndArrow = humanoidModel->bowAndArrow = false;
armorParts1->sneaking = armorParts2->sneaking = humanoidModel->sneaking = false;
armorParts1->holdingRightHand = armorParts2->holdingRightHand = humanoidModel->holdingRightHand = 0;
armorParts1->bowAndArrow = armorParts2->bowAndArrow = resModel->bowAndArrow = false;
armorParts1->sneaking = armorParts2->sneaking = resModel->sneaking = false;
armorParts1->holdingRightHand = armorParts2->holdingRightHand = resModel->holdingRightHand = 0;
}
void PlayerRenderer::additionalRendering(shared_ptr<LivingEntity> _mob, float a)
@ -264,6 +298,35 @@ void PlayerRenderer::additionalRendering(shared_ptr<LivingEntity> _mob, float a)
// 4J - dynamic cast required because we aren't using templates/generics in our version
shared_ptr<Player> mob = dynamic_pointer_cast<Player>(_mob);
HumanoidModel *resModel;
if (mob != nullptr)
{
Textures *textures = Minecraft::GetInstance()->textures;
int skinId = mob->getPlayerDefaultSkin() - 1;
int defaultSkin = mob->getPlayerDefaultSkin() + 35;
if (slim[skinId] == true)
{
if (textures->getHeight(mob->customTextureUrl, defaultSkin) == 64)
resModel = static_cast<HumanoidModel *>(newHumanoidModelSlim);
else if (textures->getHeight(mob->customTextureUrl, defaultSkin) == 32)
resModel = static_cast<HumanoidModel *>(humanoidModelSlim);
}
else
{
if (textures->getHeight(mob->customTextureUrl, defaultSkin) == 64)
resModel = static_cast<HumanoidModel *>(newHumanoidModel);
else if (textures->getHeight(mob->customTextureUrl, defaultSkin) == 32)
resModel = static_cast<HumanoidModel *>(humanoidModel);
}
}
else
resModel = humanoidModel;
/*if (mob != nullptr && newHumanoidModelSlim != nullptr && (mob->getCustomSkin() >= 10 && mob->getCustomSkin() <= 18)) resModel = newHumanoidModelSlim;
else if (mob != nullptr && newHumanoidModel != nullptr && (mob->getCustomSkin() >= 2 && mob->getCustomSkin() <= 9)) resModel = newHumanoidModel;
else resModel = humanoidModel;*/
shared_ptr<ItemInstance> headGear = mob->inventory->getArmor(3);
if (headGear != nullptr)
@ -274,7 +337,7 @@ void PlayerRenderer::additionalRendering(shared_ptr<LivingEntity> _mob, float a)
if((uiAnimOverrideBitmask&(1<<HumanoidModel::eAnim_DontRenderArmour))==0)
{
glPushMatrix();
humanoidModel->head->translateTo(1 / 16.0f);
resModel->head->translateTo(1 / 16.0f);
if(headGear->getItem()->id < 256)
{
@ -322,7 +385,7 @@ void PlayerRenderer::additionalRendering(shared_ptr<LivingEntity> _mob, float a)
float s = 8 / 6.0f;
glScalef(s, s, s);
humanoidModel->renderEars(1 / 16.0f,true);
resModel->renderEars(1 / 16.0f,true);
glPopMatrix();
}
}
@ -368,7 +431,7 @@ void PlayerRenderer::additionalRendering(shared_ptr<LivingEntity> _mob, float a)
glRotatef(lean2 / 2, 0, 0, 1);
glRotatef(-lean2 / 2, 0, 1, 0);
glRotatef(180, 0, 1, 0);
humanoidModel->renderCloak(1 / 16.0f,true);
resModel->renderCloak(1 / 16.0f,true);
glPopMatrix();
}
@ -377,7 +440,7 @@ void PlayerRenderer::additionalRendering(shared_ptr<LivingEntity> _mob, float a)
if (item != nullptr)
{
glPushMatrix();
humanoidModel->arm0->translateTo(1 / 16.0f);
resModel->arm0->translateTo(1 / 16.0f);
glTranslatef(-1 / 16.0f, 7 / 16.0f, 1 / 16.0f);
if (mob->fishing != nullptr)
@ -470,7 +533,7 @@ void PlayerRenderer::additionalRendering(shared_ptr<LivingEntity> _mob, float a)
}
}
void PlayerRenderer::renderNameTags(shared_ptr<LivingEntity> player, double x, double y, double z, const wstring &msg, float scale, double dist)
void PlayerRenderer::renderNameTags(shared_ptr<LivingEntity> player, double x, double y, double z, wstring msg, float scale, double dist)
{
#if 0
if (dist < 10 * 10)
@ -496,17 +559,7 @@ void PlayerRenderer::renderNameTags(shared_ptr<LivingEntity> player, double x, d
}
#endif
shared_ptr<Player> pPlayer = dynamic_pointer_cast<Player>(player);
int color = getNametagColour(pPlayer->getPlayerIndex());
if (player->isSleeping())
{
renderNameTag(player, msg, x, y - 1.5f, z, 64, color);
}
else
{
renderNameTag(player, msg, x, y, z, 64, color);
}
LivingEntityRenderer::renderNameTags(player, x, y, z, msg, scale, dist);
}
void PlayerRenderer::scale(shared_ptr<LivingEntity> player, float a)
@ -517,18 +570,47 @@ void PlayerRenderer::scale(shared_ptr<LivingEntity> player, float a)
void PlayerRenderer::renderHand()
{
shared_ptr<Player> player = dynamic_pointer_cast<Player>(Minecraft::GetInstance()->player);
HumanoidModel *resModel;
if (player != nullptr)
{
Textures *textures = Minecraft::GetInstance()->textures;
int skinId = player->getPlayerDefaultSkin() - 1;
int defaultSkin = player->getPlayerDefaultSkin() + 35;
if (slim[skinId] == true)
{
if (textures->getHeight(player->customTextureUrl, defaultSkin) == 64)
resModel = static_cast<HumanoidModel *>(newHumanoidModelSlim);
else if (textures->getHeight(player->customTextureUrl, defaultSkin) == 32)
resModel = static_cast<HumanoidModel *>(humanoidModelSlim);
}
else
{
if (textures->getHeight(player->customTextureUrl, defaultSkin) == 64)
resModel = static_cast<HumanoidModel *>(newHumanoidModel);
else if (textures->getHeight(player->customTextureUrl, defaultSkin) == 32)
resModel = static_cast<HumanoidModel *>(humanoidModel);
}
}
else
resModel = humanoidModel;
/*if (player != nullptr && newHumanoidModelSlim != nullptr && (player->getCustomSkin() >= 10 && player->getCustomSkin() <= 18)) resModel = newHumanoidModelSlim;
else if (player != nullptr && newHumanoidModel != nullptr && (player->getCustomSkin() >= 2 && player->getCustomSkin() <= 9)) resModel = newHumanoidModel;
else resModel = humanoidModel;*/
float brightness = 1;
glColor3f(brightness, brightness, brightness);
humanoidModel->m_uiAnimOverrideBitmask = Minecraft::GetInstance()->player->getAnimOverrideBitmask();
armorParts1->eating = armorParts2->eating = humanoidModel->eating = humanoidModel->idle = false;
humanoidModel->attackTime = 0;
humanoidModel->setupAnim(0, 0, 0, 0, 0, 1 / 16.0f, Minecraft::GetInstance()->player);
resModel->m_uiAnimOverrideBitmask = player->getAnimOverrideBitmask();
armorParts1->eating = armorParts2->eating = resModel->eating = resModel->idle = false;
resModel->attackTime = 0;
resModel->setupAnim(0, 0, 0, 0, 0, 1 / 16.0f, Minecraft::GetInstance()->player);
// 4J-PB - does this skin have its arm0 disabled? (Dalek, etc)
if((humanoidModel->m_uiAnimOverrideBitmask&(1<<HumanoidModel::eAnim_DisableRenderArm0))==0)
{
humanoidModel->arm0->render(1 / 16.0f,true);
}
if((resModel->m_uiAnimOverrideBitmask&(1<<HumanoidModel::eAnim_DisableRenderArm0))==0)
resModel->arm0->render(1 / 16.0f,true);
}
void PlayerRenderer::setupPosition(shared_ptr<LivingEntity> _mob, double x, double y, double z)

View file

@ -1,6 +1,6 @@
#pragma once
#include "MobRenderer.h"
#include "../Minecraft.World/Player.h"
#include "..\Minecraft.World\Player.h"
class HumanoidModel;
@ -14,8 +14,13 @@ public:
private:
HumanoidModel *humanoidModel;
HumanoidModel *humanoidModelSlim;
HumanoidModel *newHumanoidModel;
HumanoidModel *newHumanoidModelSlim;
HumanoidModel *armorParts1;
HumanoidModel *armorParts2;
bool defaultSlimHands;
public:
PlayerRenderer();
@ -34,7 +39,7 @@ public:
protected:
virtual void additionalRendering(shared_ptr<LivingEntity> _mob, float a);
void renderNameTags(shared_ptr<LivingEntity> player, double x, double y, double z, const wstring &msg, float scale, double dist);
void renderNameTags(shared_ptr<LivingEntity> player, double x, double y, double z, wstring msg, float scale, double dist);
virtual void scale(shared_ptr<LivingEntity> _player, float a);
public:

View file

@ -9,6 +9,11 @@ enum eBodyPart
eBodyPart_Arm1,
eBodyPart_Leg0,
eBodyPart_Leg1,
eBodyPart_Jacket,
eBodyPart_Sleeve0,
eBodyPart_Sleeve1,
eBodyPart_Pants0,
eBodyPart_Pants1,
};
typedef struct

29
Minecraft.Client/Skins.h Normal file
View file

@ -0,0 +1,29 @@
#pragma once
#include <map>
using namespace std;
class AABB;
class Recipy;
class Object;
static std::map<int, bool> slim = {
{ 0, false },
{ 1, false },
{ 2, false },
{ 3, false },
{ 4, false },
{ 5, false },
{ 6, false },
{ 7, false },
{ 8, false },
{ 9, true },
{ 10, true },
{ 11, true },
{ 12, true },
{ 13, true },
{ 14, true },
{ 15, true },
{ 16, true },
{ 17, true },
{ 18, true },
};

View file

@ -72,6 +72,16 @@ const wchar_t *Textures::preLoaded[TN_COUNT] =
L"mob/char5",
L"mob/char6",
L"mob/char7",
L"mob/char8",
L"mob/char9",
L"mob/char10",
L"mob/char11",
L"mob/char12",
L"mob/char13",
L"mob/char14",
L"mob/char15",
L"mob/char16",
L"mob/char17",
L"terrain/moon",
L"terrain/sun",
L"armor/power",
@ -1048,7 +1058,6 @@ int Textures::loadHttpTexture(const wstring& url, const wstring& backup)
}
if (texture == nullptr || texture->id < 0)
{
if (backup.empty() ) return -1;
return loadTexture(TN_COUNT, backup);
}
return texture->id;
@ -1200,6 +1209,59 @@ int Textures::loadMemTexture(const wstring& url, int backup)
return texture->id;
}
// 4J-PB - adding for texture in memory (from global title storage)
int Textures::getHeight(const wstring& url, int backup)
{
MemTexture *texture = nullptr;
auto it = memTextures.find(url);
if (it != memTextures.end())
{
texture = (*it).second;
}
if(texture == nullptr && app.IsFileInMemoryTextures(url))
{
// If we haven't loaded it yet, but we have the data for it then add it
texture = addMemTexture(url, new MobSkinMemTextureProcessor() );
}
if(texture != nullptr)
{
if (texture->loadedImage != nullptr && !texture->isLoaded)
{
// 4J - Disable mipmapping in general for skins & capes. Have seen problems with edge-on polys for some eg mumbo jumbo
if( ( url.substr(0,7) == L"dlcskin" ) ||
( url.substr(0,7) == L"dlccape" ) )
{
MIPMAP = false;
}
if (texture->id < 0)
{
texture->id = getTexture(texture->loadedImage, C4JRender::TEXTURE_FORMAT_RxGyBzAw, MIPMAP);
}
else
{
loadTexture(texture->loadedImage, texture->id);
}
texture->isLoaded = true;
MIPMAP = true;
}
}
if (texture == nullptr || texture->id < 0)
{
BufferedImage* img = readImage(static_cast<TEXTURE_NAME>(backup), wstring(preLoaded[backup]) + L".png");
if (img)
{
int h = img->getHeight();
delete img;
return h;
}
return 32;
}
return texture->loadedImage->getHeight();
}
MemTexture *Textures::addMemTexture(const wstring& name,MemTextureProcessor *processor)
{
MemTexture *texture = nullptr;
@ -1600,6 +1662,16 @@ TEXTURE_NAME OriginalImages[] =
TN_MOB_CHAR5,
TN_MOB_CHAR6,
TN_MOB_CHAR7,
TN_MOB_CHAR8,
TN_MOB_CHAR9,
TN_MOB_CHAR10,
TN_MOB_CHAR11,
TN_MOB_CHAR12,
TN_MOB_CHAR13,
TN_MOB_CHAR14,
TN_MOB_CHAR15,
TN_MOB_CHAR16,
TN_MOB_CHAR17,
TN_MISC_MAPBG,

View file

@ -1,5 +1,5 @@
#pragma once
#include "../Minecraft.World/ArrayWithLength.h"
#include "..\Minecraft.World\ArrayWithLength.h"
class DynamicTexture;
class BufferedImage;
@ -63,6 +63,16 @@ typedef enum _TEXTURE_NAME
TN_MOB_CHAR5,
TN_MOB_CHAR6,
TN_MOB_CHAR7,
TN_MOB_CHAR8,
TN_MOB_CHAR9,
TN_MOB_CHAR10,
TN_MOB_CHAR11,
TN_MOB_CHAR12,
TN_MOB_CHAR13,
TN_MOB_CHAR14,
TN_MOB_CHAR15,
TN_MOB_CHAR16,
TN_MOB_CHAR17,
TN_TERRAIN_MOON,
TN_TERRAIN_SUN,
TN_POWERED_CREEPER,
@ -330,6 +340,7 @@ public:
// 4J-PB - for the GTS textures
int loadMemTexture(const wstring& url, const wstring& backup);
int loadMemTexture(const wstring& url, int backup);
int getHeight(const wstring& url, int backup);
MemTexture * addMemTexture(const wstring& url, MemTextureProcessor *processor);
//MemTexture * getMemTexture(const wstring& url, MemTextureProcessor *processor);
void removeMemTexture(const wstring& url);

View file

@ -1,7 +1,7 @@
#include "stdafx.h"
#include "ModelPart.h"
#include "VillagerZombieModel.h"
#include "../Minecraft.World/Mth.h"
#include "..\Minecraft.World\Mth.h"
void VillagerZombieModel::_init(float g, float yOffset, bool isArmor)
{
@ -25,12 +25,12 @@ void VillagerZombieModel::_init(float g, float yOffset, bool isArmor)
head->compile(1.0f/16.0f);
}
VillagerZombieModel::VillagerZombieModel() : HumanoidModel(0, 0, 64, 64)
VillagerZombieModel::VillagerZombieModel() : HumanoidModel(0, 0, 64, 64, false, true, true)
{
_init(0, 0, false);
}
VillagerZombieModel::VillagerZombieModel(float g, float yOffset, bool isArmor) : HumanoidModel(g, 0, 64, isArmor ? 32 : 64)
VillagerZombieModel::VillagerZombieModel(float g, float yOffset, bool isArmor) : HumanoidModel(g, 0, 64, isArmor ? 32 : 64 , false, true, isArmor ? true : false)
{
_init(g, yOffset, isArmor);
}

View file

@ -35,6 +35,16 @@ enum EDefaultSkins
eDefaultSkins_Skin5,
eDefaultSkins_Skin6,
eDefaultSkins_Skin7,
eDefaultSkins_Skin8,
eDefaultSkins_Skin9,
eDefaultSkins_Skin10,
eDefaultSkins_Skin11,
eDefaultSkins_Skin12,
eDefaultSkins_Skin13,
eDefaultSkins_Skin14,
eDefaultSkins_Skin15,
eDefaultSkins_Skin16,
eDefaultSkins_Skin17,
eDefaultSkins_Count,
};

View file

@ -37,10 +37,10 @@
#include "Player.h"
#include "ParticleTypes.h"
#include "../Minecraft.Client/Textures.h"
#include "..\Minecraft.Client\Textures.h"
#include "../Minecraft.Client/LocalPlayer.h"
#include "../Minecraft.Client/HumanoidModel.h"
#include "..\Minecraft.Client\LocalPlayer.h"
#include "..\Minecraft.Client\HumanoidModel.h"
#include "SoundTypes.h"
@ -2702,6 +2702,26 @@ int Player::getTexture()
return TN_MOB_CHAR6; // 4J - was L"/mob/char6.png";
case eDefaultSkins_Skin7:
return TN_MOB_CHAR7; // 4J - was L"/mob/char7.png";
case eDefaultSkins_Skin8:
return TN_MOB_CHAR8; // 4J - was L"/mob/char8.png";
case eDefaultSkins_Skin9:
return TN_MOB_CHAR9; // 4J - was L"/mob/char9.png";
case eDefaultSkins_Skin10:
return TN_MOB_CHAR10; // 4J - was L"/mob/char10.png";
case eDefaultSkins_Skin11:
return TN_MOB_CHAR11; // 4J - was L"/mob/char11.png";
case eDefaultSkins_Skin12:
return TN_MOB_CHAR12; // 4J - was L"/mob/char12.png";
case eDefaultSkins_Skin13:
return TN_MOB_CHAR13; // 4J - was L"/mob/char13.png";
case eDefaultSkins_Skin14:
return TN_MOB_CHAR14; // 4J - was L"/mob/char14.png";
case eDefaultSkins_Skin15:
return TN_MOB_CHAR15; // 4J - was L"/mob/char15.png";
case eDefaultSkins_Skin16:
return TN_MOB_CHAR16; // 4J - was L"/mob/char16.png";
case eDefaultSkins_Skin17:
return TN_MOB_CHAR17; // 4J - was L"/mob/char17.png";
default:
return TN_MOB_CHAR; // 4J - was L"/mob/char.png";