We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 3257 - SDL_BITSPERPIXEL macro translations are incorrect
Summary: SDL_BITSPERPIXEL macro translations are incorrect
Status: RESOLVED INVALID
Alias: None
Product: SDL
Classification: Unclassified
Component: *don't know* (show other bugs)
Version: 2.0.4
Hardware: x86_64 Windows (All)
: P2 normal
Assignee: Ryan C. Gordon
QA Contact: Sam Lantinga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-02-08 16:29 UTC by Matthew Saint
Modified: 2016-02-08 16:36 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Matthew Saint 2016-02-08 16:29:31 UTC
Unit SDL.pas;

SDL_BITSPERPIXEL()
SDL_PIXELLAYOUT()
SDL_PIXELORDER()
SDL_PIXELTYPE()
SDL_PIXELFLAG()

Macro conversions are incorrect and should not return a bool but an Integer or Cardinal.

Further the Result should be AND'd with the mask not equated.

e.g of correct

Function SDL_BITSPERPIXEL(X: Cardinal): Cardinal;
Begin
  Result := (X Shr 8) And $FF;
End;
Comment 1 Matthew Saint 2016-02-08 16:36:07 UTC
Sorry wrong repository  - meant to use Delphi SDL on Git