KEMBAR78
IOS7: Add support for 32 bit pixel formats by larsamannen · Pull Request #4694 · scummvm/scummvm · GitHub
Skip to content

Conversation

@larsamannen
Copy link
Contributor

No description provided.

Copy link
Member

@criezy criezy left a comment

Choose a reason for hiding this comment

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

There is some confusion with the color formats in your comments and function names. See the comments I added for more details. The support you add is actually for RGBA8888 and not ARGB8888.

Other than that, since you need to swap the bytes with RGBA8888, it could be a good idea to also add support for ABGR8888 (Graphics::PixelFormat(4, 8, 8, 8, 8, 0, 8, 16, 24)), and to list it first in the list of supported pixel formats. Indeed as documented some engines assume that the first listed format is the preferred one, and use it. And in this case it would be the most efficient one since it matches what you need to pass to the glTexImage2D call (so no byte swap is needed). That should improve performances for those engines. One example that could be tested is AGS games.

@larsamannen
Copy link
Contributor Author

Ah, I mixed up the formats.
Thank you for clarifying. I will update accordingly.

@larsamannen larsamannen changed the title IOS7: Add ARGB8888 support IOS7: Add support for 32 bit pixel formats Feb 9, 2023
Copy link
Member

@criezy criezy left a comment

Choose a reason for hiding this comment

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

Looking good. You forgot a change in configure though.

I also made another suggestion, but I think that one could be kept for later.

Add Apple Accelerate framework to iOS and tvOS targets. The framework
utilizes NEON extensions on the ARM chip to accelerate calculations.
This will come to use when processing texture data.
This enables some game engines only supporting 32 bit color formats,
e.g. 11th hour and Broken Sword 2.5.

Add support for the pixel formats RGBA8888 and ABGR8888. The pixel
formats are defined in big endian while iOS utilizes little endian,
thus requiring converting some formats to get correct color
representation.

Use the Apple Accelerate framework converting the format requiring
to minimize the CPU load since this is done every frame.
Copy link
Member

@criezy criezy left a comment

Choose a reason for hiding this comment

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

It looks good now. Thank you!

@criezy
Copy link
Member

criezy commented Feb 9, 2023

I will merge this now.

@criezy criezy merged commit 4dc9c87 into scummvm:master Feb 9, 2023
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.

2 participants