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

Bug fixes, framerate cap mode #1

Merged
merged 5 commits into from
Sep 20, 2023
Merged

Bug fixes, framerate cap mode #1

merged 5 commits into from
Sep 20, 2023

Conversation

y2bd
Copy link
Owner

@y2bd y2bd commented Sep 18, 2023

  • Adds a new mode (toggleable with F7) that sets a maximum framerate of 120fps and a delta timestemp of 15ms.
    • This is done via the external tick library
    • This was done because the game doesn't appear to opt into vsync mode on MacOS computers, resulting in the game running extremely fast
  • Fixes a bug with the keymap parsing code where a blank space or newline at the end of the keymap file would prevent parsing the clockwise control input correctly
  • Saves window position on close of the game and restores it upon re-open
  • Updates README_Distrib with framecap mode instructions, as well as MacOS-specific keymap instructions

@y2bd y2bd self-assigned this Sep 18, 2023
window.lua Outdated
local fileInfo = love.filesystem.getInfo(WINDOW_FILE)
if fileInfo then
local contents = love.filesystem.read(WINDOW_FILE)
local windowArr = String.split(contents, ',')
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably won't need to trim given no-one in their right mind would modify this. But you could if someone is outside of their mind.

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's coded into my brain now.

window.lua Outdated
Comment on lines 13 to 15
local x = windowArr[1]
local y = windowArr[2]
local display = windowArr[3]
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oob check? or just fail? not sure if it could fail gracefully if someone did faff with the file.

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe they'd be nil, which would probably work with the setWindow function? Like it would use some default instead?

@y2bd y2bd merged commit fbe504c into master Sep 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants