KEMBAR78
GRAPHICS: Remove alpha channel for screenshots (OPENGL) by tag2015 · Pull Request #4854 · scummvm/scummvm · GitHub
Skip to content

Conversation

@tag2015
Copy link
Contributor

@tag2015 tag2015 commented Mar 29, 2023

Preserving the alpha channel for screenshots is not really needed and causes problems in
the AGS engine (and possibily other engines) in OpenGL mode.

Fixes TRAC #13348

NOTE: please test on big endian machines

@tag2015 tag2015 force-pushed the screenshots_noalpha branch from 45e0b6a to 6b6c57e Compare March 29, 2023 21:16
@dwatteau
Copy link
Contributor

NOTE: please test on big endian machines

It might take me some days to do this, maybe @raziel- could help? Otherwise, I'm not sure I'm going to have time to test this before next week, FWIW.

Thanks

@raziel-
Copy link
Contributor

raziel- commented Mar 30, 2023

I've seen this and have it on my todo list.
Unfortunately I'm also not able to test before april

@lephilousophe
Copy link
Member

It would be simpler to call glReadPixels with GL_RGB instead of doing the conversion afterwards.

@tag2015
Copy link
Contributor Author

tag2015 commented Mar 31, 2023

It would be simpler to call glReadPixels with GL_RGB instead of doing the conversion afterwards.

You mean just changing line 1747 to
GL_CALL(glReadPixels(0, 0, width, height, GL_RGB, GL_UNSIGNED_BYTE, &pixels.front()));
and initialize the data Surface using the RGB888 pixelformat?
That doesn't work, at least on my Win10. The resulting image is always corrupted

@lephilousophe
Copy link
Member

lephilousophe commented Apr 1, 2023

Indeed I missed the GL_PACK_ALIGNMENT which is set up to 4.
I have something working on Linux here: lephilousophe@40112c5

@tag2015
Copy link
Contributor Author

tag2015 commented Apr 1, 2023

Indeed I missed the GL_PACK_ALIGNMENT which is set up to 4. I have something working on Linux here: lephilousophe@40112c5

Thanks! I can confirm that your version works with Windows as well.

Preserving the alpha channel for screenshots
is not really needed and causes problems in
the AGS engine (and possibily other engines)
@lephilousophe
Copy link
Member

I updated this PR with my changes but I rebased without building.
So I wait for the CI to finish and merge this.

@lephilousophe lephilousophe merged commit 2c1741e into scummvm:master Apr 2, 2023
@tag2015 tag2015 deleted the screenshots_noalpha branch April 27, 2023 09:35
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.

4 participants