Skip to content

Commit

Permalink
DONT DONWLOAD LATEST BUILD
Browse files Browse the repository at this point in the history
  • Loading branch information
TobyAdd committed Jan 6, 2025
1 parent 32b41db commit 16ee368
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 28 deletions.
36 changes: 18 additions & 18 deletions src/hooks.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -169,28 +169,28 @@ class $modify(cocos2d::CCScheduler) {
if (engine.frame_advance && pl && !pl->m_isPaused) {
if (engine.next_frame) {
engine.next_frame = false;
if (recorder.is_recording) recorder.applyWinSize();
// if (recorder.is_recording) recorder.applyWinSize();
CCScheduler::update(new_dt);
if (recorder.is_recording || recorder.needRevertOld) {
if (recorder.needRevertOld)
recorder.needRevertOld = false;
// if (recorder.is_recording || recorder.needRevertOld) {
// if (recorder.needRevertOld)
// recorder.needRevertOld = false;

recorder.restoreWinSize();
}
// recorder.restoreWinSize();
// }
}

return;
}

if (!config.get<bool>("tps::real_time", true)) {
if (recorder.is_recording) recorder.applyWinSize();
// if (recorder.is_recording) recorder.applyWinSize();
CCScheduler::update(new_dt);
if (recorder.is_recording || recorder.needRevertOld) {
if (recorder.needRevertOld)
recorder.needRevertOld = false;
// if (recorder.is_recording || recorder.needRevertOld) {
// if (recorder.needRevertOld)
// recorder.needRevertOld = false;

recorder.restoreWinSize();
}
// recorder.restoreWinSize();
// }
return;
}

Expand All @@ -202,14 +202,14 @@ class $modify(cocos2d::CCScheduler) {
using namespace std::literals;

for (unsigned i = 0; i < times; ++i) {
if (recorder.is_recording) recorder.applyWinSize();
// if (recorder.is_recording) recorder.applyWinSize();
CCScheduler::update(new_dt);
if (recorder.is_recording || recorder.needRevertOld) {
if (recorder.needRevertOld)
recorder.needRevertOld = false;
// if (recorder.is_recording || recorder.needRevertOld) {
// if (recorder.needRevertOld)
// recorder.needRevertOld = false;

recorder.restoreWinSize();
}
// recorder.restoreWinSize();
// }
if (std::chrono::high_resolution_clock::now() - start > 33.333ms) {
times = i + 1;
break;
Expand Down
16 changes: 8 additions & 8 deletions src/recorder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -102,17 +102,17 @@ void Recorder::start(std::string command) {

after_end_extra_time = 0.f;

auto view = cocos2d::CCEGLView::get();
// auto view = cocos2d::CCEGLView::get();

oldDesignResolution = view->getDesignResolutionSize();
float aspectRatio = static_cast<float>(width) / static_cast<float>(height);
newDesignResolution = cocos2d::CCSize(roundf(320.f * aspectRatio), 320.f);
// oldDesignResolution = view->getDesignResolutionSize();
// float aspectRatio = static_cast<float>(width) / static_cast<float>(height);
// newDesignResolution = cocos2d::CCSize(roundf(320.f * aspectRatio), 320.f);

originalScreenScale = cocos2d::CCSize(view->m_fScaleX, view->m_fScaleY);
newScreenScale = cocos2d::CCSize(static_cast<float>(width) / newDesignResolution.width, static_cast<float>(height) / newDesignResolution.height);
// originalScreenScale = cocos2d::CCSize(view->m_fScaleX, view->m_fScaleY);
// newScreenScale = cocos2d::CCSize(static_cast<float>(width) / newDesignResolution.width, static_cast<float>(height) / newDesignResolution.height);

if (oldDesignResolution != newDesignResolution)
applyWinSize();
// if (oldDesignResolution != newDesignResolution)
// applyWinSize();

frame_has_data = false;
current_frame.resize(width * height * 3, 0);
Expand Down
4 changes: 2 additions & 2 deletions src/recorder.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ class Recorder {

bool enabled = false;
bool is_recording = false;
int width = 1280;
int height = 720;
int width = 2400;
int height = 1080;
int fps = 60;

bool lock_aspect_ratio = true;
Expand Down

0 comments on commit 16ee368

Please sign in to comment.