From ddb26bed799845992b3223e7a276835874499379 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A9o=20Lam?= Date: Sun, 21 Mar 2021 16:00:31 +0100 Subject: [PATCH] ksys/chm: Add Shape --- data/uking_functions.csv | 26 ++++++++-------- src/KingSystem/CMakeLists.txt | 1 + src/KingSystem/Chemical/CMakeLists.txt | 4 +++ src/KingSystem/Chemical/chmShape.cpp | 15 ++++++++++ src/KingSystem/Chemical/chmShape.h | 41 ++++++++++++++++++++++++++ 5 files changed, 74 insertions(+), 13 deletions(-) create mode 100644 src/KingSystem/Chemical/CMakeLists.txt create mode 100644 src/KingSystem/Chemical/chmShape.cpp create mode 100644 src/KingSystem/Chemical/chmShape.h diff --git a/data/uking_functions.csv b/data/uking_functions.csv index f8499c8a..b0bd5217 100644 --- a/data/uking_functions.csv +++ b/data/uking_functions.csv @@ -97441,19 +97441,19 @@ 0x000000710131e0d8,sub_710131E0D8,64, 0x000000710131e118,sub_710131E118,124, 0x000000710131e194,cam::getLookAtCamera,40, -0x000000710131e1bc,sub_710131E1BC,848, -0x000000710131e50c,sub_710131E50C,88, -0x000000710131e564,sub_710131E564,84, -0x000000710131e5b8,j__ZdlPv_1363,4, -0x000000710131e5bc,sub_710131E5BC,8, -0x000000710131e5c4,sub_710131E5C4,8, -0x000000710131e5cc,sub_710131E5CC,8, -0x000000710131e5d4,sub_710131E5D4,8, -0x000000710131e5dc,sub_710131E5DC,8, -0x000000710131e5e4,sub_710131E5E4,8, -0x000000710131e5ec,sub_710131E5EC,8, -0x000000710131e5f4,sub_710131E5F4,8, -0x000000710131e5fc,sub_710131E5FC,8, +0x000000710131e1bc,sub_710131E1BC,848,_ZN4ksys3chm5ShapeC1Ev +0x000000710131e50c,sub_710131E50C,88,_ZN4ksys3chm5ShapeD1Ev +0x000000710131e564,sub_710131E564,84,_ZThn48_N4ksys3chm5ShapeD1Ev +0x000000710131e5b8,j__ZdlPv_1363,4,_ZN4ksys3chm5ShapeD0Ev +0x000000710131e5bc,sub_710131E5BC,8,_ZThn48_N4ksys3chm5ShapeD0Ev +0x000000710131e5c4,sub_710131E5C4,8,_ZNK4ksys3chm5Shape12getResTypeIdEv +0x000000710131e5cc,sub_710131E5CC,8,_ZNK4ksys3chm5Shape7getNameEv +0x000000710131e5d4,sub_710131E5D4,8,_ZNK4ksys3chm5Shape18getVolumeOccupancyEv +0x000000710131e5dc,sub_710131E5DC,8,_ZNK4ksys3chm5Shape19getElementOcclusionEv +0x000000710131e5e4,sub_710131E5E4,8,_ZThn520_NK4ksys3chm5Shape12getResTypeIdEv +0x000000710131e5ec,sub_710131E5EC,8,_ZThn520_NK4ksys3chm5Shape7getNameEv +0x000000710131e5f4,sub_710131E5F4,8,_ZThn520_NK4ksys3chm5Shape18getVolumeOccupancyEv +0x000000710131e5fc,sub_710131E5FC,8,_ZThn520_NK4ksys3chm5Shape19getElementOcclusionEv 0x000000710131e604,sub_710131E604,32, 0x000000710131e624,sub_710131E624,24, 0x000000710131e63c,_Z20MultimediaReallocatePvmS_,36, diff --git a/src/KingSystem/CMakeLists.txt b/src/KingSystem/CMakeLists.txt index 4b452fb9..8036f58e 100644 --- a/src/KingSystem/CMakeLists.txt +++ b/src/KingSystem/CMakeLists.txt @@ -3,6 +3,7 @@ add_subdirectory(GameData) add_subdirectory(Resource) add_subdirectory(ActorSystem) +add_subdirectory(Chemical) add_subdirectory(Cooking) add_subdirectory(Ecosystem) add_subdirectory(Event) diff --git a/src/KingSystem/Chemical/CMakeLists.txt b/src/KingSystem/Chemical/CMakeLists.txt new file mode 100644 index 00000000..5f7253dc --- /dev/null +++ b/src/KingSystem/Chemical/CMakeLists.txt @@ -0,0 +1,4 @@ +target_sources(uking PRIVATE + chmShape.cpp + chmShape.h +) diff --git a/src/KingSystem/Chemical/chmShape.cpp b/src/KingSystem/Chemical/chmShape.cpp new file mode 100644 index 00000000..9d782bfd --- /dev/null +++ b/src/KingSystem/Chemical/chmShape.cpp @@ -0,0 +1,15 @@ +#include "KingSystem/Chemical/chmShape.h" + +namespace ksys::chm { + +Shape::Shape() + : agl::utl::IParameterIO("chmshp", 0), name({"untitled"}, "name", "名前", this), + res_type_id({"----"}, "res_type_id", "マテリアルID", this), + volume_occupancy(1.0, "volume_occupancy", "体積占有率", "Min=0, Max=1", this), + element_occlusion(1.0, "element_occlusion", "エレメント遮蔽率", "Min=0, Max=1", this) { + addObj(this, "res_shape"); +} + +Shape::~Shape() = default; + +} // namespace ksys::chm diff --git a/src/KingSystem/Chemical/chmShape.h b/src/KingSystem/Chemical/chmShape.h new file mode 100644 index 00000000..731c8fe9 --- /dev/null +++ b/src/KingSystem/Chemical/chmShape.h @@ -0,0 +1,41 @@ +#pragma once + +#include +#include +#include +#include +#include +#include "KingSystem/Utils/Types.h" + +namespace ksys::chm { + +class IShape { +public: + virtual const sead::SafeString& getResTypeId() const = 0; + virtual const sead::SafeString& getName() const = 0; + virtual float getVolumeOccupancy() const = 0; + virtual float getElementOcclusion() const = 0; +}; + +class Shape : public agl::utl::IParameterObj, + public agl::utl::IParameterIO, + public sead::hostio::Node, + public IShape { +public: + Shape(); + ~Shape() override; + + const sead::SafeString& getResTypeId() const override { return res_type_id.ref(); } + const sead::SafeString& getName() const override { return name.ref(); } + float getVolumeOccupancy() const override { return volume_occupancy.ref(); } + float getElementOcclusion() const override { return element_occlusion.ref(); } + +private: + agl::utl::Parameter> name; + agl::utl::Parameter> res_type_id; + agl::utl::Parameter volume_occupancy; + agl::utl::Parameter element_occlusion; +}; +KSYS_CHECK_SIZE_NX150(Shape, 0x2f0); + +} // namespace ksys::chm