diff --git a/xs/src/libslic3r/Utils.hpp b/xs/src/libslic3r/Utils.hpp index 349222854..f1390b8a2 100644 --- a/xs/src/libslic3r/Utils.hpp +++ b/xs/src/libslic3r/Utils.hpp @@ -97,8 +97,9 @@ public: void call(int i) const; void call(int i, int j) const; void call(const std::vector& ints) const; - void call(double d) const; + void call(double a) const; void call(double a, double b) const; + void call(double a, double b, double c) const; void call(double a, double b, double c, double d) const; void call(bool b) const; private: diff --git a/xs/src/libslic3r/utils.cpp b/xs/src/libslic3r/utils.cpp index 55164bbdd..95aaf5453 100644 --- a/xs/src/libslic3r/utils.cpp +++ b/xs/src/libslic3r/utils.cpp @@ -251,7 +251,7 @@ void PerlCallback::call(const std::vector& ints) const LEAVE; } -void PerlCallback::call(double d) const +void PerlCallback::call(double a) const { if (!m_callback) return; @@ -259,7 +259,7 @@ void PerlCallback::call(double d) const ENTER; SAVETMPS; PUSHMARK(SP); - XPUSHs(sv_2mortal(newSVnv(d))); + XPUSHs(sv_2mortal(newSVnv(a))); PUTBACK; perl_call_sv(SvRV((SV*)m_callback), G_DISCARD); FREETMPS; @@ -282,6 +282,23 @@ void PerlCallback::call(double a, double b) const LEAVE; } +void PerlCallback::call(double a, double b, double c) const +{ + if (!m_callback) + return; + dSP; + ENTER; + SAVETMPS; + PUSHMARK(SP); + XPUSHs(sv_2mortal(newSVnv(a))); + XPUSHs(sv_2mortal(newSVnv(b))); + XPUSHs(sv_2mortal(newSVnv(c))); + PUTBACK; + perl_call_sv(SvRV((SV*)m_callback), G_DISCARD); + FREETMPS; + LEAVE; +} + void PerlCallback::call(double a, double b, double c, double d) const { if (!m_callback)