From eef8cb06041b4206ac0a16a212e586947df839b4 Mon Sep 17 00:00:00 2001 From: Matthias Date: Thu, 1 Aug 2024 02:53:15 +0200 Subject: [PATCH 1/3] add type TSDL_Flip --- units/sdlrenderer.inc | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/units/sdlrenderer.inc b/units/sdlrenderer.inc index 32b74877..96448b4c 100644 --- a/units/sdlrenderer.inc +++ b/units/sdlrenderer.inc @@ -77,13 +77,18 @@ const SDL_TEXTUREMODULATE_COLOR = TSDL_TextureModulate(1); {**< srcC = srcC * color *} SDL_TEXTUREMODULATE_ALPHA = TSDL_TextureModulate(2); {**< srcA = srcA * alpha *} +type {** * Flip constants for SDL_RenderCopyEx *} + PPSDL_Flip = ^PSDL_Flip; + PSDL_Flip = ^TSDL_Flip; + TSDL_Flip = type cint; + const - SDL_FLIP_NONE = $0; {**< Do not flip *} - SDL_FLIP_HORIZONTAL = $1; {**< flip horizontally *} - SDL_FLIP_VERTICAL = $2; {**< flip vertically *} + SDL_FLIP_NONE = TSDL_Flip($0); {**< Do not flip *} + SDL_FLIP_HORIZONTAL = TSDL_Flip($1); {**< flip horizontally *} + SDL_FLIP_VERTICAL = TSDL_Flip($2); {**< flip vertically *} type {** From fd5d385c8c0eabcddc84d4e543bd47b451494532 Mon Sep 17 00:00:00 2001 From: Matthias Date: Thu, 1 Aug 2024 02:58:05 +0200 Subject: [PATCH 2/3] fix angle and flip var. types in RenderCopyEx/F --- units/sdlrenderer.inc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/units/sdlrenderer.inc b/units/sdlrenderer.inc index 96448b4c..6c72206b 100644 --- a/units/sdlrenderer.inc +++ b/units/sdlrenderer.inc @@ -894,7 +894,7 @@ function SDL_RenderCopyF(renderer: PSDL_Renderer; texture: PSDL_Texture; srcrect * * 0 on success, or -1 on error *} -function SDL_RenderCopyEx(renderer: PSDL_Renderer; texture: PSDL_Texture; const srcrect: PSDL_Rect; dstrect: PSDL_Rect; angle: Double; center: PSDL_Point; flip: cint): cint32 cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_RenderCopyEx' {$ENDIF} {$ENDIF}; +function SDL_RenderCopyEx(renderer: PSDL_Renderer; texture: PSDL_Texture; const srcrect: PSDL_Rect; dstrect: PSDL_Rect; angle: cdouble; center: PSDL_Point; flip: TSDL_Flip): cint32 cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_RenderCopyEx' {$ENDIF} {$ENDIF}; {** * Copy a portion of the source texture to the current rendering target, rotating it by angle around the given center @@ -909,7 +909,7 @@ function SDL_RenderCopyEx(renderer: PSDL_Renderer; texture: PSDL_Texture; const * * 0 on success, or -1 on error *} -function SDL_RenderCopyExF(renderer: PSDL_Renderer; texture: PSDL_Texture; const srcrect: PSDL_Rect; dstrect: PSDL_FRect; angle: Double; center: PSDL_FPoint; flip: cint): cint32 cdecl; +function SDL_RenderCopyExF(renderer: PSDL_Renderer; texture: PSDL_Texture; const srcrect: PSDL_Rect; dstrect: PSDL_FRect; angle: cdouble; center: PSDL_FPoint; flip: TSDL_Flip): cint32 cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_RenderCopyExF' {$ENDIF} {$ENDIF}; {** From ff68e3655143ddbbde2693b8718ac952c368201d Mon Sep 17 00:00:00 2001 From: Matthias Date: Thu, 1 Aug 2024 13:20:47 +0200 Subject: [PATCH 3/3] Fix: Renames flip type --- units/sdlrenderer.inc | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/units/sdlrenderer.inc b/units/sdlrenderer.inc index 6c72206b..afc8e201 100644 --- a/units/sdlrenderer.inc +++ b/units/sdlrenderer.inc @@ -81,14 +81,14 @@ type {** * Flip constants for SDL_RenderCopyEx *} - PPSDL_Flip = ^PSDL_Flip; - PSDL_Flip = ^TSDL_Flip; - TSDL_Flip = type cint; + PPSDL_RenderFlip = ^PSDL_RenderFlip; + PSDL_RenderFlip = ^TSDL_RenderFlip; + TSDL_RenderFlip = type cint; const - SDL_FLIP_NONE = TSDL_Flip($0); {**< Do not flip *} - SDL_FLIP_HORIZONTAL = TSDL_Flip($1); {**< flip horizontally *} - SDL_FLIP_VERTICAL = TSDL_Flip($2); {**< flip vertically *} + SDL_FLIP_NONE = TSDL_RenderFlip($0); {**< Do not flip *} + SDL_FLIP_HORIZONTAL = TSDL_RenderFlip($1); {**< flip horizontally *} + SDL_FLIP_VERTICAL = TSDL_RenderFlip($2); {**< flip vertically *} type {** @@ -894,7 +894,7 @@ function SDL_RenderCopyF(renderer: PSDL_Renderer; texture: PSDL_Texture; srcrect * * 0 on success, or -1 on error *} -function SDL_RenderCopyEx(renderer: PSDL_Renderer; texture: PSDL_Texture; const srcrect: PSDL_Rect; dstrect: PSDL_Rect; angle: cdouble; center: PSDL_Point; flip: TSDL_Flip): cint32 cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_RenderCopyEx' {$ENDIF} {$ENDIF}; +function SDL_RenderCopyEx(renderer: PSDL_Renderer; texture: PSDL_Texture; const srcrect: PSDL_Rect; dstrect: PSDL_Rect; angle: cdouble; center: PSDL_Point; flip: TSDL_RenderFlip): cint32 cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_RenderCopyEx' {$ENDIF} {$ENDIF}; {** * Copy a portion of the source texture to the current rendering target, rotating it by angle around the given center @@ -909,7 +909,7 @@ function SDL_RenderCopyEx(renderer: PSDL_Renderer; texture: PSDL_Texture; const * * 0 on success, or -1 on error *} -function SDL_RenderCopyExF(renderer: PSDL_Renderer; texture: PSDL_Texture; const srcrect: PSDL_Rect; dstrect: PSDL_FRect; angle: cdouble; center: PSDL_FPoint; flip: TSDL_Flip): cint32 cdecl; +function SDL_RenderCopyExF(renderer: PSDL_Renderer; texture: PSDL_Texture; const srcrect: PSDL_Rect; dstrect: PSDL_FRect; angle: cdouble; center: PSDL_FPoint; flip: TSDL_RenderFlip): cint32 cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_RenderCopyExF' {$ENDIF} {$ENDIF}; {**