From 7f989378c057a4f76db661b0f095d6144b2be888 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Thu, 16 Jul 2020 20:43:56 -0400 Subject: mii/manager: Make use of designated initializers Allows returning the structure in a more concise manner. --- src/core/hle/service/mii/manager.cpp | 107 ++++++++++++++++++----------------- 1 file 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 ResizeArray(const std::array& i MiiInfo ConvertStoreDataToInfo(const MiiStoreData& data) { MiiStoreBitFields bf; std::memcpy(&bf, data.data.data.data(), sizeof(MiiStoreBitFields)); - MiiInfo info{}; - info.name = ResizeArray(data.data.name); - info.uuid = data.data.uuid; - info.font_region = static_cast(bf.font_region.Value()); - info.favorite_color = static_cast(bf.favorite_color.Value()); - info.gender = static_cast(bf.gender.Value()); - info.height = static_cast(bf.height.Value()); - info.build = static_cast(bf.build.Value()); - info.type = static_cast(bf.type.Value()); - info.region_move = static_cast(bf.region_move.Value()); - info.faceline_type = static_cast(bf.faceline_type.Value()); - info.faceline_color = static_cast(bf.faceline_color.Value()); - info.faceline_wrinkle = static_cast(bf.faceline_wrinkle.Value()); - info.faceline_make = static_cast(bf.faceline_makeup.Value()); - info.hair_type = static_cast(bf.hair_type.Value()); - info.hair_color = static_cast(bf.hair_color.Value()); - info.hair_flip = static_cast(bf.hair_flip.Value()); - info.eye_type = static_cast(bf.eye_type.Value()); - info.eye_color = static_cast(bf.eye_color.Value()); - info.eye_scale = static_cast(bf.eye_scale.Value()); - info.eye_aspect = static_cast(bf.eye_aspect.Value()); - info.eye_rotate = static_cast(bf.eye_rotate.Value()); - info.eye_x = static_cast(bf.eye_x.Value()); - info.eye_y = static_cast(bf.eye_y.Value()); - info.eyebrow_type = static_cast(bf.eyebrow_type.Value()); - info.eyebrow_color = static_cast(bf.eyebrow_color.Value()); - info.eyebrow_scale = static_cast(bf.eyebrow_scale.Value()); - info.eyebrow_aspect = static_cast(bf.eyebrow_aspect.Value()); - info.eyebrow_rotate = static_cast(bf.eyebrow_rotate.Value()); - info.eyebrow_x = static_cast(bf.eyebrow_x.Value()); - info.eyebrow_y = static_cast(bf.eyebrow_y.Value() + 3); - info.nose_type = static_cast(bf.nose_type.Value()); - info.nose_scale = static_cast(bf.nose_scale.Value()); - info.nose_y = static_cast(bf.nose_y.Value()); - info.mouth_type = static_cast(bf.mouth_type.Value()); - info.mouth_color = static_cast(bf.mouth_color.Value()); - info.mouth_scale = static_cast(bf.mouth_scale.Value()); - info.mouth_aspect = static_cast(bf.mouth_aspect.Value()); - info.mouth_y = static_cast(bf.mouth_y.Value()); - info.beard_color = static_cast(bf.beard_color.Value()); - info.beard_type = static_cast(bf.beard_type.Value()); - info.mustache_type = static_cast(bf.mustache_type.Value()); - info.mustache_scale = static_cast(bf.mustache_scale.Value()); - info.mustache_y = static_cast(bf.mustache_y.Value()); - info.glasses_type = static_cast(bf.glasses_type.Value()); - info.glasses_color = static_cast(bf.glasses_color.Value()); - info.glasses_scale = static_cast(bf.glasses_scale.Value()); - info.glasses_y = static_cast(bf.glasses_y.Value()); - info.mole_type = static_cast(bf.mole_type.Value()); - info.mole_scale = static_cast(bf.mole_scale.Value()); - info.mole_x = static_cast(bf.mole_x.Value()); - info.mole_y = static_cast(bf.mole_y.Value()); - return info; + + return { + .uuid = data.data.uuid, + .name = ResizeArray(data.data.name), + .font_region = static_cast(bf.font_region.Value()), + .favorite_color = static_cast(bf.favorite_color.Value()), + .gender = static_cast(bf.gender.Value()), + .height = static_cast(bf.height.Value()), + .build = static_cast(bf.build.Value()), + .type = static_cast(bf.type.Value()), + .region_move = static_cast(bf.region_move.Value()), + .faceline_type = static_cast(bf.faceline_type.Value()), + .faceline_color = static_cast(bf.faceline_color.Value()), + .faceline_wrinkle = static_cast(bf.faceline_wrinkle.Value()), + .faceline_make = static_cast(bf.faceline_makeup.Value()), + .hair_type = static_cast(bf.hair_type.Value()), + .hair_color = static_cast(bf.hair_color.Value()), + .hair_flip = static_cast(bf.hair_flip.Value()), + .eye_type = static_cast(bf.eye_type.Value()), + .eye_color = static_cast(bf.eye_color.Value()), + .eye_scale = static_cast(bf.eye_scale.Value()), + .eye_aspect = static_cast(bf.eye_aspect.Value()), + .eye_rotate = static_cast(bf.eye_rotate.Value()), + .eye_x = static_cast(bf.eye_x.Value()), + .eye_y = static_cast(bf.eye_y.Value()), + .eyebrow_type = static_cast(bf.eyebrow_type.Value()), + .eyebrow_color = static_cast(bf.eyebrow_color.Value()), + .eyebrow_scale = static_cast(bf.eyebrow_scale.Value()), + .eyebrow_aspect = static_cast(bf.eyebrow_aspect.Value()), + .eyebrow_rotate = static_cast(bf.eyebrow_rotate.Value()), + .eyebrow_x = static_cast(bf.eyebrow_x.Value()), + .eyebrow_y = static_cast(bf.eyebrow_y.Value() + 3), + .nose_type = static_cast(bf.nose_type.Value()), + .nose_scale = static_cast(bf.nose_scale.Value()), + .nose_y = static_cast(bf.nose_y.Value()), + .mouth_type = static_cast(bf.mouth_type.Value()), + .mouth_color = static_cast(bf.mouth_color.Value()), + .mouth_scale = static_cast(bf.mouth_scale.Value()), + .mouth_aspect = static_cast(bf.mouth_aspect.Value()), + .mouth_y = static_cast(bf.mouth_y.Value()), + .beard_color = static_cast(bf.beard_color.Value()), + .beard_type = static_cast(bf.beard_type.Value()), + .mustache_type = static_cast(bf.mustache_type.Value()), + .mustache_scale = static_cast(bf.mustache_scale.Value()), + .mustache_y = static_cast(bf.mustache_y.Value()), + .glasses_type = static_cast(bf.glasses_type.Value()), + .glasses_color = static_cast(bf.glasses_color.Value()), + .glasses_scale = static_cast(bf.glasses_scale.Value()), + .glasses_y = static_cast(bf.glasses_y.Value()), + .mole_type = static_cast(bf.mole_type.Value()), + .mole_scale = static_cast(bf.mole_scale.Value()), + .mole_x = static_cast(bf.mole_x.Value()), + .mole_y = static_cast(bf.mole_y.Value()), + }; } u16 GenerateCrc16(const void* data, std::size_t size) { -- cgit v1.2.3