Refactor Visject Graph nodes data for unlimited size

This commit is contained in:
Wojtek Figat
2024-04-19 12:22:04 +02:00
parent 0845866c4d
commit 71fe280464
7 changed files with 24 additions and 33 deletions

View File

@@ -26,7 +26,7 @@ public:
/// <summary>
/// The asset references. Linked resources such as Animation assets are referenced in graph data as ID. We need to keep valid refs to them at runtime to keep data in memory.
/// </summary>
AssetReference<Asset> Assets[14];
Array<AssetReference<Asset>> Assets;
};
/// <summary>

View File

@@ -177,6 +177,7 @@ public:
// Get Gameplay Global
case GRAPH_NODE_MAKE_TYPE(7, 16):
{
node->Assets.Resize(1);
node->Assets[0] = Content::LoadAsync<Asset>((Guid)node->Values[0]);
break;
}
@@ -296,6 +297,7 @@ public:
break;
// Particle Emitter Function
case GRAPH_NODE_MAKE_TYPE(14, 300):
node->Assets.Resize(1);
InitParticleEmitterFunctionCall((Guid)node->Values[0], node->Assets[0], node->UsesParticleData, Layout);
break;
// Particle Index
@@ -447,6 +449,7 @@ public:
// Sprite Rendering
case GRAPH_NODE_MAKE_TYPE(15, 400):
{
node->Assets.Resize(1);
node->Assets[0] = Content::LoadAsync<Asset>((Guid)node->Values[2]);
USE_ATTRIBUTE(Position, Float3, 0);
USE_ATTRIBUTE(Rotation, Float3, 1);
@@ -484,6 +487,7 @@ public:
// Model Rendering
case GRAPH_NODE_MAKE_TYPE(15, 403):
{
node->Assets.Resize(2);
node->Assets[0] = Content::LoadAsync<Asset>((Guid)node->Values[2]);
node->Assets[1] = Content::LoadAsync<Asset>((Guid)node->Values[3]);
USE_ATTRIBUTE(Position, Float3, 0);
@@ -494,6 +498,7 @@ public:
// Ribbon Rendering
case GRAPH_NODE_MAKE_TYPE(15, 404):
{
node->Assets.Resize(1);
node->Assets[0] = Content::LoadAsync<Asset>((Guid)node->Values[2]);
USE_ATTRIBUTE(Position, Float3, 0);
// TODO: add support for custom sorting key - not only by age
@@ -503,6 +508,7 @@ public:
// Volumetric Fog Rendering
case GRAPH_NODE_MAKE_TYPE(15, 405):
{
node->Assets.Resize(1);
node->Assets[0] = Content::LoadAsync<Asset>((Guid)node->Values[2]);
USE_ATTRIBUTE(Position, Float3, 0);
USE_ATTRIBUTE(Radius, Float, 1);