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

BLADERUNNER: Allow using any 16-bit pixel format for the screen #1825

Closed
wants to merge 1 commit into from

Conversation

@ccawley2011
Copy link
Member

commented Aug 28, 2019

This should hopefully fix Trac#11078, and partially fix Trac#11036.

for (Common::List<Graphics::PixelFormat>::iterator g = tryModes.begin(); g != tryModes.end(); ++g) {
if (g->bytesPerPixel != 2) {
g = tryModes.reverse_erase(g);
} else if (*g == gameDataPixelFormat()) {

This comment has been minimized.

Copy link
@bluegr

bluegr Aug 29, 2019

Member

I don’t understand this pull request. We now get all the pixel formats which are supported by the backend, and then check if they contain the pixel format specified by the engine.

Why would we do that, and not just specify the needed pixel format in initGraphics()? The equality operator for PixelFormat checks for equality of the precision loss and left shift of each color component (a, r, g, b). So... why can’t we just specify the needed pixel format below?

This comment has been minimized.

Copy link
@ccawley2011

ccawley2011 Aug 29, 2019

Author Member

The issue with that is that if a game doesn't support the requested pixel format, the screen will remain in CLUT8 mode instead of trying to pick an alternative RGB mode. With this, if the required pixel format is available, the game will use that to reduce the amount of conversion required, but if not, it will try all available pixel formats with 2 bytes per pixel and use the first one that works.

This comment has been minimized.

Copy link
@bluegr

bluegr Aug 29, 2019

Member

Thanks for the explanation :)

@TheQL

This comment has been minimized.

Copy link

commented Aug 29, 2019

It indeed seems to fix #11036!

@raziel-

This comment has been minimized.

Copy link
Contributor

commented Aug 29, 2019

// Should be a format supported by Android port
return Graphics::PixelFormat(2, 5, 5, 5, 1, 11, 6, 1, 0);
}
Graphics::PixelFormat screenPixelFormat() {

This comment has been minimized.

Copy link
@peterkohaut

peterkohaut Aug 29, 2019

Contributor

you dont need to move this in into the class, if you keep it out and use ((BladeRunnerEngine *)g_engine) then you dont need all the other changes you made

@peterkohaut

This comment has been minimized.

Copy link
Contributor

commented Aug 31, 2019

sorry, but i've took some inspiration and created a7399c5 as we needed support for the best pixel format on every platform - because there was some slowdown on ps3 with 16bit formats

@digitall

This comment has been minimized.

Copy link
Member

commented Sep 1, 2019

@peterkohaut : Does a7399c5 render this PR obselete and thus it should be closed?

@bluegr

This comment has been minimized.

Copy link
Member

commented Sep 1, 2019

The commit by @peterkohaut does this for the pixel format used:

_screenPixelFormat = g_system->getSupportedFormats().front();

So, it would be preferable to use the code that determines the best format to use from this PR

@peterkohaut peterkohaut closed this Sep 1, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
6 participants
You can’t perform that action at this time.