Skip to content

Lift texture size limit for TEN and warn for other engines#1126

Open
Nickelony wants to merge 2 commits intodevelopfrom
Nickelony/Texture-Size-Limit-Lift
Open

Lift texture size limit for TEN and warn for other engines#1126
Nickelony wants to merge 2 commits intodevelopfrom
Nickelony/Texture-Size-Limit-Lift

Conversation

@Nickelony
Copy link
Collaborator

No description provided.

Copy link
Contributor

Copilot AI left a 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 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 TriangleCoordsOutOfBounds and QuadCoordsOutOfBounds from properties with hardcoded 256-pixel limits to methods accepting a configurable maxCoordSpan parameter
  • 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;
Copy link

Copilot AI Feb 12, 2026

Choose a reason for hiding this comment

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

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.

Copilot uses AI. Check for mistakes.
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

We can allow selecting larger textures in TE for other engines, in case someone wants to do group texturing. This is therefore intentional.

@Nickelony
Copy link
Collaborator Author

This PR is ready to merge in a future update. There's nothing else to add here.

@Nickelony Nickelony requested review from Lwmte February 23, 2026 18:55
@Nickelony Nickelony changed the title Lift texture size limit for TEN and warn for other engines ✅ Lift texture size limit for TEN and warn for other engines Feb 23, 2026
@Nickelony Nickelony changed the title ✅ Lift texture size limit for TEN and warn for other engines Lift texture size limit for TEN and warn for other engines Feb 23, 2026
@Nickelony Nickelony added ready for review The Pull Request is finished and ready for review. labels Feb 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready for review The Pull Request is finished and ready for review.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants