Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
stenzek
GitHub Repository: stenzek/duckstation
Path: blob/master/src/core/core_private.h
7197 views
1
// SPDX-FileCopyrightText: 2019-2025 Connor McLaughlin <[email protected]>
2
// SPDX-License-Identifier: CC-BY-NC-ND-4.0
3
4
#pragma once
5
6
#include "core.h"
7
8
class Error;
9
10
namespace Core {
11
12
/// Based on the current configuration, determines what the data directory is.
13
bool SetCriticalFolders(const char* resources_subdir, Error* error);
14
15
#ifndef __ANDROID__
16
17
/// Returns the path to the configuration file.
18
/// We split this out so it can be retrieved by the host for error message purposes,
19
/// and so that regtest can override with no-config.
20
std::string GetBaseSettingsPath();
21
22
/// Loads the configuration file.
23
bool InitializeBaseSettingsLayer(std::string settings_path, Error* error);
24
25
/// Saves the configuration file.
26
bool SaveBaseSettingsLayer(Error* error);
27
28
/// Restores default settings.
29
void SetDefaultSettings(bool host, bool system, bool controller);
30
31
#else
32
33
/// Sets the base settings layer. Should be called by the host at initialization time.
34
void SetBaseSettingsLayer(SettingsInterface* sif);
35
36
#endif // __ANDROID__
37
38
/// Sets the game settings layer. Called by System when the game changes.
39
void SetGameSettingsLayer(SettingsInterface* sif, std::unique_lock<std::mutex>& lock);
40
41
/// Sets the input profile settings layer. Called by System when the game changes.
42
void SetInputSettingsLayer(SettingsInterface* sif, std::unique_lock<std::mutex>& lock);
43
44
} // namespace Core
45
46
namespace Host {
47
48
#ifndef __ANDROID__
49
50
/// Sets host-specific default settings.
51
void SetDefaultSettings(SettingsInterface& si);
52
53
/// Called when settings have been reset.
54
void OnSettingsResetToDefault(bool host, bool system, bool controller);
55
56
#endif // __ANDROID__
57
58
} // namespace Host
59
60