Skip to content

Commit c022746

Browse files
committed
Handle another 0/-1 to true/false as a function instead of macro.
1 parent 5e4e88b commit c022746

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/SDLmzx.h

+6-3
Original file line numberDiff line numberDiff line change
@@ -375,23 +375,26 @@ typedef int SDL_RendererLogicalPresentation;
375375
#define SDL_SCALEMODE_BEST SDL_ScaleModeBest
376376
#define SDL_SCALEMODE_LINEAR SDL_ScaleModeLinear
377377
#define SDL_SCALEMODE_NEAREST SDL_ScaleModeNearest
378-
#define SDL_SetRenderClipRect(r, rect) (SDL_RenderSetClipRect((r), (rect)) == 0)
379378

380379
#if !SDL_VERSION_ATLEAST(2,0,12)
381380
typedef int SDL_ScaleMode;
382381
#endif
383382

383+
static inline SDL_bool SDL_SetRenderClipRect(SDL_Renderer *render,
384+
SDL_Rect *rect)
385+
{
386+
return (SDL_bool)(SDL_RenderSetClipRect(render, rect) == 0);
387+
}
388+
384389
static inline SDL_bool SDL_SetRenderLogicalPresentation(SDL_Renderer *render,
385390
int w, int h, SDL_RendererLogicalPresentation p, SDL_ScaleMode s)
386391
{
387-
// Return value 0/-1 -> true/false
388392
return (SDL_bool)(SDL_RenderSetLogicalSize(render, w, h) == 0);
389393
}
390394

391395
static inline SDL_bool SDL_RenderTexture(SDL_Renderer *renderer,
392396
SDL_Texture *texture, const SDL_Rect_mzx *src_rect, const SDL_Rect_mzx *dest_rect)
393397
{
394-
// Return value 0/-1 -> true/false
395398
return (SDL_bool)(SDL_RenderCopy(renderer, texture, src_rect, dest_rect) == 0);
396399
}
397400
#endif

0 commit comments

Comments
 (0)