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