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

Bug in SDL.pas C Macro conversions #28

Closed
mattsaintdev opened this issue Feb 8, 2016 · 1 comment
Closed

Bug in SDL.pas C Macro conversions #28

mattsaintdev opened this issue Feb 8, 2016 · 1 comment

Comments

@mattsaintdev
Copy link

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;

@mattsaintdev mattsaintdev changed the title Big in SDL.pas C Macro conversions Bug in SDL.pas C Macro conversions Feb 8, 2016
Free-Pascal-meets-SDL-Website added a commit to Free-Pascal-meets-SDL-Website/Pascal-SDL-2-Headers that referenced this issue Apr 22, 2016
- functions return Cardinal instead of Bool values
- bitwise AND'ing introduced
@Free-Pascal-meets-SDL-Website
Copy link
Contributor

I agree. I made a minor patch addressing this. I wonder if you use these functions?

ev1313 added a commit that referenced this issue Apr 24, 2016
functions repr. C macros corrected (see issue #28)
@ev1313 ev1313 closed this as completed Apr 24, 2016
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

No branches or pull requests

3 participants