Skip to content

Conversation

@ajtribick
Copy link
Collaborator

@ajtribick ajtribick commented Dec 31, 2025

Like #2421 but for textures. Includes changes from #2422

MultiResTexture goes away and is replaced by a single integer (actually enum class) TextureHandle - resolution selection is now done by TextureManager. Changing resolution results in unloading of GPU textures. Paths to all resolutions are resolved at the time of creation of a new TextureHandle.

Note that ring shadow textures are loaded at a maximum of medium resolution, so there is some additional handling of that. On the other hand, unlike meshes the image data is not queried once it goes to the GPU (for meshes the CPU-side data is used for testing object selections), so there is only one TextureManager class instead of a TextureManager/RenderTextureManager split.

Fixes #649

@ajtribick ajtribick force-pushed the texmanager branch 4 times, most recently from 6d05aeb to a33d22b Compare December 31, 2025 14:23
@ajtribick ajtribick marked this pull request as ready for review December 31, 2025 14:23
@375gnu
Copy link
Collaborator

375gnu commented Jan 4, 2026

It's a big change to go through right now, does it fix #649?

@ajtribick
Copy link
Collaborator Author

Just checked, yes it does fix that issue.

Might be easier to do #2422 first, then I can rebase this one to have only the texture manager changes.

@ajtribick ajtribick marked this pull request as draft January 4, 2026 21:36
@ajtribick
Copy link
Collaborator Author

Need to fix some issues in #2422

- Results in a cleaner API with more explicit allocation semantics
- Remove comparator in mesh sort API: always uses opacity comparison
@ajtribick ajtribick marked this pull request as ready for review January 10, 2026 12:34
@ajtribick ajtribick requested a review from a team January 10, 2026 12:34
@ajtribick ajtribick marked this pull request as draft January 11, 2026 00:50
@ajtribick ajtribick marked this pull request as ready for review January 11, 2026 01:26
- Replace singleton texture manager with instance classes
- Split path and OpenGL objects handling into TexturePaths and TextureManager
- Resolve all resolution paths at the time of creating the handle
- Remove MultiTexture class - resolution selection done in TextureManager
- Changing resolution or destroying Renderer destroys all loaded GPU textures
@sonarqubecloud
Copy link

@ajtribick
Copy link
Collaborator Author

Issue mentioned in #2439 is fixed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Sprite objects loaded from DSC files look only for medres textures

3 participants