diff options
author | german77 <juangerman-13@hotmail.com> | 2023-09-11 07:07:00 +0200 |
---|---|---|
committer | german77 <juangerman-13@hotmail.com> | 2023-09-11 07:18:03 +0200 |
commit | d6037efe5e63d193ae8c586ff9d1e1326cae05cb (patch) | |
tree | eea6b9067f3cd1fd0303ef081d8b97c7feb8d92a /src/core/hle/service/mii | |
parent | service: mii: Move core data operations (diff) | |
download | yuzu-d6037efe5e63d193ae8c586ff9d1e1326cae05cb.tar yuzu-d6037efe5e63d193ae8c586ff9d1e1326cae05cb.tar.gz yuzu-d6037efe5e63d193ae8c586ff9d1e1326cae05cb.tar.bz2 yuzu-d6037efe5e63d193ae8c586ff9d1e1326cae05cb.tar.lz yuzu-d6037efe5e63d193ae8c586ff9d1e1326cae05cb.tar.xz yuzu-d6037efe5e63d193ae8c586ff9d1e1326cae05cb.tar.zst yuzu-d6037efe5e63d193ae8c586ff9d1e1326cae05cb.zip |
Diffstat (limited to 'src/core/hle/service/mii')
-rw-r--r-- | src/core/hle/service/mii/mii_manager.cpp | 70 | ||||
-rw-r--r-- | src/core/hle/service/mii/types/core_data.cpp | 4 | ||||
-rw-r--r-- | src/core/hle/service/mii/types/core_data.h | 1 | ||||
-rw-r--r-- | src/core/hle/service/mii/types/store_data.cpp | 439 | ||||
-rw-r--r-- | src/core/hle/service/mii/types/store_data.h | 71 |
5 files changed, 512 insertions, 73 deletions
diff --git a/src/core/hle/service/mii/mii_manager.cpp b/src/core/hle/service/mii/mii_manager.cpp index 3483d95e5..dd7af531e 100644 --- a/src/core/hle/service/mii/mii_manager.cpp +++ b/src/core/hle/service/mii/mii_manager.cpp @@ -31,76 +31,22 @@ std::array<T, DestArraySize> ResizeArray(const std::array<T, SourceArraySize>& i } CharInfo ConvertStoreDataToInfo(const StoreData& data) { - const StoreDataBitFields& bf = data.core_data.data; - - return { - .create_id = data.create_id, - .name = data.core_data.name, - .font_region = static_cast<u8>(bf.font_region.Value()), - .favorite_color = static_cast<u8>(bf.favorite_color.Value()), - .gender = static_cast<u8>(bf.gender.Value()), - .height = static_cast<u8>(bf.height.Value()), - .build = static_cast<u8>(bf.build.Value()), - .type = static_cast<u8>(bf.type.Value()), - .region_move = static_cast<u8>(bf.region_move.Value()), - .faceline_type = static_cast<u8>(bf.faceline_type.Value()), - .faceline_color = static_cast<u8>(bf.faceline_color.Value()), - .faceline_wrinkle = static_cast<u8>(bf.faceline_wrinkle.Value()), - .faceline_make = static_cast<u8>(bf.faceline_makeup.Value()), - .hair_type = static_cast<u8>(bf.hair_type.Value()), - .hair_color = static_cast<u8>(bf.hair_color.Value()), - .hair_flip = static_cast<u8>(bf.hair_flip.Value()), - .eye_type = static_cast<u8>(bf.eye_type.Value()), - .eye_color = static_cast<u8>(bf.eye_color.Value()), - .eye_scale = static_cast<u8>(bf.eye_scale.Value()), - .eye_aspect = static_cast<u8>(bf.eye_aspect.Value()), - .eye_rotate = static_cast<u8>(bf.eye_rotate.Value()), - .eye_x = static_cast<u8>(bf.eye_x.Value()), - .eye_y = static_cast<u8>(bf.eye_y.Value()), - .eyebrow_type = static_cast<u8>(bf.eyebrow_type.Value()), - .eyebrow_color = static_cast<u8>(bf.eyebrow_color.Value()), - .eyebrow_scale = static_cast<u8>(bf.eyebrow_scale.Value()), - .eyebrow_aspect = static_cast<u8>(bf.eyebrow_aspect.Value()), - .eyebrow_rotate = static_cast<u8>(bf.eyebrow_rotate.Value()), - .eyebrow_x = static_cast<u8>(bf.eyebrow_x.Value()), - .eyebrow_y = static_cast<u8>(bf.eyebrow_y.Value() + 3), - .nose_type = static_cast<u8>(bf.nose_type.Value()), - .nose_scale = static_cast<u8>(bf.nose_scale.Value()), - .nose_y = static_cast<u8>(bf.nose_y.Value()), - .mouth_type = static_cast<u8>(bf.mouth_type.Value()), - .mouth_color = static_cast<u8>(bf.mouth_color.Value()), - .mouth_scale = static_cast<u8>(bf.mouth_scale.Value()), - .mouth_aspect = static_cast<u8>(bf.mouth_aspect.Value()), - .mouth_y = static_cast<u8>(bf.mouth_y.Value()), - .beard_color = static_cast<u8>(bf.beard_color.Value()), - .beard_type = static_cast<u8>(bf.beard_type.Value()), - .mustache_type = static_cast<u8>(bf.mustache_type.Value()), - .mustache_scale = static_cast<u8>(bf.mustache_scale.Value()), - .mustache_y = static_cast<u8>(bf.mustache_y.Value()), - .glasses_type = static_cast<u8>(bf.glasses_type.Value()), - .glasses_color = static_cast<u8>(bf.glasses_color.Value()), - .glasses_scale = static_cast<u8>(bf.glasses_scale.Value()), - .glasses_y = static_cast<u8>(bf.glasses_y.Value()), - .mole_type = static_cast<u8>(bf.mole_type.Value()), - .mole_scale = static_cast<u8>(bf.mole_scale.Value()), - .mole_x = static_cast<u8>(bf.mole_x.Value()), - .mole_y = static_cast<u8>(bf.mole_y.Value()), - .padding = 0, - }; + // Next Commit Will fix this one + return {}; } StoreData BuildRandomStoreData(Age age, Gender gender, Race race, const Common::UUID& user_id) { - CoreData core_data{}; - core_data.BuildRandom(age, gender, race); + StoreData store_data{}; + store_data.BuildRandom(age, gender, race); - return {DefaultMiiName, core_data.data, user_id}; + return store_data; } StoreData BuildDefaultStoreData(const DefaultMii& info, const Common::UUID& user_id) { - CoreData core_data{}; - core_data.SetDefault(); + StoreData store_data{}; + store_data.BuildDefault(0); - return {DefaultMiiName, core_data.data, user_id}; + return store_data; } } // namespace diff --git a/src/core/hle/service/mii/types/core_data.cpp b/src/core/hle/service/mii/types/core_data.cpp index 76c57fff2..9d7e604a9 100644 --- a/src/core/hle/service/mii/types/core_data.cpp +++ b/src/core/hle/service/mii/types/core_data.cpp @@ -394,6 +394,10 @@ void CoreData::SetNickname(Nickname nickname) { name = nickname; } +u8 CoreData::GetFontRegion() const { + return static_cast<u8>(data.font_region.Value()); +} + u8 CoreData::GetFavoriteColor() const { return static_cast<u8>(data.favorite_color.Value()); } diff --git a/src/core/hle/service/mii/types/core_data.h b/src/core/hle/service/mii/types/core_data.h index 76daf4e6e..411c123b3 100644 --- a/src/core/hle/service/mii/types/core_data.h +++ b/src/core/hle/service/mii/types/core_data.h @@ -154,6 +154,7 @@ public: void SetMoleY(u8 value); void SetNickname(Nickname nickname); + u8 GetFontRegion() const; u8 GetFavoriteColor() const; u8 GetGender() const; u8 GetHeight() const; diff --git a/src/core/hle/service/mii/types/store_data.cpp b/src/core/hle/service/mii/types/store_data.cpp index 459e8699f..72c8fa2e9 100644 --- a/src/core/hle/service/mii/types/store_data.cpp +++ b/src/core/hle/service/mii/types/store_data.cpp @@ -2,19 +2,442 @@ // SPDX-License-Identifier: GPL-2.0-or-later #include "core/hle/service/mii/mii_util.h" +#include "core/hle/service/mii/types/raw_data.h" #include "core/hle/service/mii/types/store_data.h" namespace Service::Mii { -StoreData::StoreData() = default; -StoreData::StoreData(const Nickname& name, const StoreDataBitFields& bit_fields, - const Common::UUID& user_id) { - core_data.name = name; - create_id = Common::UUID::MakeRandomRFC4122V4(); +void StoreData::BuildDefault(u32 mii_index) { + const auto& default_mii = RawData::DefaultMii[mii_index]; + core_data.SetDefault(); - core_data.data = bit_fields; - data_crc = MiiUtil::CalculateCrc16(&core_data.data, sizeof(core_data.data)); - device_crc = MiiUtil::CalculateCrc16(&user_id, sizeof(Common::UUID)); + core_data.SetFacelineType(static_cast<u8>(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.SetHairType(static_cast<u8>(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.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)); + core_data.SetEyeRotate(static_cast<u8>(default_mii.eye_rotate)); + 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.SetEyebrowColor( + RawData::GetHairColorFromVer3(static_cast<u8>(default_mii.eyebrow_color))); + core_data.SetEyebrowScale(static_cast<u8>(default_mii.eyebrow_scale)); + core_data.SetEyebrowAspect(static_cast<u8>(default_mii.eyebrow_aspect)); + core_data.SetEyebrowRotate(static_cast<u8>(default_mii.eyebrow_rotate)); + 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.SetNoseScale(static_cast<u8>(default_mii.nose_scale)); + core_data.SetNoseY(static_cast<u8>(default_mii.nose_y)); + + core_data.SetMouthType(static_cast<u8>(default_mii.mouth_type)); + core_data.SetMouthColor( + RawData::GetMouthColorFromVer3(static_cast<u8>(default_mii.mouth_color))); + core_data.SetMouthScale(static_cast<u8>(default_mii.mouth_scale)); + 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.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.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.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.SetRegionMove(static_cast<u8>(default_mii.region_move)); + core_data.SetFontRegion(default_mii.font_region); + core_data.SetType(static_cast<u8>(default_mii.type)); + core_data.SetNickname(default_mii.nickname); + + const auto device_id = MiiUtil::GetDeviceId(); + create_id = MiiUtil::MakeCreateId(); + device_crc = MiiUtil::CalculateCrc16(&device_id, sizeof(Common::UUID)); + data_crc = MiiUtil::CalculateCrc16(&core_data, sizeof(CoreData)); +} + +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.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.SetHairType(static_cast<u8>(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.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)); + core_data.SetEyeRotate(static_cast<u8>(default_mii.eye_rotate)); + 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.SetEyebrowColor( + RawData::GetHairColorFromVer3(static_cast<u8>(default_mii.eyebrow_color))); + core_data.SetEyebrowScale(static_cast<u8>(default_mii.eyebrow_scale)); + core_data.SetEyebrowAspect(static_cast<u8>(default_mii.eyebrow_aspect)); + core_data.SetEyebrowRotate(static_cast<u8>(default_mii.eyebrow_rotate)); + 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.SetNoseScale(static_cast<u8>(default_mii.nose_scale)); + core_data.SetNoseY(static_cast<u8>(default_mii.nose_y)); + + core_data.SetMouthType(static_cast<u8>(default_mii.mouth_type)); + core_data.SetMouthColor( + RawData::GetMouthColorFromVer3(static_cast<u8>(default_mii.mouth_color))); + core_data.SetMouthScale(static_cast<u8>(default_mii.mouth_scale)); + 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.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.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.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.SetRegionMove(static_cast<u8>(default_mii.region_move)); + core_data.SetFontRegion(default_mii.font_region); + core_data.SetType(static_cast<u8>(default_mii.type)); + core_data.SetNickname(default_mii.nickname); + + const auto device_id = MiiUtil::GetDeviceId(); + create_id = MiiUtil::MakeCreateId(); + device_crc = MiiUtil::CalculateCrc16(&device_id, sizeof(Common::UUID)); + data_crc = MiiUtil::CalculateCrc16(&core_data, sizeof(CoreData)); +} + +void StoreData::BuildRandom(Age age, Gender gender, Race race) { + core_data.BuildRandom(age, gender, race); + const auto device_id = MiiUtil::GetDeviceId(); + create_id = MiiUtil::MakeCreateId(); + device_crc = MiiUtil::CalculateCrc16(&device_id, sizeof(Common::UUID)); + data_crc = MiiUtil::CalculateCrc16(&core_data, sizeof(CoreData)); +} + +void StoreData::SetInvalidName() { + const auto& invalid_name = core_data.GetInvalidNickname(); + const auto device_id = MiiUtil::GetDeviceId(); + core_data.SetNickname(invalid_name); + device_crc = MiiUtil::CalculateCrc16(&device_id, sizeof(Common::UUID)); + data_crc = MiiUtil::CalculateCrc16(&core_data, sizeof(CoreData)); +} + +bool StoreData::IsSpecial() const { + return GetType() == 1; +} + +u32 StoreData::IsValid() const { + // TODO: complete this + return 0; +} + +Common::UUID StoreData::GetCreateId() const { + return create_id; +} + +FontRegion StoreData::GetFontRegion() const { + return static_cast<FontRegion>(core_data.GetFontRegion()); +} + +u8 StoreData::GetFavoriteColor() const { + return core_data.GetFavoriteColor(); +} + +u8 StoreData::GetGender() const { + return core_data.GetGender(); +} + +u8 StoreData::GetHeight() const { + return core_data.GetHeight(); +} + +u8 StoreData::GetBuild() const { + return core_data.GetBuild(); +} + +u8 StoreData::GetType() const { + return core_data.GetType(); +} + +u8 StoreData::GetRegionMove() const { + return core_data.GetRegionMove(); +} + +u8 StoreData::GetFacelineType() const { + return core_data.GetFacelineType(); +} + +u8 StoreData::GetFacelineColor() const { + return core_data.GetFacelineColor(); +} + +u8 StoreData::GetFacelineWrinkle() const { + return core_data.GetFacelineWrinkle(); +} + +u8 StoreData::GetFacelineMake() const { + return core_data.GetFacelineMake(); +} + +u8 StoreData::GetHairType() const { + return core_data.GetHairType(); +} + +u8 StoreData::GetHairColor() const { + return core_data.GetHairColor(); +} + +u8 StoreData::GetHairFlip() const { + return core_data.GetHairFlip(); +} + +u8 StoreData::GetEyeType() const { + return core_data.GetEyeType(); +} + +u8 StoreData::GetEyeColor() const { + return core_data.GetEyeColor(); +} + +u8 StoreData::GetEyeScale() const { + return core_data.GetEyeScale(); +} + +u8 StoreData::GetEyeAspect() const { + return core_data.GetEyeAspect(); +} + +u8 StoreData::GetEyeRotate() const { + return core_data.GetEyeRotate(); +} + +u8 StoreData::GetEyeX() const { + return core_data.GetEyeX(); +} + +u8 StoreData::GetEyeY() const { + return core_data.GetEyeY(); +} + +u8 StoreData::GetEyebrowType() const { + return core_data.GetEyebrowType(); +} + +u8 StoreData::GetEyebrowColor() const { + return core_data.GetEyebrowColor(); +} + +u8 StoreData::GetEyebrowScale() const { + return core_data.GetEyebrowScale(); +} + +u8 StoreData::GetEyebrowAspect() const { + return core_data.GetEyebrowAspect(); +} + +u8 StoreData::GetEyebrowRotate() const { + return core_data.GetEyebrowRotate(); +} + +u8 StoreData::GetEyebrowX() const { + return core_data.GetEyebrowX(); +} + +u8 StoreData::GetEyebrowY() const { + return core_data.GetEyebrowY(); +} + +u8 StoreData::GetNoseType() const { + return core_data.GetNoseType(); +} + +u8 StoreData::GetNoseScale() const { + return core_data.GetNoseScale(); +} + +u8 StoreData::GetNoseY() const { + return core_data.GetNoseY(); +} + +u8 StoreData::GetMouthType() const { + return core_data.GetMouthType(); +} + +u8 StoreData::GetMouthColor() const { + return core_data.GetMouthColor(); +} + +u8 StoreData::GetMouthScale() const { + return core_data.GetMouthScale(); +} + +u8 StoreData::GetMouthAspect() const { + return core_data.GetMouthAspect(); +} + +u8 StoreData::GetMouthY() const { + return core_data.GetMouthY(); +} + +u8 StoreData::GetBeardColor() const { + return core_data.GetBeardColor(); +} + +u8 StoreData::GetBeardType() const { + return core_data.GetBeardType(); +} + +u8 StoreData::GetMustacheType() const { + return core_data.GetMustacheType(); +} + +u8 StoreData::GetMustacheScale() const { + return core_data.GetMustacheScale(); +} + +u8 StoreData::GetMustacheY() const { + return core_data.GetMustacheY(); +} + +u8 StoreData::GetGlassType() const { + return core_data.GetGlassType(); +} + +u8 StoreData::GetGlassColor() const { + return core_data.GetGlassColor(); +} + +u8 StoreData::GetGlassScale() const { + return core_data.GetGlassScale(); +} + +u8 StoreData::GetGlassY() const { + return core_data.GetGlassY(); +} + +u8 StoreData::GetMoleType() const { + return core_data.GetMoleType(); +} + +u8 StoreData::GetMoleScale() const { + return core_data.GetMoleScale(); +} + +u8 StoreData::GetMoleX() const { + return core_data.GetMoleX(); +} + +u8 StoreData::GetMoleY() const { + return core_data.GetMoleY(); +} + +Nickname StoreData::GetNickname() const { + return core_data.GetNickname(); +} + +bool StoreData::operator==(const StoreData& data) { + bool is_identical = data.core_data.IsValid() == 0; + is_identical &= core_data.GetNickname() == data.core_data.GetNickname(); + is_identical &= GetCreateId() == data.GetCreateId(); + is_identical &= GetFontRegion() == data.GetFontRegion(); + is_identical &= GetFavoriteColor() == data.GetFavoriteColor(); + is_identical &= GetGender() == data.GetGender(); + is_identical &= GetHeight() == data.GetHeight(); + is_identical &= GetBuild() == data.GetBuild(); + is_identical &= GetType() == data.GetType(); + is_identical &= GetRegionMove() == data.GetRegionMove(); + is_identical &= GetFacelineType() == data.GetFacelineType(); + is_identical &= GetFacelineColor() == data.GetFacelineColor(); + is_identical &= GetFacelineWrinkle() == data.GetFacelineWrinkle(); + is_identical &= GetFacelineMake() == data.GetFacelineMake(); + is_identical &= GetHairType() == data.GetHairType(); + is_identical &= GetHairColor() == data.GetHairColor(); + is_identical &= GetHairFlip() == data.GetHairFlip(); + is_identical &= GetEyeType() == data.GetEyeType(); + is_identical &= GetEyeColor() == data.GetEyeColor(); + is_identical &= GetEyeScale() == data.GetEyeScale(); + is_identical &= GetEyeAspect() == data.GetEyeAspect(); + is_identical &= GetEyeRotate() == data.GetEyeRotate(); + is_identical &= GetEyeX() == data.GetEyeX(); + is_identical &= GetEyeY() == data.GetEyeY(); + is_identical &= GetEyebrowType() == data.GetEyebrowType(); + is_identical &= GetEyebrowColor() == data.GetEyebrowColor(); + is_identical &= GetEyebrowScale() == data.GetEyebrowScale(); + is_identical &= GetEyebrowAspect() == data.GetEyebrowAspect(); + is_identical &= GetEyebrowRotate() == data.GetEyebrowRotate(); + is_identical &= GetEyebrowX() == data.GetEyebrowX(); + is_identical &= GetEyebrowY() == data.GetEyebrowY(); + is_identical &= GetNoseType() == data.GetNoseType(); + is_identical &= GetNoseScale() == data.GetNoseScale(); + is_identical &= GetNoseY() == data.GetNoseY(); + is_identical &= GetMouthType() == data.GetMouthType(); + is_identical &= GetMouthColor() == data.GetMouthColor(); + is_identical &= GetMouthScale() == data.GetMouthScale(); + is_identical &= GetMouthAspect() == data.GetMouthAspect(); + is_identical &= GetMouthY() == data.GetMouthY(); + is_identical &= GetBeardColor() == data.GetBeardColor(); + is_identical &= GetBeardType() == data.GetBeardType(); + is_identical &= GetMustacheType() == data.GetMustacheType(); + is_identical &= GetMustacheScale() == data.GetMustacheScale(); + is_identical &= GetMustacheY() == data.GetMustacheY(); + is_identical &= GetGlassType() == data.GetGlassType(); + is_identical &= GetGlassColor() == data.GetGlassColor(); + is_identical &= GetGlassScale() == data.GetGlassScale(); + is_identical &= GetGlassY() == data.GetGlassY(); + is_identical &= GetMoleType() == data.GetMoleType(); + is_identical &= GetMoleScale() == data.GetMoleScale(); + is_identical &= GetMoleX() == data.GetMoleX(); + is_identical &= data.GetMoleY() == data.GetMoleY(); + return is_identical; } } // namespace Service::Mii diff --git a/src/core/hle/service/mii/types/store_data.h b/src/core/hle/service/mii/types/store_data.h index be6950967..cc8551a66 100644 --- a/src/core/hle/service/mii/types/store_data.h +++ b/src/core/hle/service/mii/types/store_data.h @@ -10,10 +10,75 @@ namespace Service::Mii { class StoreData { public: - StoreData(); - StoreData(const Nickname& name, const StoreDataBitFields& bit_fields, - const Common::UUID& user_id); + // nn::mii::detail::StoreDataRaw::BuildDefault + void BuildDefault(u32 mii_index); + // nn::mii::detail::StoreDataRaw::BuildDefault + void BuildBase(Gender gender); + // nn::mii::detail::StoreDataRaw::BuildRandom + void BuildRandom(Age age, Gender gender, Race race); + + void SetInvalidName(); + + bool IsSpecial() const; + + u32 IsValid() const; + + Common::UUID GetCreateId() const; + FontRegion GetFontRegion() const; + u8 GetFavoriteColor() const; + u8 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; + u8 GetEyeScale() const; + u8 GetEyeAspect() const; + u8 GetEyeRotate() const; + u8 GetEyeX() const; + u8 GetEyeY() const; + u8 GetEyebrowType() const; + u8 GetEyebrowColor() const; + u8 GetEyebrowScale() const; + u8 GetEyebrowAspect() const; + u8 GetEyebrowRotate() const; + u8 GetEyebrowX() const; + u8 GetEyebrowY() const; + u8 GetNoseType() const; + u8 GetNoseScale() const; + u8 GetNoseY() const; + u8 GetMouthType() const; + u8 GetMouthColor() const; + u8 GetMouthScale() const; + u8 GetMouthAspect() const; + u8 GetMouthY() const; + u8 GetBeardColor() const; + u8 GetBeardType() const; + u8 GetMustacheType() const; + u8 GetMustacheScale() const; + u8 GetMustacheY() const; + u8 GetGlassType() const; + u8 GetGlassColor() const; + u8 GetGlassScale() const; + u8 GetGlassY() const; + u8 GetMoleType() const; + u8 GetMoleScale() const; + u8 GetMoleX() const; + u8 GetMoleY() const; + Nickname GetNickname() const; + + bool operator==(const StoreData& data); + +private: CoreData core_data{}; Common::UUID create_id{}; u16 data_crc{}; |