From 29bcf9fbae95b0b3af0ac219ee49bf27ad2acff4 Mon Sep 17 00:00:00 2001 From: cat Date: Thu, 4 Sep 2025 22:48:42 +0300 Subject: [PATCH] Replaced unique_ptr with Corrade::Containers::Pointer --- src/ChargeAudio.hpp | 5 +++-- src/Engine.cpp | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/ChargeAudio.hpp b/src/ChargeAudio.hpp index 4f9b33a..81ace3c 100644 --- a/src/ChargeAudio.hpp +++ b/src/ChargeAudio.hpp @@ -1,11 +1,12 @@ #ifndef CHARGE_AUDIO_BASE_H #define CHARGE_AUDIO_BASE_H +#include #include #include -#include #include namespace ChargeAudio { +using namespace Corrade; namespace { #include "miniaudio/miniaudio.h" } @@ -30,7 +31,7 @@ private: class Engine { public: Engine(); - std::unique_ptr CreateSound(std::string filepath); + Containers::Pointer CreateSound(std::string filepath); void SetVolume(float value); float GetVolume(); diff --git a/src/Engine.cpp b/src/Engine.cpp index 10b266e..5a7f5b2 100644 --- a/src/Engine.cpp +++ b/src/Engine.cpp @@ -1,4 +1,5 @@ #include "ChargeAudio.hpp" +#include #include #include @@ -16,8 +17,8 @@ Engine::Engine() { } } -std::unique_ptr Engine::CreateSound(std::string filepath) { - auto sound = std::unique_ptr(new Sound()); +Containers::Pointer Engine::CreateSound(std::string filepath) { + auto sound = Containers::Pointer(new Sound()); sound->baseEngine = this; maResponse = ma_sound_init_from_file(&maEngine, filepath.c_str(), 0, NULL,