From 386fac3ff6189ca9e3cb841d4d10a1b6a91febec Mon Sep 17 00:00:00 2001 From: iProgramInCpp Date: Sat, 5 Aug 2023 15:54:41 +0300 Subject: [PATCH] * Add platform definitions file thanks to @Vruk11 Fixes #13 --- platforms/PlatformDefinitions.hpp | 31 +++++++++++++++++++++++++ source/client/sound/SoundEngine.hpp | 13 +---------- windows_vs/minecraftcpp.vcxproj | 13 ++++++----- windows_vs/minecraftcpp.vcxproj.filters | 3 +++ 4 files changed, 42 insertions(+), 18 deletions(-) create mode 100644 platforms/PlatformDefinitions.hpp diff --git a/platforms/PlatformDefinitions.hpp b/platforms/PlatformDefinitions.hpp new file mode 100644 index 0000000..6eb3f0c --- /dev/null +++ b/platforms/PlatformDefinitions.hpp @@ -0,0 +1,31 @@ +/******************************************************************** + Minecraft: Pocket Edition - Decompilation Project + Copyright (C) 2023 iProgramInCpp + + The following code is licensed under the BSD 1 clause license. + SPDX-License-Identifier: BSD-1-Clause + ********************************************************************/ + +#pragma once + +// Sound Systems +#include "client/sound/SoundSystem.hpp" + +#if false + +// Add sound system overrides here + +#elif defined(_WIN32) + +// -- DirectSound based sound system for Windows +#include "windows/SoundSystemWindows.hpp" +#define SOUND_SYSTEM_TYPE SoundSystemWindows + +#else + +// -- Empty SoundSystem placeholder. +#define SOUND_SYSTEM_TYPE SoundSystem + +#endif + +// @TODO: SoundSystemSL - Use this for the Android port diff --git a/source/client/sound/SoundEngine.hpp b/source/client/sound/SoundEngine.hpp index 1eba58d..9bde204 100644 --- a/source/client/sound/SoundEngine.hpp +++ b/source/client/sound/SoundEngine.hpp @@ -13,18 +13,7 @@ #include "SoundSystem.hpp" #include "SoundRepository.hpp" -// Platform specific type for the sound system. - -#ifdef _WIN32 -#include "../../platforms/windows/SoundSystemWindows.hpp" -#define SOUND_SYSTEM_TYPE SoundSystemWindows -#else -#define SOUND_SYSTEM_TYPE SoundSystem -#endif - -//#define SOUND_SYSTEM_TYPE SoundSystemSL - -// @TODO: SoundSystemSL - Use this for the Android port +#include "platforms/PlatformDefinitions.hpp" class SoundEngine { diff --git a/windows_vs/minecraftcpp.vcxproj b/windows_vs/minecraftcpp.vcxproj index 357edbe..0128664 100644 --- a/windows_vs/minecraftcpp.vcxproj +++ b/windows_vs/minecraftcpp.vcxproj @@ -27,6 +27,7 @@ + @@ -762,7 +763,7 @@ true _USE_MATH_DEFINES;_WINSOCK_DEPRECATED_NO_WARNINGS;_CRT_SECURE_NO_WARNINGS;WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) true - false + true Precise false @@ -778,7 +779,7 @@ true _USE_MATH_DEFINES;_WINSOCK_DEPRECATED_NO_WARNINGS;_CRT_SECURE_NO_WARNINGS;WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) true - false + true Precise false @@ -796,7 +797,7 @@ true _USE_MATH_DEFINES;_WINSOCK_DEPRECATED_NO_WARNINGS;_CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) true - false + true Precise false @@ -814,7 +815,7 @@ true _USE_MATH_DEFINES;_WINSOCK_DEPRECATED_NO_WARNINGS;_CRT_SECURE_NO_WARNINGS;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) true - false + true Precise false @@ -830,7 +831,7 @@ true _USE_MATH_DEFINES;_WINSOCK_DEPRECATED_NO_WARNINGS;_CRT_SECURE_NO_WARNINGS;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) true - false + true Precise false @@ -848,7 +849,7 @@ true _USE_MATH_DEFINES;_WINSOCK_DEPRECATED_NO_WARNINGS;_CRT_SECURE_NO_WARNINGS;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) true - false + true Precise false diff --git a/windows_vs/minecraftcpp.vcxproj.filters b/windows_vs/minecraftcpp.vcxproj.filters index 13df6cb..8a2c1ce 100644 --- a/windows_vs/minecraftcpp.vcxproj.filters +++ b/windows_vs/minecraftcpp.vcxproj.filters @@ -981,6 +981,9 @@ source\platforms\windows + + source\platforms +