service: mii: Remove most magic values
This commit is contained in:
parent
ec25f847d8
commit
4d138b760b
10 changed files with 1534 additions and 1066 deletions
|
@ -13,20 +13,517 @@
|
|||
|
||||
namespace Service::Mii {
|
||||
|
||||
enum class Age : u32 {
|
||||
constexpr u8 MaxHeight = 127;
|
||||
constexpr u8 MaxBuild = 127;
|
||||
constexpr u8 MaxType = 1;
|
||||
constexpr u8 MaxRegionMove = 3;
|
||||
constexpr u8 MaxEyeScale = 7;
|
||||
constexpr u8 MaxEyeAspect = 6;
|
||||
constexpr u8 MaxEyeRotate = 7;
|
||||
constexpr u8 MaxEyeX = 12;
|
||||
constexpr u8 MaxEyeY = 18;
|
||||
constexpr u8 MaxEyebrowScale = 8;
|
||||
constexpr u8 MaxEyebrowAspect = 6;
|
||||
constexpr u8 MaxEyebrowRotate = 11;
|
||||
constexpr u8 MaxEyebrowX = 12;
|
||||
constexpr u8 MaxEyebrowY = 18;
|
||||
constexpr u8 MaxNoseScale = 8;
|
||||
constexpr u8 MaxNoseY = 18;
|
||||
constexpr u8 MaxMouthScale = 8;
|
||||
constexpr u8 MaxMoutAspect = 6;
|
||||
constexpr u8 MaxMouthY = 18;
|
||||
constexpr u8 MaxMustacheScale = 8;
|
||||
constexpr u8 MasMustacheY = 16;
|
||||
constexpr u8 MaxGlassScale = 7;
|
||||
constexpr u8 MaxGlassY = 20;
|
||||
constexpr u8 MaxMoleScale = 8;
|
||||
constexpr u8 MaxMoleX = 16;
|
||||
constexpr u8 MaxMoleY = 30;
|
||||
constexpr u8 MaxVer3CommonColor = 7;
|
||||
constexpr u8 MaxVer3GlassType = 8;
|
||||
|
||||
enum class Age : u8 {
|
||||
Young,
|
||||
Normal,
|
||||
Old,
|
||||
All,
|
||||
All, // Default
|
||||
|
||||
Max = All,
|
||||
};
|
||||
|
||||
enum class BeardType : u32 {
|
||||
enum class Gender : u8 {
|
||||
Male,
|
||||
Female,
|
||||
All, // Default
|
||||
|
||||
Max = Female,
|
||||
};
|
||||
|
||||
enum class Race : u8 {
|
||||
Black,
|
||||
White,
|
||||
Asian,
|
||||
All, // Default
|
||||
|
||||
Max = All,
|
||||
};
|
||||
|
||||
enum class HairType : u8 {
|
||||
NormalLong, // Default
|
||||
NormalShort,
|
||||
NormalMedium,
|
||||
NormalExtraLong,
|
||||
NormalLongBottom,
|
||||
NormalTwoPeaks,
|
||||
PartingLong,
|
||||
FrontLock,
|
||||
PartingShort,
|
||||
PartingExtraLongCurved,
|
||||
PartingExtraLong,
|
||||
PartingMiddleLong,
|
||||
PartingSquared,
|
||||
PartingLongBottom,
|
||||
PeaksTop,
|
||||
PeaksSquared,
|
||||
PartingPeaks,
|
||||
PeaksLongBottom,
|
||||
Peaks,
|
||||
PeaksRounded,
|
||||
PeaksSide,
|
||||
PeaksMedium,
|
||||
PeaksLong,
|
||||
PeaksRoundedLong,
|
||||
PartingFrontPeaks,
|
||||
PartingLongFront,
|
||||
PartingLongRounded,
|
||||
PartingFrontPeaksLong,
|
||||
PartingExtraLongRounded,
|
||||
LongRounded,
|
||||
NormalUnknown1,
|
||||
NormalUnknown2,
|
||||
NormalUnknown3,
|
||||
NormalUnknown4,
|
||||
NormalUnknown5,
|
||||
NormalUnknown6,
|
||||
DreadLocks,
|
||||
PlatedMats,
|
||||
Caps,
|
||||
Afro,
|
||||
PlatedMatsLong,
|
||||
Beanie,
|
||||
Short,
|
||||
ShortTopLongSide,
|
||||
ShortUnknown1,
|
||||
ShortUnknown2,
|
||||
MilitaryParting,
|
||||
Military,
|
||||
ShortUnknown3,
|
||||
ShortUnknown4,
|
||||
ShortUnknown5,
|
||||
ShortUnknown6,
|
||||
NoneTop,
|
||||
None,
|
||||
Beard1,
|
||||
Beard2,
|
||||
Beard3,
|
||||
Beard4,
|
||||
Beard5,
|
||||
LongUnknown1,
|
||||
LongUnknown2,
|
||||
LongUnknown3,
|
||||
LongUnknown4,
|
||||
LongUnknown5,
|
||||
LongUnknown6,
|
||||
LongUnknown7,
|
||||
LongUnknown8,
|
||||
LongUnknown9,
|
||||
LongUnknown10,
|
||||
LongUnknown11,
|
||||
LongUnknown12,
|
||||
LongUnknown13,
|
||||
LongUnknown14,
|
||||
LongUnknown15,
|
||||
LongUnknown16,
|
||||
LongUnknown17,
|
||||
LongUnknown18,
|
||||
LongUnknown19,
|
||||
LongUnknown20,
|
||||
LongUnknown21,
|
||||
LongUnknown22,
|
||||
LongUnknown23,
|
||||
LongUnknown24,
|
||||
LongUnknown25,
|
||||
LongUnknown26,
|
||||
LongUnknown27,
|
||||
LongUnknown28,
|
||||
LongUnknown29,
|
||||
LongUnknown30,
|
||||
LongUnknown31,
|
||||
LongUnknown32,
|
||||
LongUnknown33,
|
||||
LongUnknown34,
|
||||
LongUnknown35,
|
||||
LongUnknown36,
|
||||
LongUnknown37,
|
||||
LongUnknown38,
|
||||
LongUnknown39,
|
||||
LongUnknown40,
|
||||
LongUnknown41,
|
||||
LongUnknown42,
|
||||
LongUnknown43,
|
||||
LongUnknown44,
|
||||
LongUnknown45,
|
||||
LongUnknown46,
|
||||
LongUnknown47,
|
||||
LongUnknown48,
|
||||
LongUnknown49,
|
||||
LongUnknown50,
|
||||
LongUnknown51,
|
||||
LongUnknown52,
|
||||
LongUnknown53,
|
||||
LongUnknown54,
|
||||
LongUnknown55,
|
||||
LongUnknown56,
|
||||
LongUnknown57,
|
||||
LongUnknown58,
|
||||
LongUnknown59,
|
||||
LongUnknown60,
|
||||
LongUnknown61,
|
||||
LongUnknown62,
|
||||
LongUnknown63,
|
||||
LongUnknown64,
|
||||
LongUnknown65,
|
||||
LongUnknown66,
|
||||
TwoMediumFrontStrandsOneLongBackPonyTail,
|
||||
TwoFrontStrandsLongBackPonyTail,
|
||||
PartingFrontTwoLongBackPonyTails,
|
||||
TwoFrontStrandsOneLongBackPonyTail,
|
||||
LongBackPonyTail,
|
||||
LongFrontTwoLongBackPonyTails,
|
||||
StrandsTwoShortSidedPonyTails,
|
||||
TwoMediumSidedPonyTails,
|
||||
ShortFrontTwoBackPonyTails,
|
||||
TwoShortSidedPonyTails,
|
||||
TwoLongSidedPonyTails,
|
||||
LongFrontTwoBackPonyTails,
|
||||
|
||||
Max = LongFrontTwoBackPonyTails,
|
||||
};
|
||||
|
||||
enum class MoleType : u8 {
|
||||
None, // Default
|
||||
OneDot,
|
||||
|
||||
Max = OneDot,
|
||||
};
|
||||
|
||||
enum class HairFlip : u8 {
|
||||
Left, // Default
|
||||
Right,
|
||||
|
||||
Max = Right,
|
||||
};
|
||||
|
||||
enum class CommonColor : u8 {
|
||||
// For simplicity common colors aren't listed
|
||||
Max = 99,
|
||||
Count = 100,
|
||||
};
|
||||
|
||||
enum class FavoriteColor : u8 {
|
||||
Red, // Default
|
||||
Orange,
|
||||
Yellow,
|
||||
LimeGreen,
|
||||
Green,
|
||||
Blue,
|
||||
LightBlue,
|
||||
Pink,
|
||||
Purple,
|
||||
Brown,
|
||||
White,
|
||||
Black,
|
||||
|
||||
Max = Black,
|
||||
};
|
||||
|
||||
enum class EyeType : u8 {
|
||||
Normal, // Default
|
||||
NormalLash,
|
||||
WhiteLash,
|
||||
WhiteNoBottom,
|
||||
OvalAngledWhite,
|
||||
AngryWhite,
|
||||
DotLashType1,
|
||||
Line,
|
||||
DotLine,
|
||||
OvalWhite,
|
||||
RoundedWhite,
|
||||
NormalShadow,
|
||||
CircleWhite,
|
||||
Circle,
|
||||
CircleWhiteStroke,
|
||||
NormalOvalNoBottom,
|
||||
NormalOvalLarge,
|
||||
NormalRoundedNoBottom,
|
||||
SmallLash,
|
||||
Small,
|
||||
TwoSmall,
|
||||
NormalLongLash,
|
||||
WhiteTwoLashes,
|
||||
WhiteThreeLashes,
|
||||
DotAngry,
|
||||
DotAngled,
|
||||
Oval,
|
||||
SmallWhite,
|
||||
WhiteAngledNoBottom,
|
||||
WhiteAngledNoLeft,
|
||||
SmallWhiteTwoLashes,
|
||||
LeafWhiteLash,
|
||||
WhiteLargeNoBottom,
|
||||
Dot,
|
||||
DotLashType2,
|
||||
DotThreeLashes,
|
||||
WhiteOvalTop,
|
||||
WhiteOvalBottom,
|
||||
WhiteOvalBottomFlat,
|
||||
WhiteOvalTwoLashes,
|
||||
WhiteOvalThreeLashes,
|
||||
WhiteOvalNoBottomTwoLashes,
|
||||
DotWhite,
|
||||
WhiteOvalTopFlat,
|
||||
WhiteThinLeaf,
|
||||
StarThreeLashes,
|
||||
LineTwoLashes,
|
||||
CrowsFeet,
|
||||
WhiteNoBottomFlat,
|
||||
WhiteNoBottomRounded,
|
||||
WhiteSmallBottomLine,
|
||||
WhiteNoBottomLash,
|
||||
WhiteNoPartialBottomLash,
|
||||
WhiteOvalBottomLine,
|
||||
WhiteNoBottomLashTopLine,
|
||||
WhiteNoPartialBottomTwoLashes,
|
||||
NormalTopLine,
|
||||
WhiteOvalLash,
|
||||
RoundTired,
|
||||
WhiteLarge,
|
||||
|
||||
Max = WhiteLarge,
|
||||
};
|
||||
|
||||
enum class MouthType : u8 {
|
||||
Neutral, // Default
|
||||
NeutralLips,
|
||||
Smile,
|
||||
SmileStroke,
|
||||
SmileTeeth,
|
||||
LipsSmall,
|
||||
LipsLarge,
|
||||
Wave,
|
||||
WaveAngrySmall,
|
||||
NeutralStrokeLarge,
|
||||
TeethSurprised,
|
||||
LipsExtraLarge,
|
||||
LipsUp,
|
||||
NeutralDown,
|
||||
Surprised,
|
||||
TeethMiddle,
|
||||
NeutralStroke,
|
||||
LipsExtraSmall,
|
||||
Malicious,
|
||||
LipsDual,
|
||||
NeutralComma,
|
||||
NeutralUp,
|
||||
TeethLarge,
|
||||
WaveAngry,
|
||||
LipsSexy,
|
||||
SmileInverted,
|
||||
LipsSexyOutline,
|
||||
SmileRounded,
|
||||
LipsTeeth,
|
||||
NeutralOpen,
|
||||
TeethRounded,
|
||||
WaveAngrySmallInverted,
|
||||
NeutralCommaInverted,
|
||||
TeethFull,
|
||||
SmileDownLine,
|
||||
Kiss,
|
||||
|
||||
Max = Kiss,
|
||||
};
|
||||
|
||||
enum class FontRegion : u8 {
|
||||
Standard, // Default
|
||||
China,
|
||||
Korea,
|
||||
Taiwan,
|
||||
|
||||
Max = Taiwan,
|
||||
};
|
||||
|
||||
enum class FacelineType : u8 {
|
||||
Sharp, // Default
|
||||
Rounded,
|
||||
SharpRounded,
|
||||
SharpRoundedSmall,
|
||||
Large,
|
||||
LargeRounded,
|
||||
SharpSmall,
|
||||
Flat,
|
||||
Bump,
|
||||
Angular,
|
||||
FlatRounded,
|
||||
AngularSmall,
|
||||
|
||||
Max = AngularSmall,
|
||||
};
|
||||
|
||||
enum class FacelineColor : u8 {
|
||||
Beige, // Default
|
||||
WarmBeige,
|
||||
Natural,
|
||||
Honey,
|
||||
Chestnut,
|
||||
Porcelain,
|
||||
Ivory,
|
||||
WarmIvory,
|
||||
Almond,
|
||||
Espresso,
|
||||
|
||||
Max = Espresso,
|
||||
Count = Max + 1,
|
||||
};
|
||||
|
||||
enum class FacelineWrinkle : u8 {
|
||||
None, // Default
|
||||
TearTroughs,
|
||||
FacialPain,
|
||||
Cheeks,
|
||||
Folds,
|
||||
UnderTheEyes,
|
||||
SplitChin,
|
||||
Chin,
|
||||
BrowDroop,
|
||||
MouthFrown,
|
||||
CrowsFeet,
|
||||
FoldsCrowsFrown,
|
||||
|
||||
Max = FoldsCrowsFrown,
|
||||
};
|
||||
|
||||
enum class FacelineMake : u8 {
|
||||
None, // Default
|
||||
CheekPorcelain,
|
||||
CheekNatural,
|
||||
EyeShadowBlue,
|
||||
CheekBlushPorcelain,
|
||||
CheekBlushNatural,
|
||||
CheekPorcelainEyeShadowBlue,
|
||||
CheekPorcelainEyeShadowNatural,
|
||||
CheekBlushPorcelainEyeShadowEspresso,
|
||||
Freckles,
|
||||
LionsManeBeard,
|
||||
StubbleBeard,
|
||||
|
||||
Max = StubbleBeard,
|
||||
};
|
||||
|
||||
enum class EyebrowType : u8 {
|
||||
FlatAngledLarge, // Default
|
||||
LowArchRoundedThin,
|
||||
SoftAngledLarge,
|
||||
MediumArchRoundedThin,
|
||||
RoundedMedium,
|
||||
LowArchMedium,
|
||||
RoundedThin,
|
||||
UpThin,
|
||||
MediumArchRoundedMedium,
|
||||
RoundedLarge,
|
||||
UpLarge,
|
||||
FlatAngledLargeInverted,
|
||||
MediumArchFlat,
|
||||
AngledThin,
|
||||
HorizontalLarge,
|
||||
HighArchFlat,
|
||||
Flat,
|
||||
MediumArchLarge,
|
||||
LowArchThin,
|
||||
RoundedThinInverted,
|
||||
HighArchLarge,
|
||||
Hairy,
|
||||
Dotted,
|
||||
None,
|
||||
|
||||
Max = None,
|
||||
};
|
||||
|
||||
enum class NoseType : u8 {
|
||||
Normal, // Default
|
||||
Rounded,
|
||||
Dot,
|
||||
Arrow,
|
||||
Roman,
|
||||
Triangle,
|
||||
Button,
|
||||
RoundedInverted,
|
||||
Potato,
|
||||
Grecian,
|
||||
Snub,
|
||||
Aquiline,
|
||||
ArrowLeft,
|
||||
RoundedLarge,
|
||||
Hooked,
|
||||
Fat,
|
||||
Droopy,
|
||||
ArrowLarge,
|
||||
|
||||
Max = ArrowLarge,
|
||||
};
|
||||
|
||||
enum class BeardType : u8 {
|
||||
None,
|
||||
Goatee,
|
||||
GoateeLong,
|
||||
LionsManeLong,
|
||||
LionsMane,
|
||||
Full,
|
||||
|
||||
Min = Goatee,
|
||||
Max = Full,
|
||||
};
|
||||
|
||||
enum class MustacheType : u8 {
|
||||
None,
|
||||
Walrus,
|
||||
Pencil,
|
||||
Horseshoe,
|
||||
Normal,
|
||||
Toothbrush,
|
||||
|
||||
Min = Walrus,
|
||||
Max = Toothbrush,
|
||||
};
|
||||
|
||||
enum class GlassType : u8 {
|
||||
None,
|
||||
Oval,
|
||||
Wayfarer,
|
||||
Rectangle,
|
||||
TopRimless,
|
||||
Rounded,
|
||||
Oversized,
|
||||
CatEye,
|
||||
Square,
|
||||
BottomRimless,
|
||||
SemiOpaqueRounded,
|
||||
SemiOpaqueCatEye,
|
||||
SemiOpaqueOval,
|
||||
SemiOpaqueRectangle,
|
||||
SemiOpaqueAviator,
|
||||
OpaqueRounded,
|
||||
OpaqueCatEye,
|
||||
OpaqueOval,
|
||||
OpaqueRectangle,
|
||||
OpaqueAviator,
|
||||
|
||||
Max = OpaqueAviator,
|
||||
Count = Max + 1,
|
||||
};
|
||||
|
||||
enum class BeardAndMustacheFlag : u32 {
|
||||
|
@ -36,42 +533,6 @@ enum class BeardAndMustacheFlag : u32 {
|
|||
};
|
||||
DECLARE_ENUM_FLAG_OPERATORS(BeardAndMustacheFlag);
|
||||
|
||||
enum class FontRegion : u32 {
|
||||
Standard,
|
||||
China,
|
||||
Korea,
|
||||
Taiwan,
|
||||
};
|
||||
|
||||
enum class Gender : u32 {
|
||||
Male,
|
||||
Female,
|
||||
All,
|
||||
Maximum = Female,
|
||||
};
|
||||
|
||||
enum class HairFlip : u32 {
|
||||
Left,
|
||||
Right,
|
||||
Maximum = Right,
|
||||
};
|
||||
|
||||
enum class MustacheType : u32 {
|
||||
None,
|
||||
Mustache1,
|
||||
Mustache2,
|
||||
Mustache3,
|
||||
Mustache4,
|
||||
Mustache5,
|
||||
};
|
||||
|
||||
enum class Race : u32 {
|
||||
Black,
|
||||
White,
|
||||
Asian,
|
||||
All,
|
||||
};
|
||||
|
||||
enum class Source : u32 {
|
||||
Database = 0,
|
||||
Default = 1,
|
||||
|
@ -173,7 +634,7 @@ struct DefaultMii {
|
|||
u32 face_makeup{};
|
||||
u32 hair_type{};
|
||||
u32 hair_color{};
|
||||
HairFlip hair_flip{};
|
||||
u32 hair_flip{};
|
||||
u32 eye_type{};
|
||||
u32 eye_color{};
|
||||
u32 eye_scale{};
|
||||
|
@ -196,8 +657,8 @@ struct DefaultMii {
|
|||
u32 mouth_scale{};
|
||||
u32 mouth_aspect{};
|
||||
u32 mouth_y{};
|
||||
MustacheType mustache_type{};
|
||||
BeardType beard_type{};
|
||||
u32 mustache_type{};
|
||||
u32 beard_type{};
|
||||
u32 beard_color{};
|
||||
u32 mustache_scale{};
|
||||
u32 mustache_y{};
|
||||
|
@ -211,10 +672,10 @@ struct DefaultMii {
|
|||
u32 mole_y{};
|
||||
u32 height{};
|
||||
u32 weight{};
|
||||
Gender gender{};
|
||||
u32 gender{};
|
||||
u32 favorite_color{};
|
||||
u32 region_move{};
|
||||
FontRegion font_region{};
|
||||
u32 font_region{};
|
||||
u32 type{};
|
||||
Nickname nickname;
|
||||
};
|
||||
|
|
|
@ -10,7 +10,7 @@ void CharInfo::SetFromStoreData(const StoreData& store_data) {
|
|||
name = store_data.GetNickname();
|
||||
null_terminator = '\0';
|
||||
create_id = store_data.GetCreateId();
|
||||
font_region = static_cast<u8>(store_data.GetFontRegion());
|
||||
font_region = store_data.GetFontRegion();
|
||||
favorite_color = store_data.GetFavoriteColor();
|
||||
gender = store_data.GetGender();
|
||||
height = store_data.GetHeight();
|
||||
|
@ -51,10 +51,10 @@ void CharInfo::SetFromStoreData(const StoreData& store_data) {
|
|||
mustache_type = store_data.GetMustacheType();
|
||||
mustache_scale = store_data.GetMustacheScale();
|
||||
mustache_y = store_data.GetMustacheY();
|
||||
glasses_type = store_data.GetGlassType();
|
||||
glasses_color = store_data.GetGlassColor();
|
||||
glasses_scale = store_data.GetGlassScale();
|
||||
glasses_y = store_data.GetGlassY();
|
||||
glass_type = store_data.GetGlassType();
|
||||
glass_color = store_data.GetGlassColor();
|
||||
glass_scale = store_data.GetGlassScale();
|
||||
glass_y = store_data.GetGlassY();
|
||||
mole_type = store_data.GetMoleType();
|
||||
mole_scale = store_data.GetMoleScale();
|
||||
mole_x = store_data.GetMoleX();
|
||||
|
@ -69,151 +69,151 @@ ValidationResult CharInfo::Verify() const {
|
|||
if (!name.IsValid()) {
|
||||
return ValidationResult::InvalidName;
|
||||
}
|
||||
if (3 < font_region) {
|
||||
if (font_region > FontRegion::Max) {
|
||||
return ValidationResult::InvalidFont;
|
||||
}
|
||||
if (0xb < favorite_color) {
|
||||
if (favorite_color > FavoriteColor::Max) {
|
||||
return ValidationResult::InvalidColor;
|
||||
}
|
||||
if (1 < gender) {
|
||||
if (gender > Gender::Max) {
|
||||
return ValidationResult::InvalidGender;
|
||||
}
|
||||
if (height > 0x7f) {
|
||||
if (height > MaxHeight) {
|
||||
return ValidationResult::InvalidHeight;
|
||||
}
|
||||
if (build > 0x7f) {
|
||||
if (build > MaxBuild) {
|
||||
return ValidationResult::InvalidBuild;
|
||||
}
|
||||
if (1 < type) {
|
||||
if (type > MaxType) {
|
||||
return ValidationResult::InvalidType;
|
||||
}
|
||||
if (3 < region_move) {
|
||||
if (region_move > MaxRegionMove) {
|
||||
return ValidationResult::InvalidRegionMove;
|
||||
}
|
||||
if (0xb < faceline_type) {
|
||||
if (faceline_type > FacelineType::Max) {
|
||||
return ValidationResult::InvalidFacelineType;
|
||||
}
|
||||
if (9 < faceline_color) {
|
||||
if (faceline_color > FacelineColor::Max) {
|
||||
return ValidationResult::InvalidFacelineColor;
|
||||
}
|
||||
if (0xb < faceline_wrinkle) {
|
||||
if (faceline_wrinkle > FacelineWrinkle::Max) {
|
||||
return ValidationResult::InvalidFacelineWrinkle;
|
||||
}
|
||||
if (0xb < faceline_make) {
|
||||
if (faceline_make > FacelineMake::Max) {
|
||||
return ValidationResult::InvalidFacelineMake;
|
||||
}
|
||||
if (0x83 < hair_type) {
|
||||
if (hair_type > HairType::Max) {
|
||||
return ValidationResult::InvalidHairType;
|
||||
}
|
||||
if (99 < hair_color) {
|
||||
if (hair_color > CommonColor::Max) {
|
||||
return ValidationResult::InvalidHairColor;
|
||||
}
|
||||
if (1 < hair_flip) {
|
||||
if (hair_flip > HairFlip::Max) {
|
||||
return ValidationResult::InvalidHairFlip;
|
||||
}
|
||||
if (0x3b < eye_type) {
|
||||
if (eye_type > EyeType::Max) {
|
||||
return ValidationResult::InvalidEyeType;
|
||||
}
|
||||
if (99 < eye_color) {
|
||||
if (eye_color > CommonColor::Max) {
|
||||
return ValidationResult::InvalidEyeColor;
|
||||
}
|
||||
if (7 < eye_scale) {
|
||||
if (eye_scale > MaxEyeScale) {
|
||||
return ValidationResult::InvalidEyeScale;
|
||||
}
|
||||
if (6 < eye_aspect) {
|
||||
if (eye_aspect > MaxEyeAspect) {
|
||||
return ValidationResult::InvalidEyeAspect;
|
||||
}
|
||||
if (7 < eye_rotate) {
|
||||
if (eye_rotate > MaxEyeX) {
|
||||
return ValidationResult::InvalidEyeRotate;
|
||||
}
|
||||
if (0xc < eye_x) {
|
||||
if (eye_x > MaxEyeX) {
|
||||
return ValidationResult::InvalidEyeX;
|
||||
}
|
||||
if (0x12 < eye_y) {
|
||||
if (eye_y > MaxEyeY) {
|
||||
return ValidationResult::InvalidEyeY;
|
||||
}
|
||||
if (0x17 < eyebrow_type) {
|
||||
if (eyebrow_type > EyebrowType::Max) {
|
||||
return ValidationResult::InvalidEyebrowType;
|
||||
}
|
||||
if (99 < eyebrow_color) {
|
||||
if (eyebrow_color > CommonColor::Max) {
|
||||
return ValidationResult::InvalidEyebrowColor;
|
||||
}
|
||||
if (8 < eyebrow_scale) {
|
||||
if (eyebrow_scale > MaxEyebrowScale) {
|
||||
return ValidationResult::InvalidEyebrowScale;
|
||||
}
|
||||
if (6 < eyebrow_aspect) {
|
||||
if (eyebrow_aspect > MaxEyebrowAspect) {
|
||||
return ValidationResult::InvalidEyebrowAspect;
|
||||
}
|
||||
if (0xb < eyebrow_rotate) {
|
||||
if (eyebrow_rotate > MaxEyebrowRotate) {
|
||||
return ValidationResult::InvalidEyebrowRotate;
|
||||
}
|
||||
if (0xc < eyebrow_x) {
|
||||
if (eyebrow_x > MaxEyebrowX) {
|
||||
return ValidationResult::InvalidEyebrowX;
|
||||
}
|
||||
if (0xf < eyebrow_y - 3) {
|
||||
if (eyebrow_y > MaxEyebrowY) {
|
||||
return ValidationResult::InvalidEyebrowY;
|
||||
}
|
||||
if (0x11 < nose_type) {
|
||||
if (nose_type > NoseType::Max) {
|
||||
return ValidationResult::InvalidNoseType;
|
||||
}
|
||||
if (nose_scale >= 9) {
|
||||
if (nose_scale > MaxNoseScale) {
|
||||
return ValidationResult::InvalidNoseScale;
|
||||
}
|
||||
if (0x12 < nose_y) {
|
||||
if (nose_y > MaxNoseY) {
|
||||
return ValidationResult::InvalidNoseY;
|
||||
}
|
||||
if (0x23 < mouth_type) {
|
||||
if (mouth_type > MouthType::Max) {
|
||||
return ValidationResult::InvalidMouthType;
|
||||
}
|
||||
if (99 < mouth_color) {
|
||||
if (mouth_color > CommonColor::Max) {
|
||||
return ValidationResult::InvalidMouthColor;
|
||||
}
|
||||
if (8 < mouth_scale) {
|
||||
if (mouth_scale > MaxMouthScale) {
|
||||
return ValidationResult::InvalidMouthScale;
|
||||
}
|
||||
if (6 < mouth_aspect) {
|
||||
if (mouth_aspect > MaxMoutAspect) {
|
||||
return ValidationResult::InvalidMouthAspect;
|
||||
}
|
||||
if (0x12 < mouth_y) {
|
||||
if (mouth_y > MaxMouthY) {
|
||||
return ValidationResult::InvalidMoleY;
|
||||
}
|
||||
if (99 < beard_color) {
|
||||
if (beard_color > CommonColor::Max) {
|
||||
return ValidationResult::InvalidBeardColor;
|
||||
}
|
||||
if (5 < beard_type) {
|
||||
if (beard_type > BeardType::Max) {
|
||||
return ValidationResult::InvalidBeardType;
|
||||
}
|
||||
if (5 < mustache_type) {
|
||||
if (mustache_type > MustacheType::Max) {
|
||||
return ValidationResult::InvalidMustacheType;
|
||||
}
|
||||
if (8 < mustache_scale) {
|
||||
if (mustache_scale > MaxMustacheScale) {
|
||||
return ValidationResult::InvalidMustacheScale;
|
||||
}
|
||||
if (0x10 < mustache_y) {
|
||||
if (mustache_y > MasMustacheY) {
|
||||
return ValidationResult::InvalidMustacheY;
|
||||
}
|
||||
if (0x13 < glasses_type) {
|
||||
if (glass_type > GlassType::Max) {
|
||||
return ValidationResult::InvalidGlassType;
|
||||
}
|
||||
if (99 < glasses_color) {
|
||||
if (glass_color > CommonColor::Max) {
|
||||
return ValidationResult::InvalidGlassColor;
|
||||
}
|
||||
if (7 < glasses_scale) {
|
||||
if (glass_scale > MaxGlassScale) {
|
||||
return ValidationResult::InvalidGlassScale;
|
||||
}
|
||||
if (0x14 < glasses_y) {
|
||||
if (glass_y > MaxGlassY) {
|
||||
return ValidationResult::InvalidGlassY;
|
||||
}
|
||||
if (mole_type >= 2) {
|
||||
if (mole_type > MoleType::Max) {
|
||||
return ValidationResult::InvalidMoleType;
|
||||
}
|
||||
if (8 < mole_scale) {
|
||||
if (mole_scale > MaxMoleScale) {
|
||||
return ValidationResult::InvalidMoleScale;
|
||||
}
|
||||
if (mole_x >= 0x11) {
|
||||
if (mole_x > MaxMoleX) {
|
||||
return ValidationResult::InvalidMoleX;
|
||||
}
|
||||
if (0x1e < mole_y) {
|
||||
if (mole_y > MaxMoleY) {
|
||||
return ValidationResult::InvalidMoleY;
|
||||
}
|
||||
return ValidationResult::NoErrors;
|
||||
|
@ -227,15 +227,15 @@ Nickname CharInfo::GetNickname() const {
|
|||
return name;
|
||||
}
|
||||
|
||||
u8 CharInfo::GetFontRegion() const {
|
||||
FontRegion CharInfo::GetFontRegion() const {
|
||||
return font_region;
|
||||
}
|
||||
|
||||
u8 CharInfo::GetFavoriteColor() const {
|
||||
FavoriteColor CharInfo::GetFavoriteColor() const {
|
||||
return favorite_color;
|
||||
}
|
||||
|
||||
u8 CharInfo::GetGender() const {
|
||||
Gender CharInfo::GetGender() const {
|
||||
return gender;
|
||||
}
|
||||
|
||||
|
@ -255,39 +255,39 @@ u8 CharInfo::GetRegionMove() const {
|
|||
return region_move;
|
||||
}
|
||||
|
||||
u8 CharInfo::GetFacelineType() const {
|
||||
FacelineType CharInfo::GetFacelineType() const {
|
||||
return faceline_type;
|
||||
}
|
||||
|
||||
u8 CharInfo::GetFacelineColor() const {
|
||||
FacelineColor CharInfo::GetFacelineColor() const {
|
||||
return faceline_color;
|
||||
}
|
||||
|
||||
u8 CharInfo::GetFacelineWrinkle() const {
|
||||
FacelineWrinkle CharInfo::GetFacelineWrinkle() const {
|
||||
return faceline_wrinkle;
|
||||
}
|
||||
|
||||
u8 CharInfo::GetFacelineMake() const {
|
||||
FacelineMake CharInfo::GetFacelineMake() const {
|
||||
return faceline_make;
|
||||
}
|
||||
|
||||
u8 CharInfo::GetHairType() const {
|
||||
HairType CharInfo::GetHairType() const {
|
||||
return hair_type;
|
||||
}
|
||||
|
||||
u8 CharInfo::GetHairColor() const {
|
||||
CommonColor CharInfo::GetHairColor() const {
|
||||
return hair_color;
|
||||
}
|
||||
|
||||
u8 CharInfo::GetHairFlip() const {
|
||||
HairFlip CharInfo::GetHairFlip() const {
|
||||
return hair_flip;
|
||||
}
|
||||
|
||||
u8 CharInfo::GetEyeType() const {
|
||||
EyeType CharInfo::GetEyeType() const {
|
||||
return eye_type;
|
||||
}
|
||||
|
||||
u8 CharInfo::GetEyeColor() const {
|
||||
CommonColor CharInfo::GetEyeColor() const {
|
||||
return eye_color;
|
||||
}
|
||||
|
||||
|
@ -311,11 +311,11 @@ u8 CharInfo::GetEyeY() const {
|
|||
return eye_y;
|
||||
}
|
||||
|
||||
u8 CharInfo::GetEyebrowType() const {
|
||||
EyebrowType CharInfo::GetEyebrowType() const {
|
||||
return eyebrow_type;
|
||||
}
|
||||
|
||||
u8 CharInfo::GetEyebrowColor() const {
|
||||
CommonColor CharInfo::GetEyebrowColor() const {
|
||||
return eyebrow_color;
|
||||
}
|
||||
|
||||
|
@ -339,7 +339,7 @@ u8 CharInfo::GetEyebrowY() const {
|
|||
return eyebrow_y;
|
||||
}
|
||||
|
||||
u8 CharInfo::GetNoseType() const {
|
||||
NoseType CharInfo::GetNoseType() const {
|
||||
return nose_type;
|
||||
}
|
||||
|
||||
|
@ -351,11 +351,11 @@ u8 CharInfo::GetNoseY() const {
|
|||
return nose_y;
|
||||
}
|
||||
|
||||
u8 CharInfo::GetMouthType() const {
|
||||
MouthType CharInfo::GetMouthType() const {
|
||||
return mouth_type;
|
||||
}
|
||||
|
||||
u8 CharInfo::GetMouthColor() const {
|
||||
CommonColor CharInfo::GetMouthColor() const {
|
||||
return mouth_color;
|
||||
}
|
||||
|
||||
|
@ -371,15 +371,15 @@ u8 CharInfo::GetMouthY() const {
|
|||
return mouth_y;
|
||||
}
|
||||
|
||||
u8 CharInfo::GetBeardColor() const {
|
||||
CommonColor CharInfo::GetBeardColor() const {
|
||||
return beard_color;
|
||||
}
|
||||
|
||||
u8 CharInfo::GetBeardType() const {
|
||||
BeardType CharInfo::GetBeardType() const {
|
||||
return beard_type;
|
||||
}
|
||||
|
||||
u8 CharInfo::GetMustacheType() const {
|
||||
MustacheType CharInfo::GetMustacheType() const {
|
||||
return mustache_type;
|
||||
}
|
||||
|
||||
|
@ -391,23 +391,23 @@ u8 CharInfo::GetMustacheY() const {
|
|||
return mustache_y;
|
||||
}
|
||||
|
||||
u8 CharInfo::GetGlassType() const {
|
||||
return glasses_type;
|
||||
GlassType CharInfo::GetGlassType() const {
|
||||
return glass_type;
|
||||
}
|
||||
|
||||
u8 CharInfo::GetGlassColor() const {
|
||||
return glasses_color;
|
||||
CommonColor CharInfo::GetGlassColor() const {
|
||||
return glass_color;
|
||||
}
|
||||
|
||||
u8 CharInfo::GetGlassScale() const {
|
||||
return glasses_scale;
|
||||
return glass_scale;
|
||||
}
|
||||
|
||||
u8 CharInfo::GetGlassY() const {
|
||||
return glasses_y;
|
||||
return glass_y;
|
||||
}
|
||||
|
||||
u8 CharInfo::GetMoleType() const {
|
||||
MoleType CharInfo::GetMoleType() const {
|
||||
return mole_type;
|
||||
}
|
||||
|
||||
|
@ -468,10 +468,10 @@ bool CharInfo::operator==(const CharInfo& info) {
|
|||
is_identical &= mustache_type == info.GetMustacheType();
|
||||
is_identical &= mustache_scale == info.GetMustacheScale();
|
||||
is_identical &= mustache_y == info.GetMustacheY();
|
||||
is_identical &= glasses_type == info.GetGlassType();
|
||||
is_identical &= glasses_color == info.GetGlassColor();
|
||||
is_identical &= glasses_scale == info.GetGlassScale();
|
||||
is_identical &= glasses_y == info.GetGlassY();
|
||||
is_identical &= glass_type == info.GetGlassType();
|
||||
is_identical &= glass_color == info.GetGlassColor();
|
||||
is_identical &= glass_scale == info.GetGlassScale();
|
||||
is_identical &= glass_y == info.GetGlassY();
|
||||
is_identical &= mole_type == info.GetMoleType();
|
||||
is_identical &= mole_scale == info.GetMoleScale();
|
||||
is_identical &= mole_x == info.GetMoleX();
|
||||
|
|
|
@ -17,52 +17,52 @@ public:
|
|||
|
||||
Common::UUID GetCreateId() const;
|
||||
Nickname GetNickname() const;
|
||||
u8 GetFontRegion() const;
|
||||
u8 GetFavoriteColor() const;
|
||||
u8 GetGender() const;
|
||||
FontRegion GetFontRegion() const;
|
||||
FavoriteColor GetFavoriteColor() const;
|
||||
Gender GetGender() const;
|
||||
u8 GetHeight() const;
|
||||
u8 GetBuild() const;
|
||||
u8 GetType() const;
|
||||
u8 GetRegionMove() const;
|
||||
u8 GetFacelineType() const;
|
||||
u8 GetFacelineColor() const;
|
||||
u8 GetFacelineWrinkle() const;
|
||||
u8 GetFacelineMake() const;
|
||||
u8 GetHairType() const;
|
||||
u8 GetHairColor() const;
|
||||
u8 GetHairFlip() const;
|
||||
u8 GetEyeType() const;
|
||||
u8 GetEyeColor() const;
|
||||
FacelineType GetFacelineType() const;
|
||||
FacelineColor GetFacelineColor() const;
|
||||
FacelineWrinkle GetFacelineWrinkle() const;
|
||||
FacelineMake GetFacelineMake() const;
|
||||
HairType GetHairType() const;
|
||||
CommonColor GetHairColor() const;
|
||||
HairFlip GetHairFlip() const;
|
||||
EyeType GetEyeType() const;
|
||||
CommonColor GetEyeColor() const;
|
||||
u8 GetEyeScale() const;
|
||||
u8 GetEyeAspect() const;
|
||||
u8 GetEyeRotate() const;
|
||||
u8 GetEyeX() const;
|
||||
u8 GetEyeY() const;
|
||||
u8 GetEyebrowType() const;
|
||||
u8 GetEyebrowColor() const;
|
||||
EyebrowType GetEyebrowType() const;
|
||||
CommonColor GetEyebrowColor() const;
|
||||
u8 GetEyebrowScale() const;
|
||||
u8 GetEyebrowAspect() const;
|
||||
u8 GetEyebrowRotate() const;
|
||||
u8 GetEyebrowX() const;
|
||||
u8 GetEyebrowY() const;
|
||||
u8 GetNoseType() const;
|
||||
NoseType GetNoseType() const;
|
||||
u8 GetNoseScale() const;
|
||||
u8 GetNoseY() const;
|
||||
u8 GetMouthType() const;
|
||||
u8 GetMouthColor() const;
|
||||
MouthType GetMouthType() const;
|
||||
CommonColor GetMouthColor() const;
|
||||
u8 GetMouthScale() const;
|
||||
u8 GetMouthAspect() const;
|
||||
u8 GetMouthY() const;
|
||||
u8 GetBeardColor() const;
|
||||
u8 GetBeardType() const;
|
||||
u8 GetMustacheType() const;
|
||||
CommonColor GetBeardColor() const;
|
||||
BeardType GetBeardType() const;
|
||||
MustacheType GetMustacheType() const;
|
||||
u8 GetMustacheScale() const;
|
||||
u8 GetMustacheY() const;
|
||||
u8 GetGlassType() const;
|
||||
u8 GetGlassColor() const;
|
||||
GlassType GetGlassType() const;
|
||||
CommonColor GetGlassColor() const;
|
||||
u8 GetGlassScale() const;
|
||||
u8 GetGlassY() const;
|
||||
u8 GetMoleType() const;
|
||||
MoleType GetMoleType() const;
|
||||
u8 GetMoleScale() const;
|
||||
u8 GetMoleX() const;
|
||||
u8 GetMoleY() const;
|
||||
|
@ -73,52 +73,52 @@ private:
|
|||
Common::UUID create_id;
|
||||
Nickname name;
|
||||
u16 null_terminator;
|
||||
u8 font_region;
|
||||
u8 favorite_color;
|
||||
u8 gender;
|
||||
FontRegion font_region;
|
||||
FavoriteColor favorite_color;
|
||||
Gender gender;
|
||||
u8 height;
|
||||
u8 build;
|
||||
u8 type;
|
||||
u8 region_move;
|
||||
u8 faceline_type;
|
||||
u8 faceline_color;
|
||||
u8 faceline_wrinkle;
|
||||
u8 faceline_make;
|
||||
u8 hair_type;
|
||||
u8 hair_color;
|
||||
u8 hair_flip;
|
||||
u8 eye_type;
|
||||
u8 eye_color;
|
||||
FacelineType faceline_type;
|
||||
FacelineColor faceline_color;
|
||||
FacelineWrinkle faceline_wrinkle;
|
||||
FacelineMake faceline_make;
|
||||
HairType hair_type;
|
||||
CommonColor hair_color;
|
||||
HairFlip hair_flip;
|
||||
EyeType eye_type;
|
||||
CommonColor eye_color;
|
||||
u8 eye_scale;
|
||||
u8 eye_aspect;
|
||||
u8 eye_rotate;
|
||||
u8 eye_x;
|
||||
u8 eye_y;
|
||||
u8 eyebrow_type;
|
||||
u8 eyebrow_color;
|
||||
EyebrowType eyebrow_type;
|
||||
CommonColor eyebrow_color;
|
||||
u8 eyebrow_scale;
|
||||
u8 eyebrow_aspect;
|
||||
u8 eyebrow_rotate;
|
||||
u8 eyebrow_x;
|
||||
u8 eyebrow_y;
|
||||
u8 nose_type;
|
||||
NoseType nose_type;
|
||||
u8 nose_scale;
|
||||
u8 nose_y;
|
||||
u8 mouth_type;
|
||||
u8 mouth_color;
|
||||
MouthType mouth_type;
|
||||
CommonColor mouth_color;
|
||||
u8 mouth_scale;
|
||||
u8 mouth_aspect;
|
||||
u8 mouth_y;
|
||||
u8 beard_color;
|
||||
u8 beard_type;
|
||||
u8 mustache_type;
|
||||
CommonColor beard_color;
|
||||
BeardType beard_type;
|
||||
MustacheType mustache_type;
|
||||
u8 mustache_scale;
|
||||
u8 mustache_y;
|
||||
u8 glasses_type;
|
||||
u8 glasses_color;
|
||||
u8 glasses_scale;
|
||||
u8 glasses_y;
|
||||
u8 mole_type;
|
||||
GlassType glass_type;
|
||||
CommonColor glass_color;
|
||||
u8 glass_scale;
|
||||
u8 glass_y;
|
||||
MoleType mole_type;
|
||||
u8 mole_scale;
|
||||
u8 mole_x;
|
||||
u8 mole_y;
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
// SPDX-FileCopyrightText: Copyright 2023 yuzu Emulator Project
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
#include "common/assert.h"
|
||||
#include "core/hle/service/mii/mii_util.h"
|
||||
#include "core/hle/service/mii/types/core_data.h"
|
||||
#include "core/hle/service/mii/types/raw_data.h"
|
||||
|
@ -14,17 +15,9 @@ void CoreData::SetDefault() {
|
|||
|
||||
void CoreData::BuildRandom(Age age, Gender gender, Race race) {
|
||||
if (gender == Gender::All) {
|
||||
gender = MiiUtil::GetRandomValue<Gender>(Gender::Maximum);
|
||||
gender = MiiUtil::GetRandomValue(Gender::Max);
|
||||
}
|
||||
|
||||
data.gender.Assign(gender);
|
||||
data.favorite_color.Assign(MiiUtil::GetRandomValue<u8>(11));
|
||||
data.region_move.Assign(0);
|
||||
data.font_region.Assign(FontRegion::Standard);
|
||||
data.type.Assign(0);
|
||||
data.height.Assign(64);
|
||||
data.build.Assign(64);
|
||||
|
||||
if (age == Age::All) {
|
||||
const auto random{MiiUtil::GetRandomValue<int>(10)};
|
||||
if (random >= 8) {
|
||||
|
@ -47,6 +40,14 @@ void CoreData::BuildRandom(Age age, Gender gender, Race race) {
|
|||
}
|
||||
}
|
||||
|
||||
SetGender(gender);
|
||||
SetFavoriteColor(MiiUtil::GetRandomValue(FavoriteColor::Max));
|
||||
SetRegionMove(0);
|
||||
SetFontRegion(FontRegion::Standard);
|
||||
SetType(0);
|
||||
SetHeight(64);
|
||||
SetBuild(64);
|
||||
|
||||
u32 axis_y{};
|
||||
if (gender == Gender::Female && age == Age::Young) {
|
||||
axis_y = MiiUtil::GetRandomValue<u32>(3);
|
||||
|
@ -85,10 +86,10 @@ void CoreData::BuildRandom(Age age, Gender gender, Race race) {
|
|||
|
||||
data.hair_type.Assign(
|
||||
hair_type_info.values[MiiUtil::GetRandomValue<std::size_t>(hair_type_info.values_count)]);
|
||||
data.hair_color.Assign(RawData::GetHairColorFromVer3(
|
||||
SetHairColor(RawData::GetHairColorFromVer3(
|
||||
hair_color_info
|
||||
.values[MiiUtil::GetRandomValue<std::size_t>(hair_color_info.values_count)]));
|
||||
data.hair_flip.Assign(MiiUtil::GetRandomValue<HairFlip>(HairFlip::Maximum));
|
||||
SetHairFlip(MiiUtil::GetRandomValue(HairFlip::Max));
|
||||
|
||||
data.eye_type.Assign(
|
||||
eye_type_info.values[MiiUtil::GetRandomValue<std::size_t>(eye_type_info.values_count)]);
|
||||
|
@ -98,13 +99,13 @@ void CoreData::BuildRandom(Age age, Gender gender, Race race) {
|
|||
const auto eye_rotate_offset{32 - RawData::EyeRotateLookup[eye_rotate_1] + eye_rotate_2};
|
||||
const auto eye_rotate{32 - RawData::EyeRotateLookup[data.eye_type]};
|
||||
|
||||
data.eye_color.Assign(RawData::GetEyeColorFromVer3(
|
||||
SetEyeColor(RawData::GetEyeColorFromVer3(
|
||||
eye_color_info.values[MiiUtil::GetRandomValue<std::size_t>(eye_color_info.values_count)]));
|
||||
data.eye_scale.Assign(4);
|
||||
data.eye_aspect.Assign(3);
|
||||
data.eye_rotate.Assign(eye_rotate_offset - eye_rotate);
|
||||
data.eye_x.Assign(2);
|
||||
data.eye_y.Assign(axis_y + 12);
|
||||
SetEyeScale(4);
|
||||
SetEyeAspect(3);
|
||||
SetEyeRotate(static_cast<u8>(eye_rotate_offset - eye_rotate));
|
||||
SetEyeX(2);
|
||||
SetEyeY(static_cast<u8>(axis_y + 12));
|
||||
|
||||
data.eyebrow_type.Assign(
|
||||
eyebrow_type_info
|
||||
|
@ -116,57 +117,53 @@ void CoreData::BuildRandom(Age age, Gender gender, Race race) {
|
|||
const auto eyebrow_rotate{
|
||||
32 - RawData::EyebrowRotateLookup[static_cast<std::size_t>(data.eyebrow_type.Value())]};
|
||||
|
||||
data.eyebrow_color.Assign(data.hair_color);
|
||||
data.eyebrow_scale.Assign(4);
|
||||
data.eyebrow_aspect.Assign(3);
|
||||
data.eyebrow_rotate.Assign(eyebrow_rotate_offset - eyebrow_rotate);
|
||||
data.eyebrow_x.Assign(2);
|
||||
data.eyebrow_y.Assign(axis_y + eyebrow_y);
|
||||
|
||||
const auto nose_scale{gender == Gender::Female ? 3 : 4};
|
||||
SetEyebrowColor(GetHairColor());
|
||||
SetEyebrowScale(4);
|
||||
SetEyebrowAspect(3);
|
||||
SetEyebrowRotate(static_cast<u8>(eyebrow_rotate_offset - eyebrow_rotate));
|
||||
SetEyebrowX(2);
|
||||
SetEyebrowY(static_cast<u8>(axis_y + eyebrow_y));
|
||||
|
||||
data.nose_type.Assign(
|
||||
nose_type_info.values[MiiUtil::GetRandomValue<std::size_t>(nose_type_info.values_count)]);
|
||||
data.nose_scale.Assign(nose_scale);
|
||||
data.nose_y.Assign(axis_y + 9);
|
||||
SetNoseScale(gender == Gender::Female ? 3 : 4);
|
||||
SetNoseY(static_cast<u8>(axis_y + 9));
|
||||
|
||||
const auto mouth_color{gender == Gender::Female ? MiiUtil::GetRandomValue<int>(4) : 0};
|
||||
|
||||
data.mouth_type.Assign(
|
||||
mouth_type_info.values[MiiUtil::GetRandomValue<std::size_t>(mouth_type_info.values_count)]);
|
||||
data.mouth_color.Assign(RawData::GetMouthColorFromVer3(mouth_color));
|
||||
data.mouth_scale.Assign(4);
|
||||
data.mouth_aspect.Assign(3);
|
||||
data.mouth_y.Assign(axis_y + 13);
|
||||
SetMouthColor(RawData::GetMouthColorFromVer3(mouth_color));
|
||||
SetMouthScale(4);
|
||||
SetMouthAspect(3);
|
||||
SetMouthY(static_cast<u8>(axis_y + 13));
|
||||
|
||||
data.beard_color.Assign(data.hair_color);
|
||||
data.mustache_scale.Assign(4);
|
||||
SetBeardColor(GetHairColor());
|
||||
SetMustacheScale(4);
|
||||
|
||||
if (gender == Gender::Male && age != Age::Young && MiiUtil::GetRandomValue<int>(10) < 2) {
|
||||
const auto mustache_and_beard_flag{
|
||||
MiiUtil::GetRandomValue<BeardAndMustacheFlag>(BeardAndMustacheFlag::All)};
|
||||
const auto mustache_and_beard_flag{MiiUtil::GetRandomValue(BeardAndMustacheFlag::All)};
|
||||
|
||||
auto beard_type{BeardType::None};
|
||||
auto mustache_type{MustacheType::None};
|
||||
|
||||
if ((mustache_and_beard_flag & BeardAndMustacheFlag::Beard) ==
|
||||
BeardAndMustacheFlag::Beard) {
|
||||
beard_type = MiiUtil::GetRandomValue<BeardType>(BeardType::Beard1, BeardType::Beard5);
|
||||
beard_type = MiiUtil::GetRandomValue(BeardType::Min, BeardType::Max);
|
||||
}
|
||||
|
||||
if ((mustache_and_beard_flag & BeardAndMustacheFlag::Mustache) ==
|
||||
BeardAndMustacheFlag::Mustache) {
|
||||
mustache_type = MiiUtil::GetRandomValue<MustacheType>(MustacheType::Mustache1,
|
||||
MustacheType::Mustache5);
|
||||
mustache_type = MiiUtil::GetRandomValue(MustacheType::Min, MustacheType::Max);
|
||||
}
|
||||
|
||||
data.mustache_type.Assign(mustache_type);
|
||||
data.beard_type.Assign(beard_type);
|
||||
data.mustache_y.Assign(10);
|
||||
SetMustacheType(mustache_type);
|
||||
SetBeardType(beard_type);
|
||||
SetMustacheY(10);
|
||||
} else {
|
||||
data.mustache_type.Assign(MustacheType::None);
|
||||
data.beard_type.Assign(BeardType::None);
|
||||
data.mustache_y.Assign(axis_y + 10);
|
||||
SetMustacheType(MustacheType::None);
|
||||
SetBeardType(BeardType::None);
|
||||
SetMustacheY(static_cast<u8>(axis_y + 10));
|
||||
}
|
||||
|
||||
const auto glasses_type_start{MiiUtil::GetRandomValue<std::size_t>(100)};
|
||||
|
@ -178,15 +175,14 @@ void CoreData::BuildRandom(Age age, Gender gender, Race race) {
|
|||
}
|
||||
}
|
||||
|
||||
data.glasses_type.Assign(glasses_type);
|
||||
data.glasses_color.Assign(RawData::GetGlassColorFromVer3(0));
|
||||
data.glasses_scale.Assign(4);
|
||||
data.glasses_y.Assign(axis_y + 10);
|
||||
SetGlassType(static_cast<GlassType>(glasses_type));
|
||||
SetGlassColor(RawData::GetGlassColorFromVer3(0));
|
||||
SetGlassScale(4);
|
||||
|
||||
data.mole_type.Assign(0);
|
||||
data.mole_scale.Assign(4);
|
||||
data.mole_x.Assign(2);
|
||||
data.mole_y.Assign(20);
|
||||
SetMoleType(MoleType::None);
|
||||
SetMoleScale(4);
|
||||
SetMoleX(2);
|
||||
SetMoleY(20);
|
||||
}
|
||||
|
||||
u32 CoreData::IsValid() const {
|
||||
|
@ -195,15 +191,15 @@ u32 CoreData::IsValid() const {
|
|||
}
|
||||
|
||||
void CoreData::SetFontRegion(FontRegion value) {
|
||||
data.font_region.Assign(value);
|
||||
data.font_region.Assign(static_cast<u32>(value));
|
||||
}
|
||||
|
||||
void CoreData::SetFavoriteColor(u8 value) {
|
||||
data.favorite_color.Assign(value);
|
||||
void CoreData::SetFavoriteColor(FavoriteColor value) {
|
||||
data.favorite_color.Assign(static_cast<u32>(value));
|
||||
}
|
||||
|
||||
void CoreData::SetGender(Gender value) {
|
||||
data.gender.Assign(value);
|
||||
data.gender.Assign(static_cast<u32>(value));
|
||||
}
|
||||
|
||||
void CoreData::SetHeight(u8 value) {
|
||||
|
@ -222,40 +218,40 @@ void CoreData::SetRegionMove(u8 value) {
|
|||
data.region_move.Assign(value);
|
||||
}
|
||||
|
||||
void CoreData::SetFacelineType(u8 value) {
|
||||
data.faceline_type.Assign(value);
|
||||
void CoreData::SetFacelineType(FacelineType value) {
|
||||
data.faceline_type.Assign(static_cast<u32>(value));
|
||||
}
|
||||
|
||||
void CoreData::SetFacelineColor(u8 value) {
|
||||
data.faceline_color.Assign(value);
|
||||
void CoreData::SetFacelineColor(FacelineColor value) {
|
||||
data.faceline_color.Assign(static_cast<u32>(value));
|
||||
}
|
||||
|
||||
void CoreData::SetFacelineWrinkle(u8 value) {
|
||||
data.faceline_wrinkle.Assign(value);
|
||||
void CoreData::SetFacelineWrinkle(FacelineWrinkle value) {
|
||||
data.faceline_wrinkle.Assign(static_cast<u32>(value));
|
||||
}
|
||||
|
||||
void CoreData::SetFacelineMake(u8 value) {
|
||||
data.faceline_makeup.Assign(value);
|
||||
void CoreData::SetFacelineMake(FacelineMake value) {
|
||||
data.faceline_makeup.Assign(static_cast<u32>(value));
|
||||
}
|
||||
|
||||
void CoreData::SetHairType(u8 value) {
|
||||
data.hair_type.Assign(value);
|
||||
void CoreData::SetHairType(HairType value) {
|
||||
data.hair_type.Assign(static_cast<u32>(value));
|
||||
}
|
||||
|
||||
void CoreData::SetHairColor(u8 value) {
|
||||
data.hair_color.Assign(value);
|
||||
void CoreData::SetHairColor(CommonColor value) {
|
||||
data.hair_color.Assign(static_cast<u32>(value));
|
||||
}
|
||||
|
||||
void CoreData::SetHairFlip(HairFlip value) {
|
||||
data.hair_flip.Assign(value);
|
||||
data.hair_flip.Assign(static_cast<u32>(value));
|
||||
}
|
||||
|
||||
void CoreData::SetEyeType(u8 value) {
|
||||
data.eye_type.Assign(value);
|
||||
void CoreData::SetEyeType(EyeType value) {
|
||||
data.eye_type.Assign(static_cast<u32>(value));
|
||||
}
|
||||
|
||||
void CoreData::SetEyeColor(u8 value) {
|
||||
data.eye_color.Assign(value);
|
||||
void CoreData::SetEyeColor(CommonColor value) {
|
||||
data.eye_color.Assign(static_cast<u32>(value));
|
||||
}
|
||||
|
||||
void CoreData::SetEyeScale(u8 value) {
|
||||
|
@ -278,12 +274,12 @@ void CoreData::SetEyeY(u8 value) {
|
|||
data.eye_y.Assign(value);
|
||||
}
|
||||
|
||||
void CoreData::SetEyebrowType(u8 value) {
|
||||
data.eyebrow_type.Assign(value);
|
||||
void CoreData::SetEyebrowType(EyebrowType value) {
|
||||
data.eyebrow_type.Assign(static_cast<u32>(value));
|
||||
}
|
||||
|
||||
void CoreData::SetEyebrowColor(u8 value) {
|
||||
data.eyebrow_color.Assign(value);
|
||||
void CoreData::SetEyebrowColor(CommonColor value) {
|
||||
data.eyebrow_color.Assign(static_cast<u32>(value));
|
||||
}
|
||||
|
||||
void CoreData::SetEyebrowScale(u8 value) {
|
||||
|
@ -306,8 +302,8 @@ void CoreData::SetEyebrowY(u8 value) {
|
|||
data.eyebrow_y.Assign(value);
|
||||
}
|
||||
|
||||
void CoreData::SetNoseType(u8 value) {
|
||||
data.nose_type.Assign(value);
|
||||
void CoreData::SetNoseType(NoseType value) {
|
||||
data.nose_type.Assign(static_cast<u32>(value));
|
||||
}
|
||||
|
||||
void CoreData::SetNoseScale(u8 value) {
|
||||
|
@ -322,8 +318,8 @@ void CoreData::SetMouthType(u8 value) {
|
|||
data.mouth_type.Assign(value);
|
||||
}
|
||||
|
||||
void CoreData::SetMouthColor(u8 value) {
|
||||
data.mouth_color.Assign(value);
|
||||
void CoreData::SetMouthColor(CommonColor value) {
|
||||
data.mouth_color.Assign(static_cast<u32>(value));
|
||||
}
|
||||
|
||||
void CoreData::SetMouthScale(u8 value) {
|
||||
|
@ -338,16 +334,16 @@ void CoreData::SetMouthY(u8 value) {
|
|||
data.mouth_y.Assign(value);
|
||||
}
|
||||
|
||||
void CoreData::SetBeardColor(u8 value) {
|
||||
data.beard_color.Assign(value);
|
||||
void CoreData::SetBeardColor(CommonColor value) {
|
||||
data.beard_color.Assign(static_cast<u32>(value));
|
||||
}
|
||||
|
||||
void CoreData::SetBeardType(BeardType value) {
|
||||
data.beard_type.Assign(value);
|
||||
data.beard_type.Assign(static_cast<u32>(value));
|
||||
}
|
||||
|
||||
void CoreData::SetMustacheType(MustacheType value) {
|
||||
data.mustache_type.Assign(value);
|
||||
data.mustache_type.Assign(static_cast<u32>(value));
|
||||
}
|
||||
|
||||
void CoreData::SetMustacheScale(u8 value) {
|
||||
|
@ -358,12 +354,12 @@ void CoreData::SetMustacheY(u8 value) {
|
|||
data.mustache_y.Assign(value);
|
||||
}
|
||||
|
||||
void CoreData::SetGlassType(u8 value) {
|
||||
data.glasses_type.Assign(value);
|
||||
void CoreData::SetGlassType(GlassType value) {
|
||||
data.glasses_type.Assign(static_cast<u32>(value));
|
||||
}
|
||||
|
||||
void CoreData::SetGlassColor(u8 value) {
|
||||
data.glasses_color.Assign(value);
|
||||
void CoreData::SetGlassColor(CommonColor value) {
|
||||
data.glasses_color.Assign(static_cast<u32>(value));
|
||||
}
|
||||
|
||||
void CoreData::SetGlassScale(u8 value) {
|
||||
|
@ -374,8 +370,8 @@ void CoreData::SetGlassY(u8 value) {
|
|||
data.glasses_y.Assign(value);
|
||||
}
|
||||
|
||||
void CoreData::SetMoleType(u8 value) {
|
||||
data.mole_type.Assign(value);
|
||||
void CoreData::SetMoleType(MoleType value) {
|
||||
data.mole_type.Assign(static_cast<u32>(value));
|
||||
}
|
||||
|
||||
void CoreData::SetMoleScale(u8 value) {
|
||||
|
@ -394,16 +390,16 @@ void CoreData::SetNickname(Nickname nickname) {
|
|||
name = nickname;
|
||||
}
|
||||
|
||||
u8 CoreData::GetFontRegion() const {
|
||||
return static_cast<u8>(data.font_region.Value());
|
||||
FontRegion CoreData::GetFontRegion() const {
|
||||
return static_cast<FontRegion>(data.font_region.Value());
|
||||
}
|
||||
|
||||
u8 CoreData::GetFavoriteColor() const {
|
||||
return static_cast<u8>(data.favorite_color.Value());
|
||||
FavoriteColor CoreData::GetFavoriteColor() const {
|
||||
return static_cast<FavoriteColor>(data.favorite_color.Value());
|
||||
}
|
||||
|
||||
u8 CoreData::GetGender() const {
|
||||
return static_cast<u8>(data.gender.Value());
|
||||
Gender CoreData::GetGender() const {
|
||||
return static_cast<Gender>(data.gender.Value());
|
||||
}
|
||||
|
||||
u8 CoreData::GetHeight() const {
|
||||
|
@ -422,40 +418,40 @@ u8 CoreData::GetRegionMove() const {
|
|||
return static_cast<u8>(data.region_move.Value());
|
||||
}
|
||||
|
||||
u8 CoreData::GetFacelineType() const {
|
||||
return static_cast<u8>(data.faceline_type.Value());
|
||||
FacelineType CoreData::GetFacelineType() const {
|
||||
return static_cast<FacelineType>(data.faceline_type.Value());
|
||||
}
|
||||
|
||||
u8 CoreData::GetFacelineColor() const {
|
||||
return static_cast<u8>(data.faceline_color.Value());
|
||||
FacelineColor CoreData::GetFacelineColor() const {
|
||||
return static_cast<FacelineColor>(data.faceline_color.Value());
|
||||
}
|
||||
|
||||
u8 CoreData::GetFacelineWrinkle() const {
|
||||
return static_cast<u8>(data.faceline_wrinkle.Value());
|
||||
FacelineWrinkle CoreData::GetFacelineWrinkle() const {
|
||||
return static_cast<FacelineWrinkle>(data.faceline_wrinkle.Value());
|
||||
}
|
||||
|
||||
u8 CoreData::GetFacelineMake() const {
|
||||
return static_cast<u8>(data.faceline_makeup.Value());
|
||||
FacelineMake CoreData::GetFacelineMake() const {
|
||||
return static_cast<FacelineMake>(data.faceline_makeup.Value());
|
||||
}
|
||||
|
||||
u8 CoreData::GetHairType() const {
|
||||
return static_cast<u8>(data.hair_type.Value());
|
||||
HairType CoreData::GetHairType() const {
|
||||
return static_cast<HairType>(data.hair_type.Value());
|
||||
}
|
||||
|
||||
u8 CoreData::GetHairColor() const {
|
||||
return static_cast<u8>(data.hair_color.Value());
|
||||
CommonColor CoreData::GetHairColor() const {
|
||||
return static_cast<CommonColor>(data.hair_color.Value());
|
||||
}
|
||||
|
||||
u8 CoreData::GetHairFlip() const {
|
||||
return static_cast<u8>(data.hair_flip.Value());
|
||||
HairFlip CoreData::GetHairFlip() const {
|
||||
return static_cast<HairFlip>(data.hair_flip.Value());
|
||||
}
|
||||
|
||||
u8 CoreData::GetEyeType() const {
|
||||
return static_cast<u8>(data.eye_type.Value());
|
||||
EyeType CoreData::GetEyeType() const {
|
||||
return static_cast<EyeType>(data.eye_type.Value());
|
||||
}
|
||||
|
||||
u8 CoreData::GetEyeColor() const {
|
||||
return static_cast<u8>(data.eye_color.Value());
|
||||
CommonColor CoreData::GetEyeColor() const {
|
||||
return static_cast<CommonColor>(data.eye_color.Value());
|
||||
}
|
||||
|
||||
u8 CoreData::GetEyeScale() const {
|
||||
|
@ -478,12 +474,12 @@ u8 CoreData::GetEyeY() const {
|
|||
return static_cast<u8>(data.eye_y.Value());
|
||||
}
|
||||
|
||||
u8 CoreData::GetEyebrowType() const {
|
||||
return static_cast<u8>(data.eyebrow_type.Value());
|
||||
EyebrowType CoreData::GetEyebrowType() const {
|
||||
return static_cast<EyebrowType>(data.eyebrow_type.Value());
|
||||
}
|
||||
|
||||
u8 CoreData::GetEyebrowColor() const {
|
||||
return static_cast<u8>(data.eyebrow_color.Value());
|
||||
CommonColor CoreData::GetEyebrowColor() const {
|
||||
return static_cast<CommonColor>(data.eyebrow_color.Value());
|
||||
}
|
||||
|
||||
u8 CoreData::GetEyebrowScale() const {
|
||||
|
@ -506,8 +502,8 @@ u8 CoreData::GetEyebrowY() const {
|
|||
return static_cast<u8>(data.eyebrow_y.Value());
|
||||
}
|
||||
|
||||
u8 CoreData::GetNoseType() const {
|
||||
return static_cast<u8>(data.nose_type.Value());
|
||||
NoseType CoreData::GetNoseType() const {
|
||||
return static_cast<NoseType>(data.nose_type.Value());
|
||||
}
|
||||
|
||||
u8 CoreData::GetNoseScale() const {
|
||||
|
@ -518,12 +514,12 @@ u8 CoreData::GetNoseY() const {
|
|||
return static_cast<u8>(data.nose_y.Value());
|
||||
}
|
||||
|
||||
u8 CoreData::GetMouthType() const {
|
||||
return static_cast<u8>(data.mouth_type.Value());
|
||||
MouthType CoreData::GetMouthType() const {
|
||||
return static_cast<MouthType>(data.mouth_type.Value());
|
||||
}
|
||||
|
||||
u8 CoreData::GetMouthColor() const {
|
||||
return static_cast<u8>(data.mouth_color.Value());
|
||||
CommonColor CoreData::GetMouthColor() const {
|
||||
return static_cast<CommonColor>(data.mouth_color.Value());
|
||||
}
|
||||
|
||||
u8 CoreData::GetMouthScale() const {
|
||||
|
@ -538,16 +534,16 @@ u8 CoreData::GetMouthY() const {
|
|||
return static_cast<u8>(data.mouth_y.Value());
|
||||
}
|
||||
|
||||
u8 CoreData::GetBeardColor() const {
|
||||
return static_cast<u8>(data.beard_color.Value());
|
||||
CommonColor CoreData::GetBeardColor() const {
|
||||
return static_cast<CommonColor>(data.beard_color.Value());
|
||||
}
|
||||
|
||||
u8 CoreData::GetBeardType() const {
|
||||
return static_cast<u8>(data.beard_type.Value());
|
||||
BeardType CoreData::GetBeardType() const {
|
||||
return static_cast<BeardType>(data.beard_type.Value());
|
||||
}
|
||||
|
||||
u8 CoreData::GetMustacheType() const {
|
||||
return static_cast<u8>(data.mustache_type.Value());
|
||||
MustacheType CoreData::GetMustacheType() const {
|
||||
return static_cast<MustacheType>(data.mustache_type.Value());
|
||||
}
|
||||
|
||||
u8 CoreData::GetMustacheScale() const {
|
||||
|
@ -558,12 +554,12 @@ u8 CoreData::GetMustacheY() const {
|
|||
return static_cast<u8>(data.mustache_y.Value());
|
||||
}
|
||||
|
||||
u8 CoreData::GetGlassType() const {
|
||||
return static_cast<u8>(data.glasses_type.Value());
|
||||
GlassType CoreData::GetGlassType() const {
|
||||
return static_cast<GlassType>(data.glasses_type.Value());
|
||||
}
|
||||
|
||||
u8 CoreData::GetGlassColor() const {
|
||||
return static_cast<u8>(data.glasses_color.Value());
|
||||
CommonColor CoreData::GetGlassColor() const {
|
||||
return static_cast<CommonColor>(data.glasses_color.Value());
|
||||
}
|
||||
|
||||
u8 CoreData::GetGlassScale() const {
|
||||
|
@ -574,8 +570,8 @@ u8 CoreData::GetGlassY() const {
|
|||
return static_cast<u8>(data.glasses_y.Value());
|
||||
}
|
||||
|
||||
u8 CoreData::GetMoleType() const {
|
||||
return static_cast<u8>(data.mole_type.Value());
|
||||
MoleType CoreData::GetMoleType() const {
|
||||
return static_cast<MoleType>(data.mole_type.Value());
|
||||
}
|
||||
|
||||
u8 CoreData::GetMoleScale() const {
|
||||
|
@ -599,7 +595,7 @@ Nickname CoreData::GetDefaultNickname() const {
|
|||
}
|
||||
|
||||
Nickname CoreData::GetInvalidNickname() const {
|
||||
return {u'?', u'?', u' ', u'?'};
|
||||
return {u'?', u'?', u'?'};
|
||||
}
|
||||
|
||||
} // namespace Service::Mii
|
||||
|
|
|
@ -15,7 +15,7 @@ struct StoreDataBitFields {
|
|||
BitField<8, 7, u32> height;
|
||||
BitField<15, 1, u32> mole_type;
|
||||
BitField<16, 7, u32> build;
|
||||
BitField<23, 1, HairFlip> hair_flip;
|
||||
BitField<23, 1, u32> hair_flip;
|
||||
BitField<24, 7, u32> hair_color;
|
||||
BitField<31, 1, u32> type;
|
||||
};
|
||||
|
@ -24,7 +24,7 @@ struct StoreDataBitFields {
|
|||
u32 word_1{};
|
||||
|
||||
BitField<0, 7, u32> eye_color;
|
||||
BitField<7, 1, Gender> gender;
|
||||
BitField<7, 1, u32> gender;
|
||||
BitField<8, 7, u32> eyebrow_color;
|
||||
BitField<16, 7, u32> mouth_color;
|
||||
BitField<24, 7, u32> beard_color;
|
||||
|
@ -37,7 +37,7 @@ struct StoreDataBitFields {
|
|||
BitField<8, 6, u32> eye_type;
|
||||
BitField<14, 2, u32> region_move;
|
||||
BitField<16, 6, u32> mouth_type;
|
||||
BitField<22, 2, FontRegion> font_region;
|
||||
BitField<22, 2, u32> font_region;
|
||||
BitField<24, 5, u32> eye_y;
|
||||
BitField<29, 3, u32> glasses_scale;
|
||||
};
|
||||
|
@ -46,9 +46,9 @@ struct StoreDataBitFields {
|
|||
u32 word_3{};
|
||||
|
||||
BitField<0, 5, u32> eyebrow_type;
|
||||
BitField<5, 3, MustacheType> mustache_type;
|
||||
BitField<5, 3, u32> mustache_type;
|
||||
BitField<8, 5, u32> nose_type;
|
||||
BitField<13, 3, BeardType> beard_type;
|
||||
BitField<13, 3, u32> beard_type;
|
||||
BitField<16, 5, u32> nose_y;
|
||||
BitField<21, 3, u32> mouth_aspect;
|
||||
BitField<24, 5, u32> mouth_y;
|
||||
|
@ -104,102 +104,102 @@ public:
|
|||
u32 IsValid() const;
|
||||
|
||||
void SetFontRegion(FontRegion value);
|
||||
void SetFavoriteColor(u8 value);
|
||||
void SetFavoriteColor(FavoriteColor value);
|
||||
void SetGender(Gender value);
|
||||
void SetHeight(u8 value);
|
||||
void SetBuild(u8 value);
|
||||
void SetType(u8 value);
|
||||
void SetRegionMove(u8 value);
|
||||
void SetFacelineType(u8 value);
|
||||
void SetFacelineColor(u8 value);
|
||||
void SetFacelineWrinkle(u8 value);
|
||||
void SetFacelineMake(u8 value);
|
||||
void SetHairType(u8 value);
|
||||
void SetHairColor(u8 value);
|
||||
void SetFacelineType(FacelineType value);
|
||||
void SetFacelineColor(FacelineColor value);
|
||||
void SetFacelineWrinkle(FacelineWrinkle value);
|
||||
void SetFacelineMake(FacelineMake value);
|
||||
void SetHairType(HairType value);
|
||||
void SetHairColor(CommonColor value);
|
||||
void SetHairFlip(HairFlip value);
|
||||
void SetEyeType(u8 value);
|
||||
void SetEyeColor(u8 value);
|
||||
void SetEyeType(EyeType value);
|
||||
void SetEyeColor(CommonColor value);
|
||||
void SetEyeScale(u8 value);
|
||||
void SetEyeAspect(u8 value);
|
||||
void SetEyeRotate(u8 value);
|
||||
void SetEyeX(u8 value);
|
||||
void SetEyeY(u8 value);
|
||||
void SetEyebrowType(u8 value);
|
||||
void SetEyebrowColor(u8 value);
|
||||
void SetEyebrowType(EyebrowType value);
|
||||
void SetEyebrowColor(CommonColor value);
|
||||
void SetEyebrowScale(u8 value);
|
||||
void SetEyebrowAspect(u8 value);
|
||||
void SetEyebrowRotate(u8 value);
|
||||
void SetEyebrowX(u8 value);
|
||||
void SetEyebrowY(u8 value);
|
||||
void SetNoseType(u8 value);
|
||||
void SetNoseType(NoseType value);
|
||||
void SetNoseScale(u8 value);
|
||||
void SetNoseY(u8 value);
|
||||
void SetMouthType(u8 value);
|
||||
void SetMouthColor(u8 value);
|
||||
void SetMouthColor(CommonColor value);
|
||||
void SetMouthScale(u8 value);
|
||||
void SetMouthAspect(u8 value);
|
||||
void SetMouthY(u8 value);
|
||||
void SetBeardColor(u8 value);
|
||||
void SetBeardColor(CommonColor value);
|
||||
void SetBeardType(BeardType value);
|
||||
void SetMustacheType(MustacheType value);
|
||||
void SetMustacheScale(u8 value);
|
||||
void SetMustacheY(u8 value);
|
||||
void SetGlassType(u8 value);
|
||||
void SetGlassColor(u8 value);
|
||||
void SetGlassType(GlassType value);
|
||||
void SetGlassColor(CommonColor value);
|
||||
void SetGlassScale(u8 value);
|
||||
void SetGlassY(u8 value);
|
||||
void SetMoleType(u8 value);
|
||||
void SetMoleType(MoleType value);
|
||||
void SetMoleScale(u8 value);
|
||||
void SetMoleX(u8 value);
|
||||
void SetMoleY(u8 value);
|
||||
void SetNickname(Nickname nickname);
|
||||
|
||||
u8 GetFontRegion() const;
|
||||
u8 GetFavoriteColor() const;
|
||||
u8 GetGender() const;
|
||||
FontRegion GetFontRegion() const;
|
||||
FavoriteColor GetFavoriteColor() const;
|
||||
Gender GetGender() const;
|
||||
u8 GetHeight() const;
|
||||
u8 GetBuild() const;
|
||||
u8 GetType() const;
|
||||
u8 GetRegionMove() const;
|
||||
u8 GetFacelineType() const;
|
||||
u8 GetFacelineColor() const;
|
||||
u8 GetFacelineWrinkle() const;
|
||||
u8 GetFacelineMake() const;
|
||||
u8 GetHairType() const;
|
||||
u8 GetHairColor() const;
|
||||
u8 GetHairFlip() const;
|
||||
u8 GetEyeType() const;
|
||||
u8 GetEyeColor() const;
|
||||
FacelineType GetFacelineType() const;
|
||||
FacelineColor GetFacelineColor() const;
|
||||
FacelineWrinkle GetFacelineWrinkle() const;
|
||||
FacelineMake GetFacelineMake() const;
|
||||
HairType GetHairType() const;
|
||||
CommonColor GetHairColor() const;
|
||||
HairFlip GetHairFlip() const;
|
||||
EyeType GetEyeType() const;
|
||||
CommonColor GetEyeColor() const;
|
||||
u8 GetEyeScale() const;
|
||||
u8 GetEyeAspect() const;
|
||||
u8 GetEyeRotate() const;
|
||||
u8 GetEyeX() const;
|
||||
u8 GetEyeY() const;
|
||||
u8 GetEyebrowType() const;
|
||||
u8 GetEyebrowColor() const;
|
||||
EyebrowType GetEyebrowType() const;
|
||||
CommonColor GetEyebrowColor() const;
|
||||
u8 GetEyebrowScale() const;
|
||||
u8 GetEyebrowAspect() const;
|
||||
u8 GetEyebrowRotate() const;
|
||||
u8 GetEyebrowX() const;
|
||||
u8 GetEyebrowY() const;
|
||||
u8 GetNoseType() const;
|
||||
NoseType GetNoseType() const;
|
||||
u8 GetNoseScale() const;
|
||||
u8 GetNoseY() const;
|
||||
u8 GetMouthType() const;
|
||||
u8 GetMouthColor() const;
|
||||
MouthType GetMouthType() const;
|
||||
CommonColor GetMouthColor() const;
|
||||
u8 GetMouthScale() const;
|
||||
u8 GetMouthAspect() const;
|
||||
u8 GetMouthY() const;
|
||||
u8 GetBeardColor() const;
|
||||
u8 GetBeardType() const;
|
||||
u8 GetMustacheType() const;
|
||||
CommonColor GetBeardColor() const;
|
||||
BeardType GetBeardType() const;
|
||||
MustacheType GetMustacheType() const;
|
||||
u8 GetMustacheScale() const;
|
||||
u8 GetMustacheY() const;
|
||||
u8 GetGlassType() const;
|
||||
u8 GetGlassColor() const;
|
||||
GlassType GetGlassType() const;
|
||||
CommonColor GetGlassColor() const;
|
||||
u8 GetGlassScale() const;
|
||||
u8 GetGlassY() const;
|
||||
u8 GetMoleType() const;
|
||||
MoleType GetMoleType() const;
|
||||
u8 GetMoleScale() const;
|
||||
u8 GetMoleX() const;
|
||||
u8 GetMoleY() const;
|
||||
|
@ -207,6 +207,7 @@ public:
|
|||
Nickname GetDefaultNickname() const;
|
||||
Nickname GetInvalidNickname() const;
|
||||
|
||||
private:
|
||||
StoreDataBitFields data{};
|
||||
Nickname name{};
|
||||
};
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -15,9 +15,9 @@ struct RandomMiiValues {
|
|||
static_assert(sizeof(RandomMiiValues) == 0xbc, "RandomMiiValues has incorrect size.");
|
||||
|
||||
struct RandomMiiData4 {
|
||||
Gender gender{};
|
||||
Age age{};
|
||||
Race race{};
|
||||
u32 gender{};
|
||||
u32 age{};
|
||||
u32 race{};
|
||||
u32 values_count{};
|
||||
std::array<u32, 47> values{};
|
||||
};
|
||||
|
@ -64,10 +64,10 @@ u8 FromVer3GetMouthlineColor(u8 color);
|
|||
u8 FromVer3GetGlassColor(u8 color);
|
||||
u8 FromVer3GetGlassType(u8 type);
|
||||
|
||||
u8 GetFacelineColorFromVer3(u8 color);
|
||||
u8 GetHairColorFromVer3(u32 color);
|
||||
u8 GetEyeColorFromVer3(u32 color);
|
||||
u8 GetMouthColorFromVer3(u32 color);
|
||||
u8 GetGlassColorFromVer3(u8 color);
|
||||
FacelineColor GetFacelineColorFromVer3(u32 color);
|
||||
CommonColor GetHairColorFromVer3(u32 color);
|
||||
CommonColor GetEyeColorFromVer3(u32 color);
|
||||
CommonColor GetMouthColorFromVer3(u32 color);
|
||||
CommonColor GetGlassColorFromVer3(u32 color);
|
||||
|
||||
} // namespace Service::Mii::RawData
|
||||
|
|
|
@ -11,16 +11,16 @@ void StoreData::BuildDefault(u32 mii_index) {
|
|||
const auto& default_mii = RawData::DefaultMii[mii_index];
|
||||
core_data.SetDefault();
|
||||
|
||||
core_data.SetFacelineType(static_cast<u8>(default_mii.face_type));
|
||||
core_data.SetFacelineType(static_cast<FacelineType>(default_mii.face_type));
|
||||
core_data.SetFacelineColor(
|
||||
RawData::GetFacelineColorFromVer3(static_cast<u8>(default_mii.face_color)));
|
||||
core_data.SetFacelineWrinkle(static_cast<u8>(default_mii.face_wrinkle));
|
||||
core_data.SetFacelineMake(static_cast<u8>(default_mii.face_makeup));
|
||||
core_data.SetFacelineWrinkle(static_cast<FacelineWrinkle>(default_mii.face_wrinkle));
|
||||
core_data.SetFacelineMake(static_cast<FacelineMake>(default_mii.face_makeup));
|
||||
|
||||
core_data.SetHairType(static_cast<u8>(default_mii.hair_type));
|
||||
core_data.SetHairType(static_cast<HairType>(default_mii.hair_type));
|
||||
core_data.SetHairColor(RawData::GetHairColorFromVer3(static_cast<u8>(default_mii.hair_color)));
|
||||
core_data.SetHairFlip(default_mii.hair_flip);
|
||||
core_data.SetEyeType(static_cast<u8>(default_mii.eye_type));
|
||||
core_data.SetHairFlip(static_cast<HairFlip>(default_mii.hair_flip));
|
||||
core_data.SetEyeType(static_cast<EyeType>(default_mii.eye_type));
|
||||
core_data.SetEyeColor(RawData::GetEyeColorFromVer3(static_cast<u8>(default_mii.eye_color)));
|
||||
core_data.SetEyeScale(static_cast<u8>(default_mii.eye_scale));
|
||||
core_data.SetEyeAspect(static_cast<u8>(default_mii.eye_aspect));
|
||||
|
@ -28,7 +28,7 @@ void StoreData::BuildDefault(u32 mii_index) {
|
|||
core_data.SetEyeX(static_cast<u8>(default_mii.eye_x));
|
||||
core_data.SetEyeY(static_cast<u8>(default_mii.eye_y));
|
||||
|
||||
core_data.SetEyebrowType(static_cast<u8>(default_mii.eyebrow_type));
|
||||
core_data.SetEyebrowType(static_cast<EyebrowType>(default_mii.eyebrow_type));
|
||||
core_data.SetEyebrowColor(
|
||||
RawData::GetHairColorFromVer3(static_cast<u8>(default_mii.eyebrow_color)));
|
||||
core_data.SetEyebrowScale(static_cast<u8>(default_mii.eyebrow_scale));
|
||||
|
@ -37,7 +37,7 @@ void StoreData::BuildDefault(u32 mii_index) {
|
|||
core_data.SetEyebrowX(static_cast<u8>(default_mii.eyebrow_x));
|
||||
core_data.SetEyebrowY(static_cast<u8>(default_mii.eyebrow_y));
|
||||
|
||||
core_data.SetNoseType(static_cast<u8>(default_mii.nose_type));
|
||||
core_data.SetNoseType(static_cast<NoseType>(default_mii.nose_type));
|
||||
core_data.SetNoseScale(static_cast<u8>(default_mii.nose_scale));
|
||||
core_data.SetNoseY(static_cast<u8>(default_mii.nose_y));
|
||||
|
||||
|
@ -48,30 +48,30 @@ void StoreData::BuildDefault(u32 mii_index) {
|
|||
core_data.SetMouthAspect(static_cast<u8>(default_mii.mouth_aspect));
|
||||
core_data.SetMouthY(static_cast<u8>(default_mii.mouth_y));
|
||||
|
||||
core_data.SetMustacheType(default_mii.mustache_type);
|
||||
core_data.SetBeardType(default_mii.beard_type);
|
||||
core_data.SetMustacheType(static_cast<MustacheType>(default_mii.mustache_type));
|
||||
core_data.SetBeardType(static_cast<BeardType>(default_mii.beard_type));
|
||||
core_data.SetBeardColor(
|
||||
RawData::GetHairColorFromVer3(static_cast<u8>(default_mii.beard_color)));
|
||||
core_data.SetMustacheScale(static_cast<u8>(default_mii.mustache_scale));
|
||||
core_data.SetMustacheY(static_cast<u8>(default_mii.mustache_y));
|
||||
|
||||
core_data.SetGlassType(static_cast<u8>(default_mii.glasses_type));
|
||||
core_data.SetGlassType(static_cast<GlassType>(default_mii.glasses_type));
|
||||
core_data.SetGlassColor(
|
||||
RawData::GetGlassColorFromVer3(static_cast<u8>(default_mii.glasses_color)));
|
||||
core_data.SetGlassScale(static_cast<u8>(default_mii.glasses_scale));
|
||||
core_data.SetGlassY(static_cast<u8>(default_mii.glasses_y));
|
||||
|
||||
core_data.SetMoleType(static_cast<u8>(default_mii.mole_type));
|
||||
core_data.SetMoleType(static_cast<MoleType>(default_mii.mole_type));
|
||||
core_data.SetMoleScale(static_cast<u8>(default_mii.mole_scale));
|
||||
core_data.SetMoleX(static_cast<u8>(default_mii.mole_x));
|
||||
core_data.SetMoleY(static_cast<u8>(default_mii.mole_y));
|
||||
|
||||
core_data.SetHeight(static_cast<u8>(default_mii.height));
|
||||
core_data.SetBuild(static_cast<u8>(default_mii.weight));
|
||||
core_data.SetGender(default_mii.gender);
|
||||
core_data.SetFavoriteColor(static_cast<u8>(default_mii.favorite_color));
|
||||
core_data.SetGender(static_cast<Gender>(default_mii.gender));
|
||||
core_data.SetFavoriteColor(static_cast<FavoriteColor>(default_mii.favorite_color));
|
||||
core_data.SetRegionMove(static_cast<u8>(default_mii.region_move));
|
||||
core_data.SetFontRegion(default_mii.font_region);
|
||||
core_data.SetFontRegion(static_cast<FontRegion>(default_mii.font_region));
|
||||
core_data.SetType(static_cast<u8>(default_mii.type));
|
||||
core_data.SetNickname(default_mii.nickname);
|
||||
|
||||
|
@ -85,16 +85,16 @@ void StoreData::BuildBase(Gender gender) {
|
|||
const auto& default_mii = RawData::BaseMii[gender == Gender::Female ? 1 : 0];
|
||||
core_data.SetDefault();
|
||||
|
||||
core_data.SetFacelineType(static_cast<u8>(default_mii.face_type));
|
||||
core_data.SetFacelineType(static_cast<FacelineType>(default_mii.face_type));
|
||||
core_data.SetFacelineColor(
|
||||
RawData::GetFacelineColorFromVer3(static_cast<u8>(default_mii.face_color)));
|
||||
core_data.SetFacelineWrinkle(static_cast<u8>(default_mii.face_wrinkle));
|
||||
core_data.SetFacelineMake(static_cast<u8>(default_mii.face_makeup));
|
||||
core_data.SetFacelineWrinkle(static_cast<FacelineWrinkle>(default_mii.face_wrinkle));
|
||||
core_data.SetFacelineMake(static_cast<FacelineMake>(default_mii.face_makeup));
|
||||
|
||||
core_data.SetHairType(static_cast<u8>(default_mii.hair_type));
|
||||
core_data.SetHairType(static_cast<HairType>(default_mii.hair_type));
|
||||
core_data.SetHairColor(RawData::GetHairColorFromVer3(static_cast<u8>(default_mii.hair_color)));
|
||||
core_data.SetHairFlip(default_mii.hair_flip);
|
||||
core_data.SetEyeType(static_cast<u8>(default_mii.eye_type));
|
||||
core_data.SetHairFlip(static_cast<HairFlip>(default_mii.hair_flip));
|
||||
core_data.SetEyeType(static_cast<EyeType>(default_mii.eye_type));
|
||||
core_data.SetEyeColor(RawData::GetEyeColorFromVer3(static_cast<u8>(default_mii.eye_color)));
|
||||
core_data.SetEyeScale(static_cast<u8>(default_mii.eye_scale));
|
||||
core_data.SetEyeAspect(static_cast<u8>(default_mii.eye_aspect));
|
||||
|
@ -102,7 +102,7 @@ void StoreData::BuildBase(Gender gender) {
|
|||
core_data.SetEyeX(static_cast<u8>(default_mii.eye_x));
|
||||
core_data.SetEyeY(static_cast<u8>(default_mii.eye_y));
|
||||
|
||||
core_data.SetEyebrowType(static_cast<u8>(default_mii.eyebrow_type));
|
||||
core_data.SetEyebrowType(static_cast<EyebrowType>(default_mii.eyebrow_type));
|
||||
core_data.SetEyebrowColor(
|
||||
RawData::GetHairColorFromVer3(static_cast<u8>(default_mii.eyebrow_color)));
|
||||
core_data.SetEyebrowScale(static_cast<u8>(default_mii.eyebrow_scale));
|
||||
|
@ -111,7 +111,7 @@ void StoreData::BuildBase(Gender gender) {
|
|||
core_data.SetEyebrowX(static_cast<u8>(default_mii.eyebrow_x));
|
||||
core_data.SetEyebrowY(static_cast<u8>(default_mii.eyebrow_y));
|
||||
|
||||
core_data.SetNoseType(static_cast<u8>(default_mii.nose_type));
|
||||
core_data.SetNoseType(static_cast<NoseType>(default_mii.nose_type));
|
||||
core_data.SetNoseScale(static_cast<u8>(default_mii.nose_scale));
|
||||
core_data.SetNoseY(static_cast<u8>(default_mii.nose_y));
|
||||
|
||||
|
@ -122,30 +122,30 @@ void StoreData::BuildBase(Gender gender) {
|
|||
core_data.SetMouthAspect(static_cast<u8>(default_mii.mouth_aspect));
|
||||
core_data.SetMouthY(static_cast<u8>(default_mii.mouth_y));
|
||||
|
||||
core_data.SetMustacheType(default_mii.mustache_type);
|
||||
core_data.SetBeardType(default_mii.beard_type);
|
||||
core_data.SetMustacheType(static_cast<MustacheType>(default_mii.mustache_type));
|
||||
core_data.SetBeardType(static_cast<BeardType>(default_mii.beard_type));
|
||||
core_data.SetBeardColor(
|
||||
RawData::GetHairColorFromVer3(static_cast<u8>(default_mii.beard_color)));
|
||||
core_data.SetMustacheScale(static_cast<u8>(default_mii.mustache_scale));
|
||||
core_data.SetMustacheY(static_cast<u8>(default_mii.mustache_y));
|
||||
|
||||
core_data.SetGlassType(static_cast<u8>(default_mii.glasses_type));
|
||||
core_data.SetGlassType(static_cast<GlassType>(default_mii.glasses_type));
|
||||
core_data.SetGlassColor(
|
||||
RawData::GetGlassColorFromVer3(static_cast<u8>(default_mii.glasses_color)));
|
||||
core_data.SetGlassScale(static_cast<u8>(default_mii.glasses_scale));
|
||||
core_data.SetGlassY(static_cast<u8>(default_mii.glasses_y));
|
||||
|
||||
core_data.SetMoleType(static_cast<u8>(default_mii.mole_type));
|
||||
core_data.SetMoleType(static_cast<MoleType>(default_mii.mole_type));
|
||||
core_data.SetMoleScale(static_cast<u8>(default_mii.mole_scale));
|
||||
core_data.SetMoleX(static_cast<u8>(default_mii.mole_x));
|
||||
core_data.SetMoleY(static_cast<u8>(default_mii.mole_y));
|
||||
|
||||
core_data.SetHeight(static_cast<u8>(default_mii.height));
|
||||
core_data.SetBuild(static_cast<u8>(default_mii.weight));
|
||||
core_data.SetGender(default_mii.gender);
|
||||
core_data.SetFavoriteColor(static_cast<u8>(default_mii.favorite_color));
|
||||
core_data.SetGender(static_cast<Gender>(default_mii.gender));
|
||||
core_data.SetFavoriteColor(static_cast<FavoriteColor>(default_mii.favorite_color));
|
||||
core_data.SetRegionMove(static_cast<u8>(default_mii.region_move));
|
||||
core_data.SetFontRegion(default_mii.font_region);
|
||||
core_data.SetFontRegion(static_cast<FontRegion>(default_mii.font_region));
|
||||
core_data.SetType(static_cast<u8>(default_mii.type));
|
||||
core_data.SetNickname(default_mii.nickname);
|
||||
|
||||
|
@ -184,7 +184,7 @@ void StoreData::SetFontRegion(FontRegion value) {
|
|||
core_data.SetFontRegion(value);
|
||||
}
|
||||
|
||||
void StoreData::SetFavoriteColor(u8 value) {
|
||||
void StoreData::SetFavoriteColor(FavoriteColor value) {
|
||||
core_data.SetFavoriteColor(value);
|
||||
}
|
||||
|
||||
|
@ -208,27 +208,27 @@ void StoreData::SetRegionMove(u8 value) {
|
|||
core_data.SetRegionMove(value);
|
||||
}
|
||||
|
||||
void StoreData::SetFacelineType(u8 value) {
|
||||
void StoreData::SetFacelineType(FacelineType value) {
|
||||
core_data.SetFacelineType(value);
|
||||
}
|
||||
|
||||
void StoreData::SetFacelineColor(u8 value) {
|
||||
void StoreData::SetFacelineColor(FacelineColor value) {
|
||||
core_data.SetFacelineColor(value);
|
||||
}
|
||||
|
||||
void StoreData::SetFacelineWrinkle(u8 value) {
|
||||
void StoreData::SetFacelineWrinkle(FacelineWrinkle value) {
|
||||
core_data.SetFacelineWrinkle(value);
|
||||
}
|
||||
|
||||
void StoreData::SetFacelineMake(u8 value) {
|
||||
void StoreData::SetFacelineMake(FacelineMake value) {
|
||||
core_data.SetFacelineMake(value);
|
||||
}
|
||||
|
||||
void StoreData::SetHairType(u8 value) {
|
||||
void StoreData::SetHairType(HairType value) {
|
||||
core_data.SetHairType(value);
|
||||
}
|
||||
|
||||
void StoreData::SetHairColor(u8 value) {
|
||||
void StoreData::SetHairColor(CommonColor value) {
|
||||
core_data.SetHairColor(value);
|
||||
}
|
||||
|
||||
|
@ -236,11 +236,11 @@ void StoreData::SetHairFlip(HairFlip value) {
|
|||
core_data.SetHairFlip(value);
|
||||
}
|
||||
|
||||
void StoreData::SetEyeType(u8 value) {
|
||||
void StoreData::SetEyeType(EyeType value) {
|
||||
core_data.SetEyeType(value);
|
||||
}
|
||||
|
||||
void StoreData::SetEyeColor(u8 value) {
|
||||
void StoreData::SetEyeColor(CommonColor value) {
|
||||
core_data.SetEyeColor(value);
|
||||
}
|
||||
|
||||
|
@ -264,11 +264,11 @@ void StoreData::SetEyeY(u8 value) {
|
|||
core_data.SetEyeY(value);
|
||||
}
|
||||
|
||||
void StoreData::SetEyebrowType(u8 value) {
|
||||
void StoreData::SetEyebrowType(EyebrowType value) {
|
||||
core_data.SetEyebrowType(value);
|
||||
}
|
||||
|
||||
void StoreData::SetEyebrowColor(u8 value) {
|
||||
void StoreData::SetEyebrowColor(CommonColor value) {
|
||||
core_data.SetEyebrowColor(value);
|
||||
}
|
||||
|
||||
|
@ -292,7 +292,7 @@ void StoreData::SetEyebrowY(u8 value) {
|
|||
core_data.SetEyebrowY(value);
|
||||
}
|
||||
|
||||
void StoreData::SetNoseType(u8 value) {
|
||||
void StoreData::SetNoseType(NoseType value) {
|
||||
core_data.SetNoseType(value);
|
||||
}
|
||||
|
||||
|
@ -308,7 +308,7 @@ void StoreData::SetMouthType(u8 value) {
|
|||
core_data.SetMouthType(value);
|
||||
}
|
||||
|
||||
void StoreData::SetMouthColor(u8 value) {
|
||||
void StoreData::SetMouthColor(CommonColor value) {
|
||||
core_data.SetMouthColor(value);
|
||||
}
|
||||
|
||||
|
@ -324,7 +324,7 @@ void StoreData::SetMouthY(u8 value) {
|
|||
core_data.SetMouthY(value);
|
||||
}
|
||||
|
||||
void StoreData::SetBeardColor(u8 value) {
|
||||
void StoreData::SetBeardColor(CommonColor value) {
|
||||
core_data.SetBeardColor(value);
|
||||
}
|
||||
|
||||
|
@ -344,11 +344,11 @@ void StoreData::SetMustacheY(u8 value) {
|
|||
core_data.SetMustacheY(value);
|
||||
}
|
||||
|
||||
void StoreData::SetGlassType(u8 value) {
|
||||
void StoreData::SetGlassType(GlassType value) {
|
||||
core_data.SetGlassType(value);
|
||||
}
|
||||
|
||||
void StoreData::SetGlassColor(u8 value) {
|
||||
void StoreData::SetGlassColor(CommonColor value) {
|
||||
core_data.SetGlassColor(value);
|
||||
}
|
||||
|
||||
|
@ -360,7 +360,7 @@ void StoreData::SetGlassY(u8 value) {
|
|||
core_data.SetGlassY(value);
|
||||
}
|
||||
|
||||
void StoreData::SetMoleType(u8 value) {
|
||||
void StoreData::SetMoleType(MoleType value) {
|
||||
core_data.SetMoleType(value);
|
||||
}
|
||||
|
||||
|
@ -388,11 +388,11 @@ FontRegion StoreData::GetFontRegion() const {
|
|||
return static_cast<FontRegion>(core_data.GetFontRegion());
|
||||
}
|
||||
|
||||
u8 StoreData::GetFavoriteColor() const {
|
||||
FavoriteColor StoreData::GetFavoriteColor() const {
|
||||
return core_data.GetFavoriteColor();
|
||||
}
|
||||
|
||||
u8 StoreData::GetGender() const {
|
||||
Gender StoreData::GetGender() const {
|
||||
return core_data.GetGender();
|
||||
}
|
||||
|
||||
|
@ -412,39 +412,39 @@ u8 StoreData::GetRegionMove() const {
|
|||
return core_data.GetRegionMove();
|
||||
}
|
||||
|
||||
u8 StoreData::GetFacelineType() const {
|
||||
FacelineType StoreData::GetFacelineType() const {
|
||||
return core_data.GetFacelineType();
|
||||
}
|
||||
|
||||
u8 StoreData::GetFacelineColor() const {
|
||||
FacelineColor StoreData::GetFacelineColor() const {
|
||||
return core_data.GetFacelineColor();
|
||||
}
|
||||
|
||||
u8 StoreData::GetFacelineWrinkle() const {
|
||||
FacelineWrinkle StoreData::GetFacelineWrinkle() const {
|
||||
return core_data.GetFacelineWrinkle();
|
||||
}
|
||||
|
||||
u8 StoreData::GetFacelineMake() const {
|
||||
FacelineMake StoreData::GetFacelineMake() const {
|
||||
return core_data.GetFacelineMake();
|
||||
}
|
||||
|
||||
u8 StoreData::GetHairType() const {
|
||||
HairType StoreData::GetHairType() const {
|
||||
return core_data.GetHairType();
|
||||
}
|
||||
|
||||
u8 StoreData::GetHairColor() const {
|
||||
CommonColor StoreData::GetHairColor() const {
|
||||
return core_data.GetHairColor();
|
||||
}
|
||||
|
||||
u8 StoreData::GetHairFlip() const {
|
||||
HairFlip StoreData::GetHairFlip() const {
|
||||
return core_data.GetHairFlip();
|
||||
}
|
||||
|
||||
u8 StoreData::GetEyeType() const {
|
||||
EyeType StoreData::GetEyeType() const {
|
||||
return core_data.GetEyeType();
|
||||
}
|
||||
|
||||
u8 StoreData::GetEyeColor() const {
|
||||
CommonColor StoreData::GetEyeColor() const {
|
||||
return core_data.GetEyeColor();
|
||||
}
|
||||
|
||||
|
@ -468,11 +468,11 @@ u8 StoreData::GetEyeY() const {
|
|||
return core_data.GetEyeY();
|
||||
}
|
||||
|
||||
u8 StoreData::GetEyebrowType() const {
|
||||
EyebrowType StoreData::GetEyebrowType() const {
|
||||
return core_data.GetEyebrowType();
|
||||
}
|
||||
|
||||
u8 StoreData::GetEyebrowColor() const {
|
||||
CommonColor StoreData::GetEyebrowColor() const {
|
||||
return core_data.GetEyebrowColor();
|
||||
}
|
||||
|
||||
|
@ -496,7 +496,7 @@ u8 StoreData::GetEyebrowY() const {
|
|||
return core_data.GetEyebrowY();
|
||||
}
|
||||
|
||||
u8 StoreData::GetNoseType() const {
|
||||
NoseType StoreData::GetNoseType() const {
|
||||
return core_data.GetNoseType();
|
||||
}
|
||||
|
||||
|
@ -508,11 +508,11 @@ u8 StoreData::GetNoseY() const {
|
|||
return core_data.GetNoseY();
|
||||
}
|
||||
|
||||
u8 StoreData::GetMouthType() const {
|
||||
MouthType StoreData::GetMouthType() const {
|
||||
return core_data.GetMouthType();
|
||||
}
|
||||
|
||||
u8 StoreData::GetMouthColor() const {
|
||||
CommonColor StoreData::GetMouthColor() const {
|
||||
return core_data.GetMouthColor();
|
||||
}
|
||||
|
||||
|
@ -528,15 +528,15 @@ u8 StoreData::GetMouthY() const {
|
|||
return core_data.GetMouthY();
|
||||
}
|
||||
|
||||
u8 StoreData::GetBeardColor() const {
|
||||
CommonColor StoreData::GetBeardColor() const {
|
||||
return core_data.GetBeardColor();
|
||||
}
|
||||
|
||||
u8 StoreData::GetBeardType() const {
|
||||
BeardType StoreData::GetBeardType() const {
|
||||
return core_data.GetBeardType();
|
||||
}
|
||||
|
||||
u8 StoreData::GetMustacheType() const {
|
||||
MustacheType StoreData::GetMustacheType() const {
|
||||
return core_data.GetMustacheType();
|
||||
}
|
||||
|
||||
|
@ -548,11 +548,11 @@ u8 StoreData::GetMustacheY() const {
|
|||
return core_data.GetMustacheY();
|
||||
}
|
||||
|
||||
u8 StoreData::GetGlassType() const {
|
||||
GlassType StoreData::GetGlassType() const {
|
||||
return core_data.GetGlassType();
|
||||
}
|
||||
|
||||
u8 StoreData::GetGlassColor() const {
|
||||
CommonColor StoreData::GetGlassColor() const {
|
||||
return core_data.GetGlassColor();
|
||||
}
|
||||
|
||||
|
@ -564,7 +564,7 @@ u8 StoreData::GetGlassY() const {
|
|||
return core_data.GetGlassY();
|
||||
}
|
||||
|
||||
u8 StoreData::GetMoleType() const {
|
||||
MoleType StoreData::GetMoleType() const {
|
||||
return core_data.GetMoleType();
|
||||
}
|
||||
|
||||
|
|
|
@ -23,51 +23,51 @@ public:
|
|||
u32 IsValid() const;
|
||||
|
||||
void SetFontRegion(FontRegion value);
|
||||
void SetFavoriteColor(u8 value);
|
||||
void SetFavoriteColor(FavoriteColor value);
|
||||
void SetGender(Gender value);
|
||||
void SetHeight(u8 value);
|
||||
void SetBuild(u8 value);
|
||||
void SetType(u8 value);
|
||||
void SetRegionMove(u8 value);
|
||||
void SetFacelineType(u8 value);
|
||||
void SetFacelineColor(u8 value);
|
||||
void SetFacelineWrinkle(u8 value);
|
||||
void SetFacelineMake(u8 value);
|
||||
void SetHairType(u8 value);
|
||||
void SetHairColor(u8 value);
|
||||
void SetFacelineType(FacelineType value);
|
||||
void SetFacelineColor(FacelineColor value);
|
||||
void SetFacelineWrinkle(FacelineWrinkle value);
|
||||
void SetFacelineMake(FacelineMake value);
|
||||
void SetHairType(HairType value);
|
||||
void SetHairColor(CommonColor value);
|
||||
void SetHairFlip(HairFlip value);
|
||||
void SetEyeType(u8 value);
|
||||
void SetEyeColor(u8 value);
|
||||
void SetEyeType(EyeType value);
|
||||
void SetEyeColor(CommonColor value);
|
||||
void SetEyeScale(u8 value);
|
||||
void SetEyeAspect(u8 value);
|
||||
void SetEyeRotate(u8 value);
|
||||
void SetEyeX(u8 value);
|
||||
void SetEyeY(u8 value);
|
||||
void SetEyebrowType(u8 value);
|
||||
void SetEyebrowColor(u8 value);
|
||||
void SetEyebrowType(EyebrowType value);
|
||||
void SetEyebrowColor(CommonColor value);
|
||||
void SetEyebrowScale(u8 value);
|
||||
void SetEyebrowAspect(u8 value);
|
||||
void SetEyebrowRotate(u8 value);
|
||||
void SetEyebrowX(u8 value);
|
||||
void SetEyebrowY(u8 value);
|
||||
void SetNoseType(u8 value);
|
||||
void SetNoseType(NoseType value);
|
||||
void SetNoseScale(u8 value);
|
||||
void SetNoseY(u8 value);
|
||||
void SetMouthType(u8 value);
|
||||
void SetMouthColor(u8 value);
|
||||
void SetMouthColor(CommonColor value);
|
||||
void SetMouthScale(u8 value);
|
||||
void SetMouthAspect(u8 value);
|
||||
void SetMouthY(u8 value);
|
||||
void SetBeardColor(u8 value);
|
||||
void SetBeardColor(CommonColor value);
|
||||
void SetBeardType(BeardType value);
|
||||
void SetMustacheType(MustacheType value);
|
||||
void SetMustacheScale(u8 value);
|
||||
void SetMustacheY(u8 value);
|
||||
void SetGlassType(u8 value);
|
||||
void SetGlassColor(u8 value);
|
||||
void SetGlassType(GlassType value);
|
||||
void SetGlassColor(CommonColor value);
|
||||
void SetGlassScale(u8 value);
|
||||
void SetGlassY(u8 value);
|
||||
void SetMoleType(u8 value);
|
||||
void SetMoleType(MoleType value);
|
||||
void SetMoleScale(u8 value);
|
||||
void SetMoleX(u8 value);
|
||||
void SetMoleY(u8 value);
|
||||
|
@ -76,51 +76,51 @@ public:
|
|||
|
||||
Common::UUID GetCreateId() const;
|
||||
FontRegion GetFontRegion() const;
|
||||
u8 GetFavoriteColor() const;
|
||||
u8 GetGender() const;
|
||||
FavoriteColor GetFavoriteColor() const;
|
||||
Gender GetGender() const;
|
||||
u8 GetHeight() const;
|
||||
u8 GetBuild() const;
|
||||
u8 GetType() const;
|
||||
u8 GetRegionMove() const;
|
||||
u8 GetFacelineType() const;
|
||||
u8 GetFacelineColor() const;
|
||||
u8 GetFacelineWrinkle() const;
|
||||
u8 GetFacelineMake() const;
|
||||
u8 GetHairType() const;
|
||||
u8 GetHairColor() const;
|
||||
u8 GetHairFlip() const;
|
||||
u8 GetEyeType() const;
|
||||
u8 GetEyeColor() const;
|
||||
FacelineType GetFacelineType() const;
|
||||
FacelineColor GetFacelineColor() const;
|
||||
FacelineWrinkle GetFacelineWrinkle() const;
|
||||
FacelineMake GetFacelineMake() const;
|
||||
HairType GetHairType() const;
|
||||
CommonColor GetHairColor() const;
|
||||
HairFlip GetHairFlip() const;
|
||||
EyeType GetEyeType() const;
|
||||
CommonColor GetEyeColor() const;
|
||||
u8 GetEyeScale() const;
|
||||
u8 GetEyeAspect() const;
|
||||
u8 GetEyeRotate() const;
|
||||
u8 GetEyeX() const;
|
||||
u8 GetEyeY() const;
|
||||
u8 GetEyebrowType() const;
|
||||
u8 GetEyebrowColor() const;
|
||||
EyebrowType GetEyebrowType() const;
|
||||
CommonColor GetEyebrowColor() const;
|
||||
u8 GetEyebrowScale() const;
|
||||
u8 GetEyebrowAspect() const;
|
||||
u8 GetEyebrowRotate() const;
|
||||
u8 GetEyebrowX() const;
|
||||
u8 GetEyebrowY() const;
|
||||
u8 GetNoseType() const;
|
||||
NoseType GetNoseType() const;
|
||||
u8 GetNoseScale() const;
|
||||
u8 GetNoseY() const;
|
||||
u8 GetMouthType() const;
|
||||
u8 GetMouthColor() const;
|
||||
MouthType GetMouthType() const;
|
||||
CommonColor GetMouthColor() const;
|
||||
u8 GetMouthScale() const;
|
||||
u8 GetMouthAspect() const;
|
||||
u8 GetMouthY() const;
|
||||
u8 GetBeardColor() const;
|
||||
u8 GetBeardType() const;
|
||||
u8 GetMustacheType() const;
|
||||
CommonColor GetBeardColor() const;
|
||||
BeardType GetBeardType() const;
|
||||
MustacheType GetMustacheType() const;
|
||||
u8 GetMustacheScale() const;
|
||||
u8 GetMustacheY() const;
|
||||
u8 GetGlassType() const;
|
||||
u8 GetGlassColor() const;
|
||||
GlassType GetGlassType() const;
|
||||
CommonColor GetGlassColor() const;
|
||||
u8 GetGlassScale() const;
|
||||
u8 GetGlassY() const;
|
||||
u8 GetMoleType() const;
|
||||
MoleType GetMoleType() const;
|
||||
u8 GetMoleScale() const;
|
||||
u8 GetMoleX() const;
|
||||
u8 GetMoleY() const;
|
||||
|
|
|
@ -9,14 +9,14 @@
|
|||
namespace Service::Mii {
|
||||
|
||||
void NfpStoreDataExtension::SetFromStoreData(const StoreData& store_data) {
|
||||
faceline_color = static_cast<u8>(store_data.GetFacelineColor() & 0xf);
|
||||
hair_color = static_cast<u8>(store_data.GetHairColor() & 0x7f);
|
||||
eye_color = static_cast<u8>(store_data.GetEyeColor() & 0x7f);
|
||||
eyebrow_color = static_cast<u8>(store_data.GetEyebrowColor() & 0x7f);
|
||||
mouth_color = static_cast<u8>(store_data.GetMouthColor() & 0x7f);
|
||||
beard_color = static_cast<u8>(store_data.GetBeardColor() & 0x7f);
|
||||
glass_color = static_cast<u8>(store_data.GetGlassColor() & 0x7f);
|
||||
glass_type = static_cast<u8>(store_data.GetGlassType() & 0x1f);
|
||||
faceline_color = static_cast<u8>(store_data.GetFacelineColor()) & 0xf;
|
||||
hair_color = static_cast<u8>(store_data.GetHairColor()) & 0x7f;
|
||||
eye_color = static_cast<u8>(store_data.GetEyeColor()) & 0x7f;
|
||||
eyebrow_color = static_cast<u8>(store_data.GetEyebrowColor()) & 0x7f;
|
||||
mouth_color = static_cast<u8>(store_data.GetMouthColor()) & 0x7f;
|
||||
beard_color = static_cast<u8>(store_data.GetBeardColor()) & 0x7f;
|
||||
glass_color = static_cast<u8>(store_data.GetGlassColor()) & 0x7f;
|
||||
glass_type = static_cast<u8>(store_data.GetGlassType()) & 0x1f;
|
||||
}
|
||||
|
||||
void Ver3StoreData::BuildToStoreData(StoreData& out_store_data) const {
|
||||
|
@ -28,8 +28,9 @@ void Ver3StoreData::BuildToStoreData(StoreData& out_store_data) const {
|
|||
|
||||
// TODO: We are ignoring a bunch of data from the mii_v3
|
||||
|
||||
out_store_data.SetGender(static_cast<Gender>(static_cast<u8>(mii_information.gender)));
|
||||
out_store_data.SetFavoriteColor(static_cast<u8>(mii_information.favorite_color));
|
||||
out_store_data.SetGender(static_cast<Gender>(mii_information.gender.Value()));
|
||||
out_store_data.SetFavoriteColor(
|
||||
static_cast<FavoriteColor>(mii_information.favorite_color.Value()));
|
||||
out_store_data.SetHeight(height);
|
||||
out_store_data.SetBuild(build);
|
||||
|
||||
|
@ -37,56 +38,60 @@ void Ver3StoreData::BuildToStoreData(StoreData& out_store_data) const {
|
|||
out_store_data.SetFontRegion(
|
||||
static_cast<FontRegion>(static_cast<u8>(region_information.font_region)));
|
||||
|
||||
out_store_data.SetFacelineType(appearance_bits1.faceline_type);
|
||||
out_store_data.SetFacelineColor(appearance_bits1.faceline_color);
|
||||
out_store_data.SetFacelineWrinkle(appearance_bits2.faceline_wrinkle);
|
||||
out_store_data.SetFacelineMake(appearance_bits2.faceline_make);
|
||||
out_store_data.SetFacelineType(
|
||||
static_cast<FacelineType>(appearance_bits1.faceline_type.Value()));
|
||||
out_store_data.SetFacelineColor(
|
||||
static_cast<FacelineColor>(appearance_bits1.faceline_color.Value()));
|
||||
out_store_data.SetFacelineWrinkle(
|
||||
static_cast<FacelineWrinkle>(appearance_bits2.faceline_wrinkle.Value()));
|
||||
out_store_data.SetFacelineMake(
|
||||
static_cast<FacelineMake>(appearance_bits2.faceline_make.Value()));
|
||||
|
||||
out_store_data.SetHairType(hair_type);
|
||||
out_store_data.SetHairColor(appearance_bits3.hair_color);
|
||||
out_store_data.SetHairFlip(static_cast<HairFlip>(static_cast<u8>(appearance_bits3.hair_flip)));
|
||||
out_store_data.SetHairType(static_cast<HairType>(hair_type));
|
||||
out_store_data.SetHairColor(static_cast<CommonColor>(appearance_bits3.hair_color.Value()));
|
||||
out_store_data.SetHairFlip(static_cast<HairFlip>(appearance_bits3.hair_flip.Value()));
|
||||
|
||||
out_store_data.SetEyeType(static_cast<u8>(appearance_bits4.eye_type));
|
||||
out_store_data.SetEyeColor(static_cast<u8>(appearance_bits4.eye_color));
|
||||
out_store_data.SetEyeType(static_cast<EyeType>(appearance_bits4.eye_type.Value()));
|
||||
out_store_data.SetEyeColor(static_cast<CommonColor>(appearance_bits4.eye_color.Value()));
|
||||
out_store_data.SetEyeScale(static_cast<u8>(appearance_bits4.eye_scale));
|
||||
out_store_data.SetEyeAspect(static_cast<u8>(appearance_bits4.eye_aspect));
|
||||
out_store_data.SetEyeRotate(static_cast<u8>(appearance_bits4.eye_rotate));
|
||||
out_store_data.SetEyeX(static_cast<u8>(appearance_bits4.eye_x));
|
||||
out_store_data.SetEyeY(static_cast<u8>(appearance_bits4.eye_y));
|
||||
|
||||
out_store_data.SetEyebrowType(static_cast<u8>(appearance_bits5.eyebrow_type));
|
||||
out_store_data.SetEyebrowColor(static_cast<u8>(appearance_bits5.eyebrow_color));
|
||||
out_store_data.SetEyebrowType(static_cast<EyebrowType>(appearance_bits5.eyebrow_type.Value()));
|
||||
out_store_data.SetEyebrowColor(
|
||||
static_cast<CommonColor>(appearance_bits5.eyebrow_color.Value()));
|
||||
out_store_data.SetEyebrowScale(static_cast<u8>(appearance_bits5.eyebrow_scale));
|
||||
out_store_data.SetEyebrowAspect(static_cast<u8>(appearance_bits5.eyebrow_aspect));
|
||||
out_store_data.SetEyebrowRotate(static_cast<u8>(appearance_bits5.eyebrow_rotate));
|
||||
out_store_data.SetEyebrowX(static_cast<u8>(appearance_bits5.eyebrow_x));
|
||||
out_store_data.SetEyebrowY(static_cast<u8>(appearance_bits5.eyebrow_y));
|
||||
|
||||
out_store_data.SetNoseType(static_cast<u8>(appearance_bits6.nose_type));
|
||||
out_store_data.SetNoseType(static_cast<NoseType>(appearance_bits6.nose_type.Value()));
|
||||
out_store_data.SetNoseScale(static_cast<u8>(appearance_bits6.nose_scale));
|
||||
out_store_data.SetNoseY(static_cast<u8>(appearance_bits6.nose_y));
|
||||
|
||||
out_store_data.SetMouthType(static_cast<u8>(appearance_bits7.mouth_type));
|
||||
out_store_data.SetMouthColor(static_cast<u8>(appearance_bits7.mouth_color));
|
||||
out_store_data.SetMouthColor(static_cast<CommonColor>(appearance_bits7.mouth_color.Value()));
|
||||
out_store_data.SetMouthScale(static_cast<u8>(appearance_bits7.mouth_scale));
|
||||
out_store_data.SetMouthAspect(static_cast<u8>(appearance_bits7.mouth_aspect));
|
||||
out_store_data.SetMouthY(static_cast<u8>(appearance_bits8.mouth_y));
|
||||
|
||||
out_store_data.SetMustacheType(
|
||||
static_cast<MustacheType>(static_cast<u8>(appearance_bits8.mustache_type)));
|
||||
static_cast<MustacheType>(appearance_bits8.mustache_type.Value()));
|
||||
out_store_data.SetMustacheScale(static_cast<u8>(appearance_bits9.mustache_scale));
|
||||
out_store_data.SetMustacheY(static_cast<u8>(appearance_bits9.mustache_y));
|
||||
|
||||
out_store_data.SetBeardType(
|
||||
static_cast<BeardType>(static_cast<u8>(appearance_bits9.beard_type)));
|
||||
out_store_data.SetBeardColor(static_cast<u8>(appearance_bits9.beard_color));
|
||||
out_store_data.SetBeardType(static_cast<BeardType>(appearance_bits9.beard_type.Value()));
|
||||
out_store_data.SetBeardColor(static_cast<CommonColor>(appearance_bits9.beard_color.Value()));
|
||||
|
||||
out_store_data.SetGlassType(static_cast<u8>(appearance_bits10.glass_type));
|
||||
out_store_data.SetGlassColor(static_cast<u8>(appearance_bits10.glass_color));
|
||||
out_store_data.SetGlassType(static_cast<GlassType>(appearance_bits10.glass_type.Value()));
|
||||
out_store_data.SetGlassColor(static_cast<CommonColor>(appearance_bits10.glass_color.Value()));
|
||||
out_store_data.SetGlassScale(static_cast<u8>(appearance_bits10.glass_scale));
|
||||
out_store_data.SetGlassY(static_cast<u8>(appearance_bits10.glass_y));
|
||||
|
||||
out_store_data.SetMoleType(static_cast<u8>(appearance_bits11.mole_type));
|
||||
out_store_data.SetMoleType(static_cast<MoleType>(appearance_bits11.mole_type.Value()));
|
||||
out_store_data.SetMoleScale(static_cast<u8>(appearance_bits11.mole_scale));
|
||||
out_store_data.SetMoleX(static_cast<u8>(appearance_bits11.mole_x));
|
||||
out_store_data.SetMoleY(static_cast<u8>(appearance_bits11.mole_y));
|
||||
|
@ -94,71 +99,75 @@ void Ver3StoreData::BuildToStoreData(StoreData& out_store_data) const {
|
|||
|
||||
void Ver3StoreData::BuildFromStoreData(const StoreData& store_data) {
|
||||
version = 1;
|
||||
mii_information.gender.Assign(store_data.GetGender());
|
||||
mii_information.favorite_color.Assign(store_data.GetFavoriteColor());
|
||||
mii_information.gender.Assign(static_cast<u8>(store_data.GetGender()));
|
||||
mii_information.favorite_color.Assign(static_cast<u8>(store_data.GetFavoriteColor()));
|
||||
height = store_data.GetHeight();
|
||||
build = store_data.GetBuild();
|
||||
|
||||
mii_name = store_data.GetNickname();
|
||||
region_information.font_region.Assign(static_cast<u8>(store_data.GetFontRegion()));
|
||||
|
||||
appearance_bits1.faceline_type.Assign(store_data.GetFacelineType());
|
||||
appearance_bits2.faceline_wrinkle.Assign(store_data.GetFacelineWrinkle());
|
||||
appearance_bits2.faceline_make.Assign(store_data.GetFacelineMake());
|
||||
appearance_bits1.faceline_type.Assign(static_cast<u8>(store_data.GetFacelineType()));
|
||||
appearance_bits2.faceline_wrinkle.Assign(static_cast<u8>(store_data.GetFacelineWrinkle()));
|
||||
appearance_bits2.faceline_make.Assign(static_cast<u8>(store_data.GetFacelineMake()));
|
||||
|
||||
hair_type = store_data.GetHairType();
|
||||
appearance_bits3.hair_flip.Assign(store_data.GetHairFlip());
|
||||
hair_type = static_cast<u8>(store_data.GetHairType());
|
||||
appearance_bits3.hair_flip.Assign(static_cast<u8>(store_data.GetHairFlip()));
|
||||
|
||||
appearance_bits4.eye_type.Assign(store_data.GetEyeType());
|
||||
appearance_bits4.eye_type.Assign(static_cast<u8>(store_data.GetEyeType()));
|
||||
appearance_bits4.eye_scale.Assign(store_data.GetEyeScale());
|
||||
appearance_bits4.eye_aspect.Assign(store_data.GetEyebrowAspect());
|
||||
appearance_bits4.eye_rotate.Assign(store_data.GetEyeRotate());
|
||||
appearance_bits4.eye_x.Assign(store_data.GetEyeX());
|
||||
appearance_bits4.eye_y.Assign(store_data.GetEyeY());
|
||||
|
||||
appearance_bits5.eyebrow_type.Assign(store_data.GetEyebrowType());
|
||||
appearance_bits5.eyebrow_type.Assign(static_cast<u8>(store_data.GetEyebrowType()));
|
||||
appearance_bits5.eyebrow_scale.Assign(store_data.GetEyebrowScale());
|
||||
appearance_bits5.eyebrow_aspect.Assign(store_data.GetEyebrowAspect());
|
||||
appearance_bits5.eyebrow_rotate.Assign(store_data.GetEyebrowRotate());
|
||||
appearance_bits5.eyebrow_x.Assign(store_data.GetEyebrowX());
|
||||
appearance_bits5.eyebrow_y.Assign(store_data.GetEyebrowY());
|
||||
|
||||
appearance_bits6.nose_type.Assign(store_data.GetNoseType());
|
||||
appearance_bits6.nose_type.Assign(static_cast<u8>(store_data.GetNoseType()));
|
||||
appearance_bits6.nose_scale.Assign(store_data.GetNoseScale());
|
||||
appearance_bits6.nose_y.Assign(store_data.GetNoseY());
|
||||
|
||||
appearance_bits7.mouth_type.Assign(store_data.GetMouthType());
|
||||
appearance_bits7.mouth_type.Assign(static_cast<u8>(store_data.GetMouthType()));
|
||||
appearance_bits7.mouth_scale.Assign(store_data.GetMouthScale());
|
||||
appearance_bits7.mouth_aspect.Assign(store_data.GetMouthAspect());
|
||||
appearance_bits8.mouth_y.Assign(store_data.GetMouthY());
|
||||
|
||||
appearance_bits8.mustache_type.Assign(store_data.GetMustacheType());
|
||||
appearance_bits8.mustache_type.Assign(static_cast<u8>(store_data.GetMustacheType()));
|
||||
appearance_bits9.mustache_scale.Assign(store_data.GetMustacheScale());
|
||||
appearance_bits9.mustache_y.Assign(store_data.GetMustacheY());
|
||||
|
||||
appearance_bits9.beard_type.Assign(store_data.GetBeardType());
|
||||
appearance_bits9.beard_type.Assign(static_cast<u8>(store_data.GetBeardType()));
|
||||
|
||||
appearance_bits10.glass_scale.Assign(store_data.GetGlassScale());
|
||||
appearance_bits10.glass_y.Assign(store_data.GetGlassY());
|
||||
|
||||
appearance_bits11.mole_type.Assign(store_data.GetMoleType());
|
||||
appearance_bits11.mole_type.Assign(static_cast<u8>(store_data.GetMoleType()));
|
||||
appearance_bits11.mole_scale.Assign(store_data.GetMoleScale());
|
||||
appearance_bits11.mole_x.Assign(store_data.GetMoleX());
|
||||
appearance_bits11.mole_y.Assign(store_data.GetMoleY());
|
||||
|
||||
// These types are converted to V3 from a table
|
||||
appearance_bits1.faceline_color.Assign(
|
||||
RawData::FromVer3GetFacelineColor(store_data.GetFacelineColor()));
|
||||
appearance_bits3.hair_color.Assign(RawData::FromVer3GetHairColor(store_data.GetHairColor()));
|
||||
appearance_bits4.eye_color.Assign(RawData::FromVer3GetEyeColor(store_data.GetEyeColor()));
|
||||
RawData::FromVer3GetFacelineColor(static_cast<u8>(store_data.GetFacelineColor())));
|
||||
appearance_bits3.hair_color.Assign(
|
||||
RawData::FromVer3GetHairColor(static_cast<u8>(store_data.GetHairColor())));
|
||||
appearance_bits4.eye_color.Assign(
|
||||
RawData::FromVer3GetEyeColor(static_cast<u8>(store_data.GetEyeColor())));
|
||||
appearance_bits5.eyebrow_color.Assign(
|
||||
RawData::FromVer3GetHairColor(store_data.GetEyebrowColor()));
|
||||
RawData::FromVer3GetHairColor(static_cast<u8>(store_data.GetEyebrowColor())));
|
||||
appearance_bits7.mouth_color.Assign(
|
||||
RawData::FromVer3GetMouthlineColor(store_data.GetMouthColor()));
|
||||
appearance_bits9.beard_color.Assign(RawData::FromVer3GetHairColor(store_data.GetBeardColor()));
|
||||
RawData::FromVer3GetMouthlineColor(static_cast<u8>(store_data.GetMouthColor())));
|
||||
appearance_bits9.beard_color.Assign(
|
||||
RawData::FromVer3GetHairColor(static_cast<u8>(store_data.GetBeardColor())));
|
||||
appearance_bits10.glass_color.Assign(
|
||||
RawData::FromVer3GetGlassColor(store_data.GetGlassColor()));
|
||||
appearance_bits10.glass_type.Assign(RawData::FromVer3GetGlassType(store_data.GetGlassType()));
|
||||
RawData::FromVer3GetGlassColor(static_cast<u8>(store_data.GetGlassColor())));
|
||||
appearance_bits10.glass_type.Assign(
|
||||
RawData::FromVer3GetGlassType(static_cast<u8>(store_data.GetGlassType())));
|
||||
|
||||
crc = MiiUtil::CalculateCrc16(&version, sizeof(Ver3StoreData) - sizeof(u16));
|
||||
}
|
||||
|
@ -166,64 +175,65 @@ void Ver3StoreData::BuildFromStoreData(const StoreData& store_data) {
|
|||
u32 Ver3StoreData::IsValid() const {
|
||||
bool is_valid = version == 0 || version == 3;
|
||||
|
||||
is_valid = is_valid && (mii_name.data[0] != 0);
|
||||
is_valid = is_valid && (mii_name.data[0] != '\0');
|
||||
|
||||
is_valid = is_valid && (mii_information.birth_month < 13);
|
||||
is_valid = is_valid && (mii_information.birth_day < 32);
|
||||
is_valid = is_valid && (mii_information.favorite_color < 12);
|
||||
is_valid = is_valid && (height < 128);
|
||||
is_valid = is_valid && (build < 128);
|
||||
is_valid = is_valid && (mii_information.favorite_color <= static_cast<u8>(FavoriteColor::Max));
|
||||
is_valid = is_valid && (height <= MaxHeight);
|
||||
is_valid = is_valid && (build <= MaxBuild);
|
||||
|
||||
is_valid = is_valid && (appearance_bits1.faceline_type < 12);
|
||||
is_valid = is_valid && (appearance_bits1.faceline_color < 7);
|
||||
is_valid = is_valid && (appearance_bits2.faceline_wrinkle < 12);
|
||||
is_valid = is_valid && (appearance_bits2.faceline_make < 12);
|
||||
is_valid = is_valid && (appearance_bits1.faceline_type <= static_cast<u8>(FacelineType::Max));
|
||||
is_valid = is_valid && (appearance_bits1.faceline_color <= MaxVer3CommonColor - 2);
|
||||
is_valid =
|
||||
is_valid && (appearance_bits2.faceline_wrinkle <= static_cast<u8>(FacelineWrinkle::Max));
|
||||
is_valid = is_valid && (appearance_bits2.faceline_make <= static_cast<u8>(FacelineMake::Max));
|
||||
|
||||
is_valid = is_valid && (hair_type < 132);
|
||||
is_valid = is_valid && (appearance_bits3.hair_color < 8);
|
||||
is_valid = is_valid && (hair_type <= static_cast<u8>(HairType::Max));
|
||||
is_valid = is_valid && (appearance_bits3.hair_color <= MaxVer3CommonColor);
|
||||
|
||||
is_valid = is_valid && (appearance_bits4.eye_type < 60);
|
||||
is_valid = is_valid && (appearance_bits4.eye_color < 6);
|
||||
is_valid = is_valid && (appearance_bits4.eye_scale < 8);
|
||||
is_valid = is_valid && (appearance_bits4.eye_aspect < 7);
|
||||
is_valid = is_valid && (appearance_bits4.eye_rotate < 8);
|
||||
is_valid = is_valid && (appearance_bits4.eye_x < 13);
|
||||
is_valid = is_valid && (appearance_bits4.eye_y < 19);
|
||||
is_valid = is_valid && (appearance_bits4.eye_type <= static_cast<u8>(EyeType::Max));
|
||||
is_valid = is_valid && (appearance_bits4.eye_color <= MaxVer3CommonColor - 2);
|
||||
is_valid = is_valid && (appearance_bits4.eye_scale <= MaxEyeScale);
|
||||
is_valid = is_valid && (appearance_bits4.eye_aspect <= MaxEyeAspect);
|
||||
is_valid = is_valid && (appearance_bits4.eye_rotate <= MaxEyeRotate);
|
||||
is_valid = is_valid && (appearance_bits4.eye_x <= MaxEyeX);
|
||||
is_valid = is_valid && (appearance_bits4.eye_y <= MaxEyeY);
|
||||
|
||||
is_valid = is_valid && (appearance_bits5.eyebrow_type < 25);
|
||||
is_valid = is_valid && (appearance_bits5.eyebrow_color < 8);
|
||||
is_valid = is_valid && (appearance_bits5.eyebrow_scale < 9);
|
||||
is_valid = is_valid && (appearance_bits5.eyebrow_aspect < 7);
|
||||
is_valid = is_valid && (appearance_bits5.eyebrow_rotate < 12);
|
||||
is_valid = is_valid && (appearance_bits5.eyebrow_x < 12);
|
||||
is_valid = is_valid && (appearance_bits5.eyebrow_y < 19);
|
||||
is_valid = is_valid && (appearance_bits5.eyebrow_type <= static_cast<u8>(EyebrowType::Max));
|
||||
is_valid = is_valid && (appearance_bits5.eyebrow_color <= MaxVer3CommonColor);
|
||||
is_valid = is_valid && (appearance_bits5.eyebrow_scale <= MaxEyebrowScale);
|
||||
is_valid = is_valid && (appearance_bits5.eyebrow_aspect <= MaxEyebrowAspect);
|
||||
is_valid = is_valid && (appearance_bits5.eyebrow_rotate <= MaxEyebrowRotate);
|
||||
is_valid = is_valid && (appearance_bits5.eyebrow_x <= MaxEyebrowX);
|
||||
is_valid = is_valid && (appearance_bits5.eyebrow_y <= MaxEyebrowY);
|
||||
|
||||
is_valid = is_valid && (appearance_bits6.nose_type < 18);
|
||||
is_valid = is_valid && (appearance_bits6.nose_scale < 9);
|
||||
is_valid = is_valid && (appearance_bits6.nose_y < 19);
|
||||
is_valid = is_valid && (appearance_bits6.nose_type <= static_cast<u8>(NoseType::Max));
|
||||
is_valid = is_valid && (appearance_bits6.nose_scale <= MaxNoseScale);
|
||||
is_valid = is_valid && (appearance_bits6.nose_y <= MaxNoseY);
|
||||
|
||||
is_valid = is_valid && (appearance_bits7.mouth_type < 36);
|
||||
is_valid = is_valid && (appearance_bits7.mouth_color < 5);
|
||||
is_valid = is_valid && (appearance_bits7.mouth_scale < 9);
|
||||
is_valid = is_valid && (appearance_bits7.mouth_aspect < 7);
|
||||
is_valid = is_valid && (appearance_bits8.mouth_y < 19);
|
||||
is_valid = is_valid && (appearance_bits7.mouth_type <= static_cast<u8>(MouthType::Max));
|
||||
is_valid = is_valid && (appearance_bits7.mouth_color <= MaxVer3CommonColor - 3);
|
||||
is_valid = is_valid && (appearance_bits7.mouth_scale <= MaxMouthScale);
|
||||
is_valid = is_valid && (appearance_bits7.mouth_aspect <= MaxMoutAspect);
|
||||
is_valid = is_valid && (appearance_bits8.mouth_y <= MaxMouthY);
|
||||
|
||||
is_valid = is_valid && (appearance_bits8.mustache_type < 6);
|
||||
is_valid = is_valid && (appearance_bits9.mustache_scale < 7);
|
||||
is_valid = is_valid && (appearance_bits9.mustache_y < 17);
|
||||
is_valid = is_valid && (appearance_bits8.mustache_type <= static_cast<u8>(MustacheType::Max));
|
||||
is_valid = is_valid && (appearance_bits9.mustache_scale < MaxMustacheScale);
|
||||
is_valid = is_valid && (appearance_bits9.mustache_y <= MasMustacheY);
|
||||
|
||||
is_valid = is_valid && (appearance_bits9.beard_type < 6);
|
||||
is_valid = is_valid && (appearance_bits9.beard_color < 8);
|
||||
is_valid = is_valid && (appearance_bits9.beard_type <= static_cast<u8>(BeardType::Max));
|
||||
is_valid = is_valid && (appearance_bits9.beard_color <= MaxVer3CommonColor);
|
||||
|
||||
is_valid = is_valid && (appearance_bits10.glass_type < 9);
|
||||
is_valid = is_valid && (appearance_bits10.glass_color < 6);
|
||||
is_valid = is_valid && (appearance_bits10.glass_scale < 8);
|
||||
is_valid = is_valid && (appearance_bits10.glass_y < 21);
|
||||
is_valid = is_valid && (appearance_bits10.glass_type <= MaxVer3GlassType);
|
||||
is_valid = is_valid && (appearance_bits10.glass_color <= MaxVer3CommonColor - 2);
|
||||
is_valid = is_valid && (appearance_bits10.glass_scale <= MaxGlassScale);
|
||||
is_valid = is_valid && (appearance_bits10.glass_y <= MaxGlassScale);
|
||||
|
||||
is_valid = is_valid && (appearance_bits11.mole_type < 2);
|
||||
is_valid = is_valid && (appearance_bits11.mole_scale < 9);
|
||||
is_valid = is_valid && (appearance_bits11.mole_x < 17);
|
||||
is_valid = is_valid && (appearance_bits11.mole_y < 31);
|
||||
is_valid = is_valid && (appearance_bits11.mole_type <= static_cast<u8>(MoleType::Max));
|
||||
is_valid = is_valid && (appearance_bits11.mole_scale <= MaxMoleScale);
|
||||
is_valid = is_valid && (appearance_bits11.mole_x <= MaxMoleX);
|
||||
is_valid = is_valid && (appearance_bits11.mole_y <= MaxMoleY);
|
||||
|
||||
return is_valid;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue