Fixed vector expansion memory ref bug when loading configuration files. Add in Audio Engine class skeleton.
This commit is contained in:
parent
1e3a2ecabb
commit
9d3be5395c
@ -309,6 +309,10 @@
|
||||
<SubType>
|
||||
</SubType>
|
||||
</ClInclude>
|
||||
<ClInclude Include="Audio.h">
|
||||
<SubType>
|
||||
</SubType>
|
||||
</ClInclude>
|
||||
<ClInclude Include="BitwiseEnum.h">
|
||||
<SubType>
|
||||
</SubType>
|
||||
@ -489,6 +493,10 @@
|
||||
<SubType>
|
||||
</SubType>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Audio.cpp">
|
||||
<SubType>
|
||||
</SubType>
|
||||
</ClCompile>
|
||||
<ClCompile Include="BlacksmithCraftingWindow.cpp">
|
||||
<SubType>
|
||||
</SubType>
|
||||
|
@ -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::vector<std::string>values=DATA.GetProperty("class_list").GetValues();
|
||||
for(const std::string&cl:values){
|
||||
std::cout<<cl<<std::endl;
|
||||
utils::datafile::Read(DATA,CONFIG_PATH + "class_directory"_S + cl + ".txt");
|
||||
}
|
||||
|
@ -53,6 +53,7 @@ All rights reserved.
|
||||
#ifndef __EMSCRIPTEN__
|
||||
#include "discord.h"
|
||||
#endif
|
||||
#include "Audio.h"
|
||||
|
||||
class AiL : public olc::PixelGameEngine
|
||||
{
|
||||
@ -60,6 +61,7 @@ class AiL : public olc::PixelGameEngine
|
||||
friend class State_GameRun;
|
||||
friend class SaveFile;
|
||||
friend class sig::Animation;
|
||||
friend class Audio;
|
||||
std::unique_ptr<Player>player;
|
||||
public:
|
||||
Pathfinding pathfinder;
|
||||
@ -121,6 +123,7 @@ private:
|
||||
#ifndef __EMSCRIPTEN__
|
||||
::discord::Result SetupDiscord();
|
||||
#endif
|
||||
Audio audioEngine;
|
||||
public:
|
||||
AiL();
|
||||
bool OnUserCreate() override;
|
||||
|
46
Adventures in Lestoria/Audio.cpp
Normal file
46
Adventures in Lestoria/Audio.cpp
Normal file
@ -0,0 +1,46 @@
|
||||
#pragma region License
|
||||
/*
|
||||
License (OLC-3)
|
||||
~~~~~~~~~~~~~~~
|
||||
|
||||
Copyright 2024 Joshua Sigona <sigonasr2@gmail.com>
|
||||
|
||||
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;
|
||||
}
|
45
Adventures in Lestoria/Audio.h
Normal file
45
Adventures in Lestoria/Audio.h
Normal file
@ -0,0 +1,45 @@
|
||||
#pragma region License
|
||||
/*
|
||||
License (OLC-3)
|
||||
~~~~~~~~~~~~~~~
|
||||
|
||||
Copyright 2024 Joshua Sigona <sigonasr2@gmail.com>
|
||||
|
||||
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();
|
||||
};
|
@ -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)){
|
||||
|
@ -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
|
||||
|
@ -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/
|
||||
|
||||
|
BIN
Adventures in Lestoria/assets/sounds/sfx100v2_loop_water_01.mp3
Normal file
BIN
Adventures in Lestoria/assets/sounds/sfx100v2_loop_water_01.mp3
Normal file
Binary file not shown.
BIN
Adventures in Lestoria/assets/title_icon_32.png
Normal file
BIN
Adventures in Lestoria/assets/title_icon_32.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.4 KiB |
Loading…
x
Reference in New Issue
Block a user