diff --git a/include/Nazara/Utility/Cursor.hpp b/include/Nazara/Utility/Cursor.hpp index b45fc6a1b..af2a160e1 100644 --- a/include/Nazara/Utility/Cursor.hpp +++ b/include/Nazara/Utility/Cursor.hpp @@ -10,29 +10,33 @@ #include #include #include +#include namespace Nz { class CursorImpl; - class Image; class NAZARA_UTILITY_API Cursor { friend class WindowImpl; public: - Cursor(); - ~Cursor(); + inline Cursor(); + inline ~Cursor(); bool Create(const Image& cursor, int hotSpotX = 0, int hotSpotY = 0); bool Create(const Image& cursor, const Vector2i& hotSpot); void Destroy(); - bool IsValid() const; + inline const Image& GetImage() const; + inline bool IsValid() const; private: + Image m_cursorImage; CursorImpl* m_impl; }; } +#include + #endif // NAZARA_CURSOR_HPP diff --git a/include/Nazara/Utility/Cursor.inl b/include/Nazara/Utility/Cursor.inl new file mode 100644 index 000000000..3073f297e --- /dev/null +++ b/include/Nazara/Utility/Cursor.inl @@ -0,0 +1,31 @@ +// Copyright (C) 2015 Jérôme Leclercq +// This file is part of the "Nazara Engine - Utility module" +// For conditions of distribution and use, see copyright notice in Config.hpp + +#include +#include + +namespace Nz +{ + inline Cursor::Cursor() : + m_impl(nullptr) + { + } + + inline Cursor::~Cursor() + { + Destroy(); + } + + inline const Image& Cursor::GetImage() const + { + return m_cursorImage; + } + + inline bool Cursor::IsValid() const + { + return m_impl != nullptr; + } +} + +#include diff --git a/src/Nazara/Utility/Cursor.cpp b/src/Nazara/Utility/Cursor.cpp index deddbc753..9dafd36bc 100644 --- a/src/Nazara/Utility/Cursor.cpp +++ b/src/Nazara/Utility/Cursor.cpp @@ -16,16 +16,6 @@ namespace Nz { - Cursor::Cursor() : - m_impl(nullptr) - { - } - - Cursor::~Cursor() - { - Destroy(); - } - bool Cursor::Create(const Image& cursor, int hotSpotX, int hotSpotY) { Destroy(); @@ -40,6 +30,8 @@ namespace Nz return false; } + m_cursorImage = cursor; + return true; } @@ -58,9 +50,4 @@ namespace Nz m_impl = nullptr; } } - - bool Cursor::IsValid() const - { - return m_impl != nullptr; - } }