Potential rotated bitmap code update needed for compatibility with 2.7.5

Documenting an issue which was reported to me in factory farming with SDK 2.7.5. The right hand information bar with money, compass and other indicators is no longer displaying in this build.

(left FF demo v1.7 in 2.7.3, right FF demo rebuilt in 2.7.5)

As this content is pre-rendered into a bitmap which is then drawn 90 degrees rotated, I expect the bugfixes in the API with regards to rotation might have caused this side effect.

Investigating...

1 Like

Right, think its understood, up to now the code was having to deal with the buggy behaviour noted at drawRotatedBitmap Draws from wrong center if degrees is one of the four cardinal directions

But as of SDK 2.7.5, the line

needs to change to

pd->graphics->drawRotatedBitmap(m_UIBitmapRightRotated, TILE_PIX, 0, 90.0f, 0.0f, 0.0f, 1.0f, 1.0f);

to apply a 16 pixel offset in x.

Checking other games too...

Cascada has 4 calls of drawRotatedBitmap, but none of them seem to have changed behaviour.

You Cannot Go Back's call which enables playing the game when holding the PD in portrait orientation is affected however by the change.

Where the x offset in this line YouCannotGoBack/playdate/src/game.c at master · timboe/YouCannotGoBack · GitHub needs to change from -56 to 184 in order to move the rotated bitmap back onto the screen.

I can certainly provide fixed builds which work correctly from 2.7.5, but I will hold off a bit from pushing updates here - as this could potentially be affecting a reasonable fraction of the current PD content library. It would be good to know how confident we are that the bugfix will not be reverted due to backwards compatibility issues (cc @dave).

1 Like

Given no other activity on this thread, I will push updates now which comply with the bug-fixed rotation API.

1 Like

Sorry for the trouble! I've been on a sorely needed vacation since last week, haven't had a chance to look at this yet. I should have added a version check there since it's a behavior change. :frowning: And we didn't bump the pdxversion tag in 2.7.5 so it's impossible to target that version specifically if we were to add a version check now--we'd only be able to identify builds against the 2.7.2 SDK and before. I guess that's better than nothing, but very little and too late.

1 Like

Hi @dave - hope you had a nice break!

Putting the new behaviour behind a check against >= 2.7.2 sounds fine. If there are 2.7.2-2.7.4 builds out there that are still affected by the change then at least the developer should still be active in these cases.

2 Likes