Subversion Repositories Games.Descent

Rev

Blame | Last modification | View Log | Download | RSS feed

  1. /*
  2.  * Portions of this file are copyright Rebirth contributors and licensed as
  3.  * described in COPYING.txt.
  4.  * Portions of this file are copyright Parallax Software and licensed
  5.  * according to the Parallax license below.
  6.  * See COPYING.txt for license details.
  7.  
  8. THE COMPUTER CODE CONTAINED HEREIN IS THE SOLE PROPERTY OF PARALLAX
  9. SOFTWARE CORPORATION ("PARALLAX").  PARALLAX, IN DISTRIBUTING THE CODE TO
  10. END-USERS, AND SUBJECT TO ALL OF THE TERMS AND CONDITIONS HEREIN, GRANTS A
  11. ROYALTY-FREE, PERPETUAL LICENSE TO SUCH END-USERS FOR USE BY SUCH END-USERS
  12. IN USING, DISPLAYING,  AND CREATING DERIVATIVE WORKS THEREOF, SO LONG AS
  13. SUCH USE, DISPLAY OR CREATION IS FOR NON-COMMERCIAL, ROYALTY OR REVENUE
  14. FREE PURPOSES.  IN NO EVENT SHALL THE END-USER USE THE COMPUTER CODE
  15. CONTAINED HEREIN FOR REVENUE-BEARING PURPOSES.  THE END-USER UNDERSTANDS
  16. AND AGREES TO THE TERMS HEREIN AND ACCEPTS THE SAME BY USE OF THIS FILE.
  17. COPYRIGHT 1993-1999 PARALLAX SOFTWARE CORPORATION.  ALL RIGHTS RESERVED.
  18. */
  19.  
  20. /*
  21.  *
  22.  * Header file for Inferno.  Should be included in all source files.
  23.  *
  24.  */
  25.  
  26. #pragma once
  27.  
  28. #include "dxxsconf.h"
  29. #include "fwd-event.h"
  30. #include "dsx-ns.h"
  31. #include "ntstring.h"
  32. #include "player-callsign.h"
  33.  
  34. namespace dcx {
  35.  
  36. #if defined(__APPLE__) || defined(macintosh)
  37. #define KEY_MAC(x) x
  38. #else
  39. // do not use MAC, it will break MSVC compilation somewhere in rpcdce.h
  40. #define KEY_MAC(x)
  41. #endif
  42.  
  43. /**
  44.  **     Constants
  45.  **/
  46.  
  47. //      How close two points must be in all dimensions to be considered the same point.
  48. #define FIX_EPSILON     10
  49.  
  50. // the maximum length of a filename
  51. constexpr std::integral_constant<std::size_t, 13> FILENAME_LEN{};
  52.  
  53. // Default event handler for everything except the editor
  54. window_event_result standard_handler(const d_event &event);
  55.  
  56. // a filename, useful for declaring arrays of filenames
  57. struct d_fname : ntstring<FILENAME_LEN - 1>
  58. {
  59.         d_fname &operator=(const d_fname &) = default;
  60.         template <std::size_t N>
  61.                 void operator=(char (&i)[N]) const = delete;
  62.         template <std::size_t N>
  63.                 void operator=(const char (&i)[N])
  64.                 {
  65.                         copy_if(i);
  66.                 }
  67. };
  68.  
  69. struct d_interface_unique_state
  70. {
  71.         callsign_t PilotName;
  72. #if DXX_HAVE_POISON
  73.         d_interface_unique_state();
  74. #endif
  75.         void update_window_title();
  76. };
  77.  
  78. extern d_interface_unique_state InterfaceUniqueState;
  79.  
  80. struct d_game_view_unique_state
  81. {
  82.         uint8_t Death_sequence_aborted;
  83. };
  84.  
  85. extern d_game_view_unique_state GameViewUniqueState;
  86.  
  87. }
  88.  
  89. #ifdef dsx
  90. namespace dsx {
  91.  
  92. /**
  93.  **     Global variables
  94.  **/
  95.  
  96. extern int Quitting;
  97. extern int Screen_mode;                 // editor screen or game screen?
  98. #ifdef DXX_BUILD_DESCENT_I
  99. extern int MacHog;
  100. #endif
  101.  
  102. }
  103. #endif
  104.