doomtype.h 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129
  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. #ifndef _MSC_VER
  60. typedef signed long long int_64_t;
  61. typedef unsigned long long uint_64_t;
  62. // define compiled-specific long-long contstant notation here
  63. #define LONGLONG(num) (uint_64_t)num ## ll
  64. #else
  65. typedef __int64 int_64_t;
  66. typedef unsigned __int64 uint_64_t;
  67. // define compiled-specific long-long contstant notation here
  68. #define LONGLONG(num) (uint_64_t)num
  69. #undef PATH_MAX
  70. #define PATH_MAX 1024
  71. #define strcasecmp _stricmp
  72. #define strncasecmp _strnicmp
  73. #define S_ISDIR(x) (((sbuf.st_mode & S_IFDIR)==S_IFDIR)?1:0)
  74. #endif
  75. #ifdef __GNUC__
  76. #define CONSTFUNC __attribute__((const))
  77. #define PUREFUNC __attribute__((pure))
  78. #define NORETURN __attribute__ ((noreturn))
  79. #else
  80. #define CONSTFUNC
  81. #define PUREFUNC
  82. #define NORETURN
  83. #endif
  84. /* CPhipps - use limits.h instead of depreciated values.h */
  85. #include <limits.h>
  86. /* cph - move compatibility levels here so we can use them in d_server.c */
  87. typedef enum {
  88. doom_12_compatibility, /* Doom v1.2 */
  89. doom_1666_compatibility, /* Doom v1.666 */
  90. doom2_19_compatibility, /* Doom & Doom 2 v1.9 */
  91. ultdoom_compatibility, /* Doom 2 v1.9 */
  92. finaldoom_compatibility, /* Final & Ultimate Doom v1.9, and Doom95 */
  93. dosdoom_compatibility, /* Early dosdoom & tasdoom */
  94. tasdoom_compatibility, /* Early dosdoom & tasdoom */
  95. boom_compatibility_compatibility, /* Boom's compatibility mode */
  96. boom_201_compatibility, /* Compatible with Boom v2.01 */
  97. boom_202_compatibility, /* Compatible with Boom v2.01 */
  98. lxdoom_1_compatibility, /* LxDoom v1.3.2+ */
  99. mbf_compatibility, /* MBF */
  100. prboom_1_compatibility, /* PrBoom 2.03beta? */
  101. prboom_2_compatibility, /* PrBoom 2.1.0-2.1.1 */
  102. prboom_3_compatibility, /* PrBoom 2.2.x */
  103. prboom_4_compatibility, /* PrBoom 2.3.x */
  104. prboom_5_compatibility, /* PrBoom 2.4.0 */
  105. prboom_6_compatibility, /* Latest PrBoom */
  106. MAX_COMPATIBILITY_LEVEL, /* Must be last entry */
  107. /* Aliases follow */
  108. boom_compatibility = boom_201_compatibility, /* Alias used by G_Compatibility */
  109. best_compatibility = prboom_6_compatibility,
  110. } complevel_t;
  111. /* cph - from v_video.h, needed by gl_struct.h */
  112. enum patch_translation_e {
  113. VPT_NONE = 0, // Normal
  114. VPT_FLIP = 1, // Flip image horizontally
  115. VPT_TRANS = 2, // Translate image via a translation table
  116. VPT_STRETCH = 4, // Stretch to compensate for high-res
  117. };
  118. #endif