diff options
author | Benjamin Haisch | 2008-04-21 07:29:35 +0000 |
---|---|---|
committer | Benjamin Haisch | 2008-04-21 07:29:35 +0000 |
commit | 651bc3a2786c36146e6471f2c06cffccd82aa0aa (patch) | |
tree | c631002e7b14aad21a7f9cea46d052940b8a12d4 | |
parent | 5279c5807210578a7390b01d62fb978550d7b527 (diff) | |
download | scummvm-rg350-651bc3a2786c36146e6471f2c06cffccd82aa0aa.tar.gz scummvm-rg350-651bc3a2786c36146e6471f2c06cffccd82aa0aa.tar.bz2 scummvm-rg350-651bc3a2786c36146e6471f2c06cffccd82aa0aa.zip |
Removed Functor2 class definition.
svn-id: r31639
-rw-r--r-- | engines/made/scriptfuncs.cpp | 2 | ||||
-rw-r--r-- | engines/made/scriptfuncs.h | 27 |
2 files changed, 3 insertions, 26 deletions
diff --git a/engines/made/scriptfuncs.cpp b/engines/made/scriptfuncs.cpp index 8d18b76c53..03ea762d78 100644 --- a/engines/made/scriptfuncs.cpp +++ b/engines/made/scriptfuncs.cpp @@ -51,7 +51,7 @@ int16 ScriptFunctions::callFunction(uint16 index, int16 argc, int16 *argv) { return (*_externalFuncs[index])(argc, argv); } -typedef Functor2Mem<int16, int16*, int16, ScriptFunctionsRtz> ExternalFuncRtz; +typedef Common::Functor2Mem<int16, int16*, int16, ScriptFunctionsRtz> ExternalFuncRtz; #define External(x) ExternalFuncRtz(this, &ScriptFunctionsRtz::x) void ScriptFunctionsRtz::setupExternalsTable() { static const ExternalFuncRtz externalsTable[] = { diff --git a/engines/made/scriptfuncs.h b/engines/made/scriptfuncs.h index ec8982af06..971db34ffd 100644 --- a/engines/made/scriptfuncs.h +++ b/engines/made/scriptfuncs.h @@ -28,37 +28,14 @@ #include "common/util.h" #include "common/file.h" +#include "common/func.h" #include "common/stream.h" namespace Made { class MadeEngine; -template<class Arg1, class Arg2, class Res> -struct Functor2 : public Common::BinaryFunction<Arg1, Arg2, Res> { - virtual ~Functor2() {} - - virtual bool isValid() const = 0; - virtual Res operator()(Arg1, Arg2) const = 0; -}; - -template<class Arg1, class Arg2, class Res, class T> -class Functor2Mem : public Functor2<Arg1, Arg2, Res> { -public: - typedef Res (T::*FuncType)(Arg1, Arg2); - - Functor2Mem(T *t, const FuncType &func) : _t(t), _func(func) {} - - bool isValid() const { return _func != 0; } - Res operator()(Arg1 v1, Arg2 v2) const { - return (_t->*_func)(v1, v2); - } -private: - mutable T *_t; - Res (T::*_func)(Arg1, Arg2); -}; - -typedef Functor2<int16, int16*, int16> ExternalFunc; +typedef Common::Functor2<int16, int16*, int16> ExternalFunc; class ScriptFunctions { public: |