r-type  0.0.0
R-Type main
Loading...
Searching...
No Matches
Common.hpp
Go to the documentation of this file.
1///
2/// @file Common.hpp
3/// @brief This file contains common definitions and constants
4/// @namespace cli
5///
6
7#pragma once
8#include <filesystem>
9
10#ifdef _WIN32
11#define PLUGINS_EXTENSION ".dll"
12#elif __linux__
13#define PLUGINS_EXTENSION ".so"
14#elif __APPLE__
15#define PLUGINS_EXTENSION ".dylib"
16#endif
17
18namespace cli
19{
20 namespace Config
21 {
22 namespace Audio
23 {
24 inline constexpr auto DEFAULT_AUDIO_VOLUME = 50; // unused
25 inline constexpr auto DEFAULT_AUDIO_MUTED = false; // unused
26 } // namespace Audio
27 namespace Network
28 {
29 inline constexpr auto DEFAULT_NETWORK_HOST = "127.0.0.1";
30 inline constexpr auto DEFAULT_NETWORK_PORT = 2560;
31 } // namespace Network
32 namespace Window
33 {
34 inline constexpr auto DEFAULT_WINDOW_WIDTH = 960;
35 inline constexpr auto DEFAULT_WINDOW_HEIGHT = 540;
36 inline constexpr auto DEFAULT_WINDOW_FRAME_LIMIT = 240;
37 inline constexpr auto DEFAULT_WINDOW_FULLSCREEN = false;
38 } // namespace Window
39 } // namespace Config
40 namespace Path
41 {
42 namespace Audio
43 {
44 inline constexpr auto AUDIO_TITLE = "assets/audio/title.mp3";
45 inline constexpr auto AUDIO_COIN = "assets/audio/coin.mp3";
46 inline constexpr auto AUDIO_BATTLE_THEME = "assets/audio/battle_theme.mp3";
47 } // namespace Audio
48 namespace Font
49 {
50 inline constexpr auto FONTS_RTYPE = "assets/fonts/r-type.otf";
51 } // namespace Font
52 namespace Plugin
53 { // TODO(bobis33): dont use filesystem here
54 inline auto PLUGIN_AUDIO_SFML =
55 std::filesystem::path(PLUGINS_DIR) / ("audio_sfml" + std::string(PLUGINS_EXTENSION));
57 std::filesystem::path(PLUGINS_DIR) / ("network_asio_client" + std::string(PLUGINS_EXTENSION));
59 std::filesystem::path(PLUGINS_DIR) / ("renderer_sfml" + std::string(PLUGINS_EXTENSION));
60 } // namespace Plugin
61 namespace Texture
62 {
63 inline constexpr auto TEXTURE_PLAYER = "assets/sprites/r-typesheet42.gif";
64 inline constexpr auto TEXTURE_SHOOT = "assets/sprites/shoot.gif";
65 inline constexpr auto TEXTURE_SHOOT_CHARGED = "assets/sprites/shootcharged.gif";
66 inline constexpr auto TEXTURE_SHOOT_LOADING = "assets/sprites/shootchargedloading.gif";
67 inline constexpr auto TEXTURE_ENEMY_EASY = "assets/sprites/r-typesheet5.gif";
68 inline constexpr auto TEXTURE_ASTEROID = "assets/sprites/r-typesheet3.gif";
69 inline constexpr auto TEXTURE_EXPLOSION = "assets/sprites/r-typesheet44.gif";
70 } // namespace Texture
71 } // namespace Path
72} // namespace cli
#define PLUGINS_EXTENSION
constexpr auto DEFAULT_AUDIO_MUTED
Definition Common.hpp:25
constexpr auto DEFAULT_AUDIO_VOLUME
Definition Common.hpp:24
constexpr auto DEFAULT_NETWORK_PORT
Definition Common.hpp:30
constexpr auto DEFAULT_NETWORK_HOST
Definition Common.hpp:29
constexpr auto DEFAULT_WINDOW_HEIGHT
Definition Common.hpp:35
constexpr auto DEFAULT_WINDOW_FRAME_LIMIT
Definition Common.hpp:36
constexpr auto DEFAULT_WINDOW_WIDTH
Definition Common.hpp:34
constexpr auto DEFAULT_WINDOW_FULLSCREEN
Definition Common.hpp:37
constexpr auto AUDIO_TITLE
Definition Common.hpp:44
constexpr auto AUDIO_COIN
Definition Common.hpp:45
constexpr auto AUDIO_BATTLE_THEME
Definition Common.hpp:46
constexpr auto FONTS_RTYPE
Definition Common.hpp:50
auto PLUGIN_AUDIO_SFML
Definition Common.hpp:54
auto PLUGIN_RENDERER_SFML
Definition Common.hpp:58
auto PLUGIN_NETWORK_ASIO_CLIENT
Definition Common.hpp:56
constexpr auto TEXTURE_SHOOT_CHARGED
Definition Common.hpp:65
constexpr auto TEXTURE_SHOOT_LOADING
Definition Common.hpp:66
constexpr auto TEXTURE_ASTEROID
Definition Common.hpp:68
constexpr auto TEXTURE_SHOOT
Definition Common.hpp:64
constexpr auto TEXTURE_ENEMY_EASY
Definition Common.hpp:67
constexpr auto TEXTURE_EXPLOSION
Definition Common.hpp:69
constexpr auto TEXTURE_PLAYER
Definition Common.hpp:63