Conversation
Added code for 64x64 classic and slim skins. Also added the remaining default skins.
Corrected some code in DLCSkinFile.cpp for getting the DLC skin offsets was getting too many parameters that don't exist.
|
will test when you're ready, just mark as ready for review when you want me to test |
Fixed cape not rendering properly for 64x64 skin due to the renderer trying to using a 64x64 texture instead a of a 64x32 texture for the cape.
|
@sylvessa I fixed the cape not rendering properly with 64x64 skins. I want to implement skin offsets, used in the Mario skin pack, before marking this as ready for review. |
|
ok! take ur time 👍 |
|
Hey, I found an issue. If a player has a 64x64 slim skin, it's still treated as a 64x32 skin by other clients in multiplayer. The opposite happens with 64x64 classic skins though. |
|
@ZomkaDEV I have looked into the issue you have reported, but cannot recreate the issue you have. |
|
@ZomkaDEV send me your PCK to test because I also have my own custom PCK, but I find no problems with mine. |
Here you go. Perhaps the issue is with how I made my pck... |
One issue is with your pck, it incorrectly has the 64x64 Classic flag on the Jeb skin while the texture is 64x32. |
Oh, well, I didn't know that. I removed the ANIM flag and the jeb (64x32) skin is now rendering properly on both sides. Still experiencing issues with 64x64 skins though... |
|
Okay, I've done some testing. I was able to find that if both of the clients have the PCK file with the 64x64 skin, it is rendered correctly. If they don't, it is treated as a 64x32 skin. |
|
Aha, I figured out why! If the skin has no extra geometry, only the texture is being sent without all the other metadata like the ANIM value :) I fixed it in my fork, feel free to implement the same change. |
Added code to DLCSkinFile.cpp to store skin box scale value. Added code to HumanoidModel.cpp and HumanoidModel.h to handle skin boxes added to the armor layer of skin. Added another float value to SkinBox.h








Description
Adds code to support DLC 64x64 classic and slim skins. Also adds the remaining default skins.
https://www.youtube.com/watch?v=lX_AaVbohZE
Changes
Previous Behavior
Skins and skin packs that were or had 64x64 dimension textures would not render properly or cause the game to crash. Also skin boxes would not be mirrored if the skin box had the mirror bit set to true.
Root Cause
Lack of 64x64 skin support.
New Behavior
Skins and skin packs that are or have 64x64 dimension textures will render properly and mostly won't cause the game to crash (Switching to or between 64x64 skins in game can sometimes cause the game to crash). Skin boxes are properly mirrored when the mirror bit is present. Some code for handling DLC skin offsets was added, but not fully implemented (Don't know how to fully implement).
Fix Implementation
References to the added default skins texture were added to the files: Textures.cpp, Textures.h, Definitions.h, UIScene_SkinSelectMenu.cpp, and Player.cpp. In SkinBox.h more enums and floats were added. In HumanoidModel.cpp and HumanoidModel.h code was added to handle whether the skin is 64x32 or 64x64, a Boolean was added to determine if it is slim or classic, and code was added to handle the skin box mirror bit value and scale of skin box if attached to the second layer (jacket, sleeve0, sleeve1, pants0, pants1). In TextureAndGeometryPacket.cpp added code to handle the extra skin boxs' floats. A check was added to UIControl_PlayerSkinPreview.cpp and XUI_Ctrl_MinecraftSkinPreview.cpp to make the Alex skins use the 64x64 slim model and make the Developer Steve skin use the 64x64 classic model. A classic and slim model options were added to EntityRenderer.cpp and EntityRenderer.h, which will be empty if a mob is spawned instead of a player. PlayerRenderer.cpp and PlayerRenderer.h contain similar functionality as UIControl_PlayerSkinPreview.cpp, but for the first-person hand and similar features and uses the DLC skin files bit mask to determine whether to use the default model or the 64x64 variants. LivingEntityRenderer.cpp contains new functionality for rendering a player model in a third-person or second-person game and include the same functionality of using the DLC skin bit mask to determine the model type. The functionality works as follows: PlayerRenderer.cpp passes a parameter to LivingEntityRenderer.cpp which creates and renders the regular, classic and slim models, which are saved in the EntityRenderer.cpp and EntityRenderer.h scripts, these models are also used in the skin menu display script (UIControl_PlayerSkinPreview.cpp). Code was added to Console_App.cpp to make DLC skin boxes render on the 64x64 classic and slim models. Changed code in ClientConnection.cpp and PlayerConnection.cpp to always send DLC metadata.
An extra enum was added to DLCManager.cpp and DLCManager.h for DLC skin offsets. SkinOffset.h was created to store the DLC skin offset data in a class, like SkinBox.h, which includes body part, direction, and amount to move the part. Code was added to DLCSkinFile.cpp and DLCSkinFile.h to store the extra data values of skin boxes and store DLC skin offset data in a vector of SKIN_OFFSETs.
AI Use Disclosure
No AI was used in the writing of this code.
Some code was taken from ItzSonicFaner's pull request (https://github.com/smartcmd/MinecraftConsoles/pull/1183), but has more development.
Thanks to @ZomkaDEV for implementing code to fix DLC skin metadata not being sent.
Related Issues
Help
I would appreciate if someone can help with the implementation of DLC skin offsets and improvement/optimization of the code for 64x64 skins.
Issues