From b52f716b2b619484a6fe6ff16d66e771ddc2c237 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Sat, 5 Feb 2011 20:02:37 -0800 Subject: [PATCH] Created a simpler version of SDL_SetHint() that doesn't need a priority. --- include/SDL_hints.h | 15 ++++++++++++--- src/SDL_hints.c | 9 ++++++++- 2 files changed, 20 insertions(+), 4 deletions(-) diff --git a/include/SDL_hints.h b/include/SDL_hints.h index 27f430f9e..4426f8efd 100644 --- a/include/SDL_hints.h +++ b/include/SDL_hints.h @@ -106,7 +106,7 @@ typedef enum /** - * \brief Set a hint + * \brief Set a hint with a specific priority * * The priority controls the behavior when setting a hint that already * has a value. Hints will replace existing hints of their priority and @@ -114,9 +114,18 @@ typedef enum * * \return SDL_TRUE if the hint was set, SDL_FALSE otherwise */ +extern DECLSPEC SDL_bool SDLCALL SDL_SetHintWithPriority(const char *name, + const char *value, + SDL_HintPriority priority); + +/** + * \brief Set a hint with normal priority + * + * \return SDL_TRUE if the hint was set, SDL_FALSE otherwise + */ extern DECLSPEC SDL_bool SDLCALL SDL_SetHint(const char *name, - const char *value, - SDL_HintPriority priority); + const char *value); + /** * \brief Get a hint diff --git a/src/SDL_hints.c b/src/SDL_hints.c index b96c4e4bd..942fb4ff3 100644 --- a/src/SDL_hints.c +++ b/src/SDL_hints.c @@ -38,7 +38,8 @@ static SDL_Hint *SDL_hints; SDL_bool -SDL_SetHint(const char *name, const char *value, SDL_HintPriority priority) +SDL_SetHintWithPriority(const char *name, const char *value, + SDL_HintPriority priority) { const char *env; SDL_Hint *prev, *hint; @@ -80,6 +81,12 @@ SDL_SetHint(const char *name, const char *value, SDL_HintPriority priority) return SDL_TRUE; } +SDL_bool +SDL_SetHint(const char *name, const char *value) +{ + return SDL_SetHintWithPriority(name, value, SDL_HINT_NORMAL); +} + const char * SDL_GetHint(const char *name) {