diff --git a/CMakeLists.txt b/CMakeLists.txt index 9d15c79..b9856e3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -60,12 +60,21 @@ add_compile_definitions(MOD_ID=\"${MOD_ID}\") RECURSE_FILES(cpp_file_list ${SOURCE_DIR}/*.cpp) RECURSE_FILES(c_file_list ${SOURCE_DIR}/*.c) +# beatsaber-hook v6 inline hook sources (provide A64HookFunction) +set(INLINE_HOOK_DIR ${EXTERN_DIR}/includes/beatsaber-hook/shared/inline-hook) +set(inline_hook_sources + ${INLINE_HOOK_DIR}/And64InlineHook.cpp + ${INLINE_HOOK_DIR}/inlineHook.c + ${INLINE_HOOK_DIR}/relocate.c +) + # add all src files to compile add_library( ${COMPILE_ID} SHARED ${cpp_file_list} ${c_file_list} + ${inline_hook_sources} ) # Add any assets diff --git a/include/AssetLib/generators/avatarGenerator.hpp b/include/AssetLib/generators/avatarGenerator.hpp index d08dc21..46415c6 100644 --- a/include/AssetLib/generators/avatarGenerator.hpp +++ b/include/AssetLib/generators/avatarGenerator.hpp @@ -2,6 +2,11 @@ #include "AssetLib/VRMConcepts.hpp" +// Include System/String.hpp first to break circular include: HumanBone_impl -> IEquatable_1_def -> typedefs.h -> String.hpp -> IEquatable_1 (not yet declared) +#include "System/String.hpp" +// Ensure HumanBone/SkeletonBone are fully defined before Avatar.hpp triggers HumanDescription_impl +#include "UnityEngine/zzzz__HumanBone_impl.hpp" +#include "UnityEngine/zzzz__SkeletonBone_impl.hpp" #include "UnityEngine/Avatar.hpp" #include "UnityEngine/GameObject.hpp" diff --git a/include/AssetLib/shaders/ShaderSO.hpp b/include/AssetLib/shaders/ShaderSO.hpp index 1864902..8145cce 100644 --- a/include/AssetLib/shaders/ShaderSO.hpp +++ b/include/AssetLib/shaders/ShaderSO.hpp @@ -7,8 +7,8 @@ #include "UnityEngine/Material.hpp" #include "UnityEngine/GameObject.hpp" -DECLARE_CLASS_CODEGEN(VRMData, ShaderSO, UnityEngine::ScriptableObject, +DECLARE_CLASS_CODEGEN(VRMData, ShaderSO, UnityEngine::ScriptableObject) { DECLARE_INSTANCE_FIELD(UnityEngine::Shader*, mToonShader); DECLARE_INSTANCE_FIELD(UnityEngine::Shader*, mirrorShader); DECLARE_INSTANCE_FIELD(UnityEngine::Material*, shadowMaterial); -) \ No newline at end of file +}; \ No newline at end of file diff --git a/include/TPoseHelper.hpp b/include/TPoseHelper.hpp index d696e6b..449d793 100644 --- a/include/TPoseHelper.hpp +++ b/include/TPoseHelper.hpp @@ -1,6 +1,9 @@ #pragma once #include +// Ensure HumanBone/SkeletonBone are fully defined before Avatar.hpp triggers HumanDescription_impl +#include "UnityEngine/zzzz__HumanBone_impl.hpp" +#include "UnityEngine/zzzz__SkeletonBone_impl.hpp" #include "UnityEngine/Avatar.hpp" #include "UnityEngine/Transform.hpp" diff --git a/include/UI/AvatarsFlowCoordinator.hpp b/include/UI/AvatarsFlowCoordinator.hpp index 8f28c3a..5206950 100644 --- a/include/UI/AvatarsFlowCoordinator.hpp +++ b/include/UI/AvatarsFlowCoordinator.hpp @@ -12,7 +12,7 @@ using namespace VRMQavatars::UI; -DECLARE_CLASS_CODEGEN(VRMQavatars::UI::FlowCoordinators, AvatarsFlowCoordinator, HMUI::FlowCoordinator, +DECLARE_CLASS_CODEGEN(VRMQavatars::UI::FlowCoordinators, AvatarsFlowCoordinator, HMUI::FlowCoordinator) { DECLARE_INSTANCE_FIELD(ViewControllers::MirrorViewController*, MirrorViewController); DECLARE_INSTANCE_FIELD(ViewControllers::AvatarSettingsViewController*, AvatarSettingsViewController); DECLARE_INSTANCE_FIELD(ViewControllers::AvatarSelectionViewController*, AvatarSelectionViewController); @@ -21,4 +21,4 @@ DECLARE_CLASS_CODEGEN(VRMQavatars::UI::FlowCoordinators, AvatarsFlowCoordinator, DECLARE_OVERRIDE_METHOD(void, DidActivate, GET_FIND_METHOD(&HMUI::FlowCoordinator::DidActivate), bool firstActivation, bool addedToHeirarchy, bool screenSystemEnabling); DECLARE_OVERRIDE_METHOD(void, BackButtonWasPressed, GET_FIND_METHOD(&HMUI::FlowCoordinator::BackButtonWasPressed), HMUI::ViewController* topViewController); -) \ No newline at end of file +}; \ No newline at end of file diff --git a/include/config/config.hpp b/include/config/config.hpp index 258215a..9666578 100644 --- a/include/config/config.hpp +++ b/include/config/config.hpp @@ -1,7 +1,7 @@ #include "mini-config-utils.hpp" #include "utils/structs/OffsetPose.hpp" -DECLARE_JSON_CLASS(OffsetPoseConfig, +DECLARE_JSON_STRUCT(OffsetPoseConfig) { VALUE(float, posX); VALUE(float, posY); VALUE(float, posZ); @@ -33,9 +33,9 @@ DECLARE_JSON_CLASS(OffsetPoseConfig, } OffsetPoseConfig() = default; OffsetPoseConfig(float posX, float posY, float posZ, float rotX, float rotY, float rotZ) : posX(posX), posY(posY), posZ(posZ), rotX(rotX), rotY(rotY), rotZ(rotZ) {} -) +}; -DECLARE_JSON_CLASS(Color2, +DECLARE_JSON_STRUCT(Color2) { VALUE_DEFAULT(float, r, {}); VALUE_DEFAULT(float, g, {}); VALUE_DEFAULT(float, b, {}); @@ -59,9 +59,9 @@ DECLARE_JSON_CLASS(Color2, { return UnityEngine::Color(r, g, b, a); } -) +}; -DECLARE_JSON_CLASS(VectorThree, +DECLARE_JSON_STRUCT(VectorThree) { VALUE_DEFAULT(float, x, {}); VALUE_DEFAULT(float, y, {}); VALUE_DEFAULT(float, z, {}); @@ -92,9 +92,9 @@ DECLARE_JSON_CLASS(VectorThree, { return Sombrero::FastVector3(x, y, z); } -) +}; -DECLARE_JSON_CLASS(ControllerTriggerSettings, +DECLARE_JSON_STRUCT(ControllerTriggerSettings) { VALUE_DEFAULT(std::string, A, "None"); VALUE_DEFAULT(std::string, B, "None"); VALUE_DEFAULT(std::string, X, "None"); @@ -104,16 +104,16 @@ DECLARE_JSON_CLASS(ControllerTriggerSettings, VALUE_DEFAULT(std::string, RGrip, "None"); VALUE_DEFAULT(std::string, LTrigger, "None"); VALUE_DEFAULT(std::string, RTrigger, "None"); -) +}; -DECLARE_JSON_CLASS(BlendshapeSettings, +DECLARE_JSON_STRUCT(BlendshapeSettings) { VALUE_DEFAULT(bool, autoBlink, true); VALUE_DEFAULT(float, waitTime, 2.0f); VALUE_DEFAULT(bool, mockEyeMovement, true); VALUE_DEFAULT(std::string, neutralExpression, "Neutral"); -) +}; -DECLARE_JSON_CLASS(LightingSettings, +DECLARE_JSON_STRUCT(LightingSettings) { VALUE_DEFAULT(Color2, globalColor, Color2(1.0f, 1.0f, 1.0f, 1.0f)); VALUE_DEFAULT(float, globalLightIntensity, 1.0f); VALUE_DEFAULT(VectorThree, lightRotation, UnityEngine::Vector3(30.0f, 240.0f, 0.0f)); @@ -121,31 +121,31 @@ DECLARE_JSON_CLASS(LightingSettings, VALUE_DEFAULT(float, beatmapLightingColorIntensity, 0.25f); VALUE_DEFAULT(float, beatmapLightingBrightness, 0.5f); VALUE_DEFAULT(float, beatmapLightingMinimumBrightness, 0.75f); -) +}; -DECLARE_JSON_CLASS(LocomotionSettings, +DECLARE_JSON_STRUCT(LocomotionSettings) { VALUE_DEFAULT(float, footDistance, 0.1f); VALUE_DEFAULT(float, stepThreshold, 0.1f); VALUE_DEFAULT(VectorThree, stepOffset, UnityEngine::Vector3(0.0f, 0.0f, 0.0f)); -) +}; -DECLARE_JSON_CLASS(IKSettings, +DECLARE_JSON_STRUCT(IKSettings) { VALUE_DEFAULT(float, legSwivel, 0.0f); VALUE_DEFAULT(float, armSwivel, 0.0f); VALUE_DEFAULT(float, bodyStiffness, 0.75f); VALUE_DEFAULT(float, shoulderRotationWeight, 1.0f); VALUE_DEFAULT(float, groundOffset, 0.0f); -) +}; -DECLARE_JSON_CLASS(OffsetSettings, +DECLARE_JSON_STRUCT(OffsetSettings) { VALUE_DEFAULT(OffsetPoseConfig, handOffset, OffsetPoseConfig(0.07f, 0.02f, -0.03f, -55.0f, 0.0f, 90.0f)); -) +}; -DECLARE_JSON_CLASS(FingerPoseSettings, +DECLARE_JSON_STRUCT(FingerPoseSettings) { VALUE_DEFAULT(std::string, grabPose, "-36,-43,-74,0,-66,-66,-74,0,-56,-73,-70,0,-46,-90,-51,0,-77,-47,-20,19"); -) +}; -DECLARE_JSON_CLASS(VMCSettings, +DECLARE_JSON_STRUCT(VMCSettings) { VALUE_DEFAULT(bool, enableSender, false); VALUE_DEFAULT(std::string, destIP, "127.0.0.1"); VALUE_DEFAULT(std::string, destPort, "39540"); @@ -160,9 +160,9 @@ DECLARE_JSON_CLASS(VMCSettings, VALUE_DEFAULT(std::string, rightFoot, "None"); VALUE_DEFAULT(std::string, leftKnee, "None"); VALUE_DEFAULT(std::string, rightKnee, "None"); -) +}; -DECLARE_JSON_CLASS(MirrorSettings, +DECLARE_JSON_STRUCT(MirrorSettings) { VALUE_DEFAULT(bool, enabled, true); VALUE_DEFAULT(VectorThree, position, VectorThree(0, 1.5f, 2)); VALUE_DEFAULT(VectorThree, rotation, VectorThree(15.0f, 180, 0)); @@ -177,13 +177,13 @@ DECLARE_JSON_CLASS(MirrorSettings, VALUE_DEFAULT(float, nearClip, 1.0f); VALUE_DEFAULT(Color2, borderColor, Color2(1.0f, 1.0f, 1.0f, 1.0f)); VALUE_DEFAULT(bool, showHandle, true); -) +}; -DECLARE_JSON_CLASS(WindSettings, +DECLARE_JSON_STRUCT(WindSettings) { VALUE_DEFAULT(bool, enabled, true); VALUE_DEFAULT(float, windStrength, 1.0f); VALUE_DEFAULT(float, timeFactor, 1.0f); -) +}; //Access Global through ConfigManager::GetGlobal //Access Avatar through ConfigManager::GetAvatar diff --git a/include/config/mini-config-utils.hpp b/include/config/mini-config-utils.hpp index 3a6bc34..1de7cf5 100644 --- a/include/config/mini-config-utils.hpp +++ b/include/config/mini-config-utils.hpp @@ -4,8 +4,7 @@ #include "rapidjson-macros/shared/macros.hpp" #define DECLARE_CONFIG(name, ...) \ -DECLARE_JSON_CLASS(name##_t, \ - DISCARD_EXTRA_FIELDS \ +DECLARE_JSON_STRUCT(name##_t) { \ __VA_ARGS__ \ public: \ static inline std::string __config_path = ""; \ @@ -36,14 +35,14 @@ DECLARE_JSON_CLASS(name##_t, \ ConfigUtils::Logger.error("Error saving config: {} (to {})", err.what(), __config_path.c_str()); \ } \ } \ -) \ +}; \ inline name##_t& get##name() { \ return name##_t::GetInstance(); \ } #define CONFIG_VALUE(name, type, jsonName, def, ...) \ private: \ -NAMED_VALUE_DEFAULT(ConfigUtils::Specialization::JSONType, __##name, def, jsonName) \ +NAMED_VALUE_DEFAULT(ConfigUtils::Specialization::JSONType, __##name, def, jsonName); \ public: \ ConfigUtils::ConfigValue name = {&this->Save, &__##name, jsonName, def __VA_OPT__(,) __VA_ARGS__}; @@ -141,54 +140,54 @@ clazz(const UnityEngine::clazz& other) { construct; } \ clazz& operator=(const UnityEngine::clazz& other) { construct; return *this; } \ operator UnityEngine::clazz() const { return UnityEngine::clazz convert; } -DECLARE_JSON_CLASS(Vector2, - VALUE(float, x) - VALUE(float, y) +DECLARE_JSON_STRUCT(Vector2) { + VALUE(float, x); + VALUE(float, y); CONVERSION(Vector2, x = other.x; y = other.y;, (x, y) ) Vector2() = default; Vector2(float x, float y) : x(x), y(y) {} -) +}; -DECLARE_JSON_CLASS(Vector3, - VALUE(float, x) - VALUE(float, y) - VALUE(float, z) +DECLARE_JSON_STRUCT(Vector3) { + VALUE(float, x); + VALUE(float, y); + VALUE(float, z); CONVERSION(Vector3, x = other.x; y = other.y; z = other.z;, (x, y, z) ) Vector3() = default; Vector3(float x, float y, float z) : x(x), y(y), z(z) {} -) +}; -DECLARE_JSON_CLASS(Vector4, - VALUE(float, x) - VALUE(float, y) - VALUE(float, z) - VALUE(float, w) +DECLARE_JSON_STRUCT(Vector4) { + VALUE(float, x); + VALUE(float, y); + VALUE(float, z); + VALUE(float, w); CONVERSION(Vector4, x = other.x; y = other.y; z = other.z; w = other.w;, (x, y, z, w) ) Vector4() = default; Vector4(float x, float y, float z, float w) : x(x), y(y), z(z), w(w) {} -) +}; -DECLARE_JSON_CLASS(Color, - VALUE(float, r) - VALUE(float, g) - VALUE(float, b) - VALUE(float, a) +DECLARE_JSON_STRUCT(Color) { + VALUE(float, r); + VALUE(float, g); + VALUE(float, b); + VALUE(float, a); CONVERSION(Color, r = other.r; g = other.g; b = other.b; a = other.a;, (r, g, b, a) ) Color() = default; Color(float r, float g, float b, float a) : r(r), g(g), b(b), a(a) {} -) +}; #pragma endregion diff --git a/include/customTypes/Installers/MenuInstaller.hpp b/include/customTypes/Installers/MenuInstaller.hpp index daeb40e..2b20313 100644 --- a/include/customTypes/Installers/MenuInstaller.hpp +++ b/include/customTypes/Installers/MenuInstaller.hpp @@ -6,7 +6,7 @@ #include "custom-types/shared/macros.hpp" #include "lapiz/shared/macros.hpp" -DECLARE_CLASS_CODEGEN(VRMQavatars, MenuInstaller, ::Zenject::Installer, +DECLARE_CLASS_CODEGEN(VRMQavatars, MenuInstaller, ::Zenject::Installer) { DECLARE_OVERRIDE_METHOD(void, InstallBindings, il2cpp_utils::il2cpp_type_check::MetadataGetter<&Zenject::Installer::InstallBindings>::methodInfo()); DECLARE_DEFAULT_CTOR(); -) \ No newline at end of file +}; \ No newline at end of file diff --git a/include/customTypes/VRMSpringBone.hpp b/include/customTypes/VRMSpringBone.hpp index e1bf4dc..4393fa1 100644 --- a/include/customTypes/VRMSpringBone.hpp +++ b/include/customTypes/VRMSpringBone.hpp @@ -19,7 +19,7 @@ #include "sombrero/shared/FastQuaternion.hpp" -DECLARE_CLASS_CODEGEN(VRMQavatars, VRMSpringBone, UnityEngine::MonoBehaviour, +DECLARE_CLASS_CODEGEN(VRMQavatars, VRMSpringBone, UnityEngine::MonoBehaviour) { DECLARE_INSTANCE_METHOD(void, Awake); DECLARE_INSTANCE_METHOD(ArrayW, GetChildren, UnityEngine::Transform* parent); DECLARE_INSTANCE_METHOD(void, FixedUpdate); @@ -42,4 +42,4 @@ DECLARE_CLASS_CODEGEN(VRMQavatars, VRMSpringBone, UnityEngine::MonoBehaviour, std::vector verlet; std::vector colliderGroups; std::map initialLocalRotationMap; -) \ No newline at end of file +}; \ No newline at end of file diff --git a/include/customTypes/VRMSpringBoneColliderGroup.hpp b/include/customTypes/VRMSpringBoneColliderGroup.hpp index 0088944..a5888f0 100644 --- a/include/customTypes/VRMSpringBoneColliderGroup.hpp +++ b/include/customTypes/VRMSpringBoneColliderGroup.hpp @@ -10,7 +10,7 @@ #include -DECLARE_CLASS_CODEGEN(VRMQavatars, VRMSpringBoneColliderGroup, UnityEngine::MonoBehaviour, +DECLARE_CLASS_CODEGEN(VRMQavatars, VRMSpringBoneColliderGroup, UnityEngine::MonoBehaviour) { public: std::vector colliders; -) \ No newline at end of file +}; \ No newline at end of file diff --git a/mod.template.json b/mod.template.json index bd459d5..931963c 100644 --- a/mod.template.json +++ b/mod.template.json @@ -6,7 +6,7 @@ "author": "FutureMapper", "version": "1.0.1", "packageId": "com.beatgames.beatsaber", - "packageVersion": "1.28.0_4124311467", + "packageVersion": "1.40.8_7379", "description": "A VRM based Custom Avatar mod for Beat Saber", "dependencies": [], "modFiles": [], diff --git a/qpm.json b/qpm.json index 1911e17..b9e004b 100644 --- a/qpm.json +++ b/qpm.json @@ -1,11 +1,12 @@ { + "$schema": "https://raw.githubusercontent.com/QuestPackageManager/QPM.Package/refs/heads/main/qpm.schema.json", "version": "0.1.0", "sharedDir": "shared", "dependenciesDir": "extern", "info": { "name": "VRM Qavatars", "id": "vrm-qavatars", - "version": "1.0.0", + "version": "1.0.1", "url": null, "additionalData": { "overrideSoName": "libvrm-qavatars.so", @@ -37,6 +38,7 @@ "pwsh ./scripts/pull-tombstone.ps1" ] }, + "ndk": "^27.3.13750724", "qmodIncludeDirs": [], "qmodIncludeFiles": [], "qmodOutput": null @@ -44,22 +46,22 @@ "dependencies": [ { "id": "beatsaber-hook", - "versionRange": "^5.1.6", + "versionRange": "^6.4.2", "additionalData": {} }, { "id": "scotland2", - "versionRange": "^0.1.4", + "versionRange": "^0.1.6", "additionalData": {} }, { "id": "bs-cordl", - "versionRange": "^3601.0.0", + "versionRange": "^4008.0.0", "additionalData": {} }, { "id": "custom-types", - "versionRange": "^0.17.0", + "versionRange": "^0.18.3", "additionalData": {} }, { @@ -69,7 +71,12 @@ }, { "id": "bsml", - "versionRange": "^0.4.0", + "versionRange": "^0.4.55", + "additionalData": {} + }, + { + "id": "gif-lib", + "versionRange": "^5.2.2", "additionalData": {} }, { @@ -79,22 +86,22 @@ }, { "id": "fmt", - "versionRange": "*", + "versionRange": "^11.0.2", "additionalData": {} }, { "id": "sombrero", - "versionRange": "*", + "versionRange": "^0.1.43", "additionalData": {} }, { "id": "chatplex-sdk-bs", - "versionRange": "*", + "versionRange": "^6.4.1", "additionalData": {} }, { "id": "rapidjson-macros", - "versionRange": "*", + "versionRange": "^3.0.0", "additionalData": {} }, { @@ -103,13 +110,13 @@ "additionalData": {} }, { - "id": "paper", - "versionRange": "^3.6.3", + "id": "paper2_scotland2", + "versionRange": "^4.6.4", "additionalData": {} }, { "id": "lapiz", - "versionRange": "^0.2.9", + "versionRange": "^0.2.23", "additionalData": {} } ] diff --git a/qpm.shared.json b/qpm.shared.json index 9e77357..55f72d1 100644 --- a/qpm.shared.json +++ b/qpm.shared.json @@ -1,4 +1,5 @@ { + "$schema": "https://raw.githubusercontent.com/QuestPackageManager/QPM.Package/refs/heads/main/qpm.shared.schema.json", "config": { "version": "0.1.0", "sharedDir": "shared", @@ -45,22 +46,22 @@ "dependencies": [ { "id": "beatsaber-hook", - "versionRange": "^5.1.6", + "versionRange": "^6.4.2", "additionalData": {} }, { "id": "scotland2", - "versionRange": "^0.1.4", + "versionRange": "^0.1.6", "additionalData": {} }, { "id": "bs-cordl", - "versionRange": "^3601.0.0", + "versionRange": "^4008.0.0", "additionalData": {} }, { "id": "custom-types", - "versionRange": "^0.17.0", + "versionRange": "^0.18.3", "additionalData": {} }, { @@ -70,7 +71,12 @@ }, { "id": "bsml", - "versionRange": "^0.4.0", + "versionRange": "^0.4.55", + "additionalData": {} + }, + { + "id": "gif-lib", + "versionRange": "^5.2.2", "additionalData": {} }, { @@ -80,17 +86,17 @@ }, { "id": "fmt", - "versionRange": "*", + "versionRange": "^11.0.2", "additionalData": {} }, { "id": "sombrero", - "versionRange": "*", + "versionRange": "^0.1.43", "additionalData": {} }, { "id": "chatplex-sdk-bs", - "versionRange": "*", + "versionRange": "^6.4.1", "additionalData": {} }, { @@ -104,13 +110,13 @@ "additionalData": {} }, { - "id": "paper", - "versionRange": "^3.6.3", + "id": "paper2_scotland2", + "versionRange": "^4.6.4", "additionalData": {} }, { "id": "lapiz", - "versionRange": "^0.2.9", + "versionRange": "^0.2.23", "additionalData": {} } ] @@ -118,89 +124,130 @@ "restoredDependencies": [ { "dependency": { - "id": "bsml", - "versionRange": "=0.4.26", + "id": "sombrero", + "versionRange": "=0.1.43", "additionalData": { - "soLink": "https://github.com/RedBrumbler/Quest-BSML/releases/download/v0.4.26/libbsml.so", - "debugSoLink": "https://github.com/RedBrumbler/Quest-BSML/releases/download/v0.4.26/debug_libbsml.so", - "overrideSoName": "libbsml.so", - "modLink": "https://github.com/RedBrumbler/Quest-BSML/releases/download/v0.4.26/BSML.qmod", - "branchName": "version/v0_4_26", - "cmake": true + "headersOnly": true, + "branchName": "version/v0_1_43" } }, - "version": "0.4.26" + "version": "0.1.43" }, { "dependency": { - "id": "rapidjson-macros", - "versionRange": "=1.2.1", + "id": "bs-cordl", + "versionRange": "=4008.0.0", "additionalData": { "headersOnly": true, - "branchName": "version/v1_2_1", - "cmake": true + "branchName": "version/v4008_0_0", + "compileOptions": { + "includePaths": [ + "include" + ], + "cppFeatures": [], + "cppFlags": [ + "-DNEED_UNSAFE_CSHARP", + "-fdeclspec", + "-DUNITY_2021", + "-DHAS_CODEGEN", + "-Wno-invalid-offsetof" + ] + } } }, - "version": "1.2.1" + "version": "4008.0.0" }, { "dependency": { - "id": "libil2cpp", - "versionRange": "=0.3.1", + "id": "lapiz", + "versionRange": "=0.2.23", "additionalData": { - "headersOnly": true + "soLink": "https://github.com/raineaeternal/Lapiz/releases/download/v0.2.23/liblapiz.so", + "debugSoLink": "https://github.com/raineaeternal/Lapiz/releases/download/v0.2.23/debug_liblapiz.so", + "overrideSoName": "liblapiz.so", + "modLink": "https://github.com/raineaeternal/Lapiz/releases/download/v0.2.23/Lapiz.qmod", + "branchName": "version/v0_2_23", + "cmake": true } }, - "version": "0.3.1" + "version": "0.2.23" }, { "dependency": { - "id": "chatplex-sdk-bs", - "versionRange": "=6.2.1", + "id": "tinyxml2", + "versionRange": "=10.0.0", "additionalData": { - "overrideSoName": "libchatplex-sdk-bs.so", + "soLink": "https://github.com/MillzyDev/NDK-tinyxml2/releases/download/v10.0.0/libtinyxml2.so", + "debugSoLink": "https://github.com/MillzyDev/NDK-tinyxml2/releases/download/v10.0.0/debug_libtinyxml2.so", + "overrideSoName": "libtinyxml2.so", + "modLink": "https://github.com/MillzyDev/NDK-tinyxml2/releases/download/v10.0.0/tinyxml2.qmod", + "branchName": "version/v10_0_0", "cmake": true } }, - "version": "6.2.1" + "version": "10.0.0" }, { "dependency": { - "id": "sombrero", - "versionRange": "=0.1.40", + "id": "gif-lib", + "versionRange": "=5.2.2", + "additionalData": { + "staticLinking": true, + "soLink": "https://github.com/RedBrumbler/gif-lib-QPM/releases/download/v5.2.2/libgif-lib.a", + "debugSoLink": "https://github.com/RedBrumbler/gif-lib-QPM/releases/download/v5.2.2/debug_libgif-lib.a", + "overrideSoName": "libgif-lib.a", + "branchName": "version-v5.2.2" + } + }, + "version": "5.2.2" + }, + { + "dependency": { + "id": "fmt", + "versionRange": "=11.0.2", "additionalData": { "headersOnly": true, - "branchName": "version/v0_1_40" + "branchName": "version/v11_0_2", + "compileOptions": { + "systemIncludes": [ + "fmt/include/" + ], + "cppFlags": [ + "-DFMT_HEADER_ONLY" + ] + } } }, - "version": "0.1.40" + "version": "11.0.2" }, { "dependency": { - "id": "conditional-dependencies", - "versionRange": "=0.3.0", + "id": "libil2cpp", + "versionRange": "=0.4.0", "additionalData": { "headersOnly": true, - "branchName": "version/v0_3_0", - "cmake": false + "compileOptions": { + "systemIncludes": [ + "il2cpp/external/baselib/Include", + "il2cpp/external/baselib/Platforms/Android/Include" + ] + } } }, - "version": "0.3.0" + "version": "0.4.0" }, { "dependency": { - "id": "tinyxml2", - "versionRange": "=10.0.0", + "id": "scotland2", + "versionRange": "=0.1.7", "additionalData": { - "soLink": "https://github.com/MillzyDev/NDK-tinyxml2/releases/download/v10.0.0/libtinyxml2.so", - "debugSoLink": "https://github.com/MillzyDev/NDK-tinyxml2/releases/download/v10.0.0/debug_libtinyxml2.so", - "overrideSoName": "libtinyxml2.so", - "modLink": "https://github.com/MillzyDev/NDK-tinyxml2/releases/download/v10.0.0/tinyxml2.qmod", - "branchName": "version/v10_0_0", - "cmake": true + "soLink": "https://github.com/sc2ad/scotland2/releases/download/v0.1.7/libsl2.so", + "debugSoLink": "https://github.com/sc2ad/scotland2/releases/download/v0.1.7/debug_libsl2.so", + "overrideSoName": "libsl2.so", + "branchName": "version/v0_1_7" } }, - "version": "10.0.0" + "version": "0.1.7" }, { "dependency": { @@ -221,66 +268,66 @@ }, { "dependency": { - "id": "paper", - "versionRange": "=3.6.3", + "id": "custom-types", + "versionRange": "=0.18.4", "additionalData": { - "soLink": "https://github.com/Fernthedev/paperlog/releases/download/v3.6.3/libpaperlog.so", - "debugSoLink": "https://github.com/Fernthedev/paperlog/releases/download/v3.6.3/debug_libpaperlog.so", - "overrideSoName": "libpaperlog.so", - "modLink": "https://github.com/Fernthedev/paperlog/releases/download/v3.6.3/paperlog.qmod", - "branchName": "version/v3_6_3", + "soLink": "https://github.com/QuestPackageManager/Il2CppQuestTypePatching/releases/download/v0.18.4/libcustom-types.so", + "debugSoLink": "https://github.com/QuestPackageManager/Il2CppQuestTypePatching/releases/download/v0.18.4/debug_libcustom-types.so", + "overrideSoName": "libcustom-types.so", + "modLink": "https://github.com/QuestPackageManager/Il2CppQuestTypePatching/releases/download/v0.18.4/CustomTypes.qmod", + "branchName": "version/v0_18_4", "compileOptions": { - "systemIncludes": [ - "shared/utfcpp/source" + "cppFlags": [ + "-Wno-invalid-offsetof" ] }, + "cmake": true + } + }, + "version": "0.18.4" + }, + { + "dependency": { + "id": "rapidjson-macros", + "versionRange": "=3.0.0", + "additionalData": { + "headersOnly": true, + "branchName": "version/v3_0_0", "cmake": false } }, - "version": "3.6.3" + "version": "3.0.0" }, { "dependency": { - "id": "custom-types", - "versionRange": "=0.17.7", + "id": "paper2_scotland2", + "versionRange": "=4.7.0", "additionalData": { - "soLink": "https://github.com/QuestPackageManager/Il2CppQuestTypePatching/releases/download/v0.17.7/libcustom-types.so", - "debugSoLink": "https://github.com/QuestPackageManager/Il2CppQuestTypePatching/releases/download/v0.17.7/debug_libcustom-types.so", - "overrideSoName": "libcustom-types.so", - "modLink": "https://github.com/QuestPackageManager/Il2CppQuestTypePatching/releases/download/v0.17.7/CustomTypes.qmod", - "branchName": "version/v0_17_7", + "soLink": "https://github.com/Fernthedev/paperlog/releases/download/v4.7.0/libpaper2_scotland2.so", + "overrideSoName": "libpaper2_scotland2.so", + "modLink": "https://github.com/Fernthedev/paperlog/releases/download/v4.7.0/paper2_scotland2.qmod", + "branchName": "version/v4_7_0", "compileOptions": { - "cppFlags": [ - "-Wno-invalid-offsetof" + "systemIncludes": [ + "shared/utfcpp/source" ] }, - "cmake": true + "cmake": false } }, - "version": "0.17.7" + "version": "4.7.0" }, { "dependency": { - "id": "bs-cordl", - "versionRange": "=3601.0.0", + "id": "conditional-dependencies", + "versionRange": "=0.3.0", "additionalData": { "headersOnly": true, - "branchName": "version/v3601_0_0", - "compileOptions": { - "includePaths": [ - "include" - ], - "cppFeatures": [], - "cppFlags": [ - "-DNEED_UNSAFE_CSHARP", - "-fdeclspec", - "-DUNITY_2021", - "-DHAS_CODEGEN" - ] - } + "branchName": "version/v0_3_0", + "cmake": false } }, - "version": "3601.0.0" + "version": "0.3.0" }, { "dependency": { @@ -301,63 +348,66 @@ }, { "dependency": { - "id": "lapiz", - "versionRange": "=0.2.9", + "id": "libcurl", + "versionRange": "=8.5.0", "additionalData": { - "soLink": "https://github.com/raineio/Lapiz/releases/download/v0.2.9/liblapiz.so", - "debugSoLink": "https://github.com/raineio/Lapiz/releases/download/v0.2.9/debug_liblapiz.so", - "overrideSoName": "liblapiz.so", - "modLink": "https://github.com/raineio/Lapiz/releases/download/v0.2.9/Lapiz.qmod", - "branchName": "version/v0_2_9", - "cmake": true + "staticLinking": true, + "soLink": "https://github.com/darknight1050/openssl-curl-android/releases/download/v8.5.0/libcurl.a", + "overrideSoName": "libcurl.a", + "branchName": "version-v8.5.0" } }, - "version": "0.2.9" + "version": "8.5.0" }, { "dependency": { "id": "beatsaber-hook", - "versionRange": "=5.1.6", + "versionRange": "=6.4.2", "additionalData": { - "soLink": "https://github.com/QuestPackageManager/beatsaber-hook/releases/download/v5.1.6/libbeatsaber-hook_5_1_6.so", - "debugSoLink": "https://github.com/QuestPackageManager/beatsaber-hook/releases/download/v5.1.6/debug_libbeatsaber-hook_5_1_6.so", - "branchName": "version/v5_1_6", + "soLink": "https://github.com/QuestPackageManager/beatsaber-hook/releases/download/v6.4.2/libbeatsaber-hook.so", + "debugSoLink": "https://github.com/QuestPackageManager/beatsaber-hook/releases/download/v6.4.2/debug_libbeatsaber-hook.so", + "overrideSoName": "libbeatsaber-hook.so", + "modLink": "https://github.com/QuestPackageManager/beatsaber-hook/releases/download/v6.4.2/beatsaber-hook.qmod", + "branchName": "version/v6_4_2", + "compileOptions": { + "cppFlags": [ + "-Wno-extra-qualification" + ] + }, "cmake": true } }, - "version": "5.1.6" + "version": "6.4.2" }, { "dependency": { - "id": "fmt", - "versionRange": "=10.0.0", + "id": "bsml", + "versionRange": "=0.4.55", "additionalData": { - "headersOnly": true, - "branchName": "version/v10_0_0", - "compileOptions": { - "systemIncludes": [ - "fmt/include/" - ], - "cppFlags": [ - "-DFMT_HEADER_ONLY" - ] - } + "soLink": "https://github.com/bsq-ports/Quest-BSML/releases/download/v0.4.55/libbsml.so", + "debugSoLink": "https://github.com/bsq-ports/Quest-BSML/releases/download/v0.4.55/debug_libbsml.so", + "overrideSoName": "libbsml.so", + "modLink": "https://github.com/bsq-ports/Quest-BSML/releases/download/v0.4.55/BSML.qmod", + "branchName": "version/v0_4_55", + "cmake": true } }, - "version": "10.0.0" + "version": "0.4.55" }, { "dependency": { - "id": "scotland2", - "versionRange": "=0.1.4", + "id": "chatplex-sdk-bs", + "versionRange": "=6.4.1", "additionalData": { - "soLink": "https://github.com/sc2ad/scotland2/releases/download/v0.1.4/libsl2.so", - "debugSoLink": "https://github.com/sc2ad/scotland2/releases/download/v0.1.4/debug_libsl2.so", - "overrideSoName": "libsl2.so", - "branchName": "version/v0_1_4" + "soLink": "https://github.com/hardcpp/QuestChatPlexSDK-BS/releases/download/v6.4.1/libchatplex-sdk-bs.so", + "debugSoLink": "https://github.com/hardcpp/QuestChatPlexSDK-BS/releases/download/v6.4.1/debug_libchatplex-sdk-bs.so", + "overrideSoName": "libchatplex-sdk-bs.so", + "modLink": "https://github.com/hardcpp/QuestChatPlexSDK-BS/releases/download/v6.4.1/ChatPlexSDK-BS.qmod", + "branchName": "version/v6_4_1", + "cmake": true } }, - "version": "0.1.4" + "version": "6.4.1" } ] } \ No newline at end of file diff --git a/scripts/build.ps1 b/scripts/build.ps1 index fe746c3..1e44b0c 100644 --- a/scripts/build.ps1 +++ b/scripts/build.ps1 @@ -18,7 +18,7 @@ if ($help -eq $true) { # if user specified clean, remove all build files if ($clean.IsPresent) { if (Test-Path -Path "build") { - remove-item build -R + remove-item build -R -Force } } @@ -29,3 +29,4 @@ if (($clean.IsPresent) -or (-not (Test-Path -Path "build"))) { & cmake -G "Ninja" -DCMAKE_BUILD_TYPE="RelWithDebInfo" -B build & cmake --build ./build +exit $LASTEXITCODE diff --git a/scripts/copy.ps1 b/scripts/copy.ps1 index 02c419c..50351a7 100644 --- a/scripts/copy.ps1 +++ b/scripts/copy.ps1 @@ -56,9 +56,9 @@ $modFiles = $modJson.modFiles foreach ($fileName in $modFiles) { if ($useDebug -eq $true) { - & adb push build/debug/$fileName /sdcard/ModData/com.beatgames.beatsaber/ModLoader/early_mods/$fileName + & adb push build/debug/$fileName /sdcard/ModData/com.beatgames.beatsaber/Modloader/early_mods/$fileName } else { - & adb push build/$fileName /sdcard/ModData/com.beatgames.beatsaber/ModLoader/early_mods/$fileName + & adb push build/$fileName /sdcard/ModData/com.beatgames.beatsaber/Modloader/early_mods/$fileName } } @@ -66,9 +66,9 @@ $lateModFiles = $modJson.lateModFiles foreach ($fileName in $lateModFiles) { if ($useDebug -eq $true) { - & adb push build/debug/$fileName /sdcard/ModData/com.beatgames.beatsaber/ModLoader/mods/$fileName + & adb push build/debug/$fileName /sdcard/ModData/com.beatgames.beatsaber/Modloader/mods/$fileName } else { - & adb push build/$fileName /sdcard/ModData/com.beatgames.beatsaber/ModLoader/mods/$fileName + & adb push build/$fileName /sdcard/ModData/com.beatgames.beatsaber/Modloader/mods/$fileName } } diff --git a/scripts/createqmod.ps1 b/scripts/createqmod.ps1 index acc1187..57fa169 100644 --- a/scripts/createqmod.ps1 +++ b/scripts/createqmod.ps1 @@ -21,7 +21,6 @@ $mod = "./mod.json" if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE } - $modJson = Get-Content $mod -Raw | ConvertFrom-Json if ($qmodName -eq "") { @@ -47,6 +46,19 @@ foreach ($mod in $modJson.modFiles) { $filelist += $path } +foreach ($mod in $modJson.lateModFiles) { + $path = "./build/" + $mod + if (-not (Test-Path $path)) { + $path = "./extern/libs/" + $mod + } + if (-not (Test-Path $path)) { + Write-Output "Error: could not find dependency: $path" + exit 1 + } + $filelist += $path +} + + foreach ($lib in $modJson.libraryFiles) { $path = "./build/" + $lib if (-not (Test-Path $path)) { @@ -62,10 +74,10 @@ foreach ($lib in $modJson.libraryFiles) { $filelist += $path } -$filelist += "./shaders.sbund"; +$filelist += "./shaders.sbund" $zip = $qmodName + ".zip" $qmod = $qmodName + ".qmod" Compress-Archive -Path $filelist -DestinationPath $zip -Update -Move-Item $zip $qmod -Force +Move-Item $zip $qmod -Force \ No newline at end of file diff --git a/scripts/ndk-stack.ps1 b/scripts/ndk-stack.ps1 new file mode 100644 index 0000000..1a364a4 --- /dev/null +++ b/scripts/ndk-stack.ps1 @@ -0,0 +1,29 @@ +Param( + [Parameter(Mandatory=$false)] + [String] $logName = "RecentCrash.log", + + [Parameter(Mandatory=$false)] + [Switch] $help +) + +if ($help -eq $true) { + Write-Output "`"NDK-Stack`" - Processes a tombstone using the debug .so to find file locations" + Write-Output "`n-- Arguments --`n" + + Write-Output "LogName `t`t The file name of the tombstone to process" + + exit +} + +if (Test-Path "./ndkpath.txt") { + $NDKPath = Get-Content ./ndkpath.txt +} else { + $NDKPath = $ENV:ANDROID_NDK_HOME +} + +$stackScript = "$NDKPath/ndk-stack" +if (-not ($PSVersionTable.PSEdition -eq "Core")) { + $stackScript += ".cmd" +} + +Get-Content $logName | & $stackScript -sym ./build/debug/ > "$($logName)_processed.log" diff --git a/scripts/start-logging.ps1 b/scripts/start-logging.ps1 index b22fef1..e60fc2d 100644 --- a/scripts/start-logging.ps1 +++ b/scripts/start-logging.ps1 @@ -27,7 +27,7 @@ if ($help -eq $true) { Write-Output "-Self `t`t Only Logs your mod and Crashes" Write-Output "-All `t`t Logs everything, including logs made by the Quest itself" Write-Output "-Custom `t Specify a specific logging pattern, e.g `"custom-types|questui`"" - Write-Output "`t`t NOTE: The paterent `"AndriodRuntime|CRASH`" is always appended to a custom pattern" + Write-Output "`t`t NOTE: The pattern `"AndroidRuntime|CRASH|scotland2|Unity`" is always appended to a custom pattern" Write-Output "-File `t`t Saves the output of the log to the file name given" exit @@ -35,14 +35,27 @@ if ($help -eq $true) { $bspid = adb shell pidof com.beatgames.beatsaber $command = "adb logcat " -$command2 = "adb logcat -c" if ($all -eq $false) { + $loops = 0 + while ([string]::IsNullOrEmpty($bspid) -and $loops -lt 3) { + Start-Sleep -Milliseconds 100 + $bspid = adb shell pidof com.beatgames.beatsaber + $loops += 1 + } + + if ([string]::IsNullOrEmpty($bspid)) { + Write-Output "Could not connect to adb, exiting..." + exit 1 + } + + $command += "--pid $bspid" } if ($all -eq $false) { $pattern = "(" if ($self -eq $true) { + & $PSScriptRoot/validate-modjson.ps1 $modID = (Get-Content "./mod.json" -Raw | ConvertFrom-Json).id $pattern += "$modID|" } @@ -50,9 +63,9 @@ if ($all -eq $false) { $pattern += "$custom|" } if ($pattern -eq "(") { - $pattern = "(QuestHook|modloader|" + $pattern = "( INFO| DEBUG| WARN| ERROR| CRITICAL|" } - $pattern += "AndroidRuntime|CRASH)" + $pattern += "AndroidRuntime|CRASH|scotland2|Unity )" $command += " | Select-String -pattern `"$pattern`"" } @@ -61,5 +74,5 @@ if (![string]::IsNullOrEmpty($file)) { } Write-Output "Logging using Command `"$command`"" -Invoke-Expression $command2 +adb logcat -c Invoke-Expression $command diff --git a/scripts/validate-modjson.ps1 b/scripts/validate-modjson.ps1 index 54db43e..73a04e8 100644 --- a/scripts/validate-modjson.ps1 +++ b/scripts/validate-modjson.ps1 @@ -1,16 +1,28 @@ $mod = "./mod.json" +$modTemplate = "./mod.template.json" +$qpmShared = "./qpm.shared.json" -if (-not (Test-Path -Path $mod)) { - if (Test-Path -Path ".\mod.template.json") { - & qpm-rust qmod build +if (Test-Path -Path $modTemplate) { + $update = -not (Test-Path -Path $mod) + + if (-not $update) { + $update = (Get-Item $modTemplate).LastWriteTime -gt (Get-Item $mod).LastWriteTime + } + + if (-not $update -and (Test-Path -Path $qpmShared)) { + $update = (Get-Item $qpmShared).LastWriteTime -gt (Get-Item $mod).LastWriteTime + } + + if ($update) { + & qpm qmod manifest if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE } } - else { - Write-Output "Error: mod.json and mod.template.json were not present" - exit 1 - } +} +elseif (-not (Test-Path -Path $mod)) { + Write-Output "Error: mod.json and mod.template.json were not present" + exit 1 } Write-Output "Creating qmod from mod.json" diff --git a/shaders.sbund b/shaders.sbund new file mode 100644 index 0000000..9ab5fca Binary files /dev/null and b/shaders.sbund differ diff --git a/src/AssetLib/modelImporter.cpp b/src/AssetLib/modelImporter.cpp index f3ff39d..88e19a2 100644 --- a/src/AssetLib/modelImporter.cpp +++ b/src/AssetLib/modelImporter.cpp @@ -10,7 +10,7 @@ #include "customTypes/BlendShape/BlendShapeController.hpp" #include "main.hpp" -#include "paper/shared/Profiler.hpp" +#include "paper2_scotland2/shared/Profiler.hpp" #include "assimp/Importer.hpp" #include "assimp/postprocess.h" #include diff --git a/src/MirrorManager.cpp b/src/MirrorManager.cpp index 9e83289..9de1071 100644 --- a/src/MirrorManager.cpp +++ b/src/MirrorManager.cpp @@ -4,7 +4,6 @@ #include #include -#include #include #include @@ -119,7 +118,6 @@ namespace VRMQavatars const auto camcomp = newCamera->GetComponent(); UnityEngine::GameObject::DestroyImmediate(newCamera->GetComponent()); UnityEngine::GameObject::DestroyImmediate(newCamera->GetComponent()); - UnityEngine::GameObject::DestroyImmediate(newCamera->GetComponent()); UnityEngine::GameObject::DestroyImmediate(newCamera->GetComponent()); camcomp->set_nearClipPlane(1.0f); diff --git a/src/UI/AvatarSettingsViewController.cpp b/src/UI/AvatarSettingsViewController.cpp index 159c2d7..5cebdf1 100644 --- a/src/UI/AvatarSettingsViewController.cpp +++ b/src/UI/AvatarSettingsViewController.cpp @@ -21,7 +21,7 @@ #include "VMC/VMCClient.hpp" #include "VMC/VMCServer.hpp" -#include "paper/shared/utfcpp/source/utf8.h" +#include "paper2_scotland2/shared/utfcpp/source/utf8.h" namespace VRMQavatars::UI::ViewControllers { CP_SDK_IL2CPP_INHERIT_INIT(AvatarSettingsViewController); diff --git a/src/UI/AvatarsFlowCoordinator.cpp b/src/UI/AvatarsFlowCoordinator.cpp index 4459b8a..5d8209f 100644 --- a/src/UI/AvatarsFlowCoordinator.cpp +++ b/src/UI/AvatarsFlowCoordinator.cpp @@ -8,13 +8,13 @@ DEFINE_TYPE(VRMQavatars::UI::FlowCoordinators, AvatarsFlowCoordinator); namespace VRMQavatars::UI { void FlowCoordinators::AvatarsFlowCoordinator::Awake() { - if (!MirrorViewController || !MirrorViewController->m_CachedPtr) { + if (!MirrorViewController || !MirrorViewController->m_CachedPtr.m_value) { MirrorViewController = BSML::Helpers::CreateViewController(); } - if (!AvatarSelectionViewController || !AvatarSelectionViewController->m_CachedPtr) { + if (!AvatarSelectionViewController || !AvatarSelectionViewController->m_CachedPtr.m_value) { AvatarSelectionViewController = BSML::Helpers::CreateViewController(); } - if (!AvatarSettingsViewController || !AvatarSettingsViewController->m_CachedPtr) { + if (!AvatarSettingsViewController || !AvatarSettingsViewController->m_CachedPtr.m_value) { AvatarSettingsViewController = BSML::Helpers::CreateViewController(); } } @@ -23,7 +23,7 @@ namespace VRMQavatars::UI if (!firstActivation) return; showBackButton = true; - SetTitle(il2cpp_utils::newcsstr("VRM Qavatars"), HMUI::ViewController::AnimationType::In); + SetTitle(StringW("VRM Qavatars"), HMUI::ViewController::AnimationType::In); ProvideInitialViewControllers(AvatarSelectionViewController, AvatarSettingsViewController, MirrorViewController, nullptr, nullptr); } diff --git a/src/UI/modals/AvatarSelectionModal.cpp b/src/UI/modals/AvatarSelectionModal.cpp index e41bddd..19e193e 100644 --- a/src/UI/modals/AvatarSelectionModal.cpp +++ b/src/UI/modals/AvatarSelectionModal.cpp @@ -9,7 +9,7 @@ #include "UI/AvatarSelectionViewController.hpp" #include "UI/AvatarSettingsViewController.hpp" -#include "paper/shared/utfcpp/source/utf8.h" +#include "paper2_scotland2/shared/utfcpp/source/utf8.h" namespace VRMQavatars::UI::Modals { diff --git a/src/customTypes/BlendShape/BlendShapeController.cpp b/src/customTypes/BlendShape/BlendShapeController.cpp index 4e8b7b5..ec79020 100644 --- a/src/customTypes/BlendShape/BlendShapeController.cpp +++ b/src/customTypes/BlendShape/BlendShapeController.cpp @@ -271,7 +271,7 @@ namespace VRMQavatars::BlendShape if(UnityEngine::Time::get_time() > time) { //Switch eye positions - Sombrero::FastVector3 unitPos = UnityEngine::Random::get_insideUnitSphere(); //random lookdir + Sombrero::FastVector3 unitPos = UnityEngine::Random::get_onUnitSphere(); //random lookdir eyeVec.x = unitPos.x * 2.5f; //vert eyeVec.y = unitPos.y * 5.0f; //horz eyeVec.z = 0.0f; diff --git a/src/customTypes/OVRLipSyncPlugin/OVRLipSync.cpp b/src/customTypes/OVRLipSyncPlugin/OVRLipSync.cpp index 653b497..03b8bdf 100644 --- a/src/customTypes/OVRLipSyncPlugin/OVRLipSync.cpp +++ b/src/customTypes/OVRLipSyncPlugin/OVRLipSync.cpp @@ -109,7 +109,7 @@ namespace VRMQavatars::OVRLipSync list->set_Item(i, audioBuffer[i]); } auto gcHandle = System::Runtime::InteropServices::GCHandle::Alloc(list, System::Runtime::InteropServices::GCHandleType::Pinned); - const auto result = ovrLipSyncDll_ProcessFrameEx(context, gcHandle.AddrOfPinnedObject(), num, audioDataType, &frame); + const auto result = ovrLipSyncDll_ProcessFrameEx(context, gcHandle.AddrOfPinnedObject().ToPointer(), num, audioDataType, &frame); gcHandle.Free(); return result; }