diff --git a/CSFML/src/Audio/Music.cpp b/CSFML/src/Audio/Music.cpp index b313b692..7e388412 100644 --- a/CSFML/src/Audio/Music.cpp +++ b/CSFML/src/Audio/Music.cpp @@ -3,11 +3,10 @@ #include #include -typedef struct -{ - int64_t offset; ///< The beginning offset of the time range - int64_t length; ///< The length of the time range -} sfTimeSpan; +struct sfTimeSpan { + int64_t offset; + int64_t length; +}; extern "C" sf::Music *sfMusic_new() { return new sf::Music; diff --git a/CSFML/src/Graphics/Color.hpp b/CSFML/src/Graphics/Color.hpp index dfb804cc..5f1ef902 100644 --- a/CSFML/src/Graphics/Color.hpp +++ b/CSFML/src/Graphics/Color.hpp @@ -3,12 +3,11 @@ #include -typedef struct -{ +struct sfColor { uint8_t r; uint8_t g; uint8_t b; uint8_t a; -} sfColor; +}; #endif // SFML_COLOR_H diff --git a/CSFML/src/Graphics/Font.cpp b/CSFML/src/Graphics/Font.cpp index 043a4807..acd91059 100644 --- a/CSFML/src/Graphics/Font.cpp +++ b/CSFML/src/Graphics/Font.cpp @@ -3,12 +3,11 @@ #include #include -typedef struct -{ +struct sfGlyph { float advance; ///< Offset to move horizontically to the next character sfFloatRect bounds; ///< Bounding rectangle of the glyph, in coordinates relative to the baseline sfIntRect textureRect; ///< Texture coordinates of the glyph inside the font's image -} sfGlyph; +}; extern "C" sf::Font *sfFont_new() { return new sf::Font; @@ -74,10 +73,9 @@ extern "C" void sfFont_setSmooth(sf::Font *font, bool smooth) { font->setSmooth(smooth); } -typedef struct -{ +struct sfFontInfo { const char *family; -} sfFontInfo; +}; extern "C" sfFontInfo sfFont_getInfo(const sf::Font *font) { return {font->getInfo().family.c_str()}; diff --git a/CSFML/src/Graphics/Rect.hpp b/CSFML/src/Graphics/Rect.hpp index a6be6f8c..041868f0 100644 --- a/CSFML/src/Graphics/Rect.hpp +++ b/CSFML/src/Graphics/Rect.hpp @@ -1,20 +1,18 @@ #ifndef SFML_RECT_H #define SFML_RECT_H -typedef struct -{ +struct sfFloatRect { float left; float top; float width; float height; -} sfFloatRect; +}; -typedef struct -{ +struct sfIntRect { int left; int top; int width; int height; -} sfIntRect; +}; #endif // SFML_RECT_H diff --git a/CSFML/src/Graphics/Shader.cpp b/CSFML/src/Graphics/Shader.cpp index d0bc00d1..5b2f2b83 100644 --- a/CSFML/src/Graphics/Shader.cpp +++ b/CSFML/src/Graphics/Shader.cpp @@ -8,64 +8,56 @@ typedef sfVector2f sfGlslVec2; typedef sfVector2i sfGlslIvec2; -typedef struct -{ +struct sfGlslBvec2 { bool x; bool y; -} sfGlslBvec2; +}; // 3D vectors typedef sfVector3f sfGlslVec3; -typedef struct -{ +struct sfGlslIvec3 { int x; int y; int z; -} sfGlslIvec3; +}; -typedef struct -{ +struct sfGlslBvec3 { bool x; bool y; bool z; -} sfGlslBvec3; +}; // 4D vectors -typedef struct -{ +struct sfGlslVec4 { float x; float y; float z; float w; -} sfGlslVec4; +}; -typedef struct -{ +struct sfGlslIvec4 { int x; int y; int z; int w; -} sfGlslIvec4; +}; -typedef struct -{ +struct sfGlslBvec4 { bool x; bool y; bool z; bool w; -} sfGlslBvec4; +}; // matrices -typedef struct -{ +struct sfGlslMat3 { float array[3 * 3]; -} sfGlslMat3; +}; -typedef struct -{ +struct sfGlslMat4 { float array[4 * 4]; -} sfGlslMat4; +}; extern "C" sf::Shader *sfShader_new() { return new sf::Shader; diff --git a/CSFML/src/System/Vector2.hpp b/CSFML/src/System/Vector2.hpp index ba3ff63c..c634c8fe 100644 --- a/CSFML/src/System/Vector2.hpp +++ b/CSFML/src/System/Vector2.hpp @@ -1,22 +1,19 @@ #ifndef SFML_VECTOR2_H #define SFML_VECTOR2_H -typedef struct -{ +struct sfVector2i { int x; int y; -} sfVector2i; +}; -typedef struct -{ +struct sfVector2u { unsigned int x; unsigned int y; -} sfVector2u; +}; -typedef struct -{ +struct sfVector2f { float x; float y; -} sfVector2f; +}; #endif // SFML_VECTOR2_H diff --git a/CSFML/src/System/Vector3.hpp b/CSFML/src/System/Vector3.hpp index 7fe74a19..3acef6a4 100644 --- a/CSFML/src/System/Vector3.hpp +++ b/CSFML/src/System/Vector3.hpp @@ -1,11 +1,10 @@ #ifndef SFML_VECTOR3_H #define SFML_VECTOR3_H -typedef struct -{ +struct sfVector3f { float x; float y; float z; -} sfVector3f; +}; #endif // SFML_VECTOR3_H diff --git a/CSFML/src/Window/VideoMode.hpp b/CSFML/src/Window/VideoMode.hpp index dc75467b..235d13cf 100644 --- a/CSFML/src/Window/VideoMode.hpp +++ b/CSFML/src/Window/VideoMode.hpp @@ -1,11 +1,10 @@ #ifndef SFML_VIDEOMODE_H #define SFML_VIDEOMODE_H -typedef struct -{ - unsigned int width; ///< Video mode width, in pixels - unsigned int height; ///< Video mode height, in pixels - unsigned int bitsPerPixel; ///< Video mode pixel depth, in bits per pixels -} sfVideoMode; +struct sfVideoMode { + unsigned int width; + unsigned int height; + unsigned int bitsPerPixel; +}; #endif // SFML_VIDEOMODE_H