coroutines truly are cursed

This commit is contained in:
2021-11-11 20:12:50 +01:00
parent 1848bb5139
commit 01049019fd
25 changed files with 202 additions and 92 deletions
-2
View File
@@ -14,12 +14,10 @@ Actor::~Actor()
}
void Actor::tick(float deltaTime)
{
addWorldRotation(glm::vec3(0, 1 * deltaTime, 0));
}
void Actor::notifySceneAttach(PScene scene)
{
owningScene = scene;
scene->getSceneUpdater()->registerActorUpdate(this);
rootComponent->notifySceneAttach(scene);
for(auto child : children)
{
+1 -3
View File
@@ -1,9 +1,7 @@
target_sources(SeeleEngine
PRIVATE
Scene.cpp
Scene.h
SceneUpdater.h
SceneUpdater.cpp)
Scene.h)
add_subdirectory(Actor/)
add_subdirectory(Components/)
@@ -36,7 +36,6 @@ PActor Component::getOwner()
void Component::notifySceneAttach(PScene scene)
{
owningScene = scene;
scene->getSceneUpdater()->registerComponentUpdate(this);
for (auto child : children)
{
child->notifySceneAttach(scene);
-2
View File
@@ -13,7 +13,6 @@ inline float frand()
Scene::Scene(Gfx::PGraphics graphics)
: graphics(graphics)
, updater(new SceneUpdater())
{
lightEnv.directionalLights[0].color = Vector4(1, 1, 1, 1);
lightEnv.directionalLights[0].direction = Vector4(1, 1, 0, 1);
@@ -36,7 +35,6 @@ Scene::~Scene()
void Scene::tick(double deltaTime)
{
updater->runUpdates(static_cast<float>(deltaTime));
for(auto &&meshBatch : staticMeshes)
{
meshBatch.material->updateDescriptorData();
-3
View File
@@ -4,7 +4,6 @@
#include "Graphics/GraphicsResources.h"
#include "Components/PrimitiveComponent.h"
#include "Graphics/MeshBatch.h"
#include "SceneUpdater.h"
namespace Seele
{
@@ -46,13 +45,11 @@ public:
const Array<PPrimitiveComponent>& getPrimitives() const { return primitives; }
const Array<StaticMeshBatch>& getStaticMeshes() const { return staticMeshes; }
const LightEnv& getLightBuffer() const { return lightEnv; }
UPSceneUpdater& getSceneUpdater() { return updater; }
private:
Array<StaticMeshBatch> staticMeshes;
Array<PActor> rootActors;
Array<PPrimitiveComponent> primitives;
LightEnv lightEnv;
Gfx::PGraphics graphics;
UPSceneUpdater updater;
};
} // namespace Seele
+1 -1
View File
@@ -2,7 +2,7 @@
#include "MinimalEngine.h"
#include "Containers/List.h"
#include <semaphore>
//DEPRECATED
namespace Seele
{
DECLARE_REF(Component);