Skip to content

Making the code easier to understand#2730

Open
YN0HTNA wants to merge 1 commit intojMonkeyEngine:masterfrom
YN0HTNA:master
Open

Making the code easier to understand#2730
YN0HTNA wants to merge 1 commit intojMonkeyEngine:masterfrom
YN0HTNA:master

Conversation

@YN0HTNA
Copy link
Copy Markdown

@YN0HTNA YN0HTNA commented Apr 30, 2026

I made some edits to the comments in the code just for better clarity of what's going on.

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request updates the Javadoc documentation for the clamp, toByte, fromByte, and toInt methods in the ColorRGBA class to provide more detailed descriptions and parameter information. A review comment suggests improving the indentation of the new Javadoc blocks and using standard hyphens for bit ranges to ensure consistency with the existing codebase.

Comment on lines +831 to +838
* Combines four normalized float color channels into a single packed 32-bit integer.
* Each channel is scaled from [0.0, 1.0] to [0, 255] and packed into 8-bit segments.
* @param c1 the first channel (occupies bits 24–31)
* @param c2 the second channel (occupies bits 16–23)
* @param c3 the third channel (occupies bits 8–15)
* @param c4 the fourth channel (occupies bits 0–7)
* @return the four channels combined into a single int
*/
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

The Javadoc comments are missing a leading space for proper alignment. Additionally, using standard hyphens instead of en-dashes for bit ranges is more consistent with the existing codebase (e.g., line 648).

Suggested change
* Combines four normalized float color channels into a single packed 32-bit integer.
* Each channel is scaled from [0.0, 1.0] to [0, 255] and packed into 8-bit segments.
* @param c1 the first channel (occupies bits 2431)
* @param c2 the second channel (occupies bits 1623)
* @param c3 the third channel (occupies bits 815)
* @param c4 the fourth channel (occupies bits 07)
* @return the four channels combined into a single int
*/
* Combines four normalized float color channels into a single packed 32-bit integer.
* Each channel is scaled from [0.0, 1.0] to [0, 255] and packed into 8-bit segments.
* @param c1 the first channel (occupies bits 24-31)
* @param c2 the second channel (occupies bits 16-23)
* @param c3 the third channel (occupies bits 8-15)
* @param c4 the fourth channel (occupies bits 0-7)
* @return the four channels combined into a single int
*/
References
  1. When identifying missing or incorrect Javadoc, provide a code suggestion to fix it directly.

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.

1 participant