diff options
author | Narr the Reg <juangerman-13@hotmail.com> | 2023-09-07 18:55:38 +0200 |
---|---|---|
committer | Narr the Reg <juangerman-13@hotmail.com> | 2023-09-07 19:46:12 +0200 |
commit | 57e7eed54c61d52361d4e3434bcfa4aa707e7232 (patch) | |
tree | 7f8e2d5bb8e7d7c15c42a21fb59abf332fb35986 /src/core/hle/service/mii | |
parent | Merge pull request #11428 from Kelebek1/adsp_rework (diff) | |
download | yuzu-57e7eed54c61d52361d4e3434bcfa4aa707e7232.tar yuzu-57e7eed54c61d52361d4e3434bcfa4aa707e7232.tar.gz yuzu-57e7eed54c61d52361d4e3434bcfa4aa707e7232.tar.bz2 yuzu-57e7eed54c61d52361d4e3434bcfa4aa707e7232.tar.lz yuzu-57e7eed54c61d52361d4e3434bcfa4aa707e7232.tar.xz yuzu-57e7eed54c61d52361d4e3434bcfa4aa707e7232.tar.zst yuzu-57e7eed54c61d52361d4e3434bcfa4aa707e7232.zip |
Diffstat (limited to '')
-rw-r--r-- | src/core/hle/service/mii/mii_manager.cpp | 12 | ||||
-rw-r--r-- | src/core/hle/service/mii/mii_manager.h | 1 | ||||
-rw-r--r-- | src/core/hle/service/mii/raw_data.cpp | 105 | ||||
-rw-r--r-- | src/core/hle/service/mii/raw_data.h | 1 |
4 files changed, 115 insertions, 4 deletions
diff --git a/src/core/hle/service/mii/mii_manager.cpp b/src/core/hle/service/mii/mii_manager.cpp index 6b966f20d..dd632df50 100644 --- a/src/core/hle/service/mii/mii_manager.cpp +++ b/src/core/hle/service/mii/mii_manager.cpp @@ -18,7 +18,6 @@ namespace { constexpr Result ERROR_CANNOT_FIND_ENTRY{ErrorModule::Mii, 4}; -constexpr std::size_t BaseMiiCount{2}; constexpr std::size_t DefaultMiiCount{RawData::DefaultMii.size()}; constexpr MiiStoreData::Name DefaultMiiName{u'n', u'o', u' ', u'n', u'a', u'm', u'e'}; @@ -404,7 +403,7 @@ u32 MiiManager::GetCount(SourceFlag source_flag) const { count += 0; } if ((source_flag & SourceFlag::Default) != SourceFlag::None) { - count += (DefaultMiiCount - BaseMiiCount); + count += DefaultMiiCount; } return static_cast<u32>(count); } @@ -422,13 +421,18 @@ CharInfo MiiManager::BuildRandom(Age age, Gender gender, Race race) { return ConvertStoreDataToInfo(BuildRandomStoreData(age, gender, race, user_id)); } +CharInfo MiiManager::BuildBase(Gender gender) { + const std::size_t index = gender == Gender::Female ? 1 : 0; + return ConvertStoreDataToInfo(BuildDefaultStoreData(RawData::BaseMii.at(index), user_id)); +} + CharInfo MiiManager::BuildDefault(std::size_t index) { return ConvertStoreDataToInfo(BuildDefaultStoreData(RawData::DefaultMii.at(index), user_id)); } CharInfo MiiManager::ConvertV3ToCharInfo(const Ver3StoreData& mii_v3) const { Service::Mii::MiiManager manager; - auto mii = manager.BuildDefault(0); + auto mii = manager.BuildBase(Mii::Gender::Male); if (!ValidateV3Info(mii_v3)) { return mii; @@ -678,7 +682,7 @@ std::vector<MiiInfoElement> MiiManager::GetDefault(SourceFlag source_flag) { return result; } - for (std::size_t index = BaseMiiCount; index < DefaultMiiCount; index++) { + for (std::size_t index = 0; index < DefaultMiiCount; index++) { result.emplace_back(BuildDefault(index), Source::Default); } diff --git a/src/core/hle/service/mii/mii_manager.h b/src/core/hle/service/mii/mii_manager.h index 45c2be3c8..0c8295ebe 100644 --- a/src/core/hle/service/mii/mii_manager.h +++ b/src/core/hle/service/mii/mii_manager.h @@ -21,6 +21,7 @@ public: u32 GetCount(SourceFlag source_flag) const; Result UpdateLatest(CharInfo* out_info, const CharInfo& info, SourceFlag source_flag); CharInfo BuildRandom(Age age, Gender gender, Race race); + CharInfo BuildBase(Gender gender); CharInfo BuildDefault(std::size_t index); CharInfo ConvertV3ToCharInfo(const Ver3StoreData& mii_v3) const; bool ValidateV3Info(const Ver3StoreData& mii_v3) const; diff --git a/src/core/hle/service/mii/raw_data.cpp b/src/core/hle/service/mii/raw_data.cpp index 80369cdb0..e5245b791 100644 --- a/src/core/hle/service/mii/raw_data.cpp +++ b/src/core/hle/service/mii/raw_data.cpp @@ -5,6 +5,111 @@ namespace Service::Mii::RawData { +const std::array<Service::Mii::DefaultMii, 2> BaseMii{ + Service::Mii::DefaultMii{ + .face_type = 0, + .face_color = 0, + .face_wrinkle = 0, + .face_makeup = 0, + .hair_type = 33, + .hair_color = 1, + .hair_flip = 0, + .eye_type = 2, + .eye_color = 0, + .eye_scale = 4, + .eye_aspect = 3, + .eye_rotate = 4, + .eye_x = 2, + .eye_y = 12, + .eyebrow_type = 6, + .eyebrow_color = 1, + .eyebrow_scale = 4, + .eyebrow_aspect = 3, + .eyebrow_rotate = 6, + .eyebrow_x = 2, + .eyebrow_y = 10, + .nose_type = 1, + .nose_scale = 4, + .nose_y = 9, + .mouth_type = 23, + .mouth_color = 0, + .mouth_scale = 4, + .mouth_aspect = 3, + .mouth_y = 13, + .mustache_type = 0, + .beard_type = 0, + .beard_color = 0, + .mustache_scale = 4, + .mustache_y = 10, + .glasses_type = 0, + .glasses_color = 0, + .glasses_scale = 4, + .glasses_y = 10, + .mole_type = 0, + .mole_scale = 4, + .mole_x = 2, + .mole_y = 20, + .height = 64, + .weight = 64, + .gender = Gender::Male, + .favorite_color = 0, + .region = 0, + .font_region = FontRegion::Standard, + .type = 0, + }, + Service::Mii::DefaultMii{ + .face_type = 0, + .face_color = 0, + .face_wrinkle = 0, + .face_makeup = 0, + .hair_type = 12, + .hair_color = 1, + .hair_flip = 0, + .eye_type = 4, + .eye_color = 0, + .eye_scale = 4, + .eye_aspect = 3, + .eye_rotate = 3, + .eye_x = 2, + .eye_y = 12, + .eyebrow_type = 0, + .eyebrow_color = 1, + .eyebrow_scale = 4, + .eyebrow_aspect = 3, + .eyebrow_rotate = 6, + .eyebrow_x = 2, + .eyebrow_y = 10, + .nose_type = 1, + .nose_scale = 4, + .nose_y = 9, + .mouth_type = 23, + .mouth_color = 0, + .mouth_scale = 4, + .mouth_aspect = 3, + .mouth_y = 13, + .mustache_type = 0, + .beard_type = 0, + .beard_color = 0, + .mustache_scale = 4, + .mustache_y = 10, + .glasses_type = 0, + .glasses_color = 0, + .glasses_scale = 4, + .glasses_y = 10, + .mole_type = 0, + .mole_scale = 4, + .mole_x = 2, + .mole_y = 20, + .height = 64, + .weight = 64, + .gender = Gender::Female, + .favorite_color = 0, + .region = 0, + .font_region = FontRegion::Standard, + .type = 0, + }, +}; + const std::array<Service::Mii::DefaultMii, 6> DefaultMii{ Service::Mii::DefaultMii{ .face_type = 0, diff --git a/src/core/hle/service/mii/raw_data.h b/src/core/hle/service/mii/raw_data.h index 5b81b013b..cdd2337d6 100644 --- a/src/core/hle/service/mii/raw_data.h +++ b/src/core/hle/service/mii/raw_data.h @@ -9,6 +9,7 @@ namespace Service::Mii::RawData { +extern const std::array<Service::Mii::DefaultMii, 2> BaseMii; extern const std::array<Service::Mii::DefaultMii, 6> DefaultMii; extern const std::array<Service::Mii::RandomMiiData4, 18> RandomMiiFaceline; extern const std::array<Service::Mii::RandomMiiData3, 6> RandomMiiFacelineColor; |