1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-07-02 16:38:41 +00:00

Basic camera control API (#15796)

This commit is contained in:
sfan5 2025-02-19 18:45:45 +01:00 committed by GitHub
parent 50819ace8f
commit ba62808fe8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
18 changed files with 162 additions and 42 deletions

View file

@ -20,12 +20,6 @@
namespace ParticleParamTypes
{
template <bool cond, typename T>
using enableIf = typename std::enable_if<cond, T>::type;
// std::enable_if_t does not appear to be present in GCC????
// std::is_enum_v also missing. wtf. these are supposed to be
// present as of c++14
template<typename T> using BlendFunction = T(float,T,T);
#define DECL_PARAM_SRZRS(type) \
void serializeParameterValue (std::ostream& os, type v); \
@ -57,12 +51,12 @@ namespace ParticleParamTypes
* that's hideous and unintuitive. instead, we supply the following functions to
* transparently map enumeration types to their underlying values. */
template <typename E, enableIf<std::is_enum<E>::value, bool> = true>
template <typename E, std::enable_if_t<std::is_enum_v<E>, bool> = true>
void serializeParameterValue(std::ostream& os, E k) {
serializeParameterValue(os, (std::underlying_type_t<E>)k);
}
template <typename E, enableIf<std::is_enum<E>::value, bool> = true>
template <typename E, std::enable_if_t<std::is_enum_v<E>, bool> = true>
void deSerializeParameterValue(std::istream& is, E& k) {
std::underlying_type_t<E> v;
deSerializeParameterValue(is, v);