-
Notifications
You must be signed in to change notification settings - Fork 209
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
Resolving #2153 Added ability to set frame-lock. #2765
Closed
Closed
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
999dd93
Added ability to set frame-lock.
TheoTheDev f4aec79
Merge branch 'master' into 2153-app-add-fps-limiter
TheoTheDev 7a463e4
Added comments for keys & added check is typing in input.
TheoTheDev 6d4287e
Moved key handling from Editor-mode.js to io-manager.
TheoTheDev File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -71,6 +71,10 @@ export default class Webaverse extends EventTarget { | |
constructor() { | ||
super(); | ||
|
||
this.lastRenderTime = 0; | ||
this.renderFrame = 0; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. These are poor variable names. Is it the number of frames? A Boolean? A time? |
||
this.loopFrame = 0; | ||
|
||
this.loadPromise = (async () => { | ||
await Promise.all([ | ||
physx.waitForLoad(), | ||
|
@@ -332,22 +336,29 @@ export default class Webaverse extends EventTarget { | |
}; | ||
_pre(); | ||
|
||
// render scenes | ||
performanceTracker.setGpuPrefix('diorama'); | ||
dioramaManager.update(timestamp, timeDiffCapped); | ||
performanceTracker.setGpuPrefix('minimap'); | ||
minimapManager.update(timestamp, timeDiffCapped); | ||
performanceTracker.setGpuPrefix('loadout'); | ||
loadoutManager.update(timestamp, timeDiffCapped); | ||
const timeSinceLastRender = timestamp - this.lastRenderTime; | ||
this.loopFrame ++; | ||
|
||
{ | ||
const popRenderSettings = renderSettingsManager.push(rootScene); | ||
if ( timeSinceLastRender >= game.renderLimitMs ) { | ||
|
||
this.lastRenderTime = timestamp; | ||
this.renderFrame ++; | ||
|
||
// render scenes | ||
performanceTracker.setGpuPrefix('diorama'); | ||
dioramaManager.update(timestamp, timeDiffCapped); | ||
performanceTracker.setGpuPrefix('minimap'); | ||
minimapManager.update(timestamp, timeDiffCapped); | ||
performanceTracker.setGpuPrefix('loadout'); | ||
loadoutManager.update(timestamp, timeDiffCapped); | ||
|
||
const popRenderSettings = renderSettingsManager.push(rootScene); | ||
performanceTracker.setGpuPrefix(''); | ||
this.render(timestamp, timeDiffCapped); | ||
|
||
popRenderSettings(); | ||
|
||
} | ||
|
||
}; | ||
_frame(); | ||
|
||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rather than this keyboard hack, this should be in the settings.