Scene changes and bug fixes #440

Merged
glencelow merged 5 commits from PlayerController into main 2023-03-25 02:44:16 +08:00
3 changed files with 25 additions and 2 deletions
Showing only changes of commit 33ba73c298 - Show all commits

View File

@ -147,7 +147,7 @@ namespace SHADE
//SHAssetManager::CompileAsset("../../Assets/Shaders/Anim_VS.glsl", false);
//SHAssetManager::CompileAsset("../../Assets/Shaders/Particle_VS.glsl", false);
//SHAssetManager::CompileAsset("../../Assets/Shaders/Particle_FS.glsl", false);
SHAssetManager::CompileAsset("../../Assets/Shaders/ParticleEmit_CS.glsl", false);
//SHAssetManager::CompileAsset("../../Assets/Shaders/ParticleEmit_CS.glsl", false);
//SHAssetManager::CompileAsset("../../Assets/Shaders/ParticleUpdate_CS.glsl", false);
// Load Built In Shaders
@ -574,6 +574,13 @@ namespace SHADE
ReceiverPtr compileAssetReceivePtr = std::dynamic_pointer_cast<SHEventReceiver>(compileAssetReceiever);
SHEventManager::SubscribeTo(SH_ASSET_COMPILE_EVENT, compileAssetReceivePtr);
std::shared_ptr<SHEventReceiverSpec<SHGraphicsSystem>> sceneExitPreEvent
{
std::make_shared<SHEventReceiverSpec<SHGraphicsSystem>>(this, &SHGraphicsSystem::ReceivePreSceneExitEvent)
};
ReceiverPtr sceneExitPreEventPtr = std::dynamic_pointer_cast<SHEventReceiver>(sceneExitPreEvent);
SHEventManager::SubscribeTo(SH_SCENE_EXIT_PRE, sceneExitPreEventPtr);
}
void SHGraphicsSystem::InitGenericDataAndTexturesDescSet(void) noexcept
@ -984,6 +991,14 @@ namespace SHADE
return eventPtr->handle;
}
SHEventHandle SHGraphicsSystem::ReceivePreSceneExitEvent(SHEventPtr eventPtr) noexcept
{
device->WaitIdle();
return eventPtr->handle;
}
SHEventHandle SHGraphicsSystem::ReceiveLightDeleteEvent(SHEventPtr eventPtr) noexcept
{
// we need to wait for the device to finish using the graph first

View File

@ -183,6 +183,7 @@ namespace SHADE
/* Light functions */
/*-----------------------------------------------------------------------*/
SHEventHandle ReceiveLightEnableShadowEvent (SHEventPtr eventPtr) noexcept;
SHEventHandle ReceivePreSceneExitEvent (SHEventPtr eventPtr) noexcept;
SHEventHandle ReceiveLightDeleteEvent (SHEventPtr eventPtr) noexcept;
/*-----------------------------------------------------------------------*/

View File

@ -1,5 +1,7 @@
#include "SHpch.h"
#include "SHParticleEmitterComponent.h"
#include "Graphics/Buffers/SHVkBuffer.h"
#include "Graphics/Descriptors/SHVkDescriptorSetGroup.h"
namespace SHADE
{
@ -12,7 +14,12 @@ namespace SHADE
void SHParticleEmitterComponent::OnDestroy(void)
{
emitterData.Free();
particleData.Free();
freelistData.Free();
indicesData.Free();
drawCallData.Free();
particleDescriptorSet.Free();
}
void SHParticleEmitterComponent::Emit(void) noexcept