Fixes for low FPS on slower systems during battles#3580
Open
VannevarXbox wants to merge 3 commits into
Open
Conversation
…eshGauge to update incrementally, or at least to skip redrawing content when not needed. The battle status window is no longer cleared by a call to Refresh(), but full-clear-and-redraw functionality would be very easy to add if needed. In order to accomplish the incremental updates, Window_BattleStatus keeps a cache of the displayed values for each item, updating the graphics if those values change. The UIs for RM2k3 battle type B (alternative) and C (gauge) both have overlapping content, meaning multiple items need to be redrawn if one of the overlapping items is redrawn in the UI, so further optimization would be possible there. The function DrawGauge, which draws the gauges for battle types A (traditional) and B (alternative), has been moved from Window_Base into Window_BattleStatus, as that seems to be the only code that uses it.
…ged, since it appears that at least in BattleType_alternative/B with a small window, the gauges can overlap into the row below. This makes sure the window gets redrawn properly, and this situation should be rare enough that this doesn't impact performance too much. Also, when re-drawing content in BattleType_gauge/C, clear the whole item/actor area in case of any face changes.
…ctor face if face redraw is needed, fixed a couple frames for clearing content, removed function ClearItemGraphics which is now unused
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Window_BattleStatus::Refresh was being called for every frame during a battle, triggering a full re-draw of the battle status window. This was causing very low framerate at some points on slower systems:
#3494
#3497
These changes improve battle framerate to a playable level on original Xbox. I've tested them with RM2k, custom test games for battle types A, B, and C (both large and small windows), the Maniac test game, and the game Ara Fell which was mentioned in the source.
It's my first pull request, so hopefully I didn't do anything too dumb! I'd be happy to answer any questions or make any needed changes.