Skip to content

Convert all cbool occurrences to Boolean #27

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

Merged
merged 1 commit into from
Jun 1, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions units/SDL3.pas
Original file line number Diff line number Diff line change
Expand Up @@ -174,38 +174,38 @@ procedure SDL_RectToFRect(const rect: PSDL_Rect; frect: PSDL_FRect);
frect^.h:=cfloat(rect^.h);
end;

function SDL_PointInRect(const p: PSDL_Point; const r: PSDL_Rect): cbool;
function SDL_PointInRect(const p: PSDL_Point; const r: PSDL_Rect): Boolean;
begin
Result :=
(p <> nil) and (r <> nil) and (p^.x >= r^.x) and (p^.x < (r^.x + r^.w)) and
(p^.y >= r^.y) and (p^.y < (r^.y + r^.h));
end;

function SDL_RectEmpty(const r: PSDL_Rect): cbool;
function SDL_RectEmpty(const r: PSDL_Rect): Boolean;
begin
Result := (r = nil) or (r^.w <= 0) or (r^.h <= 0);
end;

function SDL_RectsEqual(const a: PSDL_Rect; const b: PSDL_Rect): cbool;
function SDL_RectsEqual(const a: PSDL_Rect; const b: PSDL_Rect): Boolean;
begin
Result := (a <> nil) and (b <> nil) and (a^.x = b^.x) and (a^.y = b^.y) and
(a^.w = b^.w) and (a^.h = b^.h);
end;

function SDL_PointInRectFloat(const p: PSDL_FPoint; const r: PSDL_FRect): cbool;
function SDL_PointInRectFloat(const p: PSDL_FPoint; const r: PSDL_FRect): Boolean;
begin
Result :=
(p <> nil) and (r <> nil) and (p^.x >= r^.x) and (p^.x <= (r^.x + r^.w)) and
(p^.y >= r^.y) and (p^.y <= (r^.y + r^.h));
end;

function SDL_RectEmptyFloat(const r: PSDL_FRect): cbool;
function SDL_RectEmptyFloat(const r: PSDL_FRect): Boolean;
begin
Result := (r = nil) or (r^.w < cfloat(0.0)) or (r^.h < cfloat(0.0));
end;

function SDL_RectsEqualEpsilon(const a: PSDL_Frect; const b: PSDL_FRect;
const epsilon: cfloat): cbool;
const epsilon: cfloat): Boolean;
begin
Result :=
(a <> nil) and (b <> nil) and ((a = b) or
Expand All @@ -215,7 +215,7 @@ function SDL_RectsEqualEpsilon(const a: PSDL_Frect; const b: PSDL_FRect;
(SDL_fabsf(a^.h - b^.h) <= epsilon)));
end;

function SDL_RectsEqualFloat(const a: PSDL_FRect; b: PSDL_FRect): cbool;
function SDL_RectsEqualFloat(const a: PSDL_FRect; b: PSDL_FRect): Boolean;
begin
Result := SDL_RectsEqualEpsilon(a, b, SDL_FLT_EPSILON);
end;
Expand Down Expand Up @@ -336,7 +336,7 @@ function SDL_AtomicIncRef(a: PSDL_AtomicInt): cint;
SDL_AtomicIncRef:=SDL_AddAtomicInt(a,1);
end;

function SDL_AtomicDecRef(a: PSDL_AtomicInt): cbool;
function SDL_AtomicDecRef(a: PSDL_AtomicInt): Boolean;
begin
SDL_AtomicDecRef:=(SDL_AddAtomicInt(a,-1)=1);
end;
Expand Down
60 changes: 30 additions & 30 deletions units/SDL3_image.pas
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ function IMG_Version: cint; cdecl;
* \sa IMG_Load_IO
* \sa SDL_DestroySurface
}
function IMG_LoadTyped_IO(src: PSDL_IOStream; closeio: cbool; type_: PAnsiChar): PSDL_Surface; cdecl;
function IMG_LoadTyped_IO(src: PSDL_IOStream; closeio: Boolean; type_: PAnsiChar): PSDL_Surface; cdecl;
external IMG_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_IMG_LoadTyped_IO' {$ENDIF} {$ENDIF};

{*
Expand Down Expand Up @@ -271,7 +271,7 @@ function IMG_Load(file_: PAnsiChar): PSDL_Surface; cdecl;
* \sa IMG_LoadTyped_IO
* \sa SDL_DestroySurface
}
function IMG_Load_IO(src: PSDL_IOStream; closeio: cbool): PSDL_Surface; cdecl;
function IMG_Load_IO(src: PSDL_IOStream; closeio: Boolean): PSDL_Surface; cdecl;
external IMG_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_IMG_Load_IO' {$ENDIF} {$ENDIF};

{*
Expand Down Expand Up @@ -355,7 +355,7 @@ function IMG_LoadTexture(renderer: PSDL_Renderer; file_: PAnsiChar): PSDL_Textur
* \sa IMG_LoadTextureTyped_IO
* \sa SDL_DestroyTexture
}
function IMG_LoadTexture_IO(renderer: PSDL_Renderer; src: PSDL_IOStream; closeio: cbool): PSDL_Texture; cdecl;
function IMG_LoadTexture_IO(renderer: PSDL_Renderer; src: PSDL_IOStream; closeio: Boolean): PSDL_Texture; cdecl;
external IMG_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_IMG_LoadTexture_IO' {$ENDIF} {$ENDIF};

{*
Expand Down Expand Up @@ -411,7 +411,7 @@ function IMG_LoadTexture_IO(renderer: PSDL_Renderer; src: PSDL_IOStream; closeio
* \sa IMG_LoadTexture_IO
* \sa SDL_DestroyTexture
}
function IMG_LoadTextureTyped_IO(renderer: PSDL_Renderer; src: PSDL_IOStream; closeio: cbool; type_: PAnsiChar): PSDL_Texture; cdecl;
function IMG_LoadTextureTyped_IO(renderer: PSDL_Renderer; src: PSDL_IOStream; closeio: Boolean; type_: PAnsiChar): PSDL_Texture; cdecl;
external IMG_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_IMG_LoadTextureTyped_IO' {$ENDIF} {$ENDIF};

{*
Expand Down Expand Up @@ -456,7 +456,7 @@ function IMG_LoadTextureTyped_IO(renderer: PSDL_Renderer; src: PSDL_IOStream; cl
* \sa IMG_isXV
* \sa IMG_isWEBP
}
function IMG_isAVIF(src: PSDL_IOStream): cbool; cdecl;
function IMG_isAVIF(src: PSDL_IOStream): Boolean; cdecl;
external IMG_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_IMG_isAVIF' {$ENDIF} {$ENDIF};

{*
Expand Down Expand Up @@ -500,7 +500,7 @@ function IMG_isAVIF(src: PSDL_IOStream): cbool; cdecl;
* \sa IMG_isXV
* \sa IMG_isWEBP
}
function IMG_isICO(src: PSDL_IOStream): cbool; cdecl;
function IMG_isICO(src: PSDL_IOStream): Boolean; cdecl;
external IMG_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_IMG_isICO' {$ENDIF} {$ENDIF};

{*
Expand Down Expand Up @@ -544,7 +544,7 @@ function IMG_isICO(src: PSDL_IOStream): cbool; cdecl;
* \sa IMG_isXV
* \sa IMG_isWEBP
}
function IMG_isCUR(src: PSDL_IOStream): cbool; cdecl;
function IMG_isCUR(src: PSDL_IOStream): Boolean; cdecl;
external IMG_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_IMG_isCUR' {$ENDIF} {$ENDIF};

{*
Expand Down Expand Up @@ -588,7 +588,7 @@ function IMG_isCUR(src: PSDL_IOStream): cbool; cdecl;
* \sa IMG_isXV
* \sa IMG_isWEBP
}
function IMG_isBMP(src: PSDL_IOStream): cbool; cdecl;
function IMG_isBMP(src: PSDL_IOStream): Boolean; cdecl;
external IMG_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_IMG_isBMP' {$ENDIF} {$ENDIF};

{*
Expand Down Expand Up @@ -632,7 +632,7 @@ function IMG_isBMP(src: PSDL_IOStream): cbool; cdecl;
* \sa IMG_isXV
* \sa IMG_isWEBP
}
function IMG_isGIF(src: PSDL_IOStream): cbool; cdecl;
function IMG_isGIF(src: PSDL_IOStream): Boolean; cdecl;
external IMG_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_IMG_isGIF' {$ENDIF} {$ENDIF};

{*
Expand Down Expand Up @@ -676,7 +676,7 @@ function IMG_isGIF(src: PSDL_IOStream): cbool; cdecl;
* \sa IMG_isXV
* \sa IMG_isWEBP
}
function IMG_isJPG(src: PSDL_IOStream): cbool; cdecl;
function IMG_isJPG(src: PSDL_IOStream): Boolean; cdecl;
external IMG_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_IMG_isJPG' {$ENDIF} {$ENDIF};

{*
Expand Down Expand Up @@ -720,7 +720,7 @@ function IMG_isJPG(src: PSDL_IOStream): cbool; cdecl;
* \sa IMG_isXV
* \sa IMG_isWEBP
}
function IMG_isJXL(src: PSDL_IOStream): cbool; cdecl;
function IMG_isJXL(src: PSDL_IOStream): Boolean; cdecl;
external IMG_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_IMG_isJXL' {$ENDIF} {$ENDIF};

{*
Expand Down Expand Up @@ -764,7 +764,7 @@ function IMG_isJXL(src: PSDL_IOStream): cbool; cdecl;
* \sa IMG_isXV
* \sa IMG_isWEBP
}
function IMG_isLBM(src: PSDL_IOStream): cbool; cdecl;
function IMG_isLBM(src: PSDL_IOStream): Boolean; cdecl;
external IMG_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_IMG_isLBM' {$ENDIF} {$ENDIF};

{*
Expand Down Expand Up @@ -808,7 +808,7 @@ function IMG_isLBM(src: PSDL_IOStream): cbool; cdecl;
* \sa IMG_isXV
* \sa IMG_isWEBP
}
function IMG_isPCX(src: PSDL_IOStream): cbool; cdecl;
function IMG_isPCX(src: PSDL_IOStream): Boolean; cdecl;
external IMG_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_IMG_isPCX' {$ENDIF} {$ENDIF};

{*
Expand Down Expand Up @@ -852,7 +852,7 @@ function IMG_isPCX(src: PSDL_IOStream): cbool; cdecl;
* \sa IMG_isXV
* \sa IMG_isWEBP
}
function IMG_isPNG(src: PSDL_IOStream): cbool; cdecl;
function IMG_isPNG(src: PSDL_IOStream): Boolean; cdecl;
external IMG_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_IMG_isPNG' {$ENDIF} {$ENDIF};

{*
Expand Down Expand Up @@ -896,7 +896,7 @@ function IMG_isPNG(src: PSDL_IOStream): cbool; cdecl;
* \sa IMG_isXV
* \sa IMG_isWEBP
}
function IMG_isPNM(src: PSDL_IOStream): cbool; cdecl;
function IMG_isPNM(src: PSDL_IOStream): Boolean; cdecl;
external IMG_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_IMG_isPNM' {$ENDIF} {$ENDIF};

{*
Expand Down Expand Up @@ -940,7 +940,7 @@ function IMG_isPNM(src: PSDL_IOStream): cbool; cdecl;
* \sa IMG_isXV
* \sa IMG_isWEBP
}
function IMG_isSVG(src: PSDL_IOStream): cbool; cdecl;
function IMG_isSVG(src: PSDL_IOStream): Boolean; cdecl;
external IMG_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_IMG_isSVG' {$ENDIF} {$ENDIF};

{*
Expand Down Expand Up @@ -984,7 +984,7 @@ function IMG_isSVG(src: PSDL_IOStream): cbool; cdecl;
* \sa IMG_isXV
* \sa IMG_isWEBP
}
function IMG_isQOI(src: PSDL_IOStream): cbool; cdecl;
function IMG_isQOI(src: PSDL_IOStream): Boolean; cdecl;
external IMG_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_IMG_isQOI' {$ENDIF} {$ENDIF};

{*
Expand Down Expand Up @@ -1028,7 +1028,7 @@ function IMG_isQOI(src: PSDL_IOStream): cbool; cdecl;
* \sa IMG_isXV
* \sa IMG_isWEBP
}
function IMG_isTIF(src: PSDL_IOStream): cbool; cdecl;
function IMG_isTIF(src: PSDL_IOStream): Boolean; cdecl;
external IMG_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_IMG_isTIF' {$ENDIF} {$ENDIF};

{*
Expand Down Expand Up @@ -1072,7 +1072,7 @@ function IMG_isTIF(src: PSDL_IOStream): cbool; cdecl;
* \sa IMG_isXV
* \sa IMG_isWEBP
}
function IMG_isXCF(src: PSDL_IOStream): cbool; cdecl;
function IMG_isXCF(src: PSDL_IOStream): Boolean; cdecl;
external IMG_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_IMG_isXCF' {$ENDIF} {$ENDIF};

{*
Expand Down Expand Up @@ -1116,7 +1116,7 @@ function IMG_isXCF(src: PSDL_IOStream): cbool; cdecl;
* \sa IMG_isXV
* \sa IMG_isWEBP
}
function IMG_isXPM(src: PSDL_IOStream): cbool; cdecl;
function IMG_isXPM(src: PSDL_IOStream): Boolean; cdecl;
external IMG_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_IMG_isXPM' {$ENDIF} {$ENDIF};

{*
Expand Down Expand Up @@ -1160,7 +1160,7 @@ function IMG_isXPM(src: PSDL_IOStream): cbool; cdecl;
* \sa IMG_isXPM
* \sa IMG_isWEBP
}
function IMG_isXV(src: PSDL_IOStream): cbool; cdecl;
function IMG_isXV(src: PSDL_IOStream): Boolean; cdecl;
external IMG_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_IMG_isXV' {$ENDIF} {$ENDIF};

{*
Expand Down Expand Up @@ -1204,7 +1204,7 @@ function IMG_isXV(src: PSDL_IOStream): cbool; cdecl;
* \sa IMG_isXPM
* \sa IMG_isXV
}
function IMG_isWEBP(src: PSDL_IOStream): cbool; cdecl;
function IMG_isWEBP(src: PSDL_IOStream): Boolean; cdecl;
external IMG_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_IMG_isWEBP' {$ENDIF} {$ENDIF};

{*
Expand Down Expand Up @@ -1950,7 +1950,7 @@ function IMG_ReadXPMFromArrayToRGB888(xpm: PPAnsiChar): PSDL_Surface; cdecl;
*
* \sa IMG_SaveAVIF_IO
}
function IMG_SaveAVIF(surface: PSDL_Surface; file_: PAnsiChar; quality: cint): cbool; cdecl;
function IMG_SaveAVIF(surface: PSDL_Surface; file_: PAnsiChar; quality: cint): Boolean; cdecl;
external IMG_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_IMG_SaveAVIF' {$ENDIF} {$ENDIF};

{*
Expand All @@ -1974,7 +1974,7 @@ function IMG_SaveAVIF(surface: PSDL_Surface; file_: PAnsiChar; quality: cint): c
*
* \sa IMG_SaveAVIF
}
function IMG_SaveAVIF_IO(surface: PSDL_Surface; dst: PSDL_IOStream; closeio: cbool; quality: cint): cbool; cdecl;
function IMG_SaveAVIF_IO(surface: PSDL_Surface; dst: PSDL_IOStream; closeio: Boolean; quality: cint): Boolean; cdecl;
external IMG_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_IMG_SaveAVIF_IO' {$ENDIF} {$ENDIF};

{*
Expand All @@ -1991,7 +1991,7 @@ function IMG_SaveAVIF_IO(surface: PSDL_Surface; dst: PSDL_IOStream; closeio: cbo
*
* \sa IMG_SavePNG_IO
}
function IMG_SavePNG(surface: PSDL_Surface; file_: PAnsiChar): cbool; cdecl;
function IMG_SavePNG(surface: PSDL_Surface; file_: PAnsiChar): Boolean; cdecl;
external IMG_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_IMG_SavePNG' {$ENDIF} {$ENDIF};

{*
Expand All @@ -2013,7 +2013,7 @@ function IMG_SavePNG(surface: PSDL_Surface; file_: PAnsiChar): cbool; cdecl;
*
* \sa IMG_SavePNG
}
function IMG_SavePNG_IO(surface: PSDL_Surface; dst: PSDL_IOStream; closeio: cbool): cbool; cdecl;
function IMG_SavePNG_IO(surface: PSDL_Surface; dst: PSDL_IOStream; closeio: Boolean): Boolean; cdecl;
external IMG_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_IMG_SavePNG_IO' {$ENDIF} {$ENDIF};

{*
Expand All @@ -2032,7 +2032,7 @@ function IMG_SavePNG_IO(surface: PSDL_Surface; dst: PSDL_IOStream; closeio: cboo
*
* \sa IMG_SaveJPG_IO
}
function IMG_SaveJPG(surface: PSDL_Surface; file_: PAnsiChar; quality: cint): cbool; cdecl;
function IMG_SaveJPG(surface: PSDL_Surface; file_: PAnsiChar; quality: cint): Boolean; cdecl;
external IMG_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_IMG_SaveJPG' {$ENDIF} {$ENDIF};

{*
Expand All @@ -2056,7 +2056,7 @@ function IMG_SaveJPG(surface: PSDL_Surface; file_: PAnsiChar; quality: cint): cb
*
* \sa IMG_SaveJPG
}
function IMG_SaveJPG_IO(surface: PSDL_Surface; dst: PSDL_IOStream; closeio: cbool; quality: cint): cbool; cdecl;
function IMG_SaveJPG_IO(surface: PSDL_Surface; dst: PSDL_IOStream; closeio: Boolean; quality: cint): Boolean; cdecl;
external IMG_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_IMG_SaveJPG_IO' {$ENDIF} {$ENDIF};

{*
Expand Down Expand Up @@ -2110,7 +2110,7 @@ function IMG_LoadAnimation(file_: PAnsiChar): PIMG_Animation; cdecl;
*
* \sa IMG_FreeAnimation
}
function IMG_LoadAnimation_IO(src: PSDL_IOStream; closeio: cbool): PIMG_Animation; cdecl;
function IMG_LoadAnimation_IO(src: PSDL_IOStream; closeio: Boolean): PIMG_Animation; cdecl;
external IMG_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_IMG_LoadAnimation_IO' {$ENDIF} {$ENDIF};

{*
Expand Down Expand Up @@ -2141,7 +2141,7 @@ function IMG_LoadAnimation_IO(src: PSDL_IOStream; closeio: cbool): PIMG_Animatio
* \sa IMG_LoadAnimation_IO
* \sa IMG_FreeAnimation
}
function IMG_LoadAnimationTyped_IO(src: PSDL_IOStream; closeio: cbool; type_: PAnsiChar): PIMG_Animation; cdecl;
function IMG_LoadAnimationTyped_IO(src: PSDL_IOStream; closeio: Boolean; type_: PAnsiChar): PIMG_Animation; cdecl;
external IMG_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_IMG_LoadAnimationTyped_IO' {$ENDIF} {$ENDIF};

{*
Expand Down
6 changes: 3 additions & 3 deletions units/SDL3_textengine.pas
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ TTTF_TextData = record
font: PTTF_Font; {*< The font used by this text, read-only. }
color: TSDL_FColor; {*< The color of the text, read-only. }

needs_layout_update: cbool; {*< True if the layout needs to be updated }
needs_layout_update: Boolean;{*< True if the layout needs to be updated }
layout: PTTF_TextLayout; {*< Cached layout information, read-only. }
x: cint; {*< The x offset of the upper left corner of this text, in pixels, read-only. }
y: cint; {*< The y offset of the upper left corner of this text, in pixels, read-only. }
Expand All @@ -151,7 +151,7 @@ TTTF_TextData = record

props: TSDL_PropertiesID; {*< Custom properties associated with this text, read-only. This field is created as-needed using TTF_GetTextProperties() and the properties may be then set and read normally }

needs_engine_update: cbool; {*< True if the engine text needs to be updated }
needs_engine_update: Boolean;{*< True if the engine text needs to be updated }
engine: PTTF_TextEngine; {*< The engine used to render this text, read-only. }
engine_text: Pointer; {*< The implementation-specific representation of this text }
end;
Expand Down Expand Up @@ -181,7 +181,7 @@ TTTF_TextEngine = record
* \param userdata the userdata Pointer in this interface.
* \param text the text object being created.
}
CreateText: function(userdata: Pointer; text: PTTF_Text): cbool; cdecl;
CreateText: function(userdata: Pointer; text: PTTF_Text): Boolean; cdecl;

{*
* Destroy a text representation.
Expand Down
Loading