-
Notifications
You must be signed in to change notification settings - Fork 97
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
Further optimize rendering methods #579
Merged
Merged
Conversation
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
Aparapi Kernel transformation of rendering methods: stage 1
Added appropriate exceptions and handles for compatibility validation.
Aparapi Kernel transformation of rendering methods: stage 2
Aparapi is removed by the efficiency and necessarity. All the rendering funtions are replaced with either Graphics2D API or raw array looping.
This was referenced Nov 5, 2023
# Conflicts: # src/client/java/minicraft/gfx/MinicraftImage.java # src/client/java/minicraft/gfx/Screen.java # src/client/java/minicraft/screen/OnScreenKeyboardMenu.java # src/client/java/minicraft/screen/QuestsDisplay.java # src/client/java/minicraft/screen/SkinDisplay.java # src/client/java/minicraft/screen/TutorialDisplayHandler.java
Fix Conflicts and I’ll merge |
# Conflicts: # src/client/java/minicraft/gfx/MinicraftImage.java # src/client/java/minicraft/gfx/Screen.java
5 tasks
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.
This change performs well together with #523 and #524.
As a minor change, there is no longer an error popup when there is any explicitly or implicitly incompatible images regarding their sizes. Instead, a warning message is rendered in the terminal.
Due to the change to the compatibility of the rendering of the on-screen keyboard, the textures of the special keys are updated and saved as assets instead of being constructed on demand in runtime. It is mainly because the visibility of
Screen#pixels
is decreased,There is no longer a light screen constructed with
Screen
. Instead, an object representing the overlay is present in the screen object.Other minor changes:
Screen
is constructed with a parameter ofBufferedImage
instead of using the initialization method#init(int[])
to initialize the pixel array.Screen
now storesBufferedImage
for the ability to render throughGraphics2D
on the image object.Graphics2D
provided method.MinicraftImage
are added, because of the change to the on-screen keyboard.Screen#flush()
is called and all processes before the latest screen clean rendering are eliminated.Some methods may be still using array looping to render.
As a result, the CPU run time has been improved.
The below comparison is tested based on my personal computer.
Comparing with the current implementation (with #523):
Comparing with Add hardware acceleration setting #524 added (comparing without this pull request):