| 1 | |
| 2 | /** |
| 3 | * |
| 4 | * @file loop.h |
| 5 | * |
| 6 | * Part of the OpenJazz project |
| 7 | * |
| 8 | * @par History: |
| 9 | * - 23rd August 2005: Created OpenJazz.h |
| 10 | * - 30th April 2010: Created loop.h from parts of OpenJazz.h |
| 11 | * |
| 12 | * @par Licence: |
| 13 | * Copyright (c) 2005-2017 AJ Thomson |
| 14 | * |
| 15 | * OpenJazz is distributed under the terms of |
| 16 | * the GNU General Public License, version 2.0 |
| 17 | * |
| 18 | */ |
| 19 | |
| 20 | |
| 21 | #ifndef _LOOP_H |
| 22 | #define _LOOP_H |
| 23 | |
| 24 | |
| 25 | #include "io/gfx/paletteeffects.h" |
| 26 | |
| 27 | |
| 28 | // Constants |
| 29 | |
| 30 | // Return values |
| 31 | #define JOYSTICKB 0x100 |
| 32 | #define JOYSTICKANEG 0x200 |
| 33 | #define JOYSTICKAPOS 0x300 |
| 34 | #define JOYSTICKHUP 0x400 |
| 35 | #define JOYSTICKHLFT 0x500 |
| 36 | #define JOYSTICKHRHT 0x600 |
| 37 | #define JOYSTICKHDWN 0x700 |
| 38 | |
| 39 | |
| 40 | // Variable |
| 41 | |
| 42 | EXTERN unsigned int globalTicks; |
| 43 | |
| 44 | |
| 45 | // Enum |
| 46 | |
| 47 | /// Ways the loop function should handle input. |
| 48 | enum LoopType { |
| 49 | |
| 50 | NORMAL_LOOP, ///< Normal behaviour |
| 51 | TYPING_LOOP, ///< Return key presses |
| 52 | SET_KEY_LOOP, ///< Return key presses without modifying control state |
| 53 | SET_JOYSTICK_LOOP ///< Return joystick actions without modifying control state |
| 54 | |
| 55 | }; |
| 56 | |
| 57 | |
| 58 | // Function in main.cpp |
| 59 | |
| 60 | EXTERN int loop (LoopType type, PaletteEffect* paletteEffects = nullptr, bool effectsStopped = false); |
| 61 | |
| 62 | #endif |
| 63 |