From 243ca81685ab8d15825a4429821ed18cba022b02 Mon Sep 17 00:00:00 2001 From: TobyAdd <66429886+TobyAdd@users.noreply.github.com> Date: Thu, 28 Nov 2024 17:40:28 +0200 Subject: [PATCH] speedhack audio --- src/hacks.cpp | 2 +- src/hooks.cpp | 15 +++++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/src/hacks.cpp b/src/hacks.cpp index 03ac695..37d461e 100644 --- a/src/hacks.cpp +++ b/src/hacks.cpp @@ -12,7 +12,7 @@ void Hacks::Init() { {"Unlock Items", "The following elements will be unlocked:\n- Icons + Colors\n- Practice Music Sync\n- Music Unlocker", "unlock_items"}, // + {"No Respawn Blink", "Upon respawning, the cube will not produce an unpleasant flicker", "no_respawn_blink"}, // + {"No Death Effect", "Upon death, the cube will not emit an exploding effect", "no_death_effect"}, // + - {"No Transition Old", "Fast transition between scenes (legeacy)", "no_transition"}, // + + {"No Transition Old", "Fast transition between scenes (legacy)", "no_transition"}, // + {"Safe Mode", "Disables progress on levels", "safe_mode"} // + } }, diff --git a/src/hooks.cpp b/src/hooks.cpp index 10f8962..4b077de 100644 --- a/src/hooks.cpp +++ b/src/hooks.cpp @@ -27,6 +27,7 @@ #include #include #include +#include #include "hacks.hpp" #include "config.hpp" @@ -74,6 +75,20 @@ class $modify(cocos2d::CCScheduler) { } }; +class $modify(FMODAudioEngine) { + void update(float delta) { + auto &config = Config::get(); + + FMODAudioEngine::update(delta); + + FMOD::ChannelGroup* group; + float speed = config.get("speedhack_enabled", false) ? config.get("speedhack_value", 1.f) : 1.f; + if (m_system->getMasterChannelGroup(&group) == FMOD_OK) { + group->setPitch(speed); + } + } +}; + class $modify(PlayLayer) { struct Fields { GameObject* anticheat_obj = nullptr;