Add more profiler events

This commit is contained in:
Wojtek Figat
2025-07-28 15:15:09 +02:00
parent 354eaac56c
commit a7ffd9e57f
3 changed files with 6 additions and 2 deletions

View File

@@ -120,6 +120,7 @@ void AudioSource::Play()
auto state = _state;
if (state == States::Playing)
return;
PROFILE_CPU();
if (Clip == nullptr || Clip->WaitForLoaded())
{
LOG(Warning, "Cannot play audio source without a clip ({0})", GetNamePath());
@@ -188,6 +189,7 @@ void AudioSource::Stop()
{
if (_state == States::Stopped)
return;
PROFILE_CPU();
_state = States::Stopped;
_isActuallyPlayingSth = false;
@@ -386,6 +388,7 @@ bool AudioSource::IntersectsItself(const Ray& ray, Real& distance, Vector3& norm
void AudioSource::Update()
{
PROFILE_CPU();
PROFILE_MEM(Audio);
// Update the velocity
const Vector3 pos = GetPosition();

View File

@@ -19,6 +19,7 @@
void AssetsCache::Init()
{
PROFILE_CPU();
Entry e;
int32 count;
Stopwatch stopwatch;

View File

@@ -206,12 +206,12 @@ bool ScriptingService::Init()
// Load assemblies
if (Scripting::Load())
{
LOG(Fatal, "Scripting Engine initialization failed.");
LOG(Fatal, "Scripting initialization failed.");
return true;
}
stopwatch.Stop();
LOG(Info, "Scripting Engine initializated! (time: {0}ms)", stopwatch.GetMilliseconds());
LOG(Info, "Scripting initializated! (time: {0}ms)", stopwatch.GetMilliseconds());
return false;
}