Lift texture size limit for TEN and warn for other engines#1126
Lift texture size limit for TEN and warn for other engines#1126
Conversation
There was a problem hiding this comment.
Pull request overview
This PR lifts the texture coordinate span limit from 256 pixels to 1024 pixels for TombEngine projects, while maintaining the 256-pixel limit for classic Tomb Raider engines (TR1-5, TRNG). The changes refactor hardcoded texture size limits into parameterized methods that accept an engine-specific maximum coordinate span value.
Changes:
- Refactored
TriangleCoordsOutOfBoundsandQuadCoordsOutOfBoundsfrom properties with hardcoded 256-pixel limits to methods accepting a configurablemaxCoordSpanparameter - Updated compilation and rendering logic to use 1024.0f for TombEngine and 256.0f for other engines
- Increased rendering texture allocator limit from 256×256 to 1024×1024 for performance optimization
- Updated UI texture selection maximum size from 256 to 1024
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| TombLib/TombLib/Utils/Texture.cs | Refactored bounds checking properties to parameterized methods; added AreTriangleCoordsOutOfBounds() and AreQuadCoordsOutOfBounds() methods |
| TombLib/TombLib/LevelData/Room.cs | Updated geometry statistics to use engine-specific texture coordinate span limits |
| TombLib/TombLib/LevelData/Compilers/Util/TexInfoManager.cs | Updated texture validation to use 256.0f limit (appropriate for classic compiler) |
| TombLib/TombLib/LevelData/Compilers/TombEngine/Rooms.cs | Updated TombEngine room compiler to use 1024.0f limit |
| TombLib/TombLib/LevelData/Compilers/Rooms.cs | Updated classic engine room compiler to use 256.0f limit |
| TombLib/TombLib.Rendering/Rendering/RenderingTextureAllocator.cs | Increased MaxDirectImageArea constant from 256×256 to 1024×1024 |
| TombLib/TombLib.Rendering/Rendering/DirectX11/Dx11RenderingDrawingRoom.cs | Updated rendering to use engine-specific limits; fixed typo |
| TombLib/TombLib.Forms/Controls/TextureMapBase.cs | Changed MaxTextureSize default from 256 to 1024 |
| TombEditor/EditorActions.cs | Updated broken texture search to use engine-specific limits |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| } | ||
|
|
||
| protected virtual float MaxTextureSize { get; } = 256; | ||
| protected virtual float MaxTextureSize { get; } = 1024; |
There was a problem hiding this comment.
MaxTextureSize is now hardcoded to 1024, but should be engine-specific. In TombEditor's PanelTextureMap (which has access to _editor.Level.IsTombEngine), this property should be overridden to return 1024.0f for TombEngine and 256.0f for other engines. Without this, users editing non-TombEngine levels will be able to select texture areas larger than 256x256 pixels, which will cause issues during compilation.
There was a problem hiding this comment.
We can allow selecting larger textures in TE for other engines, in case someone wants to do group texturing. This is therefore intentional.
|
This PR is ready to merge in a future update. There's nothing else to add here. |
No description provided.