22 #ifndef ANDROID_TOUCHCONTROLS_H_ 23 #define ANDROID_TOUCHCONTROLS_H_ 25 #include "common/events.h" 34 virtual void touchControlNotifyChanged() = 0;
35 virtual void touchControlDraw(uint8 alpha, int16 x, int16 y, int16 w, int16 h,
const Common::Rect &clip) = 0;
54 void init(
float scale);
58 void update(Action action,
int ptr,
int x,
int y);
63 unsigned int _screen_width, _screen_height;
64 unsigned int _scale, _scale2;
68 unsigned int _zombieCount;
71 kFunctionInactive = 0,
77 virtual bool isInside(
int,
int) = 0;
78 virtual void touch(
int,
int, Action) = 0;
79 virtual void draw(uint8 alpha) = 0;
80 virtual void resetState() {}
83 parent(parent_), pointerId(-1),
84 startX(-1), startY(-1),
85 currentX(-1), currentY(-1),
86 lastActivable(0), status(kFunctionInactive) {}
87 virtual ~Function() {}
91 startX = startY = currentX = currentY = -1;
93 status = kFunctionInactive;
100 uint16 startX, startY;
101 uint16 currentX, currentY;
102 uint32 lastActivable;
105 Function *getFunctionFromPointerId(
int ptr);
106 Function *getZombieFunctionFromPos(
int x,
int y);
115 FunctionId getFunctionId(
int x,
int y);
117 Function *_functions[kFunctionCount];
132 void drawSurface(uint8 alpha,
int x,
int y,
int offX,
int offY,
const Common::Rect &clip)
const;
136 struct FunctionLeft : Function {
138 Function(parent), mask(0) {}
139 void resetState()
override { mask = 0; }
141 bool isInside(
int,
int)
override;
142 void touch(
int,
int, Action)
override;
143 void draw(uint8 alpha)
override;
146 void maskToLeftButtons(uint32 oldMask, uint32 newMask);
149 struct FunctionRight : Function {
151 Function(parent), button(0) {}
152 void resetState()
override { button = 0; }
154 bool isInside(
int,
int)
override;
155 void touch(
int,
int, Action)
override;
156 void draw(uint8 alpha)
override;
161 struct FunctionCenter : Function {
163 Function(parent), button(0) {}
164 void resetState()
override { button = 0; }
166 bool isInside(
int,
int)
override;
167 void touch(
int,
int, Action)
override;
168 void draw(uint8 alpha)
override;
Definition: managed_surface.h:51
Graphics::Surface * scale(const Graphics::Surface &srcImage, int xSize, int ySize)
Definition: formatinfo.h:28
Definition: touchcontrols.h:41
Definition: touchcontrols.h:31
JoystickButton
Definition: events.h:146