[Scummvm-cvs-logs] SF.net SVN: scummvm: [31639] scummvm/trunk/engines/made

john_doe at users.sourceforge.net john_doe at users.sourceforge.net
Mon Apr 21 09:29:35 CEST 2008


Revision: 31639
          http://scummvm.svn.sourceforge.net/scummvm/?rev=31639&view=rev
Author:   john_doe
Date:     2008-04-21 00:29:35 -0700 (Mon, 21 Apr 2008)

Log Message:
-----------
Removed Functor2 class definition.

Modified Paths:
--------------
    scummvm/trunk/engines/made/scriptfuncs.cpp
    scummvm/trunk/engines/made/scriptfuncs.h

Modified: scummvm/trunk/engines/made/scriptfuncs.cpp
===================================================================
--- scummvm/trunk/engines/made/scriptfuncs.cpp	2008-04-21 07:28:13 UTC (rev 31638)
+++ scummvm/trunk/engines/made/scriptfuncs.cpp	2008-04-21 07:29:35 UTC (rev 31639)
@@ -51,7 +51,7 @@
 	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[] = {

Modified: scummvm/trunk/engines/made/scriptfuncs.h
===================================================================
--- scummvm/trunk/engines/made/scriptfuncs.h	2008-04-21 07:28:13 UTC (rev 31638)
+++ scummvm/trunk/engines/made/scriptfuncs.h	2008-04-21 07:29:35 UTC (rev 31639)
@@ -28,38 +28,15 @@
 
 #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() {}
+typedef Common::Functor2<int16, int16*, int16> ExternalFunc;
 
-	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;
-
 class ScriptFunctions {
 public:
 	ScriptFunctions(MadeEngine *vm) : _vm(vm) {}


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list