Elaztek Developer Hub
Blamite Game Engine - blam!  00406.12.10.23.1457.blamite
The core library for the Blamite Game Engine.
config.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include <map>
4 #include <string>
5 #include <Windows.h>
6 
7 #include <Strings/components/settings/config/config.h>
8 
11 
12 #define CONFIG_VER "1"
13 #define CONFIG_COMMENT_DELIMETER "#"
14 #define CONFIG_DEFAULT_NAME "engine.cfg"
15 #define CONFIG_COLOR_NAME "console_colors.cfg"
16 
17 
20 #define ENGINE_CFG Blam::Settings::Config::GetEngineConfiguration()
21 
27 #define ENGINE_CFG_SECTION(section_name) Blam::Settings::Config::GetEngineConfiguration()->GetConfigurationSection(section_name)
28 
34 #define ENGINE_DATA_PATH(path) Blam::Settings::Paths::GetEngineDataPath(path)
35 
41 #define USER_DATA_PATH(path) Blam::Settings::Paths::GetUserDataPath(path)
42 
43 #ifndef BLAM
44 #define BLAM
45 #endif
46 
58 {
59  DataRoot,
60  Content,
61  Gallery,
62  Maps,
63  Fonts,
64  Tags,
65  Extensions,
66  Resources,
68  Plugins,
69 };
70 
85 {
86  DataRoot,
87  Tags,
88  Maps,
89  Mods,
90  Extensions,
91  Plugins,
92  Screenshots,
93  Reports,
94  LogArchives,
95  Cache
96 };
97 
101 namespace Blam::Settings
102 {
106  namespace Config
107  {
113  BLAM BlamResult LoadEngineConfiguration();
114 
122  BLAM BlamResult LoadConfiguration(std::string filename);
123 
132  BLAM BlamResult LoadConfiguration(std::string filename, std::string defaults_filename);
133 
140  BLAM BlamConfigurationFile* GetEngineConfiguration();
141 
151  BLAM BlamConfigurationFile* GetConfiguration(std::string filename);
152 
159 
168  BLAM bool IsConfigurationAvailable(std::string filename);
169 
176 
184  BLAM void ExpandFilePlaceholders(BlamConfigurationFile* file);
185 
191  BLAM std::map<std::string, BlamConfigurationFile*>* GetConfigurationFiles();
192  }
193 
197  namespace Paths
198  {
208 
217  BLAM std::string GetDefaultUserDataPath(BlamUserDataFolder folder);
218 
226  BLAM std::string GetEngineDataPath(BlamEngineDataFolder folder);
227 
235  BLAM std::string GetUserDataPath(BlamUserDataFolder folder);
236 
246 
256 
280  BLAM std::string ParseFolderPlaceholders(std::string string);
281  }
282 }
BlamUserDataFolder::Screenshots
@ Screenshots
Directory used to store engine screenshots. Defaults to {DataRoot}/screenshots/.
Blam::Settings::Config::GetEngineConfiguration
BLAM BlamConfigurationFile * GetEngineConfiguration()
Retrieves the main engine configuration file.
Definition: config.cpp:58
BlamUserDataFolder::Mods
@ Mods
Directory storing user-created mod packages. Defaults to {DataRoot}/mods/.
BlamContentSource::Cache
@ Cache
The engine will load all content from cache files.
Blam::Settings::Paths::GetUserDataFolderFromString
BLAM BlamUserDataFolder GetUserDataFolderFromString(std::string folder)
Attempts to convert a string to the equivalent user data folder.
Definition: paths.cpp:344
BlamUserDataFolder::Reports
@ Reports
Directory used to store the latest report (log) files. Defaults to {DataRoot}/reports/.
Blam::Settings::Paths::GetDefaultEngineDataPath
BLAM std::string GetDefaultEngineDataPath(BlamEngineDataFolder folder)
Retrieves a default value of a given engine data directory.
Definition: paths.cpp:138
Blam::Logger::LogEvent
BLAM void LogEvent(std::string message)
Logs a message to the log and/or console.
Definition: aliases.cpp:130
BlamEngineDataFolder::DataRoot
@ DataRoot
The root of all game engine data. Defaults to ./
CONFIG_COMMENT_DELIMETER
#define CONFIG_COMMENT_DELIMETER
The character that indicates a commented-out line.
Definition: config.h:13
logger.h
Blam::Settings::Config::IsConfigurationAvailable
BLAM bool IsConfigurationAvailable(std::string filename)
Checks whether or not a given configuration file is currently available.
Definition: config.cpp:94
USER_DATA_PATH
#define USER_DATA_PATH(path)
Macro to quickly access a user data folder.
Definition: config.h:41
Blam::Settings::Paths::GetEngineDataPath
BLAM std::string GetEngineDataPath(BlamEngineDataFolder folder)
Retrieves the configured value of a given engine directory.
Definition: paths.cpp:205
BlamEngineDataFolder::Fonts
@ Fonts
Directory used for game engine fonts. Defaults to ./maps/fonts/
BlamUserDataFolder::LogArchives
@ LogArchives
Directory used to store previous log archives. Defaults to {DataRoot}/logs/.
Blam::Settings::Config::GetConfiguration
BLAM BlamConfigurationFile * GetConfiguration(std::string filename)
Retrieves a configuration file from a file path.
Definition: config.cpp:70
BlamEngineDataFolder
BlamEngineDataFolder
Enumerator listing all possible engine data folders.
Definition: config.h:57
NULL
Add a fourth parameter to bake specific font ranges NULL
Definition: README.txt:57
Blam::Settings::Config::LoadConfiguration
BLAM BlamResult LoadConfiguration(std::string filename)
Loads a configuration file from a file path.
Definition: config.cpp:16
BLAM
#define BLAM
Definition: config.h:44
Blam::Settings::Paths::GetDefaultUserDataPath
BLAM std::string GetDefaultUserDataPath(BlamUserDataFolder folder)
Retrieves a default value of a given user data directory.
Definition: paths.cpp:64
errors.h
Blam::Settings::Config::ExpandFilePlaceholders
BLAM void ExpandFilePlaceholders(BlamConfigurationFile *file)
Expands placeholders within a specific configuration file.
Definition: placeholder_expand.cpp:143
BlamContentSource::Tags
@ Tags
The engine will load all content from tags.
BlamUserDataFolder
BlamUserDataFolder
Enumerator listing all possible user data folders.
Definition: config.h:84
ENGINE_DATA_PATH
#define ENGINE_DATA_PATH(path)
Macro to quickly access a game engine data folder.
Definition: config.h:34
resource.h
Blam::Settings::Paths::ParseFolderPlaceholders
BLAM std::string ParseFolderPlaceholders(std::string string)
Parses any engine/user data folder placeholders within a string.
Definition: paths.cpp:382
Blam::Settings::Config::ExpandAllPlaceholders
BLAM void ExpandAllPlaceholders()
Expands placeholders within all loaded configuration files.
Definition: config.cpp:106
Blam::Settings
Namespace containing functions used to access various game engine settings.
Definition: config.h:101
Blam::Settings::Config::GetConfigurationFiles
BLAM std::map< std::string, BlamConfigurationFile * > * GetConfigurationFiles()
Retrieves the map of all loaded configuration files.
Definition: config.cpp:116
BlamEngineDataFolder::Resources
@ Resources
Directory containing other resources and data, usually string tables and globals. Defaults to ....
globals.h
BlamEngineDataFolder::Extensions
@ Extensions
Directory used for engine extensions. Defaults to ./extensions/
BlamEngineDataFolder::Maps
@ Maps
Directory used for storing built-in cache files. Defaults to ./maps/
it
ARPHIC PUBLIC LICENSE Ltd Yung Chi Taiwan All rights reserved except as specified below Everyone is permitted to copy and distribute verbatim copies of this license but changing it is forbidden Preamble The licenses for most software are designed to take away your freedom to share and change it By the ARPHIC PUBLIC LICENSE specifically permits and encourages you to use this provided that you give the recipients all the rights that we gave you and make sure they can get the modifications of this software Legal Terms Font means the TrueType fonts AR PL Mingti2L AR PL KaitiM AR PL KaitiM and the derivatives of those fonts created through any modification including modifying reordering converting changing font or adding deleting some characters in from glyph table PL means Public License Copyright Holder means whoever is named in the copyright or copyrights for the Font You means the or person redistributing or modifying the Font Freely Available means that you have the freedom to copy or modify the Font as well as redistribute copies of the Font under the same conditions you not price If you you can charge for this service Copying &Distribution You may copy and distribute verbatim copies of this Font in any without provided that you retain this license including modifying reordering converting changing font or adding deleting some characters in from glyph and copy and distribute such modifications under the terms of Section provided that the following conditions are such as by offering access to copy the modifications from a designated or distributing the modifications on a medium customarily used for software interchange c If the modified fonts normally reads commands interactively when you must cause it
Definition: ARPHICPL.TXT:36
BlamEngineDataFolder::DefaultConfigs
@ DefaultConfigs
Directory containing default configuration files. Defaults to ./content/blam/default_configs/
file
sock planetquake com All rights reserved Quake III Arena is a registered trademark of id Inc This level may be electronically distributed only at NO CHARGE to the recipient in its current MUST include this txt file
Definition: chiropteraDM.txt:95
CONFIG_DEFAULT_NAME
#define CONFIG_DEFAULT_NAME
The filename of the default engine configuration.
Definition: config.h:14
Blam::Settings::Config::LoadEngineConfiguration
BLAM BlamResult LoadEngineConfiguration()
Loads the default game engine configuration (engine.cfg).
Definition: config.cpp:11
BlamEngineDataFolder::Plugins
@ Plugins
Directory used to store built-in plugin files for use with the Editing Kit. Defaults to ....
Blam::Settings::Paths::GetUserDataPath
BLAM std::string GetUserDataPath(BlamUserDataFolder folder)
Retrieves the configured value of a given user directory.
Definition: paths.cpp:275
config.h
BlamUserDataFolder::DataRoot
@ DataRoot
The root of all user data. Defaults to BlamStrings::Utils::IO::GetEngineDataRoot().
BlamEngineDataFolder::Gallery
@ Gallery
Directory containing general-purpose images. Defaults to ./content/Gallery/
BlamEngineDataFolder::Content
@ Content
Directory containing general-purpose resources. Defaults to ./content/
Blam::Settings::Config::IsEngineConfigurationAvailable
BLAM bool IsEngineConfigurationAvailable()
Checks whether or not the main engine configuration is currently available.
Definition: config.cpp:82
configuration_files
std::map< std::string, BlamConfigurationFile * > configuration_files
Definition: config.cpp:9
Blam::Settings::Paths::GetEngineDataFolderFromString
BLAM BlamEngineDataFolder GetEngineDataFolderFromString(std::string folder)
Attempts to convert a string to the equivalent engine data folder.
Definition: paths.cpp:363