From bef65b44075a5c918821f1360804ff5f9f2a32ed Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Wed, 5 Dec 2012 20:47:16 +0300 Subject: add attack and cancel on screen buttons. --- src/touchmanager.h | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'src/touchmanager.h') diff --git a/src/touchmanager.h b/src/touchmanager.h index 8afd78c56..4c2339e15 100644 --- a/src/touchmanager.h +++ b/src/touchmanager.h @@ -23,6 +23,8 @@ #include "resources/image.h" +#include "keydata.h" + #include #include @@ -37,7 +39,7 @@ class MouseInput; typedef void (*TouchFuncPtr) (const MouseInput &mouseInput); -const int actionsSize = 10; +const int actionsSize = Input::KEY_TOTAL; struct TouchItem final { @@ -79,9 +81,16 @@ class TouchManager final A_DELETE_COPY(TouchManager) + enum Types + { + NORMAL = 0, + LEFT = 1, + RIGHT = 2, + }; + void init(); - void loadTouchItem(TouchItem **item, std::string name, bool type, + void loadTouchItem(TouchItem **item, std::string name, int type, TouchFuncPtr fAll, TouchFuncPtr fPressed, TouchFuncPtr fReleased, TouchFuncPtr fOut); @@ -104,6 +113,8 @@ class TouchManager final private: TouchItem *mKeyboard; TouchItem *mPad; + TouchItem *mAttack; + TouchItem *mCancel; TouchItemVector mObjects; ImageCollection *mVertexes; bool mActions[actionsSize]; -- cgit v1.2.3-60-g2f50