Consolidate textures#1234
Conversation
There was a problem hiding this comment.
Pull request overview
This PR adds a WadTool command to consolidate per-object texture fragments into packed texture page(s), reusing and generalizing the existing export texture-packing logic in TombLib.
Changes:
- Added a new WadTool action + menu item to “Consolidate textures” for selected destination objects.
- Refactored/extended TombLib texture packing to support packing into configurable page sizes and applying the packing back onto Wad meshes.
- Updated the installer changelog to mention the new feature.
Reviewed changes
Copilot reviewed 5 out of 6 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| WadTool/WadActions.cs | Adds ConsolidateSelectedObjectTextures action and wires it to destination selections. |
| WadTool/Forms/FormMain.Designer.cs | Adds the “Consolidate textures” menu item under Textures. |
| WadTool/Forms/FormMain.cs | Enables the new menu item and adds the click handler. |
| TombLib/TombLib/Wad/WadMesh.cs | Introduces shared texture packing helpers and ConsolidateTextures applying packing to meshes. |
| TombLib/TombLib/Wad/Wad2.cs | Updates PackTexturesForExport to support packing into variable page sizes and multiple pages. |
| Installer/Changes.txt | Documents the new option in release notes. |
Files not reviewed (1)
- WadTool/Forms/FormMain.Designer.cs: Language not supported
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Did a quick test on Consolidate texture branch. Its good but not quite what wadmerger had achieved. It consolidates textures only on one object. Which is already an improvement but for Lara which spans multiple objects, it would be good, if we can select multiple objects and then consolidate into one. Also, maybe we can auto consolidate, when copying objects out of TR files. Once again, if I consolidate the textures and there are multiple objects which use the same textures, they each get their own copy of the said texture. |
Aggregate the meshes of every selected object into a single ConsolidateTextures pass instead of consolidating per object, so multi-object sets (e.g. Lara) share one set of texture pages and textures used by more than one object are packed only once instead of being duplicated per object.
This PR allows to consolidate disjointed texture pieces for a given object into a single set of texture pages.