Revert "Merge pull request #12 from ItzSonicFaner/LegacyEvolved"

This reverts commit f5b134aa90, reversing
changes made to f0b06116c2.
This commit is contained in:
piebot 2026-03-24 15:12:06 +03:00
parent 5b2fd49b40
commit d10deb4cc2
52 changed files with 90 additions and 737 deletions

0
.gitattributes vendored Normal file
View file

View file

@ -257,15 +257,7 @@ void UIControl_PlayerSkinPreview::render(EntityRenderer *renderer, double x, dou
glPushMatrix();
glDisable(GL_CULL_FACE);
HumanoidModel *model;
Textures *t = Minecraft::GetInstance()->textures;
if (t->loadMemTexture(m_customTextureUrl, m_backupTexture) >= 46 && t->loadMemTexture(m_customTextureUrl, m_backupTexture) <= 54)
model = static_cast<HumanoidModel *>(renderer->getNewModelSlim());
else if (t->loadMemTexture(m_customTextureUrl, m_backupTexture) >= 37 && t->loadMemTexture(m_customTextureUrl, m_backupTexture) <= 45)
model = static_cast<HumanoidModel *>(renderer->getNewModel());
else
model = static_cast<HumanoidModel *>(renderer->getModel());
HumanoidModel *model = static_cast<HumanoidModel *>(renderer->getModel());
//getAttackAnim(mob, a);
//if (armor != nullptr) armor->attackTime = model->attackTime;

View file

@ -24,16 +24,6 @@ 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)
@ -1003,36 +993,6 @@ 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;

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.4 KiB

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.1 KiB

After

Width:  |  Height:  |  Size: 4.2 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.3 KiB

After

Width:  |  Height:  |  Size: 4.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.1 KiB

After

Width:  |  Height:  |  Size: 4.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.5 KiB

After

Width:  |  Height:  |  Size: 4.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.3 KiB

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

View file

@ -19,9 +19,6 @@ 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,9 +30,6 @@ 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
@ -71,8 +68,5 @@ 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

@ -30,21 +30,6 @@ 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
@ -73,17 +58,11 @@ ModelPart * HumanoidModel::AddOrRetrievePart(SKIN_BOX *pBox)
return pNewBox;
}
void HumanoidModel::_init(float g, float yOffset, int texWidth, int texHeight, bool slimHands, bool mirror)
void HumanoidModel::_init(float g, float yOffset, int texWidth, int texHeight)
{
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
@ -99,90 +78,28 @@ void HumanoidModel::_init(float g, float yOffset, int texWidth, int texHeight, b
hair->addHumanoidBox(-4, -8, -4, 8, 8, 8, g + 0.5f); // Head
hair->setPos(0, 0 + yOffset, 0);
if (texWidth == 64 && texHeight == 64)
{
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);
if (texWidth == 64 && texHeight == 64)
{
arm0 = new ModelPart(this, 24 + 16, 16);
arm1 = new ModelPart(this, 16 + 16, 48);
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)
{
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 = new ModelPart(this, 24 + 16, 16);
arm0->addHumanoidBox(-3, -2, -2, 4, 12, 4, g); // Arm0
arm0->setPos(-5, 2 + yOffset, 0);
arm1 = new ModelPart(this, 24 + 16, 16);
arm1->bMirror = true;
arm1->addHumanoidBox(-1, -2, -2, 4, 12, 4, g); // Arm1
arm1->setPos(5, 2 + yOffset, 0);
if (mirror == true)
arm1->bMirror = true;
if (texWidth == 64 && texHeight == 64)
{
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)
{
leg0 = new ModelPart(this, 0, 16);
leg1 = new ModelPart(this, 0, 16);
}
leg0 = 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);
@ -195,17 +112,6 @@ void HumanoidModel::_init(float g, float yOffset, int texWidth, int texHeight, b
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;
@ -219,30 +125,19 @@ void HumanoidModel::_init(float g, float yOffset, int texWidth, int texHeight, b
m_uiAnimOverrideBitmask = 0L;
}
HumanoidModel::HumanoidModel() : Model()
{
_init(0, 0, 64, 32, false, true);
_init(0, 0, 64, 32);
}
HumanoidModel::HumanoidModel(float g) : Model()
{
_init(g, 0, 64, 32, false, true);
_init(g, 0, 64, 32);
}
HumanoidModel::HumanoidModel(float g, float yOffset, int texWidth, int texHeight) : Model()
{
_init(g,yOffset,texWidth,texHeight, false, true);
}
HumanoidModel::HumanoidModel(float g, float yOffset, int texWidth, int texHeight, bool slimHands) : Model()
{
_init(g,yOffset,texWidth,texHeight, slimHands, true);
}
HumanoidModel::HumanoidModel(float g, float yOffset, int texWidth, int texHeight, bool slimHands, bool mirror) : Model()
{
_init(g,yOffset,texWidth,texHeight, slimHands, mirror);
_init(g,yOffset,texWidth,texHeight);
}
void HumanoidModel::render(shared_ptr<Entity> entity, float time, float r, float bob, float yRot, float xRot, float scale, bool usecompiled)
@ -271,18 +166,6 @@ 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
@ -294,17 +177,6 @@ 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);
}
}
@ -319,9 +191,6 @@ 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))
@ -331,17 +200,6 @@ 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))
{
@ -349,18 +207,6 @@ 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))
{
@ -368,18 +214,6 @@ 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))
@ -388,18 +222,6 @@ 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
{
@ -407,18 +229,6 @@ 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;
@ -429,15 +239,9 @@ 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;
@ -445,24 +249,6 @@ 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
{
@ -470,18 +256,8 @@ 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;
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;
leg0->yRot = HALF_PI * 0.2f;
leg1->yRot = -HALF_PI * 0.2f;
}
}
else if(idle && !sneaking )
@ -490,18 +266,6 @@ 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))
{
@ -510,68 +274,31 @@ 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;
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;
}
leg1->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;
@ -584,20 +311,6 @@ 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;
@ -605,27 +318,15 @@ 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;
if (sleeve0)
{
sleeve0->xRot -= aa * 1.2f + bb;
sleeve0->yRot += body->yRot * 2.0f;
}
arm0->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;
}
}
@ -642,12 +343,6 @@ 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)
@ -671,39 +366,6 @@ 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
{
@ -723,38 +385,6 @@ 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
@ -763,15 +393,6 @@ 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;
@ -783,17 +404,6 @@ 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
{
@ -806,37 +416,15 @@ 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;
@ -854,26 +442,6 @@ 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);
}
}
}
}
@ -909,41 +477,18 @@ 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);
@ -951,15 +496,4 @@ 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, *jacket, *arm0, *sleeve0, *arm1, *sleeve1, *leg0, *pants0, *leg1, *pants1, *ear, *cloak;
ModelPart *head, *hair, *body, *arm0, *arm1, *leg0, *leg1, *ear, *cloak;
//ModelPart *hat;
int holdingLeftHand;
@ -37,12 +37,8 @@ public:
eAnim_DisableRenderLeg0,
eAnim_DisableRenderLeg1,
eAnim_DisableRenderHair,
eAnim_SmallModel,
eAnim_DisableRenderJacket,
eAnim_DisableRenderSleeve0,
eAnim_DisableRenderSleeve1,
eAnim_DisableRenderPants0,
eAnim_DisableRenderPants1
eAnim_SmallModel // Maggie Simpson for riding horse, etc
};
static const unsigned int m_staticBitmaskIgnorePlayerCustomAnimSetting= (1<<HumanoidModel::eAnim_ForceAnim) |
@ -51,20 +47,13 @@ public:
(1<<HumanoidModel::eAnim_DisableRenderTorso) |
(1<<HumanoidModel::eAnim_DisableRenderLeg0) |
(1<<HumanoidModel::eAnim_DisableRenderLeg1) |
(1<<HumanoidModel::eAnim_DisableRenderHair) |
(1<<HumanoidModel::eAnim_DisableRenderJacket) |
(1<<HumanoidModel::eAnim_DisableRenderSleeve0) |
(1<<HumanoidModel::eAnim_DisableRenderSleeve1) |
(1<<HumanoidModel::eAnim_DisableRenderPants0) |
(1<<HumanoidModel::eAnim_DisableRenderPants1);
(1<<HumanoidModel::eAnim_DisableRenderHair);
void _init(float g, float yOffset, int texWidth, int texHeight, bool slimHands, bool mirror); // 4J added
void _init(float g, float yOffset, int texWidth, int texHeight); // 4J added
HumanoidModel();
HumanoidModel(float g);
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);
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

@ -9,24 +9,13 @@
#include "..\Minecraft.World\Mth.h"
#include "..\Minecraft.World\Player.h"
ResourceLocation LivingEntityRenderer::ENCHANT_GLINT_LOCATION = ResourceLocation(TN__BLUR__MISC_GLINT);
int LivingEntityRenderer::MAX_ARMOR_LAYERS = 4;
LivingEntityRenderer::LivingEntityRenderer(Model *model, float shadow, bool slimHands, bool createNewVar)
LivingEntityRenderer::LivingEntityRenderer(Model *model, float shadow)
{
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;
}
@ -54,27 +43,22 @@ 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);
if (player != nullptr && newModelSlim != nullptr && (player->getCustomSkin() >= 10 && player->getCustomSkin() <= 18)) resModel = newModelSlim;
else if (player != nullptr && newModel != nullptr && (player->getCustomSkin() >= 0 && player->getCustomSkin() <= 9)) resModel = newModel;
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;
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;
/*try*/
{
@ -120,7 +104,7 @@ void LivingEntityRenderer::render(shared_ptr<Entity> _mob, double x, double y, d
if (ws > 1) ws = 1;
glEnable(GL_ALPHA_TEST);
resModel->prepareMobModel(mob, wp, ws, a);
model->prepareMobModel(mob, wp, ws, a);
renderModel(mob, wp, ws, bob, headRot - bodyRot, headRotx, fScale);
for (int i = 0; i < MAX_ARMOR_LAYERS; i++)
@ -204,7 +188,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);
resModel->render(mob, wp, ws, bob, headRot - bodyRot, headRotx, fScale, false);
model->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)
@ -222,7 +206,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);
resModel->render(mob, wp, ws, bob, headRot - bodyRot, headRotx, fScale, false);
model->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)
@ -259,17 +243,10 @@ 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 && newModelSlim != nullptr && (player->getCustomSkin() >= 10 && player->getCustomSkin() <= 18)) resModel = newModelSlim;
else if (player != nullptr && newModel != nullptr && (player->getCustomSkin() >= 0 && player->getCustomSkin() <= 9)) resModel = newModel;
else resModel = model;
bindTexture(mob);
if (!mob->isInvisible())
{
resModel->render(mob, wp, ws, bob, headRotMinusBodyRot, headRotx, scale, true);
model->render(mob, wp, ws, bob, headRotMinusBodyRot, headRotx, scale, true);
}
else if(!mob->isInvisibleTo(dynamic_pointer_cast<Player>(Minecraft::GetInstance()->player)))
{
@ -279,7 +256,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);
resModel->render(mob, wp, ws, bob, headRotMinusBodyRot, headRotx, scale, true);
model->render(mob, wp, ws, bob, headRotMinusBodyRot, headRotx, scale, true);
glDisable(GL_BLEND);
glAlphaFunc(GL_GREATER, .1f);
glPopMatrix();
@ -287,7 +264,7 @@ void LivingEntityRenderer::renderModel(shared_ptr<LivingEntity> mob, float wp, f
}
else
{
resModel->setupAnim(wp, ws, bob, headRotMinusBodyRot, headRotx, scale, mob);
model->setupAnim(wp, ws, bob, headRotMinusBodyRot, headRotx, scale, mob);
}
}
@ -337,15 +314,7 @@ 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 && newModelSlim != nullptr && (player->getCustomSkin() >= 10 && player->getCustomSkin() <= 18)) resModel = newModelSlim;
else if (player != nullptr && newModel != nullptr && (player->getCustomSkin() >= 0 && player->getCustomSkin() <= 9)) resModel = newModel;
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);
@ -354,10 +323,7 @@ void LivingEntityRenderer::renderArrows(shared_ptr<LivingEntity> mob, float a)
for (int i = 0; i < arrowCount; i++)
{
glPushMatrix();
ModelPart *modelPart;
modelPart = resModel->getRandomModelPart(random);
ModelPart *modelPart = model->getRandomModelPart(random);
Cube *cube = modelPart->cubes[random.nextInt(modelPart->cubes.size())];
modelPart->translateTo(1 / 16.0f);
float xd = random.nextFloat();
@ -392,7 +358,7 @@ void LivingEntityRenderer::renderArrows(shared_ptr<LivingEntity> mob, float a)
int LivingEntityRenderer::prepareArmorOverlay(shared_ptr<LivingEntity> mob, int layer, float a)
{
return prepareArmor(mob, layer, a);
return -1;
}
int LivingEntityRenderer::prepareArmor(shared_ptr<LivingEntity> mob, int layer, float a)
@ -536,7 +502,7 @@ void LivingEntityRenderer::renderNameTag(shared_ptr<LivingEntity> mob, const wst
constexpr float s = 1 / 60.0f * size;
glPushMatrix();
glTranslatef(static_cast<float>(x) + 0, static_cast<float>(y) + mob->bbHeight + 0.5f, static_cast<float>(z));
glTranslatef(static_cast<float>(x), 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

@ -19,7 +19,7 @@ protected:
Model *armor;
public:
LivingEntityRenderer(Model *model, float shadow, bool slimHands = 0, bool createNewVar = 0);
LivingEntityRenderer(Model *model, float shadow);
virtual void render(shared_ptr<Entity> mob, double x, double y, double z, float rot, float a);
virtual void setArmor(Model *armor);

View file

@ -55,12 +55,9 @@ static unsigned int nametagColorForIndex(int index)
ResourceLocation PlayerRenderer::DEFAULT_LOCATION = ResourceLocation(TN_MOB_CHAR);
PlayerRenderer::PlayerRenderer() : LivingEntityRenderer( new HumanoidModel(0), 0.5f, true, true )
PlayerRenderer::PlayerRenderer() : LivingEntityRenderer( new HumanoidModel(0), 0.5f )
{
humanoidModel = static_cast<HumanoidModel *>(model);
humanoidModelSlim = static_cast<HumanoidModel *>(modelSlim);
newHumanoidModel = static_cast<HumanoidModel *>(newModel);
newHumanoidModelSlim = static_cast<HumanoidModel *>(newModelSlim);
humanoidModel = static_cast<HumanoidModel *>(model);
armorParts1 = new HumanoidModel(1.0f);
armorParts2 = new HumanoidModel(0.5f);
@ -163,19 +160,12 @@ 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 && newHumanoidModelSlim != nullptr && (mob->getCustomSkin() >= 10 && mob->getCustomSkin() <= 18)) resModel = newHumanoidModelSlim;
else if (mob != nullptr && newHumanoidModel != nullptr && (mob->getCustomSkin() >= 0 && mob->getCustomSkin() <= 9)) resModel = newHumanoidModel;
else resModel = humanoidModel;
shared_ptr<ItemInstance> item = mob->inventory->getSelected();
armorParts1->holdingRightHand = armorParts2->holdingRightHand = resModel->holdingRightHand = item != nullptr ? 1 : 0;
armorParts1->holdingRightHand = armorParts2->holdingRightHand = humanoidModel->holdingRightHand = item != nullptr ? 1 : 0;
if (item != nullptr)
{
if (mob->getUseItemDuration() > 0)
@ -183,11 +173,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 = resModel->holdingRightHand = 3;
armorParts1->holdingRightHand = armorParts2->holdingRightHand = humanoidModel->holdingRightHand = 3;
}
else if (anim == UseAnim_bow)
{
armorParts1->bowAndArrow = armorParts2->bowAndArrow = resModel->bowAndArrow = true;
armorParts1->bowAndArrow = armorParts2->bowAndArrow = humanoidModel->bowAndArrow = true;
}
}
}
@ -197,17 +187,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 = resModel->eating = true;
armorParts1->eating_t = armorParts2->eating_t = resModel->eating_t = t;
armorParts1->eating_swing = armorParts2->eating_swing = resModel->eating_swing = swing;
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;
}
else
{
armorParts1->eating = armorParts2->eating = resModel->eating = false;
armorParts1->eating = armorParts2->eating = humanoidModel->eating = false;
}
armorParts1->sneaking = armorParts2->sneaking = resModel->sneaking = mob->isSneaking();
armorParts1->sneaking = armorParts2->sneaking = humanoidModel->sneaking = mob->isSneaking();
double yp = y - mob->heightOffset;
if (mob->isSneaking() && !mob->instanceof(eTYPE_LOCALPLAYER))
{
@ -219,20 +209,20 @@ void PlayerRenderer::render(shared_ptr<Entity> _mob, double x, double y, double
{
if(mob->isIdle())
{
resModel->idle=true;
humanoidModel->idle=true;
armorParts1->idle=true;
armorParts2->idle=true;
}
else
{
resModel->idle=false;
humanoidModel->idle=false;
armorParts1->idle=false;
armorParts2->idle=false;
}
}
else
{
resModel->idle=false;
humanoidModel->idle=false;
armorParts1->idle=false;
armorParts2->idle=false;
}
@ -258,9 +248,10 @@ void PlayerRenderer::render(shared_ptr<Entity> _mob, double x, double y, double
pModelPart->visible=false;
}
}
armorParts1->bowAndArrow = armorParts2->bowAndArrow = resModel->bowAndArrow = false;
armorParts1->sneaking = armorParts2->sneaking = resModel->sneaking = false;
armorParts1->holdingRightHand = armorParts2->holdingRightHand = resModel->holdingRightHand = 0;
armorParts1->bowAndArrow = armorParts2->bowAndArrow = humanoidModel->bowAndArrow = false;
armorParts1->sneaking = armorParts2->sneaking = humanoidModel->sneaking = false;
armorParts1->holdingRightHand = armorParts2->holdingRightHand = humanoidModel->holdingRightHand = 0;
}
void PlayerRenderer::additionalRendering(shared_ptr<LivingEntity> _mob, float a)
@ -273,11 +264,6 @@ 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 && newHumanoidModelSlim != nullptr && (mob->getCustomSkin() >= 10 && mob->getCustomSkin() <= 18)) resModel = newHumanoidModelSlim;
else if (mob != nullptr && newHumanoidModel != nullptr && (mob->getCustomSkin() >= 0 && mob->getCustomSkin() <= 9)) resModel = newHumanoidModel;
else resModel = humanoidModel;
shared_ptr<ItemInstance> headGear = mob->inventory->getArmor(3);
if (headGear != nullptr)
@ -288,7 +274,7 @@ void PlayerRenderer::additionalRendering(shared_ptr<LivingEntity> _mob, float a)
if((uiAnimOverrideBitmask&(1<<HumanoidModel::eAnim_DontRenderArmour))==0)
{
glPushMatrix();
resModel->head->translateTo(1 / 16.0f);
humanoidModel->head->translateTo(1 / 16.0f);
if(headGear->getItem()->id < 256)
{
@ -336,7 +322,7 @@ void PlayerRenderer::additionalRendering(shared_ptr<LivingEntity> _mob, float a)
float s = 8 / 6.0f;
glScalef(s, s, s);
resModel->renderEars(1 / 16.0f,true);
humanoidModel->renderEars(1 / 16.0f,true);
glPopMatrix();
}
}
@ -382,7 +368,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);
resModel->renderCloak(1 / 16.0f,true);
humanoidModel->renderCloak(1 / 16.0f,true);
glPopMatrix();
}
@ -391,7 +377,7 @@ void PlayerRenderer::additionalRendering(shared_ptr<LivingEntity> _mob, float a)
if (item != nullptr)
{
glPushMatrix();
resModel->arm0->translateTo(1 / 16.0f);
humanoidModel->arm0->translateTo(1 / 16.0f);
glTranslatef(-1 / 16.0f, 7 / 16.0f, 1 / 16.0f);
if (mob->fishing != nullptr)
@ -484,7 +470,7 @@ void PlayerRenderer::additionalRendering(shared_ptr<LivingEntity> _mob, float a)
}
}
void PlayerRenderer::renderNameTags(shared_ptr<LivingEntity> player, double x, double y, double z, wstring msg, float scale, double dist)
void PlayerRenderer::renderNameTags(shared_ptr<LivingEntity> player, double x, double y, double z, const wstring &msg, float scale, double dist)
{
#if 0
if (dist < 10 * 10)
@ -510,7 +496,17 @@ void PlayerRenderer::renderNameTags(shared_ptr<LivingEntity> player, double x, d
}
#endif
LivingEntityRenderer::renderNameTags(player, x, y, z, msg, scale, dist);
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);
}
}
void PlayerRenderer::scale(shared_ptr<LivingEntity> player, float a)
@ -521,23 +517,18 @@ 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 && newHumanoidModelSlim != nullptr && (player->getCustomSkin() >= 10 && player->getCustomSkin() <= 18)) resModel = newHumanoidModelSlim;
else if (player != nullptr && newHumanoidModel != nullptr && (player->getCustomSkin() >= 0 && player->getCustomSkin() <= 9)) resModel = newHumanoidModel;
else resModel = humanoidModel;
float brightness = 1;
glColor3f(brightness, brightness, brightness);
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);
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);
// 4J-PB - does this skin have its arm0 disabled? (Dalek, etc)
if((resModel->m_uiAnimOverrideBitmask&(1<<HumanoidModel::eAnim_DisableRenderArm0))==0)
resModel->arm0->render(1 / 16.0f,true);
if((humanoidModel->m_uiAnimOverrideBitmask&(1<<HumanoidModel::eAnim_DisableRenderArm0))==0)
{
humanoidModel->arm0->render(1 / 16.0f,true);
}
}
void PlayerRenderer::setupPosition(shared_ptr<LivingEntity> _mob, double x, double y, double z)

View file

@ -14,13 +14,8 @@ public:
private:
HumanoidModel *humanoidModel;
HumanoidModel *humanoidModelSlim;
HumanoidModel *newHumanoidModel;
HumanoidModel *newHumanoidModelSlim;
HumanoidModel *armorParts1;
HumanoidModel *armorParts2;
bool defaultSlimHands;
public:
PlayerRenderer();
@ -39,7 +34,7 @@ public:
protected:
virtual void additionalRendering(shared_ptr<LivingEntity> _mob, float a);
void renderNameTags(shared_ptr<LivingEntity> player, double x, double y, double z, wstring msg, float scale, double dist);
void renderNameTags(shared_ptr<LivingEntity> player, double x, double y, double z, const wstring &msg, float scale, double dist);
virtual void scale(shared_ptr<LivingEntity> _player, float a);
public:

View file

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

View file

@ -72,16 +72,6 @@ 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",
@ -1610,16 +1600,6 @@ 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

@ -63,16 +63,6 @@ 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,

View file

@ -35,16 +35,6 @@ 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

@ -2702,26 +2702,6 @@ 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";