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

Summary: SDL_BITSPERPIXEL macro translations are incorrect
Product: SDL Reporter: Matthew Saint <mattsaintdev>
Component: *don't know*Assignee: Ryan C. Gordon <icculus>
Status: RESOLVED INVALID QA Contact: Sam Lantinga <slouken>
Severity: normal    
Priority: P2    
Version: 2.0.4   
Hardware: x86_64   
OS: Windows (All)   

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