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

Gfx refactor #1997

Merged
merged 19 commits into from
Dec 9, 2024
Merged

Gfx refactor #1997

merged 19 commits into from
Dec 9, 2024

Conversation

rr-
Copy link
Collaborator

@rr- rr- commented Dec 9, 2024

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

Description

Extracted from #1983. Reorganizes and extends the gfx module in a couple of ways:

  • Fixes invalid parameter message at the start of TR1
  • Makes color key alpha blending optional by introducing a new alpha mode for it (necessary for the TR2 software renderer, to not have transparent pixels)
  • Adds support for repeated images to the 2d renderer (necessary for the TR2 inventory texture background)
  • Adds support for custom texture UVs to the 2d renderer (necessary for the TR2 inventory texture background)
  • Adds support for paletted output to the 2d renderer (necessary for the TR2 software renderer)
  • Adds support for alpha masks to the 2d renderer (necessary for the TR2 software renderer, to let it use different palettes for the background image and for the rest of the game)
  • Adds optional vignetting effect to the 2d renderer (necessary for the TR2 inventory texture background)
  • Adds ability to disable the z buffer in the 3d renderer (necessary for the TR2 toggle z buffer option)
  • Adds a fade renderer (necessary for the fade effects; used only in TR2 in Ditch DirectX in favor of OpenGL; use SDL window; ditch Windows Registry #1983 at the moment)
  • Adds ability to reduce viewport size by a fixed percentage in the gfx context (necessary for the TR2 sizer option)
  • Fixes unspecified strides in the 2d renderer (which is likely to be responsible for TR1X bug: incorrect pixel format and stride pair on some devices #1979)
  • Fixes vertex stream and certain uniforms sometimes not being bound in the 3d renderer
  • Privatizes 3D and 2D renderer internals
  • Removes surface locking/unlocking concept mirrored from the DirectX APIs, but useless in our case
  • Removes sampler from the 2D renderer, which adds no value

None of these changes, aside from fixed uninitialized strides, alter the game or introduce new settings – these are only internal API changes.

Since the GFX module is not used at all by TR2 in develop, and TR1 doesn't use any of the new features, I suppose it's sufficient to only do light sanity testing of TR1.

@rr- rr- added the Internal The invisible stuff label Dec 9, 2024
@rr- rr- self-assigned this Dec 9, 2024
@rr- rr- requested review from a team as code owners December 9, 2024 22:29
@rr- rr- requested review from lahm86, walkawayy and aredfan and removed request for a team December 9, 2024 22:29
@rr- rr- merged commit e4a0e6d into develop Dec 9, 2024
7 checks passed
@rr- rr- deleted the gfx-refactor branch December 9, 2024 22:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Internal The invisible stuff
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

4 participants