diff --git a/Adventures in Lestoria/Adventures in Lestoria.vcxproj b/Adventures in Lestoria/Adventures in Lestoria.vcxproj index 5cb5e240..428f4d2b 100644 --- a/Adventures in Lestoria/Adventures in Lestoria.vcxproj +++ b/Adventures in Lestoria/Adventures in Lestoria.vcxproj @@ -309,6 +309,10 @@ + + + + @@ -489,6 +493,10 @@ + + + + diff --git a/Adventures in Lestoria/AdventuresInLestoria.cpp b/Adventures in Lestoria/AdventuresInLestoria.cpp index 1db6ade3..0461e3bc 100644 --- a/Adventures in Lestoria/AdventuresInLestoria.cpp +++ b/Adventures in Lestoria/AdventuresInLestoria.cpp @@ -112,7 +112,7 @@ AiL::AiL() std::string GFX_CONFIG = CONFIG_PATH + "gfx_config"_S; utils::datafile::Read(DATA,GFX_CONFIG); WINDOW_SIZE={"WINDOW_SIZE"_i[0],"WINDOW_SIZE"_i[1]}; - + std::string MAP_CONFIG = CONFIG_PATH + "map_config"_S; utils::datafile::Read(DATA,MAP_CONFIG); @@ -144,7 +144,8 @@ AiL::AiL() DEBUG_PATHFINDING="debug_pathfinding"_I; - for(const std::string&cl:DATA.GetProperty("class_list").GetValues()){ + std::vectorvalues=DATA.GetProperty("class_list").GetValues(); + for(const std::string&cl:values){ std::cout<player; public: Pathfinding pathfinder; @@ -121,6 +123,7 @@ private: #ifndef __EMSCRIPTEN__ ::discord::Result SetupDiscord(); #endif + Audio audioEngine; public: AiL(); bool OnUserCreate() override; diff --git a/Adventures in Lestoria/Audio.cpp b/Adventures in Lestoria/Audio.cpp new file mode 100644 index 00000000..400a070c --- /dev/null +++ b/Adventures in Lestoria/Audio.cpp @@ -0,0 +1,46 @@ +#pragma region License +/* +License (OLC-3) +~~~~~~~~~~~~~~~ + +Copyright 2024 Joshua Sigona + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions or derivations of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + +2. Redistributions or derivative works in binary form must reproduce the above +copyright notice. This list of conditions and the following disclaimer must be +reproduced in the documentation and/or other materials provided with the distribution. + +3. Neither the name of the copyright holder nor the names of its contributors may +be used to endorse or promote products derived from this software without specific +prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY +EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT +SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED +TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR +BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +SUCH DAMAGE. + +Portions of this software are copyright © 2023 The FreeType +Project (www.freetype.org). Please see LICENSE_FT.txt for more information. +All rights reserved. +*/ +#pragma endregion +#include "Audio.h" +#include "AdventuresInLestoria.h" +#include "DEFINES.h" + +INCLUDE_game + +MiniAudio&Audio::Engine(){ + return game->audioEngine.audioEngine; +} \ No newline at end of file diff --git a/Adventures in Lestoria/Audio.h b/Adventures in Lestoria/Audio.h new file mode 100644 index 00000000..d5a9a2a3 --- /dev/null +++ b/Adventures in Lestoria/Audio.h @@ -0,0 +1,45 @@ +#pragma region License +/* +License (OLC-3) +~~~~~~~~~~~~~~~ + +Copyright 2024 Joshua Sigona + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions or derivations of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + +2. Redistributions or derivative works in binary form must reproduce the above +copyright notice. This list of conditions and the following disclaimer must be +reproduced in the documentation and/or other materials provided with the distribution. + +3. Neither the name of the copyright holder nor the names of its contributors may +be used to endorse or promote products derived from this software without specific +prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY +EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT +SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED +TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR +BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +SUCH DAMAGE. + +Portions of this software are copyright © 2023 The FreeType +Project (www.freetype.org). Please see LICENSE_FT.txt for more information. +All rights reserved. +*/ +#pragma endregion +#pragma once +#include "olcPGEX_MiniAudio.h" + +class Audio{ + MiniAudio audioEngine; +public: + static MiniAudio&Engine(); +}; \ No newline at end of file diff --git a/Adventures in Lestoria/State_OverworldMap.cpp b/Adventures in Lestoria/State_OverworldMap.cpp index 390f575e..f92ec5a7 100644 --- a/Adventures in Lestoria/State_OverworldMap.cpp +++ b/Adventures in Lestoria/State_OverworldMap.cpp @@ -105,6 +105,10 @@ void State_OverworldMap::OnUserUpdate(AiL*game){ Menu::OpenMenu(CRAFT_CONSUMABLE); } + if(game->GetKey(K1).bPressed){ + Audio::Engine().Play("sfx_directory"_S+"sfx100v2_loop_water_01.mp3"); + } + #pragma region Handle Connection Point Clicking and Movement for(ConnectionPoint&cp:connections){ if(game->GetMouse(Mouse::LEFT).bPressed&&geom2d::overlaps(game->GetWorldMousePos(),cp.rect)){ diff --git a/Adventures in Lestoria/Version.h b/Adventures in Lestoria/Version.h index 846fe3f2..b27ae199 100644 --- a/Adventures in Lestoria/Version.h +++ b/Adventures in Lestoria/Version.h @@ -39,7 +39,7 @@ All rights reserved. #define VERSION_MAJOR 0 #define VERSION_MINOR 2 #define VERSION_PATCH 1 -#define VERSION_BUILD 5339 +#define VERSION_BUILD 5350 #define stringify(a) stringify_(a) #define stringify_(a) #a diff --git a/Adventures in Lestoria/assets/config/configuration.txt b/Adventures in Lestoria/assets/config/configuration.txt index 158bbdcf..23ae32ad 100644 --- a/Adventures in Lestoria/assets/config/configuration.txt +++ b/Adventures in Lestoria/assets/config/configuration.txt @@ -59,6 +59,12 @@ item_img_directory = items/ # Path to story files story_directory = config/story/ +# Path to sound effect files +sfx_directory = assets/sounds/ + +# Path to bgm files +bgm_directory = assets/music/ + # Path to character images character_image_location = characters/ diff --git a/Adventures in Lestoria/assets/sounds/sfx100v2_loop_water_01.mp3 b/Adventures in Lestoria/assets/sounds/sfx100v2_loop_water_01.mp3 new file mode 100644 index 00000000..3f0bbfb7 Binary files /dev/null and b/Adventures in Lestoria/assets/sounds/sfx100v2_loop_water_01.mp3 differ diff --git a/Adventures in Lestoria/assets/title_icon_32.png b/Adventures in Lestoria/assets/title_icon_32.png new file mode 100644 index 00000000..8d932fb8 Binary files /dev/null and b/Adventures in Lestoria/assets/title_icon_32.png differ