Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

output: remove texture info globals #2403

Merged
merged 4 commits into from
Jan 28, 2025
Merged

Conversation

lahm86
Copy link
Collaborator

@lahm86 lahm86 commented Jan 28, 2025

Checklist

  • I have read the coding conventions
  • I have added a changelog entry about what my pull request accomplishes, or it is an internal change
  • I have added a readme entry about my new feature or OG bug fix, or it is a different change

Description

This removes g_ObjectTextures, g_SpriteTextures, g_ObjectTextureCount and g_LabTextureUVFlag in favour of common accessors. LMK about the last commit for the renderer if this is an acceptable approach. We would have to shift the routine for setting up the UV adjustments anyway ahead of injection work to allow for additional tex infos to be added, so thought it best to tackle now.

Just a quick test is needed I think in game to ensure textures appear OK, as well as sprites, and with bilinear toggled and SWR etc.

This replaces g_ObjectTextures with static storage in the common output
module, and introduces an accessor.
This replaces g_SpriteTextures with static storage in the common output
module, and introduces an accessor.
This replaces g_ObjectTextureCount with static storage in the common
output module, and introduces an accessor. TR1 will also set this value
although it remains unused.
This removes the g_LabTextureUVFlag array and shifts responsibility to
the renderer fully for resetting these values.
@lahm86 lahm86 added Internal The invisible stuff TR2 TR1 labels Jan 28, 2025
@lahm86 lahm86 self-assigned this Jan 28, 2025
@lahm86 lahm86 requested review from a team as code owners January 28, 2025 10:41
@lahm86 lahm86 requested review from rr-, walkawayy and aredfan and removed request for a team January 28, 2025 10:41
Copy link
Collaborator

@rr- rr- left a comment

Choose a reason for hiding this comment

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

LGTM. The UV adjustment code is fine too. BTW maybe we could allocate textures dynamically via gamebuf like level.c things? The pixel data will be held in GFX Surface anyway so it shouldn't use up too much space.
Offtop: do we know what the Lab Texture UV Flag is for?

@lahm86
Copy link
Collaborator Author

lahm86 commented Jan 28, 2025

Sounds good. I was thinking we could tackle raising the various limits next too, so shifting to game buf would be nice to do in the same task. I think we'd need to increase the game memory though to match TR1 as we're currently only on 7.5MB compared with 128MB.

I think the lab UV flag is related to the bleeding issue with bilinear filter on, but I admit I don't fully understand how it works.

@lahm86 lahm86 merged commit 8b57e7f into LostArtefacts:develop Jan 28, 2025
8 checks passed
@lahm86 lahm86 deleted the tex-infos branch January 28, 2025 13:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Internal The invisible stuff TR1 TR2
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

3 participants