| 233 | |
| 234 | |
| 235 | static bool buttonLogic(unsigned int id, bool over) |
| 236 | { |
| 237 | bool res = false; |
| 238 | // process down |
| 239 | if (!anyActive()) |
| 240 | { |
| 241 | if (over) |
| 242 | setHot(id); |
| 243 | // Begin Add Android Support |
| 244 | #ifdef ANDROID |
| 245 | if (isHot(id) && g_state.leftPressed && over) |
| 246 | setActive(id); |
| 247 | #else |
| 248 | if (isHot(id) && g_state.leftPressed) |
| 249 | setActive(id); |
| 250 | #endif |
| 251 | // End Add Android Support |
| 252 | } |
| 253 | |
| 254 | // if button is active, then react on left up |
| 255 | if (isActive(id)) |
| 256 | { |
| 257 | g_state.isActive = true; |
| 258 | if (over) |
| 259 | setHot(id); |
| 260 | if (g_state.leftReleased) |
| 261 | { |
| 262 | if (isHot(id)) |
| 263 | res = true; |
| 264 | clearActive(); |
| 265 | } |
| 266 | } |
| 267 | |
| 268 | if (isHot(id)) |
| 269 | g_state.isHot = true; |
| 270 | |
| 271 | return res; |
| 272 | } |
| 273 | |
| 274 | static void updateInput(int mx, int my, unsigned char mbut, int scroll) |
| 275 | { |
no test coverage detected