diff options
author | Andrei Karas <akaras@inbox.ru> | 2017-09-06 23:01:40 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2017-09-06 23:01:40 +0300 |
commit | c7cc189b3007321b09c0c49de74baeef5b18606a (patch) | |
tree | bb6503df94a089da1d92cc21799a12f559ab6eb1 /src/sdl2gfx/SDL2_framerate.h | |
parent | 847260e5e91391a979f4292d130d7b6e3b43bdf1 (diff) | |
download | mv-c7cc189b3007321b09c0c49de74baeef5b18606a.tar.gz mv-c7cc189b3007321b09c0c49de74baeef5b18606a.tar.bz2 mv-c7cc189b3007321b09c0c49de74baeef5b18606a.tar.xz mv-c7cc189b3007321b09c0c49de74baeef5b18606a.zip |
Fix and update internal sdl2_gfx files.
Used by default in SDL2 builds.
Diffstat (limited to 'src/sdl2gfx/SDL2_framerate.h')
-rw-r--r-- | src/sdl2gfx/SDL2_framerate.h | 88 |
1 files changed, 43 insertions, 45 deletions
diff --git a/src/sdl2gfx/SDL2_framerate.h b/src/sdl2gfx/SDL2_framerate.h index 4361b1f60..f08321140 100644 --- a/src/sdl2gfx/SDL2_framerate.h +++ b/src/sdl2gfx/SDL2_framerate.h @@ -2,7 +2,7 @@ SDL2_framerate.h: framerate manager -Copyright (C) 2012 Andreas Schiffler +Copyright (C) 2012-2014 Andreas Schiffler This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -25,6 +25,8 @@ distribution. Andreas Schiffler -- aschiffler at ferzkopp dot net +Changed for ManaPlus (C) 2013-2017 ManaPlus developers + */ #ifndef _SDL2_framerate_h @@ -32,11 +34,10 @@ Andreas Schiffler -- aschiffler at ferzkopp dot net /* Set up for C function definitions, even when using C++ */ #ifdef __cplusplus -extern "C" -{ +extern "C" { #endif - /* --- */ + /* --- */ #include "localconsts.h" @@ -45,36 +46,35 @@ PRAGMA48(GCC diagnostic ignored "-Wshadow") #include <SDL.h> PRAGMA48(GCC diagnostic pop) - /* --------- Definitions */ - - /*! - \brief Highest possible rate supported by framerate controller in Hz (1/s). - */ -#define FPS_UPPER_LIMIT 200 - - /*! - \brief Lowest possible rate supported by framerate controller in Hz (1/s). - */ -#define FPS_LOWER_LIMIT 1 - - /*! - \brief Default rate of framerate controller in Hz (1/s). - */ -#define FPS_DEFAULT 30 - - /*! - \brief Structure holding the state and timing information of the framerate controller. - */ - typedef struct - { - uint32_t framecount; - float rateticks; - uint32_t baseticks; - uint32_t lastticks; - uint32_t rate; - } FPSmanager; - - /* ---- Function Prototypes */ + /* --------- Definitions */ + + /*! + \brief Highest possible rate supported by framerate controller in Hz (1/s). + */ +#define FPS_UPPER_LIMIT 200 + + /*! + \brief Lowest possible rate supported by framerate controller in Hz (1/s). + */ +#define FPS_LOWER_LIMIT 1 + + /*! + \brief Default rate of framerate controller in Hz (1/s). + */ +#define FPS_DEFAULT 30 + + /*! + \brief Structure holding the state and timing information of the framerate controller. + */ + typedef struct { + Uint32 framecount; + float rateticks; + Uint32 baseticks; + Uint32 lastticks; + Uint32 rate; + } FPSmanager; + + /* ---- Function Prototypes */ #ifdef _MSC_VER # if defined(DLL_EXPORT) && !defined(LIBSDL2_GFX_DLL_IMPORT) @@ -89,21 +89,19 @@ PRAGMA48(GCC diagnostic pop) # define SDL2_FRAMERATE_SCOPE extern #endif - /* Functions return 0 or value for sucess and -1 for error */ + /* Functions return 0 or value for sucess and -1 for error */ - SDL2_FRAMERATE_SCOPE void SDL_initFramerate(FPSmanager *const manager); - SDL2_FRAMERATE_SCOPE int SDL_setFramerate(FPSmanager *const manager, - const uint32_t rate); - SDL2_FRAMERATE_SCOPE int SDL_getFramerate(FPSmanager *const manager); - SDL2_FRAMERATE_SCOPE int SDL_getFramecount(FPSmanager *const manager); - SDL2_FRAMERATE_SCOPE uint32_t SDL_framerateDelay(FPSmanager *const - manager); + SDL2_FRAMERATE_SCOPE void SDL_initFramerate(FPSmanager * manager); + SDL2_FRAMERATE_SCOPE int SDL_setFramerate(FPSmanager * manager, Uint32 rate); + SDL2_FRAMERATE_SCOPE int SDL_getFramerate(FPSmanager * manager); + SDL2_FRAMERATE_SCOPE int SDL_getFramecount(FPSmanager * manager); + SDL2_FRAMERATE_SCOPE Uint32 SDL_framerateDelay(FPSmanager * manager); - /* --- */ + /* --- */ - /* Ends C function definitions when using C++ */ + /* Ends C function definitions when using C++ */ #ifdef __cplusplus } #endif -#endif /* _SDL2_framerate_h */ +#endif /* _SDL2_framerate_h */ |