Format more engine code
This commit is contained in:
@@ -14,14 +14,14 @@ class AnimEvent;
|
||||
/// </summary>
|
||||
API_CLASS(NoSpawn) class FLAXENGINE_API Animation : public BinaryAsset
|
||||
{
|
||||
DECLARE_BINARY_ASSET_HEADER(Animation, 1);
|
||||
DECLARE_BINARY_ASSET_HEADER(Animation, 1);
|
||||
|
||||
/// <summary>
|
||||
/// Contains basic information about the animation asset contents.
|
||||
/// </summary>
|
||||
API_STRUCT() struct FLAXENGINE_API InfoData
|
||||
{
|
||||
DECLARE_SCRIPTING_TYPE_NO_SPAWN(InfoData);
|
||||
DECLARE_SCRIPTING_TYPE_NO_SPAWN(InfoData);
|
||||
|
||||
/// <summary>
|
||||
/// Length of the animation in seconds.
|
||||
@@ -62,14 +62,12 @@ DECLARE_BINARY_ASSET_HEADER(Animation, 1);
|
||||
};
|
||||
|
||||
private:
|
||||
|
||||
#if USE_EDITOR
|
||||
bool _registeredForScriptingReload = false;
|
||||
void OnScriptsReloadStart();
|
||||
#endif
|
||||
|
||||
public:
|
||||
|
||||
/// <summary>
|
||||
/// The animation data.
|
||||
/// </summary>
|
||||
@@ -92,7 +90,6 @@ public:
|
||||
Dictionary<SkinnedModel*, NodeToChannel> MappingCache;
|
||||
|
||||
public:
|
||||
|
||||
/// <summary>
|
||||
/// Gets the length of the animation (in seconds).
|
||||
/// </summary>
|
||||
@@ -160,16 +157,13 @@ public:
|
||||
#endif
|
||||
|
||||
private:
|
||||
|
||||
void OnSkinnedModelUnloaded(Asset* obj);
|
||||
|
||||
public:
|
||||
|
||||
// [BinaryAsset]
|
||||
void OnScriptingDispose() override;
|
||||
|
||||
protected:
|
||||
|
||||
// [BinaryAsset]
|
||||
LoadResult load() override;
|
||||
void unload(bool isReloading) override;
|
||||
|
||||
@@ -10,9 +10,8 @@
|
||||
/// </summary>
|
||||
API_CLASS(NoSpawn) class FLAXENGINE_API AnimationGraph : public BinaryAsset
|
||||
{
|
||||
DECLARE_BINARY_ASSET_HEADER(AnimationGraph, 1);
|
||||
DECLARE_BINARY_ASSET_HEADER(AnimationGraph, 1);
|
||||
public:
|
||||
|
||||
/// <summary>
|
||||
/// The animation graph.
|
||||
/// </summary>
|
||||
@@ -24,7 +23,6 @@ public:
|
||||
AnimGraphExecutor GraphExecutor;
|
||||
|
||||
public:
|
||||
|
||||
/// <summary>
|
||||
/// Gets the base model asset used for the animation preview and the skeleton layout source.
|
||||
/// </summary>
|
||||
@@ -58,20 +56,17 @@ public:
|
||||
API_FUNCTION() bool SaveSurface(BytesContainer& data);
|
||||
|
||||
private:
|
||||
|
||||
void FindDependencies(AnimGraphBase* graph);
|
||||
|
||||
#endif
|
||||
|
||||
public:
|
||||
|
||||
// [BinaryAsset]
|
||||
#if USE_EDITOR
|
||||
void GetReferences(Array<Guid>& output) const override;
|
||||
#endif
|
||||
|
||||
protected:
|
||||
|
||||
// [BinaryAsset]
|
||||
LoadResult load() override;
|
||||
void unload(bool isReloading) override;
|
||||
|
||||
@@ -147,7 +147,6 @@ void AnimationGraphFunction::ProcessGraphForSignature(AnimGraphBase* graph, bool
|
||||
p.Type = GetGraphFunctionTypeName_Deprecated(node.Values[0]);
|
||||
#endif
|
||||
p.Name = name;
|
||||
|
||||
}
|
||||
}
|
||||
else if (node.Type == GRAPH_NODE_MAKE_TYPE(16, 2)) // Function Output
|
||||
|
||||
@@ -10,9 +10,8 @@
|
||||
/// </summary>
|
||||
API_CLASS(NoSpawn) class FLAXENGINE_API AnimationGraphFunction : public BinaryAsset
|
||||
{
|
||||
DECLARE_BINARY_ASSET_HEADER(AnimationGraphFunction, 1);
|
||||
DECLARE_BINARY_ASSET_HEADER(AnimationGraphFunction, 1);
|
||||
public:
|
||||
|
||||
/// <summary>
|
||||
/// The loaded anim graph function graph data (serialized anim graph).
|
||||
/// </summary>
|
||||
@@ -59,11 +58,9 @@ public:
|
||||
#endif
|
||||
|
||||
private:
|
||||
|
||||
void ProcessGraphForSignature(AnimGraphBase* graph, bool canUseOutputs);
|
||||
|
||||
protected:
|
||||
|
||||
// [BinaryAsset]
|
||||
LoadResult load() override;
|
||||
void unload(bool isReloading) override;
|
||||
|
||||
@@ -9,5 +9,5 @@
|
||||
/// </summary>
|
||||
API_CLASS(NoSpawn) class FLAXENGINE_API CubeTexture : public TextureBase
|
||||
{
|
||||
DECLARE_BINARY_ASSET_HEADER(CubeTexture, TexturesSerializedVersion);
|
||||
DECLARE_BINARY_ASSET_HEADER(CubeTexture, TexturesSerializedVersion);
|
||||
};
|
||||
|
||||
@@ -9,10 +9,9 @@
|
||||
/// </summary>
|
||||
API_CLASS(NoSpawn) class FLAXENGINE_API IESProfile : public TextureBase
|
||||
{
|
||||
DECLARE_BINARY_ASSET_HEADER(IESProfile, TexturesSerializedVersion);
|
||||
DECLARE_BINARY_ASSET_HEADER(IESProfile, TexturesSerializedVersion);
|
||||
|
||||
public:
|
||||
|
||||
struct CustomDataLayout
|
||||
{
|
||||
float Brightness;
|
||||
@@ -20,7 +19,6 @@ public:
|
||||
};
|
||||
|
||||
public:
|
||||
|
||||
/// <summary>
|
||||
/// The light brightness in Lumens, imported from IES profile.
|
||||
/// </summary>
|
||||
@@ -32,7 +30,6 @@ public:
|
||||
API_FIELD() float TextureMultiplier;
|
||||
|
||||
protected:
|
||||
|
||||
// [BinaryAsset]
|
||||
bool init(AssetInitData& initData) override;
|
||||
};
|
||||
|
||||
@@ -12,13 +12,11 @@ class MaterialShader;
|
||||
/// </summary>
|
||||
API_CLASS(NoSpawn) class FLAXENGINE_API Material : public ShaderAssetTypeBase<MaterialBase>
|
||||
{
|
||||
DECLARE_BINARY_ASSET_HEADER(Material, ShadersSerializedVersion);
|
||||
DECLARE_BINARY_ASSET_HEADER(Material, ShadersSerializedVersion);
|
||||
private:
|
||||
|
||||
MaterialShader* _materialShader = nullptr;
|
||||
|
||||
public:
|
||||
|
||||
/// <summary>
|
||||
/// Tries to load surface graph from the asset.
|
||||
/// </summary>
|
||||
@@ -39,7 +37,6 @@ public:
|
||||
#endif
|
||||
|
||||
public:
|
||||
|
||||
// [MaterialBase]
|
||||
bool IsMaterialInstance() const override;
|
||||
|
||||
@@ -58,7 +55,6 @@ public:
|
||||
#endif
|
||||
|
||||
protected:
|
||||
|
||||
// [MaterialBase]
|
||||
LoadResult load() override;
|
||||
void unload(bool isReloading) override;
|
||||
|
||||
@@ -12,9 +12,8 @@
|
||||
/// <seealso cref="FlaxEngine.BinaryAsset" />
|
||||
API_CLASS(Abstract, NoSpawn) class FLAXENGINE_API MaterialBase : public BinaryAsset, public IMaterial
|
||||
{
|
||||
DECLARE_ASSET_HEADER(MaterialBase);
|
||||
DECLARE_ASSET_HEADER(MaterialBase);
|
||||
public:
|
||||
|
||||
/// <summary>
|
||||
/// The material parameters collection.
|
||||
/// </summary>
|
||||
@@ -32,7 +31,6 @@ public:
|
||||
virtual bool IsMaterialInstance() const = 0;
|
||||
|
||||
public:
|
||||
|
||||
/// <summary>
|
||||
/// Gets the material parameters collection.
|
||||
/// </summary>
|
||||
@@ -78,7 +76,6 @@ public:
|
||||
API_FUNCTION() MaterialInstance* CreateVirtualInstance();
|
||||
|
||||
public:
|
||||
|
||||
// [BinaryAsset]
|
||||
#if USE_EDITOR
|
||||
void GetReferences(Array<Guid>& output) const override
|
||||
|
||||
@@ -10,9 +10,8 @@
|
||||
/// </summary>
|
||||
API_CLASS(NoSpawn) class FLAXENGINE_API MaterialFunction : public BinaryAsset
|
||||
{
|
||||
DECLARE_BINARY_ASSET_HEADER(MaterialFunction, 1);
|
||||
DECLARE_BINARY_ASSET_HEADER(MaterialFunction, 1);
|
||||
public:
|
||||
|
||||
#if COMPILE_WITH_MATERIAL_GRAPH
|
||||
|
||||
/// <summary>
|
||||
@@ -60,7 +59,6 @@ public:
|
||||
#endif
|
||||
|
||||
protected:
|
||||
|
||||
// [BinaryAsset]
|
||||
LoadResult load() override;
|
||||
void unload(bool isReloading) override;
|
||||
|
||||
@@ -9,13 +9,11 @@
|
||||
/// </summary>
|
||||
API_CLASS(NoSpawn) class FLAXENGINE_API MaterialInstance : public MaterialBase
|
||||
{
|
||||
DECLARE_BINARY_ASSET_HEADER(MaterialInstance, 4);
|
||||
DECLARE_BINARY_ASSET_HEADER(MaterialInstance, 4);
|
||||
private:
|
||||
|
||||
MaterialBase* _baseMaterial = nullptr;
|
||||
|
||||
public:
|
||||
|
||||
/// <summary>
|
||||
/// Gets the base material. If value gets changed parameters collection is restored to the default values of the new material.
|
||||
/// </summary>
|
||||
@@ -43,14 +41,12 @@ public:
|
||||
#endif
|
||||
|
||||
private:
|
||||
|
||||
void OnBaseSet();
|
||||
void OnBaseUnset();
|
||||
void OnBaseUnloaded(Asset* p);
|
||||
void OnBaseParamsChanged();
|
||||
|
||||
public:
|
||||
|
||||
// [MaterialBase]
|
||||
bool IsMaterialInstance() const override;
|
||||
#if USE_EDITOR
|
||||
@@ -67,7 +63,6 @@ public:
|
||||
void Bind(BindParameters& params) override;
|
||||
|
||||
protected:
|
||||
|
||||
// [MaterialBase]
|
||||
LoadResult load() override;
|
||||
void unload(bool isReloading) override;
|
||||
|
||||
@@ -13,16 +13,14 @@ class StreamModelLODTask;
|
||||
/// </summary>
|
||||
API_CLASS(NoSpawn) class FLAXENGINE_API Model : public ModelBase
|
||||
{
|
||||
DECLARE_BINARY_ASSET_HEADER(Model, 25);
|
||||
DECLARE_BINARY_ASSET_HEADER(Model, 25);
|
||||
friend Mesh;
|
||||
friend StreamModelLODTask;
|
||||
private:
|
||||
|
||||
int32 _loadedLODs = 0;
|
||||
StreamModelLODTask* _streamingTask = nullptr;
|
||||
|
||||
public:
|
||||
|
||||
/// <summary>
|
||||
/// Model level of details. The first entry is the highest quality LOD0 followed by more optimized versions.
|
||||
/// </summary>
|
||||
@@ -34,14 +32,12 @@ public:
|
||||
API_FIELD(ReadOnly) SDFData SDF;
|
||||
|
||||
public:
|
||||
|
||||
/// <summary>
|
||||
/// Finalizes an instance of the <see cref="Model"/> class.
|
||||
/// </summary>
|
||||
~Model();
|
||||
|
||||
public:
|
||||
|
||||
/// <summary>
|
||||
/// Gets a value indicating whether this instance is initialized.
|
||||
/// </summary>
|
||||
@@ -103,7 +99,6 @@ public:
|
||||
}
|
||||
|
||||
public:
|
||||
|
||||
/// <summary>
|
||||
/// Requests the LOD data asynchronously (creates task that will gather chunk data or null if already here).
|
||||
/// </summary>
|
||||
@@ -127,7 +122,6 @@ public:
|
||||
}
|
||||
|
||||
public:
|
||||
|
||||
/// <summary>
|
||||
/// Determines if there is an intersection between the Model and a Ray in given world using given instance.
|
||||
/// </summary>
|
||||
@@ -156,7 +150,6 @@ public:
|
||||
API_FUNCTION() BoundingBox GetBox(int32 lodIndex = 0) const;
|
||||
|
||||
public:
|
||||
|
||||
/// <summary>
|
||||
/// Draws the meshes. Binds vertex and index buffers and invokes the draw calls.
|
||||
/// </summary>
|
||||
@@ -185,7 +178,6 @@ public:
|
||||
void Draw(const RenderContext& renderContext, const Mesh::DrawInfo& info);
|
||||
|
||||
public:
|
||||
|
||||
/// <summary>
|
||||
/// Setups the model LODs collection including meshes creation.
|
||||
/// </summary>
|
||||
@@ -205,7 +197,7 @@ public:
|
||||
API_FUNCTION() bool Save(bool withMeshDataFromGpu = false, const StringView& path = StringView::Empty);
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Generates the Sign Distant Field for this model.
|
||||
/// </summary>
|
||||
@@ -223,7 +215,6 @@ public:
|
||||
API_FUNCTION() void SetSDF(const SDFData& sdf);
|
||||
|
||||
private:
|
||||
|
||||
/// <summary>
|
||||
/// Initializes this model to an empty collection of LODs with meshes.
|
||||
/// </summary>
|
||||
@@ -232,7 +223,6 @@ private:
|
||||
bool Init(const Span<int32>& meshesCountPerLod);
|
||||
|
||||
public:
|
||||
|
||||
// [ModelBase]
|
||||
void SetupMaterialSlots(int32 slotsCount) override;
|
||||
int32 GetLODsCount() const override;
|
||||
@@ -251,7 +241,6 @@ public:
|
||||
Task* CreateStreamingTask(int32 residency) override;
|
||||
|
||||
protected:
|
||||
|
||||
// [ModelBase]
|
||||
LoadResult load() override;
|
||||
void unload(bool isReloading) override;
|
||||
|
||||
@@ -9,16 +9,14 @@
|
||||
/// </summary>
|
||||
API_CLASS(NoSpawn) class FLAXENGINE_API RawDataAsset : public BinaryAsset
|
||||
{
|
||||
DECLARE_BINARY_ASSET_HEADER(RawDataAsset, 1);
|
||||
DECLARE_BINARY_ASSET_HEADER(RawDataAsset, 1);
|
||||
public:
|
||||
|
||||
/// <summary>
|
||||
/// The bytes array stored in the asset.
|
||||
/// </summary>
|
||||
API_FIELD() Array<byte> Data;
|
||||
|
||||
public:
|
||||
|
||||
#if USE_EDITOR
|
||||
|
||||
/// <summary>
|
||||
@@ -31,7 +29,6 @@ public:
|
||||
#endif
|
||||
|
||||
protected:
|
||||
|
||||
// [BinaryAsset]
|
||||
LoadResult load() override;
|
||||
void unload(bool isReloading) override;
|
||||
|
||||
@@ -12,20 +12,17 @@ class GPUShader;
|
||||
/// </summary>
|
||||
API_CLASS(NoSpawn) class FLAXENGINE_API Shader : public ShaderAssetTypeBase<BinaryAsset>
|
||||
{
|
||||
DECLARE_BINARY_ASSET_HEADER(Shader, ShadersSerializedVersion);
|
||||
DECLARE_BINARY_ASSET_HEADER(Shader, ShadersSerializedVersion);
|
||||
private:
|
||||
|
||||
GPUShader* _shader;
|
||||
|
||||
public:
|
||||
|
||||
/// <summary>
|
||||
/// Finalizes an instance of the <see cref="Shader"/> class.
|
||||
/// </summary>
|
||||
~Shader();
|
||||
|
||||
public:
|
||||
|
||||
/// <summary>
|
||||
/// The GPU shader object (not null).
|
||||
/// </summary>
|
||||
@@ -40,7 +37,6 @@ public:
|
||||
}
|
||||
|
||||
protected:
|
||||
|
||||
// [BinaryAsset]
|
||||
LoadResult load() override;
|
||||
void unload(bool isReloading) override;
|
||||
|
||||
@@ -14,14 +14,12 @@ class MemoryWriteStream;
|
||||
/// </summary>
|
||||
API_CLASS(NoSpawn) class FLAXENGINE_API SkeletonMask : public BinaryAsset
|
||||
{
|
||||
DECLARE_BINARY_ASSET_HEADER(SkeletonMask, 2);
|
||||
DECLARE_BINARY_ASSET_HEADER(SkeletonMask, 2);
|
||||
private:
|
||||
|
||||
Array<String> _maskedNodes;
|
||||
BitArray<> _mask;
|
||||
|
||||
public:
|
||||
|
||||
/// <summary>
|
||||
/// The referenced skinned model skeleton that defines the masked nodes hierarchy.
|
||||
/// </summary>
|
||||
@@ -47,7 +45,6 @@ public:
|
||||
}
|
||||
|
||||
public:
|
||||
|
||||
/// <summary>
|
||||
/// Gets the per-skeleton-node boolean mask (read-only).
|
||||
/// </summary>
|
||||
@@ -66,11 +63,9 @@ public:
|
||||
#endif
|
||||
|
||||
private:
|
||||
|
||||
void OnSkeletonUnload();
|
||||
|
||||
public:
|
||||
|
||||
// [BinaryAsset]
|
||||
#if USE_EDITOR
|
||||
void GetReferences(Array<Guid>& output) const override
|
||||
@@ -83,7 +78,6 @@ public:
|
||||
#endif
|
||||
|
||||
protected:
|
||||
|
||||
// [BinaryAsset]
|
||||
LoadResult load() override;
|
||||
void unload(bool isReloading) override;
|
||||
|
||||
@@ -14,16 +14,14 @@ class StreamSkinnedModelLODTask;
|
||||
/// </summary>
|
||||
API_CLASS(NoSpawn) class FLAXENGINE_API SkinnedModel : public ModelBase
|
||||
{
|
||||
DECLARE_BINARY_ASSET_HEADER(SkinnedModel, 4);
|
||||
DECLARE_BINARY_ASSET_HEADER(SkinnedModel, 4);
|
||||
friend SkinnedMesh;
|
||||
friend StreamSkinnedModelLODTask;
|
||||
private:
|
||||
|
||||
int32 _loadedLODs = 0;
|
||||
StreamSkinnedModelLODTask* _streamingTask = nullptr;
|
||||
|
||||
public:
|
||||
|
||||
/// <summary>
|
||||
/// Model level of details. The first entry is the highest quality LOD0 followed by more optimized versions.
|
||||
/// </summary>
|
||||
@@ -35,14 +33,12 @@ public:
|
||||
SkeletonData Skeleton;
|
||||
|
||||
public:
|
||||
|
||||
/// <summary>
|
||||
/// Finalizes an instance of the <see cref="SkinnedModel"/> class.
|
||||
/// </summary>
|
||||
~SkinnedModel();
|
||||
|
||||
public:
|
||||
|
||||
/// <summary>
|
||||
/// Gets a value indicating whether this instance is initialized.
|
||||
/// </summary>
|
||||
@@ -154,7 +150,6 @@ public:
|
||||
API_PROPERTY() Array<String> GetBlendShapes();
|
||||
|
||||
public:
|
||||
|
||||
/// <summary>
|
||||
/// Requests the LOD data asynchronously (creates task that will gather chunk data or null if already here).
|
||||
/// </summary>
|
||||
@@ -170,7 +165,6 @@ public:
|
||||
void GetLODData(int32 lodIndex, BytesContainer& data) const;
|
||||
|
||||
public:
|
||||
|
||||
/// <summary>
|
||||
/// Determines if there is an intersection between the SkinnedModel and a Ray in given world using given instance.
|
||||
/// </summary>
|
||||
@@ -199,7 +193,6 @@ public:
|
||||
API_FUNCTION() BoundingBox GetBox(int32 lodIndex = 0) const;
|
||||
|
||||
public:
|
||||
|
||||
/// <summary>
|
||||
/// Draws the meshes. Binds vertex and index buffers and invokes the draw calls.
|
||||
/// </summary>
|
||||
@@ -218,7 +211,6 @@ public:
|
||||
void Draw(RenderContext& renderContext, const SkinnedMesh::DrawInfo& info);
|
||||
|
||||
public:
|
||||
|
||||
/// <summary>
|
||||
/// Setups the model LODs collection including meshes creation.
|
||||
/// </summary>
|
||||
@@ -256,7 +248,6 @@ public:
|
||||
#endif
|
||||
|
||||
private:
|
||||
|
||||
/// <summary>
|
||||
/// Initializes this skinned model to an empty collection of meshes. Ensure to init SkeletonData manually after the call.
|
||||
/// </summary>
|
||||
@@ -265,7 +256,6 @@ private:
|
||||
bool Init(const Span<int32>& meshesCountPerLod);
|
||||
|
||||
public:
|
||||
|
||||
// [ModelBase]
|
||||
void SetupMaterialSlots(int32 slotsCount) override;
|
||||
int32 GetLODsCount() const override;
|
||||
@@ -284,7 +274,6 @@ public:
|
||||
Task* CreateStreamingTask(int32 residency) override;
|
||||
|
||||
protected:
|
||||
|
||||
// [ModelBase]
|
||||
LoadResult load() override;
|
||||
void unload(bool isReloading) override;
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
/// </summary>
|
||||
API_CLASS(NoSpawn) class FLAXENGINE_API Texture : public TextureBase
|
||||
{
|
||||
DECLARE_BINARY_ASSET_HEADER(Texture, TexturesSerializedVersion);
|
||||
DECLARE_BINARY_ASSET_HEADER(Texture, TexturesSerializedVersion);
|
||||
|
||||
/// <summary>
|
||||
/// Gets the texture format type.
|
||||
@@ -22,7 +22,6 @@ DECLARE_BINARY_ASSET_HEADER(Texture, TexturesSerializedVersion);
|
||||
API_PROPERTY() bool IsNormalMap() const;
|
||||
|
||||
public:
|
||||
|
||||
#if USE_EDITOR
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -54,15 +54,15 @@ bool VisualScriptGraph::onNodeLoaded(Node* n)
|
||||
{
|
||||
switch (n->GroupID)
|
||||
{
|
||||
// Function
|
||||
// Function
|
||||
case 16:
|
||||
switch (n->TypeID)
|
||||
{
|
||||
// Invoke Method
|
||||
// Invoke Method
|
||||
case 4:
|
||||
n->Data.InvokeMethod.Method = nullptr;
|
||||
break;
|
||||
// Get/Set Field
|
||||
// Get/Set Field
|
||||
case 7:
|
||||
case 8:
|
||||
n->Data.GetSetField.Field = nullptr;
|
||||
@@ -176,7 +176,7 @@ void VisualScriptExecutor::ProcessGroupParameters(Box* box, Node* node, Value& v
|
||||
{
|
||||
switch (node->TypeID)
|
||||
{
|
||||
// Get
|
||||
// Get
|
||||
case 3:
|
||||
{
|
||||
int32 paramIndex;
|
||||
@@ -200,7 +200,7 @@ void VisualScriptExecutor::ProcessGroupParameters(Box* box, Node* node, Value& v
|
||||
}
|
||||
break;
|
||||
}
|
||||
// Set
|
||||
// Set
|
||||
case 4:
|
||||
{
|
||||
int32 paramIndex;
|
||||
@@ -235,11 +235,11 @@ void VisualScriptExecutor::ProcessGroupTools(Box* box, Node* node, Value& value)
|
||||
{
|
||||
switch (node->TypeID)
|
||||
{
|
||||
// This Instance
|
||||
// This Instance
|
||||
case 19:
|
||||
value = ThreadStacks.Get().Stack->Instance;
|
||||
break;
|
||||
// Cast
|
||||
// Cast
|
||||
case 25:
|
||||
{
|
||||
if (box->ID == 0)
|
||||
@@ -297,7 +297,7 @@ void VisualScriptExecutor::ProcessGroupTools(Box* box, Node* node, Value& value)
|
||||
}
|
||||
break;
|
||||
}
|
||||
// Cast Value
|
||||
// Cast Value
|
||||
case 26:
|
||||
{
|
||||
if (box->ID == 0)
|
||||
@@ -375,7 +375,7 @@ void VisualScriptExecutor::ProcessGroupFunction(Box* boxBase, Node* node, Value&
|
||||
{
|
||||
switch (node->TypeID)
|
||||
{
|
||||
// Method Override
|
||||
// Method Override
|
||||
case 3:
|
||||
{
|
||||
if (boxBase->ID == 0)
|
||||
@@ -392,7 +392,7 @@ void VisualScriptExecutor::ProcessGroupFunction(Box* boxBase, Node* node, Value&
|
||||
}
|
||||
break;
|
||||
}
|
||||
// Invoke Method
|
||||
// Invoke Method
|
||||
case 4:
|
||||
{
|
||||
// Call Impulse or Pure Method
|
||||
@@ -604,14 +604,14 @@ void VisualScriptExecutor::ProcessGroupFunction(Box* boxBase, Node* node, Value&
|
||||
}
|
||||
break;
|
||||
}
|
||||
// Return
|
||||
// Return
|
||||
case 5:
|
||||
{
|
||||
auto& scope = ThreadStacks.Get().Stack->Scope;
|
||||
scope->FunctionReturn = tryGetValue(node->GetBox(1), Value::Zero);
|
||||
break;
|
||||
}
|
||||
// Function
|
||||
// Function
|
||||
case 6:
|
||||
{
|
||||
if (boxBase->ID == 0)
|
||||
@@ -630,7 +630,7 @@ void VisualScriptExecutor::ProcessGroupFunction(Box* boxBase, Node* node, Value&
|
||||
}
|
||||
break;
|
||||
}
|
||||
// Get Field
|
||||
// Get Field
|
||||
case 7:
|
||||
{
|
||||
auto& cache = node->Data.GetSetField;
|
||||
@@ -716,7 +716,7 @@ void VisualScriptExecutor::ProcessGroupFunction(Box* boxBase, Node* node, Value&
|
||||
}
|
||||
break;
|
||||
}
|
||||
// Get Field
|
||||
// Get Field
|
||||
case 8:
|
||||
{
|
||||
auto& cache = node->Data.GetSetField;
|
||||
@@ -809,7 +809,7 @@ void VisualScriptExecutor::ProcessGroupFunction(Box* boxBase, Node* node, Value&
|
||||
eatBox(node, returnedImpulse->FirstConnection());
|
||||
break;
|
||||
}
|
||||
// Bind/Unbind
|
||||
// Bind/Unbind
|
||||
case 9:
|
||||
case 10:
|
||||
{
|
||||
@@ -937,7 +937,7 @@ void VisualScriptExecutor::ProcessGroupFlow(Box* boxBase, Node* node, Value& val
|
||||
{
|
||||
switch (node->TypeID)
|
||||
{
|
||||
// If
|
||||
// If
|
||||
case 1:
|
||||
{
|
||||
const bool condition = (bool)tryGetValue(node->GetBox(1), Value::Zero);
|
||||
@@ -946,7 +946,7 @@ void VisualScriptExecutor::ProcessGroupFlow(Box* boxBase, Node* node, Value& val
|
||||
eatBox(node, boxBase->FirstConnection());
|
||||
break;
|
||||
}
|
||||
// For Loop
|
||||
// For Loop
|
||||
case 2:
|
||||
{
|
||||
const auto scope = ThreadStacks.Get().Stack->Scope;
|
||||
@@ -959,7 +959,7 @@ void VisualScriptExecutor::ProcessGroupFlow(Box* boxBase, Node* node, Value& val
|
||||
}
|
||||
switch (boxBase->ID)
|
||||
{
|
||||
// Loop
|
||||
// Loop
|
||||
case 0:
|
||||
{
|
||||
if (iteratorIndex == scope->ReturnedValues.Count())
|
||||
@@ -980,13 +980,13 @@ void VisualScriptExecutor::ProcessGroupFlow(Box* boxBase, Node* node, Value& val
|
||||
eatBox(node, boxBase->FirstConnection());
|
||||
break;
|
||||
}
|
||||
// Break
|
||||
// Break
|
||||
case 3:
|
||||
// Reset loop iterator
|
||||
if (iteratorIndex != scope->ReturnedValues.Count())
|
||||
scope->ReturnedValues[iteratorIndex].Value.AsInt = MAX_int32 - 1;
|
||||
break;
|
||||
// Index
|
||||
// Index
|
||||
case 5:
|
||||
if (iteratorIndex != scope->ReturnedValues.Count())
|
||||
value = scope->ReturnedValues[iteratorIndex].Value;
|
||||
@@ -994,7 +994,7 @@ void VisualScriptExecutor::ProcessGroupFlow(Box* boxBase, Node* node, Value& val
|
||||
}
|
||||
break;
|
||||
}
|
||||
// While Loop
|
||||
// While Loop
|
||||
case 3:
|
||||
{
|
||||
const auto scope = ThreadStacks.Get().Stack->Scope;
|
||||
@@ -1007,7 +1007,7 @@ void VisualScriptExecutor::ProcessGroupFlow(Box* boxBase, Node* node, Value& val
|
||||
}
|
||||
switch (boxBase->ID)
|
||||
{
|
||||
// Loop
|
||||
// Loop
|
||||
case 0:
|
||||
{
|
||||
if (iteratorIndex == scope->ReturnedValues.Count())
|
||||
@@ -1027,13 +1027,13 @@ void VisualScriptExecutor::ProcessGroupFlow(Box* boxBase, Node* node, Value& val
|
||||
eatBox(node, boxBase->FirstConnection());
|
||||
break;
|
||||
}
|
||||
// Break
|
||||
// Break
|
||||
case 2:
|
||||
// Reset loop iterator
|
||||
if (iteratorIndex != scope->ReturnedValues.Count())
|
||||
scope->ReturnedValues[iteratorIndex].Value.AsInt = -1;
|
||||
break;
|
||||
// Index
|
||||
// Index
|
||||
case 4:
|
||||
if (iteratorIndex != scope->ReturnedValues.Count())
|
||||
value = scope->ReturnedValues[iteratorIndex].Value;
|
||||
@@ -1041,7 +1041,7 @@ void VisualScriptExecutor::ProcessGroupFlow(Box* boxBase, Node* node, Value& val
|
||||
}
|
||||
break;
|
||||
}
|
||||
// Sequence
|
||||
// Sequence
|
||||
case 4:
|
||||
{
|
||||
const int32 count = (int32)node->Values[0];
|
||||
@@ -1053,7 +1053,7 @@ void VisualScriptExecutor::ProcessGroupFlow(Box* boxBase, Node* node, Value& val
|
||||
}
|
||||
break;
|
||||
}
|
||||
// Branch On Enum
|
||||
// Branch On Enum
|
||||
case 5:
|
||||
{
|
||||
const Value v = tryGetValue(node->GetBox(1), Value::Null);
|
||||
@@ -1075,7 +1075,7 @@ void VisualScriptExecutor::ProcessGroupFlow(Box* boxBase, Node* node, Value& val
|
||||
}
|
||||
break;
|
||||
}
|
||||
// Delay
|
||||
// Delay
|
||||
case 6:
|
||||
{
|
||||
boxBase = node->GetBox(2);
|
||||
@@ -1115,7 +1115,7 @@ void VisualScriptExecutor::ProcessGroupFlow(Box* boxBase, Node* node, Value& val
|
||||
}
|
||||
break;
|
||||
}
|
||||
// Array For Each
|
||||
// Array For Each
|
||||
case 7:
|
||||
{
|
||||
const auto scope = ThreadStacks.Get().Stack->Scope;
|
||||
@@ -1135,7 +1135,7 @@ void VisualScriptExecutor::ProcessGroupFlow(Box* boxBase, Node* node, Value& val
|
||||
}
|
||||
switch (boxBase->ID)
|
||||
{
|
||||
// Loop
|
||||
// Loop
|
||||
case 0:
|
||||
{
|
||||
if (iteratorIndex == scope->ReturnedValues.Count())
|
||||
@@ -1173,18 +1173,18 @@ void VisualScriptExecutor::ProcessGroupFlow(Box* boxBase, Node* node, Value& val
|
||||
eatBox(node, boxBase->FirstConnection());
|
||||
break;
|
||||
}
|
||||
// Break
|
||||
// Break
|
||||
case 2:
|
||||
// Reset loop iterator
|
||||
if (iteratorIndex != scope->ReturnedValues.Count())
|
||||
scope->ReturnedValues[iteratorIndex].Value.AsInt = MAX_int32 - 1;
|
||||
break;
|
||||
// Item
|
||||
// Item
|
||||
case 4:
|
||||
if (iteratorIndex != scope->ReturnedValues.Count() && arrayIndex != scope->ReturnedValues.Count())
|
||||
value = scope->ReturnedValues[arrayIndex].Value.AsArray()[(int32)scope->ReturnedValues[iteratorIndex].Value];
|
||||
break;
|
||||
// Index
|
||||
// Index
|
||||
case 5:
|
||||
if (iteratorIndex != scope->ReturnedValues.Count())
|
||||
value = (int32)scope->ReturnedValues[iteratorIndex].Value;
|
||||
@@ -1702,13 +1702,13 @@ void VisualScriptingBinaryModule::OnScriptsReloading()
|
||||
{
|
||||
switch (node.Type)
|
||||
{
|
||||
// Invoke Method
|
||||
// Invoke Method
|
||||
case GRAPH_NODE_MAKE_TYPE(16, 4):
|
||||
{
|
||||
node.Data.InvokeMethod.Method = nullptr;
|
||||
break;
|
||||
}
|
||||
// Get/Set Field
|
||||
// Get/Set Field
|
||||
case GRAPH_NODE_MAKE_TYPE(16, 7):
|
||||
case GRAPH_NODE_MAKE_TYPE(16, 8):
|
||||
{
|
||||
@@ -2224,7 +2224,7 @@ String VisualScripting::GetStackTrace()
|
||||
String node;
|
||||
switch (frame->Node->Type)
|
||||
{
|
||||
// Get/Set Parameter
|
||||
// Get/Set Parameter
|
||||
case GRAPH_NODE_MAKE_TYPE(6, 3):
|
||||
case GRAPH_NODE_MAKE_TYPE(6, 4):
|
||||
{
|
||||
@@ -2233,19 +2233,19 @@ String VisualScripting::GetStackTrace()
|
||||
node += param ? param->Name : ((Guid)frame->Node->Values[0]).ToString();
|
||||
break;
|
||||
}
|
||||
// Method Override
|
||||
// Method Override
|
||||
case GRAPH_NODE_MAKE_TYPE(16, 3):
|
||||
node = (StringView)frame->Node->Values[0];
|
||||
node += TEXT("()");
|
||||
break;
|
||||
// Invoke Method
|
||||
// Invoke Method
|
||||
case GRAPH_NODE_MAKE_TYPE(16, 4):
|
||||
node = (StringView)frame->Node->Values[0];
|
||||
node += TEXT(".");
|
||||
node += (StringView)frame->Node->Values[1];
|
||||
node += TEXT("()");
|
||||
break;
|
||||
// Function
|
||||
// Function
|
||||
case GRAPH_NODE_MAKE_TYPE(16, 6):
|
||||
node = String(frame->Script->GetScriptTypeName());
|
||||
for (int32 i = 0; i < frame->Script->_methods.Count(); i++)
|
||||
|
||||
@@ -33,7 +33,6 @@ class VisualScriptExecutor : public VisjectExecutor
|
||||
{
|
||||
friend VisualScripting;
|
||||
public:
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="VisualScriptExecutor"/> class.
|
||||
/// </summary>
|
||||
@@ -58,12 +57,11 @@ private:
|
||||
/// <seealso cref="BinaryAsset" />
|
||||
API_CLASS(NoSpawn, Sealed) class FLAXENGINE_API VisualScript : public BinaryAsset
|
||||
{
|
||||
DECLARE_BINARY_ASSET_HEADER(VisualScript, 1);
|
||||
DECLARE_BINARY_ASSET_HEADER(VisualScript, 1);
|
||||
friend VisualScripting;
|
||||
friend VisualScriptExecutor;
|
||||
friend VisualScriptingBinaryModule;
|
||||
public:
|
||||
|
||||
/// <summary>
|
||||
/// Visual Script flag types.
|
||||
/// </summary>
|
||||
@@ -90,7 +88,7 @@ public:
|
||||
/// </summary>
|
||||
API_STRUCT() struct Metadata
|
||||
{
|
||||
DECLARE_SCRIPTING_TYPE_MINIMAL(Metadata);
|
||||
DECLARE_SCRIPTING_TYPE_MINIMAL(Metadata);
|
||||
|
||||
/// <summary>
|
||||
/// The base class typename.
|
||||
@@ -147,7 +145,6 @@ public:
|
||||
};
|
||||
|
||||
private:
|
||||
|
||||
Dictionary<Guid, Instance> _instances;
|
||||
ScriptingTypeHandle _scriptingTypeHandle;
|
||||
ScriptingTypeHandle _scriptingTypeHandleCached;
|
||||
@@ -160,7 +157,6 @@ private:
|
||||
#endif
|
||||
|
||||
public:
|
||||
|
||||
/// <summary>
|
||||
/// The Visual Script graph.
|
||||
/// </summary>
|
||||
@@ -172,7 +168,6 @@ public:
|
||||
API_FIELD(ReadOnly) Metadata Meta;
|
||||
|
||||
public:
|
||||
|
||||
/// <summary>
|
||||
/// Gets the typename of the Visual Script. Identifies it's scripting type.
|
||||
/// </summary>
|
||||
@@ -280,7 +275,6 @@ public:
|
||||
#endif
|
||||
|
||||
public:
|
||||
|
||||
// [BinaryAsset]
|
||||
#if USE_EDITOR
|
||||
void GetReferences(Array<Guid>& output) const override
|
||||
@@ -293,14 +287,12 @@ public:
|
||||
#endif
|
||||
|
||||
protected:
|
||||
|
||||
// [BinaryAsset]
|
||||
LoadResult load() override;
|
||||
void unload(bool isReloading) override;
|
||||
AssetChunksFlag getChunksToPreload() const override;
|
||||
|
||||
private:
|
||||
|
||||
void CacheScriptingType();
|
||||
};
|
||||
|
||||
@@ -312,25 +304,21 @@ class FLAXENGINE_API VisualScriptingBinaryModule : public BinaryModule
|
||||
{
|
||||
friend VisualScript;
|
||||
private:
|
||||
|
||||
StringAnsi _name;
|
||||
|
||||
public:
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="VisualScriptingBinaryModule"/> class.
|
||||
/// </summary>
|
||||
VisualScriptingBinaryModule();
|
||||
|
||||
public:
|
||||
|
||||
/// <summary>
|
||||
/// The visual script assets loaded into the module with exposes scripting types. Order matches the Types array.
|
||||
/// </summary>
|
||||
Array<AssetReference<VisualScript>> Scripts;
|
||||
|
||||
private:
|
||||
|
||||
static ScriptingObject* VisualScriptObjectSpawn(const ScriptingObjectSpawnParams& params);
|
||||
#if USE_EDITOR
|
||||
void OnScriptsReloading();
|
||||
@@ -338,7 +326,6 @@ private:
|
||||
static void OnEvent(ScriptingObject* object, Span<Variant> parameters, ScriptingTypeHandle eventType, StringView eventName);
|
||||
|
||||
public:
|
||||
|
||||
// [BinaryModule]
|
||||
const StringAnsi& GetName() const override;
|
||||
bool IsLoaded() const override;
|
||||
@@ -363,7 +350,6 @@ public:
|
||||
class FLAXENGINE_API VisualScripting
|
||||
{
|
||||
public:
|
||||
|
||||
struct NodeBoxValue
|
||||
{
|
||||
uint32 NodeId;
|
||||
|
||||
Reference in New Issue
Block a user