diff --git a/examples/example.c b/examples/example.c index 9e07297..6409ccf 100644 --- a/examples/example.c +++ b/examples/example.c @@ -6,8 +6,8 @@ int main(void) { // Create the main window - const sfVideoMode mode = {{800, 600}, 32}; - sfRenderWindow* window = sfRenderWindow_create(mode, "SFML window", sfResize | sfClose, sfWindowed, NULL); + const sfVideoMode mode = {{800, 600}, 32}; + sfRenderWindow* window = sfRenderWindow_create(mode, "SFML window", sfResize | sfClose, sfWindowed, NULL); if (!window) return EXIT_FAILURE; @@ -18,7 +18,7 @@ int main(void) sfRenderWindow_destroy(window); return EXIT_FAILURE; } - sfSprite* sprite = sfSprite_create(texture); + sfSprite* sprite = sfSprite_create(texture); const sfVector2f spritePosition = {200, 200}; sfSprite_setPosition(sprite, spritePosition); diff --git a/include/CSFML/Audio.h b/include/CSFML/Audio.h index 4797cf0..f0cc0a3 100644 --- a/include/CSFML/Audio.h +++ b/include/CSFML/Audio.h @@ -28,7 +28,6 @@ // Headers //////////////////////////////////////////////////////////// -#include #include #include #include @@ -37,3 +36,4 @@ #include #include #include +#include diff --git a/include/CSFML/Audio/Export.h b/include/CSFML/Audio/Export.h index 7559d16..eb0537e 100644 --- a/include/CSFML/Audio/Export.h +++ b/include/CSFML/Audio/Export.h @@ -35,10 +35,10 @@ //////////////////////////////////////////////////////////// #if defined(CSFML_AUDIO_EXPORTS) - #define CSFML_AUDIO_API CSFML_API_EXPORT +#define CSFML_AUDIO_API CSFML_API_EXPORT #else - #define CSFML_AUDIO_API CSFML_API_IMPORT +#define CSFML_AUDIO_API CSFML_API_IMPORT #endif diff --git a/include/CSFML/Audio/Listener.h b/include/CSFML/Audio/Listener.h index 71bb474..dac15ce 100644 --- a/include/CSFML/Audio/Listener.h +++ b/include/CSFML/Audio/Listener.h @@ -28,6 +28,7 @@ // Headers //////////////////////////////////////////////////////////// #include + #include diff --git a/include/CSFML/Audio/Music.h b/include/CSFML/Audio/Music.h index 4eeae19..95bc1fd 100644 --- a/include/CSFML/Audio/Music.h +++ b/include/CSFML/Audio/Music.h @@ -28,11 +28,13 @@ // Headers //////////////////////////////////////////////////////////// #include + #include #include #include #include #include + #include diff --git a/include/CSFML/Audio/Sound.h b/include/CSFML/Audio/Sound.h index 48adb98..0343709 100644 --- a/include/CSFML/Audio/Sound.h +++ b/include/CSFML/Audio/Sound.h @@ -28,6 +28,7 @@ // Headers //////////////////////////////////////////////////////////// #include + #include #include #include @@ -36,7 +37,7 @@ //////////////////////////////////////////////////////////// /// \brief Create a new sound -/// +/// /// \param soundBuffer Sound buffer containing the audio data to play with the sound /// /// \return A new sfSound object diff --git a/include/CSFML/Audio/SoundBuffer.h b/include/CSFML/Audio/SoundBuffer.h index 424c760..1b24513 100644 --- a/include/CSFML/Audio/SoundBuffer.h +++ b/include/CSFML/Audio/SoundBuffer.h @@ -28,10 +28,12 @@ // Headers //////////////////////////////////////////////////////////// #include -#include + #include +#include #include #include + #include @@ -94,12 +96,13 @@ CSFML_AUDIO_API sfSoundBuffer* sfSoundBuffer_createFromStream(sfInputStream* str /// \return A new sfSoundBuffer object (NULL if failed) /// //////////////////////////////////////////////////////////// -CSFML_AUDIO_API sfSoundBuffer* sfSoundBuffer_createFromSamples(const int16_t* samples, - uint64_t sampleCount, - unsigned int channelCount, - unsigned int sampleRate, - sfSoundChannel* channelMapData, - size_t channelMapSize); +CSFML_AUDIO_API sfSoundBuffer* sfSoundBuffer_createFromSamples( + const int16_t* samples, + uint64_t sampleCount, + unsigned int channelCount, + unsigned int sampleRate, + sfSoundChannel* channelMapData, + size_t channelMapSize); //////////////////////////////////////////////////////////// /// \brief Create a new sound buffer by copying an existing one diff --git a/include/CSFML/Audio/SoundBufferRecorder.h b/include/CSFML/Audio/SoundBufferRecorder.h index a0d62d4..45da897 100644 --- a/include/CSFML/Audio/SoundBufferRecorder.h +++ b/include/CSFML/Audio/SoundBufferRecorder.h @@ -28,6 +28,7 @@ // Headers //////////////////////////////////////////////////////////// #include + #include diff --git a/include/CSFML/Audio/SoundRecorder.h b/include/CSFML/Audio/SoundRecorder.h index b032607..5122602 100644 --- a/include/CSFML/Audio/SoundRecorder.h +++ b/include/CSFML/Audio/SoundRecorder.h @@ -28,14 +28,16 @@ // Headers //////////////////////////////////////////////////////////// #include + #include #include + #include -typedef bool (*sfSoundRecorderStartCallback)(void*); ///< Type of the callback used when starting a capture +typedef bool (*sfSoundRecorderStartCallback)(void*); ///< Type of the callback used when starting a capture typedef bool (*sfSoundRecorderProcessCallback)(const int16_t*, size_t, void*); ///< Type of the callback used to process audio data -typedef void (*sfSoundRecorderStopCallback)(void*); ///< Type of the callback used when stopping a capture +typedef void (*sfSoundRecorderStopCallback)(void*); ///< Type of the callback used when stopping a capture //////////////////////////////////////////////////////////// diff --git a/include/CSFML/Audio/SoundStream.h b/include/CSFML/Audio/SoundStream.h index 231610d..40896fe 100644 --- a/include/CSFML/Audio/SoundStream.h +++ b/include/CSFML/Audio/SoundStream.h @@ -28,11 +28,13 @@ // Headers //////////////////////////////////////////////////////////// #include + +#include #include #include -#include #include #include + #include @@ -47,7 +49,7 @@ typedef struct } sfSoundStreamChunk; typedef bool (*sfSoundStreamGetDataCallback)(sfSoundStreamChunk*, void*); ///< Type of the callback used to get a sound stream data -typedef void (*sfSoundStreamSeekCallback)(sfTime, void*); ///< Type of the callback used to seek in a sound stream +typedef void (*sfSoundStreamSeekCallback)(sfTime, void*); ///< Type of the callback used to seek in a sound stream //////////////////////////////////////////////////////////// @@ -64,13 +66,14 @@ typedef void (*sfSoundStreamSeekCallback)(sfTime, void*); ///< T /// \return A new sfSoundStream object /// //////////////////////////////////////////////////////////// -CSFML_AUDIO_API sfSoundStream* sfSoundStream_create(sfSoundStreamGetDataCallback onGetData, - sfSoundStreamSeekCallback onSeek, - unsigned int channelCount, - unsigned int sampleRate, - sfSoundChannel* channelMapData, - size_t channelMapSize, - void* userData); +CSFML_AUDIO_API sfSoundStream* sfSoundStream_create( + sfSoundStreamGetDataCallback onGetData, + sfSoundStreamSeekCallback onSeek, + unsigned int channelCount, + unsigned int sampleRate, + sfSoundChannel* channelMapData, + size_t channelMapSize, + void* userData); //////////////////////////////////////////////////////////// /// \brief Destroy a sound stream diff --git a/include/CSFML/Audio/Types.h b/include/CSFML/Audio/Types.h index 9b8e6d7..365d5a6 100644 --- a/include/CSFML/Audio/Types.h +++ b/include/CSFML/Audio/Types.h @@ -24,9 +24,9 @@ #pragma once -typedef struct sfMusic sfMusic; -typedef struct sfSound sfSound; -typedef struct sfSoundBuffer sfSoundBuffer; +typedef struct sfMusic sfMusic; +typedef struct sfSound sfSound; +typedef struct sfSoundBuffer sfSoundBuffer; typedef struct sfSoundBufferRecorder sfSoundBufferRecorder; -typedef struct sfSoundRecorder sfSoundRecorder; -typedef struct sfSoundStream sfSoundStream; +typedef struct sfSoundRecorder sfSoundRecorder; +typedef struct sfSoundStream sfSoundStream; diff --git a/include/CSFML/Config.h b/include/CSFML/Config.h index c5cbda7..7ad7726 100644 --- a/include/CSFML/Config.h +++ b/include/CSFML/Config.h @@ -28,8 +28,8 @@ // Headers //////////////////////////////////////////////////////////// -#include #include +#include //////////////////////////////////////////////////////////// @@ -44,9 +44,9 @@ // Check if we need to mark functions as extern "C" //////////////////////////////////////////////////////////// #ifdef __cplusplus - #define CSFML_EXTERN_C extern "C" +#define CSFML_EXTERN_C extern "C" #else - #define CSFML_EXTERN_C extern +#define CSFML_EXTERN_C extern #endif @@ -55,28 +55,28 @@ //////////////////////////////////////////////////////////// #if defined(_WIN32) || defined(__WIN32__) - // Windows - #define CSFML_SYSTEM_WINDOWS +// Windows +#define CSFML_SYSTEM_WINDOWS #elif defined(linux) || defined(__linux) - // Linux - #define CSFML_SYSTEM_LINUX +// Linux +#define CSFML_SYSTEM_LINUX #elif defined(__APPLE__) || defined(MACOSX) || defined(macintosh) || defined(Macintosh) - // MacOS - #define CSFML_SYSTEM_MACOS +// MacOS +#define CSFML_SYSTEM_MACOS #elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__) - // FreeBSD - #define CSFML_SYSTEM_FREEBSD +// FreeBSD +#define CSFML_SYSTEM_FREEBSD #else - // Unsupported system - #error This operating system is not supported by SFML library +// Unsupported system +#error This operating system is not supported by SFML library #endif @@ -86,21 +86,21 @@ //////////////////////////////////////////////////////////// #if defined(CSFML_SYSTEM_WINDOWS) - // Windows compilers need specific (and different) keywords for export and import - #define CSFML_API_EXPORT extern "C" __declspec(dllexport) - #define CSFML_API_IMPORT CSFML_EXTERN_C __declspec(dllimport) +// Windows compilers need specific (and different) keywords for export and import +#define CSFML_API_EXPORT extern "C" __declspec(dllexport) +#define CSFML_API_IMPORT CSFML_EXTERN_C __declspec(dllimport) - // For Visual C++ compilers, we also need to turn off this annoying C4251 warning - #ifdef _MSC_VER +// For Visual C++ compilers, we also need to turn off this annoying C4251 warning +#ifdef _MSC_VER - #pragma warning(disable : 4251) +#pragma warning(disable : 4251) - #endif +#endif #else // Linux, FreeBSD, Mac OS X - #define CSFML_API_EXPORT extern "C" __attribute__ ((__visibility__ ("default"))) - #define CSFML_API_IMPORT CSFML_EXTERN_C __attribute__ ((__visibility__ ("default"))) +#define CSFML_API_EXPORT extern "C" __attribute__((__visibility__("default"))) +#define CSFML_API_IMPORT CSFML_EXTERN_C __attribute__((__visibility__("default"))) #endif @@ -117,27 +117,27 @@ //////////////////////////////////////////////////////////// #if defined(CSFML_NO_DEPRECATED_WARNINGS) - // User explicitly requests to disable deprecation warnings - #define CSFML_DEPRECATED +// User explicitly requests to disable deprecation warnings +#define CSFML_DEPRECATED #elif defined(_MSC_VER) - // Microsoft C++ compiler - // Note: On newer MSVC versions, using deprecated functions causes a compiler error. In order to - // trigger a warning instead of an error, the compiler flag /sdl- (instead of /sdl) must be specified. - #define CSFML_DEPRECATED __declspec(deprecated) +// Microsoft C++ compiler +// Note: On newer MSVC versions, using deprecated functions causes a compiler error. In order to +// trigger a warning instead of an error, the compiler flag /sdl- (instead of /sdl) must be specified. +#define CSFML_DEPRECATED __declspec(deprecated) #elif defined(__GNUC__) - // g++ and Clang - #define CSFML_DEPRECATED __attribute__ ((deprecated)) +// g++ and Clang +#define CSFML_DEPRECATED __attribute__((deprecated)) #else - // Other compilers are not supported, leave class or function as-is. - // With a bit of luck, the #pragma directive works, otherwise users get a warning (no error!) for unrecognized #pragma. - #pragma message("CSFML_DEPRECATED is not supported for your compiler, please contact the CSFML team") - #define CSFML_DEPRECATED +// Other compilers are not supported, leave class or function as-is. +// With a bit of luck, the #pragma directive works, otherwise users get a warning (no error!) for unrecognized #pragma. +#pragma message("CSFML_DEPRECATED is not supported for your compiler, please contact the CSFML team") +#define CSFML_DEPRECATED #endif diff --git a/include/CSFML/GPUPreference.h b/include/CSFML/GPUPreference.h index e7471b1..c26936b 100644 --- a/include/CSFML/GPUPreference.h +++ b/include/CSFML/GPUPreference.h @@ -58,12 +58,12 @@ //////////////////////////////////////////////////////////// #if defined(SFML_SYSTEM_WINDOWS) - #define SFML_DEFINE_DISCRETE_GPU_PREFERENCE \ - CSFML_EXTERN_C __declspec(dllexport) unsigned long NvOptimusEnablement = 1; \ - CSFML_EXTERN_C __declspec(dllexport) unsigned long AmdPowerXpressRequestHighPerformance = 1; +#define SFML_DEFINE_DISCRETE_GPU_PREFERENCE \ + CSFML_EXTERN_C __declspec(dllexport) unsigned long NvOptimusEnablement = 1; \ + CSFML_EXTERN_C __declspec(dllexport) unsigned long AmdPowerXpressRequestHighPerformance = 1; #else - #define SFML_DEFINE_DISCRETE_GPU_PREFERENCE +#define SFML_DEFINE_DISCRETE_GPU_PREFERENCE #endif diff --git a/include/CSFML/Graphics.h b/include/CSFML/Graphics.h index b161561..54cce69 100644 --- a/include/CSFML/Graphics.h +++ b/include/CSFML/Graphics.h @@ -28,7 +28,6 @@ // Headers //////////////////////////////////////////////////////////// -#include #include #include #include @@ -54,3 +53,4 @@ #include #include #include +#include diff --git a/include/CSFML/Graphics/BlendMode.h b/include/CSFML/Graphics/BlendMode.h index 0cfbef8..8c3288c 100644 --- a/include/CSFML/Graphics/BlendMode.h +++ b/include/CSFML/Graphics/BlendMode.h @@ -69,12 +69,12 @@ typedef enum //////////////////////////////////////////////////////////// typedef struct { - sfBlendFactor colorSrcFactor; ///< Source blending factor for the color channels - sfBlendFactor colorDstFactor; ///< Destination blending factor for the color channels - sfBlendEquation colorEquation; ///< Blending equation for the color channels - sfBlendFactor alphaSrcFactor; ///< Source blending factor for the alpha channel - sfBlendFactor alphaDstFactor; ///< Destination blending factor for the alpha channel - sfBlendEquation alphaEquation; ///< Blending equation for the alpha channel + sfBlendFactor colorSrcFactor; ///< Source blending factor for the color channels + sfBlendFactor colorDstFactor; ///< Destination blending factor for the color channels + sfBlendEquation colorEquation; ///< Blending equation for the color channels + sfBlendFactor alphaSrcFactor; ///< Source blending factor for the alpha channel + sfBlendFactor alphaDstFactor; ///< Destination blending factor for the alpha channel + sfBlendEquation alphaEquation; ///< Blending equation for the alpha channel } sfBlendMode; diff --git a/include/CSFML/Graphics/CircleShape.h b/include/CSFML/Graphics/CircleShape.h index d5f3fc0..273fe94 100644 --- a/include/CSFML/Graphics/CircleShape.h +++ b/include/CSFML/Graphics/CircleShape.h @@ -28,11 +28,13 @@ // Headers //////////////////////////////////////////////////////////// #include + #include #include #include #include #include + #include diff --git a/include/CSFML/Graphics/ConvexShape.h b/include/CSFML/Graphics/ConvexShape.h index 659768b..693ec7a 100644 --- a/include/CSFML/Graphics/ConvexShape.h +++ b/include/CSFML/Graphics/ConvexShape.h @@ -28,11 +28,13 @@ // Headers //////////////////////////////////////////////////////////// #include + #include #include #include #include #include + #include diff --git a/include/CSFML/Graphics/Export.h b/include/CSFML/Graphics/Export.h index ef534fa..e7297b1 100644 --- a/include/CSFML/Graphics/Export.h +++ b/include/CSFML/Graphics/Export.h @@ -35,10 +35,10 @@ //////////////////////////////////////////////////////////// #if defined(CSFML_GRAPHICS_EXPORTS) - #define CSFML_GRAPHICS_API CSFML_API_EXPORT +#define CSFML_GRAPHICS_API CSFML_API_EXPORT #else - #define CSFML_GRAPHICS_API CSFML_API_IMPORT +#define CSFML_GRAPHICS_API CSFML_API_IMPORT #endif diff --git a/include/CSFML/Graphics/Font.h b/include/CSFML/Graphics/Font.h index bd6b6dd..a3ee935 100644 --- a/include/CSFML/Graphics/Font.h +++ b/include/CSFML/Graphics/Font.h @@ -28,10 +28,12 @@ // Headers //////////////////////////////////////////////////////////// #include + #include #include #include #include + #include @@ -96,7 +98,8 @@ CSFML_GRAPHICS_API void sfFont_destroy(sfFont* font); /// \return The corresponding glyph /// //////////////////////////////////////////////////////////// -CSFML_GRAPHICS_API sfGlyph sfFont_getGlyph(const sfFont* font, uint32_t codePoint, unsigned int characterSize, bool bold, float outlineThickness); +CSFML_GRAPHICS_API sfGlyph + sfFont_getGlyph(const sfFont* font, uint32_t codePoint, unsigned int characterSize, bool bold, float outlineThickness); //////////////////////////////////////////////////////////// /// \brief Determine if this font has a glyph representing the requested code point diff --git a/include/CSFML/Graphics/Glsl.h b/include/CSFML/Graphics/Glsl.h index a9a15ba..6c0c5a4 100644 --- a/include/CSFML/Graphics/Glsl.h +++ b/include/CSFML/Graphics/Glsl.h @@ -27,8 +27,8 @@ //////////////////////////////////////////////////////////// // Headers //////////////////////////////////////////////////////////// -#include #include +#include #include #include diff --git a/include/CSFML/Graphics/Image.h b/include/CSFML/Graphics/Image.h index f784064..6406530 100644 --- a/include/CSFML/Graphics/Image.h +++ b/include/CSFML/Graphics/Image.h @@ -28,12 +28,14 @@ // Headers //////////////////////////////////////////////////////////// #include + #include #include #include #include #include #include + #include @@ -219,7 +221,7 @@ CSFML_GRAPHICS_API void sfImage_createMaskFromColor(sfImage* image, sfColor colo /// \param dest Coordinates of the destination position /// \param sourceRect Sub-rectangle of the source image to copy /// \param applyAlpha Should the copy take in account the source transparency? -/// +/// /// \return True if the operation was successful, false otherwise /// //////////////////////////////////////////////////////////// diff --git a/include/CSFML/Graphics/PrimitiveType.h b/include/CSFML/Graphics/PrimitiveType.h index 936116f..021a8c2 100644 --- a/include/CSFML/Graphics/PrimitiveType.h +++ b/include/CSFML/Graphics/PrimitiveType.h @@ -45,5 +45,5 @@ typedef enum sfLineStrip, ///< List of connected lines, a point uses the previous point to form a line sfTriangles, ///< List of individual triangles sfTriangleStrip, ///< List of connected triangles, a point uses the two previous points to form a triangle - sfTriangleFan, ///< List of connected triangles, a point uses the common center and the previous point to form a triangle + sfTriangleFan, ///< List of connected triangles, a point uses the common center and the previous point to form a triangle } sfPrimitiveType; diff --git a/include/CSFML/Graphics/RectangleShape.h b/include/CSFML/Graphics/RectangleShape.h index 35b11df..3823b58 100644 --- a/include/CSFML/Graphics/RectangleShape.h +++ b/include/CSFML/Graphics/RectangleShape.h @@ -28,11 +28,13 @@ // Headers //////////////////////////////////////////////////////////// #include + #include #include #include #include #include + #include diff --git a/include/CSFML/Graphics/RenderStates.h b/include/CSFML/Graphics/RenderStates.h index b47c061..7e65f7b 100644 --- a/include/CSFML/Graphics/RenderStates.h +++ b/include/CSFML/Graphics/RenderStates.h @@ -28,6 +28,7 @@ // Headers //////////////////////////////////////////////////////////// #include + #include #include #include diff --git a/include/CSFML/Graphics/RenderTexture.h b/include/CSFML/Graphics/RenderTexture.h index a2687f7..461815a 100644 --- a/include/CSFML/Graphics/RenderTexture.h +++ b/include/CSFML/Graphics/RenderTexture.h @@ -28,14 +28,16 @@ // Headers //////////////////////////////////////////////////////////// #include + #include -#include -#include #include +#include #include +#include #include -#include #include +#include + #include @@ -171,7 +173,8 @@ CSFML_GRAPHICS_API sfIntRect sfRenderTexture_getViewport(const sfRenderTexture* /// \return The converted point, in "world" units /// //////////////////////////////////////////////////////////// -CSFML_GRAPHICS_API sfVector2f sfRenderTexture_mapPixelToCoords(const sfRenderTexture* renderTexture, sfVector2i point, const sfView* view); +CSFML_GRAPHICS_API sfVector2f + sfRenderTexture_mapPixelToCoords(const sfRenderTexture* renderTexture, sfVector2i point, const sfView* view); //////////////////////////////////////////////////////////// /// \brief Convert a point from world coordinates to texture coordinates @@ -197,7 +200,8 @@ CSFML_GRAPHICS_API sfVector2f sfRenderTexture_mapPixelToCoords(const sfRenderTex /// \return The converted point, in target coordinates (pixels) /// //////////////////////////////////////////////////////////// -CSFML_GRAPHICS_API sfVector2i sfRenderTexture_mapCoordsToPixel(const sfRenderTexture* renderTexture, sfVector2f point, const sfView* view); +CSFML_GRAPHICS_API sfVector2i + sfRenderTexture_mapCoordsToPixel(const sfRenderTexture* renderTexture, sfVector2f point, const sfView* view); //////////////////////////////////////////////////////////// /// \brief Draw a drawable object to the render-target @@ -207,14 +211,30 @@ CSFML_GRAPHICS_API sfVector2i sfRenderTexture_mapCoordsToPixel(const sfRenderTex /// \param states Render states to use for drawing (NULL to use the default states) /// //////////////////////////////////////////////////////////// -CSFML_GRAPHICS_API void sfRenderTexture_drawSprite(sfRenderTexture* renderTexture, const sfSprite* object, const sfRenderStates* states); -CSFML_GRAPHICS_API void sfRenderTexture_drawText(sfRenderTexture* renderTexture, const sfText* object, const sfRenderStates* states); -CSFML_GRAPHICS_API void sfRenderTexture_drawShape(sfRenderTexture* renderTexture, const sfShape* object, const sfRenderStates* states); -CSFML_GRAPHICS_API void sfRenderTexture_drawCircleShape(sfRenderTexture* renderTexture, const sfCircleShape* object, const sfRenderStates* states); -CSFML_GRAPHICS_API void sfRenderTexture_drawConvexShape(sfRenderTexture* renderTexture, const sfConvexShape* object, const sfRenderStates* states); -CSFML_GRAPHICS_API void sfRenderTexture_drawRectangleShape(sfRenderTexture* renderTexture, const sfRectangleShape* object, const sfRenderStates* states); -CSFML_GRAPHICS_API void sfRenderTexture_drawVertexArray(sfRenderTexture* renderTexture, const sfVertexArray* object, const sfRenderStates* states); -CSFML_GRAPHICS_API void sfRenderTexture_drawVertexBuffer(sfRenderTexture* renderTexture, const sfVertexBuffer* object, const sfRenderStates* states); +CSFML_GRAPHICS_API void sfRenderTexture_drawSprite(sfRenderTexture* renderTexture, + const sfSprite* object, + const sfRenderStates* states); +CSFML_GRAPHICS_API void sfRenderTexture_drawText(sfRenderTexture* renderTexture, + const sfText* object, + const sfRenderStates* states); +CSFML_GRAPHICS_API void sfRenderTexture_drawShape(sfRenderTexture* renderTexture, + const sfShape* object, + const sfRenderStates* states); +CSFML_GRAPHICS_API void sfRenderTexture_drawCircleShape(sfRenderTexture* renderTexture, + const sfCircleShape* object, + const sfRenderStates* states); +CSFML_GRAPHICS_API void sfRenderTexture_drawConvexShape(sfRenderTexture* renderTexture, + const sfConvexShape* object, + const sfRenderStates* states); +CSFML_GRAPHICS_API void sfRenderTexture_drawRectangleShape(sfRenderTexture* renderTexture, + const sfRectangleShape* object, + const sfRenderStates* states); +CSFML_GRAPHICS_API void sfRenderTexture_drawVertexArray(sfRenderTexture* renderTexture, + const sfVertexArray* object, + const sfRenderStates* states); +CSFML_GRAPHICS_API void sfRenderTexture_drawVertexBuffer(sfRenderTexture* renderTexture, + const sfVertexBuffer* object, + const sfRenderStates* states); //////////////////////////////////////////////////////////// /// \brief Draw primitives defined by a vertex buffer. @@ -226,9 +246,12 @@ CSFML_GRAPHICS_API void sfRenderTexture_drawVertexBuffer(sfRenderTexture* render /// \param states Render states to use for drawing /// //////////////////////////////////////////////////////////// -CSFML_GRAPHICS_API void sfRenderTexture_drawVertexBufferRange(sfRenderTexture* renderTexture, - const sfVertexBuffer* object, size_t firstVertex, - size_t vertexCount, const sfRenderStates* states); +CSFML_GRAPHICS_API void sfRenderTexture_drawVertexBufferRange( + sfRenderTexture* renderTexture, + const sfVertexBuffer* object, + size_t firstVertex, + size_t vertexCount, + const sfRenderStates* states); //////////////////////////////////////////////////////////// /// \brief Draw primitives defined by an array of vertices to a render texture @@ -240,9 +263,12 @@ CSFML_GRAPHICS_API void sfRenderTexture_drawVertexBufferRange(sfRenderTexture* r /// \param states Render states to use for drawing (NULL to use the default states) /// //////////////////////////////////////////////////////////// -CSFML_GRAPHICS_API void sfRenderTexture_drawPrimitives(sfRenderTexture* renderTexture, - const sfVertex* vertices, size_t vertexCount, - sfPrimitiveType type, const sfRenderStates* states); +CSFML_GRAPHICS_API void sfRenderTexture_drawPrimitives( + sfRenderTexture* renderTexture, + const sfVertex* vertices, + size_t vertexCount, + sfPrimitiveType type, + const sfRenderStates* states); //////////////////////////////////////////////////////////// /// \brief Save the current OpenGL render states and matrices diff --git a/include/CSFML/Graphics/RenderWindow.h b/include/CSFML/Graphics/RenderWindow.h index f811d9b..009524b 100644 --- a/include/CSFML/Graphics/RenderWindow.h +++ b/include/CSFML/Graphics/RenderWindow.h @@ -28,17 +28,19 @@ // Headers //////////////////////////////////////////////////////////// #include + #include -#include -#include #include +#include #include +#include #include +#include #include #include -#include #include -#include +#include + #include @@ -51,7 +53,12 @@ /// \param settings Creation settings (pass NULL to use default values) /// //////////////////////////////////////////////////////////// -CSFML_GRAPHICS_API sfRenderWindow* sfRenderWindow_create(sfVideoMode mode, const char* title, uint32_t style, sfWindowState state, const sfContextSettings* settings); +CSFML_GRAPHICS_API sfRenderWindow* sfRenderWindow_create( + sfVideoMode mode, + const char* title, + uint32_t style, + sfWindowState state, + const sfContextSettings* settings); //////////////////////////////////////////////////////////// /// \brief Construct a new render window (with a UTF-32 title) @@ -62,7 +69,12 @@ CSFML_GRAPHICS_API sfRenderWindow* sfRenderWindow_create(sfVideoMode mode, const /// \param settings Creation settings (pass NULL to use default values) /// //////////////////////////////////////////////////////////// -CSFML_GRAPHICS_API sfRenderWindow* sfRenderWindow_createUnicode(sfVideoMode mode, const sfChar32* title, uint32_t style, sfWindowState state, const sfContextSettings* settings); +CSFML_GRAPHICS_API sfRenderWindow* sfRenderWindow_createUnicode( + sfVideoMode mode, + const sfChar32* title, + uint32_t style, + sfWindowState state, + const sfContextSettings* settings); //////////////////////////////////////////////////////////// /// \brief Construct a render window from an existing control @@ -429,7 +441,8 @@ CSFML_GRAPHICS_API sfIntRect sfRenderWindow_getViewport(const sfRenderWindow* re /// \return The converted point, in "world" units /// //////////////////////////////////////////////////////////// -CSFML_GRAPHICS_API sfVector2f sfRenderWindow_mapPixelToCoords(const sfRenderWindow* renderWindow, sfVector2i point, const sfView* view); +CSFML_GRAPHICS_API sfVector2f + sfRenderWindow_mapPixelToCoords(const sfRenderWindow* renderWindow, sfVector2i point, const sfView* view); //////////////////////////////////////////////////////////// /// \brief Convert a point from world coordinates to window coordinates @@ -455,7 +468,8 @@ CSFML_GRAPHICS_API sfVector2f sfRenderWindow_mapPixelToCoords(const sfRenderWind /// \return The converted point, in target coordinates (pixels) /// //////////////////////////////////////////////////////////// -CSFML_GRAPHICS_API sfVector2i sfRenderWindow_mapCoordsToPixel(const sfRenderWindow* renderWindow, sfVector2f point, const sfView* view); +CSFML_GRAPHICS_API sfVector2i + sfRenderWindow_mapCoordsToPixel(const sfRenderWindow* renderWindow, sfVector2f point, const sfView* view); //////////////////////////////////////////////////////////// /// \brief Draw a drawable object to the render-target @@ -465,14 +479,26 @@ CSFML_GRAPHICS_API sfVector2i sfRenderWindow_mapCoordsToPixel(const sfRenderWind /// \param states Render states to use for drawing (NULL to use the default states) /// //////////////////////////////////////////////////////////// -CSFML_GRAPHICS_API void sfRenderWindow_drawSprite(sfRenderWindow* renderWindow, const sfSprite* object, const sfRenderStates* states); +CSFML_GRAPHICS_API void sfRenderWindow_drawSprite(sfRenderWindow* renderWindow, + const sfSprite* object, + const sfRenderStates* states); CSFML_GRAPHICS_API void sfRenderWindow_drawText(sfRenderWindow* renderWindow, const sfText* object, const sfRenderStates* states); CSFML_GRAPHICS_API void sfRenderWindow_drawShape(sfRenderWindow* renderWindow, const sfShape* object, const sfRenderStates* states); -CSFML_GRAPHICS_API void sfRenderWindow_drawCircleShape(sfRenderWindow* renderWindow, const sfCircleShape* object, const sfRenderStates* states); -CSFML_GRAPHICS_API void sfRenderWindow_drawConvexShape(sfRenderWindow* renderWindow, const sfConvexShape* object, const sfRenderStates* states); -CSFML_GRAPHICS_API void sfRenderWindow_drawRectangleShape(sfRenderWindow* renderWindow, const sfRectangleShape* object, const sfRenderStates* states); -CSFML_GRAPHICS_API void sfRenderWindow_drawVertexArray(sfRenderWindow* renderWindow, const sfVertexArray* object, const sfRenderStates* states); -CSFML_GRAPHICS_API void sfRenderWindow_drawVertexBuffer(sfRenderWindow* renderWindow, const sfVertexBuffer* object, const sfRenderStates* states); +CSFML_GRAPHICS_API void sfRenderWindow_drawCircleShape(sfRenderWindow* renderWindow, + const sfCircleShape* object, + const sfRenderStates* states); +CSFML_GRAPHICS_API void sfRenderWindow_drawConvexShape(sfRenderWindow* renderWindow, + const sfConvexShape* object, + const sfRenderStates* states); +CSFML_GRAPHICS_API void sfRenderWindow_drawRectangleShape(sfRenderWindow* renderWindow, + const sfRectangleShape* object, + const sfRenderStates* states); +CSFML_GRAPHICS_API void sfRenderWindow_drawVertexArray(sfRenderWindow* renderWindow, + const sfVertexArray* object, + const sfRenderStates* states); +CSFML_GRAPHICS_API void sfRenderWindow_drawVertexBuffer(sfRenderWindow* renderWindow, + const sfVertexBuffer* object, + const sfRenderStates* states); //////////////////////////////////////////////////////////// /// \brief Draw primitives defined by a vertex buffer. @@ -484,9 +510,12 @@ CSFML_GRAPHICS_API void sfRenderWindow_drawVertexBuffer(sfRenderWindow* renderWi /// \param states Render states to use for drawing /// //////////////////////////////////////////////////////////// -CSFML_GRAPHICS_API void sfRenderWindow_drawVertexBufferRange(sfRenderWindow* renderWindow, - const sfVertexBuffer* object, size_t firstVertex, - size_t vertexCount, const sfRenderStates* states); +CSFML_GRAPHICS_API void sfRenderWindow_drawVertexBufferRange( + sfRenderWindow* renderWindow, + const sfVertexBuffer* object, + size_t firstVertex, + size_t vertexCount, + const sfRenderStates* states); //////////////////////////////////////////////////////////// /// \brief Draw primitives defined by an array of vertices to a render window @@ -498,9 +527,12 @@ CSFML_GRAPHICS_API void sfRenderWindow_drawVertexBufferRange(sfRenderWindow* ren /// \param states Render states to use for drawing (NULL to use the default states) /// //////////////////////////////////////////////////////////// -CSFML_GRAPHICS_API void sfRenderWindow_drawPrimitives(sfRenderWindow* renderWindow, - const sfVertex* vertices, size_t vertexCount, - sfPrimitiveType type, const sfRenderStates* states); +CSFML_GRAPHICS_API void sfRenderWindow_drawPrimitives( + sfRenderWindow* renderWindow, + const sfVertex* vertices, + size_t vertexCount, + sfPrimitiveType type, + const sfRenderStates* states); //////////////////////////////////////////////////////////// /// \brief Save the current OpenGL render states and matrices @@ -600,4 +632,8 @@ CSFML_GRAPHICS_API sfVector2i sfTouch_getPositionRenderWindow(unsigned int finge /// \return True if surface creation was successful, false otherwise /// //////////////////////////////////////////////////////////// -CSFML_GRAPHICS_API bool sfRenderWindow_createVulkanSurface(sfRenderWindow* renderWindow, const VkInstance* instance, VkSurfaceKHR* surface, const VkAllocationCallbacks* allocator); +CSFML_GRAPHICS_API bool sfRenderWindow_createVulkanSurface( + sfRenderWindow* renderWindow, + const VkInstance* instance, + VkSurfaceKHR* surface, + const VkAllocationCallbacks* allocator); diff --git a/include/CSFML/Graphics/Shader.h b/include/CSFML/Graphics/Shader.h index b46586c..53a7ba4 100644 --- a/include/CSFML/Graphics/Shader.h +++ b/include/CSFML/Graphics/Shader.h @@ -28,6 +28,7 @@ // Headers //////////////////////////////////////////////////////////// #include + #include #include #include @@ -35,6 +36,7 @@ #include #include #include + #include @@ -56,7 +58,9 @@ /// \return A new sfShader object, or NULL if it failed /// //////////////////////////////////////////////////////////// -CSFML_GRAPHICS_API sfShader* sfShader_createFromFile(const char* vertexShaderFilename, const char* geometryShaderFilename, const char* fragmentShaderFilename); +CSFML_GRAPHICS_API sfShader* sfShader_createFromFile(const char* vertexShaderFilename, + const char* geometryShaderFilename, + const char* fragmentShaderFilename); //////////////////////////////////////////////////////////// /// \brief Load the vertex, geometry and fragment shaders from source code in memory @@ -76,7 +80,9 @@ CSFML_GRAPHICS_API sfShader* sfShader_createFromFile(const char* vertexShaderFil /// \return A new sfShader object, or NULL if it failed /// //////////////////////////////////////////////////////////// -CSFML_GRAPHICS_API sfShader* sfShader_createFromMemory(const char* vertexShader, const char* geometryShader, const char* fragmentShader); +CSFML_GRAPHICS_API sfShader* sfShader_createFromMemory(const char* vertexShader, + const char* geometryShader, + const char* fragmentShader); //////////////////////////////////////////////////////////// /// \brief Load the vertex, geometry and fragment shaders from custom streams @@ -96,7 +102,9 @@ CSFML_GRAPHICS_API sfShader* sfShader_createFromMemory(const char* vertexShader, /// \return A new sfShader object, or NULL if it failed /// //////////////////////////////////////////////////////////// -CSFML_GRAPHICS_API sfShader* sfShader_createFromStream(sfInputStream* vertexShaderStream, sfInputStream* geometryShaderStream, sfInputStream* fragmentShaderStream); +CSFML_GRAPHICS_API sfShader* sfShader_createFromStream(sfInputStream* vertexShaderStream, + sfInputStream* geometryShaderStream, + sfInputStream* fragmentShaderStream); //////////////////////////////////////////////////////////// /// \brief Destroy an existing shader diff --git a/include/CSFML/Graphics/Shape.h b/include/CSFML/Graphics/Shape.h index a0cb697..c56cd57 100644 --- a/include/CSFML/Graphics/Shape.h +++ b/include/CSFML/Graphics/Shape.h @@ -28,15 +28,17 @@ // Headers //////////////////////////////////////////////////////////// #include + #include #include #include #include #include + #include -typedef size_t (*sfShapeGetPointCountCallback)(void*); ///< Type of the callback used to get the number of points in a shape +typedef size_t (*sfShapeGetPointCountCallback)(void*); ///< Type of the callback used to get the number of points in a shape typedef sfVector2f (*sfShapeGetPointCallback)(size_t, void*); ///< Type of the callback used to get a point of a shape //////////////////////////////////////////////////////////// @@ -50,8 +52,8 @@ typedef sfVector2f (*sfShapeGetPointCallback)(size_t, void*); ///< Type of the c /// //////////////////////////////////////////////////////////// CSFML_GRAPHICS_API sfShape* sfShape_create(sfShapeGetPointCountCallback getPointCount, - sfShapeGetPointCallback getPoint, - void* userData); + sfShapeGetPointCallback getPoint, + void* userData); //////////////////////////////////////////////////////////// /// \brief Destroy an existing shape diff --git a/include/CSFML/Graphics/Sprite.h b/include/CSFML/Graphics/Sprite.h index 947e615..ee43ad3 100644 --- a/include/CSFML/Graphics/Sprite.h +++ b/include/CSFML/Graphics/Sprite.h @@ -28,6 +28,7 @@ // Headers //////////////////////////////////////////////////////////// #include + #include #include #include @@ -38,7 +39,7 @@ //////////////////////////////////////////////////////////// /// \brief Create a new sprite -/// +/// /// \param texture Source texture /// /// \return A new sfSprite object, or NULL if it failed diff --git a/include/CSFML/Graphics/Text.h b/include/CSFML/Graphics/Text.h index 845ceed..c777842 100644 --- a/include/CSFML/Graphics/Text.h +++ b/include/CSFML/Graphics/Text.h @@ -28,11 +28,13 @@ // Headers //////////////////////////////////////////////////////////// #include + #include #include -#include #include +#include #include + #include @@ -51,7 +53,7 @@ typedef enum //////////////////////////////////////////////////////////// /// \brief Create a new text -/// +/// /// \param font Font used to draw the string /// /// \return A new sfText object, or NULL if it failed @@ -277,7 +279,7 @@ CSFML_GRAPHICS_API void sfText_setFont(sfText* text, const sfFont* font); //////////////////////////////////////////////////////////// CSFML_GRAPHICS_API void sfText_setCharacterSize(sfText* text, unsigned int size); - //////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////// /// \brief Set the line spacing factor /// /// The default spacing between lines is defined by the font. @@ -376,7 +378,7 @@ CSFML_GRAPHICS_API const char* sfText_getString(const sfText* text); //////////////////////////////////////////////////////////// /// \brief Get the string of a text (returns a unicode string) -/// +/// /// \param text Text object /// /// \return String as UTF-32 diff --git a/include/CSFML/Graphics/Texture.h b/include/CSFML/Graphics/Texture.h index 4876a4a..382b098 100644 --- a/include/CSFML/Graphics/Texture.h +++ b/include/CSFML/Graphics/Texture.h @@ -28,11 +28,13 @@ // Headers //////////////////////////////////////////////////////////// #include + #include #include -#include #include #include +#include + #include //////////////////////////////////////////////////////////// diff --git a/include/CSFML/Graphics/Transform.h b/include/CSFML/Graphics/Transform.h index 88a26e2..dc4637b 100644 --- a/include/CSFML/Graphics/Transform.h +++ b/include/CSFML/Graphics/Transform.h @@ -28,12 +28,12 @@ // Headers //////////////////////////////////////////////////////////// #include + #include #include #include - //////////////////////////////////////////////////////////// /// \brief Encapsulate a 3x3 transform matrix /// @@ -66,9 +66,8 @@ CSFML_GRAPHICS_API const sfTransform sfTransform_Identity; /// \return A new sfTransform object /// //////////////////////////////////////////////////////////// -CSFML_GRAPHICS_API sfTransform sfTransform_fromMatrix(float a00, float a01, float a02, - float a10, float a11, float a12, - float a20, float a21, float a22); +CSFML_GRAPHICS_API sfTransform + sfTransform_fromMatrix(float a00, float a01, float a02, float a10, float a11, float a12, float a20, float a21, float a22); //////////////////////////////////////////////////////////// /// \brief Return the 4x4 matrix of a transform diff --git a/include/CSFML/Graphics/Transformable.h b/include/CSFML/Graphics/Transformable.h index b39f74a..8f76a67 100644 --- a/include/CSFML/Graphics/Transformable.h +++ b/include/CSFML/Graphics/Transformable.h @@ -28,8 +28,9 @@ // Headers //////////////////////////////////////////////////////////// #include -#include + #include +#include #include diff --git a/include/CSFML/Graphics/Types.h b/include/CSFML/Graphics/Types.h index c0e071a..414e94a 100644 --- a/include/CSFML/Graphics/Types.h +++ b/include/CSFML/Graphics/Types.h @@ -25,19 +25,19 @@ #pragma once -typedef struct sfCircleShape sfCircleShape; -typedef struct sfConvexShape sfConvexShape; -typedef struct sfFont sfFont; -typedef struct sfImage sfImage; -typedef struct sfShader sfShader; +typedef struct sfCircleShape sfCircleShape; +typedef struct sfConvexShape sfConvexShape; +typedef struct sfFont sfFont; +typedef struct sfImage sfImage; +typedef struct sfShader sfShader; typedef struct sfRectangleShape sfRectangleShape; -typedef struct sfRenderTexture sfRenderTexture; -typedef struct sfRenderWindow sfRenderWindow; -typedef struct sfShape sfShape; -typedef struct sfSprite sfSprite; -typedef struct sfText sfText; -typedef struct sfTexture sfTexture; -typedef struct sfTransformable sfTransformable; -typedef struct sfVertexArray sfVertexArray; -typedef struct sfVertexBuffer sfVertexBuffer; -typedef struct sfView sfView; +typedef struct sfRenderTexture sfRenderTexture; +typedef struct sfRenderWindow sfRenderWindow; +typedef struct sfShape sfShape; +typedef struct sfSprite sfSprite; +typedef struct sfText sfText; +typedef struct sfTexture sfTexture; +typedef struct sfTransformable sfTransformable; +typedef struct sfVertexArray sfVertexArray; +typedef struct sfVertexBuffer sfVertexBuffer; +typedef struct sfView sfView; diff --git a/include/CSFML/Graphics/Vertex.h b/include/CSFML/Graphics/Vertex.h index 5053dd2..bfbd823 100644 --- a/include/CSFML/Graphics/Vertex.h +++ b/include/CSFML/Graphics/Vertex.h @@ -28,6 +28,7 @@ // Headers //////////////////////////////////////////////////////////// #include + #include #include diff --git a/include/CSFML/Graphics/VertexArray.h b/include/CSFML/Graphics/VertexArray.h index 3010017..d26c12d 100644 --- a/include/CSFML/Graphics/VertexArray.h +++ b/include/CSFML/Graphics/VertexArray.h @@ -28,10 +28,12 @@ // Headers //////////////////////////////////////////////////////////// #include + #include #include #include #include + #include diff --git a/include/CSFML/Graphics/VertexBuffer.h b/include/CSFML/Graphics/VertexBuffer.h index d6faab0..361527f 100644 --- a/include/CSFML/Graphics/VertexBuffer.h +++ b/include/CSFML/Graphics/VertexBuffer.h @@ -28,9 +28,11 @@ // Headers //////////////////////////////////////////////////////////// #include + #include #include #include + #include @@ -128,7 +130,10 @@ CSFML_GRAPHICS_API unsigned int sfVertexBuffer_getVertexCount(const sfVertexBuff /// \return true if the update was successful /// //////////////////////////////////////////////////////////// -CSFML_GRAPHICS_API bool sfVertexBuffer_update(sfVertexBuffer* vertexBuffer, const sfVertex* vertices, unsigned int vertexCount, unsigned int offset); +CSFML_GRAPHICS_API bool sfVertexBuffer_update(sfVertexBuffer* vertexBuffer, + const sfVertex* vertices, + unsigned int vertexCount, + unsigned int offset); //////////////////////////////////////////////////////////// /// \brief Copy the contents of another buffer into this buffer diff --git a/include/CSFML/Graphics/View.h b/include/CSFML/Graphics/View.h index 27d4dd4..c62514a 100644 --- a/include/CSFML/Graphics/View.h +++ b/include/CSFML/Graphics/View.h @@ -28,6 +28,7 @@ // Headers //////////////////////////////////////////////////////////// #include + #include #include #include diff --git a/include/CSFML/Network.h b/include/CSFML/Network.h index ed9be23..b12760b 100644 --- a/include/CSFML/Network.h +++ b/include/CSFML/Network.h @@ -28,7 +28,6 @@ // Headers //////////////////////////////////////////////////////////// -#include #include #include #include @@ -38,3 +37,4 @@ #include #include #include +#include diff --git a/include/CSFML/Network/Export.h b/include/CSFML/Network/Export.h index 8617eb9..11e352d 100644 --- a/include/CSFML/Network/Export.h +++ b/include/CSFML/Network/Export.h @@ -35,10 +35,10 @@ //////////////////////////////////////////////////////////// #if defined(CSFML_NETWORK_EXPORTS) - #define CSFML_NETWORK_API CSFML_API_EXPORT +#define CSFML_NETWORK_API CSFML_API_EXPORT #else - #define CSFML_NETWORK_API CSFML_API_IMPORT +#define CSFML_NETWORK_API CSFML_API_IMPORT #endif diff --git a/include/CSFML/Network/Ftp.h b/include/CSFML/Network/Ftp.h index 4ed7bdc..49a6687 100644 --- a/include/CSFML/Network/Ftp.h +++ b/include/CSFML/Network/Ftp.h @@ -28,8 +28,10 @@ // Headers //////////////////////////////////////////////////////////// #include + #include #include + #include @@ -59,13 +61,13 @@ typedef enum sfFtpOpeningDataConnection = 150, ///< File status ok, about to open data connection // 2xx: the requested action has been successfully completed - sfFtpOk = 200, ///< Command ok - sfFtpPointlessCommand = 202, ///< Command not implemented - sfFtpSystemStatus = 211, ///< System status, or system help reply - sfFtpDirectoryStatus = 212, ///< Directory status - sfFtpFileStatus = 213, ///< File status - sfFtpHelpMessage = 214, ///< Help message - sfFtpSystemType = 215, ///< NAME system type, where NAME is an official system name from the list in the Assigned Numbers document + sfFtpOk = 200, ///< Command ok + sfFtpPointlessCommand = 202, ///< Command not implemented + sfFtpSystemStatus = 211, ///< System status, or system help reply + sfFtpDirectoryStatus = 212, ///< Directory status + sfFtpFileStatus = 213, ///< File status + sfFtpHelpMessage = 214, ///< Help message + sfFtpSystemType = 215, ///< NAME system type, where NAME is an official system name from the list in the Assigned Numbers document sfFtpServiceReady = 220, ///< Service ready for new user sfFtpClosingConnection = 221, ///< Service closing control connection sfFtpDataConnectionOpened = 225, ///< Data connection open, no transfer in progress @@ -88,7 +90,7 @@ typedef enum sfFtpTransferAborted = 426, ///< Connection closed, transfer aborted sfFtpFileActionAborted = 450, ///< Requested file action not taken sfFtpLocalError = 451, ///< Requested action aborted, local error in processing - sfFtpInsufficientStorageSpace = 452, ///< Requested action not taken; insufficient storage space in system, file unavailable + sfFtpInsufficientStorageSpace = 452, ///< Requested action not taken; insufficient storage space in system, file unavailable // 5xx: the command was not accepted and // the requested action did not take place @@ -220,7 +222,7 @@ CSFML_NETWORK_API const char* sfFtpDirectoryResponse_getMessage(const sfFtpDirec /// /// The returned const char* owns the string and must be freed to /// avoid memory leaks. -/// +/// /// \param ftpDirectoryResponse Ftp directory response /// /// \return Directory name @@ -234,7 +236,7 @@ CSFML_NETWORK_API const char* sfFtpDirectoryResponse_getDirectory(const sfFtpDir /// /// The returned const sfChar32* owns the string and must be freed to /// avoid memory leaks. -/// +/// /// \param ftpDirectoryResponse Ftp directory response /// /// \return Directory name @@ -521,7 +523,12 @@ CSFML_NETWORK_API sfFtpResponse* sfFtp_download(sfFtp* ftp, const char* remoteFi /// \return Server response to the request /// //////////////////////////////////////////////////////////// -CSFML_NETWORK_API sfFtpResponse* sfFtp_upload(sfFtp* ftp, const char* localFile, const char* remotePath, sfFtpTransferMode mode, bool append); +CSFML_NETWORK_API sfFtpResponse* sfFtp_upload( + sfFtp* ftp, + const char* localFile, + const char* remotePath, + sfFtpTransferMode mode, + bool append); //////////////////////////////////////////////////////////// /// \brief Send a command to the FTP server diff --git a/include/CSFML/Network/Http.h b/include/CSFML/Network/Http.h index 87e150f..b0d7171 100644 --- a/include/CSFML/Network/Http.h +++ b/include/CSFML/Network/Http.h @@ -28,6 +28,7 @@ // Headers //////////////////////////////////////////////////////////// #include + #include #include @@ -53,18 +54,18 @@ typedef enum typedef enum { // 2xx: success - sfHttpOk = 200, ///< Most common code returned when operation was successful - sfHttpCreated = 201, ///< The resource has successfully been created - sfHttpAccepted = 202, ///< The request has been accepted, but will be processed later by the server - sfHttpNoContent = 204, ///< Sent when the server didn't send any data in return - sfHttpResetContent = 205, ///< The server informs the client that it should clear the view (form) that caused the request to be sent + sfHttpOk = 200, ///< Most common code returned when operation was successful + sfHttpCreated = 201, ///< The resource has successfully been created + sfHttpAccepted = 202, ///< The request has been accepted, but will be processed later by the server + sfHttpNoContent = 204, ///< Sent when the server didn't send any data in return + sfHttpResetContent = 205, ///< The server informs the client that it should clear the view (form) that caused the request to be sent sfHttpPartialContent = 206, ///< The server has sent a part of the resource, as a response to a partial GET request // 3xx: redirection sfHttpMultipleChoices = 300, ///< The requested page can be accessed from several locations sfHttpMovedPermanently = 301, ///< The requested page has permanently moved to a new location sfHttpMovedTemporarily = 302, ///< The requested page has temporarily moved to a new location - sfHttpNotModified = 304, ///< For conditional requests, means the requested page hasn't changed and doesn't need to be refreshed + sfHttpNotModified = 304, ///< For conditional requests, means the requested page hasn't changed and doesn't need to be refreshed // 4xx: client error sfHttpBadRequest = 400, ///< The server couldn't understand the request (syntax error) diff --git a/include/CSFML/Network/IpAddress.h b/include/CSFML/Network/IpAddress.h index 60905e5..5734ed3 100644 --- a/include/CSFML/Network/IpAddress.h +++ b/include/CSFML/Network/IpAddress.h @@ -28,6 +28,7 @@ // Headers //////////////////////////////////////////////////////////// #include + #include diff --git a/include/CSFML/Network/Packet.h b/include/CSFML/Network/Packet.h index dd2a33d..6b833fe 100644 --- a/include/CSFML/Network/Packet.h +++ b/include/CSFML/Network/Packet.h @@ -28,7 +28,9 @@ // Headers //////////////////////////////////////////////////////////// #include + #include + #include diff --git a/include/CSFML/Network/SocketSelector.h b/include/CSFML/Network/SocketSelector.h index 6a5ac24..ab50d88 100644 --- a/include/CSFML/Network/SocketSelector.h +++ b/include/CSFML/Network/SocketSelector.h @@ -28,6 +28,7 @@ // Headers //////////////////////////////////////////////////////////// #include + #include #include diff --git a/include/CSFML/Network/TcpListener.h b/include/CSFML/Network/TcpListener.h index 442bdc1..de2fb01 100644 --- a/include/CSFML/Network/TcpListener.h +++ b/include/CSFML/Network/TcpListener.h @@ -28,8 +28,9 @@ // Headers //////////////////////////////////////////////////////////// #include -#include + #include +#include #include diff --git a/include/CSFML/Network/TcpSocket.h b/include/CSFML/Network/TcpSocket.h index 9b80306..74618f7 100644 --- a/include/CSFML/Network/TcpSocket.h +++ b/include/CSFML/Network/TcpSocket.h @@ -28,10 +28,12 @@ // Headers //////////////////////////////////////////////////////////// #include + #include #include #include #include + #include @@ -133,7 +135,8 @@ CSFML_NETWORK_API unsigned short sfTcpSocket_getRemotePort(const sfTcpSocket* so /// \return Status code /// //////////////////////////////////////////////////////////// -CSFML_NETWORK_API sfSocketStatus sfTcpSocket_connect(sfTcpSocket* socket, sfIpAddress remoteAddress, unsigned short remotePort, sfTime timeout); +CSFML_NETWORK_API sfSocketStatus + sfTcpSocket_connect(sfTcpSocket* socket, sfIpAddress remoteAddress, unsigned short remotePort, sfTime timeout); //////////////////////////////////////////////////////////// /// \brief Disconnect a TCP socket from its remote peer diff --git a/include/CSFML/Network/Types.h b/include/CSFML/Network/Types.h index 0ae7bf3..16cb08d 100644 --- a/include/CSFML/Network/Types.h +++ b/include/CSFML/Network/Types.h @@ -26,14 +26,14 @@ typedef struct sfFtpDirectoryResponse sfFtpDirectoryResponse; -typedef struct sfFtpListingResponse sfFtpListingResponse; -typedef struct sfFtpResponse sfFtpResponse; -typedef struct sfFtp sfFtp; -typedef struct sfHttpRequest sfHttpRequest; -typedef struct sfHttpResponse sfHttpResponse; -typedef struct sfHttp sfHttp; -typedef struct sfPacket sfPacket; -typedef struct sfSocketSelector sfSocketSelector; -typedef struct sfTcpListener sfTcpListener; -typedef struct sfTcpSocket sfTcpSocket; -typedef struct sfUdpSocket sfUdpSocket; +typedef struct sfFtpListingResponse sfFtpListingResponse; +typedef struct sfFtpResponse sfFtpResponse; +typedef struct sfFtp sfFtp; +typedef struct sfHttpRequest sfHttpRequest; +typedef struct sfHttpResponse sfHttpResponse; +typedef struct sfHttp sfHttp; +typedef struct sfPacket sfPacket; +typedef struct sfSocketSelector sfSocketSelector; +typedef struct sfTcpListener sfTcpListener; +typedef struct sfTcpSocket sfTcpSocket; +typedef struct sfUdpSocket sfUdpSocket; diff --git a/include/CSFML/Network/UdpSocket.h b/include/CSFML/Network/UdpSocket.h index 60b2e02..348bd82 100644 --- a/include/CSFML/Network/UdpSocket.h +++ b/include/CSFML/Network/UdpSocket.h @@ -28,9 +28,11 @@ // Headers //////////////////////////////////////////////////////////// #include + #include #include #include + #include @@ -139,7 +141,8 @@ CSFML_NETWORK_API void sfUdpSocket_unbind(sfUdpSocket* socket); /// \return Status code /// //////////////////////////////////////////////////////////// -CSFML_NETWORK_API sfSocketStatus sfUdpSocket_send(sfUdpSocket* socket, const void* data, size_t size, sfIpAddress remoteAddress, unsigned short remotePort); +CSFML_NETWORK_API sfSocketStatus + sfUdpSocket_send(sfUdpSocket* socket, const void* data, size_t size, sfIpAddress remoteAddress, unsigned short remotePort); //////////////////////////////////////////////////////////// /// \brief Receive raw data from a remote peer with a UDP socket @@ -161,7 +164,13 @@ CSFML_NETWORK_API sfSocketStatus sfUdpSocket_send(sfUdpSocket* socket, const voi /// \return Status code /// //////////////////////////////////////////////////////////// -CSFML_NETWORK_API sfSocketStatus sfUdpSocket_receive(sfUdpSocket* socket, void* data, size_t size, size_t* received, sfIpAddress* remoteAddress, unsigned short* remotePort); +CSFML_NETWORK_API sfSocketStatus sfUdpSocket_receive( + sfUdpSocket* socket, + void* data, + size_t size, + size_t* received, + sfIpAddress* remoteAddress, + unsigned short* remotePort); //////////////////////////////////////////////////////////// /// \brief Send a formatted packet of data to a remote peer with a UDP socket @@ -178,7 +187,8 @@ CSFML_NETWORK_API sfSocketStatus sfUdpSocket_receive(sfUdpSocket* socket, void* /// \return Status code /// //////////////////////////////////////////////////////////// -CSFML_NETWORK_API sfSocketStatus sfUdpSocket_sendPacket(sfUdpSocket* socket, sfPacket* packet, sfIpAddress remoteAddress, unsigned short remotePort); +CSFML_NETWORK_API sfSocketStatus + sfUdpSocket_sendPacket(sfUdpSocket* socket, sfPacket* packet, sfIpAddress remoteAddress, unsigned short remotePort); //////////////////////////////////////////////////////////// /// \brief Receive a formatted packet of data from a remote peer with a UDP socket @@ -193,7 +203,8 @@ CSFML_NETWORK_API sfSocketStatus sfUdpSocket_sendPacket(sfUdpSocket* socket, sfP /// \return Status code /// //////////////////////////////////////////////////////////// -CSFML_NETWORK_API sfSocketStatus sfUdpSocket_receivePacket(sfUdpSocket* socket, sfPacket* packet, sfIpAddress* remoteAddress, unsigned short* remotePort); +CSFML_NETWORK_API sfSocketStatus + sfUdpSocket_receivePacket(sfUdpSocket* socket, sfPacket* packet, sfIpAddress* remoteAddress, unsigned short* remotePort); //////////////////////////////////////////////////////////// /// \brief Return the maximum number of bytes that can be diff --git a/include/CSFML/OpenGL.h b/include/CSFML/OpenGL.h index 65410c0..5b3eaab 100644 --- a/include/CSFML/OpenGL.h +++ b/include/CSFML/OpenGL.h @@ -36,18 +36,18 @@ //////////////////////////////////////////////////////////// #if defined(CSFML_SYSTEM_WINDOWS) - #include - #include - #include +#include +#include +#include #elif defined(CSFML_SYSTEM_LINUX) || defined(CSFML_SYSTEM_FREEBSD) - #include - #include +#include +#include #elif defined(CSFML_SYSTEM_MACOS) - #include - #include +#include +#include #endif diff --git a/include/CSFML/System.h b/include/CSFML/System.h index 3eac617..a332f51 100644 --- a/include/CSFML/System.h +++ b/include/CSFML/System.h @@ -29,6 +29,7 @@ //////////////////////////////////////////////////////////// #include + #include #include #include diff --git a/include/CSFML/System/Alloc.h b/include/CSFML/System/Alloc.h index 720eccb..0c59503 100644 --- a/include/CSFML/System/Alloc.h +++ b/include/CSFML/System/Alloc.h @@ -35,11 +35,11 @@ /// /// This function deallocates the memory being pointed to /// using the free function from the C standard library. -/// +/// /// The memory must have been previously allocated using a call /// to malloc. -/// -/// \param ptr Pointer to the memory to deallocate +/// +/// \param ptr Pointer to the memory to deallocate /// //////////////////////////////////////////////////////////// CSFML_SYSTEM_API void sfFree(void* ptr); diff --git a/include/CSFML/System/Buffer.h b/include/CSFML/System/Buffer.h index 8d7f319..1570589 100644 --- a/include/CSFML/System/Buffer.h +++ b/include/CSFML/System/Buffer.h @@ -28,7 +28,9 @@ // Headers //////////////////////////////////////////////////////////// #include + #include + #include diff --git a/include/CSFML/System/Clock.h b/include/CSFML/System/Clock.h index f5a53f8..e6202ce 100644 --- a/include/CSFML/System/Clock.h +++ b/include/CSFML/System/Clock.h @@ -28,6 +28,7 @@ // Headers //////////////////////////////////////////////////////////// #include + #include #include diff --git a/include/CSFML/System/Export.h b/include/CSFML/System/Export.h index efbadaf..71c435b 100644 --- a/include/CSFML/System/Export.h +++ b/include/CSFML/System/Export.h @@ -35,10 +35,10 @@ //////////////////////////////////////////////////////////// #if defined(CSFML_SYSTEM_EXPORTS) - #define CSFML_SYSTEM_API CSFML_API_EXPORT +#define CSFML_SYSTEM_API CSFML_API_EXPORT #else - #define CSFML_SYSTEM_API CSFML_API_IMPORT +#define CSFML_SYSTEM_API CSFML_API_IMPORT #endif diff --git a/include/CSFML/System/InputStream.h b/include/CSFML/System/InputStream.h index a3f3eb9..9da7105 100644 --- a/include/CSFML/System/InputStream.h +++ b/include/CSFML/System/InputStream.h @@ -28,6 +28,7 @@ // Headers //////////////////////////////////////////////////////////// #include + #include diff --git a/include/CSFML/System/Sleep.h b/include/CSFML/System/Sleep.h index 6573aec..c43583d 100644 --- a/include/CSFML/System/Sleep.h +++ b/include/CSFML/System/Sleep.h @@ -28,6 +28,7 @@ // Headers //////////////////////////////////////////////////////////// #include + #include diff --git a/include/CSFML/System/Types.h b/include/CSFML/System/Types.h index 97a4a41..fe18f3e 100644 --- a/include/CSFML/System/Types.h +++ b/include/CSFML/System/Types.h @@ -26,4 +26,4 @@ typedef struct sfBuffer sfBuffer; -typedef struct sfClock sfClock; +typedef struct sfClock sfClock; diff --git a/include/CSFML/Window/Clipboard.h b/include/CSFML/Window/Clipboard.h index b8ce3d1..8d234f6 100644 --- a/include/CSFML/Window/Clipboard.h +++ b/include/CSFML/Window/Clipboard.h @@ -28,6 +28,7 @@ // Headers //////////////////////////////////////////////////////////// #include + #include diff --git a/include/CSFML/Window/Context.h b/include/CSFML/Window/Context.h index f234758..6fb824f 100644 --- a/include/CSFML/Window/Context.h +++ b/include/CSFML/Window/Context.h @@ -28,6 +28,7 @@ // Headers //////////////////////////////////////////////////////////// #include + #include #include diff --git a/include/CSFML/Window/Cursor.h b/include/CSFML/Window/Cursor.h index 4f62cfa..878c2fb 100644 --- a/include/CSFML/Window/Cursor.h +++ b/include/CSFML/Window/Cursor.h @@ -27,8 +27,9 @@ //////////////////////////////////////////////////////////// // Headers //////////////////////////////////////////////////////////// -#include #include + +#include #include @@ -78,14 +79,14 @@ typedef enum sfCursorSizeRight, ///< Right arrow cursor on Linux, same as SizeHorizontal on other platforms sfCursorSizeTop, ///< Up arrow cursor on Linux, same as SizeVertical on other platforms sfCursorSizeBottom, ///< Down arrow cursor on Linux, same as SizeVertical on other platforms - sfCursorSizeTopLeft, ///< Top-left arrow cursor on Linux, same as SizeTopLeftBottomRight on other platforms - sfCursorSizeBottomRight, ///< Bottom-right arrow cursor on Linux, same as SizeTopLeftBottomRight on other platforms - sfCursorSizeBottomLeft, ///< Bottom-left arrow cursor on Linux, same as SizeBottomLeftTopRight on other platforms - sfCursorSizeTopRight, ///< Top-right arrow cursor on Linux, same as SizeBottomLeftTopRight on other platforms - sfCursorSizeAll, ///< Combination of SizeHorizontal and SizeVertical - sfCursorCross, ///< Crosshair cursor - sfCursorHelp, ///< Help cursor - sfCursorNotAllowed ///< Action not allowed cursor + sfCursorSizeTopLeft, ///< Top-left arrow cursor on Linux, same as SizeTopLeftBottomRight on other platforms + sfCursorSizeBottomRight, ///< Bottom-right arrow cursor on Linux, same as SizeTopLeftBottomRight on other platforms + sfCursorSizeBottomLeft, ///< Bottom-left arrow cursor on Linux, same as SizeBottomLeftTopRight on other platforms + sfCursorSizeTopRight, ///< Top-right arrow cursor on Linux, same as SizeBottomLeftTopRight on other platforms + sfCursorSizeAll, ///< Combination of SizeHorizontal and SizeVertical + sfCursorCross, ///< Crosshair cursor + sfCursorHelp, ///< Help cursor + sfCursorNotAllowed ///< Action not allowed cursor } sfCursorType; diff --git a/include/CSFML/Window/Event.h b/include/CSFML/Window/Event.h index 0d2f73b..860dae2 100644 --- a/include/CSFML/Window/Event.h +++ b/include/CSFML/Window/Event.h @@ -28,6 +28,7 @@ // Headers //////////////////////////////////////////////////////////// #include + #include #include #include @@ -63,7 +64,7 @@ typedef enum sfEvtTouchEnded, ///< A touch event ended (data in event.touch) sfEvtSensorChanged, ///< A sensor value changed (data in event.sensor) - sfEvtCount ///< Keep last -- the total number of event types + sfEvtCount ///< Keep last -- the total number of event types } sfEventType; diff --git a/include/CSFML/Window/Export.h b/include/CSFML/Window/Export.h index b994508..1912158 100644 --- a/include/CSFML/Window/Export.h +++ b/include/CSFML/Window/Export.h @@ -35,10 +35,10 @@ //////////////////////////////////////////////////////////// #if defined(CSFML_WINDOW_EXPORTS) - #define CSFML_WINDOW_API CSFML_API_EXPORT +#define CSFML_WINDOW_API CSFML_API_EXPORT #else - #define CSFML_WINDOW_API CSFML_API_IMPORT +#define CSFML_WINDOW_API CSFML_API_IMPORT #endif diff --git a/include/CSFML/Window/Joystick.h b/include/CSFML/Window/Joystick.h index 1649f60..d2a8384 100644 --- a/include/CSFML/Window/Joystick.h +++ b/include/CSFML/Window/Joystick.h @@ -28,6 +28,7 @@ // Headers //////////////////////////////////////////////////////////// #include + #include diff --git a/include/CSFML/Window/Keyboard.h b/include/CSFML/Window/Keyboard.h index 520e3e7..7af1d29 100644 --- a/include/CSFML/Window/Keyboard.h +++ b/include/CSFML/Window/Keyboard.h @@ -143,7 +143,7 @@ typedef enum sfKeyF15, ///< The F15 key sfKeyPause, ///< The Pause key - sfKeyCount, ///< Keep last -- the total number of keyboard keys + sfKeyCount, ///< Keep last -- the total number of keyboard keys } sfKeyCode; @@ -157,118 +157,118 @@ typedef enum //////////////////////////////////////////////////////////// typedef enum { - sfScanUnknown = -1, //!< Represents any scancode not present in this enum - sfScanA = 0, //!< Keyboard a and A key - sfScanB, //!< Keyboard b and B key - sfScanC, //!< Keyboard c and C key - sfScanD, //!< Keyboard d and D key - sfScanE, //!< Keyboard e and E key - sfScanF, //!< Keyboard f and F key - sfScanG, //!< Keyboard g and G key - sfScanH, //!< Keyboard h and H key - sfScanI, //!< Keyboard i and I key - sfScanJ, //!< Keyboard j and J key - sfScanK, //!< Keyboard k and K key - sfScanL, //!< Keyboard l and L key - sfScanM, //!< Keyboard m and M key - sfScanN, //!< Keyboard n and N key - sfScanO, //!< Keyboard o and O key - sfScanP, //!< Keyboard p and P key - sfScanQ, //!< Keyboard q and Q key - sfScanR, //!< Keyboard r and R key - sfScanS, //!< Keyboard s and S key - sfScanT, //!< Keyboard t and T key - sfScanU, //!< Keyboard u and U key - sfScanV, //!< Keyboard v and V key - sfScanW, //!< Keyboard w and W key - sfScanX, //!< Keyboard x and X key - sfScanY, //!< Keyboard y and Y key - sfScanZ, //!< Keyboard z and Z key - sfScanNum1, //!< Keyboard 1 and ! key - sfScanNum2, //!< Keyboard 2 and @ key - sfScanNum3, //!< Keyboard 3 and # key - sfScanNum4, //!< Keyboard 4 and $ key - sfScanNum5, //!< Keyboard 5 and % key - sfScanNum6, //!< Keyboard 6 and ^ key - sfScanNum7, //!< Keyboard 7 and & key - sfScanNum8, //!< Keyboard 8 and * key - sfScanNum9, //!< Keyboard 9 and ) key - sfScanNum0, //!< Keyboard 0 and ) key - sfScanEnter, //!< Keyboard Enter/Return key - sfScanEscape, //!< Keyboard Escape key - sfScanBackspace, //!< Keyboard Backspace key - sfScanTab, //!< Keyboard Tab key - sfScanSpace, //!< Keyboard Space key - sfScanHyphen, //!< Keyboard - and _ key - sfScanEqual, //!< Keyboard = and + - sfScanLBracket, //!< Keyboard [ and { key - sfScanRBracket, //!< Keyboard ] and } key + sfScanUnknown = -1, //!< Represents any scancode not present in this enum + sfScanA = 0, //!< Keyboard a and A key + sfScanB, //!< Keyboard b and B key + sfScanC, //!< Keyboard c and C key + sfScanD, //!< Keyboard d and D key + sfScanE, //!< Keyboard e and E key + sfScanF, //!< Keyboard f and F key + sfScanG, //!< Keyboard g and G key + sfScanH, //!< Keyboard h and H key + sfScanI, //!< Keyboard i and I key + sfScanJ, //!< Keyboard j and J key + sfScanK, //!< Keyboard k and K key + sfScanL, //!< Keyboard l and L key + sfScanM, //!< Keyboard m and M key + sfScanN, //!< Keyboard n and N key + sfScanO, //!< Keyboard o and O key + sfScanP, //!< Keyboard p and P key + sfScanQ, //!< Keyboard q and Q key + sfScanR, //!< Keyboard r and R key + sfScanS, //!< Keyboard s and S key + sfScanT, //!< Keyboard t and T key + sfScanU, //!< Keyboard u and U key + sfScanV, //!< Keyboard v and V key + sfScanW, //!< Keyboard w and W key + sfScanX, //!< Keyboard x and X key + sfScanY, //!< Keyboard y and Y key + sfScanZ, //!< Keyboard z and Z key + sfScanNum1, //!< Keyboard 1 and ! key + sfScanNum2, //!< Keyboard 2 and @ key + sfScanNum3, //!< Keyboard 3 and # key + sfScanNum4, //!< Keyboard 4 and $ key + sfScanNum5, //!< Keyboard 5 and % key + sfScanNum6, //!< Keyboard 6 and ^ key + sfScanNum7, //!< Keyboard 7 and & key + sfScanNum8, //!< Keyboard 8 and * key + sfScanNum9, //!< Keyboard 9 and ) key + sfScanNum0, //!< Keyboard 0 and ) key + sfScanEnter, //!< Keyboard Enter/Return key + sfScanEscape, //!< Keyboard Escape key + sfScanBackspace, //!< Keyboard Backspace key + sfScanTab, //!< Keyboard Tab key + sfScanSpace, //!< Keyboard Space key + sfScanHyphen, //!< Keyboard - and _ key + sfScanEqual, //!< Keyboard = and + + sfScanLBracket, //!< Keyboard [ and { key + sfScanRBracket, //!< Keyboard ] and } key // For US keyboards mapped to key 29 (Microsoft Keyboard Scan Code Specification) // For Non-US keyboards mapped to key 42 (Microsoft Keyboard Scan Code Specification) // Typical language mappings: Belg:£µ` FrCa:<>} Dan:*' Dutch:`´ Fren:µ* Ger:'# Ital:§ù LatAm:[}` Nor:*@ Span:ç} Swed:*' Swiss:$£} UK:~# Brazil:}] - sfScanBackslash, //!< Keyboard \ and | key OR various keys for Non-US keyboards - sfScanSemicolon, //!< Keyboard ; and : key - sfScanApostrophe, //!< Keyboard ' and " key - sfScanGrave, //!< Keyboard ` and ~ key - sfScanComma, //!< Keyboard , and < key - sfScanPeriod, //!< Keyboard . and > key - sfScanSlash, //!< Keyboard / and ? key - sfScanF1, //!< Keyboard F1 key - sfScanF2, //!< Keyboard F2 key - sfScanF3, //!< Keyboard F3 key - sfScanF4, //!< Keyboard F4 key - sfScanF5, //!< Keyboard F5 key - sfScanF6, //!< Keyboard F6 key - sfScanF7, //!< Keyboard F7 key - sfScanF8, //!< Keyboard F8 key - sfScanF9, //!< Keyboard F9 key - sfScanF10, //!< Keyboard F10 key - sfScanF11, //!< Keyboard F11 key - sfScanF12, //!< Keyboard F12 key - sfScanF13, //!< Keyboard F13 key - sfScanF14, //!< Keyboard F14 key - sfScanF15, //!< Keyboard F15 key - sfScanF16, //!< Keyboard F16 key - sfScanF17, //!< Keyboard F17 key - sfScanF18, //!< Keyboard F18 key - sfScanF19, //!< Keyboard F19 key - sfScanF20, //!< Keyboard F20 key - sfScanF21, //!< Keyboard F21 key - sfScanF22, //!< Keyboard F22 key - sfScanF23, //!< Keyboard F23 key - sfScanF24, //!< Keyboard F24 key - sfScanCapsLock, //!< Keyboard Caps %Lock key - sfScanPrintScreen, //!< Keyboard Print Screen key - sfScanScrollLock, //!< Keyboard Scroll %Lock key - sfScanPause, //!< Keyboard Pause key - sfScanInsert, //!< Keyboard Insert key - sfScanHome, //!< Keyboard Home key - sfScanPageUp, //!< Keyboard Page Up key - sfScanDelete, //!< Keyboard Delete Forward key - sfScanEnd, //!< Keyboard End key - sfScanPageDown, //!< Keyboard Page Down key - sfScanRight, //!< Keyboard Right Arrow key - sfScanLeft, //!< Keyboard Left Arrow key - sfScanDown, //!< Keyboard Down Arrow key - sfScanUp, //!< Keyboard Up Arrow key - sfScanNumLock, //!< Keypad Num %Lock and Clear key - sfScanNumpadDivide, //!< Keypad / key - sfScanNumpadMultiply, //!< Keypad * key - sfScanNumpadMinus, //!< Keypad - key - sfScanNumpadPlus, //!< Keypad + key - sfScanNumpadEqual, //!< keypad = key - sfScanNumpadEnter, //!< Keypad Enter/Return key - sfScanNumpadDecimal, //!< Keypad . and Delete key - sfScanNumpad1, //!< Keypad 1 and End key - sfScanNumpad2, //!< Keypad 2 and Down Arrow key - sfScanNumpad3, //!< Keypad 3 and Page Down key - sfScanNumpad4, //!< Keypad 4 and Left Arrow key - sfScanNumpad5, //!< Keypad 5 key - sfScanNumpad6, //!< Keypad 6 and Right Arrow key - sfScanNumpad7, //!< Keypad 7 and Home key - sfScanNumpad8, //!< Keypad 8 and Up Arrow key - sfScanNumpad9, //!< Keypad 9 and Page Up key - sfScanNumpad0, //!< Keypad 0 and Insert key + sfScanBackslash, //!< Keyboard \ and | key OR various keys for Non-US keyboards + sfScanSemicolon, //!< Keyboard ; and : key + sfScanApostrophe, //!< Keyboard ' and " key + sfScanGrave, //!< Keyboard ` and ~ key + sfScanComma, //!< Keyboard , and < key + sfScanPeriod, //!< Keyboard . and > key + sfScanSlash, //!< Keyboard / and ? key + sfScanF1, //!< Keyboard F1 key + sfScanF2, //!< Keyboard F2 key + sfScanF3, //!< Keyboard F3 key + sfScanF4, //!< Keyboard F4 key + sfScanF5, //!< Keyboard F5 key + sfScanF6, //!< Keyboard F6 key + sfScanF7, //!< Keyboard F7 key + sfScanF8, //!< Keyboard F8 key + sfScanF9, //!< Keyboard F9 key + sfScanF10, //!< Keyboard F10 key + sfScanF11, //!< Keyboard F11 key + sfScanF12, //!< Keyboard F12 key + sfScanF13, //!< Keyboard F13 key + sfScanF14, //!< Keyboard F14 key + sfScanF15, //!< Keyboard F15 key + sfScanF16, //!< Keyboard F16 key + sfScanF17, //!< Keyboard F17 key + sfScanF18, //!< Keyboard F18 key + sfScanF19, //!< Keyboard F19 key + sfScanF20, //!< Keyboard F20 key + sfScanF21, //!< Keyboard F21 key + sfScanF22, //!< Keyboard F22 key + sfScanF23, //!< Keyboard F23 key + sfScanF24, //!< Keyboard F24 key + sfScanCapsLock, //!< Keyboard Caps %Lock key + sfScanPrintScreen, //!< Keyboard Print Screen key + sfScanScrollLock, //!< Keyboard Scroll %Lock key + sfScanPause, //!< Keyboard Pause key + sfScanInsert, //!< Keyboard Insert key + sfScanHome, //!< Keyboard Home key + sfScanPageUp, //!< Keyboard Page Up key + sfScanDelete, //!< Keyboard Delete Forward key + sfScanEnd, //!< Keyboard End key + sfScanPageDown, //!< Keyboard Page Down key + sfScanRight, //!< Keyboard Right Arrow key + sfScanLeft, //!< Keyboard Left Arrow key + sfScanDown, //!< Keyboard Down Arrow key + sfScanUp, //!< Keyboard Up Arrow key + sfScanNumLock, //!< Keypad Num %Lock and Clear key + sfScanNumpadDivide, //!< Keypad / key + sfScanNumpadMultiply, //!< Keypad * key + sfScanNumpadMinus, //!< Keypad - key + sfScanNumpadPlus, //!< Keypad + key + sfScanNumpadEqual, //!< keypad = key + sfScanNumpadEnter, //!< Keypad Enter/Return key + sfScanNumpadDecimal, //!< Keypad . and Delete key + sfScanNumpad1, //!< Keypad 1 and End key + sfScanNumpad2, //!< Keypad 2 and Down Arrow key + sfScanNumpad3, //!< Keypad 3 and Page Down key + sfScanNumpad4, //!< Keypad 4 and Left Arrow key + sfScanNumpad5, //!< Keypad 5 key + sfScanNumpad6, //!< Keypad 6 and Right Arrow key + sfScanNumpad7, //!< Keypad 7 and Home key + sfScanNumpad8, //!< Keypad 8 and Up Arrow key + sfScanNumpad9, //!< Keypad 9 and Page Up key + sfScanNumpad0, //!< Keypad 0 and Insert key // For US keyboards doesn't exist // For Non-US keyboards mapped to key 45 (Microsoft Keyboard Scan Code Specification) // Typical language mappings: Belg:<\> FrCa:«°» Dan:<\> Dutch:]|[ Fren:<> Ger:<|> Ital:<> LatAm:<> Nor:<> Span:<> Swed:<|> Swiss:<\> UK:\| Brazil: \|. @@ -311,7 +311,7 @@ typedef enum sfScanLaunchMail, //!< Keyboard Launch Mail key sfScanLaunchMediaSelect, //!< Keyboard Launch Media Select key - sfScancodeCount //!< Keep last -- the total number of scancodes + sfScancodeCount //!< Keep last -- the total number of scancodes } sfScancode; diff --git a/include/CSFML/Window/Mouse.h b/include/CSFML/Window/Mouse.h index 972f460..ba34afd 100644 --- a/include/CSFML/Window/Mouse.h +++ b/include/CSFML/Window/Mouse.h @@ -28,8 +28,9 @@ // Headers //////////////////////////////////////////////////////////// #include -#include + #include +#include //////////////////////////////////////////////////////////// @@ -38,11 +39,11 @@ //////////////////////////////////////////////////////////// typedef enum { - sfMouseLeft, ///< The left mouse button - sfMouseRight, ///< The right mouse button - sfMouseMiddle, ///< The middle (wheel) mouse button - sfMouseXButton1, ///< The first extra mouse button - sfMouseXButton2, ///< The second extra mouse button + sfMouseLeft, ///< The left mouse button + sfMouseRight, ///< The right mouse button + sfMouseMiddle, ///< The middle (wheel) mouse button + sfMouseXButton1, ///< The first extra mouse button + sfMouseXButton2, ///< The second extra mouse button sfMouseButtonCount ///< Keep last -- the total number of mouse buttons } sfMouseButton; diff --git a/include/CSFML/Window/Sensor.h b/include/CSFML/Window/Sensor.h index da5ef30..6c48c65 100644 --- a/include/CSFML/Window/Sensor.h +++ b/include/CSFML/Window/Sensor.h @@ -28,8 +28,9 @@ // Headers //////////////////////////////////////////////////////////// #include -#include + #include +#include //////////////////////////////////////////////////////////// @@ -38,14 +39,14 @@ //////////////////////////////////////////////////////////// typedef enum { - sfSensorAccelerometer, ///< Measures the raw acceleration (m/s^2) - sfSensorGyroscope, ///< Measures the raw rotation rates (degrees/s) - sfSensorMagnetometer, ///< Measures the ambient magnetic field (micro-teslas) - sfSensorGravity, ///< Measures the direction and intensity of gravity, independent of device acceleration (m/s^2) + sfSensorAccelerometer, ///< Measures the raw acceleration (m/s^2) + sfSensorGyroscope, ///< Measures the raw rotation rates (degrees/s) + sfSensorMagnetometer, ///< Measures the ambient magnetic field (micro-teslas) + sfSensorGravity, ///< Measures the direction and intensity of gravity, independent of device acceleration (m/s^2) sfSensorUserAcceleration, ///< Measures the direction and intensity of device acceleration, independent of the gravity (m/s^2) - sfSensorOrientation, ///< Measures the absolute 3D orientation (degrees) + sfSensorOrientation, ///< Measures the absolute 3D orientation (degrees) - sfSensorCount ///< Keep last -- the total number of sensor types + sfSensorCount ///< Keep last -- the total number of sensor types } sfSensorType; diff --git a/include/CSFML/Window/Touch.h b/include/CSFML/Window/Touch.h index d4ef4a9..6516b68 100644 --- a/include/CSFML/Window/Touch.h +++ b/include/CSFML/Window/Touch.h @@ -28,8 +28,9 @@ // Headers //////////////////////////////////////////////////////////// #include -#include + #include +#include //////////////////////////////////////////////////////////// diff --git a/include/CSFML/Window/Types.h b/include/CSFML/Window/Types.h index 0a567da..9a4d7c6 100644 --- a/include/CSFML/Window/Types.h +++ b/include/CSFML/Window/Types.h @@ -25,7 +25,7 @@ #pragma once -typedef struct sfContext sfContext; -typedef struct sfCursor sfCursor; -typedef struct sfWindow sfWindow; +typedef struct sfContext sfContext; +typedef struct sfCursor sfCursor; +typedef struct sfWindow sfWindow; typedef struct sfWindowBase sfWindowBase; diff --git a/include/CSFML/Window/VideoMode.h b/include/CSFML/Window/VideoMode.h index 79a3b97..2251e0b 100644 --- a/include/CSFML/Window/VideoMode.h +++ b/include/CSFML/Window/VideoMode.h @@ -28,7 +28,9 @@ // Headers //////////////////////////////////////////////////////////// #include + #include + #include diff --git a/include/CSFML/Window/Vulkan.h b/include/CSFML/Window/Vulkan.h index 16ad278..a180f29 100644 --- a/include/CSFML/Window/Vulkan.h +++ b/include/CSFML/Window/Vulkan.h @@ -26,12 +26,14 @@ // Headers //////////////////////////////////////////////////////////// #include + #include typedef struct VkInstance_T* VkInstance; -#if defined(__LP64__) || defined(_WIN64) || (defined(__x86_64__) && !defined(__ILP32__) ) || defined(_M_X64) || defined(__ia64) || defined (_M_IA64) || defined(__aarch64__) || defined(__powerpc64__) +#if defined(__LP64__) || defined(_WIN64) || (defined(__x86_64__) && !defined(__ILP32__)) || defined(_M_X64) || \ + defined(__ia64) || defined(_M_IA64) || defined(__aarch64__) || defined(__powerpc64__) typedef struct VkSurfaceKHR_T* VkSurfaceKHR; diff --git a/include/CSFML/Window/Window.h b/include/CSFML/Window/Window.h index 5975ccb..aacdacd 100644 --- a/include/CSFML/Window/Window.h +++ b/include/CSFML/Window/Window.h @@ -28,12 +28,13 @@ // Headers //////////////////////////////////////////////////////////// #include + +#include #include +#include #include #include #include -#include -#include //////////////////////////////////////////////////////////// @@ -42,7 +43,7 @@ //////////////////////////////////////////////////////////// typedef enum { - sfContextDefault = 0, ///< Non-debug, compatibility context (this and the core attribute are mutually exclusive) + sfContextDefault = 0, ///< Non-debug, compatibility context (this and the core attribute are mutually exclusive) sfContextCore = 1 << 0, ///< Core attribute sfContextDebug = 1 << 2 ///< Debug attribute } sfContextAttribute; @@ -86,7 +87,11 @@ typedef struct /// \return A new sfWindow object /// //////////////////////////////////////////////////////////// -CSFML_WINDOW_API sfWindow* sfWindow_create(sfVideoMode mode, const char* title, uint32_t style, sfWindowState state, const sfContextSettings* settings); +CSFML_WINDOW_API sfWindow* sfWindow_create(sfVideoMode mode, + const char* title, + uint32_t style, + sfWindowState state, + const sfContextSettings* settings); //////////////////////////////////////////////////////////// /// \brief Construct a new window (with a UTF-32 title) @@ -110,7 +115,12 @@ CSFML_WINDOW_API sfWindow* sfWindow_create(sfVideoMode mode, const char* title, /// \return A new sfWindow object /// //////////////////////////////////////////////////////////// -CSFML_WINDOW_API sfWindow* sfWindow_createUnicode(sfVideoMode mode, const sfChar32* title, uint32_t style, sfWindowState state, const sfContextSettings* settings); +CSFML_WINDOW_API sfWindow* sfWindow_createUnicode( + sfVideoMode mode, + const sfChar32* title, + uint32_t style, + sfWindowState state, + const sfContextSettings* settings); //////////////////////////////////////////////////////////// /// \brief Construct a window from an existing control @@ -485,4 +495,7 @@ CSFML_WINDOW_API sfWindowHandle sfWindow_getNativeHandle(const sfWindow* window) /// \return True if surface creation was successful, false otherwise /// //////////////////////////////////////////////////////////// -CSFML_WINDOW_API bool sfWindow_createVulkanSurface(sfWindow* window, const VkInstance* instance, VkSurfaceKHR* surface, const VkAllocationCallbacks* allocator); +CSFML_WINDOW_API bool sfWindow_createVulkanSurface(sfWindow* window, + const VkInstance* instance, + VkSurfaceKHR* surface, + const VkAllocationCallbacks* allocator); diff --git a/include/CSFML/Window/WindowBase.h b/include/CSFML/Window/WindowBase.h index 1ff0787..787218a 100644 --- a/include/CSFML/Window/WindowBase.h +++ b/include/CSFML/Window/WindowBase.h @@ -28,12 +28,13 @@ // Headers //////////////////////////////////////////////////////////// #include -#include -#include -#include -#include -#include + #include +#include +#include +#include +#include +#include //////////////////////////////////////////////////////////// @@ -42,10 +43,10 @@ //////////////////////////////////////////////////////////// typedef enum { - sfNone = 0, ///< No border / title bar (this flag and all others are mutually exclusive) - sfTitlebar = 1 << 0, ///< Title bar + fixed border - sfResize = 1 << 1, ///< Titlebar + resizable border + maximize button - sfClose = 1 << 2, ///< Titlebar + close button + sfNone = 0, ///< No border / title bar (this flag and all others are mutually exclusive) + sfTitlebar = 1 << 0, ///< Title bar + fixed border + sfResize = 1 << 1, ///< Titlebar + resizable border + maximize button + sfClose = 1 << 2, ///< Titlebar + close button sfDefaultStyle = sfTitlebar | sfResize | sfClose ///< Default window style } sfWindowStyle; @@ -388,4 +389,7 @@ CSFML_WINDOW_API sfWindowHandle sfWindowBase_getNativeHandle(const sfWindowBase* /// \return True if surface creation was successful, false otherwise /// //////////////////////////////////////////////////////////// -CSFML_WINDOW_API bool sfWindowBase_createVulkanSurface(sfWindowBase* windowBase, const VkInstance* instance, VkSurfaceKHR* surface, const VkAllocationCallbacks* allocator); +CSFML_WINDOW_API bool sfWindowBase_createVulkanSurface(sfWindowBase* windowBase, + const VkInstance* instance, + VkSurfaceKHR* surface, + const VkAllocationCallbacks* allocator); diff --git a/include/CSFML/Window/WindowHandle.h b/include/CSFML/Window/WindowHandle.h index d0c4fae..5951f2f 100644 --- a/include/CSFML/Window/WindowHandle.h +++ b/include/CSFML/Window/WindowHandle.h @@ -36,18 +36,18 @@ //////////////////////////////////////////////////////////// #if defined(CSFML_SYSTEM_WINDOWS) - // Window handle is HWND (HWND__*) on Windows - struct HWND__; - typedef struct HWND__* sfWindowHandle; +// Window handle is HWND (HWND__*) on Windows +struct HWND__; +typedef struct HWND__* sfWindowHandle; #elif defined(CSFML_SYSTEM_LINUX) || defined(CSFML_SYSTEM_FREEBSD) - // Window handle is Window (unsigned long) on Unix - X11 - typedef unsigned long sfWindowHandle; +// Window handle is Window (unsigned long) on Unix - X11 +typedef unsigned long sfWindowHandle; #elif defined(CSFML_SYSTEM_MACOS) - // Window handle is NSWindow (void*) on Mac OS X - Cocoa - typedef void* sfWindowHandle; +// Window handle is NSWindow (void*) on Mac OS X - Cocoa +typedef void* sfWindowHandle; #endif diff --git a/src/CSFML/Audio/Listener.cpp b/src/CSFML/Audio/Listener.cpp index eb5912a..1338f29 100644 --- a/src/CSFML/Audio/Listener.cpp +++ b/src/CSFML/Audio/Listener.cpp @@ -26,9 +26,9 @@ // Headers //////////////////////////////////////////////////////////// #include -#include #include +#include //////////////////////////////////////////////////////////// diff --git a/src/CSFML/Audio/Music.cpp b/src/CSFML/Audio/Music.cpp index e6b21c5..d8e97f1 100644 --- a/src/CSFML/Audio/Music.cpp +++ b/src/CSFML/Audio/Music.cpp @@ -27,8 +27,8 @@ //////////////////////////////////////////////////////////// #include #include -#include #include +#include //////////////////////////////////////////////////////////// @@ -65,7 +65,7 @@ sfMusic* sfMusic_createFromStream(sfInputStream* stream) CSFML_CHECK_RETURN(stream, nullptr); sfMusic* music = new sfMusic; - music->Stream = CallbackStream(stream); + music->Stream = CallbackStream(stream); if (!music->This.openFromStream(music->Stream)) { delete music; @@ -126,8 +126,9 @@ sfTimeSpan sfMusic_getLoopPoints(const sfMusic* music) //////////////////////////////////////////////////////////// void sfMusic_setLoopPoints(sfMusic* music, sfTimeSpan timePoints) { - CSFML_CALL(music, setLoopPoints(sf::Music::TimeSpan({ sf::microseconds(timePoints.offset.microseconds), - sf::microseconds(timePoints.length.microseconds)}))); + CSFML_CALL(music, + setLoopPoints(sf::Music::TimeSpan( + {sf::microseconds(timePoints.offset.microseconds), sf::microseconds(timePoints.length.microseconds)}))); } diff --git a/src/CSFML/Audio/MusicStruct.hpp b/src/CSFML/Audio/MusicStruct.hpp index a4ba48d..aeffa78 100644 --- a/src/CSFML/Audio/MusicStruct.hpp +++ b/src/CSFML/Audio/MusicStruct.hpp @@ -27,9 +27,10 @@ //////////////////////////////////////////////////////////// // Headers //////////////////////////////////////////////////////////// -#include #include +#include + //////////////////////////////////////////////////////////// // Internal structure of sfMusic @@ -37,5 +38,5 @@ struct sfMusic { CallbackStream Stream; - sf::Music This; + sf::Music This; }; diff --git a/src/CSFML/Audio/Sound.cpp b/src/CSFML/Audio/Sound.cpp index 9be9bf3..b8d13ed 100644 --- a/src/CSFML/Audio/Sound.cpp +++ b/src/CSFML/Audio/Sound.cpp @@ -27,8 +27,8 @@ //////////////////////////////////////////////////////////// #include #include -#include #include +#include //////////////////////////////////////////////////////////// @@ -36,7 +36,7 @@ sfSound* sfSound_create(const sfSoundBuffer* buffer) { CSFML_CHECK_RETURN(buffer, nullptr); - return new sfSound{ sf::Sound{ buffer->This }, buffer }; + return new sfSound{sf::Sound{buffer->This}, buffer}; } diff --git a/src/CSFML/Audio/SoundBuffer.cpp b/src/CSFML/Audio/SoundBuffer.cpp index 104c292..2fdd7e6 100644 --- a/src/CSFML/Audio/SoundBuffer.cpp +++ b/src/CSFML/Audio/SoundBuffer.cpp @@ -53,13 +53,12 @@ sfSoundBuffer* sfSoundBuffer_createFromMemory(const void* data, size_t sizeInByt } - //////////////////////////////////////////////////////////// sfSoundBuffer* sfSoundBuffer_createFromStream(sfInputStream* stream) { CSFML_CHECK_RETURN(stream, nullptr); - CallbackStream sfmlStream(stream); + CallbackStream sfmlStream(stream); sf::SoundBuffer soundBuffer; if (!soundBuffer.loadFromStream(sfmlStream)) return nullptr; @@ -69,12 +68,13 @@ sfSoundBuffer* sfSoundBuffer_createFromStream(sfInputStream* stream) //////////////////////////////////////////////////////////// -sfSoundBuffer* sfSoundBuffer_createFromSamples(const int16_t* samples, - uint64_t sampleCount, - unsigned int channelCount, - unsigned int sampleRate, - sfSoundChannel* channelMapData, - size_t channelMapSize) +sfSoundBuffer* sfSoundBuffer_createFromSamples( + const int16_t* samples, + uint64_t sampleCount, + unsigned int channelCount, + unsigned int sampleRate, + sfSoundChannel* channelMapData, + size_t channelMapSize) { std::vector channelMap(channelMapSize); for (std::size_t i = 0; i < channelMap.size(); ++i) diff --git a/src/CSFML/Audio/SoundBufferRecorderStruct.hpp b/src/CSFML/Audio/SoundBufferRecorderStruct.hpp index e11775e..f661901 100644 --- a/src/CSFML/Audio/SoundBufferRecorderStruct.hpp +++ b/src/CSFML/Audio/SoundBufferRecorderStruct.hpp @@ -27,9 +27,10 @@ //////////////////////////////////////////////////////////// // Headers //////////////////////////////////////////////////////////// -#include #include +#include + //////////////////////////////////////////////////////////// // Internal structure of sfSoundBufferRecorder diff --git a/src/CSFML/Audio/SoundRecorderStruct.hpp b/src/CSFML/Audio/SoundRecorderStruct.hpp index 0ea2d33..ad3afd2 100644 --- a/src/CSFML/Audio/SoundRecorderStruct.hpp +++ b/src/CSFML/Audio/SoundRecorderStruct.hpp @@ -27,9 +27,10 @@ //////////////////////////////////////////////////////////// // Headers //////////////////////////////////////////////////////////// -#include #include +#include + //////////////////////////////////////////////////////////// // Helper class implementing the callback forwarding from @@ -37,21 +38,19 @@ //////////////////////////////////////////////////////////// class sfSoundRecorderImpl : public sf::SoundRecorder { -public : - +public: sfSoundRecorderImpl(sfSoundRecorderStartCallback onStart, sfSoundRecorderProcessCallback onProcess, sfSoundRecorderStopCallback onStop, void* userData) : - myStartCallback (onStart), + myStartCallback(onStart), myProcessCallback(onProcess), - myStopCallback (onStop), - myUserData (userData) + myStopCallback(onStop), + myUserData(userData) { } -private : - +private: bool onStart() override { if (myStartCallback) @@ -95,5 +94,5 @@ struct sfSoundRecorder } sfSoundRecorderImpl This; - std::string DeviceName; + std::string DeviceName; }; diff --git a/src/CSFML/Audio/SoundStream.cpp b/src/CSFML/Audio/SoundStream.cpp index 28a0930..92f113d 100644 --- a/src/CSFML/Audio/SoundStream.cpp +++ b/src/CSFML/Audio/SoundStream.cpp @@ -27,18 +27,19 @@ //////////////////////////////////////////////////////////// #include #include -#include #include +#include //////////////////////////////////////////////////////////// -sfSoundStream* sfSoundStream_create(sfSoundStreamGetDataCallback onGetData, - sfSoundStreamSeekCallback onSeek, - unsigned int channelCount, - unsigned int sampleRate, - sfSoundChannel* channelMapData, - size_t channelMapSize, - void* userData) +sfSoundStream* sfSoundStream_create( + sfSoundStreamGetDataCallback onGetData, + sfSoundStreamSeekCallback onSeek, + unsigned int channelCount, + unsigned int sampleRate, + sfSoundChannel* channelMapData, + size_t channelMapSize, + void* userData) { return new sfSoundStream(onGetData, onSeek, channelCount, sampleRate, channelMapData, channelMapSize, userData); } diff --git a/src/CSFML/Audio/SoundStreamStruct.hpp b/src/CSFML/Audio/SoundStreamStruct.hpp index 6f14a91..07011e4 100644 --- a/src/CSFML/Audio/SoundStreamStruct.hpp +++ b/src/CSFML/Audio/SoundStreamStruct.hpp @@ -28,6 +28,7 @@ // Headers //////////////////////////////////////////////////////////// #include + #include @@ -37,8 +38,7 @@ //////////////////////////////////////////////////////////// class sfSoundStreamImpl : public sf::SoundStream { -public : - +public: sfSoundStreamImpl(sfSoundStreamGetDataCallback onGetData, sfSoundStreamSeekCallback onSeek, unsigned int channelCount, @@ -47,8 +47,8 @@ public : size_t channelMapSize, void* userData) : myGetDataCallback(onGetData), - mySeekCallback (onSeek), - myUserData (userData) + mySeekCallback(onSeek), + myUserData(userData) { std::vector channelMap(channelMapSize); for (std::size_t i = 0; i < channelMap.size(); ++i) @@ -56,12 +56,11 @@ public : initialize(channelCount, sampleRate, channelMap); } -private : - +private: bool onGetData(Chunk& data) override { sfSoundStreamChunk chunk = {nullptr, 0}; - bool ok = myGetDataCallback(&chunk, myUserData); + bool ok = myGetDataCallback(&chunk, myUserData); data.samples = chunk.samples; data.sampleCount = chunk.sampleCount; diff --git a/src/CSFML/Audio/SoundStruct.hpp b/src/CSFML/Audio/SoundStruct.hpp index f73f1fd..9a30398 100644 --- a/src/CSFML/Audio/SoundStruct.hpp +++ b/src/CSFML/Audio/SoundStruct.hpp @@ -27,9 +27,10 @@ //////////////////////////////////////////////////////////// // Headers //////////////////////////////////////////////////////////// -#include #include +#include + //////////////////////////////////////////////////////////// // Internal structure of sfSound diff --git a/src/CSFML/CallbackStream.hpp b/src/CSFML/CallbackStream.hpp index dca60bd..f46ab04 100644 --- a/src/CSFML/CallbackStream.hpp +++ b/src/CSFML/CallbackStream.hpp @@ -27,9 +27,10 @@ //////////////////////////////////////////////////////////// // Headers //////////////////////////////////////////////////////////// -#include #include +#include + //////////////////////////////////////////////////////////// /// \brief Adapts a CSFML input stream to a SFML input stream @@ -38,7 +39,6 @@ class CallbackStream : public sf::InputStream { public: - //////////////////////////////////////////////////////////// /// \brief Default constructor /// @@ -51,8 +51,7 @@ public: /// \param stream CSFML input stream callbacks /// //////////////////////////////////////////////////////////// - CallbackStream(sfInputStream* stream) : - myStream(*stream) + CallbackStream(sfInputStream* stream) : myStream(*stream) { } @@ -134,7 +133,6 @@ public: } private: - //////////////////////////////////////////////////////////// // Member data //////////////////////////////////////////////////////////// diff --git a/src/CSFML/Char32.hpp b/src/CSFML/Char32.hpp index f739866..c802467 100644 --- a/src/CSFML/Char32.hpp +++ b/src/CSFML/Char32.hpp @@ -27,8 +27,10 @@ //////////////////////////////////////////////////////////// // Headers //////////////////////////////////////////////////////////// -#include #include + +#include + #include @@ -38,7 +40,7 @@ inline sfChar32* copyToChar32(const sf::String& str) { std::size_t byteCount = sizeof(sfChar32) * str.getSize(); - sfChar32* utf32 = static_cast(malloc(byteCount + sizeof(sfChar32))); + sfChar32* utf32 = static_cast(malloc(byteCount + sizeof(sfChar32))); memcpy(utf32, str.getData(), byteCount); utf32[str.getSize()] = 0; diff --git a/src/CSFML/ConvertEvent.hpp b/src/CSFML/ConvertEvent.hpp index f789731..1539925 100644 --- a/src/CSFML/ConvertEvent.hpp +++ b/src/CSFML/ConvertEvent.hpp @@ -27,9 +27,10 @@ //////////////////////////////////////////////////////////// // Headers //////////////////////////////////////////////////////////// -#include #include +#include + //////////////////////////////////////////////////////////// // Define a function to convert a sf::Event to a sfEvent diff --git a/src/CSFML/Graphics/BlendMode.cpp b/src/CSFML/Graphics/BlendMode.cpp index 117cbc7..d5d1018 100644 --- a/src/CSFML/Graphics/BlendMode.cpp +++ b/src/CSFML/Graphics/BlendMode.cpp @@ -29,25 +29,29 @@ //////////////////////////////////////////////////////////// -const sfBlendMode sfBlendAlpha = { sfBlendFactorSrcAlpha, sfBlendFactorOneMinusSrcAlpha, sfBlendEquationAdd, - sfBlendFactorOne, sfBlendFactorOneMinusSrcAlpha, sfBlendEquationAdd }; +const sfBlendMode sfBlendAlpha = {sfBlendFactorSrcAlpha, + sfBlendFactorOneMinusSrcAlpha, + sfBlendEquationAdd, + sfBlendFactorOne, + sfBlendFactorOneMinusSrcAlpha, + sfBlendEquationAdd}; //////////////////////////////////////////////////////////// -const sfBlendMode sfBlendAdd = { sfBlendFactorSrcAlpha, sfBlendFactorOne, sfBlendEquationAdd, - sfBlendFactorOne, sfBlendFactorOne, sfBlendEquationAdd }; +const sfBlendMode sfBlendAdd = + {sfBlendFactorSrcAlpha, sfBlendFactorOne, sfBlendEquationAdd, sfBlendFactorOne, sfBlendFactorOne, sfBlendEquationAdd}; //////////////////////////////////////////////////////////// -const sfBlendMode sfBlendMultiply = { sfBlendFactorDstColor, sfBlendFactorZero, sfBlendEquationAdd, - sfBlendFactorDstColor, sfBlendFactorZero, sfBlendEquationAdd }; +const sfBlendMode sfBlendMultiply = + {sfBlendFactorDstColor, sfBlendFactorZero, sfBlendEquationAdd, sfBlendFactorDstColor, sfBlendFactorZero, sfBlendEquationAdd}; //////////////////////////////////////////////////////////// -const sfBlendMode sfBlendMin = { sfBlendFactorOne, sfBlendFactorOne, sfBlendEquationMin, - sfBlendFactorOne, sfBlendFactorOne, sfBlendEquationMin }; +const sfBlendMode sfBlendMin = + {sfBlendFactorOne, sfBlendFactorOne, sfBlendEquationMin, sfBlendFactorOne, sfBlendFactorOne, sfBlendEquationMin}; //////////////////////////////////////////////////////////// -const sfBlendMode sfBlendMax = { sfBlendFactorOne, sfBlendFactorOne, sfBlendEquationMax, - sfBlendFactorOne, sfBlendFactorOne, sfBlendEquationMax }; +const sfBlendMode sfBlendMax = + {sfBlendFactorOne, sfBlendFactorOne, sfBlendEquationMax, sfBlendFactorOne, sfBlendFactorOne, sfBlendEquationMax}; //////////////////////////////////////////////////////////// -const sfBlendMode sfBlendNone = { sfBlendFactorOne, sfBlendFactorZero, sfBlendEquationAdd, - sfBlendFactorOne, sfBlendFactorZero, sfBlendEquationAdd }; +const sfBlendMode sfBlendNone = + {sfBlendFactorOne, sfBlendFactorZero, sfBlendEquationAdd, sfBlendFactorOne, sfBlendFactorZero, sfBlendEquationAdd}; diff --git a/src/CSFML/Graphics/CircleShape.cpp b/src/CSFML/Graphics/CircleShape.cpp index 08db5c0..bee4dab 100644 --- a/src/CSFML/Graphics/CircleShape.cpp +++ b/src/CSFML/Graphics/CircleShape.cpp @@ -29,17 +29,18 @@ #include #include #include -#include -#include #include #include +#include + +#include //////////////////////////////////////////////////////////// sfCircleShape* sfCircleShape_create() { sfCircleShape* shape = new sfCircleShape; - shape->Texture = nullptr; + shape->Texture = nullptr; return shape; } diff --git a/src/CSFML/Graphics/CircleShapeStruct.hpp b/src/CSFML/Graphics/CircleShapeStruct.hpp index 169903a..7505f48 100644 --- a/src/CSFML/Graphics/CircleShapeStruct.hpp +++ b/src/CSFML/Graphics/CircleShapeStruct.hpp @@ -27,10 +27,11 @@ //////////////////////////////////////////////////////////// // Headers //////////////////////////////////////////////////////////// -#include #include #include +#include + //////////////////////////////////////////////////////////// // Internal structure of sfCircleShape diff --git a/src/CSFML/Graphics/Color.cpp b/src/CSFML/Graphics/Color.cpp index fcb2a64..251496c 100644 --- a/src/CSFML/Graphics/Color.cpp +++ b/src/CSFML/Graphics/Color.cpp @@ -27,19 +27,20 @@ //////////////////////////////////////////////////////////// #include #include + #include //////////////////////////////////////////////////////////// -sfColor sfBlack = sfColor_fromRGB( 0, 0, 0); +sfColor sfBlack = sfColor_fromRGB(0, 0, 0); sfColor sfWhite = sfColor_fromRGB(255, 255, 255); -sfColor sfRed = sfColor_fromRGB(255, 0, 0); -sfColor sfGreen = sfColor_fromRGB( 0, 255, 0); -sfColor sfBlue = sfColor_fromRGB( 0, 0, 255); -sfColor sfYellow = sfColor_fromRGB(255, 255, 0); -sfColor sfMagenta = sfColor_fromRGB(255, 0, 255); -sfColor sfCyan = sfColor_fromRGB( 0, 255, 255); -sfColor sfTransparent = sfColor_fromRGBA( 0, 0, 0, 0); +sfColor sfRed = sfColor_fromRGB(255, 0, 0); +sfColor sfGreen = sfColor_fromRGB(0, 255, 0); +sfColor sfBlue = sfColor_fromRGB(0, 0, 255); +sfColor sfYellow = sfColor_fromRGB(255, 255, 0); +sfColor sfMagenta = sfColor_fromRGB(255, 0, 255); +sfColor sfCyan = sfColor_fromRGB(0, 255, 255); +sfColor sfTransparent = sfColor_fromRGBA(0, 0, 0, 0); //////////////////////////////////////////////////////////// @@ -66,9 +67,9 @@ sfColor sfColor_fromRGBA(uint8_t red, uint8_t green, uint8_t blue, uint8_t alpha //////////////////////////////////////////////////////////// sfColor sfColor_fromInteger(uint32_t color) { - uint8_t red = static_cast((color & 0xff000000) >> 24); + uint8_t red = static_cast((color & 0xff000000) >> 24); uint8_t green = static_cast((color & 0x00ff0000) >> 16); - uint8_t blue = static_cast((color & 0x0000ff00) >> 8); + uint8_t blue = static_cast((color & 0x0000ff00) >> 8); uint8_t alpha = static_cast((color & 0x000000ff) >> 0); return sfColor_fromRGBA(red, green, blue, alpha); diff --git a/src/CSFML/Graphics/ConvertColor.hpp b/src/CSFML/Graphics/ConvertColor.hpp index 8192dd1..7cef475 100644 --- a/src/CSFML/Graphics/ConvertColor.hpp +++ b/src/CSFML/Graphics/ConvertColor.hpp @@ -27,9 +27,10 @@ //////////////////////////////////////////////////////////// // Headers //////////////////////////////////////////////////////////// -#include #include +#include + //////////////////////////////////////////////////////////// // Convert sf::Color to sfColor diff --git a/src/CSFML/Graphics/ConvertRect.hpp b/src/CSFML/Graphics/ConvertRect.hpp index 76dba5e..a139b34 100644 --- a/src/CSFML/Graphics/ConvertRect.hpp +++ b/src/CSFML/Graphics/ConvertRect.hpp @@ -27,9 +27,10 @@ //////////////////////////////////////////////////////////// // Headers //////////////////////////////////////////////////////////// -#include #include +#include + //////////////////////////////////////////////////////////// // Convert sf::Rect to CSFML Rect diff --git a/src/CSFML/Graphics/ConvertRenderStates.hpp b/src/CSFML/Graphics/ConvertRenderStates.hpp index 5ec031b..552f436 100644 --- a/src/CSFML/Graphics/ConvertRenderStates.hpp +++ b/src/CSFML/Graphics/ConvertRenderStates.hpp @@ -27,11 +27,12 @@ //////////////////////////////////////////////////////////// // Headers //////////////////////////////////////////////////////////// -#include -#include #include -#include +#include #include +#include + +#include //////////////////////////////////////////////////////////// @@ -45,12 +46,12 @@ sf::RenderStates renderStates; renderStates.blendMode.colorSrcFactor = static_cast(states->blendMode.colorSrcFactor); renderStates.blendMode.colorDstFactor = static_cast(states->blendMode.colorDstFactor); - renderStates.blendMode.colorEquation = static_cast(states->blendMode.colorEquation); + renderStates.blendMode.colorEquation = static_cast(states->blendMode.colorEquation); renderStates.blendMode.alphaSrcFactor = static_cast(states->blendMode.alphaSrcFactor); renderStates.blendMode.alphaDstFactor = static_cast(states->blendMode.alphaDstFactor); - renderStates.blendMode.alphaEquation = static_cast(states->blendMode.alphaEquation); - renderStates.transform = convertTransform(states->transform); - renderStates.texture = states->texture ? states->texture->This : nullptr; - renderStates.shader = states->shader ? &states->shader->This : nullptr; + renderStates.blendMode.alphaEquation = static_cast(states->blendMode.alphaEquation); + renderStates.transform = convertTransform(states->transform); + renderStates.texture = states->texture ? states->texture->This : nullptr; + renderStates.shader = states->shader ? &states->shader->This : nullptr; return renderStates; } diff --git a/src/CSFML/Graphics/ConvertTransform.hpp b/src/CSFML/Graphics/ConvertTransform.hpp index 651e392..dba6384 100644 --- a/src/CSFML/Graphics/ConvertTransform.hpp +++ b/src/CSFML/Graphics/ConvertTransform.hpp @@ -28,6 +28,7 @@ // Headers //////////////////////////////////////////////////////////// #include + #include diff --git a/src/CSFML/Graphics/ConvexShape.cpp b/src/CSFML/Graphics/ConvexShape.cpp index 141ba5f..12bf55d 100644 --- a/src/CSFML/Graphics/ConvexShape.cpp +++ b/src/CSFML/Graphics/ConvexShape.cpp @@ -25,14 +25,15 @@ //////////////////////////////////////////////////////////// // Headers //////////////////////////////////////////////////////////// -#include -#include -#include -#include #include #include -#include +#include +#include +#include #include +#include + +#include //////////////////////////////////////////////////////////// diff --git a/src/CSFML/Graphics/ConvexShapeStruct.hpp b/src/CSFML/Graphics/ConvexShapeStruct.hpp index a6ab3c9..2a7f796 100644 --- a/src/CSFML/Graphics/ConvexShapeStruct.hpp +++ b/src/CSFML/Graphics/ConvexShapeStruct.hpp @@ -27,10 +27,11 @@ //////////////////////////////////////////////////////////// // Headers //////////////////////////////////////////////////////////// -#include #include #include +#include + //////////////////////////////////////////////////////////// // Internal structure of sfConvexShape diff --git a/src/CSFML/Graphics/Font.cpp b/src/CSFML/Graphics/Font.cpp index 4081172..b4a1f3a 100644 --- a/src/CSFML/Graphics/Font.cpp +++ b/src/CSFML/Graphics/Font.cpp @@ -25,11 +25,11 @@ //////////////////////////////////////////////////////////// // Headers //////////////////////////////////////////////////////////// +#include +#include #include #include -#include #include -#include //////////////////////////////////////////////////////////// @@ -164,7 +164,7 @@ void sfFont_setSmooth(sfFont* font, bool smooth) //////////////////////////////////////////////////////////// -bool sfFont_isSmooth(const sfFont *font) +bool sfFont_isSmooth(const sfFont* font) { return font->This.isSmooth(); } diff --git a/src/CSFML/Graphics/FontStruct.hpp b/src/CSFML/Graphics/FontStruct.hpp index 13adf6a..960849a 100644 --- a/src/CSFML/Graphics/FontStruct.hpp +++ b/src/CSFML/Graphics/FontStruct.hpp @@ -27,9 +27,11 @@ //////////////////////////////////////////////////////////// // Headers //////////////////////////////////////////////////////////// -#include -#include #include +#include + +#include + #include @@ -38,7 +40,7 @@ //////////////////////////////////////////////////////////// struct sfFont { - sf::Font This; + sf::Font This; std::map Textures; - CallbackStream Stream; + CallbackStream Stream; }; diff --git a/src/CSFML/Graphics/Image.cpp b/src/CSFML/Graphics/Image.cpp index a9e8e7a..59ee09c 100644 --- a/src/CSFML/Graphics/Image.cpp +++ b/src/CSFML/Graphics/Image.cpp @@ -25,14 +25,14 @@ //////////////////////////////////////////////////////////// // Headers //////////////////////////////////////////////////////////// -#include -#include +#include #include #include -#include -#include +#include +#include #include -#include +#include +#include //////////////////////////////////////////////////////////// @@ -84,7 +84,7 @@ sfImage* sfImage_createFromStream(sfInputStream* stream) CSFML_CHECK_RETURN(stream, nullptr); CallbackStream sfmlStream(stream); - sf::Image image; + sf::Image image; if (!image.loadFromStream(sfmlStream)) return nullptr; @@ -123,7 +123,7 @@ bool sfImage_saveToMemory(const sfImage* image, sfBuffer* output, const char* fo auto data = image->This.saveToMemory(format); - if (data) + if (data) { output->buffer = std::move(*data); return true; diff --git a/src/CSFML/Graphics/Rect.cpp b/src/CSFML/Graphics/Rect.cpp index 34d3064..50c1658 100644 --- a/src/CSFML/Graphics/Rect.cpp +++ b/src/CSFML/Graphics/Rect.cpp @@ -25,11 +25,12 @@ //////////////////////////////////////////////////////////// // Headers //////////////////////////////////////////////////////////// -#include -#include #include -#include +#include #include +#include + +#include //////////////////////////////////////////////////////////// diff --git a/src/CSFML/Graphics/RectangleShape.cpp b/src/CSFML/Graphics/RectangleShape.cpp index 12e6e39..511f01e 100644 --- a/src/CSFML/Graphics/RectangleShape.cpp +++ b/src/CSFML/Graphics/RectangleShape.cpp @@ -25,14 +25,15 @@ //////////////////////////////////////////////////////////// // Headers //////////////////////////////////////////////////////////// -#include -#include #include #include -#include #include -#include +#include +#include #include +#include + +#include //////////////////////////////////////////////////////////// diff --git a/src/CSFML/Graphics/RectangleShapeStruct.hpp b/src/CSFML/Graphics/RectangleShapeStruct.hpp index a655d8f..d83f473 100644 --- a/src/CSFML/Graphics/RectangleShapeStruct.hpp +++ b/src/CSFML/Graphics/RectangleShapeStruct.hpp @@ -27,10 +27,11 @@ //////////////////////////////////////////////////////////// // Headers //////////////////////////////////////////////////////////// -#include #include #include +#include + //////////////////////////////////////////////////////////// // Internal structure of sfRectangleShape diff --git a/src/CSFML/Graphics/RenderStates.cpp b/src/CSFML/Graphics/RenderStates.cpp index 374cade..1656fff 100644 --- a/src/CSFML/Graphics/RenderStates.cpp +++ b/src/CSFML/Graphics/RenderStates.cpp @@ -29,7 +29,8 @@ //////////////////////////////////////////////////////////// -sfRenderStates sfRenderStates_default() { +sfRenderStates sfRenderStates_default() +{ sfRenderStates states = { sfBlendAlpha, sfTransform_Identity, diff --git a/src/CSFML/Graphics/RenderTexture.cpp b/src/CSFML/Graphics/RenderTexture.cpp index 2725d1a..e3c0701 100644 --- a/src/CSFML/Graphics/RenderTexture.cpp +++ b/src/CSFML/Graphics/RenderTexture.cpp @@ -25,21 +25,21 @@ //////////////////////////////////////////////////////////// // Headers //////////////////////////////////////////////////////////// -#include -#include -#include -#include -#include #include -#include -#include -#include -#include -#include #include #include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include +#include #include @@ -54,7 +54,7 @@ sfRenderTexture* sfRenderTexture_create(sfVector2u size, const sfContextSettings if (!renderTexture.resize(convertVector2(size), params)) return nullptr; - auto* texture = new sfTexture(const_cast(&renderTexture.getTexture())); + auto* texture = new sfTexture(const_cast(&renderTexture.getTexture())); const auto defaultView = sfView{renderTexture.getDefaultView()}; const auto currentView = sfView{renderTexture.getView()}; @@ -213,9 +213,11 @@ void sfRenderTexture_drawVertexBuffer(sfRenderTexture* renderTexture, const sfVe //////////////////////////////////////////////////////////// -void sfRenderTexture_drawVertexBufferRange(sfRenderTexture* renderTexture, - const sfVertexBuffer* object, size_t firstVertex, - size_t vertexCount, const sfRenderStates* states) +void sfRenderTexture_drawVertexBufferRange(sfRenderTexture* renderTexture, + const sfVertexBuffer* object, + size_t firstVertex, + size_t vertexCount, + const sfRenderStates* states) { CSFML_CHECK(object); CSFML_CALL(renderTexture, draw(object->This, firstVertex, vertexCount, convertRenderStates(states))); @@ -223,12 +225,17 @@ void sfRenderTexture_drawVertexBufferRange(sfRenderTexture* renderTexture, //////////////////////////////////////////////////////////// -void sfRenderTexture_drawPrimitives(sfRenderTexture* renderTexture, - const sfVertex* vertices, size_t vertexCount, - sfPrimitiveType type, const sfRenderStates* states) +void sfRenderTexture_drawPrimitives(sfRenderTexture* renderTexture, + const sfVertex* vertices, + size_t vertexCount, + sfPrimitiveType type, + const sfRenderStates* states) { - CSFML_CALL(renderTexture, draw(reinterpret_cast(vertices), vertexCount, - static_cast(type), convertRenderStates(states))); + CSFML_CALL(renderTexture, + draw(reinterpret_cast(vertices), + vertexCount, + static_cast(type), + convertRenderStates(states))); } diff --git a/src/CSFML/Graphics/RenderTextureStruct.hpp b/src/CSFML/Graphics/RenderTextureStruct.hpp index a38db25..bd866cc 100644 --- a/src/CSFML/Graphics/RenderTextureStruct.hpp +++ b/src/CSFML/Graphics/RenderTextureStruct.hpp @@ -27,10 +27,11 @@ //////////////////////////////////////////////////////////// // Headers //////////////////////////////////////////////////////////// -#include #include #include +#include + //////////////////////////////////////////////////////////// // Internal structure of sfRenderTexture diff --git a/src/CSFML/Graphics/RenderWindow.cpp b/src/CSFML/Graphics/RenderWindow.cpp index e2dcae9..b21c2d6 100644 --- a/src/CSFML/Graphics/RenderWindow.cpp +++ b/src/CSFML/Graphics/RenderWindow.cpp @@ -27,10 +27,10 @@ //////////////////////////////////////////////////////////// #include #include -#include -#include #include #include +#include +#include #include #include #include @@ -41,15 +41,20 @@ #include #include #include -#include -#include -#include #include +#include +#include +#include + #include //////////////////////////////////////////////////////////// -sfRenderWindow* sfRenderWindow_create(sfVideoMode mode, const char* title, uint32_t style, sfWindowState state, const sfContextSettings* settings) +sfRenderWindow* sfRenderWindow_create(sfVideoMode mode, + const char* title, + uint32_t style, + sfWindowState state, + const sfContextSettings* settings) { // Convert context settings const sf::ContextSettings params = settings ? convertContextSettings(*settings) : sf::ContextSettings(); @@ -64,14 +69,23 @@ sfRenderWindow* sfRenderWindow_create(sfVideoMode mode, const char* title, uint3 } //////////////////////////////////////////////////////////// -sfRenderWindow* sfRenderWindow_createUnicode(sfVideoMode mode, const sfChar32* title, uint32_t style, sfWindowState state, const sfContextSettings* settings) +sfRenderWindow* sfRenderWindow_createUnicode( + sfVideoMode mode, + const sfChar32* title, + uint32_t style, + sfWindowState state, + const sfContextSettings* settings) { // Convert context settings const sf::ContextSettings params = settings ? convertContextSettings(*settings) : sf::ContextSettings(); // Create the window sfRenderWindow* renderWindow = new sfRenderWindow; - renderWindow->This.create(convertVideoMode(mode), reinterpret_cast(title), style, static_cast(state), params); + renderWindow->This.create(convertVideoMode(mode), + reinterpret_cast(title), + style, + static_cast(state), + params); renderWindow->DefaultView.This = renderWindow->This.getDefaultView(); renderWindow->CurrentView.This = renderWindow->This.getView(); @@ -129,7 +143,7 @@ sfContextSettings sfRenderWindow_getSettings(const sfRenderWindow* renderWindow) bool sfRenderWindow_pollEvent(sfRenderWindow* renderWindow, sfEvent* event) { CSFML_CHECK_RETURN(renderWindow, false); - CSFML_CHECK_RETURN(event, false); + CSFML_CHECK_RETURN(event, false); // Get the event const std::optional sfmlEvent = renderWindow->This.pollEvent(); @@ -149,7 +163,7 @@ bool sfRenderWindow_pollEvent(sfRenderWindow* renderWindow, sfEvent* event) bool sfRenderWindow_waitEvent(sfRenderWindow* renderWindow, sfEvent* event) { CSFML_CHECK_RETURN(renderWindow, false); - CSFML_CHECK_RETURN(event, false); + CSFML_CHECK_RETURN(event, false); // Get the event const std::optional sfmlEvent = renderWindow->This.waitEvent(); @@ -170,7 +184,8 @@ sfVector2i sfRenderWindow_getPosition(const sfRenderWindow* renderWindow) { CSFML_CHECK_RETURN(renderWindow, {}); - return convertVector2(renderWindow->This.getPosition());; + return convertVector2(renderWindow->This.getPosition()); + ; } @@ -433,9 +448,11 @@ void sfRenderWindow_drawVertexBuffer(sfRenderWindow* renderWindow, const sfVerte //////////////////////////////////////////////////////////// -void sfRenderWindow_drawVertexBufferRange(sfRenderWindow* renderWindow, - const sfVertexBuffer* object, size_t firstVertex, - size_t vertexCount, const sfRenderStates* states) +void sfRenderWindow_drawVertexBufferRange(sfRenderWindow* renderWindow, + const sfVertexBuffer* object, + size_t firstVertex, + size_t vertexCount, + const sfRenderStates* states) { CSFML_CHECK(object); CSFML_CALL(renderWindow, draw(object->This, firstVertex, vertexCount, convertRenderStates(states))); @@ -443,12 +460,17 @@ void sfRenderWindow_drawVertexBufferRange(sfRenderWindow* renderWindow, //////////////////////////////////////////////////////////// -void sfRenderWindow_drawPrimitives(sfRenderWindow* renderWindow, - const sfVertex* vertices, size_t vertexCount, - sfPrimitiveType type, const sfRenderStates* states) +void sfRenderWindow_drawPrimitives(sfRenderWindow* renderWindow, + const sfVertex* vertices, + size_t vertexCount, + sfPrimitiveType type, + const sfRenderStates* states) { - CSFML_CALL(renderWindow, draw(reinterpret_cast(vertices), vertexCount, - static_cast(type), convertRenderStates(states))); + CSFML_CALL(renderWindow, + draw(reinterpret_cast(vertices), + vertexCount, + static_cast(type), + convertRenderStates(states))); } @@ -504,7 +526,10 @@ sfVector2i sfTouch_getPositionRenderWindow(unsigned int finger, const sfRenderWi //////////////////////////////////////////////////////////// -bool sfRenderWindow_createVulkanSurface(sfRenderWindow* renderWindow, const VkInstance* instance, VkSurfaceKHR* surface, const VkAllocationCallbacks* allocator) +bool sfRenderWindow_createVulkanSurface(sfRenderWindow* renderWindow, + const VkInstance* instance, + VkSurfaceKHR* surface, + const VkAllocationCallbacks* allocator) { CSFML_CHECK_RETURN(instance, false); CSFML_CHECK_RETURN(surface, false); diff --git a/src/CSFML/Graphics/RenderWindowStruct.hpp b/src/CSFML/Graphics/RenderWindowStruct.hpp index 9d8c38d..7822801 100644 --- a/src/CSFML/Graphics/RenderWindowStruct.hpp +++ b/src/CSFML/Graphics/RenderWindowStruct.hpp @@ -27,9 +27,10 @@ //////////////////////////////////////////////////////////// // Headers //////////////////////////////////////////////////////////// -#include #include +#include + //////////////////////////////////////////////////////////// // Internal structure of sfRenderWindow diff --git a/src/CSFML/Graphics/Shader.cpp b/src/CSFML/Graphics/Shader.cpp index 25bdd7f..095464f 100644 --- a/src/CSFML/Graphics/Shader.cpp +++ b/src/CSFML/Graphics/Shader.cpp @@ -25,18 +25,20 @@ //////////////////////////////////////////////////////////// // Headers //////////////////////////////////////////////////////////// +#include +#include #include #include #include -#include #include -#include //////////////////////////////////////////////////////////// -sfShader* sfShader_createFromFile(const char* vertexShaderFilename, const char* geometryShaderFilename, const char* fragmentShaderFilename) +sfShader* sfShader_createFromFile(const char* vertexShaderFilename, + const char* geometryShaderFilename, + const char* fragmentShaderFilename) { - bool success = false; + bool success = false; sf::Shader shader; if (vertexShaderFilename || geometryShaderFilename || fragmentShaderFilename) { @@ -83,7 +85,7 @@ sfShader* sfShader_createFromFile(const char* vertexShaderFilename, const char* //////////////////////////////////////////////////////////// sfShader* sfShader_createFromMemory(const char* vertexShader, const char* geometryShader, const char* fragmentShader) { - bool success = false; + bool success = false; sf::Shader shader; if (vertexShader || geometryShader || fragmentShader) { @@ -128,9 +130,11 @@ sfShader* sfShader_createFromMemory(const char* vertexShader, const char* geomet //////////////////////////////////////////////////////////// -sfShader* sfShader_createFromStream(sfInputStream* vertexShaderStream, sfInputStream* geometryShaderStream, sfInputStream* fragmentShaderStream) +sfShader* sfShader_createFromStream(sfInputStream* vertexShaderStream, + sfInputStream* geometryShaderStream, + sfInputStream* fragmentShaderStream) { - bool success = false; + bool success = false; sf::Shader shader; if (vertexShaderStream || geometryShaderStream || fragmentShaderStream) { diff --git a/src/CSFML/Graphics/Shape.cpp b/src/CSFML/Graphics/Shape.cpp index 0f4438c..2fb7109 100644 --- a/src/CSFML/Graphics/Shape.cpp +++ b/src/CSFML/Graphics/Shape.cpp @@ -25,20 +25,19 @@ //////////////////////////////////////////////////////////// // Headers //////////////////////////////////////////////////////////// -#include -#include -#include -#include #include #include -#include +#include +#include +#include #include +#include + +#include //////////////////////////////////////////////////////////// -sfShape* sfShape_create(sfShapeGetPointCountCallback getPointCount, - sfShapeGetPointCallback getPoint, - void* userData) +sfShape* sfShape_create(sfShapeGetPointCountCallback getPointCount, sfShapeGetPointCallback getPoint, void* userData) { return new sfShape(getPointCount, getPoint, userData); } diff --git a/src/CSFML/Graphics/ShapeStruct.hpp b/src/CSFML/Graphics/ShapeStruct.hpp index 10b6745..b8b9925 100644 --- a/src/CSFML/Graphics/ShapeStruct.hpp +++ b/src/CSFML/Graphics/ShapeStruct.hpp @@ -28,11 +28,12 @@ // Headers //////////////////////////////////////////////////////////// #include -#include #include #include #include +#include + //////////////////////////////////////////////////////////// // Helper class implementing the callback forwarding from @@ -40,14 +41,11 @@ //////////////////////////////////////////////////////////// class sfShapeImpl : public sf::Shape { -public : - - sfShapeImpl(sfShapeGetPointCountCallback getPointCount, - sfShapeGetPointCallback getPoint, - void* userData) : +public: + sfShapeImpl(sfShapeGetPointCountCallback getPointCount, sfShapeGetPointCallback getPoint, void* userData) : myGetPointCountCallback(getPointCount), - myGetPointCallback (getPoint), - myUserData (userData) + myGetPointCallback(getPoint), + myUserData(userData) { } @@ -64,7 +62,6 @@ public : using sf::Shape::update; private: - sfShapeGetPointCountCallback myGetPointCountCallback; sfShapeGetPointCallback myGetPointCallback; void* myUserData; @@ -76,9 +73,7 @@ private: //////////////////////////////////////////////////////////// struct sfShape { - sfShape(sfShapeGetPointCountCallback getPointCount, - sfShapeGetPointCallback getPoint, - void* userData) : + sfShape(sfShapeGetPointCountCallback getPointCount, sfShapeGetPointCallback getPoint, void* userData) : This(getPointCount, getPoint, userData) { } diff --git a/src/CSFML/Graphics/Sprite.cpp b/src/CSFML/Graphics/Sprite.cpp index 49a9cd1..415c799 100644 --- a/src/CSFML/Graphics/Sprite.cpp +++ b/src/CSFML/Graphics/Sprite.cpp @@ -25,15 +25,16 @@ //////////////////////////////////////////////////////////// // Headers //////////////////////////////////////////////////////////// -#include -#include -#include -#include -#include #include #include -#include +#include +#include +#include #include +#include + +#include +#include //////////////////////////////////////////////////////////// @@ -42,7 +43,7 @@ sfSprite* sfSprite_create(const sfTexture* texture) CSFML_CHECK_RETURN(texture, nullptr); CSFML_CHECK_RETURN(texture->This, nullptr); - return new sfSprite{ sf::Sprite{*texture->This}, texture, {}, {} }; + return new sfSprite{sf::Sprite{*texture->This}, texture, {}, {}}; } diff --git a/src/CSFML/Graphics/SpriteStruct.hpp b/src/CSFML/Graphics/SpriteStruct.hpp index 659231d..2930c1a 100644 --- a/src/CSFML/Graphics/SpriteStruct.hpp +++ b/src/CSFML/Graphics/SpriteStruct.hpp @@ -27,10 +27,11 @@ //////////////////////////////////////////////////////////// // Headers //////////////////////////////////////////////////////////// -#include #include #include +#include + //////////////////////////////////////////////////////////// // Internal structure of sfSprite diff --git a/src/CSFML/Graphics/Text.cpp b/src/CSFML/Graphics/Text.cpp index a919c5a..b4b1ef1 100644 --- a/src/CSFML/Graphics/Text.cpp +++ b/src/CSFML/Graphics/Text.cpp @@ -25,15 +25,16 @@ //////////////////////////////////////////////////////////// // Headers //////////////////////////////////////////////////////////// -#include -#include -#include -#include -#include #include #include -#include +#include +#include +#include +#include #include +#include + +#include //////////////////////////////////////////////////////////// @@ -41,7 +42,7 @@ sfText* sfText_create(const sfFont* font) { CSFML_CHECK_RETURN(font, nullptr); - return new sfText{ sf::Text{font->This}, font, {}, {}, {} }; + return new sfText{sf::Text{font->This}, font, {}, {}, {}}; } @@ -288,7 +289,6 @@ float sfText_getLineSpacing(const sfText* text) } - //////////////////////////////////////////////////////////// uint32_t sfText_getStyle(const sfText* text) { diff --git a/src/CSFML/Graphics/TextStruct.hpp b/src/CSFML/Graphics/TextStruct.hpp index 5f536aa..28fcd0c 100644 --- a/src/CSFML/Graphics/TextStruct.hpp +++ b/src/CSFML/Graphics/TextStruct.hpp @@ -27,10 +27,12 @@ //////////////////////////////////////////////////////////// // Headers //////////////////////////////////////////////////////////// -#include #include #include #include + +#include + #include diff --git a/src/CSFML/Graphics/Texture.cpp b/src/CSFML/Graphics/Texture.cpp index 1ce8277..dbb2fa9 100644 --- a/src/CSFML/Graphics/Texture.cpp +++ b/src/CSFML/Graphics/Texture.cpp @@ -25,15 +25,15 @@ //////////////////////////////////////////////////////////// // Headers //////////////////////////////////////////////////////////// -#include -#include +#include +#include #include #include -#include -#include -#include +#include +#include #include -#include +#include +#include //////////////////////////////////////////////////////////// diff --git a/src/CSFML/Graphics/TextureStruct.hpp b/src/CSFML/Graphics/TextureStruct.hpp index b07819d..2b92b4f 100644 --- a/src/CSFML/Graphics/TextureStruct.hpp +++ b/src/CSFML/Graphics/TextureStruct.hpp @@ -37,19 +37,19 @@ struct sfTexture { sfTexture() { - This = new sf::Texture; + This = new sf::Texture; OwnInstance = true; } sfTexture(sf::Texture* texture) { - This = texture; + This = texture; OwnInstance = false; } sfTexture(const sfTexture& texture) { - This = texture.This ? new sf::Texture(*texture.This) : nullptr; + This = texture.This ? new sf::Texture(*texture.This) : nullptr; OwnInstance = true; } @@ -60,5 +60,5 @@ struct sfTexture } sf::Texture* This; - bool OwnInstance; + bool OwnInstance; }; diff --git a/src/CSFML/Graphics/Transform.cpp b/src/CSFML/Graphics/Transform.cpp index 3829479..ab9e4b0 100644 --- a/src/CSFML/Graphics/Transform.cpp +++ b/src/CSFML/Graphics/Transform.cpp @@ -25,18 +25,19 @@ //////////////////////////////////////////////////////////// // Headers //////////////////////////////////////////////////////////// -#include -#include -#include #include -#include +#include +#include #include +#include + +#include + #include //////////////////////////////////////////////////////////// -const sfTransform sfTransform_Identity = -{ +const sfTransform sfTransform_Identity = { // clang-format off 1, 0, 0, 0, 1, 0, @@ -46,9 +47,7 @@ const sfTransform sfTransform_Identity = //////////////////////////////////////////////////////////// -sfTransform sfTransform_fromMatrix(float a00, float a01, float a02, - float a10, float a11, float a12, - float a20, float a21, float a22) +sfTransform sfTransform_fromMatrix(float a00, float a01, float a02, float a10, float a11, float a12, float a20, float a21, float a22) { sfTransform transform = {a00, a01, a02, a10, a11, a12, a20, a21, a22}; return transform; @@ -154,8 +153,10 @@ bool sfTransform_equal(sfTransform* left, sfTransform* right) CSFML_CHECK_RETURN(left, false); CSFML_CHECK_RETURN(right, false); - for (int i = 0; i < 9; ++i) { - if (left->matrix[i] != right->matrix[i]) return false; + for (int i = 0; i < 9; ++i) + { + if (left->matrix[i] != right->matrix[i]) + return false; } return true; } diff --git a/src/CSFML/Graphics/Transformable.cpp b/src/CSFML/Graphics/Transformable.cpp index 583588d..fbe18cb 100644 --- a/src/CSFML/Graphics/Transformable.cpp +++ b/src/CSFML/Graphics/Transformable.cpp @@ -25,11 +25,11 @@ //////////////////////////////////////////////////////////// // Headers //////////////////////////////////////////////////////////// +#include #include #include -#include -#include #include +#include //////////////////////////////////////////////////////////// diff --git a/src/CSFML/Graphics/TransformableStruct.hpp b/src/CSFML/Graphics/TransformableStruct.hpp index 86417e9..aff1d3f 100644 --- a/src/CSFML/Graphics/TransformableStruct.hpp +++ b/src/CSFML/Graphics/TransformableStruct.hpp @@ -27,9 +27,10 @@ //////////////////////////////////////////////////////////// // Headers //////////////////////////////////////////////////////////// -#include #include +#include + //////////////////////////////////////////////////////////// // Internal structure of sfTransformable diff --git a/src/CSFML/Graphics/VertexArray.cpp b/src/CSFML/Graphics/VertexArray.cpp index 9349684..c842ea9 100644 --- a/src/CSFML/Graphics/VertexArray.cpp +++ b/src/CSFML/Graphics/VertexArray.cpp @@ -25,9 +25,9 @@ //////////////////////////////////////////////////////////// // Headers //////////////////////////////////////////////////////////// +#include #include #include -#include #include diff --git a/src/CSFML/Graphics/VertexBuffer.cpp b/src/CSFML/Graphics/VertexBuffer.cpp index f8efa74..a271236 100644 --- a/src/CSFML/Graphics/VertexBuffer.cpp +++ b/src/CSFML/Graphics/VertexBuffer.cpp @@ -54,7 +54,7 @@ sfVertexBuffer* sfVertexBuffer_create(unsigned int vertexCount, sfPrimitiveType sfVertexBuffer* sfVertexBuffer_copy(const sfVertexBuffer* vertexBuffer) { sfVertexBuffer* buffer = new sfVertexBuffer; - buffer->This = sf::VertexBuffer( vertexBuffer->This ); + buffer->This = sf::VertexBuffer(vertexBuffer->This); return buffer; } diff --git a/src/CSFML/Graphics/View.cpp b/src/CSFML/Graphics/View.cpp index b1609de..81dcddb 100644 --- a/src/CSFML/Graphics/View.cpp +++ b/src/CSFML/Graphics/View.cpp @@ -25,11 +25,11 @@ //////////////////////////////////////////////////////////// // Headers //////////////////////////////////////////////////////////// +#include #include #include -#include -#include #include +#include //////////////////////////////////////////////////////////// diff --git a/src/CSFML/Internal.hpp b/src/CSFML/Internal.hpp index 921682a..ad8560b 100644 --- a/src/CSFML/Internal.hpp +++ b/src/CSFML/Internal.hpp @@ -27,107 +27,101 @@ //////////////////////////////////////////////////////////// // Define macros to check the validity of CSFML objects in debug run //////////////////////////////////////////////////////////// -#include #include + +#include + #include #ifndef NDEBUG - #define CSFML_CHECK(object_) \ - do \ - { \ - if ((object_) == nullptr) \ - { \ - sf::err() << "SFML warning: trying to use a null " #object_ " object\n"; \ - return; \ - } \ - } \ - while (0) - - #define CSFML_CALL(object_, function_) \ - do \ - { \ - if (object_) \ - { \ - ((object_)->This.function_); \ - } \ - else \ - { \ - sf::err() << "SFML warning: trying to use a null " #object_ " object\n"; \ - } \ - } \ - while (0) - - #define CSFML_CALL_PTR(object_, function_) \ - do \ - { \ - if (object_) \ - { \ - ((object_)->This->function_); \ - } \ - else \ - { \ - sf::err() << "SFML warning: trying to use a null " #object_ " object\n"; \ - } \ - } \ - while (0) - - #define CSFML_CHECK_RETURN(object_, default_) \ - do \ - { \ - if ((object_) == nullptr) \ - { \ - sf::err() << "SFML warning: trying to use a null " #object_ " object\n"; \ - return default_; \ - } \ - } \ - while (0) - - #define CSFML_CALL_RETURN(object_, function_, default_) \ - if (object_) \ - { \ - return ((object_)->This.function_); \ - } \ - else \ - { \ +#define CSFML_CHECK(object_) \ + do \ + { \ + if ((object_) == nullptr) \ + { \ sf::err() << "SFML warning: trying to use a null " #object_ " object\n"; \ - return default_; \ - } + return; \ + } \ + } while (0) - #define CSFML_CALL_PTR_RETURN(object_, function_, default_) \ - if (object_) \ - { \ - return ((object_)->This->function_); \ - } \ - else \ - { \ +#define CSFML_CALL(object_, function_) \ + do \ + { \ + if (object_) \ + { \ + ((object_)->This.function_); \ + } \ + else \ + { \ sf::err() << "SFML warning: trying to use a null " #object_ " object\n"; \ - return default_; \ - } + } \ + } while (0) + +#define CSFML_CALL_PTR(object_, function_) \ + do \ + { \ + if (object_) \ + { \ + ((object_)->This->function_); \ + } \ + else \ + { \ + sf::err() << "SFML warning: trying to use a null " #object_ " object\n"; \ + } \ + } while (0) + +#define CSFML_CHECK_RETURN(object_, default_) \ + do \ + { \ + if ((object_) == nullptr) \ + { \ + sf::err() << "SFML warning: trying to use a null " #object_ " object\n"; \ + return default_; \ + } \ + } while (0) + +#define CSFML_CALL_RETURN(object_, function_, default_) \ + if (object_) \ + { \ + return ((object_)->This.function_); \ + } \ + else \ + { \ + sf::err() << "SFML warning: trying to use a null " #object_ " object\n"; \ + return default_; \ + } + +#define CSFML_CALL_PTR_RETURN(object_, function_, default_) \ + if (object_) \ + { \ + return ((object_)->This->function_); \ + } \ + else \ + { \ + sf::err() << "SFML warning: trying to use a null " #object_ " object\n"; \ + return default_; \ + } #else - #define CSFML_CHECK(object_) +#define CSFML_CHECK(object_) - #define CSFML_CALL(object_, function_) \ - ((object_)->This.function_) +#define CSFML_CALL(object_, function_) ((object_)->This.function_) - #define CSFML_CALL_PTR(object_, function_) \ - ((object_)->This->function_) +#define CSFML_CALL_PTR(object_, function_) ((object_)->This->function_) - #define CSFML_CHECK_RETURN(object_, default_) +#define CSFML_CHECK_RETURN(object_, default_) - #define CSFML_CALL_RETURN(object_, function_, default_) \ - return ((object_)->This.function_); +#define CSFML_CALL_RETURN(object_, function_, default_) return ((object_)->This.function_); - #define CSFML_CALL_PTR_RETURN(object_, function_, default_) \ - return ((object_)->This->function_); +#define CSFML_CALL_PTR_RETURN(object_, function_, default_) return ((object_)->This->function_); #endif //////////////////////////////////////////////////////////// // Ensure char32_t has the same size as sfChar32 (uint32_t) -// Identical alignment and size is required because we're type punning +// Identical alignment and size is required because we're type punning // when doing sfChar32* <-> char32_t* casts //////////////////////////////////////////////////////////// static_assert(sizeof(sfChar32) == sizeof(char32_t)); diff --git a/src/CSFML/Main/SFML_Main.cpp b/src/CSFML/Main/SFML_Main.cpp index ab02dfb..1ab4f0f 100644 --- a/src/CSFML/Main/SFML_Main.cpp +++ b/src/CSFML/Main/SFML_Main.cpp @@ -32,13 +32,13 @@ #if defined(_WIN32) - #include +#include - extern int main(int argc, char* argv[]); +extern int main(int argc, char* argv[]); - int WINAPI WinMain(HINSTANCE, HINSTANCE, LPSTR, INT) - { - return main(__argc, __argv); - } +int WINAPI WinMain(HINSTANCE, HINSTANCE, LPSTR, INT) +{ + return main(__argc, __argv); +} #endif // _WIN32 diff --git a/src/CSFML/Network/Ftp.cpp b/src/CSFML/Network/Ftp.cpp index ff416f3..eff0529 100644 --- a/src/CSFML/Network/Ftp.cpp +++ b/src/CSFML/Network/Ftp.cpp @@ -25,13 +25,15 @@ //////////////////////////////////////////////////////////// // Headers //////////////////////////////////////////////////////////// +#include +#include #include #include + #include #include -#include + #include -#include //////////////////////////////////////////////////////////// diff --git a/src/CSFML/Network/FtpStruct.hpp b/src/CSFML/Network/FtpStruct.hpp index 4902315..cf8c6ce 100644 --- a/src/CSFML/Network/FtpStruct.hpp +++ b/src/CSFML/Network/FtpStruct.hpp @@ -28,6 +28,7 @@ // Headers //////////////////////////////////////////////////////////// #include + #include @@ -45,8 +46,7 @@ struct sfFtp //////////////////////////////////////////////////////////// struct sfFtpResponse { - sfFtpResponse(const sf::Ftp::Response& Response) - : This(Response) + sfFtpResponse(const sf::Ftp::Response& Response) : This(Response) { } @@ -59,8 +59,7 @@ struct sfFtpResponse //////////////////////////////////////////////////////////// struct sfFtpDirectoryResponse { - sfFtpDirectoryResponse(const sf::Ftp::DirectoryResponse& Response) - : This(Response) + sfFtpDirectoryResponse(const sf::Ftp::DirectoryResponse& Response) : This(Response) { } @@ -73,8 +72,7 @@ struct sfFtpDirectoryResponse //////////////////////////////////////////////////////////// struct sfFtpListingResponse { - sfFtpListingResponse(const sf::Ftp::ListingResponse& Response) - : This(Response) + sfFtpListingResponse(const sf::Ftp::ListingResponse& Response) : This(Response) { } diff --git a/src/CSFML/Network/Http.cpp b/src/CSFML/Network/Http.cpp index c7b5e05..9cea7ee 100644 --- a/src/CSFML/Network/Http.cpp +++ b/src/CSFML/Network/Http.cpp @@ -25,9 +25,9 @@ //////////////////////////////////////////////////////////// // Headers //////////////////////////////////////////////////////////// +#include #include #include -#include //////////////////////////////////////////////////////////// @@ -155,11 +155,11 @@ void sfHttp_setHost(sfHttp* http, const char* host, unsigned short port) //////////////////////////////////////////////////////////// sfHttpResponse* sfHttp_sendRequest(sfHttp* http, const sfHttpRequest* request, sfTime timeout) { - CSFML_CHECK_RETURN(http, nullptr); + CSFML_CHECK_RETURN(http, nullptr); CSFML_CHECK_RETURN(request, nullptr); sfHttpResponse* response = new sfHttpResponse; - response->This = http->This.sendRequest(request->This, sf::microseconds(timeout.microseconds)); + response->This = http->This.sendRequest(request->This, sf::microseconds(timeout.microseconds)); return response; } diff --git a/src/CSFML/Network/IpAddress.cpp b/src/CSFML/Network/IpAddress.cpp index 67ba723..90f3eed 100644 --- a/src/CSFML/Network/IpAddress.cpp +++ b/src/CSFML/Network/IpAddress.cpp @@ -26,32 +26,34 @@ // Headers //////////////////////////////////////////////////////////// #include + #include + #include namespace { - // Helper function for converting a SFML address to a CSFML one - sfIpAddress fromSFMLAddress(std::optional address) +// Helper function for converting a SFML address to a CSFML one +sfIpAddress fromSFMLAddress(std::optional address) +{ + sfIpAddress result = {0}; + + if (address) { - sfIpAddress result = {0}; - - if (address) - { - strncpy(result.address, address->toString().c_str(), 15); - } - - return result; + strncpy(result.address, address->toString().c_str(), 15); } - // Helper function for converting a CSFML address to a SFML one - std::optional toSFMLAddress(sfIpAddress address) - { - return sf::IpAddress::resolve(address.address); - } + return result; } +// Helper function for converting a CSFML address to a SFML one +std::optional toSFMLAddress(sfIpAddress address) +{ + return sf::IpAddress::resolve(address.address); +} +} // namespace + //////////////////////////////////////////////////////////// const sfIpAddress sfIpAddress_None = sfIpAddress_fromBytes(0, 0, 0, 0); diff --git a/src/CSFML/Network/Packet.cpp b/src/CSFML/Network/Packet.cpp index 9d1f831..7c291fe 100644 --- a/src/CSFML/Network/Packet.cpp +++ b/src/CSFML/Network/Packet.cpp @@ -25,9 +25,9 @@ //////////////////////////////////////////////////////////// // Headers //////////////////////////////////////////////////////////// +#include #include #include -#include //////////////////////////////////////////////////////////// diff --git a/src/CSFML/Network/SocketSelector.cpp b/src/CSFML/Network/SocketSelector.cpp index ee1e487..1dd23bb 100644 --- a/src/CSFML/Network/SocketSelector.cpp +++ b/src/CSFML/Network/SocketSelector.cpp @@ -25,12 +25,12 @@ //////////////////////////////////////////////////////////// // Headers //////////////////////////////////////////////////////////// +#include #include #include #include #include #include -#include //////////////////////////////////////////////////////////// diff --git a/src/CSFML/Network/TcpListener.cpp b/src/CSFML/Network/TcpListener.cpp index 72fe7ff..bf3b7e1 100644 --- a/src/CSFML/Network/TcpListener.cpp +++ b/src/CSFML/Network/TcpListener.cpp @@ -25,10 +25,10 @@ //////////////////////////////////////////////////////////// // Headers //////////////////////////////////////////////////////////// +#include #include #include #include -#include //////////////////////////////////////////////////////////// @@ -88,7 +88,7 @@ sfSocketStatus sfTcpListener_accept(sfTcpListener* listener, sfTcpSocket** conne CSFML_CHECK_RETURN(listener, sfSocketError); CSFML_CHECK_RETURN(connected, sfSocketError); - *connected = new sfTcpSocket; + *connected = new sfTcpSocket; sfSocketStatus status = static_cast(listener->This.accept((*connected)->This)); if (status != sfSocketDone) diff --git a/src/CSFML/Network/TcpSocket.cpp b/src/CSFML/Network/TcpSocket.cpp index 7448612..b28f834 100644 --- a/src/CSFML/Network/TcpSocket.cpp +++ b/src/CSFML/Network/TcpSocket.cpp @@ -25,11 +25,13 @@ //////////////////////////////////////////////////////////// // Headers //////////////////////////////////////////////////////////// +#include +#include #include #include -#include + #include -#include + #include diff --git a/src/CSFML/Network/UdpSocket.cpp b/src/CSFML/Network/UdpSocket.cpp index a37974f..b5cdf8f 100644 --- a/src/CSFML/Network/UdpSocket.cpp +++ b/src/CSFML/Network/UdpSocket.cpp @@ -25,11 +25,13 @@ //////////////////////////////////////////////////////////// // Headers //////////////////////////////////////////////////////////// +#include +#include #include #include -#include + #include -#include + #include @@ -108,13 +110,18 @@ sfSocketStatus sfUdpSocket_send(sfUdpSocket* socket, const void* data, size_t si //////////////////////////////////////////////////////////// -sfSocketStatus sfUdpSocket_receive(sfUdpSocket* socket, void* data, size_t size, size_t* received, sfIpAddress* remoteAddress, unsigned short* remotePort) +sfSocketStatus sfUdpSocket_receive(sfUdpSocket* socket, + void* data, + size_t size, + size_t* received, + sfIpAddress* remoteAddress, + unsigned short* remotePort) { CSFML_CHECK_RETURN(socket, sfSocketError); std::optional address; - unsigned short port; - std::size_t sizeReceived; + unsigned short port; + std::size_t sizeReceived; sf::Socket::Status status = socket->This.receive(data, size, sizeReceived, address, port); if (status != sf::Socket::Status::Done) @@ -165,7 +172,7 @@ sfSocketStatus sfUdpSocket_receivePacket(sfUdpSocket* socket, sfPacket* packet, CSFML_CHECK_RETURN(packet, sfSocketError); std::optional address; - unsigned short port; + unsigned short port; sf::Socket::Status status = socket->This.receive(packet->This, address, port); if (status != sf::Socket::Status::Done) diff --git a/src/CSFML/System/Buffer.cpp b/src/CSFML/System/Buffer.cpp index b594724..4d9737e 100644 --- a/src/CSFML/System/Buffer.cpp +++ b/src/CSFML/System/Buffer.cpp @@ -25,9 +25,9 @@ //////////////////////////////////////////////////////////// // Headers //////////////////////////////////////////////////////////// +#include #include #include -#include //////////////////////////////////////////////////////////// diff --git a/src/CSFML/System/BufferStruct.hpp b/src/CSFML/System/BufferStruct.hpp index ea727b5..7f728a6 100644 --- a/src/CSFML/System/BufferStruct.hpp +++ b/src/CSFML/System/BufferStruct.hpp @@ -28,8 +28,9 @@ // Headers //////////////////////////////////////////////////////////// #include -#include + #include +#include //////////////////////////////////////////////////////////// diff --git a/src/CSFML/System/Clock.cpp b/src/CSFML/System/Clock.cpp index 5476065..8ff158b 100644 --- a/src/CSFML/System/Clock.cpp +++ b/src/CSFML/System/Clock.cpp @@ -25,10 +25,11 @@ //////////////////////////////////////////////////////////// // Headers //////////////////////////////////////////////////////////// +#include #include #include + #include -#include //////////////////////////////////////////////////////////// diff --git a/src/CSFML/System/ConvertVector2.hpp b/src/CSFML/System/ConvertVector2.hpp index 890fa1a..22b2779 100644 --- a/src/CSFML/System/ConvertVector2.hpp +++ b/src/CSFML/System/ConvertVector2.hpp @@ -27,9 +27,10 @@ //////////////////////////////////////////////////////////// // Headers //////////////////////////////////////////////////////////// -#include #include +#include + //////////////////////////////////////////////////////////// // Convert sf::Vector2 to sfVector2 diff --git a/src/CSFML/System/ConvertVector3.hpp b/src/CSFML/System/ConvertVector3.hpp index 2f39779..e9b9034 100644 --- a/src/CSFML/System/ConvertVector3.hpp +++ b/src/CSFML/System/ConvertVector3.hpp @@ -27,9 +27,10 @@ //////////////////////////////////////////////////////////// // Headers //////////////////////////////////////////////////////////// -#include #include +#include + //////////////////////////////////////////////////////////// // Convert sf::Vector3f to sfVector3f diff --git a/src/CSFML/System/Sleep.cpp b/src/CSFML/System/Sleep.cpp index 27879cc..9b1f32b 100644 --- a/src/CSFML/System/Sleep.cpp +++ b/src/CSFML/System/Sleep.cpp @@ -25,10 +25,11 @@ //////////////////////////////////////////////////////////// // Headers //////////////////////////////////////////////////////////// +#include #include + #include #include -#include //////////////////////////////////////////////////////////// diff --git a/src/CSFML/Window/Clipboard.cpp b/src/CSFML/Window/Clipboard.cpp index cf3a81d..c342062 100644 --- a/src/CSFML/Window/Clipboard.cpp +++ b/src/CSFML/Window/Clipboard.cpp @@ -25,18 +25,20 @@ //////////////////////////////////////////////////////////// // Headers //////////////////////////////////////////////////////////// -#include -#include -#include #include +#include + +#include +#include + #include namespace { - sf::String ClipboardString; - std::string ClipboardStringAnsi; -} +sf::String ClipboardString; +std::string ClipboardStringAnsi; +} // namespace //////////////////////////////////////////////////////////// diff --git a/src/CSFML/Window/Context.cpp b/src/CSFML/Window/Context.cpp index f3b3ec9..abda8f6 100644 --- a/src/CSFML/Window/Context.cpp +++ b/src/CSFML/Window/Context.cpp @@ -25,9 +25,9 @@ //////////////////////////////////////////////////////////// // Headers //////////////////////////////////////////////////////////// +#include #include #include -#include #include @@ -53,10 +53,7 @@ bool sfContext_isExtensionAvailable(const char* name) //////////////////////////////////////////////////////////// -bool sfContext_setActive(sfContext* context, bool active) -{ - CSFML_CALL_RETURN(context, setActive(active), false) -} +bool sfContext_setActive(sfContext* context, bool active){CSFML_CALL_RETURN(context, setActive(active), false)} //////////////////////////////////////////////////////////// diff --git a/src/CSFML/Window/ConvertContextSettings.hpp b/src/CSFML/Window/ConvertContextSettings.hpp index cbd36d3..876ffc7 100644 --- a/src/CSFML/Window/ConvertContextSettings.hpp +++ b/src/CSFML/Window/ConvertContextSettings.hpp @@ -28,6 +28,7 @@ // Headers //////////////////////////////////////////////////////////// #include + #include diff --git a/src/CSFML/Window/ConvertVideoMode.hpp b/src/CSFML/Window/ConvertVideoMode.hpp index 74b56c5..33c3a5f 100644 --- a/src/CSFML/Window/ConvertVideoMode.hpp +++ b/src/CSFML/Window/ConvertVideoMode.hpp @@ -27,9 +27,10 @@ //////////////////////////////////////////////////////////// // Headers //////////////////////////////////////////////////////////// -#include #include +#include + //////////////////////////////////////////////////////////// // Convert sf::VideoMode to sfVideoMode diff --git a/src/CSFML/Window/Cursor.cpp b/src/CSFML/Window/Cursor.cpp index fcb18b5..70139c7 100644 --- a/src/CSFML/Window/Cursor.cpp +++ b/src/CSFML/Window/Cursor.cpp @@ -25,10 +25,10 @@ //////////////////////////////////////////////////////////// // Headers //////////////////////////////////////////////////////////// +#include +#include #include #include -#include -#include //////////////////////////////////////////////////////////// diff --git a/src/CSFML/Window/Joystick.cpp b/src/CSFML/Window/Joystick.cpp index 27bd9bc..84ebfc4 100644 --- a/src/CSFML/Window/Joystick.cpp +++ b/src/CSFML/Window/Joystick.cpp @@ -25,9 +25,10 @@ //////////////////////////////////////////////////////////// // Headers //////////////////////////////////////////////////////////// -#include -#include #include +#include + +#include //////////////////////////////////////////////////////////// @@ -70,13 +71,13 @@ sfJoystickIdentification sfJoystick_getIdentification(unsigned int joystick) static std::string name; sf::Joystick::Identification identification = sf::Joystick::getIdentification(joystick); - name = identification.name; + name = identification.name; sfJoystickIdentification result; - result.name = name.c_str(); + result.name = name.c_str(); result.productId = identification.productId; - result.vendorId = identification.vendorId; + result.vendorId = identification.vendorId; return result; } diff --git a/src/CSFML/Window/Keyboard.cpp b/src/CSFML/Window/Keyboard.cpp index e2fee45..518305a 100644 --- a/src/CSFML/Window/Keyboard.cpp +++ b/src/CSFML/Window/Keyboard.cpp @@ -25,10 +25,11 @@ //////////////////////////////////////////////////////////// // Headers //////////////////////////////////////////////////////////// -#include -#include #include +#include + #include +#include #include diff --git a/src/CSFML/Window/Mouse.cpp b/src/CSFML/Window/Mouse.cpp index 0da2e70..1fa8dcc 100644 --- a/src/CSFML/Window/Mouse.cpp +++ b/src/CSFML/Window/Mouse.cpp @@ -25,12 +25,13 @@ //////////////////////////////////////////////////////////// // Headers //////////////////////////////////////////////////////////// +#include +#include #include #include #include + #include -#include -#include //////////////////////////////////////////////////////////// diff --git a/src/CSFML/Window/Sensor.cpp b/src/CSFML/Window/Sensor.cpp index 502a07f..e954a1b 100644 --- a/src/CSFML/Window/Sensor.cpp +++ b/src/CSFML/Window/Sensor.cpp @@ -25,10 +25,11 @@ //////////////////////////////////////////////////////////// // Headers //////////////////////////////////////////////////////////// -#include -#include -#include #include +#include +#include + +#include //////////////////////////////////////////////////////////// diff --git a/src/CSFML/Window/Touch.cpp b/src/CSFML/Window/Touch.cpp index cbe8a98..ca1df48 100644 --- a/src/CSFML/Window/Touch.cpp +++ b/src/CSFML/Window/Touch.cpp @@ -25,12 +25,13 @@ //////////////////////////////////////////////////////////// // Headers //////////////////////////////////////////////////////////// +#include +#include #include -#include #include #include -#include -#include + +#include //////////////////////////////////////////////////////////// diff --git a/src/CSFML/Window/VideoMode.cpp b/src/CSFML/Window/VideoMode.cpp index 9e9d0e2..03b1222 100644 --- a/src/CSFML/Window/VideoMode.cpp +++ b/src/CSFML/Window/VideoMode.cpp @@ -25,10 +25,11 @@ //////////////////////////////////////////////////////////// // Headers //////////////////////////////////////////////////////////// -#include -#include -#include #include +#include +#include + +#include //////////////////////////////////////////////////////////// diff --git a/src/CSFML/Window/Vulkan.cpp b/src/CSFML/Window/Vulkan.cpp index 152cde3..feb0467 100644 --- a/src/CSFML/Window/Vulkan.cpp +++ b/src/CSFML/Window/Vulkan.cpp @@ -26,7 +26,9 @@ // Headers //////////////////////////////////////////////////////////// #include + #include + #include #include diff --git a/src/CSFML/Window/Window.cpp b/src/CSFML/Window/Window.cpp index 302c9d6..2978ba0 100644 --- a/src/CSFML/Window/Window.cpp +++ b/src/CSFML/Window/Window.cpp @@ -25,14 +25,14 @@ //////////////////////////////////////////////////////////// // Headers //////////////////////////////////////////////////////////// +#include +#include +#include +#include +#include +#include #include #include -#include -#include -#include -#include -#include -#include //////////////////////////////////////////////////////////// @@ -49,14 +49,22 @@ sfWindow* sfWindow_create(sfVideoMode mode, const char* title, uint32_t style, s } //////////////////////////////////////////////////////////// -sfWindow* sfWindow_createUnicode(sfVideoMode mode, const sfChar32* title, uint32_t style, sfWindowState state, const sfContextSettings* settings) +sfWindow* sfWindow_createUnicode(sfVideoMode mode, + const sfChar32* title, + uint32_t style, + sfWindowState state, + const sfContextSettings* settings) { // Convert context settings const sf::ContextSettings params = settings ? convertContextSettings(*settings) : sf::ContextSettings(); // Create the window sfWindow* window = new sfWindow; - window->This.create(convertVideoMode(mode), reinterpret_cast(title), style, static_cast(state), params); + window->This.create(convertVideoMode(mode), + reinterpret_cast(title), + style, + static_cast(state), + params); return window; } @@ -293,7 +301,10 @@ sfWindowHandle sfWindow_getNativeHandle(const sfWindow* window) //////////////////////////////////////////////////////////// -bool sfWindow_createVulkanSurface(sfWindow* window, const VkInstance* instance, VkSurfaceKHR* surface, const VkAllocationCallbacks* allocator) +bool sfWindow_createVulkanSurface(sfWindow* window, + const VkInstance* instance, + VkSurfaceKHR* surface, + const VkAllocationCallbacks* allocator) { CSFML_CHECK_RETURN(instance, false); CSFML_CHECK_RETURN(surface, false); diff --git a/src/CSFML/Window/WindowBase.cpp b/src/CSFML/Window/WindowBase.cpp index 7fa599b..19a3da9 100644 --- a/src/CSFML/Window/WindowBase.cpp +++ b/src/CSFML/Window/WindowBase.cpp @@ -25,14 +25,15 @@ //////////////////////////////////////////////////////////// // Headers //////////////////////////////////////////////////////////// +#include +#include +#include +#include +#include #include #include -#include -#include -#include + #include -#include -#include //////////////////////////////////////////////////////////// @@ -249,7 +250,10 @@ sfWindowHandle sfWindowBase_getNativeHandle(const sfWindowBase* windowBase) } //////////////////////////////////////////////////////////// -bool sfWindowBase_createVulkanSurface(sfWindowBase* windowBase, const VkInstance* instance, VkSurfaceKHR* surface, const VkAllocationCallbacks* allocator) +bool sfWindowBase_createVulkanSurface(sfWindowBase* windowBase, + const VkInstance* instance, + VkSurfaceKHR* surface, + const VkAllocationCallbacks* allocator) { CSFML_CHECK_RETURN(instance, false); CSFML_CHECK_RETURN(surface, false); diff --git a/test/System/Clock.test.cpp b/test/System/Clock.test.cpp index 6b19cbe..6f2aaa5 100644 --- a/test/System/Clock.test.cpp +++ b/test/System/Clock.test.cpp @@ -7,7 +7,7 @@ TEST_CASE("[System] sfClock") { sfClock* clock = sfClock_create(); - + CHECK(sfTime_asMicroseconds(sfClock_getElapsedTime(clock)) >= 0); std::this_thread::sleep_for(std::chrono::milliseconds(1)); CHECK(sfTime_asMicroseconds(sfClock_getElapsedTime(clock)) >= 1'000); diff --git a/test/System/Sleep.test.cpp b/test/System/Sleep.test.cpp index dceb1cb..10bc210 100644 --- a/test/System/Sleep.test.cpp +++ b/test/System/Sleep.test.cpp @@ -3,7 +3,7 @@ #include TEST_CASE("[System] sfSleep") -{ +{ const auto startTime = std::chrono::steady_clock::now(); sfSleep(sfMilliseconds(10)); const auto elapsed = std::chrono::steady_clock::now() - startTime;