Debian Codegraph @

common/main/automap.h

raw
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 * Prototypes for auto-map stuff.
23 *
24 */
25
26 #pragma once
27
28 #include "pstypes.h"
29
30 #include <cstddef>
31 #include "fwd-segment.h"
32 #include "dxxsconf.h"
33 #include "dsx-ns.h"
34 #include <array>
35
36 namespace dcx {
37 extern uint8_t Automap_active;
38 }
39 #ifdef DXX_BUILD_DESCENT
40 namespace dsx {
41 void do_automap();
42 void automap_clear_visited(d_level_unique_automap_state &LevelUniqueAutomapState);
43 }
44
45 #if DXX_BUILD_DESCENT == 2
46 #include "object.h"
47 #include "ntstring.h"
48 #include "d_array.h"
49 #include "d_range.h"
50 #include "fwd-event.h"
51 #include "fwd-game.h"
52 #include "segment.h"
53
54 namespace dsx {
55 void DropBuddyMarker(object &objp);
56 void InitMarkerInput();
57 window_event_result MarkerInputMessage(int key, control_info &Controls);
58
59 constexpr std::integral_constant<std::size_t, 16> NUM_MARKERS{};
60 constexpr std::integral_constant<std::size_t, 40> MARKER_MESSAGE_LEN{};
61 struct marker_message_text_t : ntstring<MARKER_MESSAGE_LEN - 1>
62 {
63 constexpr marker_message_text_t() :
64 ntstring{}
65 {
66 }
67 };
68
69 struct d_marker_object_numbers
70 {
71 enumerated_array<imobjidx_t, NUM_MARKERS, game_marker_index> imobjidx = {init_object_number_array<imobjidx_t>(std::make_index_sequence<NUM_MARKERS>())};
72 };
73
74 struct d_marker_state : d_marker_object_numbers
75 {
76 player_marker_index MarkerBeingDefined = player_marker_index::None;
77 game_marker_index HighlightMarker = game_marker_index::None;
78 player_marker_index LastMarkerDropped = player_marker_index::None;
79 enumerated_array<marker_message_text_t, NUM_MARKERS, game_marker_index> message;
80 bool DefiningMarkerMessage() const
81 {
82 return MarkerBeingDefined != player_marker_index::None;
83 }
84 static unsigned get_markers_per_player(game_mode_flags game_mode, unsigned netgame_max_players);
85 };
86
87 game_marker_index convert_player_marker_index_to_game_marker_index(game_mode_flags game_mode, unsigned max_numplayers, unsigned player_num, player_marker_index base_marker_num);
88 xrange<player_marker_index> get_player_marker_range(unsigned maxdrop);
89 extern marker_message_text_t Marker_input;
90 extern d_marker_state MarkerState;
91 }
92 #endif
93 #endif