Skip to content

Commit

Permalink
Updated to the latest version of SDL
Browse files Browse the repository at this point in the history
  • Loading branch information
slouken committed Sep 18, 2024
1 parent 0077d43 commit 7a89a38
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
12 changes: 6 additions & 6 deletions include/SDL3_rtf/SDL_rtf.h
Original file line number Diff line number Diff line change
Expand Up @@ -147,34 +147,34 @@ extern SDL_DECLSPEC RTF_Context * SDLCALL RTF_CreateContext(SDL_Renderer *render
*
* \param ctx the RTF context to update.
* \param file the file path to load RTF data from.
* \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError()
* \returns true on success or false on failure; call SDL_GetError()
* for more information.
*
* \since This function is available since SDL_rtf 3.0.0.
*/
extern SDL_DECLSPEC SDL_bool SDLCALL RTF_Load(RTF_Context *ctx, const char *file);
extern SDL_DECLSPEC bool SDLCALL RTF_Load(RTF_Context *ctx, const char *file);

/**
* Set the text of an RTF context, with data loaded from an SDL_IOStream.
*
* This can be called multiple times to change the text displayed.
*
* If `closeio` is SDL_TRUE, this function will close `src`, whether this
* If `closeio` is true, this function will close `src`, whether this
* function succeeded or not.
*
* On failure, call RTF_GetError() to get a human-readable text message
* corresponding to the error.
*
* \param ctx the RTF context to update.
* \param src the SDL_IOStream to load RTF data from.
* \param closeio SDL_TRUE to close `src` when the font is closed, SDL_FALSE
* \param closeio true to close `src` when the font is closed, false
* to leave it open.
* \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError()
* \returns true on success or false on failure; call SDL_GetError()
* for more information.
*
* \since This function is available since SDL_rtf 3.0.0.
*/
extern SDL_DECLSPEC SDL_bool SDLCALL RTF_Load_IO(RTF_Context *ctx, SDL_IOStream *src, SDL_bool closeio);
extern SDL_DECLSPEC bool SDLCALL RTF_Load_IO(RTF_Context *ctx, SDL_IOStream *src, bool closeio);

/**
* Get the title of an RTF document.
Expand Down
12 changes: 6 additions & 6 deletions src/SDL_rtf.c
Original file line number Diff line number Diff line change
Expand Up @@ -63,12 +63,12 @@ RTF_Context *RTF_CreateContext(SDL_Renderer *renderer, RTF_FontEngine *fontEngin
}

/* Set the text of an RTF context.
* This function returns SDL_TRUE if it succeeds or SDL_FALSE if it fails.
* This function returns true if it succeeds or false if it fails.
* Use SDL_GetError() to get a text message corresponding to the error.
*/
SDL_bool RTF_Load_IO(RTF_Context *ctx, SDL_IOStream *src, SDL_bool closeio)
bool RTF_Load_IO(RTF_Context *ctx, SDL_IOStream *src, bool closeio)
{
SDL_bool retval;
bool retval;

ecClearContext(ctx);

Expand All @@ -83,7 +83,7 @@ SDL_bool RTF_Load_IO(RTF_Context *ctx, SDL_IOStream *src, SDL_bool closeio)
/* Parse the RTF text and clean up */
switch (ecRtfParse(ctx)) {
case ecOK:
retval = SDL_TRUE;
retval = true;
break;
case ecStackUnderflow:
retval = SDL_SetError("Unmatched '}'");
Expand Down Expand Up @@ -124,11 +124,11 @@ SDL_bool RTF_Load_IO(RTF_Context *ctx, SDL_IOStream *src, SDL_bool closeio)
return retval;
}

SDL_bool RTF_Load(RTF_Context *ctx, const char *file)
bool RTF_Load(RTF_Context *ctx, const char *file)
{
SDL_IOStream *src = SDL_IOFromFile(file, "rb");
if (!src) {
return SDL_FALSE;
return false;
}
return RTF_Load_IO(ctx, src, 1);
}
Expand Down

0 comments on commit 7a89a38

Please sign in to comment.