mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-07-12 15:14:35 +00:00
Fixed type inference for nulls in console functions
This commit is contained in:
parent
733fd3ef6d
commit
88106f9032
17 changed files with 29 additions and 22 deletions
|
|
@ -39,6 +39,7 @@
|
|||
#include "console/engineStructs.h"
|
||||
#endif
|
||||
|
||||
template<typename T> constexpr T nullAsType(){ return nullptr; }
|
||||
|
||||
/// @file
|
||||
/// Legacy TS-based console type definitions.
|
||||
|
|
|
|||
|
|
@ -547,9 +547,12 @@ namespace engineAPI{
|
|||
template<size_t index, size_t method_offset = 0, typename ...RealArgTs>
|
||||
static IthArgType<index> getRealArgValue(S32 argc, ConsoleValueRef *argv, const _EngineFunctionDefaultArguments< void(RealArgTs...) >& defaultArgs)
|
||||
{
|
||||
return (startArgc + index) < argc
|
||||
? EngineUnmarshallData< IthArgType<index> >()( argv[ startArgc + index ] )
|
||||
: std::get<index + method_offset>(defaultArgs.mArgs);
|
||||
if((startArgc + index) < argc)
|
||||
{
|
||||
return EngineUnmarshallData< IthArgType<index> >()( argv[ startArgc + index ] );
|
||||
} else {
|
||||
return std::get<index + method_offset>(defaultArgs.mArgs);
|
||||
}
|
||||
}
|
||||
|
||||
template<size_t ...I>
|
||||
|
|
|
|||
|
|
@ -23,6 +23,8 @@
|
|||
#ifndef _ENGINEFUNCTIONS_H_
|
||||
#define _ENGINEFUNCTIONS_H_
|
||||
|
||||
#include <tuple>
|
||||
|
||||
#ifndef _ENGINEEXPORTS_H_
|
||||
#include "console/engineExports.h"
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -41,6 +41,8 @@ DECLARE_PRIMITIVE_R(S32);
|
|||
DECLARE_PRIMITIVE_R(U32);
|
||||
DECLARE_PRIMITIVE_R(F32);
|
||||
DECLARE_PRIMITIVE_R(F64);
|
||||
DECLARE_PRIMITIVE_R(U64);
|
||||
DECLARE_PRIMITIVE_R(S64);
|
||||
DECLARE_PRIMITIVE_R(void*);
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue