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 #include <math.h> 24 #include <stdbool.h> 25 26 #define COUNTOF(x) ((unsigned)(sizeof(x) / sizeof *(x))) // use only on arrays! 27 #define MIN(a, b) ((a) < (b) ? (a) : (b)) 28 #define MAX(a, b) ((a) > (b) ? (a) : (b)) 29 30 #ifndef M_PI 31 #define M_PI 3.14159265358979323846 // pi 32 #endif 33 #ifndef M_PI_2 34 #define M_PI_2 1.57079632679489661923 // pi/2 35 #endif 36 #ifndef M_PI_4 37 #define M_PI_4 0.78539816339744830962 // pi/4 38 #endif 39 40 typedef unsigned int uint; 41 typedef unsigned long ulong; 42 43 // Pascal types, yuck. 44 typedef Sint32 JE_longint; 45 typedef Sint16 JE_integer; 46 typedef Sint8 JE_shortint; 47 typedef Uint16 JE_word; 48 typedef Uint8 JE_byte; 49 typedef bool JE_boolean; 50 typedef char JE_char; 51 typedef float JE_real; 52 53 #ifdef TYRIAN2000 54 #define TYRIAN_VERSION "2000" 55 #else 56 #define TYRIAN_VERSION "2.1" 57 #endif 58 59 char *strnztcpy( char *to, const char *from, size_t count ); 60 61 extern const char *opentyrian_str, *opentyrian_version; 62 63 void opentyrian_menu( void ); 64 65 #endif /* OPENTYR_H */ 66 67