Skip to content

Commit

Permalink
fps based speedhack
Browse files Browse the repository at this point in the history
  • Loading branch information
matcool committed Feb 2, 2021
1 parent 93d7b61 commit 13a00b9
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions dllmain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,14 @@ void readInput(HMODULE hModule) {
std::cout << "Setting fps to " << fps << std::endl;
ReplaySystem::getInstance()->setDefaultFPS(fps);
}
else if (line.rfind("speed ", 0) == 0) {
auto speed = std::stof(line.substr(6));
auto replay = ReplaySystem::getInstance()->getCurrentReplay();
if (!replay) continue;
auto fps = replay->getFPS() * speed;
std::cout << "Setting speed to " << speed << " (fps=" << fps << ")" << std::endl;
CCDirector::sharedDirector()->setAnimationInterval(1. / fps);
}
}
}

Expand Down

0 comments on commit 13a00b9

Please sign in to comment.