Skip to content

Commit

Permalink
speedhack audio
Browse files Browse the repository at this point in the history
  • Loading branch information
TobyAdd committed Nov 28, 2024
1 parent 70be63d commit 243ca81
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/hacks.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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"} // +
}
},
Expand Down
15 changes: 15 additions & 0 deletions src/hooks.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
#include <Geode/modify/EditLevelLayer.hpp>
#include <Geode/modify/GameObject.hpp>
#include <Geode/modify/LevelEditorLayer.hpp>
#include <Geode/modify/FMODAudioEngine.hpp>
#include "hacks.hpp"
#include "config.hpp"

Expand Down Expand Up @@ -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<bool>("speedhack_enabled", false) ? config.get<float>("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;
Expand Down

0 comments on commit 243ca81

Please sign in to comment.