Debian Codegraph @

common/main/config.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 * prototype definitions for descent.cfg reading/writing
23 *
24 */
25
26 #pragma once
27
28 #ifdef DXX_BUILD_DESCENT
29 #include "player-callsign.h"
30 #endif
31
32 #include "mission.h"
33 #include "pack.h"
34 #include "ntstring.h"
35 #include "d_array.h"
36
37 namespace dcx {
38
39 enum class opengl_texture_filter : uint8_t;
40 enum class music_type : uint8_t;
41 enum class song_number : unsigned;
42
43 // play-order definitions for custom music
44 /* These values are written to a file as integers, so they must not be
45 * renumbered.
46 */
47 enum class LevelMusicPlayOrder : uint8_t
48 {
49 Continuous,
50 Level,
51 Random,
52 };
53
54 struct CCfg : prohibit_void_ptr<CCfg>
55 {
56 uint16_t ResolutionX;
57 uint16_t ResolutionY;
58 uint8_t AspectX;
59 uint8_t AspectY;
60 #if DXX_USE_ADLMIDI
61 int ADLMIDI_num_chips{6};
62 /* See common/include/adlmidi_dynamic.h for the symbolic name and for other
63 * values.
64 */
65 int ADLMIDI_bank{31};
66 bool ADLMIDI_enabled;
67 #endif
68 bool VSync;
69 bool Grabinput;
70 bool WindowMode;
71 opengl_texture_filter TexFilt;
72 bool TexAnisotropy;
73 bool Multisample;
74 bool FPSIndicator;
75 uint8_t GammaLevel;
76 bool ReverseStereo;
77 bool OrigTrackOrder;
78 uint8_t DigiVolume;
79 uint8_t MusicVolume;
80 music_type MusicType;
81 LevelMusicPlayOrder CMLevelMusicPlayOrder;
82 std::array<int, 2> CMLevelMusicTrack;
83 ntstring<MISSION_NAME_LEN> LastMission;
84 ntstring<PATH_MAX - 1> CMLevelMusicPath;
85 enumerated_array<ntstring<PATH_MAX - 1>, 5, song_number> CMMiscMusic;
86 };
87
88 extern struct CCfg CGameCfg;
89 }
90
91 #ifdef DXX_BUILD_DESCENT
92 namespace dsx {
93 struct Cfg : prohibit_void_ptr<Cfg>
94 {
95 #if DXX_BUILD_DESCENT == 2
96 bool MovieSubtitles;
97 int MovieTexFilt;
98 #endif
99 callsign_t LastPlayer;
100 };
101 extern struct Cfg GameCfg;
102
103 //#ifdef USE_SDLMIXER
104 //#define EXT_MUSIC_ON (GameCfg.SndEnableRedbook || GameCfg.JukeboxOn)
105 //#else
106 //#define EXT_MUSIC_ON (GameCfg.SndEnableRedbook) // JukeboxOn shouldn't do anything if it's not supported
107 //#endif
108
109 void ReadConfigFile(CCfg &, Cfg &);
110 int WriteConfigFile(const CCfg &, const Cfg &);
111 }
112 #endif