-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
17 changed files
with
209 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
<Root> | ||
<Object class="TextureResourceMeta"> | ||
<Property type="String" name="m_name" flags="NotVisible" value="Billboard_Empty.png.meta"/> | ||
<Property type="Bool" name="m_importSettings.m_overridePixelFormat" flags="NotVisible" value="false"/> | ||
<Property type="EnumU8" name="m_importSettings.m_pixelFormat" flags="Optional" value="R8G8B8A8_unorm_sRGB"/> | ||
<Property type="Bool" name="m_importSettings.m_overrideDownscale" flags="NotVisible" value="false"/> | ||
<Property type="EnumU8" name="m_importSettings.m_downscale" flags="Optional" value="None"/> | ||
<Property type="EnumU8" name="m_importSettings.m_importerFormat" value="Automatic"/> | ||
<Property type="Bool" name="m_importSettings.m_sRGB" value="false"/> | ||
<Property type="EnumU8" name="m_importSettings.m_mipLevelCount" value="Automatic"/> | ||
<Property type="EnumU8" name="m_importSettings.m_downscale" value="None"/> | ||
</Object> | ||
</Root> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,4 +6,12 @@ namespace vg::audio | |
{ | ||
|
||
}; | ||
|
||
vg_enum_class(AudioSourceType, core::u8, | ||
None, | ||
Wav, | ||
Ogg, | ||
Mp3, | ||
Flac | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#pragma once | ||
#include "core/Instance/Instance.h" | ||
|
||
namespace vg::audio | ||
{ | ||
class ISoundInstance : public core::Instance | ||
{ | ||
public: | ||
VG_CLASS_DECL_ABSTRACT(ISoundInstance, core::Instance); | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
#include "audio/Precomp.h" | ||
#include "SoundInstance.h" | ||
|
||
using namespace vg::core; | ||
|
||
namespace vg::audio | ||
{ | ||
//-------------------------------------------------------------------------------------- | ||
VG_REGISTER_OBJECT_CLASS(SoundInstance, "Sound instance"); | ||
|
||
//-------------------------------------------------------------------------------------- | ||
bool SoundInstance::registerProperties(IClassDesc & _desc) | ||
{ | ||
super::registerProperties(_desc); | ||
|
||
return true; | ||
} | ||
|
||
//-------------------------------------------------------------------------------------- | ||
SoundInstance::SoundInstance(const string & _name, IObject * _parent) : | ||
super(_name, _parent) | ||
{ | ||
|
||
} | ||
|
||
//-------------------------------------------------------------------------------------- | ||
SoundInstance::~SoundInstance() | ||
{ | ||
VG_SAFE_DELETE(m_slAudioSource); | ||
} | ||
|
||
//-------------------------------------------------------------------------------------- | ||
bool SoundInstance::TryGetAABB(AABB & _aabb) const | ||
{ | ||
return false; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#pragma once | ||
#include "audio/ISoundInstance.h" | ||
#include "audio/Audio_Consts.h" | ||
|
||
namespace vg::audio | ||
{ | ||
class SoundInstance final : public ISoundInstance | ||
{ | ||
public: | ||
VG_CLASS_DECL(SoundInstance, ISoundInstance); | ||
|
||
SoundInstance(const core::string & _name, core::IObject * _parent); | ||
~SoundInstance(); | ||
|
||
bool TryGetAABB(core::AABB & _aabb) const; | ||
|
||
private: | ||
AudioSourceType m_audioSourceType = AudioSourceType::None; | ||
SoLoud::AudioSource * m_slAudioSource = nullptr; | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#include "engine/Precomp.h" | ||
|
||
#include "Sound/SoundComponent.hpp" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#pragma once | ||
|
||
#include "engine/ISoundComponent.h" | ||
|
||
namespace audio | ||
{ | ||
class ISoundInstance; | ||
} | ||
|
||
namespace vg::engine | ||
{ | ||
class SoundComponent final : public ISoundComponent | ||
{ | ||
public: | ||
VG_CLASS_DECL(SoundComponent, ISoundComponent); | ||
|
||
SoundComponent(const core::string & _name, IObject * _parent); | ||
~SoundComponent(); | ||
|
||
private: | ||
core::string m_path; | ||
audio::ISoundInstance * m_soundInstance = nullptr; | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
#include "SoundComponent.h" | ||
#include "editor/Editor_Consts.h" | ||
#include "core/Object/Update.h" | ||
|
||
using namespace vg::core; | ||
|
||
namespace vg::engine | ||
{ | ||
VG_REGISTER_COMPONENT_CLASS(SoundComponent, "Sound", "Audio", "Audio sound component", editor::style::icon::Sound, 0); | ||
|
||
//-------------------------------------------------------------------------------------- | ||
bool SoundComponent::registerProperties(core::IClassDesc & _desc) | ||
{ | ||
super::registerProperties(_desc); | ||
|
||
registerProperty(SoundComponent, m_path, "Path"); | ||
|
||
return true; | ||
} | ||
|
||
//-------------------------------------------------------------------------------------- | ||
SoundComponent::SoundComponent(const core::string & _name, IObject * _parent) : | ||
super(_name, _parent) | ||
{ | ||
SetUpdateFlags(UpdateFlags::FixedUpdate | UpdateFlags::Update | UpdateFlags::LateUpdate, false); | ||
} | ||
|
||
//-------------------------------------------------------------------------------------- | ||
SoundComponent::~SoundComponent() | ||
{ | ||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
#pragma once | ||
|
||
#include "core/Component/Component.h" | ||
|
||
namespace vg::engine | ||
{ | ||
class ISoundComponent : public core::Component | ||
{ | ||
public: | ||
VG_CLASS_DECL_ABSTRACT(ISoundComponent, core::Component); | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters