Skip to content

Commit bca82a4

Browse files
Merge pull request #119 from crumblingstatue/master
Inline the functions in ContextSettingsInternal
2 parents 8ec6eb0 + 6dca26e commit bca82a4

File tree

3 files changed

+26
-71
lines changed

3 files changed

+26
-71
lines changed

src/SFML/Window/CMakeLists.txt

-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ set(SRCROOT ${CMAKE_SOURCE_DIR}/src/SFML/Window)
66
set(SRC
77
${INCROOT}/Export.h
88
${SRCROOT}/Context.cpp
9-
${SRCROOT}/ContextSettingsInternal.cpp
109
${SRCROOT}/ContextSettingsInternal.h
1110
${SRCROOT}/ContextStruct.h
1211
${INCROOT}/Context.h

src/SFML/Window/ContextSettingsInternal.cpp

-67
This file was deleted.

src/SFML/Window/ContextSettingsInternal.h

+26-3
Original file line numberDiff line numberDiff line change
@@ -36,17 +36,40 @@ namespace priv
3636
////////////////////////////////////////////////////////////
3737
// Create a "null" sfContextSettings that's returned in case of an error.
3838
////////////////////////////////////////////////////////////
39-
sfContextSettings sfContextSettings_null();
39+
inline sfContextSettings sfContextSettings_null()
40+
{
41+
sfContextSettings settings = {0, 0, 0, 0, 0, 0, sfFalse};
42+
43+
return settings;
44+
}
4045

4146
////////////////////////////////////////////////////////////
4247
// Read the data of an sf::ContextSettings into an sfContextSettings
4348
////////////////////////////////////////////////////////////
44-
void sfContextSettings_readFromCpp(const sf::ContextSettings& from, sfContextSettings& to);
49+
inline void sfContextSettings_readFromCpp(const sf::ContextSettings& from, sfContextSettings& to)
50+
{
51+
to.depthBits = from.depthBits;
52+
to.stencilBits = from.stencilBits;
53+
to.antialiasingLevel = from.antialiasingLevel;
54+
to.majorVersion = from.majorVersion;
55+
to.minorVersion = from.minorVersion;
56+
to.attributeFlags = from.attributeFlags;
57+
to.sRgbCapable = from.sRgbCapable ? sfTrue : sfFalse;
58+
}
4559

4660
////////////////////////////////////////////////////////////
4761
// Write the data of an sfContextSettings into an sf::ContextSettings
4862
////////////////////////////////////////////////////////////
49-
void sfContextSettings_writeToCpp(const sfContextSettings& from, sf::ContextSettings& to);
63+
inline void sfContextSettings_writeToCpp(const sfContextSettings& from, sf::ContextSettings& to)
64+
{
65+
to.depthBits = from.depthBits;
66+
to.stencilBits = from.stencilBits;
67+
to.antialiasingLevel = from.antialiasingLevel;
68+
to.majorVersion = from.majorVersion;
69+
to.minorVersion = from.minorVersion;
70+
to.attributeFlags = from.attributeFlags;
71+
to.sRgbCapable = from.sRgbCapable == sfTrue;
72+
}
5073
}
5174

5275
#endif // SFML_CONTEXTSETTINGSINTERNAL_H

0 commit comments

Comments
 (0)