mirror of
https://github.com/RetroDECK/ES-DE.git
synced 2024-11-22 06:05:38 +00:00
(macOS) Some fixes to make the legacy build work again.
This commit is contained in:
parent
e285749871
commit
a2253113f7
|
@ -276,6 +276,10 @@ if(VLC_PLAYER)
|
|||
add_definitions(-DBUILD_VLC_PLAYER)
|
||||
endif()
|
||||
|
||||
if(APPLE AND CMAKE_OSX_DEPLOYMENT_TARGET VERSION_LESS 10.14)
|
||||
add_definitions(-DLEGACY_MACOS)
|
||||
endif()
|
||||
|
||||
# GLM library options.
|
||||
add_definitions(-DGLM_FORCE_CXX17)
|
||||
add_definitions(-DGLM_FORCE_XYZW_ONLY)
|
||||
|
|
|
@ -127,6 +127,21 @@ public:
|
|||
|
||||
template <typename T> const T get(const std::string& prop) const
|
||||
{
|
||||
#if defined(LEGACY_MACOS)
|
||||
if (std::is_same<T, glm::vec2>::value)
|
||||
return *(const T*)&properties.at(prop).v;
|
||||
else if (std::is_same<T, std::string>::value)
|
||||
return *(const T*)&properties.at(prop).s;
|
||||
else if (std::is_same<T, unsigned int>::value)
|
||||
return *(const T*)&properties.at(prop).i;
|
||||
else if (std::is_same<T, float>::value)
|
||||
return *(const T*)&properties.at(prop).f;
|
||||
else if (std::is_same<T, bool>::value)
|
||||
return *(const T*)&properties.at(prop).b;
|
||||
else if (std::is_same<T, glm::vec4>::value)
|
||||
return *(const T*)&properties.at(prop).r;
|
||||
return T();
|
||||
#else
|
||||
if (std::is_same<T, glm::vec2>::value)
|
||||
return std::any_cast<const T>(properties.at(prop).v);
|
||||
else if (std::is_same<T, std::string>::value)
|
||||
|
@ -140,6 +155,7 @@ public:
|
|||
else if (std::is_same<T, glm::vec4>::value)
|
||||
return std::any_cast<const T>(properties.at(prop).r);
|
||||
return T();
|
||||
#endif
|
||||
}
|
||||
|
||||
bool has(const std::string& prop) const
|
||||
|
|
Loading…
Reference in a new issue