Draft
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Adds code to support 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 (Certain skins cause the game to crash and the reason is difficult to determine). 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). A check was added to UIControl_PlayerSkinPreview.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.
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 (#1183), but has more development.
Related Issues
Help
I would appreciate if someone can help with the implementation of DLC skin offests.