Merge pull request #12 from ItzSonicFaner/LegacyEvolved

Skins update
This commit is contained in:
piebot 2026-03-23 10:29:17 +03:00 committed by GitHub
commit f5b134aa90
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
52 changed files with 737 additions and 90 deletions

0
.gitattributes vendored
View file

View file

@ -257,7 +257,15 @@ void UIControl_PlayerSkinPreview::render(EntityRenderer *renderer, double x, dou
glPushMatrix(); glPushMatrix();
glDisable(GL_CULL_FACE); glDisable(GL_CULL_FACE);
HumanoidModel *model = static_cast<HumanoidModel *>(renderer->getModel()); 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());
//getAttackAnim(mob, a); //getAttackAnim(mob, a);
//if (armor != nullptr) armor->attackTime = model->attackTime; //if (armor != nullptr) armor->attackTime = model->attackTime;

View file

@ -24,6 +24,16 @@ const WCHAR *UIScene_SkinSelectMenu::wchDefaultNamesA[]=
L"Prisoner Steve", L"Prisoner Steve",
L"Cyclist Steve", L"Cyclist Steve",
L"Boxer 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) 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: case eDefaultSkins_Skin7:
texture = TN_MOB_CHAR7; texture = TN_MOB_CHAR7;
break; 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; return texture;

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() EntityRenderer::EntityRenderer()
{ {
model = nullptr; model = nullptr;
modelSlim = nullptr;
newModel = nullptr;
newModelSlim = nullptr;
tileRenderer = new TileRenderer(); tileRenderer = new TileRenderer();
shadowRadius = 0; shadowRadius = 0;
shadowStrength = 1.0f; shadowStrength = 1.0f;

View file

@ -30,6 +30,9 @@ private:
protected: 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 *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: protected:
TileRenderer *tileRenderer; // 4J - changed to protected so derived classes can use instead of shadowing their own TileRenderer *tileRenderer; // 4J - changed to protected so derived classes can use instead of shadowing their own
@ -68,5 +71,8 @@ public:
public: public:
// 4J Added // 4J Added
virtual Model *getModel() { return model; } 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) {} virtual void SetItemFrame(bool bSet) {}
}; };

View file

@ -30,6 +30,21 @@ ModelPart * HumanoidModel::AddOrRetrievePart(SKIN_BOX *pBox)
case eBodyPart_Leg1: case eBodyPart_Leg1:
pAttachTo=leg1; pAttachTo=leg1;
break; 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 // first check this box doesn't already exist
@ -58,11 +73,17 @@ ModelPart * HumanoidModel::AddOrRetrievePart(SKIN_BOX *pBox)
return pNewBox; 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)
{ {
this->texWidth = texWidth; this->texWidth = texWidth;
this->texHeight = texHeight; this->texHeight = texHeight;
jacket = nullptr;
sleeve0 = nullptr;
sleeve1 = nullptr;
pants0 = nullptr;
pants1 = nullptr;
m_fYOffset=yOffset; m_fYOffset=yOffset;
cloak = new ModelPart(this, 0, 0); cloak = new ModelPart(this, 0, 0);
cloak->addHumanoidBox(-5, -0, -1, 10, 16, 1, g); // Cloak 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->addHumanoidBox(-4, -8, -4, 8, 8, 8, g + 0.5f); // Head
hair->setPos(0, 0 + yOffset, 0); 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 = new ModelPart(this, 16, 16);
body->addHumanoidBox(-4, 0, -2, 8, 12, 4, g); // Body body->addHumanoidBox(-4, 0, -2, 8, 12, 4, g); // Body
body->setPos(0, 0 + yOffset, 0); body->setPos(0, 0 + yOffset, 0);
arm0 = new ModelPart(this, 24 + 16, 16); if (texWidth == 64 && texHeight == 64)
arm0->addHumanoidBox(-3, -2, -2, 4, 12, 4, g); // Arm0 {
arm0->setPos(-5, 2 + yOffset, 0); arm0 = new ModelPart(this, 24 + 16, 16);
arm1 = new ModelPart(this, 16 + 16, 48);
arm1 = new ModelPart(this, 24 + 16, 16); sleeve0 = new ModelPart(this, 24 + 16, 32);
arm1->bMirror = true; sleeve1 = new ModelPart(this, 32 + 16, 48);
arm1->addHumanoidBox(-1, -2, -2, 4, 12, 4, g); // Arm1
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->setPos(-5, 2 + yOffset, 0);
arm1->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)
{
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->addHumanoidBox(-2, 0, -2, 4, 12, 4, g); // Leg0 leg0->addHumanoidBox(-2, 0, -2, 4, 12, 4, g); // Leg0
leg0->setPos(-1.9, 12 + yOffset, 0); 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->addHumanoidBox(-2, 0, -2, 4, 12, 4, g); // Leg1
leg1->setPos(1.9, 12 + yOffset, 0); 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 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 // 4J Stu - Not just performance, but alpha+depth tests don't work right unless we compile here
cloak->compile(1.0f/16.0f); 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); leg1->compile(1.0f/16.0f);
hair->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; holdingLeftHand=0;
holdingRightHand=0; holdingRightHand=0;
sneaking=false; sneaking=false;
@ -125,19 +219,30 @@ void HumanoidModel::_init(float g, float yOffset, int texWidth, int texHeight)
m_uiAnimOverrideBitmask = 0L; m_uiAnimOverrideBitmask = 0L;
} }
HumanoidModel::HumanoidModel() : Model() HumanoidModel::HumanoidModel() : Model()
{ {
_init(0, 0, 64, 32); _init(0, 0, 64, 32, false, true);
} }
HumanoidModel::HumanoidModel(float g) : Model() HumanoidModel::HumanoidModel(float g) : Model()
{ {
_init(g, 0, 64, 32); _init(g, 0, 64, 32, false, true);
} }
HumanoidModel::HumanoidModel(float g, float yOffset, int texWidth, int texHeight) : Model() HumanoidModel::HumanoidModel(float g, float yOffset, int texWidth, int texHeight) : Model()
{ {
_init(g,yOffset,texWidth,texHeight); _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);
} }
void HumanoidModel::render(shared_ptr<Entity> entity, float time, float r, float bob, float yRot, float xRot, float scale, bool usecompiled) void HumanoidModel::render(shared_ptr<Entity> entity, float time, float r, float bob, float yRot, float xRot, float scale, bool usecompiled)
@ -166,6 +271,18 @@ void HumanoidModel::render(shared_ptr<Entity> entity, float time, float r, float
leg0->render(scale, usecompiled); leg0->render(scale, usecompiled);
leg1->render(scale, usecompiled); leg1->render(scale, usecompiled);
hair->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(); glPopMatrix();
} }
else else
@ -177,6 +294,17 @@ void HumanoidModel::render(shared_ptr<Entity> entity, float time, float r, float
leg0->render(scale, usecompiled,(m_uiAnimOverrideBitmask&(1<<eAnim_DisableRenderLeg0))>0); leg0->render(scale, usecompiled,(m_uiAnimOverrideBitmask&(1<<eAnim_DisableRenderLeg0))>0);
leg1->render(scale, usecompiled,(m_uiAnimOverrideBitmask&(1<<eAnim_DisableRenderLeg1))>0); leg1->render(scale, usecompiled,(m_uiAnimOverrideBitmask&(1<<eAnim_DisableRenderLeg1))>0);
hair->render(scale, usecompiled,(m_uiAnimOverrideBitmask&(1<<eAnim_DisableRenderHair))>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 +319,9 @@ void HumanoidModel::setupAnim(float time, float r, float bob, float yRot, float
hair->xRot = head->xRot; hair->xRot = head->xRot;
body->z = 0.0f; body->z = 0.0f;
if (jacket)
jacket->z = 0.0f;
// Does the skin have an override for anim? // Does the skin have an override for anim?
if(uiBitmaskOverrideAnim&(1<<eAnim_ArmsDown)) if(uiBitmaskOverrideAnim&(1<<eAnim_ArmsDown))
@ -200,6 +331,17 @@ void HumanoidModel::setupAnim(float time, float r, float bob, float yRot, float
arm0->zRot = 0.0f; arm0->zRot = 0.0f;
arm1->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)) else if(uiBitmaskOverrideAnim&(1<<eAnim_ArmsOutFront))
{ {
@ -207,6 +349,18 @@ void HumanoidModel::setupAnim(float time, float r, float bob, float yRot, float
arm1->xRot=-HALF_PI; arm1->xRot=-HALF_PI;
arm0->zRot = 0.0f; arm0->zRot = 0.0f;
arm1->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)) else if(uiBitmaskOverrideAnim&(1<<eAnim_SingleArms))
{ {
@ -214,6 +368,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; arm1->xRot = (Mth::cos(time * 0.6662f + PI) * 2.0f) * r * 0.5f;
arm0->zRot = 0.0f; arm0->zRot = 0.0f;
arm1->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 // 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)) else if((uiBitmaskOverrideAnim&(1<<eAnim_StatueOfLiberty)) && (holdingRightHand==0) && (attackTime==0.0f))
@ -222,6 +388,18 @@ void HumanoidModel::setupAnim(float time, float r, float bob, float yRot, float
arm0->zRot = -0.3f; arm0->zRot = -0.3f;
arm1->xRot = ( Mth::cos(time * 0.6662f) * 2.0f) * r * 0.5f; arm1->xRot = ( Mth::cos(time * 0.6662f) * 2.0f) * r * 0.5f;
arm1->zRot = 0.0f; 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 else
{ {
@ -229,6 +407,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; arm1->xRot = ( Mth::cos(time * 0.6662f) * 2.0f) * r * 0.5f;
arm0->zRot = 0.0f; arm0->zRot = 0.0f;
arm1->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; // arm0.zRot = ((float) (util.Mth.cos(time * 0.2312f) + 1) * 1) * r;
@ -239,9 +429,15 @@ void HumanoidModel::setupAnim(float time, float r, float bob, float yRot, float
leg0->yRot = 0.0f; leg0->yRot = 0.0f;
leg1->yRot = 0.0f; leg1->yRot = 0.0f;
if (pants0)
pants0->yRot=0.0f;
if (pants1)
pants1->yRot=0.0f;
if (riding) if (riding)
{ {
if ((uiBitmaskOverrideAnim&(1<<eAnim_SmallModel)) == 0) if(uiBitmaskOverrideAnim&(1<<eAnim_SmallModel) == 0)
{ {
arm0->xRot += -HALF_PI * 0.4f; arm0->xRot += -HALF_PI * 0.4f;
arm1->xRot += -HALF_PI * 0.4f; arm1->xRot += -HALF_PI * 0.4f;
@ -249,6 +445,24 @@ void HumanoidModel::setupAnim(float time, float r, float bob, float yRot, float
leg1->xRot = -HALF_PI * 0.8f; leg1->xRot = -HALF_PI * 0.8f;
leg0->yRot = HALF_PI * 0.2f; leg0->yRot = HALF_PI * 0.2f;
leg1->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 else
{ {
@ -256,8 +470,18 @@ void HumanoidModel::setupAnim(float time, float r, float bob, float yRot, float
arm1->xRot += -HALF_PI * 0.4f; arm1->xRot += -HALF_PI * 0.4f;
leg0->xRot = -HALF_PI * 0.4f; leg0->xRot = -HALF_PI * 0.4f;
leg1->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 ) else if(idle && !sneaking )
@ -266,6 +490,18 @@ void HumanoidModel::setupAnim(float time, float r, float bob, float yRot, float
leg1->xRot = -HALF_PI; leg1->xRot = -HALF_PI;
leg0->yRot = HALF_PI * 0.2f; leg0->yRot = HALF_PI * 0.2f;
leg1->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)) else if(uiBitmaskOverrideAnim&(1<<eAnim_NoLegAnim))
{ {
@ -274,31 +510,68 @@ void HumanoidModel::setupAnim(float time, float r, float bob, float yRot, float
leg1->xRot=0.0f; leg1->xRot=0.0f;
leg1->zRot=0.0f; leg1->zRot=0.0f;
leg0->yRot = 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)) else if(uiBitmaskOverrideAnim&(1<<eAnim_SingleLegs))
{ {
leg0->xRot = ( Mth::cos(time * 0.6662f) * 1.4f) * r; leg0->xRot = ( Mth::cos(time * 0.6662f) * 1.4f) * r;
leg1->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 else
{ {
leg0->xRot = ( Mth::cos(time * 0.6662f) * 1.4f) * r; leg0->xRot = ( Mth::cos(time * 0.6662f) * 1.4f) * r;
leg1->xRot = ( Mth::cos(time * 0.6662f + PI) * 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) if (holdingLeftHand != 0)
{ {
arm1->xRot = arm1->xRot * 0.5f - HALF_PI * 0.2f * holdingLeftHand; 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) if (holdingRightHand != 0)
{ {
arm0->xRot = arm0->xRot * 0.5f - HALF_PI * 0.2f * holdingRightHand; 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; arm0->yRot = 0.0f;
arm1->yRot = 0.0f; arm1->yRot = 0.0f;
if (sleeve0)
sleeve0->yRot=0.0f;
if (sleeve1)
sleeve1->yRot=0.0f;
if (attackTime > -9990.0f) if (attackTime > -9990.0f)
{ {
float swing = attackTime; float swing = attackTime;
@ -311,6 +584,20 @@ void HumanoidModel::setupAnim(float time, float r, float bob, float yRot, float
arm1->yRot += body->yRot; arm1->yRot += body->yRot;
arm1->xRot += 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 = 1.0f - attackTime;
swing *= swing; swing *= swing;
swing *= swing; swing *= swing;
@ -318,15 +605,27 @@ void HumanoidModel::setupAnim(float time, float r, float bob, float yRot, float
float aa = Mth::sin(swing * PI); float aa = Mth::sin(swing * PI);
float bb = Mth::sin(attackTime * PI) * -(head->xRot - 0.7f) * 0.75f; 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->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)) if((uiBitmaskOverrideAnim&(1<<eAnim_StatueOfLiberty))&& (holdingRightHand==0) && (attackTime==0.0f))
{ {
arm0->zRot -= Mth::sin(attackTime * PI) * -0.4f; arm0->zRot -= Mth::sin(attackTime * PI) * -0.4f;
if (sleeve0)
sleeve0->zRot -= Mth::sin(attackTime * PI) * -0.4f;
} }
else else
{ {
arm0->zRot = Mth::sin(attackTime * PI) * -0.4f; arm0->zRot = Mth::sin(attackTime * PI) * -0.4f;
if (sleeve0)
sleeve0->zRot = Mth::sin(attackTime * PI) * -0.4f;
} }
} }
@ -343,6 +642,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->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; 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) if (sneaking)
@ -366,6 +671,39 @@ void HumanoidModel::setupAnim(float time, float r, float bob, float yRot, float
hair->y = +1.0f; hair->y = +1.0f;
ear->y = +1.0f; ear->y = +1.0f;
cloak->y = 0.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 else
{ {
@ -385,6 +723,38 @@ void HumanoidModel::setupAnim(float time, float r, float bob, float yRot, float
hair->y = +1.0f; hair->y = +1.0f;
ear->y = +1.0f; ear->y = +1.0f;
cloak->y = 0.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 else
@ -393,6 +763,15 @@ void HumanoidModel::setupAnim(float time, float r, float bob, float yRot, float
leg0->z = 0.1f; leg0->z = 0.1f;
leg1->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) if(!riding && idle)
{ {
leg0->y = 22.0f; leg0->y = 22.0f;
@ -404,6 +783,17 @@ void HumanoidModel::setupAnim(float time, float r, float bob, float yRot, float
hair->y = 10.0f; hair->y = 10.0f;
ear->y = 11.0f; ear->y = 11.0f;
cloak->y = 10.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 else
{ {
@ -416,15 +806,37 @@ void HumanoidModel::setupAnim(float time, float r, float bob, float yRot, float
hair->y = 0.0f; hair->y = 0.0f;
ear->y = 1.0f; ear->y = 1.0f;
cloak->y = 0.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); arm0->zRot += ((Mth::cos(bob * 0.09f)) * 0.05f + 0.05f);
arm1->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); arm0->xRot += ((Mth::sin(bob * 0.067f)) * 0.05f);
arm1->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) if (bowAndArrow)
{ {
float attack2 = 0.0f; float attack2 = 0.0f;
@ -442,6 +854,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); arm1->zRot -= ((float) (Mth::cos(bob * 0.09f)) * 0.05f + 0.05f);
arm0->xRot += ((float) (Mth::sin(bob * 0.067f)) * 0.05f); arm0->xRot += ((float) (Mth::sin(bob * 0.067f)) * 0.05f);
arm1->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 +909,41 @@ void HumanoidModel::render(HumanoidModel *model, float scale, bool usecompiled)
hair->xRot = head->xRot; hair->xRot = head->xRot;
body->yRot = model->body->yRot; body->yRot = model->body->yRot;
if (jacket)
jacket->yRot = model->jacket->yRot;
arm0->xRot = model->arm0->xRot; arm0->xRot = model->arm0->xRot;
arm0->yRot = model->arm0->yRot; arm0->yRot = model->arm0->yRot;
arm0->zRot = model->arm0->zRot; 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->xRot = model->arm1->xRot;
arm1->yRot = model->arm1->yRot; arm1->yRot = model->arm1->yRot;
arm1->zRot = model->arm1->zRot; 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; leg0->xRot = model->leg0->xRot;
leg1->xRot = model->leg1->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); head->render(scale, usecompiled,(m_uiAnimOverrideBitmask&(1<<eAnim_DisableRenderHead))>0);
body->render(scale, usecompiled,(m_uiAnimOverrideBitmask&(1<<eAnim_DisableRenderTorso))>0); body->render(scale, usecompiled,(m_uiAnimOverrideBitmask&(1<<eAnim_DisableRenderTorso))>0);
arm0->render(scale, usecompiled,(m_uiAnimOverrideBitmask&(1<<eAnim_DisableRenderArm0))>0); arm0->render(scale, usecompiled,(m_uiAnimOverrideBitmask&(1<<eAnim_DisableRenderArm0))>0);
@ -496,4 +951,15 @@ void HumanoidModel::render(HumanoidModel *model, float scale, bool usecompiled)
leg0->render(scale, usecompiled,(m_uiAnimOverrideBitmask&(1<<eAnim_DisableRenderLeg0))>0); leg0->render(scale, usecompiled,(m_uiAnimOverrideBitmask&(1<<eAnim_DisableRenderLeg0))>0);
leg1->render(scale, usecompiled,(m_uiAnimOverrideBitmask&(1<<eAnim_DisableRenderLeg1))>0); leg1->render(scale, usecompiled,(m_uiAnimOverrideBitmask&(1<<eAnim_DisableRenderLeg1))>0);
hair->render(scale, usecompiled,(m_uiAnimOverrideBitmask&(1<<eAnim_DisableRenderHair))>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 class HumanoidModel : public Model
{ {
public: 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; //ModelPart *hat;
int holdingLeftHand; int holdingLeftHand;
@ -37,8 +37,12 @@ public:
eAnim_DisableRenderLeg0, eAnim_DisableRenderLeg0,
eAnim_DisableRenderLeg1, eAnim_DisableRenderLeg1,
eAnim_DisableRenderHair, 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) | static const unsigned int m_staticBitmaskIgnorePlayerCustomAnimSetting= (1<<HumanoidModel::eAnim_ForceAnim) |
@ -47,13 +51,20 @@ public:
(1<<HumanoidModel::eAnim_DisableRenderTorso) | (1<<HumanoidModel::eAnim_DisableRenderTorso) |
(1<<HumanoidModel::eAnim_DisableRenderLeg0) | (1<<HumanoidModel::eAnim_DisableRenderLeg0) |
(1<<HumanoidModel::eAnim_DisableRenderLeg1) | (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); // 4J added
HumanoidModel(); HumanoidModel();
HumanoidModel(float g); 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);
virtual void render(shared_ptr<Entity> entity, float time, float r, float bob, float yRot, float xRot, float scale, bool usecompiled); 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); 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); void renderHair(float scale, bool usecompiled);

View file

@ -9,13 +9,24 @@
#include "..\Minecraft.World\Mth.h" #include "..\Minecraft.World\Mth.h"
#include "..\Minecraft.World\Player.h" #include "..\Minecraft.World\Player.h"
ResourceLocation LivingEntityRenderer::ENCHANT_GLINT_LOCATION = ResourceLocation(TN__BLUR__MISC_GLINT); ResourceLocation LivingEntityRenderer::ENCHANT_GLINT_LOCATION = ResourceLocation(TN__BLUR__MISC_GLINT);
int LivingEntityRenderer::MAX_ARMOR_LAYERS = 4; 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; 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; shadowRadius = shadow;
armor = nullptr; armor = nullptr;
} }
@ -43,22 +54,27 @@ void LivingEntityRenderer::render(shared_ptr<Entity> _mob, double x, double y, d
} }
shared_ptr<LivingEntity> mob = dynamic_pointer_cast<LivingEntity>(_mob); shared_ptr<LivingEntity> mob = dynamic_pointer_cast<LivingEntity>(_mob);
shared_ptr<Player> player = dynamic_pointer_cast<Player>(_mob);
Model *resModel;
if (mob == nullptr) if (mob == nullptr)
{ {
return; return;
} }
app.DebugPrintf("LivingEntityRenderer::render called for type %d\n", _mob->GetType());
glPushMatrix(); glPushMatrix();
glDisable(GL_CULL_FACE); glDisable(GL_CULL_FACE);
model->attackTime = getAttackAnim(mob, a); if (player != nullptr && newModelSlim != nullptr && (player->getCustomSkin() >= 10 && player->getCustomSkin() <= 18)) resModel = newModelSlim;
if (armor != nullptr) armor->attackTime = model->attackTime; else if (player != nullptr && newModel != nullptr && (player->getCustomSkin() >= 0 && player->getCustomSkin() <= 9)) resModel = newModel;
model->riding = mob->isRiding(); else resModel = model;
if (armor != nullptr) armor->riding = model->riding;
model->young = mob->isBaby(); resModel->attackTime = getAttackAnim(mob, a);
if (armor != nullptr) armor->young = model->young; 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*/ /*try*/
{ {
@ -104,7 +120,7 @@ void LivingEntityRenderer::render(shared_ptr<Entity> _mob, double x, double y, d
if (ws > 1) ws = 1; if (ws > 1) ws = 1;
glEnable(GL_ALPHA_TEST); 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); renderModel(mob, wp, ws, bob, headRot - bodyRot, headRotx, fScale);
for (int i = 0; i < MAX_ARMOR_LAYERS; i++) for (int i = 0; i < MAX_ARMOR_LAYERS; i++)
@ -188,7 +204,7 @@ void LivingEntityRenderer::render(shared_ptr<Entity> _mob, double x, double y, d
if (mob->hurtTime > 0 || mob->deathTime > 0) if (mob->hurtTime > 0 || mob->deathTime > 0)
{ {
glColor4f(br, 0, 0, 0.4f); 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++) for (int i = 0; i < MAX_ARMOR_LAYERS; i++)
{ {
if (prepareArmorOverlay(mob, i, a) >= 0) if (prepareArmorOverlay(mob, i, a) >= 0)
@ -206,7 +222,7 @@ void LivingEntityRenderer::render(shared_ptr<Entity> _mob, double x, double y, d
float b = ((overlayColor) & 0xff) / 255.0f; float b = ((overlayColor) & 0xff) / 255.0f;
float aa = ((overlayColor >> 24) & 0xff) / 255.0f; float aa = ((overlayColor >> 24) & 0xff) / 255.0f;
glColor4f(r, g, b, aa); 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++) for (int i = 0; i < MAX_ARMOR_LAYERS; i++)
{ {
if (prepareArmorOverlay(mob, i, a) >= 0) if (prepareArmorOverlay(mob, i, a) >= 0)
@ -243,10 +259,17 @@ 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) 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); bindTexture(mob);
if (!mob->isInvisible()) 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))) else if(!mob->isInvisibleTo(dynamic_pointer_cast<Player>(Minecraft::GetInstance()->player)))
{ {
@ -256,7 +279,7 @@ void LivingEntityRenderer::renderModel(shared_ptr<LivingEntity> mob, float wp, f
glEnable(GL_BLEND); glEnable(GL_BLEND);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
glAlphaFunc(GL_GREATER, 1.0f / 255.0f); 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); glDisable(GL_BLEND);
glAlphaFunc(GL_GREATER, .1f); glAlphaFunc(GL_GREATER, .1f);
glPopMatrix(); glPopMatrix();
@ -264,7 +287,7 @@ void LivingEntityRenderer::renderModel(shared_ptr<LivingEntity> mob, float wp, f
} }
else else
{ {
model->setupAnim(wp, ws, bob, headRotMinusBodyRot, headRotx, scale, mob); resModel->setupAnim(wp, ws, bob, headRotMinusBodyRot, headRotx, scale, mob);
} }
} }
@ -314,7 +337,15 @@ void LivingEntityRenderer::additionalRendering(shared_ptr<LivingEntity> mob, flo
void LivingEntityRenderer::renderArrows(shared_ptr<LivingEntity> mob, float a) 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(); int arrowCount = mob->getArrowCount();
if (arrowCount > 0) if (arrowCount > 0)
{ {
shared_ptr<Entity> arrow = std::make_shared<Arrow>(mob->level, mob->x, mob->y, mob->z); shared_ptr<Entity> arrow = std::make_shared<Arrow>(mob->level, mob->x, mob->y, mob->z);
@ -323,7 +354,10 @@ void LivingEntityRenderer::renderArrows(shared_ptr<LivingEntity> mob, float a)
for (int i = 0; i < arrowCount; i++) for (int i = 0; i < arrowCount; i++)
{ {
glPushMatrix(); glPushMatrix();
ModelPart *modelPart = model->getRandomModelPart(random);
ModelPart *modelPart;
modelPart = resModel->getRandomModelPart(random);
Cube *cube = modelPart->cubes[random.nextInt(modelPart->cubes.size())]; Cube *cube = modelPart->cubes[random.nextInt(modelPart->cubes.size())];
modelPart->translateTo(1 / 16.0f); modelPart->translateTo(1 / 16.0f);
float xd = random.nextFloat(); float xd = random.nextFloat();
@ -358,7 +392,7 @@ void LivingEntityRenderer::renderArrows(shared_ptr<LivingEntity> mob, float a)
int LivingEntityRenderer::prepareArmorOverlay(shared_ptr<LivingEntity> mob, int layer, 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) int LivingEntityRenderer::prepareArmor(shared_ptr<LivingEntity> mob, int layer, float a)
@ -502,7 +536,7 @@ void LivingEntityRenderer::renderNameTag(shared_ptr<LivingEntity> mob, const wst
constexpr float s = 1 / 60.0f * size; constexpr float s = 1 / 60.0f * size;
glPushMatrix(); 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); glNormal3f(0, 1, 0);
glRotatef(-this->entityRenderDispatcher->playerRotY, 0, 1, 0); glRotatef(-this->entityRenderDispatcher->playerRotY, 0, 1, 0);

View file

@ -19,7 +19,7 @@ protected:
Model *armor; Model *armor;
public: 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 render(shared_ptr<Entity> mob, double x, double y, double z, float rot, float a);
virtual void setArmor(Model *armor); virtual void setArmor(Model *armor);

View file

@ -55,9 +55,12 @@ static unsigned int nametagColorForIndex(int index)
ResourceLocation PlayerRenderer::DEFAULT_LOCATION = ResourceLocation(TN_MOB_CHAR); 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); armorParts1 = new HumanoidModel(1.0f);
armorParts2 = new HumanoidModel(0.5f); armorParts2 = new HumanoidModel(0.5f);
@ -160,12 +163,19 @@ 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 // 4J - dynamic cast required because we aren't using templates/generics in our version
shared_ptr<Player> mob = dynamic_pointer_cast<Player>(_mob); shared_ptr<Player> mob = dynamic_pointer_cast<Player>(_mob);
HumanoidModel *resModel;
if(mob == nullptr) return; if(mob == nullptr) return;
if(mob->hasInvisiblePrivilege()) 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(); 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 (item != nullptr)
{ {
if (mob->getUseItemDuration() > 0) if (mob->getUseItemDuration() > 0)
@ -173,11 +183,11 @@ void PlayerRenderer::render(shared_ptr<Entity> _mob, double x, double y, double
UseAnim anim = item->getUseAnimation(); UseAnim anim = item->getUseAnimation();
if (anim == UseAnim_block) if (anim == UseAnim_block)
{ {
armorParts1->holdingRightHand = armorParts2->holdingRightHand = humanoidModel->holdingRightHand = 3; armorParts1->holdingRightHand = armorParts2->holdingRightHand = resModel->holdingRightHand = 3;
} }
else if (anim == UseAnim_bow) else if (anim == UseAnim_bow)
{ {
armorParts1->bowAndArrow = armorParts2->bowAndArrow = humanoidModel->bowAndArrow = true; armorParts1->bowAndArrow = armorParts2->bowAndArrow = resModel->bowAndArrow = true;
} }
} }
} }
@ -187,17 +197,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 // 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 t = (mob->getUseItemDuration() - a + 1);
float swing = 1 - (t / item->getUseDuration()); 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 = armorParts2->eating = resModel->eating = true;
armorParts1->eating_swing = armorParts2->eating_swing = humanoidModel->eating_swing = swing; armorParts1->eating_t = armorParts2->eating_t = resModel->eating_t = t;
armorParts1->eating_swing = armorParts2->eating_swing = resModel->eating_swing = swing;
} }
else 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; double yp = y - mob->heightOffset;
if (mob->isSneaking() && !mob->instanceof(eTYPE_LOCALPLAYER)) if (mob->isSneaking() && !mob->instanceof(eTYPE_LOCALPLAYER))
{ {
@ -209,20 +219,20 @@ void PlayerRenderer::render(shared_ptr<Entity> _mob, double x, double y, double
{ {
if(mob->isIdle()) if(mob->isIdle())
{ {
humanoidModel->idle=true; resModel->idle=true;
armorParts1->idle=true; armorParts1->idle=true;
armorParts2->idle=true; armorParts2->idle=true;
} }
else else
{ {
humanoidModel->idle=false; resModel->idle=false;
armorParts1->idle=false; armorParts1->idle=false;
armorParts2->idle=false; armorParts2->idle=false;
} }
} }
else else
{ {
humanoidModel->idle=false; resModel->idle=false;
armorParts1->idle=false; armorParts1->idle=false;
armorParts2->idle=false; armorParts2->idle=false;
} }
@ -248,10 +258,9 @@ void PlayerRenderer::render(shared_ptr<Entity> _mob, double x, double y, double
pModelPart->visible=false; pModelPart->visible=false;
} }
} }
armorParts1->bowAndArrow = armorParts2->bowAndArrow = humanoidModel->bowAndArrow = false; armorParts1->bowAndArrow = armorParts2->bowAndArrow = resModel->bowAndArrow = false;
armorParts1->sneaking = armorParts2->sneaking = humanoidModel->sneaking = false; armorParts1->sneaking = armorParts2->sneaking = resModel->sneaking = false;
armorParts1->holdingRightHand = armorParts2->holdingRightHand = humanoidModel->holdingRightHand = 0; armorParts1->holdingRightHand = armorParts2->holdingRightHand = resModel->holdingRightHand = 0;
} }
void PlayerRenderer::additionalRendering(shared_ptr<LivingEntity> _mob, float a) void PlayerRenderer::additionalRendering(shared_ptr<LivingEntity> _mob, float a)
@ -264,6 +273,11 @@ void PlayerRenderer::additionalRendering(shared_ptr<LivingEntity> _mob, float a)
// 4J - dynamic cast required because we aren't using templates/generics in our version // 4J - dynamic cast required because we aren't using templates/generics in our version
shared_ptr<Player> mob = dynamic_pointer_cast<Player>(_mob); 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); shared_ptr<ItemInstance> headGear = mob->inventory->getArmor(3);
if (headGear != nullptr) if (headGear != nullptr)
@ -274,7 +288,7 @@ void PlayerRenderer::additionalRendering(shared_ptr<LivingEntity> _mob, float a)
if((uiAnimOverrideBitmask&(1<<HumanoidModel::eAnim_DontRenderArmour))==0) if((uiAnimOverrideBitmask&(1<<HumanoidModel::eAnim_DontRenderArmour))==0)
{ {
glPushMatrix(); glPushMatrix();
humanoidModel->head->translateTo(1 / 16.0f); resModel->head->translateTo(1 / 16.0f);
if(headGear->getItem()->id < 256) if(headGear->getItem()->id < 256)
{ {
@ -322,7 +336,7 @@ void PlayerRenderer::additionalRendering(shared_ptr<LivingEntity> _mob, float a)
float s = 8 / 6.0f; float s = 8 / 6.0f;
glScalef(s, s, s); glScalef(s, s, s);
humanoidModel->renderEars(1 / 16.0f,true); resModel->renderEars(1 / 16.0f,true);
glPopMatrix(); glPopMatrix();
} }
} }
@ -368,7 +382,7 @@ void PlayerRenderer::additionalRendering(shared_ptr<LivingEntity> _mob, float a)
glRotatef(lean2 / 2, 0, 0, 1); glRotatef(lean2 / 2, 0, 0, 1);
glRotatef(-lean2 / 2, 0, 1, 0); glRotatef(-lean2 / 2, 0, 1, 0);
glRotatef(180, 0, 1, 0); glRotatef(180, 0, 1, 0);
humanoidModel->renderCloak(1 / 16.0f,true); resModel->renderCloak(1 / 16.0f,true);
glPopMatrix(); glPopMatrix();
} }
@ -377,7 +391,7 @@ void PlayerRenderer::additionalRendering(shared_ptr<LivingEntity> _mob, float a)
if (item != nullptr) if (item != nullptr)
{ {
glPushMatrix(); glPushMatrix();
humanoidModel->arm0->translateTo(1 / 16.0f); resModel->arm0->translateTo(1 / 16.0f);
glTranslatef(-1 / 16.0f, 7 / 16.0f, 1 / 16.0f); glTranslatef(-1 / 16.0f, 7 / 16.0f, 1 / 16.0f);
if (mob->fishing != nullptr) if (mob->fishing != nullptr)
@ -470,7 +484,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 0
if (dist < 10 * 10) if (dist < 10 * 10)
@ -496,17 +510,7 @@ void PlayerRenderer::renderNameTags(shared_ptr<LivingEntity> player, double x, d
} }
#endif #endif
shared_ptr<Player> pPlayer = dynamic_pointer_cast<Player>(player); LivingEntityRenderer::renderNameTags(player, x, y, z, msg, scale, dist);
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) void PlayerRenderer::scale(shared_ptr<LivingEntity> player, float a)
@ -517,18 +521,23 @@ void PlayerRenderer::scale(shared_ptr<LivingEntity> player, float a)
void PlayerRenderer::renderHand() 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; float brightness = 1;
glColor3f(brightness, brightness, brightness); glColor3f(brightness, brightness, brightness);
humanoidModel->m_uiAnimOverrideBitmask = Minecraft::GetInstance()->player->getAnimOverrideBitmask(); resModel->m_uiAnimOverrideBitmask = player->getAnimOverrideBitmask();
armorParts1->eating = armorParts2->eating = humanoidModel->eating = humanoidModel->idle = false; armorParts1->eating = armorParts2->eating = resModel->eating = resModel->idle = false;
humanoidModel->attackTime = 0; resModel->attackTime = 0;
humanoidModel->setupAnim(0, 0, 0, 0, 0, 1 / 16.0f, Minecraft::GetInstance()->player); resModel->setupAnim(0, 0, 0, 0, 0, 1 / 16.0f, Minecraft::GetInstance()->player);
// 4J-PB - does this skin have its arm0 disabled? (Dalek, etc) // 4J-PB - does this skin have its arm0 disabled? (Dalek, etc)
if((humanoidModel->m_uiAnimOverrideBitmask&(1<<HumanoidModel::eAnim_DisableRenderArm0))==0) if((resModel->m_uiAnimOverrideBitmask&(1<<HumanoidModel::eAnim_DisableRenderArm0))==0)
{ resModel->arm0->render(1 / 16.0f,true);
humanoidModel->arm0->render(1 / 16.0f,true);
}
} }
void PlayerRenderer::setupPosition(shared_ptr<LivingEntity> _mob, double x, double y, double z) void PlayerRenderer::setupPosition(shared_ptr<LivingEntity> _mob, double x, double y, double z)

View file

@ -14,8 +14,13 @@ public:
private: private:
HumanoidModel *humanoidModel; HumanoidModel *humanoidModel;
HumanoidModel *humanoidModelSlim;
HumanoidModel *newHumanoidModel;
HumanoidModel *newHumanoidModelSlim;
HumanoidModel *armorParts1; HumanoidModel *armorParts1;
HumanoidModel *armorParts2; HumanoidModel *armorParts2;
bool defaultSlimHands;
public: public:
PlayerRenderer(); PlayerRenderer();
@ -34,7 +39,7 @@ public:
protected: protected:
virtual void additionalRendering(shared_ptr<LivingEntity> _mob, float a); 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); virtual void scale(shared_ptr<LivingEntity> _player, float a);
public: public:

View file

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

View file

@ -72,6 +72,16 @@ const wchar_t *Textures::preLoaded[TN_COUNT] =
L"mob/char5", L"mob/char5",
L"mob/char6", L"mob/char6",
L"mob/char7", 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/moon",
L"terrain/sun", L"terrain/sun",
L"armor/power", L"armor/power",
@ -1600,6 +1610,16 @@ TEXTURE_NAME OriginalImages[] =
TN_MOB_CHAR5, TN_MOB_CHAR5,
TN_MOB_CHAR6, TN_MOB_CHAR6,
TN_MOB_CHAR7, 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, TN_MISC_MAPBG,

View file

@ -63,6 +63,16 @@ typedef enum _TEXTURE_NAME
TN_MOB_CHAR5, TN_MOB_CHAR5,
TN_MOB_CHAR6, TN_MOB_CHAR6,
TN_MOB_CHAR7, 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_MOON,
TN_TERRAIN_SUN, TN_TERRAIN_SUN,
TN_POWERED_CREEPER, TN_POWERED_CREEPER,

View file

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

View file

@ -2702,6 +2702,26 @@ int Player::getTexture()
return TN_MOB_CHAR6; // 4J - was L"/mob/char6.png"; return TN_MOB_CHAR6; // 4J - was L"/mob/char6.png";
case eDefaultSkins_Skin7: case eDefaultSkins_Skin7:
return TN_MOB_CHAR7; // 4J - was L"/mob/char7.png"; 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: default:
return TN_MOB_CHAR; // 4J - was L"/mob/char.png"; return TN_MOB_CHAR; // 4J - was L"/mob/char.png";