Skip to content

Fixed animated group textures not animating#1124

Open
Nickelony wants to merge 7 commits intodevelopfrom
Nickelony/Fix-Animated-Group-Textures
Open

Fixed animated group textures not animating#1124
Nickelony wants to merge 7 commits intodevelopfrom
Nickelony/Fix-Animated-Group-Textures

Conversation

@Nickelony
Copy link
Copy Markdown
Collaborator

@Nickelony Nickelony commented Feb 12, 2026

This pull request introduces robust support for animated texture sub-areas - enabling tools that apply textures to only a portion of an animated frame (such as group texturing) to work seamlessly. The changes include a new utility for matching and generating sub-area animation sets, cache key structures for deduplication, and integration with both the general and TombEngine-specific texture managers. Additionally, some redundant code related to resetting texture parent areas was removed.

Animated texture sub-area support:

  • Added AnimatedTextureLookupUtility with methods for matching, quantizing, and generating sub-area animation sets, as well as a SubAreaKey struct for deduplicating sub-area lookups. (TombLib/TombLib/LevelData/Compilers/AnimatedTextureLookupUtility.cs)
  • Integrated sub-area animated texture matching and lookup generation into both TexInfoManager and TombEngineTexInfoManager, including logic to handle only compatible animation types and prevent redundant processing via _processedSubAreas. (TombLib/TombLib/LevelData/Compilers/Util/TexInfoManager.cs, TombLib/TombLib/LevelData/Compilers/TombEngine/TombEngineTexInfoManager.cs) [1] [2] [3] [4] [5]
  • Modified the animated lookup generation to accept a isForRoom parameter, ensuring correct scoping of generated lookups. (TombLib/TombLib/LevelData/Compilers/Util/TexInfoManager.cs) [1] [2]

Code cleanup and bug fixes:

  • Removed unnecessary resetting of texture.ParentArea before applying textures, preventing accidental loss of parent area information needed for sub-area matching. (TombEditor/EditorActions.cs) [1] [2]

Dependency management:

  • Added missing using directive for the new utility in TexInfoManager. (TombLib/TombLib/LevelData/Compilers/Util/TexInfoManager.cs)

Copy link
Copy Markdown
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

Fixes a compiler-side issue where animated textures applied as sub-areas (via group texturing tools using ParentArea) were not being recognized as animated, causing them to compile as static textures instead.

Changes:

  • Detects textures with a non-zero ParentArea and attempts to match them against reference animated textures using reconstructed “full-frame” UVs.
  • When a match is found, synthesizes a sub-area AnimatedTextureSet, generates lookup entries for it, and retries AddTexture so the sub-area can be treated as animated.
  • Implements the same logic in both the classic TR compiler texinfo manager and the TombEngine texinfo manager.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 10 comments.

File Description
TombLib/TombLib/LevelData/Compilers/Util/TexInfoManager.cs Adds sub-area animated-texture detection + synthetic sub-animation lookup generation for classic/TR compilers.
TombLib/TombLib/LevelData/Compilers/TombEngine/TombEngineTexInfoManager.cs Mirrors the sub-area animated-texture handling for TombEngine texture compilation.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@Nickelony Nickelony marked this pull request as draft February 23, 2026 18:56
@Nickelony Nickelony changed the title Fixed animated group textures not animating WIP: Fixed animated group textures not animating Feb 23, 2026
@Nickelony Nickelony added work in progress The Pull Request is not finished yet or needs some extra work done to it. labels Feb 23, 2026
Copy link
Copy Markdown
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

Copilot reviewed 2 out of 2 changed files in this pull request and generated 5 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@Nickelony Nickelony changed the title WIP: Fixed animated group textures not animating Fixed animated group textures not animating Mar 22, 2026
@Nickelony Nickelony marked this pull request as ready for review March 22, 2026 21:56
@Nickelony Nickelony added ready for review The Pull Request is finished and ready for review. and removed work in progress The Pull Request is not finished yet or needs some extra work done to it. labels Mar 22, 2026
@Nickelony Nickelony requested a review from Copilot March 22, 2026 21:56
Copy link
Copy Markdown
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

Copilot reviewed 2 out of 2 changed files in this pull request and generated 5 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Copy Markdown
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

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Copy Markdown
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

Copilot reviewed 3 out of 3 changed files in this pull request and generated no new comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Copy Markdown
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

Copilot reviewed 4 out of 4 changed files in this pull request and generated no new comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Copy Markdown
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

Copilot reviewed 4 out of 4 changed files in this pull request and generated no new comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@Nickelony
Copy link
Copy Markdown
Collaborator Author

This PR is now complete and ready for review.

@Nickelony Nickelony added this to the Version 2.0 milestone Mar 23, 2026
@Nickelony Nickelony added the enhancement A task which adds something new or improves on existing features. label Mar 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement A task which adds something new or improves on existing features. 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