aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLittleboy2012-08-01 13:55:55 -0400
committerLittleboy2012-08-01 13:55:55 -0400
commit4ad7d48fe9b306192963398668feb6332a664830 (patch)
tree7d1e643b86d9fddcade1310a7478807b7036b2cd
parent7f05e1413c8b7b3913f64ddb29622dcdf40b2c65 (diff)
downloadscummvm-rg350-4ad7d48fe9b306192963398668feb6332a664830.tar.gz
scummvm-rg350-4ad7d48fe9b306192963398668feb6332a664830.tar.bz2
scummvm-rg350-4ad7d48fe9b306192963398668feb6332a664830.zip
LASTEXPRESS: Remove unused code and move functor definition to only file using it
-rw-r--r--engines/lastexpress/game/action.cpp16
-rw-r--r--engines/lastexpress/shared.h56
2 files changed, 16 insertions, 56 deletions
diff --git a/engines/lastexpress/game/action.cpp b/engines/lastexpress/game/action.cpp
index 4d1c786167..60a309518a 100644
--- a/engines/lastexpress/game/action.cpp
+++ b/engines/lastexpress/game/action.cpp
@@ -329,6 +329,22 @@ static const struct {
{"8042A", 600}
};
+template<class Arg, class Res, class T>
+class Functor1MemConst : public Common::Functor1<Arg, Res> {
+public:
+ typedef Res (T::*FuncType)(Arg) const;
+
+ Functor1MemConst(T *t, const FuncType &func) : _t(t), _func(func) {}
+
+ bool isValid() const { return _func != 0 && _t != 0; }
+ Res operator()(Arg v1) const {
+ return (_t->*_func)(v1);
+ }
+private:
+ mutable T *_t;
+ const FuncType _func;
+};
+
Action::Action(LastExpressEngine *engine) : _engine(engine) {
ADD_ACTION(dummy);
ADD_ACTION(inventory);
diff --git a/engines/lastexpress/shared.h b/engines/lastexpress/shared.h
index bebd149b9b..56cf730e24 100644
--- a/engines/lastexpress/shared.h
+++ b/engines/lastexpress/shared.h
@@ -1733,62 +1733,6 @@ enum ActionIndex {
kActionEnd
};
-//////////////////////////////////////////////////////////////////////////
-// Functors classes used by the engine
-//////////////////////////////////////////////////////////////////////////
-
-// FIXME is this achievable with the existing Functor1Mem function
-template<class Arg, class Res, class T>
-class Functor1MemConst : public Common::Functor1<Arg, Res> {
-public:
- typedef Res (T::*FuncType)(Arg) const;
-
- Functor1MemConst(T *t, const FuncType &func) : _t(t), _func(func) {}
-
- bool isValid() const { return _func != 0 && _t != 0; }
- Res operator()(Arg v1) const {
- return (_t->*_func)(v1);
- }
-private:
- mutable T *_t;
- const FuncType _func;
-};
-
-// FIXME move this to existing func.h file
-template<class Arg1, class Arg2, class Arg3, class Arg4, class Result>
-struct QuaternaryFunction {
- typedef Arg1 FirstArgumentType;
- typedef Arg2 SecondArgumentType;
- typedef Arg3 ThirdArgumentType;
- typedef Arg4 FourthArgumentType;
- typedef Result ResultType;
-};
-
-template<class Arg1, class Arg2, class Arg3, class Arg4, class Res>
-struct Functor4 : public QuaternaryFunction<Arg1, Arg2, Arg3, Arg4, Res> {
- virtual ~Functor4() {}
-
- virtual bool isValid() const = 0;
- virtual Res operator()(Arg1, Arg2, Arg3, Arg4) const = 0;
-};
-
-template<class Arg1, class Arg2, class Arg3, class Arg4, class Res, class T>
-class Functor4Mem : public Functor4<Arg1, Arg2, Arg3, Arg4, Res> {
-public:
- typedef Res (T::*FuncType)(Arg1, Arg2, Arg3, Arg4);
-
- Functor4Mem(T *t, const FuncType &func) : _t(t), _func(func) {}
-
- bool isValid() const { return _func != 0 && _t != 0; }
- Res operator()(Arg1 v1, Arg2 v2, Arg3 v3, Arg4 v4) const {
- return (_t->*_func)(v1, v2, v3, v4);
- }
-private:
- mutable T *_t;
- const FuncType _func;
-};
-
-
} // End of namespace LastExpress
#endif // LASTEXPRESS_SHARED_H