Skip to content

Refactor: Uniform optimization + javadoc #2528

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

Open
wants to merge 9 commits into
base: master
Choose a base branch
from

Conversation

capdevon
Copy link
Contributor

@capdevon capdevon commented Jun 25, 2025

This PR refactors the Uniform class in com.jme3.shader to improve code clarity, maintainability, and usage safety. Key changes include:

  • Replacing wildcard and redundant imports with explicit class imports.
  • Improving null checks, input validation, and variable naming for clearer intent.
  • Unifying and simplifying handling of value assignment in setValue.
  • Replacing manual equals implementation with Objects.equals.
  • Adding and enhancing Javadoc comments for public methods and class-level documentation.
  • Using meaningful constants for location checks and buffer allocation.
  • Ensuring proper buffer cleanup in deleteNativeBuffers with explanatory comments.
  • General code cleanup, minor bug fixes, and consistency improvements.

These updates make the Uniform class easier to understand, safer to use, and better documented for both users and maintainers.

Copy link

github-actions bot commented Aug 9, 2025

🖼️ Screenshot tests have failed.

The purpose of these tests is to ensure that changes introduced in this PR don't break visual features. They are visual unit tests.

📄 Where to find the report:

  • Go to the (failed run) > Summary > Artifacts > screenshot-test-report
  • Download the zip and open jme3-screenshot-tests/build/reports/ScreenshotDiffReport.html

⚠️ If you didn't expect to change anything visual:
Fix your changes so the screenshot tests pass.

If you did mean to change things:
Review the replacement images in jme3-screenshot-tests/build/changed-images to make sure they really are improvements and then replace and commit the replacement images at jme3-screenshot-tests/src/test/resources.

If you are creating entirely new tests:
Find the new images in jme3-screenshot-tests/build/changed-images and commit the new images at jme3-screenshot-tests/src/test/resources.

Note; it is very important that the committed reference images are created on the build pipeline, locally created images are not reliable. Similarly tests will fail locally but you can look at the report to check they are "visually similar".

See https://github.com/jMonkeyEngine/jmonkeyengine/blob/master/jme3-screenshot-tests/README.md for more information

Contact @richardTingle (aka richtea) for guidance if required

@richardTingle
Copy link
Member

These screenshot test failures will be related to #2542

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.

4 participants