@@ -6,77 +6,7 @@ using namespace geode::prelude;
6
6
7
7
FMOD::ChannelGroup* masterGroup;
8
8
9
- bool stringToFloat (const std::string& str, float & result) {
10
- std::istringstream iss (str);
11
- iss >> std::noskipws; // Disable skipping whitespace
12
- char c;
13
- if (!(iss >> result) || (iss >> c && !std::isspace (c))) {
14
- // Conversion failed or there are extra characters
15
- return false ;
16
- }
17
- return true ;
18
- }
19
-
20
- /* class $modify (CCScheduler)
21
- {
22
- void update(float dt)
23
- {
24
- if (!masterGroup)
25
- {
26
- FMODAudioEngine::sharedEngine()->m_system->getMasterChannelGroup(&masterGroup);
27
- }
28
-
29
- // icon effects value
30
- ColourUtility::update(dt);
31
-
32
- if (SpeedhackTop::instance)
33
- {
34
- if (SpeedhackEnabled::instance->enabled)
35
- {
36
- float v = 1.0f;
37
-
38
- //if (!stringToFloat(SpeedhackTop::instance->text, v))
39
- //v = 1.0f;
40
-
41
- try
42
- {
43
- v = std::stof(SpeedhackTop::instance->text);
44
- }
45
- catch(const std::exception& e)
46
- {
47
- //std::cerr << e.what() << '\n';
48
- v = 1.0f;
49
- }
50
-
51
-
52
- if (v < 0.01f)
53
- v = 0.01f;
54
-
55
- if (v > 99999)
56
- v = 99999;
57
-
58
- bool m = SpeedhackMus::instance->enabled;
59
-
60
- if (SpeedhackGameplay::instance->enabled)
61
- if (!(PlayLayer::get() || GameManager::sharedState()->getEditorLayer())) { v = 1.0f; }
62
-
63
- //FMOD::ChannelGroup* masterGroup;
64
- //0FMODAudioEngine::sharedEngine()->m_system->getMasterChannelGroup(&masterGroup);
65
- masterGroup->setPitch(m ? v : 1);
66
-
67
- CCScheduler::update(dt * v);
68
- return;
69
- }
70
- }
71
-
72
- masterGroup->setPitch(1);
73
-
74
- CCScheduler::update(dt * 2);
75
- }
76
- }; // LINE 115 DOESN'T FUCKING EXIST???? HOW CRASH
77
- */
78
-
79
- void myUpdate (CCScheduler* ins, float dt)
9
+ float speedhackLogic (float dt)
80
10
{
81
11
if (!masterGroup)
82
12
FMODAudioEngine::sharedEngine ()->m_system ->getMasterChannelGroup (&masterGroup);
@@ -108,14 +38,20 @@ void myUpdate(CCScheduler* ins, float dt)
108
38
if (!(PlayLayer::get () || GameManager::sharedState ()->getEditorLayer ())) { v = 1 .0f ; }
109
39
110
40
masterGroup->setPitch (SpeedhackMus::instance->enabled ? v : 1 );
111
- ins->update (dt * v);
112
41
ColourUtility::update (dt * v);
113
- return ;
42
+ return dt * v ;
114
43
}
115
44
}
116
45
117
46
masterGroup->setPitch (1 );
118
47
ColourUtility::update (dt);
48
+ return dt;
49
+ }
50
+
51
+ void myUpdate (CCScheduler* ins, float dt)
52
+ {
53
+ dt = speedhackLogic (dt);
54
+
119
55
ins->update (dt);
120
56
}
121
57
0 commit comments