Improve Engine API export, robust Default Value logic and allow _ in arg

This commit is contained in:
Lukas Joergensen 2019-08-03 17:54:21 +02:00 committed by Lukas Aldershaab
parent 8bede52d3b
commit d567bc9735
3 changed files with 86 additions and 43 deletions

View file

@ -22,6 +22,9 @@
#ifndef _FIXEDTUPLE_H_
#define _FIXEDTUPLE_H_
#include "engineTypes.h"
/// @name Fixed-layout tuple definition
/// These structs and templates serve as a way to pass arguments from external
/// applications and into the T3D console system.
@ -113,6 +116,21 @@ struct fixed_tuple_accessor<0>
}
};
#pragma warning( push )
#pragma warning( disable : 4267 )
template <size_t I, class... Ts>
static U32 fixed_tuple_offset(fixed_tuple<Ts...>& t)
{
return (U32)((size_t)& fixed_tuple_accessor<I>::get(t)) - ((size_t)& t);
}
template <size_t I, class... Ts>
static U32 fixed_tuple_offset(const fixed_tuple<Ts...>& t)
{
return (U32)((size_t)& fixed_tuple_accessor<I>::get(t)) - ((size_t)& t);
}
#pragma warning(pop)
template< typename T1, typename T2 >
struct fixed_tuple_mutator {};
@ -150,4 +168,4 @@ struct fixed_tuple_mutator<void(Tdest...), void(Tsrc...)>
/// @}
#endif // !_FIXEDTUPLE_H_
#endif // !_FIXEDTUPLE_H_