small fixes to make it work with demo project
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
|
||||
#include <typeinfo>
|
||||
#include "MeshContainer.hpp"
|
||||
#include "RectBase.hpp"
|
||||
#include "elements/Transformable.hpp"
|
||||
|
||||
namespace TSE
|
||||
@@ -24,8 +25,8 @@ namespace TSE
|
||||
Mesh* Renderable::GetMeshContainer() const {
|
||||
if(baseObject->HasBehaviourScript(MESH_CONTAINER))
|
||||
return dynamic_cast<MeshContainer*>(baseObject->GetBehaviourScript(MESH_CONTAINER))->GetMesh();
|
||||
// if(baseObject->HasBehaviourScript(RECT_BASE))
|
||||
// return dynamic_cast<RectBase*>(baseObject->GetBehaviourScript(RECT_BASE))->GetMesh();
|
||||
if(baseObject->HasBehaviourScript(RECT_BASE))
|
||||
return dynamic_cast<RectBase*>(baseObject->GetBehaviourScript(RECT_BASE))->GetMesh();
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
@@ -38,5 +39,14 @@ namespace TSE
|
||||
auto* container = GetMeshContainer();
|
||||
return container ? container->uvs.data() : nullptr;
|
||||
}
|
||||
const std::vector<ushort> Renderable::GetIndices() const
|
||||
{
|
||||
auto* container = GetMeshContainer();
|
||||
return container ? container->indecies : std::vector<unsigned short>();
|
||||
}
|
||||
size_t Renderable::GetVertexCount() const
|
||||
{
|
||||
auto* container = GetMeshContainer();
|
||||
return container ? container->VerteciesCount() : 0;
|
||||
}
|
||||
} // namespace TSE
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@ void HandleObject(TSE::Transformable* trans, TSE::TransformationStack& stack, TS
|
||||
}
|
||||
}
|
||||
|
||||
TSE::Layer::Layer(string &n)
|
||||
TSE::Layer::Layer(const string &n)
|
||||
{
|
||||
name = n;
|
||||
}
|
||||
|
||||
@@ -14,7 +14,7 @@ namespace TSE
|
||||
std::vector<Transformable*> objectsToRender;
|
||||
|
||||
public:
|
||||
Layer(string& name);
|
||||
Layer(const string& name);
|
||||
|
||||
void Render(IRenderer& rnd) const;
|
||||
void AddTransformable(Transformable* t);
|
||||
|
||||
@@ -23,7 +23,7 @@ namespace TSE
|
||||
|
||||
public:
|
||||
string name = "Unnamed";
|
||||
static ITextureHelper* helper;
|
||||
inline static ITextureHelper* helper = nullptr;
|
||||
|
||||
Texture(const string& path);
|
||||
Texture(const int& width, const int& height, int bpp = 32);
|
||||
|
||||
@@ -29,7 +29,7 @@ namespace TSE
|
||||
std::vector<Transformable*> children;
|
||||
Transformable* parent = nullptr;
|
||||
|
||||
static std::unordered_map<uuids::uuid, Transformable*> objectEntries;
|
||||
inline static std::unordered_map<uuids::uuid, Transformable*> objectEntries = {};
|
||||
|
||||
public:
|
||||
Transformable();
|
||||
|
||||
@@ -12,7 +12,7 @@ namespace TSE
|
||||
/// @param width the new width
|
||||
/// @param height the new height
|
||||
/// @param resizable the resizable that got changed
|
||||
virtual void OnResize(float width, float height, IResizable* resizable);
|
||||
virtual void OnResize(float width, float height, IResizable* resizable) = 0;
|
||||
virtual ~IResizeNotifiable() = default;
|
||||
};
|
||||
} // namespace TSE
|
||||
|
||||
@@ -15,7 +15,6 @@ namespace TSE
|
||||
virtual bool Init() = 0;
|
||||
public:
|
||||
virtual void Clear() const = 0;
|
||||
virtual void Update() const = 0;
|
||||
virtual void ClearDepthBuffer() const = 0;
|
||||
virtual bool ShouldClose() const = 0;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user