Skip to content

Commit

Permalink
Slight cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
fleroviux committed Jul 15, 2023
1 parent d1b4ac2 commit 53bf25c
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/platform/qt/src/widget/sprite_viewer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -258,9 +258,11 @@ void SpriteViewer::Update() {
}
}

const int available_render_cycles = (core->PeekHalfIO(0x04000000) & (1 << 5)) ? 964 : 1232;
const bool fast_hblank_oam_access = core->PeekHalfIO(0x04000000) & (1 << 5);
const int available_render_cycles = fast_hblank_oam_access ? 964 : 1232;
const float render_cycle_percentage = 100.0f * (float)render_cycles / (float)available_render_cycles;

label_sprite_render_cycles->setText(QString::fromStdString(fmt::format("{} ({:.2f} %)", render_cycles, 100.0f * (float)render_cycles / available_render_cycles)));
label_sprite_render_cycles->setText(QString::fromStdString(fmt::format("{} ({:.2f} %)", render_cycles, render_cycle_percentage)));

sprite_width = width;
sprite_height = height;
Expand Down

0 comments on commit 53bf25c

Please sign in to comment.