| 1 | /* |
| 2 | * OpenTyrian: A modern cross-platform port of Tyrian |
| 3 | * Copyright (C) 2007-2009 The OpenTyrian Development Team |
| 4 | * |
| 5 | * This program is free software; you can redistribute it and/or |
| 6 | * modify it under the terms of the GNU General Public License |
| 7 | * as published by the Free Software Foundation; either version 2 |
| 8 | * of the License, or (at your option) any later version. |
| 9 | * |
| 10 | * This program is distributed in the hope that it will be useful, |
| 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 13 | * GNU General Public License for more details. |
| 14 | * |
| 15 | * You should have received a copy of the GNU General Public License |
| 16 | * along with this program; if not, write to the Free Software |
| 17 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
| 18 | */ |
| 19 | #ifndef OPENTYR_H |
| 20 | #define OPENTYR_H |
| 21 | |
| 22 | #include "SDL_types.h" |
| 23 | |
| 24 | #include <math.h> |
| 25 | #include <stdbool.h> |
| 26 | |
| 27 | #define COUNTOF(x) ((unsigned)(sizeof(x) / sizeof *(x))) // use only on arrays! |
| 28 | #define MIN(a, b) ((a) < (b) ? (a) : (b)) |
| 29 | #define MAX(a, b) ((a) > (b) ? (a) : (b)) |
| 30 | |
| 31 | #ifndef M_PI |
| 32 | #define M_PI 3.14159265358979323846 // pi |
| 33 | #endif |
| 34 | #ifndef M_PI_2 |
| 35 | #define M_PI_2 1.57079632679489661923 // pi/2 |
| 36 | #endif |
| 37 | #ifndef M_PI_4 |
| 38 | #define M_PI_4 0.78539816339744830962 // pi/4 |
| 39 | #endif |
| 40 | |
| 41 | typedef unsigned int uint; |
| 42 | typedef unsigned long ulong; |
| 43 | |
| 44 | // Pascal types, yuck. |
| 45 | typedef Sint32 JE_longint; |
| 46 | typedef Sint16 JE_integer; |
| 47 | typedef Sint8 JE_shortint; |
| 48 | typedef Uint16 JE_word; |
| 49 | typedef Uint8 JE_byte; |
| 50 | typedef bool JE_boolean; |
| 51 | typedef char JE_char; |
| 52 | typedef float JE_real; |
| 53 | |
| 54 | #define TYRIAN_VERSION "2.1" |
| 55 | |
| 56 | extern const char *opentyrian_str; |
| 57 | extern const char *opentyrian_version; |
| 58 | |
| 59 | void setupMenu(void); |
| 60 | |
| 61 | #endif /* OPENTYR_H */ |