Fixes
This commit is contained in:
@ -24,9 +24,9 @@
|
||||
#include <IAEngine/Components/CameraComponent.hpp>
|
||||
#include <IAEngine/Components/SoundEmitterComponent.hpp>
|
||||
|
||||
#include <IAEngine/Scene.hpp>
|
||||
#include <IAEngine/UI.hpp>
|
||||
#include <IAEngine/Utils.hpp>
|
||||
#include <IAEngine/SceneManager.hpp>
|
||||
|
||||
namespace ia::iae
|
||||
{
|
||||
@ -54,6 +54,7 @@ namespace ia::iae
|
||||
STATIC VOID DrawQuad(IN Vec2 position, IN Handle texture, IN Vec2 scale, IN FLOAT32 rotation, IN UINT8 layer, IN UINT16 sortIndex);
|
||||
STATIC VOID DrawCircle(IN Vec2 position, IN Handle texture, IN FLOAT32 radius, IN FLOAT32 rotation, IN UINT8 layer, IN UINT16 sortIndex);
|
||||
STATIC VOID DrawText(IN CONST String& text, IN Vec2 position, IN FLOAT32 scale, IN FLOAT32 rotation, IN UINT8 layer, IN UINT16 sortIndex);
|
||||
STATIC Vec2 GetSceneDesignViewport();
|
||||
STATIC VOID SetSceneDesignViewport(IN Vec2 value);
|
||||
|
||||
// Renderer State Functions
|
||||
|
||||
@ -23,28 +23,33 @@ namespace ia::iae
|
||||
class SceneManager
|
||||
{
|
||||
public:
|
||||
SceneManager(IN std::function<RefPtr<Node2D>(IN CONST String &, IN CONST Vector<String>&)> getCustomNode,
|
||||
IN std::function<Handle(IN ResourceType type, IN CONST String &, IN INT64)> getResource);
|
||||
~SceneManager();
|
||||
STATIC VOID Setup(IN std::function<RefPtr<Node2D>(IN CONST String &, IN CONST Vector<String> &)> getCustomNode,
|
||||
IN std::function<Handle(IN ResourceType type, IN CONST String &, IN INT64)> getResource);
|
||||
|
||||
VOID SwitchTo(IN CONST String &name);
|
||||
STATIC VOID SwitchTo(IN CONST String &name);
|
||||
|
||||
Scene *GetScene(IN CONST String &name);
|
||||
STATIC Scene *GetScene(IN CONST String &name);
|
||||
|
||||
public:
|
||||
template<typename SceneType> SceneType* AddScene(IN CONST String &name, IN CONST String &xml)
|
||||
template<typename SceneType> STATIC SceneType *AddScene(IN CONST String &name, IN CONST String &xml)
|
||||
{
|
||||
const auto t = (Scene*)new SceneType();
|
||||
const auto t = (Scene *) new SceneType();
|
||||
AddScene(t, name, xml);
|
||||
return (SceneType*)t;
|
||||
return (SceneType *) t;
|
||||
}
|
||||
|
||||
private:
|
||||
VOID AddScene(IN Scene *scene, IN CONST String &name, IN CONST String &xml);
|
||||
STATIC VOID AddScene(IN Scene *scene, IN CONST String &name, IN CONST String &xml);
|
||||
|
||||
private:
|
||||
Map<String, Scene *> m_scenes;
|
||||
std::function<RefPtr<Node2D>(IN CONST String &, IN CONST Vector<String>&)> m_customNodeGetter;
|
||||
std::function<Handle(IN ResourceType type, IN CONST String &, IN INT64)> m_resourceGetter;
|
||||
STATIC Map<String, Scene *> s_scenes;
|
||||
STATIC std::function<RefPtr<Node2D>(IN CONST String &, IN CONST Vector<String> &)> s_customNodeGetter;
|
||||
STATIC std::function<Handle(IN ResourceType type, IN CONST String &, IN INT64)> s_resourceGetter;
|
||||
|
||||
private:
|
||||
STATIC VOID Initialize();
|
||||
STATIC VOID Terminate();
|
||||
|
||||
friend class __Internal_Engine;
|
||||
};
|
||||
} // namespace ia::iae
|
||||
Reference in New Issue
Block a user