diff options
| author | 2020-07-16 20:43:56 -0400 | |
|---|---|---|
| committer | 2020-07-16 20:45:33 -0400 | |
| commit | 7f989378c057a4f76db661b0f095d6144b2be888 (patch) | |
| tree | e38b38340f0b32da9882cb9b5fc28c411f6be4a8 | |
| parent | Merge pull request #4292 from bunnei/mii-rewrite (diff) | |
| download | yuzu-7f989378c057a4f76db661b0f095d6144b2be888.tar.gz yuzu-7f989378c057a4f76db661b0f095d6144b2be888.tar.xz yuzu-7f989378c057a4f76db661b0f095d6144b2be888.zip | |
mii/manager: Make use of designated initializers
Allows returning the structure in a more concise manner.
Diffstat (limited to '')
| -rw-r--r-- | src/core/hle/service/mii/manager.cpp | 107 |
1 files changed, 54 insertions, 53 deletions
diff --git a/src/core/hle/service/mii/manager.cpp b/src/core/hle/service/mii/manager.cpp index 4a1d1182e..6e51fe89f 100644 --- a/src/core/hle/service/mii/manager.cpp +++ b/src/core/hle/service/mii/manager.cpp | |||
| @@ -47,59 +47,60 @@ std::array<T, DestArraySize> ResizeArray(const std::array<T, SourceArraySize>& i | |||
| 47 | MiiInfo ConvertStoreDataToInfo(const MiiStoreData& data) { | 47 | MiiInfo ConvertStoreDataToInfo(const MiiStoreData& data) { |
| 48 | MiiStoreBitFields bf; | 48 | MiiStoreBitFields bf; |
| 49 | std::memcpy(&bf, data.data.data.data(), sizeof(MiiStoreBitFields)); | 49 | std::memcpy(&bf, data.data.data.data(), sizeof(MiiStoreBitFields)); |
| 50 | MiiInfo info{}; | 50 | |
| 51 | info.name = ResizeArray<char16_t, 10, 11>(data.data.name); | 51 | return { |
| 52 | info.uuid = data.data.uuid; | 52 | .uuid = data.data.uuid, |
| 53 | info.font_region = static_cast<u8>(bf.font_region.Value()); | 53 | .name = ResizeArray<char16_t, 10, 11>(data.data.name), |
| 54 | info.favorite_color = static_cast<u8>(bf.favorite_color.Value()); | 54 | .font_region = static_cast<u8>(bf.font_region.Value()), |
| 55 | info.gender = static_cast<u8>(bf.gender.Value()); | 55 | .favorite_color = static_cast<u8>(bf.favorite_color.Value()), |
| 56 | info.height = static_cast<u8>(bf.height.Value()); | 56 | .gender = static_cast<u8>(bf.gender.Value()), |
| 57 | info.build = static_cast<u8>(bf.build.Value()); | 57 | .height = static_cast<u8>(bf.height.Value()), |
| 58 | info.type = static_cast<u8>(bf.type.Value()); | 58 | .build = static_cast<u8>(bf.build.Value()), |
| 59 | info.region_move = static_cast<u8>(bf.region_move.Value()); | 59 | .type = static_cast<u8>(bf.type.Value()), |
| 60 | info.faceline_type = static_cast<u8>(bf.faceline_type.Value()); | 60 | .region_move = static_cast<u8>(bf.region_move.Value()), |
| 61 | info.faceline_color = static_cast<u8>(bf.faceline_color.Value()); | 61 | .faceline_type = static_cast<u8>(bf.faceline_type.Value()), |
| 62 | info.faceline_wrinkle = static_cast<u8>(bf.faceline_wrinkle.Value()); | 62 | .faceline_color = static_cast<u8>(bf.faceline_color.Value()), |
| 63 | info.faceline_make = static_cast<u8>(bf.faceline_makeup.Value()); | 63 | .faceline_wrinkle = static_cast<u8>(bf.faceline_wrinkle.Value()), |
| 64 | info.hair_type = static_cast<u8>(bf.hair_type.Value()); | 64 | .faceline_make = static_cast<u8>(bf.faceline_makeup.Value()), |
| 65 | info.hair_color = static_cast<u8>(bf.hair_color.Value()); | 65 | .hair_type = static_cast<u8>(bf.hair_type.Value()), |
| 66 | info.hair_flip = static_cast<u8>(bf.hair_flip.Value()); | 66 | .hair_color = static_cast<u8>(bf.hair_color.Value()), |
| 67 | info.eye_type = static_cast<u8>(bf.eye_type.Value()); | 67 | .hair_flip = static_cast<u8>(bf.hair_flip.Value()), |
| 68 | info.eye_color = static_cast<u8>(bf.eye_color.Value()); | 68 | .eye_type = static_cast<u8>(bf.eye_type.Value()), |
| 69 | info.eye_scale = static_cast<u8>(bf.eye_scale.Value()); | 69 | .eye_color = static_cast<u8>(bf.eye_color.Value()), |
| 70 | info.eye_aspect = static_cast<u8>(bf.eye_aspect.Value()); | 70 | .eye_scale = static_cast<u8>(bf.eye_scale.Value()), |
| 71 | info.eye_rotate = static_cast<u8>(bf.eye_rotate.Value()); | 71 | .eye_aspect = static_cast<u8>(bf.eye_aspect.Value()), |
| 72 | info.eye_x = static_cast<u8>(bf.eye_x.Value()); | 72 | .eye_rotate = static_cast<u8>(bf.eye_rotate.Value()), |
| 73 | info.eye_y = static_cast<u8>(bf.eye_y.Value()); | 73 | .eye_x = static_cast<u8>(bf.eye_x.Value()), |
| 74 | info.eyebrow_type = static_cast<u8>(bf.eyebrow_type.Value()); | 74 | .eye_y = static_cast<u8>(bf.eye_y.Value()), |
| 75 | info.eyebrow_color = static_cast<u8>(bf.eyebrow_color.Value()); | 75 | .eyebrow_type = static_cast<u8>(bf.eyebrow_type.Value()), |
| 76 | info.eyebrow_scale = static_cast<u8>(bf.eyebrow_scale.Value()); | 76 | .eyebrow_color = static_cast<u8>(bf.eyebrow_color.Value()), |
| 77 | info.eyebrow_aspect = static_cast<u8>(bf.eyebrow_aspect.Value()); | 77 | .eyebrow_scale = static_cast<u8>(bf.eyebrow_scale.Value()), |
| 78 | info.eyebrow_rotate = static_cast<u8>(bf.eyebrow_rotate.Value()); | 78 | .eyebrow_aspect = static_cast<u8>(bf.eyebrow_aspect.Value()), |
| 79 | info.eyebrow_x = static_cast<u8>(bf.eyebrow_x.Value()); | 79 | .eyebrow_rotate = static_cast<u8>(bf.eyebrow_rotate.Value()), |
| 80 | info.eyebrow_y = static_cast<u8>(bf.eyebrow_y.Value() + 3); | 80 | .eyebrow_x = static_cast<u8>(bf.eyebrow_x.Value()), |
| 81 | info.nose_type = static_cast<u8>(bf.nose_type.Value()); | 81 | .eyebrow_y = static_cast<u8>(bf.eyebrow_y.Value() + 3), |
| 82 | info.nose_scale = static_cast<u8>(bf.nose_scale.Value()); | 82 | .nose_type = static_cast<u8>(bf.nose_type.Value()), |
| 83 | info.nose_y = static_cast<u8>(bf.nose_y.Value()); | 83 | .nose_scale = static_cast<u8>(bf.nose_scale.Value()), |
| 84 | info.mouth_type = static_cast<u8>(bf.mouth_type.Value()); | 84 | .nose_y = static_cast<u8>(bf.nose_y.Value()), |
| 85 | info.mouth_color = static_cast<u8>(bf.mouth_color.Value()); | 85 | .mouth_type = static_cast<u8>(bf.mouth_type.Value()), |
| 86 | info.mouth_scale = static_cast<u8>(bf.mouth_scale.Value()); | 86 | .mouth_color = static_cast<u8>(bf.mouth_color.Value()), |
| 87 | info.mouth_aspect = static_cast<u8>(bf.mouth_aspect.Value()); | 87 | .mouth_scale = static_cast<u8>(bf.mouth_scale.Value()), |
| 88 | info.mouth_y = static_cast<u8>(bf.mouth_y.Value()); | 88 | .mouth_aspect = static_cast<u8>(bf.mouth_aspect.Value()), |
| 89 | info.beard_color = static_cast<u8>(bf.beard_color.Value()); | 89 | .mouth_y = static_cast<u8>(bf.mouth_y.Value()), |
| 90 | info.beard_type = static_cast<u8>(bf.beard_type.Value()); | 90 | .beard_color = static_cast<u8>(bf.beard_color.Value()), |
| 91 | info.mustache_type = static_cast<u8>(bf.mustache_type.Value()); | 91 | .beard_type = static_cast<u8>(bf.beard_type.Value()), |
| 92 | info.mustache_scale = static_cast<u8>(bf.mustache_scale.Value()); | 92 | .mustache_type = static_cast<u8>(bf.mustache_type.Value()), |
| 93 | info.mustache_y = static_cast<u8>(bf.mustache_y.Value()); | 93 | .mustache_scale = static_cast<u8>(bf.mustache_scale.Value()), |
| 94 | info.glasses_type = static_cast<u8>(bf.glasses_type.Value()); | 94 | .mustache_y = static_cast<u8>(bf.mustache_y.Value()), |
| 95 | info.glasses_color = static_cast<u8>(bf.glasses_color.Value()); | 95 | .glasses_type = static_cast<u8>(bf.glasses_type.Value()), |
| 96 | info.glasses_scale = static_cast<u8>(bf.glasses_scale.Value()); | 96 | .glasses_color = static_cast<u8>(bf.glasses_color.Value()), |
| 97 | info.glasses_y = static_cast<u8>(bf.glasses_y.Value()); | 97 | .glasses_scale = static_cast<u8>(bf.glasses_scale.Value()), |
| 98 | info.mole_type = static_cast<u8>(bf.mole_type.Value()); | 98 | .glasses_y = static_cast<u8>(bf.glasses_y.Value()), |
| 99 | info.mole_scale = static_cast<u8>(bf.mole_scale.Value()); | 99 | .mole_type = static_cast<u8>(bf.mole_type.Value()), |
| 100 | info.mole_x = static_cast<u8>(bf.mole_x.Value()); | 100 | .mole_scale = static_cast<u8>(bf.mole_scale.Value()), |
| 101 | info.mole_y = static_cast<u8>(bf.mole_y.Value()); | 101 | .mole_x = static_cast<u8>(bf.mole_x.Value()), |
| 102 | return info; | 102 | .mole_y = static_cast<u8>(bf.mole_y.Value()), |
| 103 | }; | ||
| 103 | } | 104 | } |
| 104 | 105 | ||
| 105 | u16 GenerateCrc16(const void* data, std::size_t size) { | 106 | u16 GenerateCrc16(const void* data, std::size_t size) { |