-
Notifications
You must be signed in to change notification settings - Fork 137
Configurable atlas textures packing #2328
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
Conversation
|
|
||
| open class KorgeTexturePacker : KorgeResourceProcessor { | ||
| override fun processFolder(context: KorgeResourceProcessorContext) { | ||
| context.resourceFolders |
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.
I guess this line should be removed?
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.
Pull Request Overview
This PR introduces configurable atlas texture packing by allowing texture packing settings—rotation, trimming, and padding—to be defined in an external .atlas file rather than using hardcoded values.
- Introduces a new padding parameter (default 2) in the texture packer classes.
- Adds parsing logic to read atlas settings from configuration files, propagating these settings into the generation logic.
- Mirrors these changes in both the main and buildSrc modules to ensure consistency.
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| korge-gradle-plugin/src/main/kotlin/korlibs/korge/gradle/texpacker/NewTexturePacker.kt | Replaced hardcoded padding with a configurable parameter. |
| korge-gradle-plugin/src/main/kotlin/korlibs/korge/gradle/processor/KorgeTexturePacker.kt | Added atlas configuration parsing and passed settings to the generate function. |
| buildSrc/src/main/kotlin/korlibs/korge/gradle/texpacker/NewTexturePacker.kt | Applied the configurable padding changes echoing the changes in the main module. |
| buildSrc/src/main/kotlin/korlibs/korge/gradle/processor/KorgeTexturePacker.kt | Implemented atlas settings parsing and usage in the generate method. |
|
|
||
| open class KorgeTexturePacker : KorgeResourceProcessor { | ||
| override fun processFolder(context: KorgeResourceProcessorContext) { | ||
| context.resourceFolders |
Copilot
AI
May 15, 2025
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.
The use of 'context.resourceFolders' as a standalone expression does not affect the control flow and appears to be a no-op; consider removing it for clarity.
| context.resourceFolders |
|
|
||
| open class KorgeTexturePacker : KorgeResourceProcessor { | ||
| override fun processFolder(context: KorgeResourceProcessorContext) { | ||
| context.resourceFolders |
Copilot
AI
May 15, 2025
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.
The standalone invocation of 'context.resourceFolders' is redundant and does not contribute to the processing logic; it is recommended to remove it to avoid confusion.
| } | ||
| } | ||
|
|
||
| private fun parseAtlasSettingsFile(atlasFile: File): AtlasGenerationSettings { |
Copilot
AI
May 15, 2025
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.
Since similar atlas settings parsing logic exists in both the main and buildSrc processor files, consider extracting this logic into a shared utility to reduce duplication and ease future maintenance.
| } | ||
| } | ||
|
|
||
| private fun parseAtlasSettingsFile(atlasFile: File): AtlasGenerationSettings { |
Copilot
AI
May 15, 2025
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.
The atlas settings parsing in this module duplicates functionality found in the main module; consider refactoring this into a common utility to improve maintainability.
Autogenerated atlas texture packing in this pr can be configured through .atlas file in the following manner: