Last modules fixes

This commit is contained in:
Jérôme Leclercq
2020-09-17 18:54:33 +02:00
parent 631aeb77a2
commit 98e20ecbb7
15 changed files with 95 additions and 163 deletions

View File

@@ -29,7 +29,7 @@ SCENARIO("Music", "[AUDIO][MUSIC]")
THEN("We can play it and get the time offset")
{
Nz::Audio::SetGlobalVolume(0.f);
Nz::Audio::Instance()->SetGlobalVolume(0.f);
music.Play();
std::this_thread::sleep_for(std::chrono::seconds(1));
@@ -42,7 +42,7 @@ SCENARIO("Music", "[AUDIO][MUSIC]")
music.SetPlayingOffset(3500);
REQUIRE(music.GetPlayingOffset() >= 3500);
Nz::Audio::SetGlobalVolume(100.f);
Nz::Audio::Instance()->SetGlobalVolume(100.f);
}
}
}

View File

@@ -24,7 +24,7 @@ SCENARIO("Sound", "[AUDIO][SOUND]")
THEN("We can play it and get the time offset")
{
Nz::Audio::SetGlobalVolume(0.f);
Nz::Audio::Instance()->SetGlobalVolume(0.f);
sound.Play();
std::this_thread::sleep_for(std::chrono::seconds(1));
@@ -37,7 +37,7 @@ SCENARIO("Sound", "[AUDIO][SOUND]")
sound.SetPlayingOffset(3500);
REQUIRE(sound.GetPlayingOffset() >= 3500);
Nz::Audio::SetGlobalVolume(100.f);
Nz::Audio::Instance()->SetGlobalVolume(100.f);
}
}
}

View File

@@ -25,8 +25,8 @@ SCENARIO("ListenerSystem", "[NDK][LISTENERSYSTEM]")
THEN("Our listener should have moved")
{
REQUIRE(Nz::Audio::GetListenerPosition() == position);
REQUIRE(Nz::Audio::GetListenerRotation() == rotation);
REQUIRE(Nz::Audio::Instance()->GetListenerPosition() == position);
REQUIRE(Nz::Audio::Instance()->GetListenerRotation() == rotation);
}
THEN("With a component of velocity")
@@ -36,8 +36,8 @@ SCENARIO("ListenerSystem", "[NDK][LISTENERSYSTEM]")
velocityComponent.linearVelocity = velocity;
world.Update(1.f);
REQUIRE(Nz::Audio::GetListenerVelocity() == velocity);
REQUIRE(Nz::Audio::Instance()->GetListenerVelocity() == velocity);
}
}
}
}
}

View File

@@ -1,16 +1,16 @@
#define CATCH_CONFIG_RUNNER
#include <Catch/catch.hpp>
#include <NazaraSDK/Application.hpp>
#include <Nazara/Core/AbstractLogger.hpp>
#include <Nazara/Core/Initializer.hpp>
#include <Nazara/Core/Log.hpp>
#include <Nazara/Network/Network.hpp>
#include <Nazara/Core/AbstractLogger.hpp>
#include <Nazara/Core/Modules.hpp>
#include <NazaraSDK/Application.hpp>
#include <NazaraSDK/Sdk.hpp>
int main(int argc, char* argv[])
{
Ndk::Application application(argc, argv);
Nz::Initializer<Nz::Network> modules;
Nz::Modules<Ndk::Sdk> nazaza;
Ndk::Application app(argc, argv);
Nz::Log::GetLogger()->EnableStdReplication(false);