Skip to content

Commit

Permalink
BLUGA: Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
guillaumeAbel committed Nov 3, 2023
1 parent f05973b commit 8f0fcee
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,13 @@ namespace Raylib {
SetMasterVolume(volume);
}

std::unique_ptr<Sound> Sound::fromFile(const std::string& fileName, float volume)
std::shared_ptr<Sound> Sound::fromFile(const std::string& fileName, float volume)
{
return std::make_unique<SoundImpl>(fileName, volume);
return std::make_shared<SoundImpl>(fileName, volume);
}

std::unique_ptr<Music> Music::fromFile(const std::string& fileName, float volume)
std::shared_ptr<Music> Music::fromFile(const std::string& fileName, float volume)
{
return std::make_unique<MusicImpl>(fileName, volume);
return std::make_shared<MusicImpl>(fileName, volume);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ namespace Raylib {
// Sounds
class Sound {
public:
static std::unique_ptr<Sound> fromFile(const std::string &fileName, float volume);
static std::shared_ptr<Sound> fromFile(const std::string &fileName, float volume);

virtual ~Sound() = default;

Expand Down Expand Up @@ -56,7 +56,7 @@ namespace Raylib {

class Music {
public:
static std::unique_ptr<Music> fromFile(const std::string &fileName, float volume);
static std::shared_ptr<Music> fromFile(const std::string &fileName, float volume);

virtual ~Music() = default;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ namespace Raylib {
MOUSE_BTN_EXTRA ,
MOUSE_BTN_FORWARD ,
MOUSE_BTN_BACK ,
MOUSE_
MOUSE_MAX_MAX ,
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -284,14 +284,14 @@ namespace Raylib {
return std::make_unique<RayImageImpl>(width, height, color);
}

std::unique_ptr<Sprite> Sprite::fromFile(const std::string &fileName, float width, float height, std::size_t id)
std::shared_ptr<Sprite> Sprite::fromFile(const std::string &fileName, float width, float height, std::size_t id)
{
return std::make_unique<SpriteImpl>(fileName, width, height, id);
return std::make_shared<SpriteImpl>(fileName, width, height, id);
}

std::unique_ptr<Sprite> Sprite::fromRayImage(std::unique_ptr<RayImage> image, float width, float height)
std::shared_ptr<Sprite> Sprite::fromRayImage(std::unique_ptr<RayImage> image, float width, float height)
{
return std::make_unique<SpriteImpl>(std::move(image), width, height);
return std::make_shared<SpriteImpl>(std::move(image), width, height);
}

void Window::initWindow(int width, int height, const std::string &title)
Expand Down Expand Up @@ -458,9 +458,9 @@ namespace Raylib {
return MeasureText(text.c_str(), fontSize);
}

std::unique_ptr<Text> Text::fromText(const std::string &text, Vector2 position, float fontSize, Color color)
std::shared_ptr<Text> Text::fromText(const std::string &text, Vector2 position, float fontSize, Color color)
{
return std::make_unique<TextImpl>(text, position, fontSize, color);
return std::make_shared<TextImpl>(text, position, fontSize, color);
}

TextureManager &TextureManager::getInstance()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -186,8 +186,8 @@ namespace Raylib {

class Sprite {
public:
static std::unique_ptr<Sprite> fromFile(const std::string &fileName, float width, float height, std::size_t id = 0);
static std::unique_ptr<Sprite> fromRayImage(std::unique_ptr<RayImage> image, float width, float height);
static std::shared_ptr<Sprite> fromFile(const std::string &fileName, float width, float height, std::size_t id = 0);
static std::shared_ptr<Sprite> fromRayImage(std::unique_ptr<RayImage> image, float width, float height);

virtual ~Sprite() = default;

Expand Down Expand Up @@ -287,7 +287,7 @@ namespace Raylib {

static int measureText(const std::string text, int fontSize);

static std::unique_ptr<Text> fromText(const std::string &text, Vector2 position = Vector2(0, 0), float fontSize = 5.0F, Color color = Raylib::Black);
static std::shared_ptr<Text> fromText(const std::string &text, Vector2 position = Vector2(0, 0), float fontSize = 5.0F, Color color = Raylib::Black);

virtual ~Text() = default;

Expand Down

0 comments on commit 8f0fcee

Please sign in to comment.