Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 16 additions & 2 deletions Minecraft.Client/Common/Consoles_App.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9201,7 +9201,14 @@ bool CMinecraftApp::DLCContentRetrieved(eDLCMarketplaceType eType)
void CMinecraftApp::SetAdditionalSkinBoxes(DWORD dwSkinID, SKIN_BOX *SkinBoxA, DWORD dwSkinBoxC)
{
EntityRenderer *renderer = EntityRenderDispatcher::instance->getRenderer(eTYPE_PLAYER);
Model *pModel = renderer->getModel();
unsigned int m_uiAnimOverrideBitmask = Player::getSkinAnimOverrideBitmask(dwSkinID);
Model *pModel;
if (m_uiAnimOverrideBitmask&(1<<HumanoidModel::eAnim_ClassicModel))
pModel = renderer->getModelClassic();
else if (m_uiAnimOverrideBitmask&(1<<HumanoidModel::eAnim_SlimModel))
pModel = renderer->getModelSlim();
else
pModel = renderer->getModel();
vector<ModelPart *> *pvModelPart = new vector<ModelPart *>;
vector<SKIN_BOX *> *pvSkinBoxes = new vector<SKIN_BOX *>;

Expand Down Expand Up @@ -9233,7 +9240,14 @@ void CMinecraftApp::SetAdditionalSkinBoxes(DWORD dwSkinID, SKIN_BOX *SkinBoxA, D
vector<ModelPart *> * CMinecraftApp::SetAdditionalSkinBoxes(DWORD dwSkinID, vector<SKIN_BOX *> *pvSkinBoxA)
{
EntityRenderer *renderer = EntityRenderDispatcher::instance->getRenderer(eTYPE_PLAYER);
Model *pModel = renderer->getModel();
unsigned int m_uiAnimOverrideBitmask = Player::getSkinAnimOverrideBitmask(dwSkinID);
Model *pModel;
if (m_uiAnimOverrideBitmask&(1<<HumanoidModel::eAnim_ClassicModel))
pModel = renderer->getModelClassic();
else if (m_uiAnimOverrideBitmask&(1<<HumanoidModel::eAnim_SlimModel))
pModel = renderer->getModelSlim();
else
pModel = renderer->getModel();
vector<ModelPart *> *pvModelPart = new vector<ModelPart *>;

EnterCriticalSection( &csAdditionalModelParts );
Expand Down
1 change: 1 addition & 0 deletions Minecraft.Client/Common/DLC/DLCManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ const WCHAR *DLCManager::wchTypeNamesA[]=
L"ENCHANTTEXTFOCUSCOLOUR",
L"DATAPATH",
L"PACKVERSION",
L"OFFSET",
};

DLCManager::DLCManager()
Expand Down
1 change: 1 addition & 0 deletions Minecraft.Client/Common/DLC/DLCManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ class DLCManager
e_DLCParamType_EnchantmentTextFocusColour,
e_DLCParamType_DataPath,
e_DLCParamType_PackVersion,
e_DLCParamType_Offset,

e_DLCParamType_Max,

Expand Down
207 changes: 203 additions & 4 deletions Minecraft.Client/Common/DLC/DLCSkinFile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -113,12 +113,12 @@ void DLCSkinFile::addParameter(DLCManager::EDLCParameterType type, const wstring
WCHAR wchBodyPart[10];
SKIN_BOX *pSkinBox = new SKIN_BOX;
ZeroMemory(pSkinBox,sizeof(SKIN_BOX));

#ifdef __PS3__
// 4J Stu - The Xbox version used swscanf_s which isn't available in GCC.
swscanf(value.c_str(), L"%10ls%f%f%f%f%f%f%f%f", wchBodyPart,
swscanf(value.c_str(), L"%10ls%f%f%f%f%f%f%f%f%f%f", wchBodyPart,
#else
swscanf_s(value.c_str(), L"%9ls%f%f%f%f%f%f%f%f", wchBodyPart,10,
swscanf_s(value.c_str(), L"%9ls%f%f%f%f%f%f%f%f%f%f", wchBodyPart,10,
#endif
&pSkinBox->fX,
&pSkinBox->fY,
Expand All @@ -127,7 +127,9 @@ void DLCSkinFile::addParameter(DLCManager::EDLCParameterType type, const wstring
&pSkinBox->fH,
&pSkinBox->fD,
&pSkinBox->fU,
&pSkinBox->fV);
&pSkinBox->fV,
&pSkinBox->fA,
&pSkinBox->fM);

if(wcscmp(wchBodyPart,L"HEAD")==0)
{
Expand All @@ -153,11 +155,199 @@ void DLCSkinFile::addParameter(DLCManager::EDLCParameterType type, const wstring
{
pSkinBox->ePart=eBodyPart_Leg1;
}
else if(wcscmp(wchBodyPart,L"HEADWEAR")==0)
{
pSkinBox->ePart=eBodyPart_Headwear;
}
else if(wcscmp(wchBodyPart,L"JACKET")==0)
{
pSkinBox->ePart=eBodyPart_Jacket;
}
else if(wcscmp(wchBodyPart,L"SLEEVE0")==0)
{
pSkinBox->ePart=eBodyPart_Sleeve0;
}
else if(wcscmp(wchBodyPart,L"SLEEVE1")==0)
{
pSkinBox->ePart=eBodyPart_Sleeve1;
}
else if(wcscmp(wchBodyPart,L"PANTS0")==0)
{
pSkinBox->ePart=eBodyPart_Pants0;
}
else if(wcscmp(wchBodyPart,L"PANTS1")==0)
{
pSkinBox->ePart=eBodyPart_Pants1;
}
else if(wcscmp(wchBodyPart,L"WAIST")==0)
{
pSkinBox->ePart=eBodyPart_Waist;
}
else if(wcscmp(wchBodyPart,L"LEGGING0")==0)
{
pSkinBox->ePart=eBodyPart_Legging0;
}
else if(wcscmp(wchBodyPart,L"LEGGING1")==0)
{
pSkinBox->ePart=eBodyPart_Legging1;
}
else if(wcscmp(wchBodyPart,L"SOCK0")==0)
{
pSkinBox->ePart=eBodyPart_Sock0;
}
else if(wcscmp(wchBodyPart,L"SOCK1")==0)
{
pSkinBox->ePart=eBodyPart_Sock1;
}
else if(wcscmp(wchBodyPart,L"BOOT0")==0)
{
pSkinBox->ePart=eBodyPart_Boot0;
}
else if(wcscmp(wchBodyPart,L"BOOT1")==0)
{
pSkinBox->ePart=eBodyPart_Boot1;
}
else if(wcscmp(wchBodyPart,L"ARMARMOR0")==0)
{
pSkinBox->ePart=eBodyPart_ArmArmor0;
}
else if(wcscmp(wchBodyPart,L"ARMARMOR1")==0)
{
pSkinBox->ePart=eBodyPart_ArmArmor1;
}
else if(wcscmp(wchBodyPart,L"BODYARMOR")==0)
{
pSkinBox->ePart=eBodyPart_BodyArmor;
}
else if(wcscmp(wchBodyPart,L"BELT")==0)
{
pSkinBox->ePart=eBodyPart_Belt;
}

// add this to the skin's vector of parts
m_AdditionalBoxes.push_back(pSkinBox);
}
break;
case DLCManager::e_DLCParamType_Offset:
{
WCHAR wchBodyPart[2];
SKIN_OFFSET *pSkinOffset = new SKIN_OFFSET;
ZeroMemory(pSkinOffset,sizeof(SKIN_OFFSET));

#ifdef __PS3__
// 4J Stu - The Xbox version used swscanf_s which isn't available in GCC.
swscanf(value.c_str(), L"%10ls%f%f", wchBodyPart,
#else
swscanf_s(value.c_str(), L"%9ls%f%f", wchBodyPart,2,
#endif
&pSkinOffset->fD,
&pSkinOffset->fO);

if(wcscmp(wchBodyPart,L"HEAD")==0)
{
pSkinOffset->ePart=eBodyOffset_Head;
}
else if(wcscmp(wchBodyPart,L"BODY")==0)
{
pSkinOffset->ePart=eBodyOffset_Body;
}
else if(wcscmp(wchBodyPart,L"ARM0")==0)
{
pSkinOffset->ePart=eBodyOffset_Arm0;
}
else if(wcscmp(wchBodyPart,L"ARM1")==0)
{
pSkinOffset->ePart=eBodyOffset_Arm1;
}
else if(wcscmp(wchBodyPart,L"LEG0")==0)
{
pSkinOffset->ePart=eBodyOffset_Leg0;
}
else if(wcscmp(wchBodyPart,L"LEG1")==0)
{
pSkinOffset->ePart=eBodyOffset_Leg1;
}
else if(wcscmp(wchBodyPart,L"HEADWEAR")==0)
{
pSkinOffset->ePart=eBodyOffset_Headwear;
}
else if(wcscmp(wchBodyPart,L"JACKET")==0)
{
pSkinOffset->ePart=eBodyOffset_Jacket;
}
else if(wcscmp(wchBodyPart,L"SLEEVE0")==0)
{
pSkinOffset->ePart=eBodyOffset_Sleeve0;
}
else if(wcscmp(wchBodyPart,L"SLEEVE1")==0)
{
pSkinOffset->ePart=eBodyOffset_Sleeve1;
}
else if(wcscmp(wchBodyPart,L"PANTS0")==0)
{
pSkinOffset->ePart=eBodyOffset_Pants0;
}
else if(wcscmp(wchBodyPart,L"PANTS1")==0)
{
pSkinOffset->ePart=eBodyOffset_Pants1;
}
else if(wcscmp(wchBodyPart,L"WAIST")==0)
{
pSkinOffset->ePart=eBodyOffset_Waist;
}
else if(wcscmp(wchBodyPart,L"LEGGING0")==0)
{
pSkinOffset->ePart=eBodyOffset_Legging0;
}
else if(wcscmp(wchBodyPart,L"LEGGING1")==0)
{
pSkinOffset->ePart=eBodyOffset_Legging1;
}
else if(wcscmp(wchBodyPart,L"SOCK0")==0)
{
pSkinOffset->ePart=eBodyOffset_Sock0;
}
else if(wcscmp(wchBodyPart,L"SOCK1")==0)
{
pSkinOffset->ePart=eBodyOffset_Sock1;
}
else if(wcscmp(wchBodyPart,L"BOOT0")==0)
{
pSkinOffset->ePart=eBodyOffset_Boot0;
}
else if(wcscmp(wchBodyPart,L"BOOT1")==0)
{
pSkinOffset->ePart=eBodyOffset_Boot1;
}
else if(wcscmp(wchBodyPart,L"ARMARMOR1")==0)
{
pSkinOffset->ePart=eBodyOffset_ArmArmor1;
}
else if(wcscmp(wchBodyPart,L"ARMARMOR0")==0)
{
pSkinOffset->ePart=eBodyOffset_ArmArmor0;
}
else if(wcscmp(wchBodyPart,L"BODYARMOR")==0)
{
pSkinOffset->ePart=eBodyOffset_BodyArmor;
}
else if(wcscmp(wchBodyPart,L"BELT")==0)
{
pSkinOffset->ePart=eBodyOffset_Belt;
}
else if(wcscmp(wchBodyPart,L"TOOL0")==0)
{
pSkinOffset->ePart=eBodyOffset_Tool0;
}
else if(wcscmp(wchBodyPart,L"TOOL1")==0)
{
pSkinOffset->ePart=eBodyOffset_Tool1;
}

// add this to the skin's vector of offsets
m_Offsets.push_back(pSkinOffset);
}
break;
case DLCManager::e_DLCParamType_Anim:
#ifdef __PS3__
// 4J Stu - The Xbox version used swscanf_s which isn't available in GCC.
Expand Down Expand Up @@ -185,6 +375,15 @@ vector<SKIN_BOX *> *DLCSkinFile::getAdditionalBoxes()
return &m_AdditionalBoxes;
}

int DLCSkinFile::getOffsetsCount()
{
return static_cast<int>(m_Offsets.size());
}
vector<SKIN_OFFSET *> *DLCSkinFile::getOffsets()
{
return &m_Offsets;
}

wstring DLCSkinFile::getParameterAsString(DLCManager::EDLCParameterType type)
{
switch(type)
Expand Down
5 changes: 5 additions & 0 deletions Minecraft.Client/Common/DLC/DLCSkinFile.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#pragma once
#include "DLCFile.h"
#include "..\..\..\Minecraft.Client\HumanoidModel.h"
// This is added to prevent a building failure, probably should move it to HumanoidModel.h later - Langtanium
#include "..\..\..\Minecraft.Client\SkinOffset.h"

class DLCSkinFile : public DLCFile
{
Expand All @@ -12,6 +14,7 @@ class DLCSkinFile : public DLCFile
unsigned int m_uiAnimOverrideBitmask;
bool m_bIsFree;
vector<SKIN_BOX *> m_AdditionalBoxes;
vector<SKIN_OFFSET *> m_Offsets;

public:

Expand All @@ -24,6 +27,8 @@ class DLCSkinFile : public DLCFile
bool getParameterAsBool(DLCManager::EDLCParameterType type) override;
vector<SKIN_BOX *> *getAdditionalBoxes();
int getAdditionalBoxesCount();
vector<SKIN_OFFSET *> *getOffsets();
int getOffsetsCount();
unsigned int getAnimOverrideBitmask() { return m_uiAnimOverrideBitmask;}
bool isFree() {return m_bIsFree;}
};
10 changes: 9 additions & 1 deletion Minecraft.Client/Common/UI/UIControl_PlayerSkinPreview.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,15 @@ void UIControl_PlayerSkinPreview::render(EntityRenderer *renderer, double x, dou
glPushMatrix();
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) >= 45 && t->loadMemTexture(m_customTextureUrl, m_backupTexture) <= 53) || m_uiAnimOverrideBitmask&(1<<HumanoidModel::eAnim_SlimModel))
model = static_cast<HumanoidModel *>(renderer->getModelSlim());
else if (t->loadMemTexture(m_customTextureUrl, m_backupTexture) == 54 || m_uiAnimOverrideBitmask&(1<<HumanoidModel::eAnim_ClassicModel))
model = static_cast<HumanoidModel *>(renderer->getModelClassic());
else
model = static_cast<HumanoidModel *>(renderer->getModel());

//getAttackAnim(mob, a);
//if (armor != nullptr) armor->attackTime = model->attackTime;
Expand Down
40 changes: 40 additions & 0 deletions Minecraft.Client/Common/UI/UIScene_SkinSelectMenu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,16 @@ const WCHAR *UIScene_SkinSelectMenu::wchDefaultNamesA[]=
L"Prisoner Steve",
L"Cyclist Steve",
L"Boxer Steve",
L"Alex",
L"Tennis Alex",
L"Tuxedo Alex",
L"Athlete Alex",
L"Swedish Alex",
L"Prisoner Alex",
L"Cyclist Alex",
L"Boxer Alex",
L"Developer Alex",
L"Developer Steve",
};

UIScene_SkinSelectMenu::UIScene_SkinSelectMenu(int iPad, void *initData, UILayer *parentLayer) : UIScene(iPad, parentLayer)
Expand Down Expand Up @@ -993,6 +1003,36 @@ TEXTURE_NAME UIScene_SkinSelectMenu::getTextureId(int skinIndex)
case eDefaultSkins_Skin7:
texture = TN_MOB_CHAR7;
break;
case eDefaultSkins_Skin8:
texture = TN_MOB_ALEX;
break;
case eDefaultSkins_Skin9:
texture = TN_MOB_ALEX1;
break;
case eDefaultSkins_Skin10:
texture = TN_MOB_ALEX2;
break;
case eDefaultSkins_Skin11:
texture = TN_MOB_ALEX3;
break;
case eDefaultSkins_Skin12:
texture = TN_MOB_ALEX4;
break;
case eDefaultSkins_Skin13:
texture = TN_MOB_ALEX5;
break;
case eDefaultSkins_Skin14:
texture = TN_MOB_ALEX6;
break;
case eDefaultSkins_Skin15:
texture = TN_MOB_ALEX7;
break;
case eDefaultSkins_Skin16:
texture = TN_MOB_DEVALEX;
break;
case eDefaultSkins_Skin17:
texture = TN_MOB_DEVSTEVE;
break;
};

return texture;
Expand Down
Binary file added Minecraft.Client/Common/res/1_2_2/mob/DevAlex.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Minecraft.Client/Common/res/1_2_2/mob/alex.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Minecraft.Client/Common/res/1_2_2/mob/alex1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Minecraft.Client/Common/res/1_2_2/mob/alex2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Minecraft.Client/Common/res/1_2_2/mob/alex3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Minecraft.Client/Common/res/1_2_2/mob/alex4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Minecraft.Client/Common/res/1_2_2/mob/alex5.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Minecraft.Client/Common/res/1_2_2/mob/alex6.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Minecraft.Client/Common/res/1_2_2/mob/alex7.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions Minecraft.Client/EntityRenderer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ ResourceLocation EntityRenderer::SHADOW_LOCATION = ResourceLocation(TN__CLAMP__M
EntityRenderer::EntityRenderer()
{
model = nullptr;
modelClassic = nullptr;
modelSlim = nullptr;
tileRenderer = new TileRenderer();
shadowRadius = 0;
shadowStrength = 1.0f;
Expand Down
Loading