World of Might and Magic  0.2.0
Open reimplementation of Might and Magic 6 7 8 game engine
EngineConfig.h
См. документацию.
1 #pragma once
2 
3 #include <string>
4 
6 
7 
8 #define GAME_FLAGS_1_01 0x01 // do not render terrain / bmodels(odm), lightmaps render bmodels in white(blv)
9 #define GAME_FLAGS_1_02 0x02 // only 0th lod, no lightning
10 #define GAME_FLAGS_1_04 0x04 // draw lightmaps / decals debug outlines
11 #define GAME_FLAGS_1_DRAW_BLV_DEBUGS 0x08 // draw portal debug outlines
12 #define GAME_FLAGS_1_40 0x40 //
13 #define GAME_FLAGS_1_FORCE_LEGACY_PROJECTION 0x80 // force camera / culling / projection mode : BLV
14 #define GAME_FLAGS_1_400 0x400 //
15 #define GAME_FLAGS_1_800 0x800 //
16 #define GAME_FLAGS_1_TORCHLIGHT 0x1000 // do Torchlight lightning
17 #define GAME_FLAGS_1_40000_sw_alter_palettes 0x40000 // software render alter palettes
18 #define GAME_FLAGS_1_HUGE_BLOODSPLATS 0x80000 // huge bloodsplats on bosses
19 
20 #define GAME_FLAGS_2_FORCE_REDRAW 0x01 // force redraw this frame
21 #define GAME_FLAGS_2_SATURATE_LIGHTMAPS 0x02 // alter lightmaps saturation
22 #define GAME_FLAGS_2_ALLOW_DYNAMIC_BRIGHTNESS 0x04 // allows dynamic brightness calculation on lightmaps
23 #define GAME_FLAGS_2_ALTER_GRAVITY 0x08 // underwater effect, no gravity (for out15.odm - Shoals)
24 #define GAME_FLAGS_2_TARGETING_MODE 0x10 // spell targeting, current cursor is "MICON2" (crosshair)
25 #define GAME_FLAGS_2_DRAW_BLOODSPLATS 0x20
26 
27 #define DEBUG_SETTINGS_RUN_IN_WIDOW 0x0001
28 #define DEBUG_SETTINGS_0002_SHOW_FR 0x0002
29 #define DEBUG_SETTINGS_NO_ACTORS 0x0004
30 #define DEBUG_SETTINGS_NO_DECORATIONS 0x0008
31 #define DEBUG_SETTINGS_NO_DAMAGE 0x0010
32 
33 namespace Engine_ {
34 
35 class EngineConfig {
36  public:
37  inline bool IsTargetingMode() const { return is_targeting; }
38  inline void SetTargetingMode(bool is_targeting) { this->is_targeting = is_targeting; }
39  inline bool IsUnderwater() const { return is_underwater; }
40  inline void SetUnderwater(bool is_underwater) { this->is_underwater = is_underwater; }
41 
42  inline bool NoVideo() const { return no_video; }
43  inline bool NoSound() const { return no_sound; }
44  inline bool NoMargareth() const { return no_margareth; }
45  inline bool NoShowDamage() const { return !show_damage; }
46  inline bool NoWalkSound() const { return no_walk_sound; }
47  inline bool NoBloodsplats() const { return no_bloodsplats; }
48  inline bool NoActors() const { return no_actors; }
49  inline bool NoDecorations() const { return no_decorations; }
50  inline bool NoDamage() const { return no_damage; }
51 
53  inline void ToggleAlwaysRun() { always_run = !always_run; }
57 
58  inline bool Flag1_1() const { return flags1 & GAME_FLAGS_1_01; }
59  inline bool Flag1_2() const { return flags1 & GAME_FLAGS_1_02; }
60  inline bool ForceLegacyProjection() const { return flags1 & GAME_FLAGS_1_FORCE_LEGACY_PROJECTION; }
61  inline bool NoHugeBloodsplats() const { return flags1 & GAME_FLAGS_1_HUGE_BLOODSPLATS; }
62  inline bool AlterPalettes() const { return flags1 & GAME_FLAGS_1_40000_sw_alter_palettes; }
63  inline bool DrawBlvDebugs() const { return flags1 & GAME_FLAGS_1_DRAW_BLV_DEBUGS; }
64  inline bool TorchlightEffect() const { return flags1 & GAME_FLAGS_1_TORCHLIGHT; }
65  inline bool CanSaturateFaces() const { return flags2 & GAME_FLAGS_2_SATURATE_LIGHTMAPS; }
66  void SetSaturateFaces(bool saturate);
67  inline bool ForceRedraw() const { return flags2 & GAME_FLAGS_2_FORCE_REDRAW; }
68  void SetForceRedraw(bool redraw);
69  inline bool AllowDynamicBrigtness() const { return flags2 & GAME_FLAGS_2_ALLOW_DYNAMIC_BRIGHTNESS; }
70  inline bool RunInWindow() const { return dword_6BE368_debug_settings_2 & DEBUG_SETTINGS_RUN_IN_WIDOW; }
71 
78  inline void ToggleDebugNoActors() { no_actors = !no_actors; }
80  inline void ToggleDebugSnow() { allow_snow = !allow_snow; }
81  inline void ToggleDebugNoDamage() { no_damage = !no_damage; }
84  inline void ToggleDebugShowFPS() { show_fps = !show_fps; }
86 
87  // DEBUG_SETTINGS_*
88  int dword_6BE368_debug_settings_2 = DEBUG_SETTINGS_RUN_IN_WIDOW;
89 
90  // GAME_FLAGS_1_*
91  int flags1 = GAME_FLAGS_1_40 | GAME_FLAGS_1_800;
92 
93  // GAME_FLAGS_2_*
94  int flags2 = GAME_FLAGS_2_ALLOW_DYNAMIC_BRIGHTNESS | GAME_FLAGS_2_DRAW_BLOODSPLATS | GAME_FLAGS_2_SATURATE_LIGHTMAPS;
95 
96  int turn_speed = 0; // discrete turn speed, 0 for smooth
97  float turn_speed_smooth = 1.0f;
98 
99  int sound_level = 4; // 0..9
100  int voice_level = 5; // 0..9
101  int music_level = 3; // 0..9
102 
103  int gamma = 4;
104  int max_flight_height = 4000;
105 
106  bool no_intro = false;
107  bool no_logo = false;
108 
109  bool no_sound = false;
110  bool no_video = false;
111  bool no_walk_sound = false;
112  bool no_margareth = false;
113  bool no_bloodsplats = false;
114  bool no_actors = false;
115  bool no_decorations = false;
116  bool no_damage = false;
117  bool seasons_change = true; // change sprites and tiles according to season
118  bool allow_lightmaps = true;
119  bool allow_snow = false;
120  bool extended_draw_distance = true; // 2.5x draw distance
121  bool show_fps = true;
122  bool show_picked_face = true; // red flash face pointed by mouse
123  bool debug_all_magic = false; // toggle all spellbook
124  bool debug_wizard_eye = false; // wizard eye always on
125  bool debug_portal_outlines = false; // draw portal frames
126  bool debug_turbo_speed = false; // party movement 12x
127  bool debug_lightmaps_decals = false; // debug lightmap and decals outlines
128  bool debug_terrain = false;
129  bool debug_town_portal = true;
130  bool debug_infinite_gold = true;
131  bool debug_infinite_food = true;
132 
133  bool always_run = true;
134  bool show_damage = true;
135  bool flip_on_exit = false;
136 
137  bool is_underwater = false;
138  bool is_targeting = false;
139 
140  std::string renderer_name = "DirectDraw";
141 };
142 
143 } // namespace Engine_
Engine_::EngineConfig::Flag1_1
bool Flag1_1() const
Definition: EngineConfig.h:58
Engine_::EngineConfig::NoVideo
bool NoVideo() const
Definition: EngineConfig.h:42
Engine_::EngineConfig
Definition: EngineConfig.h:35
Engine_::EngineConfig::voice_level
int voice_level
Definition: EngineConfig.h:100
Engine_
Definition: EngineConfig.h:33
Engine_::EngineConfig::ToggleDebugNoActors
void ToggleDebugNoActors()
Definition: EngineConfig.h:78
Engine_::EngineConfig::debug_lightmaps_decals
bool debug_lightmaps_decals
Definition: EngineConfig.h:127
Engine_::EngineConfig::debug_infinite_gold
bool debug_infinite_gold
Definition: EngineConfig.h:130
Engine_::EngineConfig::extended_draw_distance
bool extended_draw_distance
Definition: EngineConfig.h:120
Engine_::EngineConfig::show_damage
bool show_damage
Definition: EngineConfig.h:134
Engine_::EngineConfig::no_logo
bool no_logo
Definition: EngineConfig.h:107
Engine_::EngineConfig::NoWalkSound
bool NoWalkSound() const
Definition: EngineConfig.h:46
Engine_::EngineConfig::show_fps
bool show_fps
Definition: EngineConfig.h:121
Engine_::EngineConfig::debug_terrain
bool debug_terrain
Definition: EngineConfig.h:128
Engine_::EngineConfig::allow_lightmaps
bool allow_lightmaps
Definition: EngineConfig.h:118
Engine_::EngineConfig::music_level
int music_level
Definition: EngineConfig.h:101
Engine_::EngineConfig::ToggleDebugLightmap
void ToggleDebugLightmap()
Definition: EngineConfig.h:76
Engine_::EngineConfig::AlterPalettes
bool AlterPalettes() const
Definition: EngineConfig.h:62
Engine_::EngineConfig::NoHugeBloodsplats
bool NoHugeBloodsplats() const
Definition: EngineConfig.h:61
Engine_::EngineConfig::NoMargareth
bool NoMargareth() const
Definition: EngineConfig.h:44
Engine_::EngineConfig::seasons_change
bool seasons_change
Definition: EngineConfig.h:117
Engine_::EngineConfig::IsTargetingMode
bool IsTargetingMode() const
Definition: EngineConfig.h:37
Engine_::EngineConfig::always_run
bool always_run
Definition: EngineConfig.h:133
Engine_::EngineConfig::ToggleDebugPortalLines
void ToggleDebugPortalLines()
Definition: EngineConfig.h:82
Engine_::EngineConfig::ToggleDebugSnow
void ToggleDebugSnow()
Definition: EngineConfig.h:80
Engine_::EngineConfig::no_sound
bool no_sound
Definition: EngineConfig.h:109
Engine_::EngineConfig::is_underwater
bool is_underwater
Definition: EngineConfig.h:137
Engine_::EngineConfig::IsUnderwater
bool IsUnderwater() const
Definition: EngineConfig.h:39
Engine_::EngineConfig::SetSaturateFaces
void SetSaturateFaces(bool saturate)
Definition: EngineConfig.cpp:6
Engine_::EngineConfig::sound_level
int sound_level
Definition: EngineConfig.h:99
Engine_::EngineConfig::SetTargetingMode
void SetTargetingMode(bool is_targeting)
Definition: EngineConfig.h:38
Engine_::EngineConfig::ToggleAlwaysRun
void ToggleAlwaysRun()
Definition: EngineConfig.h:53
Engine_::EngineConfig::no_decorations
bool no_decorations
Definition: EngineConfig.h:115
Engine_::EngineConfig::ToggleDebugDrawDist
void ToggleDebugDrawDist()
Definition: EngineConfig.h:79
Engine_::EngineConfig::ToggleShowDamage
void ToggleShowDamage()
Definition: EngineConfig.h:52
Engine_::EngineConfig::no_margareth
bool no_margareth
Definition: EngineConfig.h:112
Engine_::EngineConfig::flags2
int flags2
Definition: EngineConfig.h:94
Engine_::EngineConfig::DrawBlvDebugs
bool DrawBlvDebugs() const
Definition: EngineConfig.h:63
Engine_::EngineConfig::ToggleDebugPickedFace
void ToggleDebugPickedFace()
Definition: EngineConfig.h:83
Engine_::EngineConfig::dword_6BE368_debug_settings_2
int dword_6BE368_debug_settings_2
Definition: EngineConfig.h:88
Engine_::EngineConfig::flags1
int flags1
Definition: EngineConfig.h:91
Engine_::EngineConfig::ToggleWalkSound
void ToggleWalkSound()
Definition: EngineConfig.h:55
Engine_::EngineConfig::ToggleDebugShowFPS
void ToggleDebugShowFPS()
Definition: EngineConfig.h:84
Engine_::EngineConfig::ToggleDebugTurboSpeed
void ToggleDebugTurboSpeed()
Definition: EngineConfig.h:77
Engine_::EngineConfig::ToggleDebugNoDamage
void ToggleDebugNoDamage()
Definition: EngineConfig.h:81
Engine_::EngineConfig::no_bloodsplats
bool no_bloodsplats
Definition: EngineConfig.h:113
Engine_::EngineConfig::gamma
int gamma
Definition: EngineConfig.h:103
Engine_::EngineConfig::no_intro
bool no_intro
Definition: EngineConfig.h:106
Engine_::EngineConfig::ToggleDebugTownPortal
void ToggleDebugTownPortal()
Definition: EngineConfig.h:72
Engine_::EngineConfig::debug_all_magic
bool debug_all_magic
Definition: EngineConfig.h:123
IRenderFactory.h
Engine_::EngineConfig::NoActors
bool NoActors() const
Definition: EngineConfig.h:48
Engine_::EngineConfig::NoDecorations
bool NoDecorations() const
Definition: EngineConfig.h:49
Engine_::EngineConfig::ToggleDebugTerrain
void ToggleDebugTerrain()
Definition: EngineConfig.h:75
Engine_::EngineConfig::SetUnderwater
void SetUnderwater(bool is_underwater)
Definition: EngineConfig.h:40
Engine_::EngineConfig::debug_turbo_speed
bool debug_turbo_speed
Definition: EngineConfig.h:126
Engine_::EngineConfig::no_video
bool no_video
Definition: EngineConfig.h:110
Engine_::EngineConfig::NoBloodsplats
bool NoBloodsplats() const
Definition: EngineConfig.h:47
Engine_::EngineConfig::NoShowDamage
bool NoShowDamage() const
Definition: EngineConfig.h:45
Engine_::EngineConfig::max_flight_height
int max_flight_height
Definition: EngineConfig.h:104
Engine_::EngineConfig::flip_on_exit
bool flip_on_exit
Definition: EngineConfig.h:135
Engine_::EngineConfig::renderer_name
std::string renderer_name
Definition: EngineConfig.h:140
Engine_::EngineConfig::turn_speed_smooth
float turn_speed_smooth
Definition: EngineConfig.h:97
Engine_::EngineConfig::ForceRedraw
bool ForceRedraw() const
Definition: EngineConfig.h:67
Engine_::EngineConfig::NoDamage
bool NoDamage() const
Definition: EngineConfig.h:50
Engine_::EngineConfig::Flag1_2
bool Flag1_2() const
Definition: EngineConfig.h:59
Engine_::EngineConfig::debug_infinite_food
bool debug_infinite_food
Definition: EngineConfig.h:131
Engine_::EngineConfig::is_targeting
bool is_targeting
Definition: EngineConfig.h:138
Engine_::EngineConfig::no_walk_sound
bool no_walk_sound
Definition: EngineConfig.h:111
Engine_::EngineConfig::AllowDynamicBrigtness
bool AllowDynamicBrigtness() const
Definition: EngineConfig.h:69
Engine_::EngineConfig::CanSaturateFaces
bool CanSaturateFaces() const
Definition: EngineConfig.h:65
Engine_::EngineConfig::TorchlightEffect
bool TorchlightEffect() const
Definition: EngineConfig.h:64
Engine_::EngineConfig::no_actors
bool no_actors
Definition: EngineConfig.h:114
Engine_::EngineConfig::ToggleBloodsplats
void ToggleBloodsplats()
Definition: EngineConfig.h:56
Engine_::EngineConfig::ToggleDebugSeasonsChange
void ToggleDebugSeasonsChange()
Definition: EngineConfig.h:85
Engine_::EngineConfig::NoSound
bool NoSound() const
Definition: EngineConfig.h:43
Engine_::EngineConfig::SetForceRedraw
void SetForceRedraw(bool redraw)
Definition: EngineConfig.cpp:13
Engine_::EngineConfig::debug_portal_outlines
bool debug_portal_outlines
Definition: EngineConfig.h:125
Engine_::EngineConfig::debug_town_portal
bool debug_town_portal
Definition: EngineConfig.h:129
Engine_::EngineConfig::no_damage
bool no_damage
Definition: EngineConfig.h:116
Engine_::EngineConfig::RunInWindow
bool RunInWindow() const
Definition: EngineConfig.h:70
string
GLsizei const GLchar *const * string
Definition: SDL_opengl_glext.h:691
Engine_::EngineConfig::debug_wizard_eye
bool debug_wizard_eye
Definition: EngineConfig.h:124
Engine_::EngineConfig::ForceLegacyProjection
bool ForceLegacyProjection() const
Definition: EngineConfig.h:60
Engine_::EngineConfig::ToggleDebugWizardEye
void ToggleDebugWizardEye()
Definition: EngineConfig.h:73
Engine_::EngineConfig::show_picked_face
bool show_picked_face
Definition: EngineConfig.h:122
Engine_::EngineConfig::turn_speed
int turn_speed
Definition: EngineConfig.h:96
Engine_::EngineConfig::ToggleDebugAllMagic
void ToggleDebugAllMagic()
Definition: EngineConfig.h:74
Engine_::EngineConfig::ToggleFlipOnExit
void ToggleFlipOnExit()
Definition: EngineConfig.h:54
Engine_::EngineConfig::allow_snow
bool allow_snow
Definition: EngineConfig.h:119