doomtype.h 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. /* Emacs style mode select -*- C++ -*-
  2. *-----------------------------------------------------------------------------
  3. *
  4. *
  5. * PrBoom: a Doom port merged with LxDoom and LSDLDoom
  6. * based on BOOM, a modified and improved DOOM engine
  7. * Copyright (C) 1999 by
  8. * id Software, Chi Hoang, Lee Killough, Jim Flynn, Rand Phares, Ty Halderman
  9. * Copyright (C) 1999-2006 by
  10. * Jess Haas, Nicolas Kalkhof, Colin Phipps, Florian Schulze
  11. * Copyright 2005, 2006 by
  12. * Florian Schulze, Colin Phipps, Neil Stevens, Andrey Budko
  13. *
  14. * This program is free software; you can redistribute it and/or
  15. * modify it under the terms of the GNU General Public License
  16. * as published by the Free Software Foundation; either version 2
  17. * of the License, or (at your option) any later version.
  18. *
  19. * This program is distributed in the hope that it will be useful,
  20. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  21. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  22. * GNU General Public License for more details.
  23. *
  24. * You should have received a copy of the GNU General Public License
  25. * along with this program; if not, write to the Free Software
  26. * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
  27. * 02111-1307, USA.
  28. *
  29. * DESCRIPTION:
  30. * Simple basic typedefs, isolated here to make it easier
  31. * separating modules.
  32. *
  33. *-----------------------------------------------------------------------------*/
  34. #ifndef __DOOMTYPE__
  35. #define __DOOMTYPE__
  36. #ifdef HAVE_CONFIG_H
  37. #include "config.h"
  38. #endif
  39. #ifndef __BYTEBOOL__
  40. #define __BYTEBOOL__
  41. /* Fixed to use builtin bool type with C++. */
  42. #ifdef __cplusplus
  43. typedef bool boolean;
  44. #else
  45. typedef enum {false, true} boolean;
  46. #endif
  47. typedef unsigned char byte;
  48. #endif
  49. //e6y
  50. #ifndef MAX
  51. #define MAX(a,b) ((a)>(b)?(a):(b))
  52. #endif
  53. #ifndef MIN
  54. #define MIN(a,b) ((a)<(b)?(a):(b))
  55. #endif
  56. /* cph - Wrapper for the long long type, as Win32 used a different name.
  57. * Except I don't know what to test as it's compiler specific
  58. * Proff - I fixed it */
  59. #ifdef __WINS__
  60. #define int_64_t __int64
  61. #define uint_64_t unsigned __int64
  62. #else
  63. #define int_64_t long long
  64. #define uint_64_t unsigned long long
  65. #endif
  66. //typedef _int64 int_64_t;
  67. //typedef unsigned _int64 uint_64_t;
  68. // define compiled-specific long-long contstant notation here
  69. #define LONGLONG(num) (uint_64_t)num
  70. #undef PATH_MAX
  71. #define PATH_MAX 1024
  72. #ifdef __GNUC__
  73. #define CONSTFUNC __attribute__((const))
  74. #define PUREFUNC __attribute__((pure))
  75. #define NORETURN __attribute__ ((noreturn))
  76. #else
  77. #define CONSTFUNC
  78. #define PUREFUNC
  79. #define NORETURN
  80. #endif
  81. /* CPhipps - use limits.h instead of depreciated values.h */
  82. #include <limits.h>
  83. /* cph - from v_video.h, needed by gl_struct.h */
  84. enum patch_translation_e {
  85. VPT_NONE = 0, // Normal
  86. VPT_FLIP = 1, // Flip image horizontally
  87. VPT_TRANS = 2, // Translate image via a translation table
  88. VPT_STRETCH = 4, // Stretch to compensate for high-res
  89. };
  90. #endif