mirror of https://github.com/OpenTTD/OpenTTD
Codechange: Remove useless SQConstruct parameters
parent
4b677e8256
commit
90e21bc713
|
@ -187,9 +187,9 @@ namespace SQConvert {
|
||||||
return SQCall(instance, func, vm, std::index_sequence_for<Targs...>{});
|
return SQCall(instance, func, vm, std::index_sequence_for<Targs...>{});
|
||||||
}
|
}
|
||||||
|
|
||||||
static Tcls *SQConstruct(Tcls *instance, Tretval(Tcls:: *func)(Targs...), HSQUIRRELVM vm)
|
static Tcls *SQConstruct(HSQUIRRELVM vm)
|
||||||
{
|
{
|
||||||
return SQConstruct(instance, func, vm, std::index_sequence_for<Targs...>{});
|
return SQConstruct(vm, std::index_sequence_for<Targs...>{});
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
@ -210,7 +210,7 @@ namespace SQConvert {
|
||||||
}
|
}
|
||||||
|
|
||||||
template <size_t... i>
|
template <size_t... i>
|
||||||
static Tcls *SQConstruct(Tcls *, Tretval(Tcls:: *)(Targs...), [[maybe_unused]] HSQUIRRELVM vm, std::index_sequence<i...>)
|
static Tcls *SQConstruct([[maybe_unused]] HSQUIRRELVM vm, std::index_sequence<i...>)
|
||||||
{
|
{
|
||||||
Tcls *inst = new Tcls(
|
Tcls *inst = new Tcls(
|
||||||
Param<Targs>::Get(vm, 2 + i)...
|
Param<Targs>::Get(vm, 2 + i)...
|
||||||
|
@ -384,7 +384,7 @@ namespace SQConvert {
|
||||||
int nparam = sq_gettop(vm);
|
int nparam = sq_gettop(vm);
|
||||||
|
|
||||||
/* Create the real instance */
|
/* Create the real instance */
|
||||||
Tcls *instance = HelperT<Tmethod>::SQConstruct((Tcls *)nullptr, (Tmethod)nullptr, vm);
|
Tcls *instance = HelperT<Tmethod>::SQConstruct(vm);
|
||||||
sq_setinstanceup(vm, -nparam, instance);
|
sq_setinstanceup(vm, -nparam, instance);
|
||||||
sq_setreleasehook(vm, -nparam, DefSQDestructorCallback<Tcls>);
|
sq_setreleasehook(vm, -nparam, DefSQDestructorCallback<Tcls>);
|
||||||
instance->AddRef();
|
instance->AddRef();
|
||||||
|
|
Loading…
Reference in New Issue