[go: up one dir, main page]

Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FPS Limit option #22

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Apply FPSLimit to application frametime
  • Loading branch information
bobermilk committed Nov 2, 2023
commit 4c1f68689929a81f837f3e23ec7b4ee62a979eb4
2 changes: 1 addition & 1 deletion Source/Application.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#include <SFML/Graphics/Transformable.hpp>


const sf::Time Application::TimePerFrame = sf::seconds(1.f / 60.f);
const sf::Time Application::TimePerFrame = sf::seconds(1.f / static_cast<float>(LogicalParameter::ID::OtherFPSLimit));

Application::Application()
{
Expand Down
2 changes: 1 addition & 1 deletion Source/Menu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -718,7 +718,7 @@ void Menu::buildParametersMap()
mParameters.emplace(std::make_pair(LogicalParameter::ID::OtherSaveStats, new LogicalParameter(LogicalParameter::Type::Bool, &Settings::SaveStats, "Update statistics on quit", "False")));
mParameters.emplace(std::make_pair(LogicalParameter::ID::OtherShowOppOnAlt, new LogicalParameter(LogicalParameter::Type::Bool, &Settings::ShowOppOnAlt, "Show opposite key values on alt press", "True")));
mParameters.emplace(std::make_pair(LogicalParameter::ID::OtherMultpl, new LogicalParameter(LogicalParameter::Type::Unsigned, &Settings::ButtonPressMultiplier, "Value to multiply on click", "1", 0, 1000000)));
mParameters.emplace(std::make_pair(LogicalParameter::ID::OtherFPSLimit, new LogicalParameter(LogicalParameter::Type::Unsigned, &Settings::FPSLimit, "FPS Limit", "60", 0, 8000)));
mParameters.emplace(std::make_pair(LogicalParameter::ID::OtherFPSLimit, new LogicalParameter(LogicalParameter::Type::Unsigned, &Settings::FPSLimit, "FPS Limit", "60", 0, 8000)));

mParameters.emplace(std::make_pair(LogicalParameter::ID::SaveStatMaxKPS, new LogicalParameter(LogicalParameter::Type::Float, &Settings::MaxKPS, "Saved max KPS", "0", 0u, UINT_MAX)));
mParameters.emplace(std::make_pair(LogicalParameter::ID::SaveStatTotal, new LogicalParameter(LogicalParameter::Type::Unsigned, &Settings::Total, "Saved total", "0", 0u, UINT_MAX)));
Expand Down
2 changes: 1 addition & 1 deletion Source/Palette.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Palette::Palette(int)
, wasButtonPressedOnLine(false)
, wasButtonPressedOnCanvas(false)
{
mWindow.setFramerateLimit(60);
mWindow.setFramerateLimit(Settings::FPSLimit);

auto color = sf::Color::Red;
float colorStep = mLineSize / 2, leftSide = 5.f, rightSide = 25.f;
Expand Down