mirror of
https://github.com/smartcmd/MinecraftConsoles.git
synced 2026-08-20 09:57:09 +00:00
Slim Skins
This commit is contained in:
parent
bb8ffee0d3
commit
58648c0f92
|
|
@ -257,7 +257,12 @@ void UIControl_PlayerSkinPreview::render(EntityRenderer *renderer, double x, dou
|
|||
glPushMatrix();
|
||||
glDisable(GL_CULL_FACE);
|
||||
|
||||
HumanoidModel *model = static_cast<HumanoidModel *>(renderer->getModel());
|
||||
HumanoidModel *model;
|
||||
|
||||
if (m_backupTexture == TN_MOB_CHAR8)
|
||||
model = static_cast<HumanoidModel *>(renderer->getModelSlim());
|
||||
else
|
||||
model = static_cast<HumanoidModel *>(renderer->getModel());
|
||||
|
||||
//getAttackAnim(mob, a);
|
||||
//if (armor != nullptr) armor->attackTime = model->attackTime;
|
||||
|
|
@ -353,6 +358,7 @@ void UIControl_PlayerSkinPreview::render(EntityRenderer *renderer, double x, dou
|
|||
|
||||
MemSect(31);
|
||||
bindTexture(m_customTextureUrl, m_backupTexture);
|
||||
|
||||
MemSect(0);
|
||||
glEnable(GL_ALPHA_TEST);
|
||||
|
||||
|
|
|
|||
|
|
@ -24,6 +24,7 @@ const WCHAR *UIScene_SkinSelectMenu::wchDefaultNamesA[]=
|
|||
L"Prisoner Steve",
|
||||
L"Cyclist Steve",
|
||||
L"Boxer Steve",
|
||||
L"Alex",
|
||||
};
|
||||
|
||||
UIScene_SkinSelectMenu::UIScene_SkinSelectMenu(int iPad, void *initData, UILayer *parentLayer) : UIScene(iPad, parentLayer)
|
||||
|
|
@ -993,6 +994,9 @@ TEXTURE_NAME UIScene_SkinSelectMenu::getTextureId(int skinIndex)
|
|||
case eDefaultSkins_Skin7:
|
||||
texture = TN_MOB_CHAR7;
|
||||
break;
|
||||
case eDefaultSkins_Skin8:
|
||||
texture = TN_MOB_CHAR8;
|
||||
break;
|
||||
};
|
||||
|
||||
return texture;
|
||||
|
|
|
|||
BIN
Minecraft.Client/Common/res/1_2_2/mob/char8.png
Normal file
BIN
Minecraft.Client/Common/res/1_2_2/mob/char8.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.4 KiB |
BIN
Minecraft.Client/Common/res/TitleUpdate/res/mob/char8.png
Normal file
BIN
Minecraft.Client/Common/res/TitleUpdate/res/mob/char8.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.4 KiB |
BIN
Minecraft.Client/Common/res/mob/char8.png
Normal file
BIN
Minecraft.Client/Common/res/mob/char8.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.4 KiB |
|
|
@ -117,7 +117,7 @@ EntityRenderDispatcher::EntityRenderDispatcher()
|
|||
renderers[eTYPE_PIGZOMBIE] = new ZombieRenderer();
|
||||
renderers[eTYPE_SLIME] = new SlimeRenderer(new SlimeModel(16), new SlimeModel(0), 0.25f);
|
||||
renderers[eTYPE_LAVASLIME] = new LavaSlimeRenderer();
|
||||
renderers[eTYPE_PLAYER] = new PlayerRenderer();
|
||||
renderers[eTYPE_PLAYER] = new PlayerRenderer(true);
|
||||
renderers[eTYPE_GIANT] = new GiantMobRenderer(new ZombieModel(), 0.5f, 6);
|
||||
renderers[eTYPE_GHAST] = new GhastRenderer();
|
||||
renderers[eTYPE_SQUID] = new SquidRenderer(new SquidModel(), 0.7f);
|
||||
|
|
@ -180,6 +180,7 @@ EntityRenderDispatcher::EntityRenderDispatcher()
|
|||
EntityRenderer *EntityRenderDispatcher::getRenderer(eINSTANCEOF e)
|
||||
{
|
||||
if( (e & eTYPE_PLAYER) == eTYPE_PLAYER) e = eTYPE_PLAYER;
|
||||
else if( (e & eTYPE_PLAYER) == eTYPE_PLAYER) e = eTYPE_PLAYER;
|
||||
//EntityRenderer * r = renderers[e];
|
||||
auto it = renderers.find(e); // 4J Stu - The .at and [] accessors insert elements if they don't exist
|
||||
|
||||
|
|
|
|||
|
|
@ -19,6 +19,7 @@ ResourceLocation EntityRenderer::SHADOW_LOCATION = ResourceLocation(TN__CLAMP__M
|
|||
EntityRenderer::EntityRenderer()
|
||||
{
|
||||
model = nullptr;
|
||||
modelSlim = nullptr;
|
||||
tileRenderer = new TileRenderer();
|
||||
shadowRadius = 0;
|
||||
shadowStrength = 1.0f;
|
||||
|
|
|
|||
|
|
@ -30,6 +30,7 @@ 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;
|
||||
|
||||
protected:
|
||||
TileRenderer *tileRenderer; // 4J - changed to protected so derived classes can use instead of shadowing their own
|
||||
|
|
@ -68,5 +69,6 @@ public:
|
|||
public:
|
||||
// 4J Added
|
||||
virtual Model *getModel() { return model; }
|
||||
virtual Model *getModelSlim() { return modelSlim; }
|
||||
virtual void SetItemFrame(bool bSet) {}
|
||||
};
|
||||
|
|
|
|||
|
|
@ -58,7 +58,7 @@ ModelPart * HumanoidModel::AddOrRetrievePart(SKIN_BOX *pBox)
|
|||
return pNewBox;
|
||||
}
|
||||
|
||||
void HumanoidModel::_init(float g, float yOffset, int texWidth, int texHeight)
|
||||
void HumanoidModel::_init(float g, float yOffset, int texWidth, int texHeight, bool slimHands)
|
||||
{
|
||||
this->texWidth = texWidth;
|
||||
this->texHeight = texHeight;
|
||||
|
|
@ -83,14 +83,23 @@ void HumanoidModel::_init(float g, float yOffset, int texWidth, int texHeight)
|
|||
body->setPos(0, 0 + yOffset, 0);
|
||||
|
||||
arm0 = new ModelPart(this, 24 + 16, 16);
|
||||
arm0->addHumanoidBox(-3, -2, -2, 4, 12, 4, g); // Arm0
|
||||
arm0->setPos(-5, 2 + yOffset, 0);
|
||||
|
||||
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 (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, 0);
|
||||
arm1->addHumanoidBox(-1, -2, -2, 3, 12, 4, 0);
|
||||
}
|
||||
|
||||
leg0 = new ModelPart(this, 0, 16);
|
||||
leg0->addHumanoidBox(-2, 0, -2, 4, 12, 4, g); // Leg0
|
||||
leg0->setPos(-1.9, 12 + yOffset, 0);
|
||||
|
|
@ -125,19 +134,25 @@ void HumanoidModel::_init(float g, float yOffset, int texWidth, int texHeight)
|
|||
m_uiAnimOverrideBitmask = 0L;
|
||||
}
|
||||
|
||||
|
||||
HumanoidModel::HumanoidModel() : Model()
|
||||
{
|
||||
_init(0, 0, 64, 32);
|
||||
_init(0, 0, 64, 32, false);
|
||||
}
|
||||
|
||||
HumanoidModel::HumanoidModel(float g) : Model()
|
||||
{
|
||||
_init(g, 0, 64, 32);
|
||||
_init(g, 0, 64, 32, false);
|
||||
}
|
||||
|
||||
HumanoidModel::HumanoidModel(float g, float yOffset, int texWidth, int texHeight) : Model()
|
||||
{
|
||||
_init(g,yOffset,texWidth,texHeight);
|
||||
_init(g,yOffset,texWidth,texHeight, false);
|
||||
}
|
||||
|
||||
HumanoidModel::HumanoidModel(float g, float yOffset, int texWidth, int texHeight, bool slimHands) : Model()
|
||||
{
|
||||
_init(g,yOffset,texWidth,texHeight, slimHands);
|
||||
}
|
||||
|
||||
void HumanoidModel::render(shared_ptr<Entity> entity, float time, float r, float bob, float yRot, float xRot, float scale, bool usecompiled)
|
||||
|
|
|
|||
|
|
@ -50,10 +50,11 @@ public:
|
|||
(1<<HumanoidModel::eAnim_DisableRenderHair);
|
||||
|
||||
|
||||
void _init(float g, float yOffset, int texWidth, int texHeight); // 4J added
|
||||
void _init(float g, float yOffset, int texWidth, int texHeight, bool slimHands); // 4J added
|
||||
HumanoidModel();
|
||||
HumanoidModel(float g);
|
||||
HumanoidModel(float g, float yOffset, int texWidth, int texHeight);
|
||||
HumanoidModel(float g, float yOffset, int texWidth, int texHeight);
|
||||
HumanoidModel(float g, float yOffset, int texWidth, int texHeight, bool slimHands);
|
||||
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);
|
||||
|
|
|
|||
|
|
@ -9,13 +9,16 @@
|
|||
#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)
|
||||
LivingEntityRenderer::LivingEntityRenderer(Model *model, float shadow, bool slimHands)
|
||||
{
|
||||
this->model = model;
|
||||
|
||||
if (slimHands == true)
|
||||
this->modelSlim = new HumanoidModel(0, 0, 64, 32, true);
|
||||
|
||||
shadowRadius = shadow;
|
||||
armor = nullptr;
|
||||
}
|
||||
|
|
@ -43,6 +46,8 @@ 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)
|
||||
{
|
||||
|
|
@ -52,12 +57,15 @@ void LivingEntityRenderer::render(shared_ptr<Entity> _mob, double x, double y, d
|
|||
glPushMatrix();
|
||||
glDisable(GL_CULL_FACE);
|
||||
|
||||
model->attackTime = getAttackAnim(mob, a);
|
||||
if (armor != nullptr) armor->attackTime = model->attackTime;
|
||||
model->riding = mob->isRiding();
|
||||
if (armor != nullptr) armor->riding = model->riding;
|
||||
model->young = mob->isBaby();
|
||||
if (armor != nullptr) armor->young = model->young;
|
||||
if (player != nullptr && modelSlim != nullptr && player->getPlayerDefaultSkin() == 9) resModel = modelSlim;
|
||||
else resModel = model;
|
||||
|
||||
resModel->attackTime = getAttackAnim(mob, a);
|
||||
if (armor != nullptr) armor->attackTime = resModel->attackTime;
|
||||
resModel->riding = mob->isRiding();
|
||||
if (armor != nullptr) armor->riding = resModel->riding;
|
||||
resModel->young = mob->isBaby();
|
||||
if (armor != nullptr) armor->young = resModel->young;
|
||||
|
||||
/*try*/
|
||||
{
|
||||
|
|
@ -103,7 +111,7 @@ void LivingEntityRenderer::render(shared_ptr<Entity> _mob, double x, double y, d
|
|||
if (ws > 1) ws = 1;
|
||||
|
||||
glEnable(GL_ALPHA_TEST);
|
||||
model->prepareMobModel(mob, wp, ws, a);
|
||||
resModel->prepareMobModel(mob, wp, ws, a);
|
||||
renderModel(mob, wp, ws, bob, headRot - bodyRot, headRotx, fScale);
|
||||
|
||||
for (int i = 0; i < MAX_ARMOR_LAYERS; i++)
|
||||
|
|
@ -187,7 +195,7 @@ void LivingEntityRenderer::render(shared_ptr<Entity> _mob, double x, double y, d
|
|||
if (mob->hurtTime > 0 || mob->deathTime > 0)
|
||||
{
|
||||
glColor4f(br, 0, 0, 0.4f);
|
||||
model->render(mob, wp, ws, bob, headRot - bodyRot, headRotx, fScale, false);
|
||||
resModel->render(mob, wp, ws, bob, headRot - bodyRot, headRotx, fScale, false);
|
||||
for (int i = 0; i < MAX_ARMOR_LAYERS; i++)
|
||||
{
|
||||
if (prepareArmorOverlay(mob, i, a) >= 0)
|
||||
|
|
@ -205,7 +213,7 @@ void LivingEntityRenderer::render(shared_ptr<Entity> _mob, double x, double y, d
|
|||
float b = ((overlayColor) & 0xff) / 255.0f;
|
||||
float aa = ((overlayColor >> 24) & 0xff) / 255.0f;
|
||||
glColor4f(r, g, b, aa);
|
||||
model->render(mob, wp, ws, bob, headRot - bodyRot, headRotx, fScale, false);
|
||||
resModel->render(mob, wp, ws, bob, headRot - bodyRot, headRotx, fScale, false);
|
||||
for (int i = 0; i < MAX_ARMOR_LAYERS; i++)
|
||||
{
|
||||
if (prepareArmorOverlay(mob, i, a) >= 0)
|
||||
|
|
@ -242,10 +250,16 @@ 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 && modelSlim != nullptr && player->getPlayerDefaultSkin() == 9) resModel = modelSlim;
|
||||
else resModel = model;
|
||||
|
||||
bindTexture(mob);
|
||||
if (!mob->isInvisible())
|
||||
{
|
||||
model->render(mob, wp, ws, bob, headRotMinusBodyRot, headRotx, scale, true);
|
||||
resModel->render(mob, wp, ws, bob, headRotMinusBodyRot, headRotx, scale, true);
|
||||
}
|
||||
else if(!mob->isInvisibleTo(dynamic_pointer_cast<Player>(Minecraft::GetInstance()->player)))
|
||||
{
|
||||
|
|
@ -255,7 +269,7 @@ void LivingEntityRenderer::renderModel(shared_ptr<LivingEntity> mob, float wp, f
|
|||
glEnable(GL_BLEND);
|
||||
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
|
||||
glAlphaFunc(GL_GREATER, 1.0f / 255.0f);
|
||||
model->render(mob, wp, ws, bob, headRotMinusBodyRot, headRotx, scale, true);
|
||||
resModel->render(mob, wp, ws, bob, headRotMinusBodyRot, headRotx, scale, true);
|
||||
glDisable(GL_BLEND);
|
||||
glAlphaFunc(GL_GREATER, .1f);
|
||||
glPopMatrix();
|
||||
|
|
@ -263,7 +277,7 @@ void LivingEntityRenderer::renderModel(shared_ptr<LivingEntity> mob, float wp, f
|
|||
}
|
||||
else
|
||||
{
|
||||
model->setupAnim(wp, ws, bob, headRotMinusBodyRot, headRotx, scale, mob);
|
||||
resModel->setupAnim(wp, ws, bob, headRotMinusBodyRot, headRotx, scale, mob);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -313,7 +327,9 @@ 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);
|
||||
int arrowCount = mob->getArrowCount();
|
||||
|
||||
if (arrowCount > 0)
|
||||
{
|
||||
shared_ptr<Entity> arrow = std::make_shared<Arrow>(mob->level, mob->x, mob->y, mob->z);
|
||||
|
|
@ -322,7 +338,14 @@ void LivingEntityRenderer::renderArrows(shared_ptr<LivingEntity> mob, float a)
|
|||
for (int i = 0; i < arrowCount; i++)
|
||||
{
|
||||
glPushMatrix();
|
||||
ModelPart *modelPart = model->getRandomModelPart(random);
|
||||
|
||||
ModelPart *modelPart;
|
||||
|
||||
if (player != nullptr && modelSlim != nullptr && player->getPlayerDefaultSkin() == 9)
|
||||
modelPart = model->getRandomModelPart(random);
|
||||
else
|
||||
modelPart = modelSlim->getRandomModelPart(random);
|
||||
|
||||
Cube *cube = modelPart->cubes[random.nextInt(modelPart->cubes.size())];
|
||||
modelPart->translateTo(1 / 16.0f);
|
||||
float xd = random.nextFloat();
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ protected:
|
|||
Model *armor;
|
||||
|
||||
public:
|
||||
LivingEntityRenderer(Model *model, float shadow);
|
||||
LivingEntityRenderer(Model *model, float shadow, bool slimHands);
|
||||
virtual void render(shared_ptr<Entity> mob, double x, double y, double z, float rot, float a);
|
||||
virtual void setArmor(Model *armor);
|
||||
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@
|
|||
#include "..\Minecraft.World\Mth.h"
|
||||
#include "entityRenderDispatcher.h"
|
||||
|
||||
MobRenderer::MobRenderer(Model *model, float shadow) : LivingEntityRenderer(model, shadow)
|
||||
MobRenderer::MobRenderer(Model *model, float shadow) : LivingEntityRenderer(model, shadow, false)
|
||||
{
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -55,9 +55,10 @@ static unsigned int nametagColorForIndex(int index)
|
|||
|
||||
ResourceLocation PlayerRenderer::DEFAULT_LOCATION = ResourceLocation(TN_MOB_CHAR);
|
||||
|
||||
PlayerRenderer::PlayerRenderer() : LivingEntityRenderer( new HumanoidModel(0), 0.5f )
|
||||
PlayerRenderer::PlayerRenderer(bool slimHands) : LivingEntityRenderer( new HumanoidModel(0), 0.5f, slimHands )
|
||||
{
|
||||
humanoidModel = static_cast<HumanoidModel *>(model);
|
||||
humanoidModel = static_cast<HumanoidModel *>(model);
|
||||
humanoidModelSlim = static_cast<HumanoidModel *>(modelSlim);
|
||||
|
||||
armorParts1 = new HumanoidModel(1.0f);
|
||||
armorParts2 = new HumanoidModel(0.5f);
|
||||
|
|
@ -160,12 +161,18 @@ 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 && modelSlim != nullptr && mob->getPlayerDefaultSkin() == 9) resModel = humanoidModelSlim;
|
||||
else resModel = humanoidModel;
|
||||
|
||||
shared_ptr<ItemInstance> item = mob->inventory->getSelected();
|
||||
armorParts1->holdingRightHand = armorParts2->holdingRightHand = humanoidModel->holdingRightHand = item != nullptr ? 1 : 0;
|
||||
|
||||
armorParts1->holdingRightHand = armorParts2->holdingRightHand = resModel->holdingRightHand = item != nullptr ? 1 : 0;
|
||||
|
||||
if (item != nullptr)
|
||||
{
|
||||
if (mob->getUseItemDuration() > 0)
|
||||
|
|
@ -173,11 +180,11 @@ void PlayerRenderer::render(shared_ptr<Entity> _mob, double x, double y, double
|
|||
UseAnim anim = item->getUseAnimation();
|
||||
if (anim == UseAnim_block)
|
||||
{
|
||||
armorParts1->holdingRightHand = armorParts2->holdingRightHand = humanoidModel->holdingRightHand = 3;
|
||||
armorParts1->holdingRightHand = armorParts2->holdingRightHand = resModel->holdingRightHand = 3;
|
||||
}
|
||||
else if (anim == UseAnim_bow)
|
||||
{
|
||||
armorParts1->bowAndArrow = armorParts2->bowAndArrow = humanoidModel->bowAndArrow = true;
|
||||
armorParts1->bowAndArrow = armorParts2->bowAndArrow = resModel->bowAndArrow = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -187,17 +194,17 @@ void PlayerRenderer::render(shared_ptr<Entity> _mob, double x, double y, double
|
|||
// These factors are largely lifted from ItemInHandRenderer to try and keep the 3rd person eating animation as similar as possible
|
||||
float t = (mob->getUseItemDuration() - a + 1);
|
||||
float swing = 1 - (t / item->getUseDuration());
|
||||
armorParts1->eating = armorParts2->eating = humanoidModel->eating = true;
|
||||
armorParts1->eating_t = armorParts2->eating_t = humanoidModel->eating_t = t;
|
||||
armorParts1->eating_swing = armorParts2->eating_swing = humanoidModel->eating_swing = swing;
|
||||
|
||||
armorParts1->eating = armorParts2->eating = resModel->eating = true;
|
||||
armorParts1->eating_t = armorParts2->eating_t = resModel->eating_t = t;
|
||||
armorParts1->eating_swing = armorParts2->eating_swing = resModel->eating_swing = swing;
|
||||
}
|
||||
else
|
||||
{
|
||||
armorParts1->eating = armorParts2->eating = humanoidModel->eating = false;
|
||||
armorParts1->eating = armorParts2->eating = resModel->eating = false;
|
||||
}
|
||||
|
||||
armorParts1->sneaking = armorParts2->sneaking = humanoidModel->sneaking = mob->isSneaking();
|
||||
|
||||
armorParts1->sneaking = armorParts2->sneaking = resModel->sneaking = mob->isSneaking();
|
||||
double yp = y - mob->heightOffset;
|
||||
if (mob->isSneaking() && !mob->instanceof(eTYPE_LOCALPLAYER))
|
||||
{
|
||||
|
|
@ -209,20 +216,20 @@ void PlayerRenderer::render(shared_ptr<Entity> _mob, double x, double y, double
|
|||
{
|
||||
if(mob->isIdle())
|
||||
{
|
||||
humanoidModel->idle=true;
|
||||
resModel->idle=true;
|
||||
armorParts1->idle=true;
|
||||
armorParts2->idle=true;
|
||||
}
|
||||
else
|
||||
{
|
||||
humanoidModel->idle=false;
|
||||
resModel->idle=false;
|
||||
armorParts1->idle=false;
|
||||
armorParts2->idle=false;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
humanoidModel->idle=false;
|
||||
resModel->idle=false;
|
||||
armorParts1->idle=false;
|
||||
armorParts2->idle=false;
|
||||
}
|
||||
|
|
@ -248,10 +255,9 @@ void PlayerRenderer::render(shared_ptr<Entity> _mob, double x, double y, double
|
|||
pModelPart->visible=false;
|
||||
}
|
||||
}
|
||||
armorParts1->bowAndArrow = armorParts2->bowAndArrow = humanoidModel->bowAndArrow = false;
|
||||
armorParts1->sneaking = armorParts2->sneaking = humanoidModel->sneaking = false;
|
||||
armorParts1->holdingRightHand = armorParts2->holdingRightHand = humanoidModel->holdingRightHand = 0;
|
||||
|
||||
armorParts1->bowAndArrow = armorParts2->bowAndArrow = resModel->bowAndArrow = false;
|
||||
armorParts1->sneaking = armorParts2->sneaking = resModel->sneaking = false;
|
||||
armorParts1->holdingRightHand = armorParts2->holdingRightHand = resModel->holdingRightHand = 0;
|
||||
}
|
||||
|
||||
void PlayerRenderer::additionalRendering(shared_ptr<LivingEntity> _mob, float a)
|
||||
|
|
@ -264,6 +270,10 @@ 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 && modelSlim != nullptr && mob->getPlayerDefaultSkin() == 9) resModel = humanoidModelSlim;
|
||||
else resModel = humanoidModel;
|
||||
|
||||
shared_ptr<ItemInstance> headGear = mob->inventory->getArmor(3);
|
||||
if (headGear != nullptr)
|
||||
|
|
@ -274,7 +284,7 @@ void PlayerRenderer::additionalRendering(shared_ptr<LivingEntity> _mob, float a)
|
|||
if((uiAnimOverrideBitmask&(1<<HumanoidModel::eAnim_DontRenderArmour))==0)
|
||||
{
|
||||
glPushMatrix();
|
||||
humanoidModel->head->translateTo(1 / 16.0f);
|
||||
resModel->head->translateTo(1 / 16.0f);
|
||||
|
||||
if(headGear->getItem()->id < 256)
|
||||
{
|
||||
|
|
@ -322,7 +332,7 @@ void PlayerRenderer::additionalRendering(shared_ptr<LivingEntity> _mob, float a)
|
|||
|
||||
float s = 8 / 6.0f;
|
||||
glScalef(s, s, s);
|
||||
humanoidModel->renderEars(1 / 16.0f,true);
|
||||
resModel->renderEars(1 / 16.0f,true);
|
||||
glPopMatrix();
|
||||
}
|
||||
}
|
||||
|
|
@ -368,7 +378,7 @@ void PlayerRenderer::additionalRendering(shared_ptr<LivingEntity> _mob, float a)
|
|||
glRotatef(lean2 / 2, 0, 0, 1);
|
||||
glRotatef(-lean2 / 2, 0, 1, 0);
|
||||
glRotatef(180, 0, 1, 0);
|
||||
humanoidModel->renderCloak(1 / 16.0f,true);
|
||||
resModel->renderCloak(1 / 16.0f,true);
|
||||
glPopMatrix();
|
||||
}
|
||||
|
||||
|
|
@ -377,7 +387,7 @@ void PlayerRenderer::additionalRendering(shared_ptr<LivingEntity> _mob, float a)
|
|||
if (item != nullptr)
|
||||
{
|
||||
glPushMatrix();
|
||||
humanoidModel->arm0->translateTo(1 / 16.0f);
|
||||
resModel->arm0->translateTo(1 / 16.0f);
|
||||
glTranslatef(-1 / 16.0f, 7 / 16.0f, 1 / 16.0f);
|
||||
|
||||
if (mob->fishing != nullptr)
|
||||
|
|
@ -507,18 +517,22 @@ 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 && modelSlim != nullptr && player->getPlayerDefaultSkin() == 9) resModel = humanoidModelSlim;
|
||||
else resModel = humanoidModel;
|
||||
|
||||
float brightness = 1;
|
||||
glColor3f(brightness, brightness, brightness);
|
||||
|
||||
humanoidModel->m_uiAnimOverrideBitmask = Minecraft::GetInstance()->player->getAnimOverrideBitmask();
|
||||
armorParts1->eating = armorParts2->eating = humanoidModel->eating = humanoidModel->idle = false;
|
||||
humanoidModel->attackTime = 0;
|
||||
humanoidModel->setupAnim(0, 0, 0, 0, 0, 1 / 16.0f, Minecraft::GetInstance()->player);
|
||||
resModel->m_uiAnimOverrideBitmask = player->getAnimOverrideBitmask();
|
||||
armorParts1->eating = armorParts2->eating = resModel->eating = resModel->idle = false;
|
||||
resModel->attackTime = 0;
|
||||
resModel->setupAnim(0, 0, 0, 0, 0, 1 / 16.0f, Minecraft::GetInstance()->player);
|
||||
// 4J-PB - does this skin have its arm0 disabled? (Dalek, etc)
|
||||
if((humanoidModel->m_uiAnimOverrideBitmask&(1<<HumanoidModel::eAnim_DisableRenderArm0))==0)
|
||||
{
|
||||
humanoidModel->arm0->render(1 / 16.0f,true);
|
||||
}
|
||||
if((resModel->m_uiAnimOverrideBitmask&(1<<HumanoidModel::eAnim_DisableRenderArm0))==0)
|
||||
resModel->arm0->render(1 / 16.0f,true);
|
||||
}
|
||||
|
||||
void PlayerRenderer::setupPosition(shared_ptr<LivingEntity> _mob, double x, double y, double z)
|
||||
|
|
|
|||
|
|
@ -14,11 +14,13 @@ public:
|
|||
|
||||
private:
|
||||
HumanoidModel *humanoidModel;
|
||||
HumanoidModel *humanoidModelSlim;
|
||||
HumanoidModel *armorParts1;
|
||||
HumanoidModel *armorParts2;
|
||||
bool defaultSlimHands;
|
||||
|
||||
public:
|
||||
PlayerRenderer();
|
||||
PlayerRenderer(bool slimHands);
|
||||
|
||||
static unsigned int getNametagColour(int index);
|
||||
|
||||
|
|
|
|||
|
|
@ -72,6 +72,7 @@ const wchar_t *Textures::preLoaded[TN_COUNT] =
|
|||
L"mob/char5",
|
||||
L"mob/char6",
|
||||
L"mob/char7",
|
||||
L"mob/char8",
|
||||
L"terrain/moon",
|
||||
L"terrain/sun",
|
||||
L"armor/power",
|
||||
|
|
|
|||
|
|
@ -63,6 +63,7 @@ typedef enum _TEXTURE_NAME
|
|||
TN_MOB_CHAR5,
|
||||
TN_MOB_CHAR6,
|
||||
TN_MOB_CHAR7,
|
||||
TN_MOB_CHAR8,
|
||||
TN_TERRAIN_MOON,
|
||||
TN_TERRAIN_SUN,
|
||||
TN_POWERED_CREEPER,
|
||||
|
|
|
|||
|
|
@ -35,6 +35,7 @@ enum EDefaultSkins
|
|||
eDefaultSkins_Skin5,
|
||||
eDefaultSkins_Skin6,
|
||||
eDefaultSkins_Skin7,
|
||||
eDefaultSkins_Skin8,
|
||||
|
||||
eDefaultSkins_Count,
|
||||
};
|
||||
|
|
@ -2702,6 +2702,8 @@ 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";
|
||||
|
||||
default:
|
||||
return TN_MOB_CHAR; // 4J - was L"/mob/char.png";
|
||||
|
|
|
|||
Loading…
Reference in a new issue