diff --git a/.github/workflows/build_linux.todo b/.github/workflows/build_linux.todo
new file mode 100644
index 000000000..9c3b21624
--- /dev/null
+++ b/.github/workflows/build_linux.todo
@@ -0,0 +1,19 @@
+name: Build Linux
+on: [push, pull_request]
+
+jobs:
+
+ # Game
+ game-linux:
+ name: Game (Linux, Release x64)
+ runs-on: "ubuntu-20.04"
+ steps:
+ - name: Checkout repo
+ uses: actions/checkout@v2
+ - name: Checkout LFS
+ run: |
+ git lfs version
+ git lfs pull
+ - name: Build
+ run: |
+ ./Development/Scripts/Linux/CallBuildTool.sh -build -log -arch=x64 -platform=Linux -configuration=Release -buildtargets=FlaxGame
diff --git a/.github/workflows/build_windows.yml b/.github/workflows/build_windows.yml
new file mode 100644
index 000000000..690d6747b
--- /dev/null
+++ b/.github/workflows/build_windows.yml
@@ -0,0 +1,34 @@
+name: Build Windows
+on: [push, pull_request]
+
+jobs:
+
+ # Editor
+ editor-windows:
+ name: Editor (Windows, Development x64)
+ runs-on: "windows-latest"
+ steps:
+ - name: Checkout repo
+ uses: actions/checkout@v2
+ - name: Checkout LFS
+ run: |
+ git lfs version
+ git lfs pull
+ - name: Build
+ run: |
+ .\Development\Scripts\Windows\CallBuildTool.bat -build -log -arch=x64 -platform=Windows -configuration=Development -buildtargets=FlaxEditor
+
+ # Game
+ game-windows:
+ name: Game (Windows, Release x64)
+ runs-on: "windows-latest"
+ steps:
+ - name: Checkout repo
+ uses: actions/checkout@v2
+ - name: Checkout LFS
+ run: |
+ git lfs version
+ git lfs pull
+ - name: Build
+ run: |
+ .\Development\Scripts\Windows\CallBuildTool.bat -build -log -arch=x64 -platform=Windows -configuration=Release -buildtargets=FlaxGame
diff --git a/Content/Editor/Camera/M_Camera.flax b/Content/Editor/Camera/M_Camera.flax
index 0631de26c..b5473caa3 100644
--- a/Content/Editor/Camera/M_Camera.flax
+++ b/Content/Editor/Camera/M_Camera.flax
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
-oid sha256:52c68260bfdf79f3cc9addea31680379c89c804b07a932d363be0254d44f708a
-size 38302
+oid sha256:b8b77651be81af931c1e63c1cb411b9f2764b4b0be4a7fa51e2c3c043a063435
+size 38085
diff --git a/Content/Editor/Gizmo/Material.flax b/Content/Editor/Gizmo/Material.flax
index c65bf8bfc..b4917f502 100644
--- a/Content/Editor/Gizmo/Material.flax
+++ b/Content/Editor/Gizmo/Material.flax
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
-oid sha256:cc1c77fbc5849a052d5a677c936d3fc1a926d3acde7595d02ef3b3bca6f9e287
-size 36009
+oid sha256:85435f0342a96eeebad705692df74ec19871e28bc35a3d3046f8f63dee4d9334
+size 35945
diff --git a/Content/Editor/Gizmo/MaterialWire.flax b/Content/Editor/Gizmo/MaterialWire.flax
index ebd8e8d97..888846500 100644
--- a/Content/Editor/Gizmo/MaterialWire.flax
+++ b/Content/Editor/Gizmo/MaterialWire.flax
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
-oid sha256:918b4f7c7dde101ebe9b3e757cde61718413408f585159173cd87372671af006
-size 35222
+oid sha256:9ab58f495cdd9fee4c81332a291bbee4f1adc327d7d14b5158d4360aac1ef8fa
+size 35158
diff --git a/Content/Editor/Gizmo/SelectionOutlineMaterial.flax b/Content/Editor/Gizmo/SelectionOutlineMaterial.flax
index 661897e62..48a87ba88 100644
--- a/Content/Editor/Gizmo/SelectionOutlineMaterial.flax
+++ b/Content/Editor/Gizmo/SelectionOutlineMaterial.flax
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
-oid sha256:06b86af6ada11a767d70ebb5b633b998bbfc9fcdc507b09597fc8070d7bf4a4e
-size 16115
+oid sha256:f578d4b9e0dbd295de0674cf46cfc5d2894db225fd2c3cfc443c6f2e9c7167d3
+size 15941
diff --git a/Content/Editor/Highlight Material.flax b/Content/Editor/Highlight Material.flax
index 2b1baa997..9f1de8fcd 100644
--- a/Content/Editor/Highlight Material.flax
+++ b/Content/Editor/Highlight Material.flax
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
-oid sha256:889bfcffc68926671e3915300900c6d5908b4c1a5981f815d56f0aa3877e672a
-size 35420
+oid sha256:0eba0cb1115fb6510ed32159a8fa5a81bbfabfd0e6ec00f4d5ccbfa0426fad97
+size 35356
diff --git a/Content/Editor/Icons/IconsMaterial.flax b/Content/Editor/Icons/IconsMaterial.flax
index 9d4eefd96..91bba0296 100644
--- a/Content/Editor/Icons/IconsMaterial.flax
+++ b/Content/Editor/Icons/IconsMaterial.flax
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
-oid sha256:9e2b53c83b4f1ac7908e0af6b5d917ccc617c74a67665d8484db8b9709c5bb85
-size 35353
+oid sha256:51bceae1877ea1859c8757a1e21abade8cf21eda8857d3204bf4b0239fc66d18
+size 35289
diff --git a/Content/Editor/MaterialTemplates/Decal.shader b/Content/Editor/MaterialTemplates/Decal.shader
index 1e2076211..e0253efd6 100644
--- a/Content/Editor/MaterialTemplates/Decal.shader
+++ b/Content/Editor/MaterialTemplates/Decal.shader
@@ -114,8 +114,7 @@ Material GetMaterialPS(MaterialInput input)
@4
}
-// Programmatically set the line number after all the material inputs which have a variable number of line endings
-// This allows shader error line numbers after this point to be the same regardless of which material is being compiled
+// Fix line for errors/warnings for shader code from template
#line 1000
// Input macro specified by the material: DECAL_BLEND_MODE
@@ -160,12 +159,9 @@ void PS_Decal(
float3 positionWS = positionHS.xyz / positionHS.w;
float3 positionOS = mul(float4(positionWS, 1), InvWorld).xyz;
- // Clip content outside the decal
clip(0.5 - abs(positionOS.xyz));
-
- // By default, map textures using the vectors perpendicular to the projection direction
float2 decalUVs = positionOS.xz + 0.5f;
-
+
// Setup material input
MaterialInput materialInput = (MaterialInput)0;
materialInput.WorldPosition = positionWS;
diff --git a/Content/Editor/MaterialTemplates/GUI.shader b/Content/Editor/MaterialTemplates/GUI.shader
index 6d3c11dc2..1457a0bc3 100644
--- a/Content/Editor/MaterialTemplates/GUI.shader
+++ b/Content/Editor/MaterialTemplates/GUI.shader
@@ -197,8 +197,7 @@ Material GetMaterialPS(MaterialInput input)
@4
}
-// Programmatically set the line number after all the material inputs which have a variable number of line endings
-// This allows shader error line numbers after this point to be the same regardless of which material is being compiled
+// Fix line for errors/warnings for shader code from template
#line 1000
// Vertex Shader function for GUI materials rendering
diff --git a/Content/Editor/MaterialTemplates/Particle.shader b/Content/Editor/MaterialTemplates/Particle.shader
index cd7f163d0..5fd161645 100644
--- a/Content/Editor/MaterialTemplates/Particle.shader
+++ b/Content/Editor/MaterialTemplates/Particle.shader
@@ -330,8 +330,7 @@ Material GetMaterialPS(MaterialInput input)
@4
}
-// Programmatically set the line number after all the material inputs which have a variable number of line endings
-// This allows shader error line numbers after this point to be the same regardless of which material is being compiled
+// Fix line for errors/warnings for shader code from template
#line 1000
// Calculates the transform matrix from mesh tangent space to local space
@@ -834,7 +833,7 @@ float4 PS_Distortion(PixelInput input) : SV_Target0
// Scale up for better precision in low/subtle refractions at the expense of artefacts at higher refraction
distortion *= 4.0f;
- // Store positive and negative offsets separately
+ // Use separate storage for positive and negative offsets
float2 addOffset = max(distortion, 0);
float2 subOffset = abs(min(distortion, 0));
return float4(addOffset.x, addOffset.y, subOffset.x, subOffset.y);
diff --git a/Content/Editor/MaterialTemplates/PostProcess.shader b/Content/Editor/MaterialTemplates/PostProcess.shader
index d4a5424bf..dad9795af 100644
--- a/Content/Editor/MaterialTemplates/PostProcess.shader
+++ b/Content/Editor/MaterialTemplates/PostProcess.shader
@@ -134,8 +134,7 @@ Material GetMaterialPS(MaterialInput input)
@4
}
-// Programmatically set the line number after all the material inputs which have a variable number of line endings
-// This allows shader error line numbers after this point to be the same regardless of which material is being compiled
+// Fix line for errors/warnings for shader code from template
#line 1000
// Pixel Shader function for PostFx materials rendering
diff --git a/Content/Editor/MaterialTemplates/SurfaceDeferred.shader b/Content/Editor/MaterialTemplates/SurfaceDeferred.shader
index cc65235c0..6f393464b 100644
--- a/Content/Editor/MaterialTemplates/SurfaceDeferred.shader
+++ b/Content/Editor/MaterialTemplates/SurfaceDeferred.shader
@@ -340,8 +340,7 @@ Material GetMaterialPS(MaterialInput input)
@4
}
-// Programmatically set the line number after all the material inputs which have a variable number of line endings
-// This allows shader error line numbers after this point to be the same regardless of which material is being compiled
+// Fix line for errors/warnings for shader code from template
#line 1000
// Calculates the transform matrix from mesh tangent space to local space
@@ -500,7 +499,7 @@ float3x4 GetBoneMatrix(int index)
}
// Calculates the transposed transform matrix for the given vertex (uses blending)
-float3x4 CalcBoneMatrix(ModelInput_Skinned input)
+float3x4 GetBoneMatrix(ModelInput_Skinned input)
{
float3x4 boneMatrix = input.BlendWeights.x * GetBoneMatrix(input.BlendIndices.x);
boneMatrix += input.BlendWeights.y * GetBoneMatrix(input.BlendIndices.y);
@@ -549,7 +548,7 @@ VertexOutput VS_Skinned(ModelInput_Skinned input)
// Perform skinning
SkinningData data;
- data.BlendMatrix = CalcBoneMatrix(input);
+ data.BlendMatrix = GetBoneMatrix(input);
float3 position = SkinPosition(input, data);
float3x3 tangentToLocal = SkinTangents(input, data);
@@ -808,7 +807,6 @@ TessalationDSToPS DS(TessalationPatch constantData, float3 barycentricCoords : S
#define COPY(thing) output.thing = input[0].thing
INTERPOLATE(Position);
#if MATERIAL_TESSELLATION == MATERIAL_TESSELLATION_PN
- // Precompute squares and squares * 3
float UU = U * U;
float VV = V * V;
float WW = W * W;
diff --git a/Content/Editor/MaterialTemplates/SurfaceForward.shader b/Content/Editor/MaterialTemplates/SurfaceForward.shader
index 64fe054d4..7a97e5e5a 100644
--- a/Content/Editor/MaterialTemplates/SurfaceForward.shader
+++ b/Content/Editor/MaterialTemplates/SurfaceForward.shader
@@ -337,8 +337,7 @@ Material GetMaterialPS(MaterialInput input)
@4
}
-// Programmatically set the line number after all the material inputs which have a variable number of line endings
-// This allows shader error line numbers after this point to be the same regardless of which material is being compiled
+// Fix line for errors/warnings for shader code from template
#line 1000
// Calculates the transform matrix from mesh tangent space to local space
@@ -474,7 +473,7 @@ float3x4 GetBoneMatrix(int index)
}
// Calculates the transposed transform matrix for the given vertex (uses blending)
-float3x4 CalcBoneMatrix(ModelInput_Skinned input)
+float3x4 GetBoneMatrix(ModelInput_Skinned input)
{
float3x4 boneMatrix = input.BlendWeights.x * GetBoneMatrix(input.BlendIndices.x);
boneMatrix += input.BlendWeights.y * GetBoneMatrix(input.BlendIndices.y);
@@ -521,7 +520,7 @@ VertexOutput VS_Skinned(ModelInput_Skinned input)
// Perform skinning
SkinningData data;
- data.BlendMatrix = CalcBoneMatrix(input);
+ data.BlendMatrix = GetBoneMatrix(input);
float3 position = SkinPosition(input, data);
half3x3 tangentToLocal = SkinTangents(input, data);
@@ -755,7 +754,6 @@ TessalationDSToPS DS(TessalationPatch constantData, float3 barycentricCoords : S
#define COPY(thing) output.thing = input[0].thing
INTERPOLATE(Position);
#if MATERIAL_TESSELLATION == MATERIAL_TESSELLATION_PN
- // Precompute squares and squares * 3
float UU = U * U;
float VV = V * V;
float WW = W * W;
@@ -977,8 +975,8 @@ float4 PS_Distortion(PixelInput input) : SV_Target0
// Scale up for better precision in low/subtle refractions at the expense of artefacts at higher refraction
distortion *= 4.0f;
-
- // Store positive and negative offsets separately
+
+ // Use separate storage for positive and negative offsets
float2 addOffset = max(distortion, 0);
float2 subOffset = abs(min(distortion, 0));
return float4(addOffset.x, addOffset.y, subOffset.x, subOffset.y);
diff --git a/Content/Editor/MaterialTemplates/Terrain.shader b/Content/Editor/MaterialTemplates/Terrain.shader
index b05ebd91c..03a2081bf 100644
--- a/Content/Editor/MaterialTemplates/Terrain.shader
+++ b/Content/Editor/MaterialTemplates/Terrain.shader
@@ -234,8 +234,7 @@ Material GetMaterialPS(MaterialInput input)
@4
}
-// Programmatically set the line number after all the material inputs which have a variable number of line endings
-// This allows shader error line numbers after this point to be the same regardless of which material is being compiled
+// Fix line for errors/warnings for shader code from template
#line 1000
// Calculates LOD value (with fractional part for blending)
@@ -595,7 +594,6 @@ TessalationDSToPS DS(TessalationPatch constantData, float3 barycentricCoords : S
#define COPY(thing) output.thing = input[0].thing
INTERPOLATE(Position);
#if MATERIAL_TESSELLATION == MATERIAL_TESSELLATION_PN
- // Precompute squares and squares * 3
float UU = U * U;
float VV = V * V;
float WW = W * W;
diff --git a/Content/Editor/Particles/Smoke Material.flax b/Content/Editor/Particles/Smoke Material.flax
index 798c422f2..a3ae100ca 100644
--- a/Content/Editor/Particles/Smoke Material.flax
+++ b/Content/Editor/Particles/Smoke Material.flax
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
-oid sha256:a464d781c863bc54c43341cd68cc06726e6badd12813e381fefc8ba3dfd54fb4
-size 36574
+oid sha256:4c8642a2a7024ae38ae371d95c3411d8e362f42ef98c54dc9da9c061d2a568c1
+size 36552
diff --git a/Content/Editor/Wires Debug Material.flax b/Content/Editor/Wires Debug Material.flax
index 146d8dba1..9dedbfea2 100644
--- a/Content/Editor/Wires Debug Material.flax
+++ b/Content/Editor/Wires Debug Material.flax
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
-oid sha256:f5980c96def69ba574b2feb1337d9dd23c56a28779df9601252545b1a01b452d
-size 35420
+oid sha256:cb08e24a379cd67db22025bf5e3ae84979f0686179db871387d388f11aae20f0
+size 35356
diff --git a/Content/Engine/DefaultMaterial.flax b/Content/Engine/DefaultMaterial.flax
index 23401a029..cd7cd19e0 100644
--- a/Content/Engine/DefaultMaterial.flax
+++ b/Content/Engine/DefaultMaterial.flax
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
-oid sha256:fc0d25b2686512eba5f52691d45ee2e8348d578d627299953e5cec4f97e5e074
-size 40081
+oid sha256:d195b3434472636eff8e34a2052f1ef5d02b1415802414bad6e15f21d0b16de8
+size 39864
diff --git a/Content/Engine/DefaultTerrainMaterial.flax b/Content/Engine/DefaultTerrainMaterial.flax
index d1b0de859..be5145720 100644
--- a/Content/Engine/DefaultTerrainMaterial.flax
+++ b/Content/Engine/DefaultTerrainMaterial.flax
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
-oid sha256:138d3bbb4297dd585c8a0a4ecfd8e48ae542c71d8aff2a199ed28d51d4ced4cf
-size 28896
+oid sha256:98a8347591e895fccbe327f393d6376ad1113321daa8a7ad4f47d0753c2e76a1
+size 28681
diff --git a/Content/Shaders/AtmospherePreCompute.flax b/Content/Shaders/AtmospherePreCompute.flax
index 753bb46dc..356a065bc 100644
--- a/Content/Shaders/AtmospherePreCompute.flax
+++ b/Content/Shaders/AtmospherePreCompute.flax
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
-oid sha256:7435c6133694bd0f4fbff46978b5813bdbf9faa21763e9cf702410a6cd041585
+oid sha256:2b2a649dd7640652194df4bf6c0e21f0ae43fa2935bf1f095efee8ded8e60be7
size 11720
diff --git a/Content/Shaders/BakeLightmap.flax b/Content/Shaders/BakeLightmap.flax
index f84e6a94a..6e813205f 100644
--- a/Content/Shaders/BakeLightmap.flax
+++ b/Content/Shaders/BakeLightmap.flax
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
-oid sha256:5fde14495e73f8433e6b529cf152fb8c3cf0f0ac69064e087a68acd5511251df
+oid sha256:17295767d488dc2b64a1794ceda8b4d68f20dd2c5f1a8fdbe6f7940a070f9724
size 16095
diff --git a/Content/Shaders/BitonicSort.flax b/Content/Shaders/BitonicSort.flax
index dda68df88..c8a9e901c 100644
--- a/Content/Shaders/BitonicSort.flax
+++ b/Content/Shaders/BitonicSort.flax
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
-oid sha256:e67cf2342b037ae696c72aa670aed7b9c7c5a07cc4cc295b9c963ca600e1cf01
+oid sha256:c8371a1f4e0631e69f6dc6dbb8e11c8618351a7083293078270d60599f739e9f
size 6725
diff --git a/Content/Shaders/ColorGrading.flax b/Content/Shaders/ColorGrading.flax
index b89d4b22b..9450d5cdc 100644
--- a/Content/Shaders/ColorGrading.flax
+++ b/Content/Shaders/ColorGrading.flax
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
-oid sha256:ae31d654f71cd691f66cd140fd066ad2cf8a31d984f62f411173972471b9022b
-size 10987
+oid sha256:1c7e39df4b34a1393a227a39e4d86ce21f82a8116a72e741e7ec4f39bbb82bbe
+size 10870
diff --git a/Content/Shaders/DebugDraw.flax b/Content/Shaders/DebugDraw.flax
index fd44cbe12..6e2db8bf9 100644
--- a/Content/Shaders/DebugDraw.flax
+++ b/Content/Shaders/DebugDraw.flax
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
-oid sha256:b6fea1d9b7d7fbfc51337c06017a87f929b5238e8c8108862d4aa9724ad3dadd
+oid sha256:17006324e818ddff6880b7c6b23a49fec90111c185a6355153ae79ab4b244807
size 1746
diff --git a/Content/Shaders/DepthOfField.flax b/Content/Shaders/DepthOfField.flax
index a0831c322..a84047429 100644
--- a/Content/Shaders/DepthOfField.flax
+++ b/Content/Shaders/DepthOfField.flax
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
-oid sha256:bea89bc4545dd7268448f3a66b7176801759744eb1f625e8c036fdd064fa4cfe
+oid sha256:92355644db4cdfd96250b779a87385e6805d01ce084801b3a4be704f026e9bca
size 21025
diff --git a/Content/Shaders/Editor/LightmapUVsDensity.flax b/Content/Shaders/Editor/LightmapUVsDensity.flax
index 257b7755b..4e5fdf379 100644
--- a/Content/Shaders/Editor/LightmapUVsDensity.flax
+++ b/Content/Shaders/Editor/LightmapUVsDensity.flax
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
-oid sha256:4492f139ebb5377b1450a74e28a33dd0dddb24480b7dad7506f833173091bd1b
+oid sha256:8801204604fb09783de7f7054929a882546bbfbe8bf8aeb5f4366368b354c87c
size 4509
diff --git a/Content/Shaders/Editor/VertexColors.flax b/Content/Shaders/Editor/VertexColors.flax
index 80b2b83fc..20ef9a4d5 100644
--- a/Content/Shaders/Editor/VertexColors.flax
+++ b/Content/Shaders/Editor/VertexColors.flax
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
-oid sha256:dfced13aa6d3098566c42d7a0c3b5c486c59fdeca1c75b0a48866090fad9804b
+oid sha256:72bccc6b6f51e175676c82eb615bfcaadd2b54a11e79553b0fe79ee37649766d
size 2102
diff --git a/Content/Shaders/EyeAdaptation.flax b/Content/Shaders/EyeAdaptation.flax
index 559b58a25..9c538e798 100644
--- a/Content/Shaders/EyeAdaptation.flax
+++ b/Content/Shaders/EyeAdaptation.flax
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
-oid sha256:a635936a583a1b8da5d30587567b0f5ba0951e98e003077f19ced2a80a124d75
+oid sha256:c12b7b43743e4e609a4155d7a4117421298d679d07548ffa48a386da496556b0
size 4605
diff --git a/Content/Shaders/FXAA.flax b/Content/Shaders/FXAA.flax
index dd2efc5e5..57dbb6e2c 100644
--- a/Content/Shaders/FXAA.flax
+++ b/Content/Shaders/FXAA.flax
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
-oid sha256:71c3aa093a2af316dee10553ac1225da0d206ee88cf288543fb207a6134924f4
+oid sha256:a44e1c0c006d78f87cebde66a398cf61d50c5f4770f462df0e62c03680359f46
size 24774
diff --git a/Content/Shaders/Fog.flax b/Content/Shaders/Fog.flax
index f3376447a..f14e38c72 100644
--- a/Content/Shaders/Fog.flax
+++ b/Content/Shaders/Fog.flax
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
-oid sha256:574afd4d29bf42d17dfbc3da1b9841c1bfac8e8f4f05ff2b1ca9658eb5b8d159
+oid sha256:ec58d56ac1e0b7063960d15beb4151dd67d7e0f31566e7ed65d390dc142ceea1
size 2878
diff --git a/Content/Shaders/Forward.flax b/Content/Shaders/Forward.flax
index 41ac2933a..e2051cac7 100644
--- a/Content/Shaders/Forward.flax
+++ b/Content/Shaders/Forward.flax
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
-oid sha256:0e2ec3d7ecb31942e65371e6b7c706b9fd8e8d1ba8ca824a3049f3d058058e84
-size 1467
+oid sha256:4d238e4d029e48032632a015ddf64a31e65746c1c3092a9d101aad70fc59053d
+size 1221
diff --git a/Content/Shaders/GBuffer.flax b/Content/Shaders/GBuffer.flax
index bef552135..6bd1d00fd 100644
--- a/Content/Shaders/GBuffer.flax
+++ b/Content/Shaders/GBuffer.flax
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
-oid sha256:4ed560c1adc9cbeb2f37c3e83946d167b5f05ef36f7e737c75cf1d8289f2f4b4
+oid sha256:c62bd111fc8e6a141194cb6c6b19252b7131249423a3d33a76877117cdcf9313
size 2845
diff --git a/Content/Shaders/GPUParticlesSorting.flax b/Content/Shaders/GPUParticlesSorting.flax
index 4e92309cb..11f71859f 100644
--- a/Content/Shaders/GPUParticlesSorting.flax
+++ b/Content/Shaders/GPUParticlesSorting.flax
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
-oid sha256:8b538e7ae923869442330860d392a0f6adc921e26602d8b216caa8e1f2c9149d
+oid sha256:104d6256028b42fb4123c4b01273c9c514d6bd08fa747869ca3f970298d0f4ff
size 2726
diff --git a/Content/Shaders/GUI.flax b/Content/Shaders/GUI.flax
index 7db2c18c4..73fd80725 100644
--- a/Content/Shaders/GUI.flax
+++ b/Content/Shaders/GUI.flax
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
-oid sha256:90124cb9b6acf303aedb04e8ef3b53676031efd2c9fae3e641d74384ecbeab70
+oid sha256:ea8cffddde04c7f3829ce0bd0cb61deecb50a9ac954c552cddb72d182538d605
size 5108
diff --git a/Content/Shaders/Histogram.flax b/Content/Shaders/Histogram.flax
index 557232811..ee7190ced 100644
--- a/Content/Shaders/Histogram.flax
+++ b/Content/Shaders/Histogram.flax
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
-oid sha256:d308ec40abf308fe3d713abb124dbc7f0094c8e141dfa9a9600888deb0601804
+oid sha256:a0ac3be10c9a0da0c039c45c391d78116bd0d8bb721d277158c16f879d75f718
size 2609
diff --git a/Content/Shaders/Lights.flax b/Content/Shaders/Lights.flax
index 1eeb9563f..a6401aee5 100644
--- a/Content/Shaders/Lights.flax
+++ b/Content/Shaders/Lights.flax
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
-oid sha256:2a37a2bd9a2e7296c23ccb719b77143383e9f52aed8879f7637f0247c48bf3c6
+oid sha256:9bbaf37af5232f37872110c03b81b0089272a53b3acec637f41e15aaaff9370b
size 5209
diff --git a/Content/Shaders/MotionBlur.flax b/Content/Shaders/MotionBlur.flax
index 2f93589f0..b055675b7 100644
--- a/Content/Shaders/MotionBlur.flax
+++ b/Content/Shaders/MotionBlur.flax
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
-oid sha256:1bb224fc630264fcfa58c6d8ce27759e44d3f989a53655dc35959e594890d146
-size 1838
+oid sha256:6009c2b534a935859584d79b3e7a3fc0f98f2579cfa47e91b8d66fc53e3f9709
+size 9685
diff --git a/Content/Shaders/MultiScaler.flax b/Content/Shaders/MultiScaler.flax
index a89ebfb53..1e35e8206 100644
--- a/Content/Shaders/MultiScaler.flax
+++ b/Content/Shaders/MultiScaler.flax
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
-oid sha256:f3e0974edbf259ee284aab355735c281740ed05808fbed97f0ad6dc0ce3c2a0a
+oid sha256:941d8e300f269bd23a6b3f7e6016af650e96d353bf1f29657553ee7dcb38c5bb
size 3929
diff --git a/Content/Shaders/PostProcessing.flax b/Content/Shaders/PostProcessing.flax
index cd3923673..93ebd93ce 100644
--- a/Content/Shaders/PostProcessing.flax
+++ b/Content/Shaders/PostProcessing.flax
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
-oid sha256:6933ed1b8e8257ca9bd0a5e25deda41d3d79fff2d3aefb2b6be5b8e8d308c5f6
-size 17028
+oid sha256:1c6147f7d8510a8660320d00f366384fb858807562a59e41353fc83070deb0b8
+size 17000
diff --git a/Content/Shaders/ProbesFilter.flax b/Content/Shaders/ProbesFilter.flax
index 91fe4a08b..e7236e5af 100644
--- a/Content/Shaders/ProbesFilter.flax
+++ b/Content/Shaders/ProbesFilter.flax
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
-oid sha256:78d5d554e4dc59fdb9bcfef7c4ad0ee96cebb79b67e3e443a5a580e4e664135a
+oid sha256:574890175f7f2bc1a4a99b85a5fc7facb34fae4a8e3ad3aa2b8fd545ff4f5d58
size 4980
diff --git a/Content/Shaders/Quad.flax b/Content/Shaders/Quad.flax
index fc0a8359f..b6f825e11 100644
--- a/Content/Shaders/Quad.flax
+++ b/Content/Shaders/Quad.flax
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
-oid sha256:21e9c3fc030a85a59295b026f33790f8da824df0f9c6eab48eb37115998acdc4
+oid sha256:b7e3b297da6f455817ca392238d3d629f92a3e6be0564ec02892e80e819bc060
size 2310
diff --git a/Content/Shaders/Reflections.flax b/Content/Shaders/Reflections.flax
index 0ea38f099..395c4ac5d 100644
--- a/Content/Shaders/Reflections.flax
+++ b/Content/Shaders/Reflections.flax
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
-oid sha256:80f5dec0b968c92460069a0e194a4768341f312f770f7b1e355fba119d45d480
+oid sha256:412e3c4d5ba2d28cc47019f9ed0813141e1b42cc3fe20e80c91a9712a19cb804
size 3288
diff --git a/Content/Shaders/SMAA.flax b/Content/Shaders/SMAA.flax
index 0b24ed466..2375a0ec2 100644
--- a/Content/Shaders/SMAA.flax
+++ b/Content/Shaders/SMAA.flax
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
-oid sha256:ba606acbf34c101f25f4ad8004dad01e04c02b51fa7d62ec4e939d606f954393
+oid sha256:efa07f6d334a4bd93d2d9482131ea4ee8dcacb1638536c30f8454e758b5ae4a1
size 47673
diff --git a/Content/Shaders/SSAO.flax b/Content/Shaders/SSAO.flax
index 0876ab6a7..43d2b12de 100644
--- a/Content/Shaders/SSAO.flax
+++ b/Content/Shaders/SSAO.flax
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
-oid sha256:154d66b27b6010b2c27c68c8c7d8087a242ddd24fd0bc7982fdbda6aa59df563
+oid sha256:e2e64ca23dbc5d61814e5510532caf3fc90046924185804ea050266f4410200e
size 37614
diff --git a/Content/Shaders/SSR.flax b/Content/Shaders/SSR.flax
index 25dbf176c..4ec88e109 100644
--- a/Content/Shaders/SSR.flax
+++ b/Content/Shaders/SSR.flax
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
-oid sha256:a76d5105eb8c915939d9855d9d65f50bb2001d4fc4342faf95038b0c6c8f339e
+oid sha256:23f804b30a54f92c8f1fd59270fbcc30360d9c4c875534117b3e357eff62aee9
size 13442
diff --git a/Content/Shaders/Shadows.flax b/Content/Shaders/Shadows.flax
index f5cc0cdbd..ca47c58cd 100644
--- a/Content/Shaders/Shadows.flax
+++ b/Content/Shaders/Shadows.flax
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
-oid sha256:e02e444708fce9d576dc59769905381546a49be2b593a83b524393e2986dedf2
+oid sha256:a6d9a32a1d994a97a18f01a7de07a2239012b87e8c694ab2007b96fe0f583ed5
size 7847
diff --git a/Content/Shaders/Sky.flax b/Content/Shaders/Sky.flax
index 19013517e..0c8a970f3 100644
--- a/Content/Shaders/Sky.flax
+++ b/Content/Shaders/Sky.flax
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
-oid sha256:f2aa068d9f425e50061c8a037136177e51dbd8f2065f37a7d0fc01388257c640
+oid sha256:836db6e4ac2e57bbe0622e8ead4199ae66f5947e79696fff748b77ac60ca77b7
size 3585
diff --git a/Content/Shaders/TAA.flax b/Content/Shaders/TAA.flax
index 17564fda3..f14be47f6 100644
--- a/Content/Shaders/TAA.flax
+++ b/Content/Shaders/TAA.flax
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
-oid sha256:83d415b15679c8203b8db16d9b7ef99a74aa8e07ba2753109d6d3e4eeba2cece
+oid sha256:18053d25260b9636af403508225c1a7934ddf92a60c52c426b70c057ac53e559
size 712
diff --git a/Content/Shaders/VolumetricFog.flax b/Content/Shaders/VolumetricFog.flax
index 4cd23cb0c..7b43cbc02 100644
--- a/Content/Shaders/VolumetricFog.flax
+++ b/Content/Shaders/VolumetricFog.flax
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
-oid sha256:6e278259855304359f5cf5d4860c5d473eaae4ae20cdfe73a8b311fdfc00b1aa
-size 14492
+oid sha256:73843444b47005497bc974921c57508c8c6d0bc2d6ecb77b01900a3537654f1b
+size 14259
diff --git a/Development/Scripts/Linux/CallBuildTool.sh b/Development/Scripts/Linux/CallBuildTool.sh
old mode 100644
new mode 100755
diff --git a/Flax.flaxproj b/Flax.flaxproj
index eb99c004a..26fb340ba 100644
--- a/Flax.flaxproj
+++ b/Flax.flaxproj
@@ -3,10 +3,10 @@
"Version": {
"Major": 1,
"Minor": 0,
- "Build": 6214
+ "Build": 6215
},
"Company": "Flax",
- "Copyright": "Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.",
+ "Copyright": "Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.",
"GameTarget": "FlaxGame",
"EditorTarget": "FlaxEditor"
}
\ No newline at end of file
diff --git a/GenerateProjectFiles.bat b/GenerateProjectFiles.bat
index 3c681bcaa..5db8aaf55 100644
--- a/GenerateProjectFiles.bat
+++ b/GenerateProjectFiles.bat
@@ -6,34 +6,18 @@ setlocal
pushd
echo Generating Flax Engine project files...
-rem Make sure the batch file exists in the root folder.
-if not exist "%~dp0\Source" goto Error_BatchFileInWrongLocation
-if not exist "Development\Scripts\Windows\CallBuildTool.bat" goto Error_BatchFileInWrongLocation
-
rem Run Flax.Build to generate Visual Studio solution and project files (also pass the arguments)
call "Development\Scripts\Windows\CallBuildTool.bat" -genproject %*
-if errorlevel 1 goto Error_BuildToolFailed
+if errorlevel 1 goto BuildToolFailed
-rem Done.
popd
echo Done!
exit /B 0
-:Error_BatchFileInWrongLocation
-echo.
-echo The batch file does not appear to be located in the root directory. This script must be run from within that directory.
-echo.
-pause
-goto Exit
-
-:Error_BuildToolFailed
-echo.
+:BuildToolFailed
echo Flax.Build tool failed.
-echo.
-pause
goto Exit
:Exit
-rem Restore original directory before exit.
popd
exit /B 1
diff --git a/GenerateProjectFiles.sh b/GenerateProjectFiles.sh
old mode 100644
new mode 100755
diff --git a/PackageAll.bat b/PackageAll.bat
index da9113aa5..95bf040a8 100644
--- a/PackageAll.bat
+++ b/PackageAll.bat
@@ -6,32 +6,18 @@ setlocal
pushd
echo Performing the full package...
-rem Make sure the batch file exists in the root folder.
-if not exist "%~dp0\Source" goto Error_BatchFileInWrongLocation
-if not exist "Development\Scripts\Windows\CallBuildTool.bat" goto Error_BatchFileInWrongLocation
-
rem Run the build tool.
call "Development\Scripts\Windows\CallBuildTool.bat" -deploy -deployEditor -deployPlatforms -verbose -log -logFile="Cache\Intermediate\PackageLog.txt" %*
-if errorlevel 1 goto Error_BuildToolFailed
+if errorlevel 1 goto BuildToolFailed
-rem Done.
popd
echo Done!
exit /B 0
-:Error_BatchFileInWrongLocation
-echo.
-echo The batch file does not appear to be located in the root directory. This script must be run from within that directory.
-echo.
-goto Exit
-
-:Error_BuildToolFailed
-echo.
+:BuildToolFailed
echo Flax.Build tool failed.
-echo.
goto Exit
:Exit
-rem Restore original directory before exit.
popd
exit /B 1
diff --git a/PackageEditor.bat b/PackageEditor.bat
index 7d7249e52..1590ab40c 100644
--- a/PackageEditor.bat
+++ b/PackageEditor.bat
@@ -6,32 +6,18 @@ setlocal
pushd
echo Building and packaging Flax Editor...
-rem Make sure the batch file exists in the root folder.
-if not exist "%~dp0\Source" goto Error_BatchFileInWrongLocation
-if not exist "Development\Scripts\Windows\CallBuildTool.bat" goto Error_BatchFileInWrongLocation
-
-rem Run Flax.Build to generate Visual Studio solution and project files (also pass the arguments)
+rem Run the build tool.
call "Development\Scripts\Windows\CallBuildTool.bat" -deploy -deployEditor -verbose -log -logFile="Cache\Intermediate\PackageLog.txt" %*
-if errorlevel 1 goto Error_BuildToolFailed
+if errorlevel 1 goto BuildToolFailed
-rem Done.
popd
echo Done!
exit /B 0
-:Error_BatchFileInWrongLocation
-echo.
-echo The batch file does not appear to be located in the root directory. This script must be run from within that directory.
-echo.
-goto Exit
-
-:Error_BuildToolFailed
-echo.
+:BuildToolFailed
echo Flax.Build tool failed.
-echo.
goto Exit
:Exit
-rem Restore original directory before exit.
popd
exit /B 1
diff --git a/PackagePlatforms.bat b/PackagePlatforms.bat
index 80cbd9ec5..c1eb954f5 100644
--- a/PackagePlatforms.bat
+++ b/PackagePlatforms.bat
@@ -6,32 +6,18 @@ setlocal
pushd
echo Building and packaging platforms data...
-rem Make sure the batch file exists in the root folder.
-if not exist "%~dp0\Source" goto Error_BatchFileInWrongLocation
-if not exist "Development\Scripts\Windows\CallBuildTool.bat" goto Error_BatchFileInWrongLocation
-
-rem Run Flax.Build to generate Visual Studio solution and project files (also pass the arguments)
+rem Run the build tool.
call "Development\Scripts\Windows\CallBuildTool.bat" -deploy -deployPlatforms -verbose -log -logFile="Cache\Intermediate\PackageLog.txt" %*
-if errorlevel 1 goto Error_BuildToolFailed
+if errorlevel 1 goto BuildToolFailed
-rem Done.
popd
echo Done!
exit /B 0
-:Error_BatchFileInWrongLocation
-echo.
-echo The batch file does not appear to be located in the root directory. This script must be run from within that directory.
-echo.
-goto Exit
-
-:Error_BuildToolFailed
-echo.
+:BuildToolFailed
echo Flax.Build tool failed.
-echo.
goto Exit
:Exit
-rem Restore original directory before exit.
popd
exit /B 1
diff --git a/PackagePlatforms.sh b/PackagePlatforms.sh
old mode 100644
new mode 100755
diff --git a/RegisterEngineLocation.bat b/RegisterEngineLocation.bat
index bb1a915a3..bd8c32cee 100644
--- a/RegisterEngineLocation.bat
+++ b/RegisterEngineLocation.bat
@@ -14,12 +14,12 @@ if not exist "%appdata%\Flax\Versions.txt" (
)
set EngineLocation=%cd%
find /c "%EngineLocation%" "%appdata%\Flax\Versions.txt"
-if %errorlevel% equ 1 goto notfound
+if %errorlevel% equ 1 goto NotFound
echo Already registered.
goto Done
rem Register the location (append to the end)
-:notfound
+:NotFound
echo Location '%EngineLocation%' is not registered. Adding it to the list of engine versions.
echo %EngineLocation%>>"%appdata%\Flax\Versions.txt"
goto Done
@@ -31,6 +31,5 @@ echo Done!
exit /B 0
:Exit
-rem Restore original directory before exit.
popd
exit /B 1
diff --git a/Source/Editor/Analytics/EditorAnalytics.cpp b/Source/Editor/Analytics/EditorAnalytics.cpp
index ed17b6249..b3ab6d23d 100644
--- a/Source/Editor/Analytics/EditorAnalytics.cpp
+++ b/Source/Editor/Analytics/EditorAnalytics.cpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#include "EditorAnalytics.h"
#include "EditorAnalyticsController.h"
diff --git a/Source/Editor/Analytics/EditorAnalytics.h b/Source/Editor/Analytics/EditorAnalytics.h
index bc0be7be7..bd2ff02e2 100644
--- a/Source/Editor/Analytics/EditorAnalytics.h
+++ b/Source/Editor/Analytics/EditorAnalytics.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Editor/Analytics/EditorAnalyticsController.cpp b/Source/Editor/Analytics/EditorAnalyticsController.cpp
index 928dd37b2..48dc83c6c 100644
--- a/Source/Editor/Analytics/EditorAnalyticsController.cpp
+++ b/Source/Editor/Analytics/EditorAnalyticsController.cpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#include "EditorAnalyticsController.h"
#include "Editor/Cooker/GameCooker.h"
diff --git a/Source/Editor/Analytics/EditorAnalyticsController.h b/Source/Editor/Analytics/EditorAnalyticsController.h
index 32516e2ae..4794aeca4 100644
--- a/Source/Editor/Analytics/EditorAnalyticsController.h
+++ b/Source/Editor/Analytics/EditorAnalyticsController.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Editor/Content/AssetItemConverter.cs b/Source/Editor/Content/AssetItemConverter.cs
index 7ae5ed26d..cad604659 100644
--- a/Source/Editor/Content/AssetItemConverter.cs
+++ b/Source/Editor/Content/AssetItemConverter.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using Newtonsoft.Json;
diff --git a/Source/Editor/Content/Create/CreateFileEntry.cs b/Source/Editor/Content/Create/CreateFileEntry.cs
index c0f8cc561..24307c89a 100644
--- a/Source/Editor/Content/Create/CreateFileEntry.cs
+++ b/Source/Editor/Content/Create/CreateFileEntry.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
namespace FlaxEditor.Content.Create
{
diff --git a/Source/Editor/Content/Create/CreateFilesDialog.cs b/Source/Editor/Content/Create/CreateFilesDialog.cs
index 028d14379..537cec5d5 100644
--- a/Source/Editor/Content/Create/CreateFilesDialog.cs
+++ b/Source/Editor/Content/Create/CreateFilesDialog.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using System.Collections.Generic;
diff --git a/Source/Editor/Content/Create/ParticleEmitterCreateEntry.cs b/Source/Editor/Content/Create/ParticleEmitterCreateEntry.cs
index a99229b6b..50e409562 100644
--- a/Source/Editor/Content/Create/ParticleEmitterCreateEntry.cs
+++ b/Source/Editor/Content/Create/ParticleEmitterCreateEntry.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using System.IO;
diff --git a/Source/Editor/Content/Create/SettingsCreateEntry.cs b/Source/Editor/Content/Create/SettingsCreateEntry.cs
index 009a13b13..369cc01e5 100644
--- a/Source/Editor/Content/Create/SettingsCreateEntry.cs
+++ b/Source/Editor/Content/Create/SettingsCreateEntry.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using FlaxEditor.Content.Settings;
diff --git a/Source/Editor/Content/Create/VisualScriptCreateEntry.cs b/Source/Editor/Content/Create/VisualScriptCreateEntry.cs
index a1348ab51..5fbc3bd3b 100644
--- a/Source/Editor/Content/Create/VisualScriptCreateEntry.cs
+++ b/Source/Editor/Content/Create/VisualScriptCreateEntry.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using FlaxEngine;
diff --git a/Source/Editor/Content/GUI/ContentNavigationButton.cs b/Source/Editor/Content/GUI/ContentNavigationButton.cs
index 633d4957b..ccd52953e 100644
--- a/Source/Editor/Content/GUI/ContentNavigationButton.cs
+++ b/Source/Editor/Content/GUI/ContentNavigationButton.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using FlaxEditor.GUI;
using FlaxEditor.GUI.Drag;
diff --git a/Source/Editor/Content/GUI/ContentView.DragDrop.cs b/Source/Editor/Content/GUI/ContentView.DragDrop.cs
index 2f15daaaf..f38832760 100644
--- a/Source/Editor/Content/GUI/ContentView.DragDrop.cs
+++ b/Source/Editor/Content/GUI/ContentView.DragDrop.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using FlaxEditor.GUI.Drag;
using FlaxEditor.SceneGraph;
diff --git a/Source/Editor/Content/GUI/ContentView.cs b/Source/Editor/Content/GUI/ContentView.cs
index 0730ac4ca..6cfdea210 100644
--- a/Source/Editor/Content/GUI/ContentView.cs
+++ b/Source/Editor/Content/GUI/ContentView.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using System.Collections.Generic;
diff --git a/Source/Editor/Content/IFileEntryAction.cs b/Source/Editor/Content/IFileEntryAction.cs
index d3edc5ca3..42d0ab482 100644
--- a/Source/Editor/Content/IFileEntryAction.cs
+++ b/Source/Editor/Content/IFileEntryAction.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
namespace FlaxEditor.Content
{
diff --git a/Source/Editor/Content/Import/AssetImportEntry.cs b/Source/Editor/Content/Import/AssetImportEntry.cs
index 2ca19351d..6ac67c893 100644
--- a/Source/Editor/Content/Import/AssetImportEntry.cs
+++ b/Source/Editor/Content/Import/AssetImportEntry.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
namespace FlaxEditor.Content.Import
{
diff --git a/Source/Editor/Content/Import/AudioImportSettings.cs b/Source/Editor/Content/Import/AudioImportSettings.cs
index 822b54a64..5c0b42cc8 100644
--- a/Source/Editor/Content/Import/AudioImportSettings.cs
+++ b/Source/Editor/Content/Import/AudioImportSettings.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System.ComponentModel;
using System.Reflection;
diff --git a/Source/Editor/Content/Import/FolderImportEntry.cs b/Source/Editor/Content/Import/FolderImportEntry.cs
index aaf13abc2..3586076a2 100644
--- a/Source/Editor/Content/Import/FolderImportEntry.cs
+++ b/Source/Editor/Content/Import/FolderImportEntry.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System.IO;
diff --git a/Source/Editor/Content/Import/ImportFileEntry.cs b/Source/Editor/Content/Import/ImportFileEntry.cs
index 843e295e3..e14959f61 100644
--- a/Source/Editor/Content/Import/ImportFileEntry.cs
+++ b/Source/Editor/Content/Import/ImportFileEntry.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System.Collections.Generic;
using System.IO;
diff --git a/Source/Editor/Content/Import/ImportFilesDialog.cs b/Source/Editor/Content/Import/ImportFilesDialog.cs
index 009825ae8..2e3633d3b 100644
--- a/Source/Editor/Content/Import/ImportFilesDialog.cs
+++ b/Source/Editor/Content/Import/ImportFilesDialog.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using System.Collections.Generic;
diff --git a/Source/Editor/Content/Import/ModelImportEntry.cs b/Source/Editor/Content/Import/ModelImportEntry.cs
index 2456826af..e7cbe96ea 100644
--- a/Source/Editor/Content/Import/ModelImportEntry.cs
+++ b/Source/Editor/Content/Import/ModelImportEntry.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System.ComponentModel;
using System.Runtime.CompilerServices;
diff --git a/Source/Editor/Content/Import/Request.cs b/Source/Editor/Content/Import/Request.cs
index ab2614eab..b9da30afb 100644
--- a/Source/Editor/Content/Import/Request.cs
+++ b/Source/Editor/Content/Import/Request.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using FlaxEngine;
diff --git a/Source/Editor/Content/Import/TextureImportEntry.cs b/Source/Editor/Content/Import/TextureImportEntry.cs
index 0aec0df9d..c276dce1b 100644
--- a/Source/Editor/Content/Import/TextureImportEntry.cs
+++ b/Source/Editor/Content/Import/TextureImportEntry.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System.Collections.Generic;
using System.ComponentModel;
diff --git a/Source/Editor/Content/Items/AssetItem.cs b/Source/Editor/Content/Items/AssetItem.cs
index 437c556fc..afb68d42a 100644
--- a/Source/Editor/Content/Items/AssetItem.cs
+++ b/Source/Editor/Content/Items/AssetItem.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using System.IO;
@@ -58,7 +58,7 @@ namespace FlaxEditor.Content
public override bool OnMouseDoubleClick(Vector2 location, MouseButton button)
{
- return Item.OnMouseDoubleClick(Item.ScreenToClient(ClientToScreen(location)), button);
+ return Item.OnMouseDoubleClick(Item.PointFromScreen(PointToScreen(location)), button);
}
}
diff --git a/Source/Editor/Content/Items/BinaryAssetItem.cs b/Source/Editor/Content/Items/BinaryAssetItem.cs
index b851df352..417bd23e4 100644
--- a/Source/Editor/Content/Items/BinaryAssetItem.cs
+++ b/Source/Editor/Content/Items/BinaryAssetItem.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using System.Text;
diff --git a/Source/Editor/Content/Items/CSharpScriptItem.cs b/Source/Editor/Content/Items/CSharpScriptItem.cs
index 5b372922e..6160de2bb 100644
--- a/Source/Editor/Content/Items/CSharpScriptItem.cs
+++ b/Source/Editor/Content/Items/CSharpScriptItem.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using FlaxEngine;
diff --git a/Source/Editor/Content/Items/ContentFolder.cs b/Source/Editor/Content/Items/ContentFolder.cs
index e5ddd62a2..8ae934b78 100644
--- a/Source/Editor/Content/Items/ContentFolder.cs
+++ b/Source/Editor/Content/Items/ContentFolder.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using System.Collections.Generic;
diff --git a/Source/Editor/Content/Items/ContentItem.cs b/Source/Editor/Content/Items/ContentItem.cs
index 36c5ee7e3..86741a432 100644
--- a/Source/Editor/Content/Items/ContentItem.cs
+++ b/Source/Editor/Content/Items/ContentItem.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using System.Collections.Generic;
diff --git a/Source/Editor/Content/Items/CppScriptItem.cs b/Source/Editor/Content/Items/CppScriptItem.cs
index 3490cb4c6..1f7bc9f19 100644
--- a/Source/Editor/Content/Items/CppScriptItem.cs
+++ b/Source/Editor/Content/Items/CppScriptItem.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using FlaxEngine;
diff --git a/Source/Editor/Content/Items/FileItem.cs b/Source/Editor/Content/Items/FileItem.cs
index f7ba3c9bc..7a3d0fa65 100644
--- a/Source/Editor/Content/Items/FileItem.cs
+++ b/Source/Editor/Content/Items/FileItem.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using FlaxEngine;
diff --git a/Source/Editor/Content/Items/JsonAssetItem.cs b/Source/Editor/Content/Items/JsonAssetItem.cs
index b217aa8bc..6e32ad49a 100644
--- a/Source/Editor/Content/Items/JsonAssetItem.cs
+++ b/Source/Editor/Content/Items/JsonAssetItem.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using FlaxEngine;
diff --git a/Source/Editor/Content/Items/NewItem.cs b/Source/Editor/Content/Items/NewItem.cs
index 49e459067..da06c6bfd 100644
--- a/Source/Editor/Content/Items/NewItem.cs
+++ b/Source/Editor/Content/Items/NewItem.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using FlaxEngine;
diff --git a/Source/Editor/Content/Items/PrefabItem.cs b/Source/Editor/Content/Items/PrefabItem.cs
index eea4a2406..aee264d55 100644
--- a/Source/Editor/Content/Items/PrefabItem.cs
+++ b/Source/Editor/Content/Items/PrefabItem.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using FlaxEngine;
diff --git a/Source/Editor/Content/Items/SceneItem.cs b/Source/Editor/Content/Items/SceneItem.cs
index 819567598..190fe9807 100644
--- a/Source/Editor/Content/Items/SceneItem.cs
+++ b/Source/Editor/Content/Items/SceneItem.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using FlaxEngine;
diff --git a/Source/Editor/Content/Items/ScriptItem.cs b/Source/Editor/Content/Items/ScriptItem.cs
index b366ebe15..60db615e9 100644
--- a/Source/Editor/Content/Items/ScriptItem.cs
+++ b/Source/Editor/Content/Items/ScriptItem.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System.Text;
diff --git a/Source/Editor/Content/Items/ShaderSourceItem.cs b/Source/Editor/Content/Items/ShaderSourceItem.cs
index 0358eff77..77cd6d6ee 100644
--- a/Source/Editor/Content/Items/ShaderSourceItem.cs
+++ b/Source/Editor/Content/Items/ShaderSourceItem.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using FlaxEngine;
diff --git a/Source/Editor/Content/Items/VisualScriptItem.cs b/Source/Editor/Content/Items/VisualScriptItem.cs
index 3fa3b463b..86be2e3de 100644
--- a/Source/Editor/Content/Items/VisualScriptItem.cs
+++ b/Source/Editor/Content/Items/VisualScriptItem.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using System.Collections.Generic;
diff --git a/Source/Editor/Content/PreviewsCache.cpp b/Source/Editor/Content/PreviewsCache.cpp
index ca99bf07c..c51e8cabb 100644
--- a/Source/Editor/Content/PreviewsCache.cpp
+++ b/Source/Editor/Content/PreviewsCache.cpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#include "PreviewsCache.h"
#include "Engine/Core/Log.h"
diff --git a/Source/Editor/Content/PreviewsCache.cs b/Source/Editor/Content/PreviewsCache.cs
index acca11589..0769f8f47 100644
--- a/Source/Editor/Content/PreviewsCache.cs
+++ b/Source/Editor/Content/PreviewsCache.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using FlaxEngine;
diff --git a/Source/Editor/Content/PreviewsCache.h b/Source/Editor/Content/PreviewsCache.h
index 63ffb8c6e..7aae6e60a 100644
--- a/Source/Editor/Content/PreviewsCache.h
+++ b/Source/Editor/Content/PreviewsCache.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Editor/Content/Proxy/AnimationGraphFunctionProxy.cs b/Source/Editor/Content/Proxy/AnimationGraphFunctionProxy.cs
index 9ac2c407e..824bd56a3 100644
--- a/Source/Editor/Content/Proxy/AnimationGraphFunctionProxy.cs
+++ b/Source/Editor/Content/Proxy/AnimationGraphFunctionProxy.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using FlaxEditor.Windows;
diff --git a/Source/Editor/Content/Proxy/AnimationGraphProxy.cs b/Source/Editor/Content/Proxy/AnimationGraphProxy.cs
index b5e197bf3..abc5dd40b 100644
--- a/Source/Editor/Content/Proxy/AnimationGraphProxy.cs
+++ b/Source/Editor/Content/Proxy/AnimationGraphProxy.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using FlaxEditor.Windows;
diff --git a/Source/Editor/Content/Proxy/AnimationProxy.cs b/Source/Editor/Content/Proxy/AnimationProxy.cs
index 0b5a43e38..fb220820d 100644
--- a/Source/Editor/Content/Proxy/AnimationProxy.cs
+++ b/Source/Editor/Content/Proxy/AnimationProxy.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using System.IO;
diff --git a/Source/Editor/Content/Proxy/AssetProxy.cs b/Source/Editor/Content/Proxy/AssetProxy.cs
index fa0a878af..405ff3b34 100644
--- a/Source/Editor/Content/Proxy/AssetProxy.cs
+++ b/Source/Editor/Content/Proxy/AssetProxy.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using FlaxEditor.Content.Thumbnails;
diff --git a/Source/Editor/Content/Proxy/AudioClipProxy.cs b/Source/Editor/Content/Proxy/AudioClipProxy.cs
index ec1444366..ba60d6ef9 100644
--- a/Source/Editor/Content/Proxy/AudioClipProxy.cs
+++ b/Source/Editor/Content/Proxy/AudioClipProxy.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using System.Collections.Generic;
diff --git a/Source/Editor/Content/Proxy/BinaryAssetProxy.cs b/Source/Editor/Content/Proxy/BinaryAssetProxy.cs
index 124e3696a..4d27f325b 100644
--- a/Source/Editor/Content/Proxy/BinaryAssetProxy.cs
+++ b/Source/Editor/Content/Proxy/BinaryAssetProxy.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using FlaxEngine;
diff --git a/Source/Editor/Content/Proxy/CSharpScriptProxy.cs b/Source/Editor/Content/Proxy/CSharpScriptProxy.cs
index 3754b73d8..925355580 100644
--- a/Source/Editor/Content/Proxy/CSharpScriptProxy.cs
+++ b/Source/Editor/Content/Proxy/CSharpScriptProxy.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using System.IO;
diff --git a/Source/Editor/Content/Proxy/CollisionDataProxy.cs b/Source/Editor/Content/Proxy/CollisionDataProxy.cs
index 64b3aa62f..91a573f1a 100644
--- a/Source/Editor/Content/Proxy/CollisionDataProxy.cs
+++ b/Source/Editor/Content/Proxy/CollisionDataProxy.cs
@@ -1,6 +1,7 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
+using System.Threading.Tasks;
using FlaxEditor.Windows;
using FlaxEditor.Windows.Assets;
using FlaxEngine;
@@ -40,5 +41,29 @@ namespace FlaxEditor.Content
if (Editor.CreateAsset(Editor.NewAssetType.CollisionData, outputPath))
throw new Exception("Failed to create new asset.");
}
+
+ ///
+ /// Create collision data from model.
+ ///
+ /// The associated model.
+ public void CreateCollisionDataFromModel(Model model)
+ {
+ Action created = contentItem =>
+ {
+ var ai = (AssetItem)contentItem;
+ var cd = FlaxEngine.Content.LoadAsync(ai.ID);
+ if (cd == null || cd.WaitForLoaded())
+ {
+ Editor.LogError("Failed to load created collision data.");
+ return;
+ }
+
+ Task.Run(() =>
+ {
+ Editor.CookMeshCollision(ai.Path, CollisionDataType.TriangleMesh, model);
+ });
+ };
+ Editor.Instance.Windows.ContentWin.NewItem(this, null, created);
+ }
}
}
diff --git a/Source/Editor/Content/Proxy/ContentProxy.cs b/Source/Editor/Content/Proxy/ContentProxy.cs
index 460a3721f..0948ef5e8 100644
--- a/Source/Editor/Content/Proxy/ContentProxy.cs
+++ b/Source/Editor/Content/Proxy/ContentProxy.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using FlaxEditor.GUI.ContextMenu;
diff --git a/Source/Editor/Content/Proxy/CppScriptProxy.cs b/Source/Editor/Content/Proxy/CppScriptProxy.cs
index 9958fa187..8bad93021 100644
--- a/Source/Editor/Content/Proxy/CppScriptProxy.cs
+++ b/Source/Editor/Content/Proxy/CppScriptProxy.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using System.IO;
diff --git a/Source/Editor/Content/Proxy/CubeTextureProxy.cs b/Source/Editor/Content/Proxy/CubeTextureProxy.cs
index 8d3920040..ce9a9e4ce 100644
--- a/Source/Editor/Content/Proxy/CubeTextureProxy.cs
+++ b/Source/Editor/Content/Proxy/CubeTextureProxy.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using FlaxEditor.Content.Thumbnails;
diff --git a/Source/Editor/Content/Proxy/FileProxy.cs b/Source/Editor/Content/Proxy/FileProxy.cs
index 6e94f6a31..ef3f2185a 100644
--- a/Source/Editor/Content/Proxy/FileProxy.cs
+++ b/Source/Editor/Content/Proxy/FileProxy.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using FlaxEditor.Windows;
using FlaxEngine;
diff --git a/Source/Editor/Content/Proxy/FontProxy.cs b/Source/Editor/Content/Proxy/FontProxy.cs
index 7985e3b92..5645845d7 100644
--- a/Source/Editor/Content/Proxy/FontProxy.cs
+++ b/Source/Editor/Content/Proxy/FontProxy.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using FlaxEditor.Content.Thumbnails;
diff --git a/Source/Editor/Content/Proxy/GameplayGlobalsProxy.cs b/Source/Editor/Content/Proxy/GameplayGlobalsProxy.cs
index 8ac6e70ce..d7285ac24 100644
--- a/Source/Editor/Content/Proxy/GameplayGlobalsProxy.cs
+++ b/Source/Editor/Content/Proxy/GameplayGlobalsProxy.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using FlaxEditor.Windows;
diff --git a/Source/Editor/Content/Proxy/IESProfileProxy.cs b/Source/Editor/Content/Proxy/IESProfileProxy.cs
index 1beb6130e..9a0d97599 100644
--- a/Source/Editor/Content/Proxy/IESProfileProxy.cs
+++ b/Source/Editor/Content/Proxy/IESProfileProxy.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using FlaxEditor.Content.Thumbnails;
diff --git a/Source/Editor/Content/Proxy/JsonAssetProxy.cs b/Source/Editor/Content/Proxy/JsonAssetProxy.cs
index 1f96e6b2c..25155d39d 100644
--- a/Source/Editor/Content/Proxy/JsonAssetProxy.cs
+++ b/Source/Editor/Content/Proxy/JsonAssetProxy.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using FlaxEditor.Content.Create;
diff --git a/Source/Editor/Content/Proxy/MaterialFunctionProxy.cs b/Source/Editor/Content/Proxy/MaterialFunctionProxy.cs
index c794d6118..e162227d3 100644
--- a/Source/Editor/Content/Proxy/MaterialFunctionProxy.cs
+++ b/Source/Editor/Content/Proxy/MaterialFunctionProxy.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using FlaxEditor.Windows;
diff --git a/Source/Editor/Content/Proxy/MaterialInstanceProxy.cs b/Source/Editor/Content/Proxy/MaterialInstanceProxy.cs
index 2ab4e0ac2..2a4423e55 100644
--- a/Source/Editor/Content/Proxy/MaterialInstanceProxy.cs
+++ b/Source/Editor/Content/Proxy/MaterialInstanceProxy.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using FlaxEditor.Content.Thumbnails;
diff --git a/Source/Editor/Content/Proxy/MaterialProxy.cs b/Source/Editor/Content/Proxy/MaterialProxy.cs
index 0c30ae2af..dd1befb0a 100644
--- a/Source/Editor/Content/Proxy/MaterialProxy.cs
+++ b/Source/Editor/Content/Proxy/MaterialProxy.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using FlaxEditor.Content.Thumbnails;
diff --git a/Source/Editor/Content/Proxy/ModelProxy.cs b/Source/Editor/Content/Proxy/ModelProxy.cs
index b0e78ced8..1c58139db 100644
--- a/Source/Editor/Content/Proxy/ModelProxy.cs
+++ b/Source/Editor/Content/Proxy/ModelProxy.cs
@@ -1,7 +1,8 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using FlaxEditor.Content.Thumbnails;
+using FlaxEditor.GUI.ContextMenu;
using FlaxEditor.Viewport.Previews;
using FlaxEditor.Windows;
using FlaxEditor.Windows.Assets;
@@ -39,6 +40,19 @@ namespace FlaxEditor.Content
///
public override Type AssetType => typeof(Model);
+ ///
+ public override void OnContentWindowContextMenu(ContextMenu menu, ContentItem item)
+ {
+ base.OnContentWindowContextMenu(menu, item);
+
+ menu.AddButton("Generate collision data", () =>
+ {
+ var model = FlaxEngine.Content.LoadAsync(((ModelAssetItem)item).ID);
+ var cdProxy = (CollisionDataProxy)Editor.Instance.ContentDatabase.GetProxy();
+ cdProxy.CreateCollisionDataFromModel(model);
+ });
+ }
+
///
public override void OnThumbnailDrawPrepare(ThumbnailRequest request)
{
diff --git a/Source/Editor/Content/Proxy/ParticleEmitterFunctionProxy.cs b/Source/Editor/Content/Proxy/ParticleEmitterFunctionProxy.cs
index 26f594a37..f594d043d 100644
--- a/Source/Editor/Content/Proxy/ParticleEmitterFunctionProxy.cs
+++ b/Source/Editor/Content/Proxy/ParticleEmitterFunctionProxy.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using FlaxEditor.Windows;
diff --git a/Source/Editor/Content/Proxy/ParticleEmitterProxy.cs b/Source/Editor/Content/Proxy/ParticleEmitterProxy.cs
index 107569294..f714b3af0 100644
--- a/Source/Editor/Content/Proxy/ParticleEmitterProxy.cs
+++ b/Source/Editor/Content/Proxy/ParticleEmitterProxy.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using FlaxEditor.Content.Create;
diff --git a/Source/Editor/Content/Proxy/ParticleSystemProxy.cs b/Source/Editor/Content/Proxy/ParticleSystemProxy.cs
index 853b76690..4e9b3edbe 100644
--- a/Source/Editor/Content/Proxy/ParticleSystemProxy.cs
+++ b/Source/Editor/Content/Proxy/ParticleSystemProxy.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using FlaxEditor.Content.Thumbnails;
diff --git a/Source/Editor/Content/Proxy/PrefabProxy.cs b/Source/Editor/Content/Proxy/PrefabProxy.cs
index e5338d52f..39d77f25c 100644
--- a/Source/Editor/Content/Proxy/PrefabProxy.cs
+++ b/Source/Editor/Content/Proxy/PrefabProxy.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using FlaxEditor.Content.Thumbnails;
diff --git a/Source/Editor/Content/Proxy/PreviewsCacheProxy.cs b/Source/Editor/Content/Proxy/PreviewsCacheProxy.cs
index 16e59ad4d..a22c86715 100644
--- a/Source/Editor/Content/Proxy/PreviewsCacheProxy.cs
+++ b/Source/Editor/Content/Proxy/PreviewsCacheProxy.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using FlaxEditor.Windows;
diff --git a/Source/Editor/Content/Proxy/SceneAnimationProxy.cs b/Source/Editor/Content/Proxy/SceneAnimationProxy.cs
index 9e18a86e2..83d9247d8 100644
--- a/Source/Editor/Content/Proxy/SceneAnimationProxy.cs
+++ b/Source/Editor/Content/Proxy/SceneAnimationProxy.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using FlaxEditor.Windows;
diff --git a/Source/Editor/Content/Proxy/SceneProxy.cs b/Source/Editor/Content/Proxy/SceneProxy.cs
index b5fc63943..a6cdbdcde 100644
--- a/Source/Editor/Content/Proxy/SceneProxy.cs
+++ b/Source/Editor/Content/Proxy/SceneProxy.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using FlaxEditor.Windows;
diff --git a/Source/Editor/Content/Proxy/ScriptProxy.cs b/Source/Editor/Content/Proxy/ScriptProxy.cs
index 0220fe67c..89a08bb4f 100644
--- a/Source/Editor/Content/Proxy/ScriptProxy.cs
+++ b/Source/Editor/Content/Proxy/ScriptProxy.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using System.IO;
diff --git a/Source/Editor/Content/Proxy/SettingsProxy.cs b/Source/Editor/Content/Proxy/SettingsProxy.cs
index 604f5ca0a..a6b74b0ea 100644
--- a/Source/Editor/Content/Proxy/SettingsProxy.cs
+++ b/Source/Editor/Content/Proxy/SettingsProxy.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using FlaxEditor.Content.Create;
diff --git a/Source/Editor/Content/Proxy/ShaderProxy.cs b/Source/Editor/Content/Proxy/ShaderProxy.cs
index 2a0630d94..e6e288318 100644
--- a/Source/Editor/Content/Proxy/ShaderProxy.cs
+++ b/Source/Editor/Content/Proxy/ShaderProxy.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using FlaxEditor.Windows;
diff --git a/Source/Editor/Content/Proxy/ShaderSourceProxy.cs b/Source/Editor/Content/Proxy/ShaderSourceProxy.cs
index 806b3ac2f..9e956369f 100644
--- a/Source/Editor/Content/Proxy/ShaderSourceProxy.cs
+++ b/Source/Editor/Content/Proxy/ShaderSourceProxy.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using System.IO;
diff --git a/Source/Editor/Content/Proxy/SkeletonMaskProxy.cs b/Source/Editor/Content/Proxy/SkeletonMaskProxy.cs
index 194892f99..e8cf4bd3e 100644
--- a/Source/Editor/Content/Proxy/SkeletonMaskProxy.cs
+++ b/Source/Editor/Content/Proxy/SkeletonMaskProxy.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using FlaxEditor.Windows;
diff --git a/Source/Editor/Content/Proxy/SkinnedModelProxy.cs b/Source/Editor/Content/Proxy/SkinnedModelProxy.cs
index ed42a3f16..f56f0e3a7 100644
--- a/Source/Editor/Content/Proxy/SkinnedModelProxy.cs
+++ b/Source/Editor/Content/Proxy/SkinnedModelProxy.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using FlaxEditor.Content.Thumbnails;
diff --git a/Source/Editor/Content/Proxy/SpriteAtlasProxy.cs b/Source/Editor/Content/Proxy/SpriteAtlasProxy.cs
index 9cd6f39cd..28ca1058f 100644
--- a/Source/Editor/Content/Proxy/SpriteAtlasProxy.cs
+++ b/Source/Editor/Content/Proxy/SpriteAtlasProxy.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using FlaxEditor.Content.Thumbnails;
diff --git a/Source/Editor/Content/Proxy/TextureProxy.cs b/Source/Editor/Content/Proxy/TextureProxy.cs
index 2f67c78bb..df0b7c2ca 100644
--- a/Source/Editor/Content/Proxy/TextureProxy.cs
+++ b/Source/Editor/Content/Proxy/TextureProxy.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using FlaxEditor.Content.Thumbnails;
diff --git a/Source/Editor/Content/Proxy/VisualScriptProxy.cs b/Source/Editor/Content/Proxy/VisualScriptProxy.cs
index 38b30808e..207527da0 100644
--- a/Source/Editor/Content/Proxy/VisualScriptProxy.cs
+++ b/Source/Editor/Content/Proxy/VisualScriptProxy.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using System.Collections.Generic;
diff --git a/Source/Editor/Content/Settings/AndroidPlatformSettings.cs b/Source/Editor/Content/Settings/AndroidPlatformSettings.cs
index d8f2d2963..2c540109f 100644
--- a/Source/Editor/Content/Settings/AndroidPlatformSettings.cs
+++ b/Source/Editor/Content/Settings/AndroidPlatformSettings.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using FlaxEngine;
diff --git a/Source/Editor/Content/Settings/AudioSettings.cs b/Source/Editor/Content/Settings/AudioSettings.cs
index 3c1060a2e..f011cad46 100644
--- a/Source/Editor/Content/Settings/AudioSettings.cs
+++ b/Source/Editor/Content/Settings/AudioSettings.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System.ComponentModel;
using FlaxEngine;
diff --git a/Source/Editor/Content/Settings/BuildPreset.cs b/Source/Editor/Content/Settings/BuildPreset.cs
index b5d8f986c..bd1a9d1e4 100644
--- a/Source/Editor/Content/Settings/BuildPreset.cs
+++ b/Source/Editor/Content/Settings/BuildPreset.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using FlaxEngine;
diff --git a/Source/Editor/Content/Settings/BuildSettings.cs b/Source/Editor/Content/Settings/BuildSettings.cs
index 059ade72d..e74a5fd41 100644
--- a/Source/Editor/Content/Settings/BuildSettings.cs
+++ b/Source/Editor/Content/Settings/BuildSettings.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using System.ComponentModel;
diff --git a/Source/Editor/Content/Settings/BuildTarget.cs b/Source/Editor/Content/Settings/BuildTarget.cs
index 43ad328f3..7cdc500f6 100644
--- a/Source/Editor/Content/Settings/BuildTarget.cs
+++ b/Source/Editor/Content/Settings/BuildTarget.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using FlaxEngine;
diff --git a/Source/Editor/Content/Settings/GameSettings.cs b/Source/Editor/Content/Settings/GameSettings.cs
index 498efb127..28c13c905 100644
--- a/Source/Editor/Content/Settings/GameSettings.cs
+++ b/Source/Editor/Content/Settings/GameSettings.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using System.Collections.Generic;
diff --git a/Source/Editor/Content/Settings/GraphicsSettings.cs b/Source/Editor/Content/Settings/GraphicsSettings.cs
index d488fef46..731bc750d 100644
--- a/Source/Editor/Content/Settings/GraphicsSettings.cs
+++ b/Source/Editor/Content/Settings/GraphicsSettings.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using FlaxEngine;
diff --git a/Source/Editor/Content/Settings/InputSettings.cs b/Source/Editor/Content/Settings/InputSettings.cs
index dc074bb3c..69a8dfba3 100644
--- a/Source/Editor/Content/Settings/InputSettings.cs
+++ b/Source/Editor/Content/Settings/InputSettings.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using FlaxEngine;
diff --git a/Source/Editor/Content/Settings/LayersAndTagsSettings.cs b/Source/Editor/Content/Settings/LayersAndTagsSettings.cs
index 7c376d503..5f3884ee1 100644
--- a/Source/Editor/Content/Settings/LayersAndTagsSettings.cs
+++ b/Source/Editor/Content/Settings/LayersAndTagsSettings.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System.Collections.Generic;
using System.Runtime.CompilerServices;
diff --git a/Source/Editor/Content/Settings/LinuxPlatformSettings.cs b/Source/Editor/Content/Settings/LinuxPlatformSettings.cs
index c1a30963d..8b26e77d4 100644
--- a/Source/Editor/Content/Settings/LinuxPlatformSettings.cs
+++ b/Source/Editor/Content/Settings/LinuxPlatformSettings.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using FlaxEngine;
diff --git a/Source/Editor/Content/Settings/NavigationSettings.cs b/Source/Editor/Content/Settings/NavigationSettings.cs
index f4e0e3a02..cba8f2688 100644
--- a/Source/Editor/Content/Settings/NavigationSettings.cs
+++ b/Source/Editor/Content/Settings/NavigationSettings.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System.ComponentModel;
using FlaxEngine;
diff --git a/Source/Editor/Content/Settings/PhysicsSettings.cs b/Source/Editor/Content/Settings/PhysicsSettings.cs
index b6b08f053..540b11772 100644
--- a/Source/Editor/Content/Settings/PhysicsSettings.cs
+++ b/Source/Editor/Content/Settings/PhysicsSettings.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System.ComponentModel;
using FlaxEngine;
diff --git a/Source/Editor/Content/Settings/TimeSettings.cs b/Source/Editor/Content/Settings/TimeSettings.cs
index f346139f4..af352f5e1 100644
--- a/Source/Editor/Content/Settings/TimeSettings.cs
+++ b/Source/Editor/Content/Settings/TimeSettings.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System.ComponentModel;
using FlaxEngine;
diff --git a/Source/Editor/Content/Settings/UWPPlatformSettings.cs b/Source/Editor/Content/Settings/UWPPlatformSettings.cs
index db00f3061..5c5696936 100644
--- a/Source/Editor/Content/Settings/UWPPlatformSettings.cs
+++ b/Source/Editor/Content/Settings/UWPPlatformSettings.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using System.ComponentModel;
diff --git a/Source/Editor/Content/Settings/WindowsPlatformSettings.cs b/Source/Editor/Content/Settings/WindowsPlatformSettings.cs
index f0e3bf4bf..dc873e9f4 100644
--- a/Source/Editor/Content/Settings/WindowsPlatformSettings.cs
+++ b/Source/Editor/Content/Settings/WindowsPlatformSettings.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System.ComponentModel;
using FlaxEngine;
diff --git a/Source/Editor/Content/Thumbnails/ThumbnailRequest.cs b/Source/Editor/Content/Thumbnails/ThumbnailRequest.cs
index 8ec88a6a7..58f08a037 100644
--- a/Source/Editor/Content/Thumbnails/ThumbnailRequest.cs
+++ b/Source/Editor/Content/Thumbnails/ThumbnailRequest.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using FlaxEngine;
diff --git a/Source/Editor/Content/Thumbnails/ThumbnailsModule.cs b/Source/Editor/Content/Thumbnails/ThumbnailsModule.cs
index 689cad248..d234eb91e 100644
--- a/Source/Editor/Content/Thumbnails/ThumbnailsModule.cs
+++ b/Source/Editor/Content/Thumbnails/ThumbnailsModule.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using System.Collections.Generic;
diff --git a/Source/Editor/Content/Tree/ContentTreeNode.cs b/Source/Editor/Content/Tree/ContentTreeNode.cs
index 909162c11..7df407e08 100644
--- a/Source/Editor/Content/Tree/ContentTreeNode.cs
+++ b/Source/Editor/Content/Tree/ContentTreeNode.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System.Collections.Generic;
using FlaxEditor.GUI;
diff --git a/Source/Editor/Content/Tree/MainContentTreeNode.cs b/Source/Editor/Content/Tree/MainContentTreeNode.cs
index 22f67b99e..5ee845bf1 100644
--- a/Source/Editor/Content/Tree/MainContentTreeNode.cs
+++ b/Source/Editor/Content/Tree/MainContentTreeNode.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System.IO;
diff --git a/Source/Editor/Content/Tree/ProjectTreeNode.cs b/Source/Editor/Content/Tree/ProjectTreeNode.cs
index 6ab5ac432..037ac3c40 100644
--- a/Source/Editor/Content/Tree/ProjectTreeNode.cs
+++ b/Source/Editor/Content/Tree/ProjectTreeNode.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using FlaxEngine.GUI;
diff --git a/Source/Editor/Content/Tree/RootContentTreeNode.cs b/Source/Editor/Content/Tree/RootContentTreeNode.cs
index 612da4fa8..b7283c9fd 100644
--- a/Source/Editor/Content/Tree/RootContentTreeNode.cs
+++ b/Source/Editor/Content/Tree/RootContentTreeNode.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
namespace FlaxEditor.Content
{
diff --git a/Source/Editor/Cooker/CookingData.h b/Source/Editor/Cooker/CookingData.h
index 39a20e894..b46b8ff72 100644
--- a/Source/Editor/Cooker/CookingData.h
+++ b/Source/Editor/Cooker/CookingData.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Editor/Cooker/GameCooker.cpp b/Source/Editor/Cooker/GameCooker.cpp
index 19bd0f90a..1fdf0755f 100644
--- a/Source/Editor/Cooker/GameCooker.cpp
+++ b/Source/Editor/Cooker/GameCooker.cpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#include "GameCooker.h"
#include "FlaxEngine.Gen.h"
@@ -309,7 +309,7 @@ void GameCooker::Build(BuildPlatform platform, BuildConfiguration configuration,
PlatformTools* tools = GetTools(platform);
if (tools == nullptr)
{
- LOG(Error, "Build platform {0} is not suppoerd.", ::ToString(platform));
+ LOG(Error, "Build platform {0} is not supported.", ::ToString(platform));
return;
}
diff --git a/Source/Editor/Cooker/GameCooker.cs b/Source/Editor/Cooker/GameCooker.cs
index 0f5d25fe6..91741e074 100644
--- a/Source/Editor/Cooker/GameCooker.cs
+++ b/Source/Editor/Cooker/GameCooker.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using System.Linq;
diff --git a/Source/Editor/Cooker/GameCooker.h b/Source/Editor/Cooker/GameCooker.h
index a7282d1aa..3defe51ff 100644
--- a/Source/Editor/Cooker/GameCooker.h
+++ b/Source/Editor/Cooker/GameCooker.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Editor/Cooker/Steps/CollectAssetsStep.cpp b/Source/Editor/Cooker/Steps/CollectAssetsStep.cpp
index 2a742e6f0..f004f5da2 100644
--- a/Source/Editor/Cooker/Steps/CollectAssetsStep.cpp
+++ b/Source/Editor/Cooker/Steps/CollectAssetsStep.cpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#include "CollectAssetsStep.h"
#include "Engine/Content/Content.h"
diff --git a/Source/Editor/Cooker/Steps/CollectAssetsStep.h b/Source/Editor/Cooker/Steps/CollectAssetsStep.h
index 9c1ce813b..e7e43c823 100644
--- a/Source/Editor/Cooker/Steps/CollectAssetsStep.h
+++ b/Source/Editor/Cooker/Steps/CollectAssetsStep.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Editor/Cooker/Steps/CompileScriptsStep.cpp b/Source/Editor/Cooker/Steps/CompileScriptsStep.cpp
index d167219b4..3bb2e1eb6 100644
--- a/Source/Editor/Cooker/Steps/CompileScriptsStep.cpp
+++ b/Source/Editor/Cooker/Steps/CompileScriptsStep.cpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#include "CompileScriptsStep.h"
#include "Editor/Scripting/ScriptsBuilder.h"
diff --git a/Source/Editor/Cooker/Steps/CompileScriptsStep.h b/Source/Editor/Cooker/Steps/CompileScriptsStep.h
index 08776cb38..44ffe5e6a 100644
--- a/Source/Editor/Cooker/Steps/CompileScriptsStep.h
+++ b/Source/Editor/Cooker/Steps/CompileScriptsStep.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Editor/Cooker/Steps/CookAssetsStep.cpp b/Source/Editor/Cooker/Steps/CookAssetsStep.cpp
index 5f4c3e323..396626fc1 100644
--- a/Source/Editor/Cooker/Steps/CookAssetsStep.cpp
+++ b/Source/Editor/Cooker/Steps/CookAssetsStep.cpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#include "CookAssetsStep.h"
#include "Editor/Cooker/PlatformTools.h"
diff --git a/Source/Editor/Cooker/Steps/CookAssetsStep.h b/Source/Editor/Cooker/Steps/CookAssetsStep.h
index 9a153723a..8896e1e99 100644
--- a/Source/Editor/Cooker/Steps/CookAssetsStep.h
+++ b/Source/Editor/Cooker/Steps/CookAssetsStep.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Editor/Cooker/Steps/DeployDataStep.cpp b/Source/Editor/Cooker/Steps/DeployDataStep.cpp
index 97c50029b..b5ea2d268 100644
--- a/Source/Editor/Cooker/Steps/DeployDataStep.cpp
+++ b/Source/Editor/Cooker/Steps/DeployDataStep.cpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#include "DeployDataStep.h"
#include "Engine/Platform/FileSystem.h"
diff --git a/Source/Editor/Cooker/Steps/DeployDataStep.h b/Source/Editor/Cooker/Steps/DeployDataStep.h
index 23b22adf8..902aae029 100644
--- a/Source/Editor/Cooker/Steps/DeployDataStep.h
+++ b/Source/Editor/Cooker/Steps/DeployDataStep.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Editor/Cooker/Steps/PostProcessStep.cpp b/Source/Editor/Cooker/Steps/PostProcessStep.cpp
index 0f356e2a6..85e7619a0 100644
--- a/Source/Editor/Cooker/Steps/PostProcessStep.cpp
+++ b/Source/Editor/Cooker/Steps/PostProcessStep.cpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#include "PostProcessStep.h"
#include "Editor/Cooker/PlatformTools.h"
diff --git a/Source/Editor/Cooker/Steps/PostProcessStep.h b/Source/Editor/Cooker/Steps/PostProcessStep.h
index 738508880..e9e23b0f9 100644
--- a/Source/Editor/Cooker/Steps/PostProcessStep.h
+++ b/Source/Editor/Cooker/Steps/PostProcessStep.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Editor/Cooker/Steps/PrecompileAssembliesStep.cpp b/Source/Editor/Cooker/Steps/PrecompileAssembliesStep.cpp
index a37e96216..4c482c529 100644
--- a/Source/Editor/Cooker/Steps/PrecompileAssembliesStep.cpp
+++ b/Source/Editor/Cooker/Steps/PrecompileAssembliesStep.cpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#include "PrecompileAssembliesStep.h"
#include "Editor/Scripting/ScriptsBuilder.h"
diff --git a/Source/Editor/Cooker/Steps/PrecompileAssembliesStep.h b/Source/Editor/Cooker/Steps/PrecompileAssembliesStep.h
index 91af5b0b0..39cee583e 100644
--- a/Source/Editor/Cooker/Steps/PrecompileAssembliesStep.h
+++ b/Source/Editor/Cooker/Steps/PrecompileAssembliesStep.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Editor/Cooker/Steps/ValidateStep.cpp b/Source/Editor/Cooker/Steps/ValidateStep.cpp
index 9bb2ada9f..219301544 100644
--- a/Source/Editor/Cooker/Steps/ValidateStep.cpp
+++ b/Source/Editor/Cooker/Steps/ValidateStep.cpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#include "ValidateStep.h"
#include "Engine/Core/Config/GameSettings.h"
diff --git a/Source/Editor/Cooker/Steps/ValidateStep.h b/Source/Editor/Cooker/Steps/ValidateStep.h
index cb926cef8..3532727e7 100644
--- a/Source/Editor/Cooker/Steps/ValidateStep.h
+++ b/Source/Editor/Cooker/Steps/ValidateStep.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Editor/CustomEditorWindow.cs b/Source/Editor/CustomEditorWindow.cs
index 371bfbaaa..de8d0f2f6 100644
--- a/Source/Editor/CustomEditorWindow.cs
+++ b/Source/Editor/CustomEditorWindow.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using FlaxEditor.CustomEditors;
using FlaxEditor.Windows;
diff --git a/Source/Editor/CustomEditors/CustomEditor.cs b/Source/Editor/CustomEditors/CustomEditor.cs
index c3b468b56..5f992729f 100644
--- a/Source/Editor/CustomEditors/CustomEditor.cs
+++ b/Source/Editor/CustomEditors/CustomEditor.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using System.Collections.Generic;
diff --git a/Source/Editor/CustomEditors/CustomEditorPresenter.cs b/Source/Editor/CustomEditors/CustomEditorPresenter.cs
index 41a230363..2cea89f08 100644
--- a/Source/Editor/CustomEditors/CustomEditorPresenter.cs
+++ b/Source/Editor/CustomEditors/CustomEditorPresenter.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using System.Collections.Generic;
diff --git a/Source/Editor/CustomEditors/CustomEditorsUtil.cpp b/Source/Editor/CustomEditors/CustomEditorsUtil.cpp
index 35fcb278f..182175cd6 100644
--- a/Source/Editor/CustomEditors/CustomEditorsUtil.cpp
+++ b/Source/Editor/CustomEditors/CustomEditorsUtil.cpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#include "CustomEditorsUtil.h"
#include "Engine/Core/Log.h"
diff --git a/Source/Editor/CustomEditors/CustomEditorsUtil.cs b/Source/Editor/CustomEditors/CustomEditorsUtil.cs
index 3f716b7ff..2f97da333 100644
--- a/Source/Editor/CustomEditors/CustomEditorsUtil.cs
+++ b/Source/Editor/CustomEditors/CustomEditorsUtil.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using System.Collections.Generic;
diff --git a/Source/Editor/CustomEditors/CustomEditorsUtil.h b/Source/Editor/CustomEditors/CustomEditorsUtil.h
index 12d5a9bfe..55f5011e8 100644
--- a/Source/Editor/CustomEditors/CustomEditorsUtil.h
+++ b/Source/Editor/CustomEditors/CustomEditorsUtil.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Editor/CustomEditors/Dedicated/ActorEditor.cs b/Source/Editor/CustomEditors/Dedicated/ActorEditor.cs
index ee74cc98a..ad974c55a 100644
--- a/Source/Editor/CustomEditors/Dedicated/ActorEditor.cs
+++ b/Source/Editor/CustomEditors/Dedicated/ActorEditor.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using System.Collections.Generic;
diff --git a/Source/Editor/CustomEditors/Dedicated/AnimatedModelEditor.cs b/Source/Editor/CustomEditors/Dedicated/AnimatedModelEditor.cs
index f4feccef4..09a9f3ee7 100644
--- a/Source/Editor/CustomEditors/Dedicated/AnimatedModelEditor.cs
+++ b/Source/Editor/CustomEditors/Dedicated/AnimatedModelEditor.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using FlaxEditor.Surface;
using FlaxEngine;
diff --git a/Source/Editor/CustomEditors/Dedicated/CurveObjectEditor.cs b/Source/Editor/CustomEditors/Dedicated/CurveObjectEditor.cs
index 53414a516..2b352eb17 100644
--- a/Source/Editor/CustomEditors/Dedicated/CurveObjectEditor.cs
+++ b/Source/Editor/CustomEditors/Dedicated/CurveObjectEditor.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using FlaxEditor.GUI;
using FlaxEngine;
diff --git a/Source/Editor/CustomEditors/Dedicated/EnvironmentProbeEditor.cs b/Source/Editor/CustomEditors/Dedicated/EnvironmentProbeEditor.cs
index 7d7264ff9..5049f729f 100644
--- a/Source/Editor/CustomEditors/Dedicated/EnvironmentProbeEditor.cs
+++ b/Source/Editor/CustomEditors/Dedicated/EnvironmentProbeEditor.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using FlaxEngine;
diff --git a/Source/Editor/CustomEditors/Dedicated/FontReferenceEditor.cs b/Source/Editor/CustomEditors/Dedicated/FontReferenceEditor.cs
index fd88d563c..49307e1cd 100644
--- a/Source/Editor/CustomEditors/Dedicated/FontReferenceEditor.cs
+++ b/Source/Editor/CustomEditors/Dedicated/FontReferenceEditor.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System.Collections.Generic;
using FlaxEditor.CustomEditors.Editors;
diff --git a/Source/Editor/CustomEditors/Dedicated/LayersMatrixEditor.cs b/Source/Editor/CustomEditors/Dedicated/LayersMatrixEditor.cs
index 5d2ceab7a..44a273ee4 100644
--- a/Source/Editor/CustomEditors/Dedicated/LayersMatrixEditor.cs
+++ b/Source/Editor/CustomEditors/Dedicated/LayersMatrixEditor.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using System.Collections.Generic;
diff --git a/Source/Editor/CustomEditors/Dedicated/ParticleEffectEditor.cs b/Source/Editor/CustomEditors/Dedicated/ParticleEffectEditor.cs
index a7a35a9d6..83d6acacd 100644
--- a/Source/Editor/CustomEditors/Dedicated/ParticleEffectEditor.cs
+++ b/Source/Editor/CustomEditors/Dedicated/ParticleEffectEditor.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System.Linq;
using FlaxEditor.Surface;
diff --git a/Source/Editor/CustomEditors/Dedicated/PhysicalMaterialEditor.cs b/Source/Editor/CustomEditors/Dedicated/PhysicalMaterialEditor.cs
index 9cfe89c87..c3017edf3 100644
--- a/Source/Editor/CustomEditors/Dedicated/PhysicalMaterialEditor.cs
+++ b/Source/Editor/CustomEditors/Dedicated/PhysicalMaterialEditor.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System.Collections.Generic;
using FlaxEditor.CustomEditors.Editors;
diff --git a/Source/Editor/CustomEditors/Dedicated/PostProcessSettingsEditor.cs b/Source/Editor/CustomEditors/Dedicated/PostProcessSettingsEditor.cs
index 7f7da4414..6b51e019f 100644
--- a/Source/Editor/CustomEditors/Dedicated/PostProcessSettingsEditor.cs
+++ b/Source/Editor/CustomEditors/Dedicated/PostProcessSettingsEditor.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System.Collections.Generic;
using FlaxEditor.CustomEditors.Editors;
diff --git a/Source/Editor/CustomEditors/Dedicated/RigidBodyEditor.cs b/Source/Editor/CustomEditors/Dedicated/RigidBodyEditor.cs
index ad7316205..02a1359c5 100644
--- a/Source/Editor/CustomEditors/Dedicated/RigidBodyEditor.cs
+++ b/Source/Editor/CustomEditors/Dedicated/RigidBodyEditor.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System.Collections.Generic;
using FlaxEditor.CustomEditors.GUI;
diff --git a/Source/Editor/CustomEditors/Dedicated/ScriptsEditor.cs b/Source/Editor/CustomEditors/Dedicated/ScriptsEditor.cs
index 1ed2634a5..f577e9bae 100644
--- a/Source/Editor/CustomEditors/Dedicated/ScriptsEditor.cs
+++ b/Source/Editor/CustomEditors/Dedicated/ScriptsEditor.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using System.Collections;
diff --git a/Source/Editor/CustomEditors/Dedicated/SkyLightEditor.cs b/Source/Editor/CustomEditors/Dedicated/SkyLightEditor.cs
index 61baecce4..f219d5921 100644
--- a/Source/Editor/CustomEditors/Dedicated/SkyLightEditor.cs
+++ b/Source/Editor/CustomEditors/Dedicated/SkyLightEditor.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using FlaxEngine;
diff --git a/Source/Editor/CustomEditors/Dedicated/TerrainEditor.cs b/Source/Editor/CustomEditors/Dedicated/TerrainEditor.cs
index d44db8adf..9cd4cfcf0 100644
--- a/Source/Editor/CustomEditors/Dedicated/TerrainEditor.cs
+++ b/Source/Editor/CustomEditors/Dedicated/TerrainEditor.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using FlaxEngine;
diff --git a/Source/Editor/CustomEditors/Dedicated/UIControlEditor.cs b/Source/Editor/CustomEditors/Dedicated/UIControlEditor.cs
index 1d9b2f856..0fcf9d78a 100644
--- a/Source/Editor/CustomEditors/Dedicated/UIControlEditor.cs
+++ b/Source/Editor/CustomEditors/Dedicated/UIControlEditor.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using System.Linq;
diff --git a/Source/Editor/CustomEditors/Editors/ActorLayerEditor.cs b/Source/Editor/CustomEditors/Editors/ActorLayerEditor.cs
index 40e1ae0af..a6aa34880 100644
--- a/Source/Editor/CustomEditors/Editors/ActorLayerEditor.cs
+++ b/Source/Editor/CustomEditors/Editors/ActorLayerEditor.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System.Collections.Generic;
using FlaxEditor.Content.Settings;
diff --git a/Source/Editor/CustomEditors/Editors/ActorStaticFlagsEditor.cs b/Source/Editor/CustomEditors/Editors/ActorStaticFlagsEditor.cs
index dd1ea8c41..86dd45812 100644
--- a/Source/Editor/CustomEditors/Editors/ActorStaticFlagsEditor.cs
+++ b/Source/Editor/CustomEditors/Editors/ActorStaticFlagsEditor.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System.Collections.Generic;
using FlaxEngine;
diff --git a/Source/Editor/CustomEditors/Editors/ActorTagEditor.cs b/Source/Editor/CustomEditors/Editors/ActorTagEditor.cs
index 70f25fb69..840bd27a3 100644
--- a/Source/Editor/CustomEditors/Editors/ActorTagEditor.cs
+++ b/Source/Editor/CustomEditors/Editors/ActorTagEditor.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using FlaxEditor.Content.Settings;
using FlaxEditor.CustomEditors.Elements;
diff --git a/Source/Editor/CustomEditors/Editors/ActorTransformEditor.cs b/Source/Editor/CustomEditors/Editors/ActorTransformEditor.cs
index 8b72deeec..ad455038b 100644
--- a/Source/Editor/CustomEditors/Editors/ActorTransformEditor.cs
+++ b/Source/Editor/CustomEditors/Editors/ActorTransformEditor.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using FlaxEngine;
diff --git a/Source/Editor/CustomEditors/Editors/ArrayEditor.cs b/Source/Editor/CustomEditors/Editors/ArrayEditor.cs
index 340f1a85c..f12dadde1 100644
--- a/Source/Editor/CustomEditors/Editors/ArrayEditor.cs
+++ b/Source/Editor/CustomEditors/Editors/ArrayEditor.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using System.Collections;
diff --git a/Source/Editor/CustomEditors/Editors/AssetRefEditor.cs b/Source/Editor/CustomEditors/Editors/AssetRefEditor.cs
index e7b03c6d6..7a0e5819c 100644
--- a/Source/Editor/CustomEditors/Editors/AssetRefEditor.cs
+++ b/Source/Editor/CustomEditors/Editors/AssetRefEditor.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using System.Linq;
@@ -34,7 +34,7 @@ namespace FlaxEditor.CustomEditors.Editors
public class AssetRefEditor : CustomEditor
{
private CustomElement _element;
- private ScriptType _type;
+ private ScriptType _valueType;
///
public override DisplayStyle Style => DisplayStyle.Inline;
@@ -44,7 +44,8 @@ namespace FlaxEditor.CustomEditors.Editors
{
if (!HasDifferentTypes)
{
- _type = Values.Type.Type != typeof(object) || Values[0] == null ? Values.Type : TypeUtils.GetObjectType(Values[0]);
+ _valueType = Values.Type.Type != typeof(object) || Values[0] == null ? Values.Type : TypeUtils.GetObjectType(Values[0]);
+ var assetType = _valueType;
float height = 48;
var attributes = Values.GetAttributes();
@@ -58,14 +59,14 @@ namespace FlaxEditor.CustomEditors.Editors
{
var customType = TypeUtils.GetType(assetReference.TypeName);
if (customType != ScriptType.Null)
- _type = customType;
+ assetType = customType;
else
Debug.LogWarning(string.Format("Unknown asset type '{0}' to use for asset picker filter.", assetReference.TypeName));
}
}
_element = layout.Custom();
- _element.CustomControl.AssetType = _type;
+ _element.CustomControl.AssetType = assetType;
_element.CustomControl.Height = height;
_element.CustomControl.SelectedItemChanged += OnSelectedItemChanged;
}
@@ -73,11 +74,11 @@ namespace FlaxEditor.CustomEditors.Editors
private void OnSelectedItemChanged()
{
- if (typeof(AssetItem).IsAssignableFrom(_type.Type))
+ if (typeof(AssetItem).IsAssignableFrom(_valueType.Type))
SetValue(_element.CustomControl.SelectedItem);
- else if (_type.Type == typeof(Guid))
+ else if (_valueType.Type == typeof(Guid))
SetValue(_element.CustomControl.SelectedID);
- else if (_type.Type == typeof(SceneReference))
+ else if (_valueType.Type == typeof(SceneReference))
SetValue(new SceneReference(_element.CustomControl.SelectedID));
else
SetValue(_element.CustomControl.SelectedAsset);
diff --git a/Source/Editor/CustomEditors/Editors/BooleanEditor.cs b/Source/Editor/CustomEditors/Editors/BooleanEditor.cs
index c2ec4193a..c7ba3b78b 100644
--- a/Source/Editor/CustomEditors/Editors/BooleanEditor.cs
+++ b/Source/Editor/CustomEditors/Editors/BooleanEditor.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using FlaxEditor.CustomEditors.Elements;
using FlaxEngine;
diff --git a/Source/Editor/CustomEditors/Editors/CollectionEditor.cs b/Source/Editor/CustomEditors/Editors/CollectionEditor.cs
index 726f9b374..ecbbef0f9 100644
--- a/Source/Editor/CustomEditors/Editors/CollectionEditor.cs
+++ b/Source/Editor/CustomEditors/Editors/CollectionEditor.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using System.Collections;
diff --git a/Source/Editor/CustomEditors/Editors/ColorEditor.cs b/Source/Editor/CustomEditors/Editors/ColorEditor.cs
index cdc7ef1ee..d3a18f4a4 100644
--- a/Source/Editor/CustomEditors/Editors/ColorEditor.cs
+++ b/Source/Editor/CustomEditors/Editors/ColorEditor.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using FlaxEditor.CustomEditors.Elements;
using FlaxEditor.GUI.Input;
diff --git a/Source/Editor/CustomEditors/Editors/ColorTrackball.cs b/Source/Editor/CustomEditors/Editors/ColorTrackball.cs
index 2ec532cf1..e2b74a605 100644
--- a/Source/Editor/CustomEditors/Editors/ColorTrackball.cs
+++ b/Source/Editor/CustomEditors/Editors/ColorTrackball.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System.Linq;
using FlaxEditor.CustomEditors.Elements;
diff --git a/Source/Editor/CustomEditors/Editors/DictionaryEditor.cs b/Source/Editor/CustomEditors/Editors/DictionaryEditor.cs
index 2988c29dd..4e4048dba 100644
--- a/Source/Editor/CustomEditors/Editors/DictionaryEditor.cs
+++ b/Source/Editor/CustomEditors/Editors/DictionaryEditor.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using System.Collections;
diff --git a/Source/Editor/CustomEditors/Editors/DoubleEditor.cs b/Source/Editor/CustomEditors/Editors/DoubleEditor.cs
index fe3b0619c..7134243a0 100644
--- a/Source/Editor/CustomEditors/Editors/DoubleEditor.cs
+++ b/Source/Editor/CustomEditors/Editors/DoubleEditor.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System.Linq;
using FlaxEditor.CustomEditors.Elements;
diff --git a/Source/Editor/CustomEditors/Editors/EnumEditor.cs b/Source/Editor/CustomEditors/Editors/EnumEditor.cs
index 444949be3..e277324e5 100644
--- a/Source/Editor/CustomEditors/Editors/EnumEditor.cs
+++ b/Source/Editor/CustomEditors/Editors/EnumEditor.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using System.Linq;
diff --git a/Source/Editor/CustomEditors/Editors/FlaxObjectRefEditor.cs b/Source/Editor/CustomEditors/Editors/FlaxObjectRefEditor.cs
index b5a0f9200..4420d3fca 100644
--- a/Source/Editor/CustomEditors/Editors/FlaxObjectRefEditor.cs
+++ b/Source/Editor/CustomEditors/Editors/FlaxObjectRefEditor.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using System.Linq;
diff --git a/Source/Editor/CustomEditors/Editors/FloatEditor.cs b/Source/Editor/CustomEditors/Editors/FloatEditor.cs
index 2d6f4e34c..523db92cf 100644
--- a/Source/Editor/CustomEditors/Editors/FloatEditor.cs
+++ b/Source/Editor/CustomEditors/Editors/FloatEditor.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using System.Linq;
diff --git a/Source/Editor/CustomEditors/Editors/GenericEditor.cs b/Source/Editor/CustomEditors/Editors/GenericEditor.cs
index b3035f6e1..485a9b735 100644
--- a/Source/Editor/CustomEditors/Editors/GenericEditor.cs
+++ b/Source/Editor/CustomEditors/Editors/GenericEditor.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using System.Collections.Generic;
diff --git a/Source/Editor/CustomEditors/Editors/GuidEditor.cs b/Source/Editor/CustomEditors/Editors/GuidEditor.cs
index 1a878bbcd..8ff7691b8 100644
--- a/Source/Editor/CustomEditors/Editors/GuidEditor.cs
+++ b/Source/Editor/CustomEditors/Editors/GuidEditor.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using FlaxEditor.CustomEditors.Elements;
diff --git a/Source/Editor/CustomEditors/Editors/IBrushEditor.cs b/Source/Editor/CustomEditors/Editors/IBrushEditor.cs
index 2fae8f458..f0c194eef 100644
--- a/Source/Editor/CustomEditors/Editors/IBrushEditor.cs
+++ b/Source/Editor/CustomEditors/Editors/IBrushEditor.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using FlaxEngine;
using FlaxEngine.GUI;
diff --git a/Source/Editor/CustomEditors/Editors/Int2Editor.cs b/Source/Editor/CustomEditors/Editors/Int2Editor.cs
index 91e45bf86..9b4f401a4 100644
--- a/Source/Editor/CustomEditors/Editors/Int2Editor.cs
+++ b/Source/Editor/CustomEditors/Editors/Int2Editor.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System.Linq;
using FlaxEditor.CustomEditors.Elements;
diff --git a/Source/Editor/CustomEditors/Editors/Int3Editor.cs b/Source/Editor/CustomEditors/Editors/Int3Editor.cs
index c4728298c..f26938e7a 100644
--- a/Source/Editor/CustomEditors/Editors/Int3Editor.cs
+++ b/Source/Editor/CustomEditors/Editors/Int3Editor.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System.Linq;
using FlaxEditor.CustomEditors.Elements;
diff --git a/Source/Editor/CustomEditors/Editors/Int4Editor.cs b/Source/Editor/CustomEditors/Editors/Int4Editor.cs
index ec03ca56c..4c92ab1ab 100644
--- a/Source/Editor/CustomEditors/Editors/Int4Editor.cs
+++ b/Source/Editor/CustomEditors/Editors/Int4Editor.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System.Linq;
using FlaxEditor.CustomEditors.Elements;
diff --git a/Source/Editor/CustomEditors/Editors/IntegerEditor.cs b/Source/Editor/CustomEditors/Editors/IntegerEditor.cs
index bd3d7817a..3c2ca8872 100644
--- a/Source/Editor/CustomEditors/Editors/IntegerEditor.cs
+++ b/Source/Editor/CustomEditors/Editors/IntegerEditor.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System.Linq;
using FlaxEditor.CustomEditors.Elements;
@@ -109,8 +109,7 @@ namespace FlaxEditor.CustomEditors.Editors
// Use int value editor with limit
var element = layout.SignedIntegerValue();
element.LongValue.SetLimits((LimitAttribute)limit);
- element.LongValue.MinValue = Mathf.Max(element.LongValue.MinValue, min);
- element.LongValue.MaxValue = Mathf.Min(element.LongValue.MaxValue, max);
+ element.LongValue.SetLimits(Mathf.Max(element.LongValue.MinValue, min), Mathf.Min(element.LongValue.MaxValue, max));
element.LongValue.ValueChanged += OnValueChanged;
element.LongValue.SlidingEnd += ClearToken;
_element = element;
@@ -121,8 +120,7 @@ namespace FlaxEditor.CustomEditors.Editors
{
// Use int value editor
var element = layout.SignedIntegerValue();
- element.LongValue.MinValue = Mathf.Max(element.LongValue.MinValue, min);
- element.LongValue.MaxValue = Mathf.Min(element.LongValue.MaxValue, max);
+ element.LongValue.SetLimits(Mathf.Max(element.LongValue.MinValue, min), Mathf.Min(element.LongValue.MaxValue, max));
element.LongValue.ValueChanged += OnValueChanged;
element.LongValue.SlidingEnd += ClearToken;
_element = element;
@@ -278,8 +276,7 @@ namespace FlaxEditor.CustomEditors.Editors
// Use int value editor with limit
var element = layout.UnsignedIntegerValue();
element.ULongValue.SetLimits((LimitAttribute)limit);
- element.ULongValue.MinValue = Mathf.Max(element.ULongValue.MinValue, min);
- element.ULongValue.MaxValue = Mathf.Min(element.ULongValue.MaxValue, max);
+ element.ULongValue.SetLimits(Mathf.Max(element.ULongValue.MinValue, min), Mathf.Min(element.ULongValue.MaxValue, max));
element.ULongValue.ValueChanged += OnValueChanged;
element.ULongValue.SlidingEnd += ClearToken;
_element = element;
@@ -290,8 +287,7 @@ namespace FlaxEditor.CustomEditors.Editors
{
// Use int value editor
var element = layout.UnsignedIntegerValue();
- element.ULongValue.MinValue = Mathf.Max(element.ULongValue.MinValue, min);
- element.ULongValue.MaxValue = Mathf.Min(element.ULongValue.MaxValue, max);
+ element.ULongValue.SetLimits(Mathf.Max(element.ULongValue.MinValue, min), Mathf.Min(element.ULongValue.MaxValue, max));
element.ULongValue.ValueChanged += OnValueChanged;
element.ULongValue.SlidingEnd += ClearToken;
_element = element;
diff --git a/Source/Editor/CustomEditors/Editors/ListEditor.cs b/Source/Editor/CustomEditors/Editors/ListEditor.cs
index 3a250f68e..305d2e2c9 100644
--- a/Source/Editor/CustomEditors/Editors/ListEditor.cs
+++ b/Source/Editor/CustomEditors/Editors/ListEditor.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using System.Collections;
diff --git a/Source/Editor/CustomEditors/Editors/MatrixEditor.cs b/Source/Editor/CustomEditors/Editors/MatrixEditor.cs
index dd76e496b..09b570a5d 100644
--- a/Source/Editor/CustomEditors/Editors/MatrixEditor.cs
+++ b/Source/Editor/CustomEditors/Editors/MatrixEditor.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System.Linq;
using FlaxEditor.CustomEditors.Elements;
diff --git a/Source/Editor/CustomEditors/Editors/ModelInstanceEntryEditor.cs b/Source/Editor/CustomEditors/Editors/ModelInstanceEntryEditor.cs
index 576c52588..6ecac91ee 100644
--- a/Source/Editor/CustomEditors/Editors/ModelInstanceEntryEditor.cs
+++ b/Source/Editor/CustomEditors/Editors/ModelInstanceEntryEditor.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using FlaxEditor.CustomEditors.Elements;
using FlaxEngine;
diff --git a/Source/Editor/CustomEditors/Editors/ObjectSwitcherEditor.cs b/Source/Editor/CustomEditors/Editors/ObjectSwitcherEditor.cs
index 5e8eb5f3b..7724acf18 100644
--- a/Source/Editor/CustomEditors/Editors/ObjectSwitcherEditor.cs
+++ b/Source/Editor/CustomEditors/Editors/ObjectSwitcherEditor.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using FlaxEditor.GUI;
diff --git a/Source/Editor/CustomEditors/Editors/QuaternionEditor.cs b/Source/Editor/CustomEditors/Editors/QuaternionEditor.cs
index 342e0641f..c79d86a0f 100644
--- a/Source/Editor/CustomEditors/Editors/QuaternionEditor.cs
+++ b/Source/Editor/CustomEditors/Editors/QuaternionEditor.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using FlaxEditor.CustomEditors.Elements;
using FlaxEngine;
diff --git a/Source/Editor/CustomEditors/Editors/SkeletonNodeEditor.cs b/Source/Editor/CustomEditors/Editors/SkeletonNodeEditor.cs
index 37f21ee2f..d5d15ff04 100644
--- a/Source/Editor/CustomEditors/Editors/SkeletonNodeEditor.cs
+++ b/Source/Editor/CustomEditors/Editors/SkeletonNodeEditor.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using FlaxEditor.CustomEditors.Elements;
using FlaxEditor.GUI;
diff --git a/Source/Editor/CustomEditors/Editors/SpriteHandleEditor.cs b/Source/Editor/CustomEditors/Editors/SpriteHandleEditor.cs
index 81b39e884..69ee06abd 100644
--- a/Source/Editor/CustomEditors/Editors/SpriteHandleEditor.cs
+++ b/Source/Editor/CustomEditors/Editors/SpriteHandleEditor.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using FlaxEditor.GUI;
using FlaxEditor.Scripting;
diff --git a/Source/Editor/CustomEditors/Editors/StringEditor.cs b/Source/Editor/CustomEditors/Editors/StringEditor.cs
index adb9eb719..75ae87025 100644
--- a/Source/Editor/CustomEditors/Editors/StringEditor.cs
+++ b/Source/Editor/CustomEditors/Editors/StringEditor.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System.Linq;
using FlaxEditor.CustomEditors.Elements;
diff --git a/Source/Editor/CustomEditors/Editors/StyleEditor.cs b/Source/Editor/CustomEditors/Editors/StyleEditor.cs
index 93a6591e8..441deefd0 100644
--- a/Source/Editor/CustomEditors/Editors/StyleEditor.cs
+++ b/Source/Editor/CustomEditors/Editors/StyleEditor.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using FlaxEditor.CustomEditors.Elements;
using FlaxEditor.GUI;
diff --git a/Source/Editor/CustomEditors/Editors/TypeEditor.cs b/Source/Editor/CustomEditors/Editors/TypeEditor.cs
index 5c88a2c29..885109c00 100644
--- a/Source/Editor/CustomEditors/Editors/TypeEditor.cs
+++ b/Source/Editor/CustomEditors/Editors/TypeEditor.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using System.Linq;
@@ -405,7 +405,7 @@ namespace FlaxEditor.CustomEditors.Editors
if (_element.CustomControl.Type == new ScriptType(typeof(object)))
{
- _element.CustomControl.Type = Values.Type.Type != typeof(object) || Values[0] == null ? Values.Type : TypeUtils.GetObjectType(Values[0]);
+ _element.CustomControl.Type = Values.Type.Type != typeof(object) || Values[0] == null ? new ScriptType(typeof(object)) : TypeUtils.GetObjectType(Values[0]);
}
}
}
diff --git a/Source/Editor/CustomEditors/Editors/Vector2Editor.cs b/Source/Editor/CustomEditors/Editors/Vector2Editor.cs
index aa8a17f71..8eeae072c 100644
--- a/Source/Editor/CustomEditors/Editors/Vector2Editor.cs
+++ b/Source/Editor/CustomEditors/Editors/Vector2Editor.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System.Linq;
using FlaxEditor.CustomEditors.Elements;
diff --git a/Source/Editor/CustomEditors/Editors/Vector3Editor.cs b/Source/Editor/CustomEditors/Editors/Vector3Editor.cs
index f18144764..b0088f6aa 100644
--- a/Source/Editor/CustomEditors/Editors/Vector3Editor.cs
+++ b/Source/Editor/CustomEditors/Editors/Vector3Editor.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System.Linq;
using FlaxEditor.CustomEditors.Elements;
diff --git a/Source/Editor/CustomEditors/Editors/Vector4Editor.cs b/Source/Editor/CustomEditors/Editors/Vector4Editor.cs
index bd25ae66d..cafed5e4d 100644
--- a/Source/Editor/CustomEditors/Editors/Vector4Editor.cs
+++ b/Source/Editor/CustomEditors/Editors/Vector4Editor.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System.Linq;
using FlaxEditor.CustomEditors.Elements;
diff --git a/Source/Editor/CustomEditors/Editors/VersionEditor.cs b/Source/Editor/CustomEditors/Editors/VersionEditor.cs
index ece030303..1b1877b4f 100644
--- a/Source/Editor/CustomEditors/Editors/VersionEditor.cs
+++ b/Source/Editor/CustomEditors/Editors/VersionEditor.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using FlaxEditor.CustomEditors.Elements;
diff --git a/Source/Editor/CustomEditors/Elements/ButtonElement.cs b/Source/Editor/CustomEditors/Elements/ButtonElement.cs
index 966d310ef..85eb38855 100644
--- a/Source/Editor/CustomEditors/Elements/ButtonElement.cs
+++ b/Source/Editor/CustomEditors/Elements/ButtonElement.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using FlaxEngine;
using FlaxEngine.GUI;
diff --git a/Source/Editor/CustomEditors/Elements/CheckBoxElement.cs b/Source/Editor/CustomEditors/Elements/CheckBoxElement.cs
index 86fcca725..4e22370bb 100644
--- a/Source/Editor/CustomEditors/Elements/CheckBoxElement.cs
+++ b/Source/Editor/CustomEditors/Elements/CheckBoxElement.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using FlaxEngine.GUI;
diff --git a/Source/Editor/CustomEditors/Elements/ComboBoxElement.cs b/Source/Editor/CustomEditors/Elements/ComboBoxElement.cs
index 2da53e1a0..929013a31 100644
--- a/Source/Editor/CustomEditors/Elements/ComboBoxElement.cs
+++ b/Source/Editor/CustomEditors/Elements/ComboBoxElement.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using FlaxEditor.GUI;
using FlaxEngine.GUI;
diff --git a/Source/Editor/CustomEditors/Elements/CustomElement.cs b/Source/Editor/CustomEditors/Elements/CustomElement.cs
index 943ea8713..06faa1b32 100644
--- a/Source/Editor/CustomEditors/Elements/CustomElement.cs
+++ b/Source/Editor/CustomEditors/Elements/CustomElement.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using FlaxEngine.GUI;
diff --git a/Source/Editor/CustomEditors/Elements/DoubleValueElement.cs b/Source/Editor/CustomEditors/Elements/DoubleValueElement.cs
index 490aae8e8..384d59e2d 100644
--- a/Source/Editor/CustomEditors/Elements/DoubleValueElement.cs
+++ b/Source/Editor/CustomEditors/Elements/DoubleValueElement.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System.Linq;
using System.Reflection;
diff --git a/Source/Editor/CustomEditors/Elements/EnumElement.cs b/Source/Editor/CustomEditors/Elements/EnumElement.cs
index 4c4854a5b..27b4dfdb9 100644
--- a/Source/Editor/CustomEditors/Elements/EnumElement.cs
+++ b/Source/Editor/CustomEditors/Elements/EnumElement.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using FlaxEditor.GUI;
diff --git a/Source/Editor/CustomEditors/Elements/FloatValueElement.cs b/Source/Editor/CustomEditors/Elements/FloatValueElement.cs
index 7ac47b206..5e238e1c1 100644
--- a/Source/Editor/CustomEditors/Elements/FloatValueElement.cs
+++ b/Source/Editor/CustomEditors/Elements/FloatValueElement.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System.Linq;
using System.Reflection;
diff --git a/Source/Editor/CustomEditors/Elements/GroupElement.cs b/Source/Editor/CustomEditors/Elements/GroupElement.cs
index 787c99dde..b8cb03e9d 100644
--- a/Source/Editor/CustomEditors/Elements/GroupElement.cs
+++ b/Source/Editor/CustomEditors/Elements/GroupElement.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using FlaxEngine.GUI;
diff --git a/Source/Editor/CustomEditors/Elements/IFloatValueEditor.cs b/Source/Editor/CustomEditors/Elements/IFloatValueEditor.cs
index ff7bb759e..2e67cb5f7 100644
--- a/Source/Editor/CustomEditors/Elements/IFloatValueEditor.cs
+++ b/Source/Editor/CustomEditors/Elements/IFloatValueEditor.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
namespace FlaxEditor.CustomEditors.Elements
{
diff --git a/Source/Editor/CustomEditors/Elements/IIntegerValueEditor.cs b/Source/Editor/CustomEditors/Elements/IIntegerValueEditor.cs
index 8dfe4afcf..d8f03aafe 100644
--- a/Source/Editor/CustomEditors/Elements/IIntegerValueEditor.cs
+++ b/Source/Editor/CustomEditors/Elements/IIntegerValueEditor.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
namespace FlaxEditor.CustomEditors.Elements
{
diff --git a/Source/Editor/CustomEditors/Elements/ImageElement.cs b/Source/Editor/CustomEditors/Elements/ImageElement.cs
index ea135e48f..eff63cf5d 100644
--- a/Source/Editor/CustomEditors/Elements/ImageElement.cs
+++ b/Source/Editor/CustomEditors/Elements/ImageElement.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using FlaxEngine.GUI;
diff --git a/Source/Editor/CustomEditors/Elements/IntegerValueElement.cs b/Source/Editor/CustomEditors/Elements/IntegerValueElement.cs
index 15b6852b4..c85f31660 100644
--- a/Source/Editor/CustomEditors/Elements/IntegerValueElement.cs
+++ b/Source/Editor/CustomEditors/Elements/IntegerValueElement.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System.Linq;
using System.Reflection;
diff --git a/Source/Editor/CustomEditors/Elements/LabelElement.cs b/Source/Editor/CustomEditors/Elements/LabelElement.cs
index e69899a34..4dd2b0302 100644
--- a/Source/Editor/CustomEditors/Elements/LabelElement.cs
+++ b/Source/Editor/CustomEditors/Elements/LabelElement.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using FlaxEngine;
using FlaxEngine.GUI;
diff --git a/Source/Editor/CustomEditors/Elements/PropertiesListElement.cs b/Source/Editor/CustomEditors/Elements/PropertiesListElement.cs
index 68b2ca9cf..f30fba184 100644
--- a/Source/Editor/CustomEditors/Elements/PropertiesListElement.cs
+++ b/Source/Editor/CustomEditors/Elements/PropertiesListElement.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using System.Collections.Generic;
diff --git a/Source/Editor/CustomEditors/Elements/SliderElement.cs b/Source/Editor/CustomEditors/Elements/SliderElement.cs
index 9fc0c91d0..6e981a257 100644
--- a/Source/Editor/CustomEditors/Elements/SliderElement.cs
+++ b/Source/Editor/CustomEditors/Elements/SliderElement.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System.Linq;
using System.Reflection;
diff --git a/Source/Editor/CustomEditors/Elements/SpaceElement.cs b/Source/Editor/CustomEditors/Elements/SpaceElement.cs
index 0ba5df9d6..8026bdb75 100644
--- a/Source/Editor/CustomEditors/Elements/SpaceElement.cs
+++ b/Source/Editor/CustomEditors/Elements/SpaceElement.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using FlaxEngine.GUI;
diff --git a/Source/Editor/CustomEditors/Elements/TextBoxElement.cs b/Source/Editor/CustomEditors/Elements/TextBoxElement.cs
index ee46298ba..66f126462 100644
--- a/Source/Editor/CustomEditors/Elements/TextBoxElement.cs
+++ b/Source/Editor/CustomEditors/Elements/TextBoxElement.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using FlaxEngine.GUI;
diff --git a/Source/Editor/CustomEditors/Elements/TreeElement.cs b/Source/Editor/CustomEditors/Elements/TreeElement.cs
index d6130e691..34747754a 100644
--- a/Source/Editor/CustomEditors/Elements/TreeElement.cs
+++ b/Source/Editor/CustomEditors/Elements/TreeElement.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using FlaxEditor.GUI.Tree;
using FlaxEngine.GUI;
diff --git a/Source/Editor/CustomEditors/Elements/TreeNodeElement.cs b/Source/Editor/CustomEditors/Elements/TreeNodeElement.cs
index 3cad7de49..03268345d 100644
--- a/Source/Editor/CustomEditors/Elements/TreeNodeElement.cs
+++ b/Source/Editor/CustomEditors/Elements/TreeNodeElement.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using FlaxEditor.GUI.Tree;
using FlaxEngine.GUI;
diff --git a/Source/Editor/CustomEditors/Elements/VerticalPanelElement.cs b/Source/Editor/CustomEditors/Elements/VerticalPanelElement.cs
index 1ae23b9e4..2958cd337 100644
--- a/Source/Editor/CustomEditors/Elements/VerticalPanelElement.cs
+++ b/Source/Editor/CustomEditors/Elements/VerticalPanelElement.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using FlaxEngine.GUI;
diff --git a/Source/Editor/CustomEditors/GUI/CheckablePropertyNameLabel.cs b/Source/Editor/CustomEditors/GUI/CheckablePropertyNameLabel.cs
index e5364cea5..0ab1f25fc 100644
--- a/Source/Editor/CustomEditors/GUI/CheckablePropertyNameLabel.cs
+++ b/Source/Editor/CustomEditors/GUI/CheckablePropertyNameLabel.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using FlaxEngine;
diff --git a/Source/Editor/CustomEditors/GUI/ClickablePropertyNameLabel.cs b/Source/Editor/CustomEditors/GUI/ClickablePropertyNameLabel.cs
index fe07b8c9f..73775d4f1 100644
--- a/Source/Editor/CustomEditors/GUI/ClickablePropertyNameLabel.cs
+++ b/Source/Editor/CustomEditors/GUI/ClickablePropertyNameLabel.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using FlaxEngine;
diff --git a/Source/Editor/CustomEditors/GUI/DraggablePropertyNameLabel.cs b/Source/Editor/CustomEditors/GUI/DraggablePropertyNameLabel.cs
index 5f500b067..ad4c921c2 100644
--- a/Source/Editor/CustomEditors/GUI/DraggablePropertyNameLabel.cs
+++ b/Source/Editor/CustomEditors/GUI/DraggablePropertyNameLabel.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using FlaxEngine;
using FlaxEngine.GUI;
diff --git a/Source/Editor/CustomEditors/GUI/PropertiesList.cs b/Source/Editor/CustomEditors/GUI/PropertiesList.cs
index dae327f08..1da862869 100644
--- a/Source/Editor/CustomEditors/GUI/PropertiesList.cs
+++ b/Source/Editor/CustomEditors/GUI/PropertiesList.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using FlaxEditor.CustomEditors.Elements;
using FlaxEngine;
diff --git a/Source/Editor/CustomEditors/GUI/PropertyNameLabel.cs b/Source/Editor/CustomEditors/GUI/PropertyNameLabel.cs
index 3bfe74506..a080aaa4a 100644
--- a/Source/Editor/CustomEditors/GUI/PropertyNameLabel.cs
+++ b/Source/Editor/CustomEditors/GUI/PropertyNameLabel.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using FlaxEditor.GUI.ContextMenu;
using FlaxEngine;
diff --git a/Source/Editor/CustomEditors/LayoutElement.cs b/Source/Editor/CustomEditors/LayoutElement.cs
index 02f8d4e5f..a1b7872e3 100644
--- a/Source/Editor/CustomEditors/LayoutElement.cs
+++ b/Source/Editor/CustomEditors/LayoutElement.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using FlaxEngine;
using FlaxEngine.GUI;
diff --git a/Source/Editor/CustomEditors/LayoutElementsContainer.cs b/Source/Editor/CustomEditors/LayoutElementsContainer.cs
index 6b07f3c62..9df2de8be 100644
--- a/Source/Editor/CustomEditors/LayoutElementsContainer.cs
+++ b/Source/Editor/CustomEditors/LayoutElementsContainer.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using System.Collections.Generic;
diff --git a/Source/Editor/CustomEditors/SyncPointEditor.cs b/Source/Editor/CustomEditors/SyncPointEditor.cs
index eeab227ec..120648230 100644
--- a/Source/Editor/CustomEditors/SyncPointEditor.cs
+++ b/Source/Editor/CustomEditors/SyncPointEditor.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System.Collections.Generic;
using System.Linq;
diff --git a/Source/Editor/CustomEditors/Values/CustomValueContainer.cs b/Source/Editor/CustomEditors/Values/CustomValueContainer.cs
index 63f865851..d9aa52ac4 100644
--- a/Source/Editor/CustomEditors/Values/CustomValueContainer.cs
+++ b/Source/Editor/CustomEditors/Values/CustomValueContainer.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using FlaxEditor.Scripting;
diff --git a/Source/Editor/CustomEditors/Values/DictionaryValueContainer.cs b/Source/Editor/CustomEditors/Values/DictionaryValueContainer.cs
index 5fafc2e9e..0723d7305 100644
--- a/Source/Editor/CustomEditors/Values/DictionaryValueContainer.cs
+++ b/Source/Editor/CustomEditors/Values/DictionaryValueContainer.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using System.Collections;
diff --git a/Source/Editor/CustomEditors/Values/ListValueContainer.cs b/Source/Editor/CustomEditors/Values/ListValueContainer.cs
index 21f386ffe..f8e5dd26c 100644
--- a/Source/Editor/CustomEditors/Values/ListValueContainer.cs
+++ b/Source/Editor/CustomEditors/Values/ListValueContainer.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using System.Collections;
diff --git a/Source/Editor/CustomEditors/Values/ReadOnlyValueContainer.cs b/Source/Editor/CustomEditors/Values/ReadOnlyValueContainer.cs
index 7a5b63bab..c87c0d446 100644
--- a/Source/Editor/CustomEditors/Values/ReadOnlyValueContainer.cs
+++ b/Source/Editor/CustomEditors/Values/ReadOnlyValueContainer.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using FlaxEditor.Scripting;
using FlaxEngine;
diff --git a/Source/Editor/CustomEditors/Values/ValueContainer.cs b/Source/Editor/CustomEditors/Values/ValueContainer.cs
index 74ed01b38..b2f26bb7b 100644
--- a/Source/Editor/CustomEditors/Values/ValueContainer.cs
+++ b/Source/Editor/CustomEditors/Values/ValueContainer.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using System.Collections.Generic;
diff --git a/Source/Editor/Editor.Build.cs b/Source/Editor/Editor.Build.cs
index 9a21e2c60..a767ecac9 100644
--- a/Source/Editor/Editor.Build.cs
+++ b/Source/Editor/Editor.Build.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System.Collections.Generic;
using System.IO;
diff --git a/Source/Editor/Editor.cpp b/Source/Editor/Editor.cpp
index 49e1c40de..aa16421a3 100644
--- a/Source/Editor/Editor.cpp
+++ b/Source/Editor/Editor.cpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#if USE_EDITOR
diff --git a/Source/Editor/Editor.cs b/Source/Editor/Editor.cs
index 816035858..59810043d 100644
--- a/Source/Editor/Editor.cs
+++ b/Source/Editor/Editor.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using System.Collections.Generic;
@@ -409,11 +409,6 @@ namespace FlaxEditor
{
_modules[i].OnUpdate();
}
-
- if (Input.GetKeyDown(KeyboardKeys.F6))
- {
- Simulation.RequestResumeOrPause();
- }
}
catch (Exception ex)
{
@@ -1203,7 +1198,7 @@ namespace FlaxEditor
var win = Windows.GameWin.Root;
if (win != null && win.RootWindow is WindowRootControl root && root.Window.IsFocused)
{
- pos = Vector2.Round(Windows.GameWin.Viewport.PointFromWindow(root.ScreenToClient(pos)));
+ pos = Vector2.Round(Windows.GameWin.Viewport.PointFromWindow(root.Window.ScreenToClient(pos)));
}
else
{
diff --git a/Source/Editor/Editor.h b/Source/Editor/Editor.h
index b83fe626e..761e4b059 100644
--- a/Source/Editor/Editor.h
+++ b/Source/Editor/Editor.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Editor/EditorAssets.cs b/Source/Editor/EditorAssets.cs
index eeef77459..8ffe9fe35 100644
--- a/Source/Editor/EditorAssets.cs
+++ b/Source/Editor/EditorAssets.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using FlaxEngine;
diff --git a/Source/Editor/EditorIcons.cs b/Source/Editor/EditorIcons.cs
index 4d81c4303..700b5e25e 100644
--- a/Source/Editor/EditorIcons.cs
+++ b/Source/Editor/EditorIcons.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System.Reflection;
using FlaxEngine;
diff --git a/Source/Editor/GUI/AssetPicker.cs b/Source/Editor/GUI/AssetPicker.cs
index 6a9c2a3f8..63c1276ab 100644
--- a/Source/Editor/GUI/AssetPicker.cs
+++ b/Source/Editor/GUI/AssetPicker.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using FlaxEditor.Content;
diff --git a/Source/Editor/GUI/ClickableLabel.cs b/Source/Editor/GUI/ClickableLabel.cs
index c8386fcfd..f8940e714 100644
--- a/Source/Editor/GUI/ClickableLabel.cs
+++ b/Source/Editor/GUI/ClickableLabel.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using FlaxEngine;
diff --git a/Source/Editor/GUI/ColumnDefinition.cs b/Source/Editor/GUI/ColumnDefinition.cs
index 6ea5dd5a7..d18f06213 100644
--- a/Source/Editor/GUI/ColumnDefinition.cs
+++ b/Source/Editor/GUI/ColumnDefinition.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using FlaxEngine;
diff --git a/Source/Editor/GUI/ComboBox.cs b/Source/Editor/GUI/ComboBox.cs
index 61dfe34f1..aa1c13c8a 100644
--- a/Source/Editor/GUI/ComboBox.cs
+++ b/Source/Editor/GUI/ComboBox.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using System.Collections.Generic;
diff --git a/Source/Editor/GUI/ContextMenu/ContextMenu.cs b/Source/Editor/GUI/ContextMenu/ContextMenu.cs
index b48e3ca59..45eff148e 100644
--- a/Source/Editor/GUI/ContextMenu/ContextMenu.cs
+++ b/Source/Editor/GUI/ContextMenu/ContextMenu.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using System.Collections.Generic;
diff --git a/Source/Editor/GUI/ContextMenu/ContextMenuBase.cs b/Source/Editor/GUI/ContextMenu/ContextMenuBase.cs
index 7fb3fe38a..6caf7f651 100644
--- a/Source/Editor/GUI/ContextMenu/ContextMenuBase.cs
+++ b/Source/Editor/GUI/ContextMenu/ContextMenuBase.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using FlaxEngine;
using FlaxEngine.Assertions;
@@ -45,6 +45,7 @@ namespace FlaxEditor.GUI.ContextMenu
private bool _isSubMenu;
private ContextMenuBase _childCM;
private Window _window;
+ private Control _previouslyFocused;
///
/// Returns true if context menu is opened
@@ -114,7 +115,7 @@ namespace FlaxEditor.GUI.ContextMenu
// Check if show menu inside the other menu - then link as a child to prevent closing the calling menu window on lost focus
if (_parentCM == null && parentWin.ChildrenCount == 1 && parentWin.Children[0] is ContextMenuBase parentCM)
{
- parentCM.ShowChild(this, parentCM.ScreenToClient(parent.ClientToScreen(location)), false);
+ parentCM.ShowChild(this, parentCM.PointFromScreen(parent.PointToScreen(location)), false);
return;
}
@@ -126,7 +127,7 @@ namespace FlaxEditor.GUI.ContextMenu
var dpiScale = Platform.DpiScale;
Vector2 dpiSize = Size * dpiScale;
Vector2 locationWS = parent.PointToWindow(location);
- Vector2 locationSS = parentWin.ClientToScreen(locationWS * dpiScale);
+ Vector2 locationSS = parentWin.PointToScreen(locationWS);
Location = Vector2.Zero;
Rectangle monitorBounds = Platform.GetMonitorBounds(locationSS);
Vector2 rightBottomLocationSS = locationSS + dpiSize;
@@ -185,6 +186,7 @@ namespace FlaxEditor.GUI.ContextMenu
return;
_window.Show();
PerformLayout();
+ _previouslyFocused = parentWin.FocusedControl;
Focus();
OnShow();
}
@@ -221,6 +223,14 @@ namespace FlaxEditor.GUI.ContextMenu
_parentCM = null;
}
+ // Return focus
+ if (_previouslyFocused != null)
+ {
+ _previouslyFocused.RootWindow?.Focus();
+ _previouslyFocused.Focus();
+ _previouslyFocused = null;
+ }
+
// Hide
Visible = false;
OnHide();
@@ -303,7 +313,7 @@ namespace FlaxEditor.GUI.ContextMenu
if (_parentCM != null)
{
// Focus parent if user clicked over the parent popup
- var mouse = _parentCM.ScreenToClient(FlaxEngine.Input.MouseScreenPosition / Platform.DpiScale);
+ var mouse = _parentCM.PointFromScreen(FlaxEngine.Input.MouseScreenPosition);
if (_parentCM.ContainsPoint(ref mouse))
{
_parentCM._window.Focus();
diff --git a/Source/Editor/GUI/ContextMenu/ContextMenuButton.cs b/Source/Editor/GUI/ContextMenu/ContextMenuButton.cs
index 48e9b516b..c4bdbce68 100644
--- a/Source/Editor/GUI/ContextMenu/ContextMenuButton.cs
+++ b/Source/Editor/GUI/ContextMenu/ContextMenuButton.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using FlaxEngine;
diff --git a/Source/Editor/GUI/ContextMenu/ContextMenuChildMenu.cs b/Source/Editor/GUI/ContextMenu/ContextMenuChildMenu.cs
index 743dc4d2f..690d904c1 100644
--- a/Source/Editor/GUI/ContextMenu/ContextMenuChildMenu.cs
+++ b/Source/Editor/GUI/ContextMenu/ContextMenuChildMenu.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using FlaxEngine;
using FlaxEngine.GUI;
diff --git a/Source/Editor/GUI/ContextMenu/ContextMenuItem.cs b/Source/Editor/GUI/ContextMenu/ContextMenuItem.cs
index 1a00b189f..24ef827ca 100644
--- a/Source/Editor/GUI/ContextMenu/ContextMenuItem.cs
+++ b/Source/Editor/GUI/ContextMenu/ContextMenuItem.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using FlaxEngine;
using FlaxEngine.GUI;
diff --git a/Source/Editor/GUI/ContextMenu/ContextMenuSeparator.cs b/Source/Editor/GUI/ContextMenu/ContextMenuSeparator.cs
index 61c5f62fa..8886981f0 100644
--- a/Source/Editor/GUI/ContextMenu/ContextMenuSeparator.cs
+++ b/Source/Editor/GUI/ContextMenu/ContextMenuSeparator.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using FlaxEngine;
using FlaxEngine.GUI;
diff --git a/Source/Editor/GUI/CurveEditor.cs b/Source/Editor/GUI/CurveEditor.cs
index 477e8d30d..8840a7f06 100644
--- a/Source/Editor/GUI/CurveEditor.cs
+++ b/Source/Editor/GUI/CurveEditor.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using System.Collections.Generic;
diff --git a/Source/Editor/GUI/Dialogs/ColorPickerDialog.cs b/Source/Editor/GUI/Dialogs/ColorPickerDialog.cs
index 92e70561b..9eb63ee48 100644
--- a/Source/Editor/GUI/Dialogs/ColorPickerDialog.cs
+++ b/Source/Editor/GUI/Dialogs/ColorPickerDialog.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using FlaxEditor.GUI.Input;
using FlaxEngine;
diff --git a/Source/Editor/GUI/Dialogs/ColorSelector.cs b/Source/Editor/GUI/Dialogs/ColorSelector.cs
index d6657a089..da1b913a5 100644
--- a/Source/Editor/GUI/Dialogs/ColorSelector.cs
+++ b/Source/Editor/GUI/Dialogs/ColorSelector.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using FlaxEngine;
diff --git a/Source/Editor/GUI/Dialogs/Dialog.cs b/Source/Editor/GUI/Dialogs/Dialog.cs
index 5aa4dbcfb..b8897b2e1 100644
--- a/Source/Editor/GUI/Dialogs/Dialog.cs
+++ b/Source/Editor/GUI/Dialogs/Dialog.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System.Threading;
using FlaxEngine;
diff --git a/Source/Editor/GUI/Docking/DockHintWindow.cs b/Source/Editor/GUI/Docking/DockHintWindow.cs
index c956bb9ad..de5b39c2d 100644
--- a/Source/Editor/GUI/Docking/DockHintWindow.cs
+++ b/Source/Editor/GUI/Docking/DockHintWindow.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using FlaxEngine;
@@ -20,6 +20,7 @@ namespace FlaxEditor.GUI.Docking
private Vector2 _mouse;
private DockState _toSet;
private DockPanel _toDock;
+ private bool _lateDragOffsetUpdate;
private Rectangle _rLeft, _rRight, _rBottom, _rUpper, _rCenter;
@@ -37,9 +38,14 @@ namespace FlaxEditor.GUI.Docking
window.Focus();
// Calculate dragging offset and move window to the destination position
- Vector2 mouse = FlaxEngine.Input.MouseScreenPosition;
- Vector2 baseWinPos = window.Position;
- _dragOffset = mouse - baseWinPos;
+ var mouseScreenPosition = FlaxEngine.Input.MouseScreenPosition;
+
+ // If the _toMove window was not focused when initializing this window, the result vector only contains zeros
+ // and to prevent a failure, we need to perform an update for the drag offset at later time which will be done in the OnMouseMove event handler.
+ if (mouseScreenPosition != Vector2.Zero)
+ CalculateDragOffset(mouseScreenPosition);
+ else
+ _lateDragOffsetUpdate = true;
// Get initial size
_defaultWindowSize = window.Size;
@@ -217,14 +223,19 @@ namespace FlaxEditor.GUI.Docking
return result;
}
+ private void CalculateDragOffset(Vector2 mouseScreenPosition)
+ {
+ Vector2 baseWinPos = this._toMove.Window.Window.Position;
+ _dragOffset = mouseScreenPosition - baseWinPos;
+ }
+
private void UpdateRects()
{
// Cache mouse position
_mouse = FlaxEngine.Input.MouseScreenPosition;
// Check intersection with any dock panel
- var dpiScale = Platform.DpiScale;
- var uiMouse = _mouse / dpiScale;
+ var uiMouse = _mouse;
_toDock = _toMove.MasterPanel.HitTest(ref uiMouse, _toMove);
// Check dock state to use
@@ -327,6 +338,16 @@ namespace FlaxEditor.GUI.Docking
private void OnMouseMove(ref Vector2 mousePos)
{
+ // Recalculate the drag offset because the current mouse screen position was invalid when we initialized the window
+ if (_lateDragOffsetUpdate)
+ {
+ // Calculate dragging offset and move window to the destination position
+ CalculateDragOffset(mousePos);
+
+ // Reset state
+ _lateDragOffsetUpdate = false;
+ }
+
UpdateRects();
}
diff --git a/Source/Editor/GUI/Docking/DockPanel.cs b/Source/Editor/GUI/Docking/DockPanel.cs
index 5641639ec..f6e10e653 100644
--- a/Source/Editor/GUI/Docking/DockPanel.cs
+++ b/Source/Editor/GUI/Docking/DockPanel.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using System.Collections.Generic;
@@ -125,7 +125,7 @@ namespace FlaxEditor.GUI.Docking
var control = _tabsProxy != null ? (Control)_tabsProxy : this;
var dpiScale = Platform.DpiScale;
var clientPos = control.PointToWindow(Vector2.Zero);
- return new Rectangle(parentWin.ClientToScreen(clientPos * dpiScale), control.Size * dpiScale);
+ return new Rectangle(parentWin.PointToScreen(clientPos), control.Size * dpiScale);
}
}
@@ -310,7 +310,7 @@ namespace FlaxEditor.GUI.Docking
var parentWin = Root;
if (parentWin == null)
return null;
- Vector2 clientPos = parentWin.ScreenToClient(position);
+ Vector2 clientPos = parentWin.PointFromScreen(position);
Vector2 localPos = PointFromWindow(clientPos);
// Early out
diff --git a/Source/Editor/GUI/Docking/DockPanelProxy.cs b/Source/Editor/GUI/Docking/DockPanelProxy.cs
index 83c19f1d6..748ae726c 100644
--- a/Source/Editor/GUI/Docking/DockPanelProxy.cs
+++ b/Source/Editor/GUI/Docking/DockPanelProxy.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using FlaxEditor.GUI.ContextMenu;
using FlaxEngine;
diff --git a/Source/Editor/GUI/Docking/DockWindow.cs b/Source/Editor/GUI/Docking/DockWindow.cs
index 791789a94..aa6d94ca8 100644
--- a/Source/Editor/GUI/Docking/DockWindow.cs
+++ b/Source/Editor/GUI/Docking/DockWindow.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System.Xml;
using FlaxEngine;
diff --git a/Source/Editor/GUI/Docking/FloatWindowDockPanel.cs b/Source/Editor/GUI/Docking/FloatWindowDockPanel.cs
index 881d696a6..2d890e654 100644
--- a/Source/Editor/GUI/Docking/FloatWindowDockPanel.cs
+++ b/Source/Editor/GUI/Docking/FloatWindowDockPanel.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using FlaxEngine;
using FlaxEngine.GUI;
@@ -76,7 +76,7 @@ namespace FlaxEditor.GUI.Docking
settings.Size = size;
settings.Position = location;
settings.MinimumSize = new Vector2(1);
- settings.MaximumSize = new Vector2(2000);
+ settings.MaximumSize = new Vector2(4096);
settings.Fullscreen = false;
settings.HasBorder = true;
settings.SupportsTransparency = false;
diff --git a/Source/Editor/GUI/Docking/MasterDockPanel.cs b/Source/Editor/GUI/Docking/MasterDockPanel.cs
index 83d9dbcef..f7acdbed4 100644
--- a/Source/Editor/GUI/Docking/MasterDockPanel.cs
+++ b/Source/Editor/GUI/Docking/MasterDockPanel.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System.Collections.Generic;
using FlaxEngine;
diff --git a/Source/Editor/GUI/Drag/DragActorType.cs b/Source/Editor/GUI/Drag/DragActorType.cs
index 136d2e932..2fcbdde6c 100644
--- a/Source/Editor/GUI/Drag/DragActorType.cs
+++ b/Source/Editor/GUI/Drag/DragActorType.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using System.Collections.Generic;
diff --git a/Source/Editor/GUI/Drag/DragActors.cs b/Source/Editor/GUI/Drag/DragActors.cs
index 5b5bfd6e3..1948c91e9 100644
--- a/Source/Editor/GUI/Drag/DragActors.cs
+++ b/Source/Editor/GUI/Drag/DragActors.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using System.Collections.Generic;
diff --git a/Source/Editor/GUI/Drag/DragAssets.cs b/Source/Editor/GUI/Drag/DragAssets.cs
index 4bf070d5e..f8a7739d1 100644
--- a/Source/Editor/GUI/Drag/DragAssets.cs
+++ b/Source/Editor/GUI/Drag/DragAssets.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using System.Collections.Generic;
diff --git a/Source/Editor/GUI/Drag/DragEventArgs.cs b/Source/Editor/GUI/Drag/DragEventArgs.cs
index a283d5723..5a69d8b3e 100644
--- a/Source/Editor/GUI/Drag/DragEventArgs.cs
+++ b/Source/Editor/GUI/Drag/DragEventArgs.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
namespace FlaxEditor.GUI.Drag
{
diff --git a/Source/Editor/GUI/Drag/DragHandlers.cs b/Source/Editor/GUI/Drag/DragHandlers.cs
index 675a869d5..ddee46e54 100644
--- a/Source/Editor/GUI/Drag/DragHandlers.cs
+++ b/Source/Editor/GUI/Drag/DragHandlers.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System.Collections.Generic;
using System.Linq;
diff --git a/Source/Editor/GUI/Drag/DragHelper.cs b/Source/Editor/GUI/Drag/DragHelper.cs
index b3812ba97..37c6c2ab5 100644
--- a/Source/Editor/GUI/Drag/DragHelper.cs
+++ b/Source/Editor/GUI/Drag/DragHelper.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using System.Collections.Generic;
diff --git a/Source/Editor/GUI/Drag/DragItems.cs b/Source/Editor/GUI/Drag/DragItems.cs
index 6f0da43c4..d50b8a28c 100644
--- a/Source/Editor/GUI/Drag/DragItems.cs
+++ b/Source/Editor/GUI/Drag/DragItems.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using System.Collections.Generic;
diff --git a/Source/Editor/GUI/Drag/DragNames.cs b/Source/Editor/GUI/Drag/DragNames.cs
index 5ebf5aa7b..cf23bf903 100644
--- a/Source/Editor/GUI/Drag/DragNames.cs
+++ b/Source/Editor/GUI/Drag/DragNames.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using System.Collections.Generic;
diff --git a/Source/Editor/GUI/Drag/DragScriptItems.cs b/Source/Editor/GUI/Drag/DragScriptItems.cs
index d2b69c757..57be81229 100644
--- a/Source/Editor/GUI/Drag/DragScriptItems.cs
+++ b/Source/Editor/GUI/Drag/DragScriptItems.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using System.Collections.Generic;
diff --git a/Source/Editor/GUI/Drag/DragScripts.cs b/Source/Editor/GUI/Drag/DragScripts.cs
index 8301caf99..38899abbf 100644
--- a/Source/Editor/GUI/Drag/DragScripts.cs
+++ b/Source/Editor/GUI/Drag/DragScripts.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using System.Collections.Generic;
diff --git a/Source/Editor/GUI/EnumComboBox.cs b/Source/Editor/GUI/EnumComboBox.cs
index a0c3bf328..8ceae0bb0 100644
--- a/Source/Editor/GUI/EnumComboBox.cs
+++ b/Source/Editor/GUI/EnumComboBox.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using System.Collections.Generic;
diff --git a/Source/Editor/GUI/Input/ColorValueBox.cs b/Source/Editor/GUI/Input/ColorValueBox.cs
index c6ca181c4..f1ed39954 100644
--- a/Source/Editor/GUI/Input/ColorValueBox.cs
+++ b/Source/Editor/GUI/Input/ColorValueBox.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using FlaxEditor.GUI.Dialogs;
diff --git a/Source/Editor/GUI/Input/DoubleValueBox.cs b/Source/Editor/GUI/Input/DoubleValueBox.cs
index 5b7127d25..b9f1afcac 100644
--- a/Source/Editor/GUI/Input/DoubleValueBox.cs
+++ b/Source/Editor/GUI/Input/DoubleValueBox.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using System.Globalization;
diff --git a/Source/Editor/GUI/Input/FloatValueBox.cs b/Source/Editor/GUI/Input/FloatValueBox.cs
index 1d4c229d5..1bbd56c9a 100644
--- a/Source/Editor/GUI/Input/FloatValueBox.cs
+++ b/Source/Editor/GUI/Input/FloatValueBox.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using System.Globalization;
diff --git a/Source/Editor/GUI/Input/IntValueBox.cs b/Source/Editor/GUI/Input/IntValueBox.cs
index 2983fbbdb..023fb6465 100644
--- a/Source/Editor/GUI/Input/IntValueBox.cs
+++ b/Source/Editor/GUI/Input/IntValueBox.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using FlaxEditor.Utilities;
diff --git a/Source/Editor/GUI/Input/LongValueBox.cs b/Source/Editor/GUI/Input/LongValueBox.cs
index 9d92f59d1..498d58d07 100644
--- a/Source/Editor/GUI/Input/LongValueBox.cs
+++ b/Source/Editor/GUI/Input/LongValueBox.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using FlaxEngine;
@@ -93,6 +93,18 @@ namespace FlaxEditor.GUI.Input
Value = Value;
}
+ ///
+ /// Sets the limits at once.
+ ///
+ /// The minimum value.
+ /// The minimum value.
+ public void SetLimits(long min, long max)
+ {
+ _min = Math.Min(min, max);
+ _max = Math.Max(min, max);
+ Value = Value;
+ }
+
///
protected sealed override void UpdateText()
{
diff --git a/Source/Editor/GUI/Input/SliderControl.cs b/Source/Editor/GUI/Input/SliderControl.cs
index 34c937cac..90288cfd0 100644
--- a/Source/Editor/GUI/Input/SliderControl.cs
+++ b/Source/Editor/GUI/Input/SliderControl.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using System.Globalization;
diff --git a/Source/Editor/GUI/Input/UIntValueBox.cs b/Source/Editor/GUI/Input/UIntValueBox.cs
new file mode 100644
index 000000000..9f1b2c1f4
--- /dev/null
+++ b/Source/Editor/GUI/Input/UIntValueBox.cs
@@ -0,0 +1,161 @@
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
+
+using System;
+using FlaxEditor.Utilities;
+using FlaxEngine;
+
+namespace FlaxEditor.GUI.Input
+{
+ ///
+ /// Unsigned Integer value editor.
+ ///
+ ///
+ [HideInEditor]
+ public class UIntValueBox : ValueBox
+ {
+ ///
+ public override uint Value
+ {
+ get => _value;
+ set
+ {
+ value = Mathf.Clamp(value, _min, _max);
+ if (_value != value)
+ {
+ // Set value
+ _value = value;
+
+ // Update
+ UpdateText();
+ OnValueChanged();
+ }
+ }
+ }
+
+ ///
+ public override uint MinValue
+ {
+ get => _min;
+ set
+ {
+ if (_min != value)
+ {
+ if (value > _max)
+ throw new ArgumentException();
+
+ _min = value;
+ Value = Value;
+ }
+ }
+ }
+
+ ///
+ public override uint MaxValue
+ {
+ get => _max;
+ set
+ {
+ if (_max != value)
+ {
+ if (value < _min)
+ throw new ArgumentException();
+
+ _max = value;
+ Value = Value;
+ }
+ }
+ }
+
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ /// The value.
+ /// The x location.
+ /// The y location.
+ /// The width.
+ /// The minimum value.
+ /// The maximum value.
+ /// The slide speed.
+ public UIntValueBox(uint value, float x = 0, float y = 0, float width = 120, uint min = uint.MinValue, uint max = uint.MaxValue, float slideSpeed = 1)
+ : base(Mathf.Clamp(value, min, max), x, y, width, min, max, slideSpeed)
+ {
+ UpdateText();
+ }
+
+ ///
+ /// Sets the value limits.
+ ///
+ /// The minimum value (bottom range).
+ /// The maximum value (upper range).
+ public void SetLimits(uint min, uint max)
+ {
+ _min = min;
+ _max = Mathf.Max(_min, max);
+ Value = Value;
+ }
+
+ ///
+ /// Sets the limits from the attribute.
+ ///
+ /// The limits.
+ public void SetLimits(RangeAttribute limits)
+ {
+ _min = limits.Min <= 0 ? uint.MinValue : (uint)limits.Min;
+ _max = Math.Max(_min, limits.Max == float.MaxValue ? uint.MaxValue : (uint)limits.Max);
+ Value = Value;
+ }
+
+ ///
+ /// Sets the limits from the attribute.
+ ///
+ /// The limits.
+ public void SetLimits(LimitAttribute limits)
+ {
+ _min = limits.Min <= 0 ? uint.MinValue : (uint)limits.Min;
+ _max = Math.Max(_min, limits.Max == float.MaxValue ? uint.MaxValue : (uint)limits.Max);
+ _slideSpeed = limits.SliderSpeed;
+ Value = Value;
+ }
+
+ ///
+ /// Sets the limits from the other .
+ ///
+ /// The other.
+ public void SetLimits(UIntValueBox other)
+ {
+ _min = other._min;
+ _max = other._max;
+ _slideSpeed = other._slideSpeed;
+ Value = Value;
+ }
+
+ ///
+ protected sealed override void UpdateText()
+ {
+ var text = _value.ToString();
+
+ SetText(text);
+ }
+
+ ///
+ protected override void TryGetValue()
+ {
+ try
+ {
+ var value = ShuntingYard.Parse(Text);
+ Value = (uint)value;
+ }
+ catch (Exception ex)
+ {
+ // Fall back to previous value
+ Editor.LogWarning(ex);
+ }
+ }
+
+ ///
+ protected override void ApplySliding(float delta)
+ {
+ Value = _startSlideValue + (uint)delta;
+ }
+ }
+}
diff --git a/Source/Editor/GUI/Input/ULongValueBox.cs b/Source/Editor/GUI/Input/ULongValueBox.cs
index 7215166ad..228778c97 100644
--- a/Source/Editor/GUI/Input/ULongValueBox.cs
+++ b/Source/Editor/GUI/Input/ULongValueBox.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using FlaxEditor.Utilities;
@@ -88,12 +88,24 @@ namespace FlaxEditor.GUI.Input
/// The limits.
public void SetLimits(LimitAttribute limits)
{
- _min = limits.Min == int.MinValue ? ulong.MinValue : (ulong)limits.Min;
- _max = Math.Max(_min, limits.Max == int.MaxValue ? ulong.MaxValue : (ulong)limits.Max);
+ _min = limits.Min < 0.0f ? 0 : (ulong)limits.Min;
+ _max = Math.Max(_min, limits.Max == float.MaxValue ? ulong.MaxValue : (ulong)limits.Max);
_slideSpeed = limits.SliderSpeed;
Value = Value;
}
+ ///
+ /// Sets the limits at once.
+ ///
+ /// The minimum value.
+ /// The minimum value.
+ public void SetLimits(ulong min, ulong max)
+ {
+ _min = Math.Min(min, max);
+ _max = Math.Max(min, max);
+ Value = Value;
+ }
+
///
protected sealed override void UpdateText()
{
diff --git a/Source/Editor/GUI/Input/ValueBox.cs b/Source/Editor/GUI/Input/ValueBox.cs
index 3de04109a..8ee1c3887 100644
--- a/Source/Editor/GUI/Input/ValueBox.cs
+++ b/Source/Editor/GUI/Input/ValueBox.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using FlaxEngine;
diff --git a/Source/Editor/GUI/ItemsListContextMenu.cs b/Source/Editor/GUI/ItemsListContextMenu.cs
index c77897793..8c4dd723d 100644
--- a/Source/Editor/GUI/ItemsListContextMenu.cs
+++ b/Source/Editor/GUI/ItemsListContextMenu.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using System.Collections.Generic;
diff --git a/Source/Editor/GUI/MainMenu.cs b/Source/Editor/GUI/MainMenu.cs
index d6e5886bb..7c49d85ac 100644
--- a/Source/Editor/GUI/MainMenu.cs
+++ b/Source/Editor/GUI/MainMenu.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using FlaxEngine;
@@ -192,13 +192,12 @@ namespace FlaxEditor.GUI
if (!_window.IsMaximized)
{
- var winSize = RootWindow.Size * Platform.DpiScale;
- /*
- * Distance from which the mouse is considered to be on the border/corner
- * You can change the distance by modifying the x value in : (int)(x * Platform.DpiScale)
- */
- int distance = (int)(10 * Platform.DpiScale);
-
+ var dpiScale = Platform.DpiScale;
+ var winSize = RootWindow.Size * dpiScale;
+
+ // Distance from which the mouse is considered to be on the border/corner
+ float distance = 5.0f * dpiScale;
+
if (pos.Y > winSize.Y - distance && pos.X < distance)
return WindowHitCodes.BottomLeft;
@@ -250,7 +249,7 @@ namespace FlaxEditor.GUI
}
return b;
}
-
+
///
/// Adds the button.
///
diff --git a/Source/Editor/GUI/MainMenuButton.cs b/Source/Editor/GUI/MainMenuButton.cs
index 3f7b19b18..c009e9c4c 100644
--- a/Source/Editor/GUI/MainMenuButton.cs
+++ b/Source/Editor/GUI/MainMenuButton.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using FlaxEngine;
using FlaxEngine.GUI;
diff --git a/Source/Editor/GUI/NavigationBar.cs b/Source/Editor/GUI/NavigationBar.cs
index 7a6429788..94f01bf98 100644
--- a/Source/Editor/GUI/NavigationBar.cs
+++ b/Source/Editor/GUI/NavigationBar.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using FlaxEngine;
using FlaxEngine.GUI;
@@ -27,6 +27,8 @@ namespace FlaxEditor.GUI
///
protected override void Arrange()
{
+ base.Arrange();
+
// Arrange buttons
float x = DefaultButtonsMargin;
for (int i = 0; i < _children.Count; i++)
@@ -50,10 +52,11 @@ namespace FlaxEditor.GUI
return;
var lastToolstripButton = toolstrip.LastButton;
+ var parentSize = Parent.Size;
Bounds = new Rectangle
(
new Vector2(lastToolstripButton.Right + 8.0f, 0),
- new Vector2(Parent.Width - X - 8.0f, 32)
+ new Vector2(parentSize.X - X - 8.0f, toolstrip.Height)
);
}
}
diff --git a/Source/Editor/GUI/NavigationButton.cs b/Source/Editor/GUI/NavigationButton.cs
index 100294693..abd9eb4e6 100644
--- a/Source/Editor/GUI/NavigationButton.cs
+++ b/Source/Editor/GUI/NavigationButton.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using FlaxEngine;
using FlaxEngine.GUI;
diff --git a/Source/Editor/GUI/PlatformSelector.cs b/Source/Editor/GUI/PlatformSelector.cs
index b084afd53..d2e8bf682 100644
--- a/Source/Editor/GUI/PlatformSelector.cs
+++ b/Source/Editor/GUI/PlatformSelector.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using FlaxEngine;
diff --git a/Source/Editor/GUI/Popups/ActorSearchPopup.cs b/Source/Editor/GUI/Popups/ActorSearchPopup.cs
index a34d3a13b..1164394a8 100644
--- a/Source/Editor/GUI/Popups/ActorSearchPopup.cs
+++ b/Source/Editor/GUI/Popups/ActorSearchPopup.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using FlaxEngine;
diff --git a/Source/Editor/GUI/Popups/AssetSearchPopup.cs b/Source/Editor/GUI/Popups/AssetSearchPopup.cs
index d95c148c3..50963019e 100644
--- a/Source/Editor/GUI/Popups/AssetSearchPopup.cs
+++ b/Source/Editor/GUI/Popups/AssetSearchPopup.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using FlaxEditor.Content;
diff --git a/Source/Editor/GUI/Popups/RenamePopup.cs b/Source/Editor/GUI/Popups/RenamePopup.cs
index 1071abccb..834e620d9 100644
--- a/Source/Editor/GUI/Popups/RenamePopup.cs
+++ b/Source/Editor/GUI/Popups/RenamePopup.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using FlaxEditor.GUI.ContextMenu;
diff --git a/Source/Editor/GUI/Popups/ScriptSearchPopup.cs b/Source/Editor/GUI/Popups/ScriptSearchPopup.cs
index 232b2c0f0..6c1cf74fd 100644
--- a/Source/Editor/GUI/Popups/ScriptSearchPopup.cs
+++ b/Source/Editor/GUI/Popups/ScriptSearchPopup.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using FlaxEditor.Scripting;
diff --git a/Source/Editor/GUI/Popups/TypeSearchPopup.cs b/Source/Editor/GUI/Popups/TypeSearchPopup.cs
index b087b5b85..f1300d299 100644
--- a/Source/Editor/GUI/Popups/TypeSearchPopup.cs
+++ b/Source/Editor/GUI/Popups/TypeSearchPopup.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using System.Linq;
diff --git a/Source/Editor/GUI/PrefabDiffContextMenu.cs b/Source/Editor/GUI/PrefabDiffContextMenu.cs
index 51690e068..9f40b11fb 100644
--- a/Source/Editor/GUI/PrefabDiffContextMenu.cs
+++ b/Source/Editor/GUI/PrefabDiffContextMenu.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using FlaxEditor.GUI.ContextMenu;
diff --git a/Source/Editor/GUI/Row.cs b/Source/Editor/GUI/Row.cs
index aeffdb1cd..8ae84f138 100644
--- a/Source/Editor/GUI/Row.cs
+++ b/Source/Editor/GUI/Row.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using FlaxEngine;
using FlaxEngine.GUI;
diff --git a/Source/Editor/GUI/StatusBar.cs b/Source/Editor/GUI/StatusBar.cs
index 7ddc42ac8..9f993ba32 100644
--- a/Source/Editor/GUI/StatusBar.cs
+++ b/Source/Editor/GUI/StatusBar.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using FlaxEngine;
using FlaxEngine.GUI;
diff --git a/Source/Editor/GUI/StyleValueEditor.cs b/Source/Editor/GUI/StyleValueEditor.cs
index fec0e5794..1e269cd97 100644
--- a/Source/Editor/GUI/StyleValueEditor.cs
+++ b/Source/Editor/GUI/StyleValueEditor.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using FlaxEditor.Windows;
diff --git a/Source/Editor/GUI/Table.cs b/Source/Editor/GUI/Table.cs
index 5acefd9da..e070cba17 100644
--- a/Source/Editor/GUI/Table.cs
+++ b/Source/Editor/GUI/Table.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using System.Runtime.CompilerServices;
diff --git a/Source/Editor/GUI/Tabs/Tab.cs b/Source/Editor/GUI/Tabs/Tab.cs
index 0f24db27f..91025deac 100644
--- a/Source/Editor/GUI/Tabs/Tab.cs
+++ b/Source/Editor/GUI/Tabs/Tab.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using FlaxEngine;
diff --git a/Source/Editor/GUI/Tabs/Tabs.cs b/Source/Editor/GUI/Tabs/Tabs.cs
index 72e5826c7..377c6827d 100644
--- a/Source/Editor/GUI/Tabs/Tabs.cs
+++ b/Source/Editor/GUI/Tabs/Tabs.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using System.Collections;
diff --git a/Source/Editor/GUI/Timeline/AnimationTimeline.cs b/Source/Editor/GUI/Timeline/AnimationTimeline.cs
index 59e48810f..f4d9d6c71 100644
--- a/Source/Editor/GUI/Timeline/AnimationTimeline.cs
+++ b/Source/Editor/GUI/Timeline/AnimationTimeline.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using FlaxEditor.GUI.Timeline.Tracks;
using FlaxEngine;
diff --git a/Source/Editor/GUI/Timeline/GUI/Background.cs b/Source/Editor/GUI/Timeline/GUI/Background.cs
index 94b9135bc..e95ee6e16 100644
--- a/Source/Editor/GUI/Timeline/GUI/Background.cs
+++ b/Source/Editor/GUI/Timeline/GUI/Background.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using System.Globalization;
diff --git a/Source/Editor/GUI/Timeline/GUI/GradientEditor.cs b/Source/Editor/GUI/Timeline/GUI/GradientEditor.cs
index d00410687..1fc3578cb 100644
--- a/Source/Editor/GUI/Timeline/GUI/GradientEditor.cs
+++ b/Source/Editor/GUI/Timeline/GUI/GradientEditor.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using System.Collections.Generic;
diff --git a/Source/Editor/GUI/Timeline/GUI/KeyframesEditor.cs b/Source/Editor/GUI/Timeline/GUI/KeyframesEditor.cs
index ef1b82ed1..abd3e78a8 100644
--- a/Source/Editor/GUI/Timeline/GUI/KeyframesEditor.cs
+++ b/Source/Editor/GUI/Timeline/GUI/KeyframesEditor.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using System.Collections.Generic;
diff --git a/Source/Editor/GUI/Timeline/GUI/PositionHandle.cs b/Source/Editor/GUI/Timeline/GUI/PositionHandle.cs
index 3410cfbd2..079ef9957 100644
--- a/Source/Editor/GUI/Timeline/GUI/PositionHandle.cs
+++ b/Source/Editor/GUI/Timeline/GUI/PositionHandle.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using FlaxEngine;
using FlaxEngine.GUI;
diff --git a/Source/Editor/GUI/Timeline/GUI/TimelineEdge.cs b/Source/Editor/GUI/Timeline/GUI/TimelineEdge.cs
index b36136ddf..7de81bf0e 100644
--- a/Source/Editor/GUI/Timeline/GUI/TimelineEdge.cs
+++ b/Source/Editor/GUI/Timeline/GUI/TimelineEdge.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using FlaxEditor.GUI.Timeline.Undo;
using FlaxEngine;
diff --git a/Source/Editor/GUI/Timeline/Media.cs b/Source/Editor/GUI/Timeline/Media.cs
index 46ff11d74..7183d330e 100644
--- a/Source/Editor/GUI/Timeline/Media.cs
+++ b/Source/Editor/GUI/Timeline/Media.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using FlaxEditor.GUI.Timeline.Undo;
diff --git a/Source/Editor/GUI/Timeline/ParticleSystemTimeline.cs b/Source/Editor/GUI/Timeline/ParticleSystemTimeline.cs
index b3ad364a7..a537c3346 100644
--- a/Source/Editor/GUI/Timeline/ParticleSystemTimeline.cs
+++ b/Source/Editor/GUI/Timeline/ParticleSystemTimeline.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using System.Collections.Generic;
diff --git a/Source/Editor/GUI/Timeline/SceneAnimationTimeline.cs b/Source/Editor/GUI/Timeline/SceneAnimationTimeline.cs
index 168588a9e..7549fb984 100644
--- a/Source/Editor/GUI/Timeline/SceneAnimationTimeline.cs
+++ b/Source/Editor/GUI/Timeline/SceneAnimationTimeline.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using FlaxEditor.Content;
diff --git a/Source/Editor/GUI/Timeline/Timeline.cs b/Source/Editor/GUI/Timeline/Timeline.cs
index b012eb2a2..149f4a3c8 100644
--- a/Source/Editor/GUI/Timeline/Timeline.cs
+++ b/Source/Editor/GUI/Timeline/Timeline.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using System.Collections.Generic;
diff --git a/Source/Editor/GUI/Timeline/Track.cs b/Source/Editor/GUI/Timeline/Track.cs
index 951e72302..4f5278251 100644
--- a/Source/Editor/GUI/Timeline/Track.cs
+++ b/Source/Editor/GUI/Timeline/Track.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using System.Collections.Generic;
diff --git a/Source/Editor/GUI/Timeline/TrackArchetype.cs b/Source/Editor/GUI/Timeline/TrackArchetype.cs
index 821a8484e..ca855d75a 100644
--- a/Source/Editor/GUI/Timeline/TrackArchetype.cs
+++ b/Source/Editor/GUI/Timeline/TrackArchetype.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System.IO;
using FlaxEngine;
diff --git a/Source/Editor/GUI/Timeline/TrackCreateOptions.cs b/Source/Editor/GUI/Timeline/TrackCreateOptions.cs
index 1f2c04048..2d370d6ba 100644
--- a/Source/Editor/GUI/Timeline/TrackCreateOptions.cs
+++ b/Source/Editor/GUI/Timeline/TrackCreateOptions.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using FlaxEngine;
diff --git a/Source/Editor/GUI/Timeline/Tracks/ActorTrack.cs b/Source/Editor/GUI/Timeline/Tracks/ActorTrack.cs
index 820e3521e..580d1f266 100644
--- a/Source/Editor/GUI/Timeline/Tracks/ActorTrack.cs
+++ b/Source/Editor/GUI/Timeline/Tracks/ActorTrack.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using System.IO;
diff --git a/Source/Editor/GUI/Timeline/Tracks/AnimationChannelTrack.cs b/Source/Editor/GUI/Timeline/Tracks/AnimationChannelTrack.cs
index 600e71a68..c040f366d 100644
--- a/Source/Editor/GUI/Timeline/Tracks/AnimationChannelTrack.cs
+++ b/Source/Editor/GUI/Timeline/Tracks/AnimationChannelTrack.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System.IO;
using FlaxEngine;
diff --git a/Source/Editor/GUI/Timeline/Tracks/AudioTrack.cs b/Source/Editor/GUI/Timeline/Tracks/AudioTrack.cs
index 5e6778b63..031226a02 100644
--- a/Source/Editor/GUI/Timeline/Tracks/AudioTrack.cs
+++ b/Source/Editor/GUI/Timeline/Tracks/AudioTrack.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using System.IO;
diff --git a/Source/Editor/GUI/Timeline/Tracks/CameraCutTrack.cs b/Source/Editor/GUI/Timeline/Tracks/CameraCutTrack.cs
index 378bfac57..2a4a42ebc 100644
--- a/Source/Editor/GUI/Timeline/Tracks/CameraCutTrack.cs
+++ b/Source/Editor/GUI/Timeline/Tracks/CameraCutTrack.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using System.Collections;
diff --git a/Source/Editor/GUI/Timeline/Tracks/CurvePropertyTrack.cs b/Source/Editor/GUI/Timeline/Tracks/CurvePropertyTrack.cs
index bc5a8de91..f6a19d749 100644
--- a/Source/Editor/GUI/Timeline/Tracks/CurvePropertyTrack.cs
+++ b/Source/Editor/GUI/Timeline/Tracks/CurvePropertyTrack.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using System.IO;
diff --git a/Source/Editor/GUI/Timeline/Tracks/EventTrack.cs b/Source/Editor/GUI/Timeline/Tracks/EventTrack.cs
index 59bc3d30f..683458b16 100644
--- a/Source/Editor/GUI/Timeline/Tracks/EventTrack.cs
+++ b/Source/Editor/GUI/Timeline/Tracks/EventTrack.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using System.IO;
diff --git a/Source/Editor/GUI/Timeline/Tracks/FolderTrack.cs b/Source/Editor/GUI/Timeline/Tracks/FolderTrack.cs
index 297695c50..5e251b6d2 100644
--- a/Source/Editor/GUI/Timeline/Tracks/FolderTrack.cs
+++ b/Source/Editor/GUI/Timeline/Tracks/FolderTrack.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System.IO;
using FlaxEditor.GUI.Input;
diff --git a/Source/Editor/GUI/Timeline/Tracks/KeyframesPropertyTrack.cs b/Source/Editor/GUI/Timeline/Tracks/KeyframesPropertyTrack.cs
index 3eb77afb9..a5d81ba7c 100644
--- a/Source/Editor/GUI/Timeline/Tracks/KeyframesPropertyTrack.cs
+++ b/Source/Editor/GUI/Timeline/Tracks/KeyframesPropertyTrack.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using System.IO;
diff --git a/Source/Editor/GUI/Timeline/Tracks/MemberTrack.cs b/Source/Editor/GUI/Timeline/Tracks/MemberTrack.cs
index d0f793998..57de46ee4 100644
--- a/Source/Editor/GUI/Timeline/Tracks/MemberTrack.cs
+++ b/Source/Editor/GUI/Timeline/Tracks/MemberTrack.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using System.Linq;
diff --git a/Source/Editor/GUI/Timeline/Tracks/NestedSceneAnimationTrack.cs b/Source/Editor/GUI/Timeline/Tracks/NestedSceneAnimationTrack.cs
index 9874101b9..385314c00 100644
--- a/Source/Editor/GUI/Timeline/Tracks/NestedSceneAnimationTrack.cs
+++ b/Source/Editor/GUI/Timeline/Tracks/NestedSceneAnimationTrack.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using System.IO;
diff --git a/Source/Editor/GUI/Timeline/Tracks/ObjectPropertyTrack.cs b/Source/Editor/GUI/Timeline/Tracks/ObjectPropertyTrack.cs
index 538447ab2..9a41838e2 100644
--- a/Source/Editor/GUI/Timeline/Tracks/ObjectPropertyTrack.cs
+++ b/Source/Editor/GUI/Timeline/Tracks/ObjectPropertyTrack.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using System.IO;
diff --git a/Source/Editor/GUI/Timeline/Tracks/ObjectReferencePropertyTrack.cs b/Source/Editor/GUI/Timeline/Tracks/ObjectReferencePropertyTrack.cs
index e3053ac31..6dc408057 100644
--- a/Source/Editor/GUI/Timeline/Tracks/ObjectReferencePropertyTrack.cs
+++ b/Source/Editor/GUI/Timeline/Tracks/ObjectReferencePropertyTrack.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using System.IO;
diff --git a/Source/Editor/GUI/Timeline/Tracks/ObjectTrack.cs b/Source/Editor/GUI/Timeline/Tracks/ObjectTrack.cs
index 67c402354..2ed5070c5 100644
--- a/Source/Editor/GUI/Timeline/Tracks/ObjectTrack.cs
+++ b/Source/Editor/GUI/Timeline/Tracks/ObjectTrack.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using System.Collections.Generic;
diff --git a/Source/Editor/GUI/Timeline/Tracks/ParticleEmitterTrack.cs b/Source/Editor/GUI/Timeline/Tracks/ParticleEmitterTrack.cs
index 5e022bc8b..e7fa9e0ba 100644
--- a/Source/Editor/GUI/Timeline/Tracks/ParticleEmitterTrack.cs
+++ b/Source/Editor/GUI/Timeline/Tracks/ParticleEmitterTrack.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using System.Collections.Generic;
diff --git a/Source/Editor/GUI/Timeline/Tracks/PostProcessMaterialTrack.cs b/Source/Editor/GUI/Timeline/Tracks/PostProcessMaterialTrack.cs
index 848298b14..a84a047da 100644
--- a/Source/Editor/GUI/Timeline/Tracks/PostProcessMaterialTrack.cs
+++ b/Source/Editor/GUI/Timeline/Tracks/PostProcessMaterialTrack.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using System.IO;
diff --git a/Source/Editor/GUI/Timeline/Tracks/ScreenFadeTrack.cs b/Source/Editor/GUI/Timeline/Tracks/ScreenFadeTrack.cs
index fab2d2436..ea9ff6dcf 100644
--- a/Source/Editor/GUI/Timeline/Tracks/ScreenFadeTrack.cs
+++ b/Source/Editor/GUI/Timeline/Tracks/ScreenFadeTrack.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System.Collections.Generic;
using System.IO;
diff --git a/Source/Editor/GUI/Timeline/Tracks/ScriptTrack.cs b/Source/Editor/GUI/Timeline/Tracks/ScriptTrack.cs
index 5f71eb583..1e99d306f 100644
--- a/Source/Editor/GUI/Timeline/Tracks/ScriptTrack.cs
+++ b/Source/Editor/GUI/Timeline/Tracks/ScriptTrack.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using System.IO;
diff --git a/Source/Editor/GUI/Timeline/Tracks/SingleMediaAssetTrack.cs b/Source/Editor/GUI/Timeline/Tracks/SingleMediaAssetTrack.cs
index 7c92b8c81..adaf354ca 100644
--- a/Source/Editor/GUI/Timeline/Tracks/SingleMediaAssetTrack.cs
+++ b/Source/Editor/GUI/Timeline/Tracks/SingleMediaAssetTrack.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using FlaxEditor.GUI.Timeline.Undo;
diff --git a/Source/Editor/GUI/Timeline/Tracks/SingleMediaTrack.cs b/Source/Editor/GUI/Timeline/Tracks/SingleMediaTrack.cs
index 83564e15c..6ed700954 100644
--- a/Source/Editor/GUI/Timeline/Tracks/SingleMediaTrack.cs
+++ b/Source/Editor/GUI/Timeline/Tracks/SingleMediaTrack.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
namespace FlaxEditor.GUI.Timeline.Tracks
{
diff --git a/Source/Editor/GUI/Timeline/Tracks/StringPropertyTrack.cs b/Source/Editor/GUI/Timeline/Tracks/StringPropertyTrack.cs
index a021afc7b..b1b301daf 100644
--- a/Source/Editor/GUI/Timeline/Tracks/StringPropertyTrack.cs
+++ b/Source/Editor/GUI/Timeline/Tracks/StringPropertyTrack.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using System.IO;
diff --git a/Source/Editor/GUI/Timeline/Tracks/StructPropertyTrack.cs b/Source/Editor/GUI/Timeline/Tracks/StructPropertyTrack.cs
index 0ac60832a..4660c82b0 100644
--- a/Source/Editor/GUI/Timeline/Tracks/StructPropertyTrack.cs
+++ b/Source/Editor/GUI/Timeline/Tracks/StructPropertyTrack.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using System.IO;
diff --git a/Source/Editor/GUI/Timeline/Undo/AddRemoveTrackAction.cs b/Source/Editor/GUI/Timeline/Undo/AddRemoveTrackAction.cs
index de2cc21fc..be5beb757 100644
--- a/Source/Editor/GUI/Timeline/Undo/AddRemoveTrackAction.cs
+++ b/Source/Editor/GUI/Timeline/Undo/AddRemoveTrackAction.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System.IO;
using FlaxEngine;
diff --git a/Source/Editor/GUI/Timeline/Undo/EditFpsAction.cs b/Source/Editor/GUI/Timeline/Undo/EditFpsAction.cs
index 26e53706c..f15b23f86 100644
--- a/Source/Editor/GUI/Timeline/Undo/EditFpsAction.cs
+++ b/Source/Editor/GUI/Timeline/Undo/EditFpsAction.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
namespace FlaxEditor.GUI.Timeline.Undo
{
diff --git a/Source/Editor/GUI/Timeline/Undo/EditTimelineAction.cs b/Source/Editor/GUI/Timeline/Undo/EditTimelineAction.cs
index 15ef0138c..dba1a95d8 100644
--- a/Source/Editor/GUI/Timeline/Undo/EditTimelineAction.cs
+++ b/Source/Editor/GUI/Timeline/Undo/EditTimelineAction.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System.IO;
diff --git a/Source/Editor/GUI/Timeline/Undo/EditTrackAction.cs b/Source/Editor/GUI/Timeline/Undo/EditTrackAction.cs
index 3f3984b24..26f4e2b9f 100644
--- a/Source/Editor/GUI/Timeline/Undo/EditTrackAction.cs
+++ b/Source/Editor/GUI/Timeline/Undo/EditTrackAction.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System.IO;
using FlaxEngine;
diff --git a/Source/Editor/GUI/Timeline/Undo/RenameTrackAction.cs b/Source/Editor/GUI/Timeline/Undo/RenameTrackAction.cs
index 9782fc4ae..dc04ad487 100644
--- a/Source/Editor/GUI/Timeline/Undo/RenameTrackAction.cs
+++ b/Source/Editor/GUI/Timeline/Undo/RenameTrackAction.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
namespace FlaxEditor.GUI.Timeline.Undo
{
diff --git a/Source/Editor/GUI/Timeline/Undo/ReorderTrackAction.cs b/Source/Editor/GUI/Timeline/Undo/ReorderTrackAction.cs
index 6da33c7ed..4a23d9e3e 100644
--- a/Source/Editor/GUI/Timeline/Undo/ReorderTrackAction.cs
+++ b/Source/Editor/GUI/Timeline/Undo/ReorderTrackAction.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
namespace FlaxEditor.GUI.Timeline.Undo
{
diff --git a/Source/Editor/GUI/Timeline/Undo/TimelineUndoBlock.cs b/Source/Editor/GUI/Timeline/Undo/TimelineUndoBlock.cs
index 7573bfbb2..f474a4451 100644
--- a/Source/Editor/GUI/Timeline/Undo/TimelineUndoBlock.cs
+++ b/Source/Editor/GUI/Timeline/Undo/TimelineUndoBlock.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
diff --git a/Source/Editor/GUI/Timeline/Undo/TrackUndoBlock.cs b/Source/Editor/GUI/Timeline/Undo/TrackUndoBlock.cs
index 495a38d77..85838cf6d 100644
--- a/Source/Editor/GUI/Timeline/Undo/TrackUndoBlock.cs
+++ b/Source/Editor/GUI/Timeline/Undo/TrackUndoBlock.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
diff --git a/Source/Editor/GUI/ToolStrip.cs b/Source/Editor/GUI/ToolStrip.cs
index e3c0a82e1..27fb9961a 100644
--- a/Source/Editor/GUI/ToolStrip.cs
+++ b/Source/Editor/GUI/ToolStrip.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using FlaxEngine;
@@ -68,11 +68,14 @@ namespace FlaxEditor.GUI
///
/// Initializes a new instance of the class.
///
- public ToolStrip()
+ /// The toolstrip height.
+ /// The toolstrip Y position.
+ public ToolStrip(float height = 32.0f, float y = 0)
{
AutoFocus = false;
AnchorPreset = AnchorPresets.HorizontalStretchTop;
BackgroundColor = Style.Current.LightBackground;
+ Offsets = new Margin(0, 0, y, height * Editor.Instance.Options.Options.Interface.IconsScale);
}
///
diff --git a/Source/Editor/GUI/ToolStripButton.cs b/Source/Editor/GUI/ToolStripButton.cs
index 537d33688..c34669404 100644
--- a/Source/Editor/GUI/ToolStripButton.cs
+++ b/Source/Editor/GUI/ToolStripButton.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using FlaxEngine;
diff --git a/Source/Editor/GUI/ToolStripSeparator.cs b/Source/Editor/GUI/ToolStripSeparator.cs
index e49f17167..153c1908f 100644
--- a/Source/Editor/GUI/ToolStripSeparator.cs
+++ b/Source/Editor/GUI/ToolStripSeparator.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using FlaxEngine;
using FlaxEngine.GUI;
diff --git a/Source/Editor/GUI/Tree/Tree.cs b/Source/Editor/GUI/Tree/Tree.cs
index 755515457..99aaabcf5 100644
--- a/Source/Editor/GUI/Tree/Tree.cs
+++ b/Source/Editor/GUI/Tree/Tree.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using System.Collections.Generic;
diff --git a/Source/Editor/GUI/Tree/TreeNode.cs b/Source/Editor/GUI/Tree/TreeNode.cs
index 721139968..727da3edd 100644
--- a/Source/Editor/GUI/Tree/TreeNode.cs
+++ b/Source/Editor/GUI/Tree/TreeNode.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using FlaxEngine;
diff --git a/Source/Editor/Gizmo/EditorPrimitives.cs b/Source/Editor/Gizmo/EditorPrimitives.cs
index df2c0c886..cdb9f4747 100644
--- a/Source/Editor/Gizmo/EditorPrimitives.cs
+++ b/Source/Editor/Gizmo/EditorPrimitives.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using FlaxEngine;
diff --git a/Source/Editor/Gizmo/GizmoBase.cs b/Source/Editor/Gizmo/GizmoBase.cs
index 53a6ad4e5..6159c7673 100644
--- a/Source/Editor/Gizmo/GizmoBase.cs
+++ b/Source/Editor/Gizmo/GizmoBase.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System.Collections.Generic;
using FlaxEditor.SceneGraph;
diff --git a/Source/Editor/Gizmo/GizmosCollection.cs b/Source/Editor/Gizmo/GizmosCollection.cs
index a220a47ec..a246aeeb0 100644
--- a/Source/Editor/Gizmo/GizmosCollection.cs
+++ b/Source/Editor/Gizmo/GizmosCollection.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using System.Collections.Generic;
diff --git a/Source/Editor/Gizmo/GridGizmo.cs b/Source/Editor/Gizmo/GridGizmo.cs
index ee6b64991..22ff0cfd7 100644
--- a/Source/Editor/Gizmo/GridGizmo.cs
+++ b/Source/Editor/Gizmo/GridGizmo.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using FlaxEngine;
diff --git a/Source/Editor/Gizmo/IGizmoOwner.cs b/Source/Editor/Gizmo/IGizmoOwner.cs
index 92ae2e0f9..d3dc6cbc0 100644
--- a/Source/Editor/Gizmo/IGizmoOwner.cs
+++ b/Source/Editor/Gizmo/IGizmoOwner.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using FlaxEngine;
diff --git a/Source/Editor/Gizmo/SelectionOutline.cs b/Source/Editor/Gizmo/SelectionOutline.cs
index 44274f718..fbcd33be0 100644
--- a/Source/Editor/Gizmo/SelectionOutline.cs
+++ b/Source/Editor/Gizmo/SelectionOutline.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using System.Collections.Generic;
diff --git a/Source/Editor/Gizmo/TransformGizmo.cs b/Source/Editor/Gizmo/TransformGizmo.cs
index eb73262e9..eca5475ed 100644
--- a/Source/Editor/Gizmo/TransformGizmo.cs
+++ b/Source/Editor/Gizmo/TransformGizmo.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using System.Collections.Generic;
diff --git a/Source/Editor/Gizmo/TransformGizmoBase.Draw.cs b/Source/Editor/Gizmo/TransformGizmoBase.Draw.cs
index d922e0664..8f871c635 100644
--- a/Source/Editor/Gizmo/TransformGizmoBase.Draw.cs
+++ b/Source/Editor/Gizmo/TransformGizmoBase.Draw.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using FlaxEngine;
diff --git a/Source/Editor/Gizmo/TransformGizmoBase.Selection.cs b/Source/Editor/Gizmo/TransformGizmoBase.Selection.cs
index 396d1c236..d39447a34 100644
--- a/Source/Editor/Gizmo/TransformGizmoBase.Selection.cs
+++ b/Source/Editor/Gizmo/TransformGizmoBase.Selection.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using FlaxEngine;
diff --git a/Source/Editor/Gizmo/TransformGizmoBase.Settings.cs b/Source/Editor/Gizmo/TransformGizmoBase.Settings.cs
index 193c7b1cc..786e001e6 100644
--- a/Source/Editor/Gizmo/TransformGizmoBase.Settings.cs
+++ b/Source/Editor/Gizmo/TransformGizmoBase.Settings.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using FlaxEngine;
diff --git a/Source/Editor/Gizmo/TransformGizmoBase.Types.cs b/Source/Editor/Gizmo/TransformGizmoBase.Types.cs
index 8c01ef0e8..10437d3e8 100644
--- a/Source/Editor/Gizmo/TransformGizmoBase.Types.cs
+++ b/Source/Editor/Gizmo/TransformGizmoBase.Types.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
namespace FlaxEditor.Gizmo
{
diff --git a/Source/Editor/Gizmo/TransformGizmoBase.cs b/Source/Editor/Gizmo/TransformGizmoBase.cs
index 0a34d9546..87dcb6fa8 100644
--- a/Source/Editor/Gizmo/TransformGizmoBase.cs
+++ b/Source/Editor/Gizmo/TransformGizmoBase.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System.Collections.Generic;
using FlaxEngine;
@@ -325,7 +325,9 @@ namespace FlaxEditor.Gizmo
private void UpdateRotate(float dt)
{
- float delta = Owner.MouseDelta.X * dt;
+ float mouseDelta = _activeAxis == Axis.Y ? -Owner.MouseDelta.X : Owner.MouseDelta.X;
+
+ float delta = mouseDelta * dt;
if (RotationSnapEnabled || Owner.UseSnapping)
{
diff --git a/Source/Editor/History/HistoryStack.cs b/Source/Editor/History/HistoryStack.cs
index 72a273cfe..c7a63efc4 100644
--- a/Source/Editor/History/HistoryStack.cs
+++ b/Source/Editor/History/HistoryStack.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using System.Linq;
diff --git a/Source/Editor/History/IHistoryAction.cs b/Source/Editor/History/IHistoryAction.cs
index 95f5e43e5..2215d2c41 100644
--- a/Source/Editor/History/IHistoryAction.cs
+++ b/Source/Editor/History/IHistoryAction.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
namespace FlaxEditor.History
{
diff --git a/Source/Editor/History/UndoActionObject.cs b/Source/Editor/History/UndoActionObject.cs
index e7bf492e2..cac710bff 100644
--- a/Source/Editor/History/UndoActionObject.cs
+++ b/Source/Editor/History/UndoActionObject.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using System.Collections.Generic;
diff --git a/Source/Editor/IEditable.cs b/Source/Editor/IEditable.cs
index 608bec9f8..524ce3dea 100644
--- a/Source/Editor/IEditable.cs
+++ b/Source/Editor/IEditable.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
diff --git a/Source/Editor/Managed/ManagedEditor.Internal.cpp b/Source/Editor/Managed/ManagedEditor.Internal.cpp
index 6dc6c8388..4084c7f01 100644
--- a/Source/Editor/Managed/ManagedEditor.Internal.cpp
+++ b/Source/Editor/Managed/ManagedEditor.Internal.cpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#include "ManagedEditor.h"
#include "Editor/Editor.h"
@@ -1016,7 +1016,7 @@ public:
document.Parse(json.Get(), json.Length());
if (document.HasParseError())
{
- Log::JsonParseException(document.GetParseError());
+ Log::JsonParseException(document.GetParseError(), document.GetErrorOffset());
DebugLog::ThrowException("Failed to parse Json.");
}
diff --git a/Source/Editor/Managed/ManagedEditor.cpp b/Source/Editor/Managed/ManagedEditor.cpp
index 5717787a2..b32ec54b1 100644
--- a/Source/Editor/Managed/ManagedEditor.cpp
+++ b/Source/Editor/Managed/ManagedEditor.cpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#include "ManagedEditor.h"
#include "Editor/Editor.h"
diff --git a/Source/Editor/Managed/ManagedEditor.h b/Source/Editor/Managed/ManagedEditor.h
index be2f62c9f..5e0b612b5 100644
--- a/Source/Editor/Managed/ManagedEditor.h
+++ b/Source/Editor/Managed/ManagedEditor.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Editor/Modules/ContentDatabaseModule.cs b/Source/Editor/Modules/ContentDatabaseModule.cs
index 01f8bf8d0..c90a386c1 100644
--- a/Source/Editor/Modules/ContentDatabaseModule.cs
+++ b/Source/Editor/Modules/ContentDatabaseModule.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using System.Collections.Generic;
@@ -344,7 +344,13 @@ namespace FlaxEditor.Modules
return null;
}
- private static void RenameAsset(ContentItem el, ref string newPath)
+ ///
+ /// Renames a content item
+ ///
+ /// Content item
+ /// New path
+ /// True if failed, otherwise false
+ private static bool RenameAsset(ContentItem el, ref string newPath)
{
string oldPath = el.Path;
@@ -357,7 +363,7 @@ namespace FlaxEditor.Modules
{
// Error
Editor.LogError(string.Format("Cannot rename asset \'{0}\' to \'{1}\'", oldPath, newPath));
- return;
+ return true;
}
}
else
@@ -372,12 +378,13 @@ namespace FlaxEditor.Modules
// Error
Editor.LogWarning(ex);
Editor.LogError(string.Format("Cannot rename asset \'{0}\' to \'{1}\'", oldPath, newPath));
- return;
+ return true;
}
}
// Change path
el.UpdatePath(newPath);
+ return false;
}
private static void UpdateAssetNewNameTree(ContentItem el)
@@ -464,12 +471,6 @@ namespace FlaxEditor.Modules
MessageBox.Show("Cannot move folder. Target location already exists.");
return;
}
- if (!item.IsFolder && File.Exists(newPath))
- {
- // Error
- MessageBox.Show("Cannot move file. Target location already exists.");
- return;
- }
// Find target parent
var newDirPath = Path.GetDirectoryName(newPath);
@@ -526,7 +527,11 @@ namespace FlaxEditor.Modules
}
else
{
- RenameAsset(item, ref newPath);
+ if (RenameAsset(item, ref newPath))
+ {
+ MessageBox.Show("Cannot rename item.");
+ return;
+ }
}
if (item.ParentFolder != null)
diff --git a/Source/Editor/Modules/ContentEditingModule.cs b/Source/Editor/Modules/ContentEditingModule.cs
index 76986d6fc..0d0e65ca9 100644
--- a/Source/Editor/Modules/ContentEditingModule.cs
+++ b/Source/Editor/Modules/ContentEditingModule.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using FlaxEditor.Content;
diff --git a/Source/Editor/Modules/ContentFindingModule.cs b/Source/Editor/Modules/ContentFindingModule.cs
index 9fc66119b..88b5832af 100644
--- a/Source/Editor/Modules/ContentFindingModule.cs
+++ b/Source/Editor/Modules/ContentFindingModule.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using System.Collections.Generic;
diff --git a/Source/Editor/Modules/ContentImportingModule.cs b/Source/Editor/Modules/ContentImportingModule.cs
index 964926dba..03f434b9c 100644
--- a/Source/Editor/Modules/ContentImportingModule.cs
+++ b/Source/Editor/Modules/ContentImportingModule.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using System.Collections.Generic;
diff --git a/Source/Editor/Modules/EditorModule.cs b/Source/Editor/Modules/EditorModule.cs
index b73848d3e..6d14e09f5 100644
--- a/Source/Editor/Modules/EditorModule.cs
+++ b/Source/Editor/Modules/EditorModule.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using FlaxEngine;
diff --git a/Source/Editor/Modules/PrefabsModule.cs b/Source/Editor/Modules/PrefabsModule.cs
index e5f6c4551..b33da20df 100644
--- a/Source/Editor/Modules/PrefabsModule.cs
+++ b/Source/Editor/Modules/PrefabsModule.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using System.Linq;
diff --git a/Source/Editor/Modules/ProgressReportingModule.cs b/Source/Editor/Modules/ProgressReportingModule.cs
index 18f9e3480..c3264abfe 100644
--- a/Source/Editor/Modules/ProgressReportingModule.cs
+++ b/Source/Editor/Modules/ProgressReportingModule.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using System.Collections.Generic;
diff --git a/Source/Editor/Modules/ProjectCacheModule.cs b/Source/Editor/Modules/ProjectCacheModule.cs
index 6a9409405..a2a04c1eb 100644
--- a/Source/Editor/Modules/ProjectCacheModule.cs
+++ b/Source/Editor/Modules/ProjectCacheModule.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using System.Collections.Generic;
diff --git a/Source/Editor/Modules/SceneEditingModule.cs b/Source/Editor/Modules/SceneEditingModule.cs
index f158dd1c3..78ffd26b0 100644
--- a/Source/Editor/Modules/SceneEditingModule.cs
+++ b/Source/Editor/Modules/SceneEditingModule.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using System.Collections.Generic;
diff --git a/Source/Editor/Modules/SceneModule.cs b/Source/Editor/Modules/SceneModule.cs
index e41612a01..9fd860a51 100644
--- a/Source/Editor/Modules/SceneModule.cs
+++ b/Source/Editor/Modules/SceneModule.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using System.Collections.Generic;
@@ -359,9 +359,7 @@ namespace FlaxEditor.Modules
{
Editor.SceneEditing.Deselect();
- // TODO: this works in most cases fine but we still need to handle the case when assembly gets reloaded and type references are invalid
- // TODO: To solve this: serialize type reference as 'namespace.name' in undo data storage
- //if (fullCleanup)
+ if (fullCleanup)
{
Undo.Clear();
}
diff --git a/Source/Editor/Modules/SimulationModule.cs b/Source/Editor/Modules/SimulationModule.cs
index 5c37446ba..c1f2a3e7b 100644
--- a/Source/Editor/Modules/SimulationModule.cs
+++ b/Source/Editor/Modules/SimulationModule.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using System.Threading;
diff --git a/Source/Editor/Modules/SourceCodeEditing/CachedCustomAnimGraphNodesCollection.cs b/Source/Editor/Modules/SourceCodeEditing/CachedCustomAnimGraphNodesCollection.cs
index e7fa9469b..be0e96a36 100644
--- a/Source/Editor/Modules/SourceCodeEditing/CachedCustomAnimGraphNodesCollection.cs
+++ b/Source/Editor/Modules/SourceCodeEditing/CachedCustomAnimGraphNodesCollection.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using System.Collections.Generic;
diff --git a/Source/Editor/Modules/SourceCodeEditing/CachedTypesCollection.cs b/Source/Editor/Modules/SourceCodeEditing/CachedTypesCollection.cs
index 0957e679f..fe0c565e5 100644
--- a/Source/Editor/Modules/SourceCodeEditing/CachedTypesCollection.cs
+++ b/Source/Editor/Modules/SourceCodeEditing/CachedTypesCollection.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using System.Collections.Generic;
diff --git a/Source/Editor/Modules/SourceCodeEditing/CodeEditingModule.cs b/Source/Editor/Modules/SourceCodeEditing/CodeEditingModule.cs
index fd601b86f..e6868e4fd 100644
--- a/Source/Editor/Modules/SourceCodeEditing/CodeEditingModule.cs
+++ b/Source/Editor/Modules/SourceCodeEditing/CodeEditingModule.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using System.Collections.Generic;
diff --git a/Source/Editor/Modules/SourceCodeEditing/DefaultSourceCodeEditor.cs b/Source/Editor/Modules/SourceCodeEditing/DefaultSourceCodeEditor.cs
index e70acaccc..458d46100 100644
--- a/Source/Editor/Modules/SourceCodeEditing/DefaultSourceCodeEditor.cs
+++ b/Source/Editor/Modules/SourceCodeEditing/DefaultSourceCodeEditor.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using FlaxEngine;
diff --git a/Source/Editor/Modules/SourceCodeEditing/ISourceCodeEditor.cs b/Source/Editor/Modules/SourceCodeEditing/ISourceCodeEditor.cs
index 5db499302..c0dc5ef9d 100644
--- a/Source/Editor/Modules/SourceCodeEditing/ISourceCodeEditor.cs
+++ b/Source/Editor/Modules/SourceCodeEditing/ISourceCodeEditor.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
namespace FlaxEditor.Modules.SourceCodeEditing
{
diff --git a/Source/Editor/Modules/SourceCodeEditing/InBuildSourceCodeEditor.cs b/Source/Editor/Modules/SourceCodeEditing/InBuildSourceCodeEditor.cs
index 64e3f8d9c..73d3705db 100644
--- a/Source/Editor/Modules/SourceCodeEditing/InBuildSourceCodeEditor.cs
+++ b/Source/Editor/Modules/SourceCodeEditing/InBuildSourceCodeEditor.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
@@ -54,6 +54,9 @@ namespace FlaxEditor.Modules.SourceCodeEditing
case CodeEditorTypes.VSCode:
Name = "Visual Studio Code";
break;
+ case CodeEditorTypes.VSCodeInsiders:
+ Name = "Visual Studio Code - Insiders";
+ break;
default: throw new ArgumentOutOfRangeException(nameof(type), type, null);
}
}
@@ -68,6 +71,7 @@ namespace FlaxEditor.Modules.SourceCodeEditing
{
switch (Type)
{
+ case CodeEditorTypes.VSCodeInsiders:
case CodeEditorTypes.VSCode: return "-vscode";
default: return null;
}
diff --git a/Source/Editor/Modules/UIModule.cs b/Source/Editor/Modules/UIModule.cs
index fab73a004..6b01986a9 100644
--- a/Source/Editor/Modules/UIModule.cs
+++ b/Source/Editor/Modules/UIModule.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using System.IO;
@@ -8,6 +8,7 @@ using FlaxEditor.GUI;
using FlaxEditor.GUI.ContextMenu;
using FlaxEditor.GUI.Dialogs;
using FlaxEditor.GUI.Input;
+using FlaxEditor.Progress.Handlers;
using FlaxEditor.SceneGraph;
using FlaxEditor.SceneGraph.Actors;
using FlaxEditor.Utilities;
@@ -37,6 +38,7 @@ namespace FlaxEditor.Modules
private ContextMenuButton _menuEditRedo;
private ContextMenuButton _menuEditCut;
private ContextMenuButton _menuEditCopy;
+ private ContextMenuButton _menuEditPaste;
private ContextMenuButton _menuEditDelete;
private ContextMenuButton _menuEditDuplicate;
private ContextMenuButton _menuEditSelectAll;
@@ -161,7 +163,8 @@ namespace FlaxEditor.Modules
var undoRedo = Editor.Undo;
var gizmo = Editor.MainTransformGizmo;
var state = Editor.StateMachine.CurrentState;
- var canEditScene = state.CanEditScene;
+ var canEditScene = state.CanEditScene && Level.IsAnySceneLoaded;
+ var canUseUndoRedo = state.CanUseUndoRedo;
var canEnterPlayMode = state.CanEnterPlayMode && Level.IsAnySceneLoaded;
var isPlayMode = Editor.StateMachine.IsPlayMode;
var isDuringBreakpointHang = Editor.Simulation.IsDuringBreakpointHang;
@@ -170,15 +173,15 @@ namespace FlaxEditor.Modules
//
_toolStripSaveAll.Enabled = !isDuringBreakpointHang;
//
- _toolStripUndo.Enabled = canEditScene && undoRedo.CanUndo;
- _toolStripRedo.Enabled = canEditScene && undoRedo.CanRedo;
+ _toolStripUndo.Enabled = canEditScene && undoRedo.CanUndo && canUseUndoRedo;
+ _toolStripRedo.Enabled = canEditScene && undoRedo.CanRedo && canUseUndoRedo;
//
var gizmoMode = gizmo.ActiveMode;
_toolStripTranslate.Checked = gizmoMode == TransformGizmoBase.Mode.Translate;
_toolStripRotate.Checked = gizmoMode == TransformGizmoBase.Mode.Rotate;
_toolStripScale.Checked = gizmoMode == TransformGizmoBase.Mode.Scale;
//
- _toolStripBuildScenes.Enabled = canEditScene && !isPlayMode;
+ _toolStripBuildScenes.Enabled = (canEditScene && !isPlayMode) || Editor.StateMachine.BuildingScenesState.IsActive;
//
var play = _toolStripPlay;
var pause = _toolStripPause;
@@ -358,13 +361,13 @@ namespace FlaxEditor.Modules
// Place dialog nearby the target control
if (targetControl != null)
{
- var targetControlDesktopCenter = targetControl.ClientToScreen(targetControl.Size * 0.5f);
+ var targetControlDesktopCenter = targetControl.PointToScreen(targetControl.Size * 0.5f);
var desktopSize = Platform.GetMonitorBounds(targetControlDesktopCenter);
var pos = targetControlDesktopCenter + new Vector2(10.0f, -dialog.Height * 0.5f);
var dialogEnd = pos + dialog.Size;
var desktopEnd = desktopSize.BottomRight - new Vector2(10.0f);
if (dialogEnd.X >= desktopEnd.X || dialogEnd.Y >= desktopEnd.Y)
- pos = targetControl.ClientToScreen(Vector2.Zero) - new Vector2(10.0f + dialog.Width, dialog.Height);
+ pos = targetControl.PointToScreen(Vector2.Zero) - new Vector2(10.0f + dialog.Width, dialog.Height);
var desktopBounds = Platform.VirtualDesktopBounds;
pos = Vector2.Clamp(pos, desktopBounds.UpperLeft, desktopBounds.BottomRight - dialog.Size);
dialog.RootWindow.Window.Position = pos;
@@ -403,7 +406,7 @@ namespace FlaxEditor.Modules
cm.AddSeparator();
_menuEditCut = cm.AddButton("Cut", "Ctrl+X", Editor.SceneEditing.Cut);
_menuEditCopy = cm.AddButton("Copy", "Ctrl+C", Editor.SceneEditing.Copy);
- cm.AddButton("Paste", "Ctrl+V", Editor.SceneEditing.Paste);
+ _menuEditPaste = cm.AddButton("Paste", "Ctrl+V", Editor.SceneEditing.Paste);
cm.AddSeparator();
_menuEditDelete = cm.AddButton("Delete", "Del", Editor.SceneEditing.Delete);
_menuEditDuplicate = cm.AddButton("Duplicate", "Ctrl+D", Editor.SceneEditing.Duplicate);
@@ -490,10 +493,9 @@ namespace FlaxEditor.Modules
private void InitToolstrip(RootControl mainWindow)
{
- ToolStrip = new ToolStrip
+ ToolStrip = new ToolStrip(34.0f, MainMenu.Bottom)
{
Parent = mainWindow,
- Bounds = new Rectangle(0, MainMenu.Bottom, mainWindow.Width, 34),
};
_toolStripSaveAll = (ToolStripButton)ToolStrip.AddButton(Editor.Icons.Save32, Editor.SaveAll).LinkTooltip("Save all (Ctrl+S)");
@@ -594,17 +596,19 @@ namespace FlaxEditor.Modules
var undoRedo = Editor.Undo;
var hasSthSelected = Editor.SceneEditing.HasSthSelected;
+ var state = Editor.StateMachine.CurrentState;
+ var canEditScene = Level.IsAnySceneLoaded && state.CanEditScene;
+ var canUseUndoRedo = state.CanUseUndoRedo;
- bool canUndo = undoRedo.CanUndo;
- _menuEditUndo.Enabled = canUndo;
- _menuEditUndo.Text = canUndo ? string.Format("Undo \'{0}\'", undoRedo.FirstUndoName) : "No undo";
+ _menuEditUndo.Enabled = canEditScene && canUseUndoRedo && undoRedo.CanUndo;
+ _menuEditUndo.Text = undoRedo.CanUndo ? string.Format("Undo \'{0}\'", undoRedo.FirstUndoName) : "No undo";
- bool canRedo = undoRedo.CanRedo;
- _menuEditRedo.Enabled = canRedo;
- _menuEditRedo.Text = canRedo ? string.Format("Redo \'{0}\'", undoRedo.FirstRedoName) : "No redo";
+ _menuEditRedo.Enabled = canEditScene && canUseUndoRedo && undoRedo.CanRedo;
+ _menuEditRedo.Text = undoRedo.CanRedo ? string.Format("Redo \'{0}\'", undoRedo.FirstRedoName) : "No redo";
_menuEditCut.Enabled = hasSthSelected;
_menuEditCopy.Enabled = hasSthSelected;
+ _menuEditPaste.Enabled = canEditScene;
_menuEditDelete.Enabled = hasSthSelected;
_menuEditDuplicate.Enabled = hasSthSelected;
_menuEditSelectAll.Enabled = Level.IsAnySceneLoaded;
@@ -638,9 +642,10 @@ namespace FlaxEditor.Modules
var c = (ContextMenu)control;
var isPlayMode = Editor.StateMachine.IsPlayMode;
+ var canPlay = Level.IsAnySceneLoaded;
- _menuGamePlay.Enabled = !isPlayMode;
- _menuGamePause.Enabled = isPlayMode;
+ _menuGamePlay.Enabled = !isPlayMode && canPlay;
+ _menuGamePause.Enabled = isPlayMode && canPlay;
c.PerformLayout();
}
@@ -651,10 +656,11 @@ namespace FlaxEditor.Modules
return;
var c = (ContextMenu)control;
- bool canBakeLightmaps = Progress.Handlers.BakeLightmapsProgress.CanBake;
+ bool canBakeLightmaps = BakeLightmapsProgress.CanBake;
bool canEdit = Level.IsAnySceneLoaded && Editor.StateMachine.IsEditMode;
bool isBakingLightmaps = Editor.ProgressReporting.BakeLightmaps.IsActive;
bool isBuildingScenes = Editor.StateMachine.BuildingScenesState.IsActive;
+
_menuToolsBuildScenes.Enabled = canEdit || isBuildingScenes;
_menuToolsBuildScenes.Text = isBuildingScenes ? "Cancel building scenes data" : "Build scenes data";
_menuToolsBakeLightmaps.Enabled = (canEdit && canBakeLightmaps) || isBakingLightmaps;
diff --git a/Source/Editor/Modules/WindowsModule.cs b/Source/Editor/Modules/WindowsModule.cs
index 09a71c8df..9b80b664c 100644
--- a/Source/Editor/Modules/WindowsModule.cs
+++ b/Source/Editor/Modules/WindowsModule.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using System.Collections.Generic;
diff --git a/Source/Editor/Options/Editor.cs b/Source/Editor/Options/Editor.cs
index 70348a321..539cef444 100644
--- a/Source/Editor/Options/Editor.cs
+++ b/Source/Editor/Options/Editor.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using FlaxEditor.CustomEditors;
using FlaxEditor.CustomEditors.Editors;
diff --git a/Source/Editor/Options/EditorOptions.cs b/Source/Editor/Options/EditorOptions.cs
index f65e4acd3..74f6855b8 100644
--- a/Source/Editor/Options/EditorOptions.cs
+++ b/Source/Editor/Options/EditorOptions.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System.Collections.Generic;
using FlaxEngine;
diff --git a/Source/Editor/Options/GeneralOptions.cs b/Source/Editor/Options/GeneralOptions.cs
index d05a259d3..9b5450f45 100644
--- a/Source/Editor/Options/GeneralOptions.cs
+++ b/Source/Editor/Options/GeneralOptions.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System.ComponentModel;
using FlaxEngine;
diff --git a/Source/Editor/Options/InputBinding.cs b/Source/Editor/Options/InputBinding.cs
index 6312fa1a4..e28e8fa0c 100644
--- a/Source/Editor/Options/InputBinding.cs
+++ b/Source/Editor/Options/InputBinding.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using System.Collections.Generic;
diff --git a/Source/Editor/Options/InputOptions.cs b/Source/Editor/Options/InputOptions.cs
index 7e2482367..8f690454e 100644
--- a/Source/Editor/Options/InputOptions.cs
+++ b/Source/Editor/Options/InputOptions.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System.ComponentModel;
using FlaxEngine;
diff --git a/Source/Editor/Options/InterfaceOptions.cs b/Source/Editor/Options/InterfaceOptions.cs
index 981e4a653..e8929b77b 100644
--- a/Source/Editor/Options/InterfaceOptions.cs
+++ b/Source/Editor/Options/InterfaceOptions.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System.ComponentModel;
using FlaxEngine;
@@ -71,6 +71,13 @@ namespace FlaxEditor.Options
[DefaultValue(TimestampsFormats.None)]
[EditorDisplay("Interface"), EditorOrder(210), Tooltip("The timestamps prefix mode for debug log messages.")]
public TimestampsFormats DebugLogTimestampsFormat { get; set; } = TimestampsFormats.None;
+
+ ///
+ /// Gets or sets the editor icons scale. Editor restart required.
+ ///
+ [DefaultValue(1.0f), Limit(0.1f, 4.0f, 0.01f)]
+ [EditorDisplay("Interface"), EditorOrder(250), Tooltip("Editor icons scale. Editor restart required.")]
+ public float IconsScale { get; set; } = 1.0f;
///
/// Gets or sets the timestamps prefix mode for output log messages.
@@ -131,7 +138,7 @@ namespace FlaxEditor.Options
/// Gets or sets a value indicating whether auto-focus game window on play mode start.
///
[DefaultValue(true)]
- [EditorDisplay("Play In-Editor", "Focus Game Window On Play"), EditorOrder(200), Tooltip("Determines whether auto-focus game window on play mode start.")]
+ [EditorDisplay("Play In-Editor", "Focus Game Window On Play"), EditorOrder(400), Tooltip("Determines whether auto-focus game window on play mode start.")]
public bool FocusGameWinOnPlay { get; set; } = true;
private static FontAsset DefaultFont => FlaxEngine.Content.LoadAsyncInternal(EditorAssets.PrimaryFont);
diff --git a/Source/Editor/Options/OptionsModule.cs b/Source/Editor/Options/OptionsModule.cs
index 16dae5e8d..7c0cd11da 100644
--- a/Source/Editor/Options/OptionsModule.cs
+++ b/Source/Editor/Options/OptionsModule.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using System.Collections.Generic;
@@ -196,9 +196,9 @@ namespace FlaxEditor.Options
// If a non-default style was chosen, switch to that style
string styleName = themeOptions.SelectedStyle;
- if (styleName != "Default" && themeOptions.Styles.ContainsKey(styleName))
+ if (styleName != "Default" && themeOptions.Styles.TryGetValue(styleName, out var style) && style != null)
{
- Style.Current = themeOptions.Styles[themeOptions.SelectedStyle];
+ Style.Current = style;
}
else
{
diff --git a/Source/Editor/Options/SourceCodeOptions.cs b/Source/Editor/Options/SourceCodeOptions.cs
index 260549a80..2e19e9103 100644
--- a/Source/Editor/Options/SourceCodeOptions.cs
+++ b/Source/Editor/Options/SourceCodeOptions.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System.ComponentModel;
using FlaxEditor.CustomEditors;
diff --git a/Source/Editor/Options/ThemeOptions.cs b/Source/Editor/Options/ThemeOptions.cs
index 8afecccda..169a9d9fe 100644
--- a/Source/Editor/Options/ThemeOptions.cs
+++ b/Source/Editor/Options/ThemeOptions.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System.Collections.Generic;
using FlaxEditor.CustomEditors;
diff --git a/Source/Editor/Options/ViewportOptions.cs b/Source/Editor/Options/ViewportOptions.cs
index 140a7052c..6e1f8a9d6 100644
--- a/Source/Editor/Options/ViewportOptions.cs
+++ b/Source/Editor/Options/ViewportOptions.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System.ComponentModel;
using FlaxEngine;
diff --git a/Source/Editor/Options/VisualOptions.cs b/Source/Editor/Options/VisualOptions.cs
index 7808de95e..2aa666387 100644
--- a/Source/Editor/Options/VisualOptions.cs
+++ b/Source/Editor/Options/VisualOptions.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System.ComponentModel;
using FlaxEngine;
diff --git a/Source/Editor/Plugins/EditorPlugin.cs b/Source/Editor/Plugins/EditorPlugin.cs
index 6639c9201..46b33e798 100644
--- a/Source/Editor/Plugins/EditorPlugin.cs
+++ b/Source/Editor/Plugins/EditorPlugin.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using FlaxEngine;
diff --git a/Source/Editor/Plugins/PluginUtils.cs b/Source/Editor/Plugins/PluginUtils.cs
index 30b2992ac..389e24ff0 100644
--- a/Source/Editor/Plugins/PluginUtils.cs
+++ b/Source/Editor/Plugins/PluginUtils.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using System.IO;
diff --git a/Source/Editor/Progress/Handlers/BakeEnvProbesProgress.cs b/Source/Editor/Progress/Handlers/BakeEnvProbesProgress.cs
index 7c4b8c5bf..ad501cb44 100644
--- a/Source/Editor/Progress/Handlers/BakeEnvProbesProgress.cs
+++ b/Source/Editor/Progress/Handlers/BakeEnvProbesProgress.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using FlaxEngine;
diff --git a/Source/Editor/Progress/Handlers/BakeLightmapsProgress.cs b/Source/Editor/Progress/Handlers/BakeLightmapsProgress.cs
index 88a0186ed..39e46d19e 100644
--- a/Source/Editor/Progress/Handlers/BakeLightmapsProgress.cs
+++ b/Source/Editor/Progress/Handlers/BakeLightmapsProgress.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using FlaxEngine;
diff --git a/Source/Editor/Progress/Handlers/BuildingGameProgress.cs b/Source/Editor/Progress/Handlers/BuildingGameProgress.cs
index cb5945194..719764ea2 100644
--- a/Source/Editor/Progress/Handlers/BuildingGameProgress.cs
+++ b/Source/Editor/Progress/Handlers/BuildingGameProgress.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using FlaxEngine;
diff --git a/Source/Editor/Progress/Handlers/CodeEditorOpenProgress.cs b/Source/Editor/Progress/Handlers/CodeEditorOpenProgress.cs
index bf9cdcadc..592ba2c2f 100644
--- a/Source/Editor/Progress/Handlers/CodeEditorOpenProgress.cs
+++ b/Source/Editor/Progress/Handlers/CodeEditorOpenProgress.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using FlaxEngine;
diff --git a/Source/Editor/Progress/Handlers/CompileScriptsProgress.cs b/Source/Editor/Progress/Handlers/CompileScriptsProgress.cs
index 3661e89df..1db01c510 100644
--- a/Source/Editor/Progress/Handlers/CompileScriptsProgress.cs
+++ b/Source/Editor/Progress/Handlers/CompileScriptsProgress.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using FlaxEngine;
using FlaxEditor.Utilities;
@@ -36,7 +36,7 @@ namespace FlaxEditor.Progress.Handlers
_selectionCache.Cache();
// Clear references to the user scripts (we gonna reload an assembly)
- Editor.Instance.Scene.ClearRefsToSceneObjects();
+ Editor.Instance.Scene.ClearRefsToSceneObjects(true);
}
private void OnScriptsReload()
diff --git a/Source/Editor/Progress/Handlers/GenerateScriptsProjectFilesProgress.cs b/Source/Editor/Progress/Handlers/GenerateScriptsProjectFilesProgress.cs
index 8ff41d286..a724ce87a 100644
--- a/Source/Editor/Progress/Handlers/GenerateScriptsProjectFilesProgress.cs
+++ b/Source/Editor/Progress/Handlers/GenerateScriptsProjectFilesProgress.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System.Threading.Tasks;
diff --git a/Source/Editor/Progress/Handlers/ImportAssetsProgress.cs b/Source/Editor/Progress/Handlers/ImportAssetsProgress.cs
index ddaf02f3a..41745becb 100644
--- a/Source/Editor/Progress/Handlers/ImportAssetsProgress.cs
+++ b/Source/Editor/Progress/Handlers/ImportAssetsProgress.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using FlaxEditor.Content;
using FlaxEditor.Content.Import;
diff --git a/Source/Editor/Progress/Handlers/NavMeshBuildingProgress.cs b/Source/Editor/Progress/Handlers/NavMeshBuildingProgress.cs
index fd706c841..1cb5e4b8b 100644
--- a/Source/Editor/Progress/Handlers/NavMeshBuildingProgress.cs
+++ b/Source/Editor/Progress/Handlers/NavMeshBuildingProgress.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using FlaxEngine;
diff --git a/Source/Editor/Progress/ProgressHandler.cs b/Source/Editor/Progress/ProgressHandler.cs
index eeee2fe4e..da2782d16 100644
--- a/Source/Editor/Progress/ProgressHandler.cs
+++ b/Source/Editor/Progress/ProgressHandler.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using FlaxEngine;
diff --git a/Source/Editor/ProjectInfo.cpp b/Source/Editor/ProjectInfo.cpp
index be2afb095..0d325a823 100644
--- a/Source/Editor/ProjectInfo.cpp
+++ b/Source/Editor/ProjectInfo.cpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#include "ProjectInfo.h"
#include "Engine/Platform/FileSystem.h"
diff --git a/Source/Editor/ProjectInfo.cs b/Source/Editor/ProjectInfo.cs
index 3dc154ee7..07b40c69d 100644
--- a/Source/Editor/ProjectInfo.cs
+++ b/Source/Editor/ProjectInfo.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using System.IO;
diff --git a/Source/Editor/ProjectInfo.h b/Source/Editor/ProjectInfo.h
index b610fa0d2..3e89b60d8 100644
--- a/Source/Editor/ProjectInfo.h
+++ b/Source/Editor/ProjectInfo.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Editor/SceneGraph/ActorChildNode.cs b/Source/Editor/SceneGraph/ActorChildNode.cs
index b38a055bd..0711aa20a 100644
--- a/Source/Editor/SceneGraph/ActorChildNode.cs
+++ b/Source/Editor/SceneGraph/ActorChildNode.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using FlaxEditor.SceneGraph.Actors;
diff --git a/Source/Editor/SceneGraph/ActorNode.cs b/Source/Editor/SceneGraph/ActorNode.cs
index 367174d02..753440378 100644
--- a/Source/Editor/SceneGraph/ActorNode.cs
+++ b/Source/Editor/SceneGraph/ActorNode.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using System.Collections.Generic;
diff --git a/Source/Editor/SceneGraph/ActorNodeWithIcon.cs b/Source/Editor/SceneGraph/ActorNodeWithIcon.cs
index ae51bbd2c..240c733a6 100644
--- a/Source/Editor/SceneGraph/ActorNodeWithIcon.cs
+++ b/Source/Editor/SceneGraph/ActorNodeWithIcon.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using FlaxEngine;
diff --git a/Source/Editor/SceneGraph/Actors/AnimatedModelNode.cs b/Source/Editor/SceneGraph/Actors/AnimatedModelNode.cs
index c266422d4..2fd35ead3 100644
--- a/Source/Editor/SceneGraph/Actors/AnimatedModelNode.cs
+++ b/Source/Editor/SceneGraph/Actors/AnimatedModelNode.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using FlaxEngine;
diff --git a/Source/Editor/SceneGraph/Actors/AudioListenerNode.cs b/Source/Editor/SceneGraph/Actors/AudioListenerNode.cs
index 30697a40d..4b872e90d 100644
--- a/Source/Editor/SceneGraph/Actors/AudioListenerNode.cs
+++ b/Source/Editor/SceneGraph/Actors/AudioListenerNode.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using FlaxEngine;
diff --git a/Source/Editor/SceneGraph/Actors/AudioSourceNode.cs b/Source/Editor/SceneGraph/Actors/AudioSourceNode.cs
index d440d17c3..9da8d7ca6 100644
--- a/Source/Editor/SceneGraph/Actors/AudioSourceNode.cs
+++ b/Source/Editor/SceneGraph/Actors/AudioSourceNode.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using FlaxEngine;
diff --git a/Source/Editor/SceneGraph/Actors/BoneSocketNode.cs b/Source/Editor/SceneGraph/Actors/BoneSocketNode.cs
index c1db4ec68..9ffea07d0 100644
--- a/Source/Editor/SceneGraph/Actors/BoneSocketNode.cs
+++ b/Source/Editor/SceneGraph/Actors/BoneSocketNode.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using FlaxEngine;
diff --git a/Source/Editor/SceneGraph/Actors/BoxBrushNode.cs b/Source/Editor/SceneGraph/Actors/BoxBrushNode.cs
index 75fe50e73..8fb8552fe 100644
--- a/Source/Editor/SceneGraph/Actors/BoxBrushNode.cs
+++ b/Source/Editor/SceneGraph/Actors/BoxBrushNode.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using FlaxEngine;
diff --git a/Source/Editor/SceneGraph/Actors/BoxColliderNode.cs b/Source/Editor/SceneGraph/Actors/BoxColliderNode.cs
index 490bbba84..2631a9677 100644
--- a/Source/Editor/SceneGraph/Actors/BoxColliderNode.cs
+++ b/Source/Editor/SceneGraph/Actors/BoxColliderNode.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using FlaxEngine;
diff --git a/Source/Editor/SceneGraph/Actors/BoxVolumeNode.cs b/Source/Editor/SceneGraph/Actors/BoxVolumeNode.cs
index 9b6bf9aa2..92b252138 100644
--- a/Source/Editor/SceneGraph/Actors/BoxVolumeNode.cs
+++ b/Source/Editor/SceneGraph/Actors/BoxVolumeNode.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using FlaxEngine;
diff --git a/Source/Editor/SceneGraph/Actors/CameraNode.cs b/Source/Editor/SceneGraph/Actors/CameraNode.cs
index 0437a6821..9a0e9fc4b 100644
--- a/Source/Editor/SceneGraph/Actors/CameraNode.cs
+++ b/Source/Editor/SceneGraph/Actors/CameraNode.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using FlaxEngine;
diff --git a/Source/Editor/SceneGraph/Actors/ColliderNode.cs b/Source/Editor/SceneGraph/Actors/ColliderNode.cs
index d01369a9d..3d9618939 100644
--- a/Source/Editor/SceneGraph/Actors/ColliderNode.cs
+++ b/Source/Editor/SceneGraph/Actors/ColliderNode.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using FlaxEngine;
diff --git a/Source/Editor/SceneGraph/Actors/DecalNode.cs b/Source/Editor/SceneGraph/Actors/DecalNode.cs
index 84d8b7e03..08ee2b564 100644
--- a/Source/Editor/SceneGraph/Actors/DecalNode.cs
+++ b/Source/Editor/SceneGraph/Actors/DecalNode.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using FlaxEngine;
diff --git a/Source/Editor/SceneGraph/Actors/DirectionalLightNode.cs b/Source/Editor/SceneGraph/Actors/DirectionalLightNode.cs
index d33885a6c..3c2b1447e 100644
--- a/Source/Editor/SceneGraph/Actors/DirectionalLightNode.cs
+++ b/Source/Editor/SceneGraph/Actors/DirectionalLightNode.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using FlaxEngine;
diff --git a/Source/Editor/SceneGraph/Actors/EnvironmentProbeNode.cs b/Source/Editor/SceneGraph/Actors/EnvironmentProbeNode.cs
index c8453b30c..34488eb5f 100644
--- a/Source/Editor/SceneGraph/Actors/EnvironmentProbeNode.cs
+++ b/Source/Editor/SceneGraph/Actors/EnvironmentProbeNode.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using FlaxEngine;
diff --git a/Source/Editor/SceneGraph/Actors/ExponentialHeightFogNode.cs b/Source/Editor/SceneGraph/Actors/ExponentialHeightFogNode.cs
index 8a8d48342..cb6088ddf 100644
--- a/Source/Editor/SceneGraph/Actors/ExponentialHeightFogNode.cs
+++ b/Source/Editor/SceneGraph/Actors/ExponentialHeightFogNode.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using FlaxEngine;
diff --git a/Source/Editor/SceneGraph/Actors/FoliageNode.cs b/Source/Editor/SceneGraph/Actors/FoliageNode.cs
index 5def91173..4cb9018bd 100644
--- a/Source/Editor/SceneGraph/Actors/FoliageNode.cs
+++ b/Source/Editor/SceneGraph/Actors/FoliageNode.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using FlaxEngine;
diff --git a/Source/Editor/SceneGraph/Actors/NavLinkNode.cs b/Source/Editor/SceneGraph/Actors/NavLinkNode.cs
index 3fe6be2a6..8eb5fbc8b 100644
--- a/Source/Editor/SceneGraph/Actors/NavLinkNode.cs
+++ b/Source/Editor/SceneGraph/Actors/NavLinkNode.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using FlaxEngine;
diff --git a/Source/Editor/SceneGraph/Actors/NavMeshBoundsVolumeNode.cs b/Source/Editor/SceneGraph/Actors/NavMeshBoundsVolumeNode.cs
index be6db2a19..66ed32be4 100644
--- a/Source/Editor/SceneGraph/Actors/NavMeshBoundsVolumeNode.cs
+++ b/Source/Editor/SceneGraph/Actors/NavMeshBoundsVolumeNode.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using FlaxEngine;
diff --git a/Source/Editor/SceneGraph/Actors/ParticleEffectNode.cs b/Source/Editor/SceneGraph/Actors/ParticleEffectNode.cs
index ee181928b..254afb248 100644
--- a/Source/Editor/SceneGraph/Actors/ParticleEffectNode.cs
+++ b/Source/Editor/SceneGraph/Actors/ParticleEffectNode.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using FlaxEngine;
diff --git a/Source/Editor/SceneGraph/Actors/PointLightNode.cs b/Source/Editor/SceneGraph/Actors/PointLightNode.cs
index 04095bcc4..f0689b4d6 100644
--- a/Source/Editor/SceneGraph/Actors/PointLightNode.cs
+++ b/Source/Editor/SceneGraph/Actors/PointLightNode.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using FlaxEngine;
diff --git a/Source/Editor/SceneGraph/Actors/PostFxVolumeNode.cs b/Source/Editor/SceneGraph/Actors/PostFxVolumeNode.cs
index 94f28d0ae..b2a9eb2ca 100644
--- a/Source/Editor/SceneGraph/Actors/PostFxVolumeNode.cs
+++ b/Source/Editor/SceneGraph/Actors/PostFxVolumeNode.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using FlaxEngine;
diff --git a/Source/Editor/SceneGraph/Actors/SceneAnimationPlayerNode.cs b/Source/Editor/SceneGraph/Actors/SceneAnimationPlayerNode.cs
index 73c38fd22..a2ae40611 100644
--- a/Source/Editor/SceneGraph/Actors/SceneAnimationPlayerNode.cs
+++ b/Source/Editor/SceneGraph/Actors/SceneAnimationPlayerNode.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using FlaxEngine;
diff --git a/Source/Editor/SceneGraph/Actors/SceneNode.cs b/Source/Editor/SceneGraph/Actors/SceneNode.cs
index 51cc460f8..359d3d207 100644
--- a/Source/Editor/SceneGraph/Actors/SceneNode.cs
+++ b/Source/Editor/SceneGraph/Actors/SceneNode.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using FlaxEditor.SceneGraph.GUI;
using FlaxEngine;
diff --git a/Source/Editor/SceneGraph/Actors/SkyLightNode.cs b/Source/Editor/SceneGraph/Actors/SkyLightNode.cs
index daea82afa..d64ec83a9 100644
--- a/Source/Editor/SceneGraph/Actors/SkyLightNode.cs
+++ b/Source/Editor/SceneGraph/Actors/SkyLightNode.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using FlaxEngine;
diff --git a/Source/Editor/SceneGraph/Actors/SkyNode.cs b/Source/Editor/SceneGraph/Actors/SkyNode.cs
index f784bcc08..a3a83f7a3 100644
--- a/Source/Editor/SceneGraph/Actors/SkyNode.cs
+++ b/Source/Editor/SceneGraph/Actors/SkyNode.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using FlaxEngine;
diff --git a/Source/Editor/SceneGraph/Actors/SkyboxNode.cs b/Source/Editor/SceneGraph/Actors/SkyboxNode.cs
index c4adc7cc2..48beb277c 100644
--- a/Source/Editor/SceneGraph/Actors/SkyboxNode.cs
+++ b/Source/Editor/SceneGraph/Actors/SkyboxNode.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using FlaxEngine;
diff --git a/Source/Editor/SceneGraph/Actors/SpotLightNode.cs b/Source/Editor/SceneGraph/Actors/SpotLightNode.cs
index b65405213..9148a45cd 100644
--- a/Source/Editor/SceneGraph/Actors/SpotLightNode.cs
+++ b/Source/Editor/SceneGraph/Actors/SpotLightNode.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using FlaxEngine;
diff --git a/Source/Editor/SceneGraph/Actors/StaticModelNode.cs b/Source/Editor/SceneGraph/Actors/StaticModelNode.cs
index a2398d307..845b4fa35 100644
--- a/Source/Editor/SceneGraph/Actors/StaticModelNode.cs
+++ b/Source/Editor/SceneGraph/Actors/StaticModelNode.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using FlaxEngine;
diff --git a/Source/Editor/SceneGraph/Actors/TerrainNode.cs b/Source/Editor/SceneGraph/Actors/TerrainNode.cs
index ab932079a..13fcb846b 100644
--- a/Source/Editor/SceneGraph/Actors/TerrainNode.cs
+++ b/Source/Editor/SceneGraph/Actors/TerrainNode.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using FlaxEngine;
diff --git a/Source/Editor/SceneGraph/Actors/TextRenderNode.cs b/Source/Editor/SceneGraph/Actors/TextRenderNode.cs
index 9ffe17086..32ae0a631 100644
--- a/Source/Editor/SceneGraph/Actors/TextRenderNode.cs
+++ b/Source/Editor/SceneGraph/Actors/TextRenderNode.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using FlaxEngine;
diff --git a/Source/Editor/SceneGraph/Actors/UICanvasNode.cs b/Source/Editor/SceneGraph/Actors/UICanvasNode.cs
index b68345e3f..ff1a7631c 100644
--- a/Source/Editor/SceneGraph/Actors/UICanvasNode.cs
+++ b/Source/Editor/SceneGraph/Actors/UICanvasNode.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using FlaxEngine;
diff --git a/Source/Editor/SceneGraph/Actors/UIControlNode.cs b/Source/Editor/SceneGraph/Actors/UIControlNode.cs
index 035c16365..b3f8f5d09 100644
--- a/Source/Editor/SceneGraph/Actors/UIControlNode.cs
+++ b/Source/Editor/SceneGraph/Actors/UIControlNode.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using FlaxEngine;
diff --git a/Source/Editor/SceneGraph/GUI/ActorTreeNode.cs b/Source/Editor/SceneGraph/GUI/ActorTreeNode.cs
index 4f2a69fcf..e04dd7741 100644
--- a/Source/Editor/SceneGraph/GUI/ActorTreeNode.cs
+++ b/Source/Editor/SceneGraph/GUI/ActorTreeNode.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using System.Collections.Generic;
diff --git a/Source/Editor/SceneGraph/GUI/SceneTreeNode.cs b/Source/Editor/SceneGraph/GUI/SceneTreeNode.cs
index 5ee0f7c17..e520fd45a 100644
--- a/Source/Editor/SceneGraph/GUI/SceneTreeNode.cs
+++ b/Source/Editor/SceneGraph/GUI/SceneTreeNode.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using FlaxEditor.SceneGraph.Actors;
using FlaxEngine;
diff --git a/Source/Editor/SceneGraph/LocalSceneGraph.cs b/Source/Editor/SceneGraph/LocalSceneGraph.cs
index ca4b98bda..660f0a553 100644
--- a/Source/Editor/SceneGraph/LocalSceneGraph.cs
+++ b/Source/Editor/SceneGraph/LocalSceneGraph.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using FlaxEngine;
diff --git a/Source/Editor/SceneGraph/RootNode.cs b/Source/Editor/SceneGraph/RootNode.cs
index cf8949077..fec8f68ad 100644
--- a/Source/Editor/SceneGraph/RootNode.cs
+++ b/Source/Editor/SceneGraph/RootNode.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using FlaxEditor.SceneGraph.Actors;
diff --git a/Source/Editor/SceneGraph/SceneGraphFactory.cs b/Source/Editor/SceneGraph/SceneGraphFactory.cs
index 86caf6939..68cb627f0 100644
--- a/Source/Editor/SceneGraph/SceneGraphFactory.cs
+++ b/Source/Editor/SceneGraph/SceneGraphFactory.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using System.Collections.Generic;
diff --git a/Source/Editor/SceneGraph/SceneGraphNode.cs b/Source/Editor/SceneGraph/SceneGraphNode.cs
index a724bfa5d..755aea139 100644
--- a/Source/Editor/SceneGraph/SceneGraphNode.cs
+++ b/Source/Editor/SceneGraph/SceneGraphNode.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using System.Collections.Generic;
diff --git a/Source/Editor/SceneGraph/SceneGraphTools.cs b/Source/Editor/SceneGraph/SceneGraphTools.cs
index 78edbf099..b20303a14 100644
--- a/Source/Editor/SceneGraph/SceneGraphTools.cs
+++ b/Source/Editor/SceneGraph/SceneGraphTools.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using System.Collections.Generic;
diff --git a/Source/Editor/Scripting/CodeEditor.cpp b/Source/Editor/Scripting/CodeEditor.cpp
index c075192a4..076bf5e0b 100644
--- a/Source/Editor/Scripting/CodeEditor.cpp
+++ b/Source/Editor/Scripting/CodeEditor.cpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#include "CodeEditor.h"
#include "CodeEditors/SystemDefaultCodeEditor.h"
diff --git a/Source/Editor/Scripting/CodeEditor.h b/Source/Editor/Scripting/CodeEditor.h
index 1a89eb13d..4f8923342 100644
--- a/Source/Editor/Scripting/CodeEditor.h
+++ b/Source/Editor/Scripting/CodeEditor.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
@@ -62,6 +62,11 @@ API_ENUM(Namespace="FlaxEditor", Attributes="HideInEditor") enum class CodeEdito
///
VSCode,
+ ///
+ /// Visual Studio Code Insiders
+ ///
+ VSCodeInsiders,
+
MAX
};
diff --git a/Source/Editor/Scripting/CodeEditors/SystemDefaultCodeEditor.cpp b/Source/Editor/Scripting/CodeEditors/SystemDefaultCodeEditor.cpp
index d713d7596..2eb50a233 100644
--- a/Source/Editor/Scripting/CodeEditors/SystemDefaultCodeEditor.cpp
+++ b/Source/Editor/Scripting/CodeEditors/SystemDefaultCodeEditor.cpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#include "SystemDefaultCodeEditor.h"
#include "Engine/Core/Types/StringView.h"
diff --git a/Source/Editor/Scripting/CodeEditors/SystemDefaultCodeEditor.h b/Source/Editor/Scripting/CodeEditors/SystemDefaultCodeEditor.h
index 4912eac2b..b2c1a90fd 100644
--- a/Source/Editor/Scripting/CodeEditors/SystemDefaultCodeEditor.h
+++ b/Source/Editor/Scripting/CodeEditors/SystemDefaultCodeEditor.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Editor/Scripting/CodeEditors/VisualStudio/VisualStudioConnection.cpp b/Source/Editor/Scripting/CodeEditors/VisualStudio/VisualStudioConnection.cpp
index 4ce176c66..d73c5279a 100644
--- a/Source/Editor/Scripting/CodeEditors/VisualStudio/VisualStudioConnection.cpp
+++ b/Source/Editor/Scripting/CodeEditors/VisualStudio/VisualStudioConnection.cpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#if USE_VISUAL_STUDIO_DTE
diff --git a/Source/Editor/Scripting/CodeEditors/VisualStudio/VisualStudioConnection.h b/Source/Editor/Scripting/CodeEditors/VisualStudio/VisualStudioConnection.h
index e5cd60a92..be873b73b 100644
--- a/Source/Editor/Scripting/CodeEditors/VisualStudio/VisualStudioConnection.h
+++ b/Source/Editor/Scripting/CodeEditors/VisualStudio/VisualStudioConnection.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Editor/Scripting/CodeEditors/VisualStudio/VisualStudioEditor.cpp b/Source/Editor/Scripting/CodeEditors/VisualStudio/VisualStudioEditor.cpp
index 01e3d4b24..458d7aaeb 100644
--- a/Source/Editor/Scripting/CodeEditors/VisualStudio/VisualStudioEditor.cpp
+++ b/Source/Editor/Scripting/CodeEditors/VisualStudio/VisualStudioEditor.cpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#if USE_VISUAL_STUDIO_DTE
diff --git a/Source/Editor/Scripting/CodeEditors/VisualStudio/VisualStudioEditor.h b/Source/Editor/Scripting/CodeEditors/VisualStudio/VisualStudioEditor.h
index 5dd1ba199..183c4dffb 100644
--- a/Source/Editor/Scripting/CodeEditors/VisualStudio/VisualStudioEditor.h
+++ b/Source/Editor/Scripting/CodeEditors/VisualStudio/VisualStudioEditor.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Editor/Scripting/CodeEditors/VisualStudioCodeEditor.cpp b/Source/Editor/Scripting/CodeEditors/VisualStudioCodeEditor.cpp
index 27e8e5e48..280f7fced 100644
--- a/Source/Editor/Scripting/CodeEditors/VisualStudioCodeEditor.cpp
+++ b/Source/Editor/Scripting/CodeEditors/VisualStudioCodeEditor.cpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#include "VisualStudioCodeEditor.h"
#include "Engine/Platform/FileSystem.h"
@@ -8,9 +8,10 @@
#include "Engine/Engine/Globals.h"
#include "Engine/Platform/Win32/IncludeWindowsHeaders.h"
-VisualStudioCodeEditor::VisualStudioCodeEditor(const String& execPath)
+VisualStudioCodeEditor::VisualStudioCodeEditor(const String& execPath, const bool isInsiders)
: _execPath(execPath)
, _workspacePath(Globals::ProjectFolder / Editor::Project->Name + TEXT(".code-workspace"))
+ , _isInsiders(isInsiders)
{
}
@@ -18,29 +19,40 @@ void VisualStudioCodeEditor::FindEditors(Array* output)
{
#if PLATFORM_WINDOWS
String cmd;
+ bool isInsiders = false;
if (Platform::ReadRegValue(HKEY_CURRENT_USER, TEXT("SOFTWARE\\Classes\\Applications\\Code.exe\\shell\\open\\command"), TEXT(""), &cmd) || cmd.IsEmpty())
{
if (Platform::ReadRegValue(HKEY_LOCAL_MACHINE, TEXT("SOFTWARE\\Classes\\Applications\\Code.exe\\shell\\open\\command"), TEXT(""), &cmd) || cmd.IsEmpty())
{
- return;
+ if (Platform::ReadRegValue(HKEY_CURRENT_USER, TEXT("SOFTWARE\\Classes\\Applications\\Code - Insiders.exe\\shell\\open\\command"), TEXT(""), &cmd) || cmd.IsEmpty())
+ {
+ if (Platform::ReadRegValue(HKEY_LOCAL_MACHINE, TEXT("SOFTWARE\\Classes\\Applications\\Code - Insiders.exe\\shell\\open\\command"), TEXT(""), &cmd) || cmd.IsEmpty())
+ {
+ return;
+ }
+ else
+ isInsiders = true;
+ }
+ else
+ isInsiders = true;
}
}
const String path = cmd.Substring(1, cmd.Length() - String(TEXT("\" \"%1\"")).Length() - 1);
if (FileSystem::FileExists(path))
{
- output->Add(New(path));
+ output->Add(New(path, isInsiders));
}
#endif
}
CodeEditorTypes VisualStudioCodeEditor::GetType() const
{
- return CodeEditorTypes::VSCode;
+ return _isInsiders ? CodeEditorTypes::VSCodeInsiders : CodeEditorTypes::VSCode;
}
String VisualStudioCodeEditor::GetName() const
{
- return TEXT("Visual Studio Code");
+ return _isInsiders ? TEXT("Visual Studio Code - Insiders") : TEXT("Visual Studio Code");
}
void VisualStudioCodeEditor::OpenFile(const String& path, int32 line)
diff --git a/Source/Editor/Scripting/CodeEditors/VisualStudioCodeEditor.h b/Source/Editor/Scripting/CodeEditors/VisualStudioCodeEditor.h
index 8742cef31..725bb65b8 100644
--- a/Source/Editor/Scripting/CodeEditors/VisualStudioCodeEditor.h
+++ b/Source/Editor/Scripting/CodeEditors/VisualStudioCodeEditor.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
@@ -13,6 +13,7 @@ private:
String _execPath;
String _workspacePath;
+ bool _isInsiders;
public:
@@ -20,7 +21,8 @@ public:
/// Initializes a new instance of the class.
///
/// Executable file path
- VisualStudioCodeEditor(const String& execPath);
+ /// Is insiders edition
+ VisualStudioCodeEditor(const String& execPath, const bool isInsiders);
public:
diff --git a/Source/Editor/Scripting/ScriptType.cs b/Source/Editor/Scripting/ScriptType.cs
index 9c57d6f02..038c1b745 100644
--- a/Source/Editor/Scripting/ScriptType.cs
+++ b/Source/Editor/Scripting/ScriptType.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using System.Collections.Generic;
diff --git a/Source/Editor/Scripting/ScriptsBuilder.cpp b/Source/Editor/Scripting/ScriptsBuilder.cpp
index d9379fcf9..7d581fa8a 100644
--- a/Source/Editor/Scripting/ScriptsBuilder.cpp
+++ b/Source/Editor/Scripting/ScriptsBuilder.cpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#include "ScriptsBuilder.h"
#include "CodeEditor.h"
diff --git a/Source/Editor/Scripting/ScriptsBuilder.cs b/Source/Editor/Scripting/ScriptsBuilder.cs
index 7e60d298a..f53601067 100644
--- a/Source/Editor/Scripting/ScriptsBuilder.cs
+++ b/Source/Editor/Scripting/ScriptsBuilder.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
diff --git a/Source/Editor/Scripting/ScriptsBuilder.h b/Source/Editor/Scripting/ScriptsBuilder.h
index d81c57e82..79a3706a2 100644
--- a/Source/Editor/Scripting/ScriptsBuilder.h
+++ b/Source/Editor/Scripting/ScriptsBuilder.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Editor/Scripting/TypeUtils.cs b/Source/Editor/Scripting/TypeUtils.cs
index e81f0093b..70108f06f 100644
--- a/Source/Editor/Scripting/TypeUtils.cs
+++ b/Source/Editor/Scripting/TypeUtils.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using System.Collections.Generic;
diff --git a/Source/Editor/Scripting/Types.h b/Source/Editor/Scripting/Types.h
index 7a6425cfe..018783095 100644
--- a/Source/Editor/Scripting/Types.h
+++ b/Source/Editor/Scripting/Types.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Editor/States/BuildingLightingState.cs b/Source/Editor/States/BuildingLightingState.cs
index 7c9d806d0..fd69ec02e 100644
--- a/Source/Editor/States/BuildingLightingState.cs
+++ b/Source/Editor/States/BuildingLightingState.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using FlaxEngine;
using FlaxEngine.Assertions;
diff --git a/Source/Editor/States/BuildingScenesState.cs b/Source/Editor/States/BuildingScenesState.cs
index 0e2ea6907..998292626 100644
--- a/Source/Editor/States/BuildingScenesState.cs
+++ b/Source/Editor/States/BuildingScenesState.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using FlaxEditor.SceneGraph.Actors;
diff --git a/Source/Editor/States/ChangingScenesState.cs b/Source/Editor/States/ChangingScenesState.cs
index e279796d8..a7342f432 100644
--- a/Source/Editor/States/ChangingScenesState.cs
+++ b/Source/Editor/States/ChangingScenesState.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using System.Collections.Generic;
diff --git a/Source/Editor/States/ClosingState.cs b/Source/Editor/States/ClosingState.cs
index 3127acd8f..68f3cc5b2 100644
--- a/Source/Editor/States/ClosingState.cs
+++ b/Source/Editor/States/ClosingState.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using FlaxEngine;
using FlaxEngine.Utilities;
diff --git a/Source/Editor/States/EditingSceneState.cs b/Source/Editor/States/EditingSceneState.cs
index 87311ff4a..7aa9ce13d 100644
--- a/Source/Editor/States/EditingSceneState.cs
+++ b/Source/Editor/States/EditingSceneState.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using FlaxEngine;
diff --git a/Source/Editor/States/EditorState.cs b/Source/Editor/States/EditorState.cs
index bc5bd1bcc..04d82a720 100644
--- a/Source/Editor/States/EditorState.cs
+++ b/Source/Editor/States/EditorState.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using FlaxEngine;
using FlaxEngine.Utilities;
diff --git a/Source/Editor/States/EditorStateMachine.cs b/Source/Editor/States/EditorStateMachine.cs
index aa0ceaa90..f4125554e 100644
--- a/Source/Editor/States/EditorStateMachine.cs
+++ b/Source/Editor/States/EditorStateMachine.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System.Collections.Generic;
using FlaxEngine;
diff --git a/Source/Editor/States/InvalidStateException.cs b/Source/Editor/States/InvalidStateException.cs
index 0f4fe5662..72a11bf95 100644
--- a/Source/Editor/States/InvalidStateException.cs
+++ b/Source/Editor/States/InvalidStateException.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using FlaxEngine;
diff --git a/Source/Editor/States/LoadingState.cs b/Source/Editor/States/LoadingState.cs
index 3e4ce51d8..748e97f66 100644
--- a/Source/Editor/States/LoadingState.cs
+++ b/Source/Editor/States/LoadingState.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using FlaxEngine;
diff --git a/Source/Editor/States/PlayingState.cs b/Source/Editor/States/PlayingState.cs
index 599150a57..bcc982235 100644
--- a/Source/Editor/States/PlayingState.cs
+++ b/Source/Editor/States/PlayingState.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using System.Collections.Generic;
@@ -28,6 +28,9 @@ namespace FlaxEditor.States
///
public override bool CanEditScene => true;
+ ///
+ public override bool CanUseUndoRedo => false;
+
///
public override bool CanEnterPlayMode => true;
@@ -116,7 +119,7 @@ namespace FlaxEditor.States
CacheSelection();
// Remove references to the scene objects
- Editor.Scene.ClearRefsToSceneObjects(true);
+ Editor.Scene.ClearRefsToSceneObjects();
// Apply game settings (user may modify them before the gameplay)
GameSettingsApplying?.Invoke();
@@ -132,6 +135,8 @@ namespace FlaxEditor.States
SceneDuplicated?.Invoke();
RestoreSelection();
+ PluginManager.InitializeGamePlugins();
+
Editor.OnPlayBegin();
}
@@ -155,7 +160,7 @@ namespace FlaxEditor.States
IsPaused = true;
// Remove references to the scene objects
- Editor.Scene.ClearRefsToSceneObjects(true);
+ Editor.Scene.ClearRefsToSceneObjects();
// Restore editor scene
SceneRestoring?.Invoke();
@@ -172,6 +177,8 @@ namespace FlaxEditor.States
IsPaused = true;
RestoreSelection();
+ PluginManager.DeinitializeGamePlugins();
+
Editor.OnPlayEnd();
}
}
diff --git a/Source/Editor/States/ReloadingScriptsState.cs b/Source/Editor/States/ReloadingScriptsState.cs
index 85c9e16ce..17f1abdab 100644
--- a/Source/Editor/States/ReloadingScriptsState.cs
+++ b/Source/Editor/States/ReloadingScriptsState.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using FlaxEngine;
diff --git a/Source/Editor/Surface/AnimGraphSurface.cs b/Source/Editor/Surface/AnimGraphSurface.cs
index bd353f52d..8621ed257 100644
--- a/Source/Editor/Surface/AnimGraphSurface.cs
+++ b/Source/Editor/Surface/AnimGraphSurface.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using System.Collections.Generic;
diff --git a/Source/Editor/Surface/AnimationGraphFunctionSurface.cs b/Source/Editor/Surface/AnimationGraphFunctionSurface.cs
index cc3f0c3c3..f3812e60e 100644
--- a/Source/Editor/Surface/AnimationGraphFunctionSurface.cs
+++ b/Source/Editor/Surface/AnimationGraphFunctionSurface.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using FlaxEditor.Surface.Archetypes;
diff --git a/Source/Editor/Surface/Archetypes/Animation.MultiBlend.cs b/Source/Editor/Surface/Archetypes/Animation.MultiBlend.cs
index 5a3ff14bf..36c52f730 100644
--- a/Source/Editor/Surface/Archetypes/Animation.MultiBlend.cs
+++ b/Source/Editor/Surface/Archetypes/Animation.MultiBlend.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using System.Collections.Generic;
diff --git a/Source/Editor/Surface/Archetypes/Animation.StateMachine.cs b/Source/Editor/Surface/Archetypes/Animation.StateMachine.cs
index 9acca8004..9f9e21f4f 100644
--- a/Source/Editor/Surface/Archetypes/Animation.StateMachine.cs
+++ b/Source/Editor/Surface/Archetypes/Animation.StateMachine.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using System.Collections.Generic;
diff --git a/Source/Editor/Surface/Archetypes/Animation.TransitionEditor.cs b/Source/Editor/Surface/Archetypes/Animation.TransitionEditor.cs
index 416ea23e2..4048036aa 100644
--- a/Source/Editor/Surface/Archetypes/Animation.TransitionEditor.cs
+++ b/Source/Editor/Surface/Archetypes/Animation.TransitionEditor.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using FlaxEditor.CustomEditors;
diff --git a/Source/Editor/Surface/Archetypes/Animation.cs b/Source/Editor/Surface/Archetypes/Animation.cs
index 2366230b1..b27fb9bd6 100644
--- a/Source/Editor/Surface/Archetypes/Animation.cs
+++ b/Source/Editor/Surface/Archetypes/Animation.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using System.Collections.Generic;
diff --git a/Source/Editor/Surface/Archetypes/Bitwise.cs b/Source/Editor/Surface/Archetypes/Bitwise.cs
index c7a41c914..503372131 100644
--- a/Source/Editor/Surface/Archetypes/Bitwise.cs
+++ b/Source/Editor/Surface/Archetypes/Bitwise.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using FlaxEngine;
diff --git a/Source/Editor/Surface/Archetypes/Boolean.cs b/Source/Editor/Surface/Archetypes/Boolean.cs
index 1d4c7fc66..80c944c18 100644
--- a/Source/Editor/Surface/Archetypes/Boolean.cs
+++ b/Source/Editor/Surface/Archetypes/Boolean.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using FlaxEngine;
diff --git a/Source/Editor/Surface/Archetypes/Comparisons.cs b/Source/Editor/Surface/Archetypes/Comparisons.cs
index 0744c45ff..d77fd5ff7 100644
--- a/Source/Editor/Surface/Archetypes/Comparisons.cs
+++ b/Source/Editor/Surface/Archetypes/Comparisons.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System.Collections.Generic;
using FlaxEditor.GUI;
diff --git a/Source/Editor/Surface/Archetypes/Constants.cs b/Source/Editor/Surface/Archetypes/Constants.cs
index d0fdb1438..63cec366b 100644
--- a/Source/Editor/Surface/Archetypes/Constants.cs
+++ b/Source/Editor/Surface/Archetypes/Constants.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using FlaxEditor.GUI;
diff --git a/Source/Editor/Surface/Archetypes/Custom.cs b/Source/Editor/Surface/Archetypes/Custom.cs
index 1afbf26fb..28ca0f488 100644
--- a/Source/Editor/Surface/Archetypes/Custom.cs
+++ b/Source/Editor/Surface/Archetypes/Custom.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using FlaxEngine;
diff --git a/Source/Editor/Surface/Archetypes/Flow.cs b/Source/Editor/Surface/Archetypes/Flow.cs
index ab403f293..b8c426a5a 100644
--- a/Source/Editor/Surface/Archetypes/Flow.cs
+++ b/Source/Editor/Surface/Archetypes/Flow.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System.Collections.Generic;
using FlaxEditor.GUI;
diff --git a/Source/Editor/Surface/Archetypes/Function.cs b/Source/Editor/Surface/Archetypes/Function.cs
index 703609bf4..7c4963072 100644
--- a/Source/Editor/Surface/Archetypes/Function.cs
+++ b/Source/Editor/Surface/Archetypes/Function.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using System.IO;
diff --git a/Source/Editor/Surface/Archetypes/Layers.cs b/Source/Editor/Surface/Archetypes/Layers.cs
index e55aa50e6..ef40ec0b4 100644
--- a/Source/Editor/Surface/Archetypes/Layers.cs
+++ b/Source/Editor/Surface/Archetypes/Layers.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using FlaxEngine;
diff --git a/Source/Editor/Surface/Archetypes/Material.cs b/Source/Editor/Surface/Archetypes/Material.cs
index d80dbfe02..a007db7d7 100644
--- a/Source/Editor/Surface/Archetypes/Material.cs
+++ b/Source/Editor/Surface/Archetypes/Material.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using FlaxEditor.Scripting;
diff --git a/Source/Editor/Surface/Archetypes/Math.cs b/Source/Editor/Surface/Archetypes/Math.cs
index bcdef2be6..92ae69a12 100644
--- a/Source/Editor/Surface/Archetypes/Math.cs
+++ b/Source/Editor/Surface/Archetypes/Math.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using FlaxEditor.Scripting;
diff --git a/Source/Editor/Surface/Archetypes/Packing.cs b/Source/Editor/Surface/Archetypes/Packing.cs
index a0a7ebf84..04f3819ea 100644
--- a/Source/Editor/Surface/Archetypes/Packing.cs
+++ b/Source/Editor/Surface/Archetypes/Packing.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using System.IO;
diff --git a/Source/Editor/Surface/Archetypes/Parameters.cs b/Source/Editor/Surface/Archetypes/Parameters.cs
index 00267881e..43048d19d 100644
--- a/Source/Editor/Surface/Archetypes/Parameters.cs
+++ b/Source/Editor/Surface/Archetypes/Parameters.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using System.Collections.Generic;
diff --git a/Source/Editor/Surface/Archetypes/ParticleModules.cs b/Source/Editor/Surface/Archetypes/ParticleModules.cs
index 9491240f6..64adc828d 100644
--- a/Source/Editor/Surface/Archetypes/ParticleModules.cs
+++ b/Source/Editor/Surface/Archetypes/ParticleModules.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using System.Linq;
diff --git a/Source/Editor/Surface/Archetypes/Particles.cs b/Source/Editor/Surface/Archetypes/Particles.cs
index 846cdc5da..4d72bfa7b 100644
--- a/Source/Editor/Surface/Archetypes/Particles.cs
+++ b/Source/Editor/Surface/Archetypes/Particles.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using System.Linq;
diff --git a/Source/Editor/Surface/Archetypes/Textures.cs b/Source/Editor/Surface/Archetypes/Textures.cs
index 33051f260..0e1e8ac72 100644
--- a/Source/Editor/Surface/Archetypes/Textures.cs
+++ b/Source/Editor/Surface/Archetypes/Textures.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using FlaxEngine;
diff --git a/Source/Editor/Surface/Archetypes/Tools.cs b/Source/Editor/Surface/Archetypes/Tools.cs
index 3a988ad9b..2b63bdfb2 100644
--- a/Source/Editor/Surface/Archetypes/Tools.cs
+++ b/Source/Editor/Surface/Archetypes/Tools.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using System.Collections.Generic;
diff --git a/Source/Editor/Surface/AttributesEditor.cs b/Source/Editor/Surface/AttributesEditor.cs
index e33c7874e..e3e765ef1 100644
--- a/Source/Editor/Surface/AttributesEditor.cs
+++ b/Source/Editor/Surface/AttributesEditor.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using System.Collections.Generic;
diff --git a/Source/Editor/Surface/Constants.cs b/Source/Editor/Surface/Constants.cs
index f7cdb1606..3636d193c 100644
--- a/Source/Editor/Surface/Constants.cs
+++ b/Source/Editor/Surface/Constants.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using FlaxEngine;
diff --git a/Source/Editor/Surface/ContextMenu/ContentFinder.cs b/Source/Editor/Surface/ContextMenu/ContentFinder.cs
index 4ac6f4282..76e8d2e33 100644
--- a/Source/Editor/Surface/ContextMenu/ContentFinder.cs
+++ b/Source/Editor/Surface/ContextMenu/ContentFinder.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System.Collections.Generic;
using FlaxEditor.Content;
diff --git a/Source/Editor/Surface/ContextMenu/SearchItem.cs b/Source/Editor/Surface/ContextMenu/SearchItem.cs
index 92c3b34f5..c7810dca2 100644
--- a/Source/Editor/Surface/ContextMenu/SearchItem.cs
+++ b/Source/Editor/Surface/ContextMenu/SearchItem.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using FlaxEditor.Content;
using FlaxEngine;
diff --git a/Source/Editor/Surface/ContextMenu/VisjectCM.cs b/Source/Editor/Surface/ContextMenu/VisjectCM.cs
index c5d254220..f197ce98b 100644
--- a/Source/Editor/Surface/ContextMenu/VisjectCM.cs
+++ b/Source/Editor/Surface/ContextMenu/VisjectCM.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using System.Collections.Generic;
diff --git a/Source/Editor/Surface/ContextMenu/VisjectCMGroup.cs b/Source/Editor/Surface/ContextMenu/VisjectCMGroup.cs
index 0d6a190b6..912ec473c 100644
--- a/Source/Editor/Surface/ContextMenu/VisjectCMGroup.cs
+++ b/Source/Editor/Surface/ContextMenu/VisjectCMGroup.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using FlaxEditor.Surface.Elements;
diff --git a/Source/Editor/Surface/ContextMenu/VisjectCMItem.cs b/Source/Editor/Surface/ContextMenu/VisjectCMItem.cs
index dc678c5d5..015b9213d 100644
--- a/Source/Editor/Surface/ContextMenu/VisjectCMItem.cs
+++ b/Source/Editor/Surface/ContextMenu/VisjectCMItem.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using System.Collections.Generic;
diff --git a/Source/Editor/Surface/Elements/ActorSelect.cs b/Source/Editor/Surface/Elements/ActorSelect.cs
index 62720abfe..a7d729c58 100644
--- a/Source/Editor/Surface/Elements/ActorSelect.cs
+++ b/Source/Editor/Surface/Elements/ActorSelect.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using FlaxEditor.CustomEditors.Editors;
diff --git a/Source/Editor/Surface/Elements/AssetSelect.cs b/Source/Editor/Surface/Elements/AssetSelect.cs
index e75b13520..fcd6501d1 100644
--- a/Source/Editor/Surface/Elements/AssetSelect.cs
+++ b/Source/Editor/Surface/Elements/AssetSelect.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using FlaxEditor.GUI;
diff --git a/Source/Editor/Surface/Elements/BoolValue.cs b/Source/Editor/Surface/Elements/BoolValue.cs
index a01aa78d6..8fa6dc7e0 100644
--- a/Source/Editor/Surface/Elements/BoolValue.cs
+++ b/Source/Editor/Surface/Elements/BoolValue.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using FlaxEngine;
using FlaxEngine.GUI;
diff --git a/Source/Editor/Surface/Elements/Box.cs b/Source/Editor/Surface/Elements/Box.cs
index e11f143d6..886ab1e37 100644
--- a/Source/Editor/Surface/Elements/Box.cs
+++ b/Source/Editor/Surface/Elements/Box.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using System.Collections.Generic;
diff --git a/Source/Editor/Surface/Elements/BoxValue.cs b/Source/Editor/Surface/Elements/BoxValue.cs
index 82b7f60f3..461f797dd 100644
--- a/Source/Editor/Surface/Elements/BoxValue.cs
+++ b/Source/Editor/Surface/Elements/BoxValue.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using FlaxEditor.GUI.Input;
using FlaxEngine;
diff --git a/Source/Editor/Surface/Elements/ColorValue.cs b/Source/Editor/Surface/Elements/ColorValue.cs
index 19486919b..bee792904 100644
--- a/Source/Editor/Surface/Elements/ColorValue.cs
+++ b/Source/Editor/Surface/Elements/ColorValue.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using FlaxEditor.GUI.Input;
using FlaxEngine;
diff --git a/Source/Editor/Surface/Elements/ComboBoxElement.cs b/Source/Editor/Surface/Elements/ComboBoxElement.cs
index 81ab3b34f..20693e51b 100644
--- a/Source/Editor/Surface/Elements/ComboBoxElement.cs
+++ b/Source/Editor/Surface/Elements/ComboBoxElement.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using FlaxEditor.GUI;
using FlaxEngine;
diff --git a/Source/Editor/Surface/Elements/EnumValue.cs b/Source/Editor/Surface/Elements/EnumValue.cs
index 504bbcfd3..9513abd78 100644
--- a/Source/Editor/Surface/Elements/EnumValue.cs
+++ b/Source/Editor/Surface/Elements/EnumValue.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using FlaxEditor.GUI;
diff --git a/Source/Editor/Surface/Elements/FloatValue.cs b/Source/Editor/Surface/Elements/FloatValue.cs
index 5f9ea7b85..54c5d7bf6 100644
--- a/Source/Editor/Surface/Elements/FloatValue.cs
+++ b/Source/Editor/Surface/Elements/FloatValue.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using FlaxEditor.GUI.Input;
using FlaxEngine;
diff --git a/Source/Editor/Surface/Elements/InputBox.cs b/Source/Editor/Surface/Elements/InputBox.cs
index 434cf7a5c..ea6e9e34a 100644
--- a/Source/Editor/Surface/Elements/InputBox.cs
+++ b/Source/Editor/Surface/Elements/InputBox.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using System.Collections.Generic;
@@ -105,13 +105,13 @@ namespace FlaxEditor.Surface.Elements
{
public bool CanUse(InputBox box, ref ScriptType type)
{
- return type.Type == typeof(int) || type.Type == typeof(uint);
+ return type.Type == typeof(int);
}
public Control Create(InputBox box, ref Rectangle bounds)
{
var value = IntegerValue.Get(box.ParentNode, box.Archetype);
- var control = new IntValueBox(value, bounds.X, bounds.Y, 40, box.CurrentType.Type == typeof(uint) ? 0 : int.MinValue, int.MaxValue, 0.01f)
+ var control = new IntValueBox(value, bounds.X, bounds.Y, 40, int.MinValue, int.MaxValue, 0.01f)
{
Height = bounds.Height,
Parent = box.Parent,
@@ -145,6 +145,50 @@ namespace FlaxEditor.Surface.Elements
}
}
+ class UnsignedIntegerDefaultValueEditor : IDefaultValueEditor
+ {
+ public bool CanUse(InputBox box, ref ScriptType type)
+ {
+ return type.Type == typeof(uint);
+ }
+
+ public Control Create(InputBox box, ref Rectangle bounds)
+ {
+ var value = UnsignedIntegerValue.Get(box.ParentNode, box.Archetype);
+ var control = new UIntValueBox(value, bounds.X, bounds.Y, 40, uint.MinValue, uint.MaxValue, 0.01f)
+ {
+ Height = bounds.Height,
+ Parent = box.Parent,
+ Tag = box,
+ };
+ control.BoxValueChanged += OnValueBoxChanged;
+ return control;
+ }
+
+ public bool IsValid(InputBox box, Control control)
+ {
+ return control is UIntValueBox;
+ }
+
+ public void UpdateDefaultValue(InputBox box, Control control)
+ {
+ if (control is UIntValueBox intValue)
+ {
+ intValue.Value = UnsignedIntegerValue.Get(box.ParentNode, box.Archetype);
+ }
+ }
+
+ public void UpdateAttributes(InputBox box, object[] attributes, Control control)
+ {
+ }
+
+ private void OnValueBoxChanged(ValueBox control)
+ {
+ var box = (InputBox)control.Tag;
+ UnsignedIntegerValue.Set(box.ParentNode, box.Archetype, control.Value);
+ }
+ }
+
class FloatingDefaultValueEditor : IDefaultValueEditor
{
public bool CanUse(InputBox box, ref ScriptType type)
@@ -817,6 +861,7 @@ namespace FlaxEditor.Surface.Elements
{
new BooleanDefaultValueEditor(),
new IntegerDefaultValueEditor(),
+ new UnsignedIntegerDefaultValueEditor(),
new FloatingDefaultValueEditor(),
new StringDefaultValueEditor(),
new Vector2DefaultValueEditor(),
diff --git a/Source/Editor/Surface/Elements/IntegerValue.cs b/Source/Editor/Surface/Elements/IntegerValue.cs
index 7672db418..f04578b75 100644
--- a/Source/Editor/Surface/Elements/IntegerValue.cs
+++ b/Source/Editor/Surface/Elements/IntegerValue.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using FlaxEditor.GUI.Input;
using FlaxEngine;
diff --git a/Source/Editor/Surface/Elements/OutputBox.cs b/Source/Editor/Surface/Elements/OutputBox.cs
index 53f6d49e1..0c3ba8da4 100644
--- a/Source/Editor/Surface/Elements/OutputBox.cs
+++ b/Source/Editor/Surface/Elements/OutputBox.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using FlaxEngine;
using FlaxEngine.GUI;
diff --git a/Source/Editor/Surface/Elements/SkeletonBoneIndexSelectElement.cs b/Source/Editor/Surface/Elements/SkeletonBoneIndexSelectElement.cs
index 65f7d1280..4ae82c94f 100644
--- a/Source/Editor/Surface/Elements/SkeletonBoneIndexSelectElement.cs
+++ b/Source/Editor/Surface/Elements/SkeletonBoneIndexSelectElement.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using System.Text;
diff --git a/Source/Editor/Surface/Elements/SkeletonNodeNameSelectElement.cs b/Source/Editor/Surface/Elements/SkeletonNodeNameSelectElement.cs
index cf1f50bb4..0d8d676c7 100644
--- a/Source/Editor/Surface/Elements/SkeletonNodeNameSelectElement.cs
+++ b/Source/Editor/Surface/Elements/SkeletonNodeNameSelectElement.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using System.Collections.Generic;
diff --git a/Source/Editor/Surface/Elements/TextBoxView.cs b/Source/Editor/Surface/Elements/TextBoxView.cs
index 1e1847708..345adb5a2 100644
--- a/Source/Editor/Surface/Elements/TextBoxView.cs
+++ b/Source/Editor/Surface/Elements/TextBoxView.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using FlaxEngine;
using FlaxEngine.GUI;
diff --git a/Source/Editor/Surface/Elements/TextView.cs b/Source/Editor/Surface/Elements/TextView.cs
index 3f03c6542..07d35b949 100644
--- a/Source/Editor/Surface/Elements/TextView.cs
+++ b/Source/Editor/Surface/Elements/TextView.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using FlaxEngine;
using FlaxEngine.GUI;
diff --git a/Source/Editor/Surface/Elements/UnsignedIntegerValue.cs b/Source/Editor/Surface/Elements/UnsignedIntegerValue.cs
new file mode 100644
index 000000000..9668105f1
--- /dev/null
+++ b/Source/Editor/Surface/Elements/UnsignedIntegerValue.cs
@@ -0,0 +1,153 @@
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
+
+using FlaxEditor.GUI.Input;
+using FlaxEngine;
+using FlaxEngine.GUI;
+
+namespace FlaxEditor.Surface.Elements
+{
+ ///
+ /// Unsigned Integer value editing element.
+ ///
+ ///
+ ///
+ [HideInEditor]
+ public sealed class UnsignedIntegerValue : UIntValueBox, ISurfaceNodeElement
+ {
+ ///
+ public SurfaceNode ParentNode { get; }
+
+ ///
+ public NodeElementArchetype Archetype { get; }
+
+ ///
+ public UnsignedIntegerValue(SurfaceNode parentNode, NodeElementArchetype archetype)
+ : base(Get(parentNode, archetype), archetype.Position.X, archetype.Position.Y, 50, (uint)archetype.ValueMin, (uint)archetype.ValueMax, 0.05f)
+ {
+ ParentNode = parentNode;
+ Archetype = archetype;
+
+ ParentNode.ValuesChanged += OnNodeValuesChanged;
+ }
+
+ private void OnNodeValuesChanged()
+ {
+ Value = Get(ParentNode, Archetype);
+ }
+
+ ///
+ public override void Draw()
+ {
+ base.Draw();
+
+ // Draw border
+ if (!IsFocused)
+ Render2D.DrawRectangle(new Rectangle(Vector2.Zero, Size), Style.Current.BorderNormal);
+ }
+
+ ///
+ protected override void OnValueChanged()
+ {
+ base.OnValueChanged();
+ Set(ParentNode, Archetype, Value);
+ }
+
+ ///
+ /// Gets the unsigned integer value from the specified parent node. Handles type casting and components gather.
+ ///
+ /// The parent node.
+ /// The node element archetype.
+ /// The result value.
+ public static uint Get(SurfaceNode parentNode, NodeElementArchetype arch)
+ {
+ if (arch.ValueIndex < 0)
+ return 0;
+
+ uint result;
+ var value = parentNode.Values[arch.ValueIndex];
+
+ // Note: this value box may edit on component of the vector like Vector3.Y, BoxID from Archetype tells which component pick
+
+ if (value is int valueInt)
+ result = (uint)valueInt;
+ else if (value is uint valueUint)
+ result = valueUint;
+ else if (value is long valueLong)
+ result = (uint)valueLong;
+ else if (value is ulong valueUlong)
+ result = (uint)valueUlong;
+ else if (value is float valueFloat)
+ result = (uint)valueFloat;
+ else if (value is Vector2 valueVec2)
+ result = (uint)(arch.BoxID == 0 ? valueVec2.X : valueVec2.Y);
+ else if (value is Vector3 valueVec3)
+ result = (uint)(arch.BoxID == 0 ? valueVec3.X : arch.BoxID == 1 ? valueVec3.Y : valueVec3.Z);
+ else if (value is Vector4 valueVec4)
+ result = (uint)(arch.BoxID == 0 ? valueVec4.X : arch.BoxID == 1 ? valueVec4.Y : arch.BoxID == 2 ? valueVec4.Z : valueVec4.W);
+ else
+ result = 0;
+
+ return result;
+ }
+
+ ///
+ /// Sets the unsigned integer value of the specified parent node. Handles type casting and components assignment.
+ ///
+ /// The parent node.
+ /// The node element archetype.
+ /// The value to set.
+ public static void Set(SurfaceNode parentNode, NodeElementArchetype arch, uint toSet)
+ {
+ if (arch.ValueIndex < 0)
+ return;
+
+ var value = parentNode.Values[arch.ValueIndex];
+ float toSetF = (float)toSet;
+
+ if (value is int)
+ value = (int)toSet;
+ else if (value is uint)
+ value = toSet;
+ else if (value is long)
+ value = (long)toSet;
+ else if (value is ulong)
+ value = (ulong)toSet;
+ else if (value is float)
+ value = toSetF;
+ else if (value is Vector2 valueVec2)
+ {
+ if (arch.BoxID == 0)
+ valueVec2.X = toSetF;
+ else
+ valueVec2.Y = toSetF;
+ value = valueVec2;
+ }
+ else if (value is Vector3 valueVec3)
+ {
+ if (arch.BoxID == 0)
+ valueVec3.X = toSetF;
+ else if (arch.BoxID == 1)
+ valueVec3.Y = toSetF;
+ else
+ valueVec3.Z = toSetF;
+ value = valueVec3;
+ }
+ else if (value is Vector4 valueVec4)
+ {
+ if (arch.BoxID == 0)
+ valueVec4.X = toSetF;
+ else if (arch.BoxID == 1)
+ valueVec4.Y = toSetF;
+ else if (arch.BoxID == 2)
+ valueVec4.Z = toSetF;
+ else
+ valueVec4.W = toSetF;
+ value = valueVec4;
+ }
+ else
+ value = 0;
+
+ parentNode.SetValue(arch.ValueIndex, value);
+ }
+ }
+}
diff --git a/Source/Editor/Surface/GUI/VisjectContextNavigationButton.cs b/Source/Editor/Surface/GUI/VisjectContextNavigationButton.cs
index 767c566a8..183c36ada 100644
--- a/Source/Editor/Surface/GUI/VisjectContextNavigationButton.cs
+++ b/Source/Editor/Surface/GUI/VisjectContextNavigationButton.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using FlaxEditor.GUI;
using FlaxEngine;
diff --git a/Source/Editor/Surface/GroupArchetype.cs b/Source/Editor/Surface/GroupArchetype.cs
index d9285186e..4177f9358 100644
--- a/Source/Editor/Surface/GroupArchetype.cs
+++ b/Source/Editor/Surface/GroupArchetype.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System.Collections.Generic;
using FlaxEngine;
diff --git a/Source/Editor/Surface/IParametersDependantNode.cs b/Source/Editor/Surface/IParametersDependantNode.cs
index 4714dbbcf..3c857062a 100644
--- a/Source/Editor/Surface/IParametersDependantNode.cs
+++ b/Source/Editor/Surface/IParametersDependantNode.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using FlaxEngine;
diff --git a/Source/Editor/Surface/ISurfaceContext.cs b/Source/Editor/Surface/ISurfaceContext.cs
index d5c954ae4..f9004f0c7 100644
--- a/Source/Editor/Surface/ISurfaceContext.cs
+++ b/Source/Editor/Surface/ISurfaceContext.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using FlaxEngine;
diff --git a/Source/Editor/Surface/ISurfaceNodeElement.cs b/Source/Editor/Surface/ISurfaceNodeElement.cs
index aa8adef0f..dba9b7aca 100644
--- a/Source/Editor/Surface/ISurfaceNodeElement.cs
+++ b/Source/Editor/Surface/ISurfaceNodeElement.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using FlaxEngine;
diff --git a/Source/Editor/Surface/IVisjectSurfaceOwner.cs b/Source/Editor/Surface/IVisjectSurfaceOwner.cs
index b2fe8918f..b6e90df19 100644
--- a/Source/Editor/Surface/IVisjectSurfaceOwner.cs
+++ b/Source/Editor/Surface/IVisjectSurfaceOwner.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using FlaxEngine;
diff --git a/Source/Editor/Surface/MaterialFunctionSurface.cs b/Source/Editor/Surface/MaterialFunctionSurface.cs
index d9a52cf9d..71f607310 100644
--- a/Source/Editor/Surface/MaterialFunctionSurface.cs
+++ b/Source/Editor/Surface/MaterialFunctionSurface.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using FlaxEditor.Surface.Archetypes;
diff --git a/Source/Editor/Surface/MaterialSurface.cs b/Source/Editor/Surface/MaterialSurface.cs
index 737388caf..f583ad1a3 100644
--- a/Source/Editor/Surface/MaterialSurface.cs
+++ b/Source/Editor/Surface/MaterialSurface.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using System.Collections.Generic;
diff --git a/Source/Editor/Surface/NodeArchetype.cs b/Source/Editor/Surface/NodeArchetype.cs
index 6cfec6a93..b2a859cc5 100644
--- a/Source/Editor/Surface/NodeArchetype.cs
+++ b/Source/Editor/Surface/NodeArchetype.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using FlaxEditor.Scripting;
diff --git a/Source/Editor/Surface/NodeElementArchetype.cs b/Source/Editor/Surface/NodeElementArchetype.cs
index 20c4df67d..07ea35875 100644
--- a/Source/Editor/Surface/NodeElementArchetype.cs
+++ b/Source/Editor/Surface/NodeElementArchetype.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using System.Collections.Generic;
diff --git a/Source/Editor/Surface/NodeElementType.cs b/Source/Editor/Surface/NodeElementType.cs
index 84ce31d7f..48b2356dd 100644
--- a/Source/Editor/Surface/NodeElementType.cs
+++ b/Source/Editor/Surface/NodeElementType.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using FlaxEngine;
diff --git a/Source/Editor/Surface/NodeFactory.cs b/Source/Editor/Surface/NodeFactory.cs
index 29b6c0e71..52441ca01 100644
--- a/Source/Editor/Surface/NodeFactory.cs
+++ b/Source/Editor/Surface/NodeFactory.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using System.Collections.Generic;
diff --git a/Source/Editor/Surface/NodeFlags.cs b/Source/Editor/Surface/NodeFlags.cs
index b03dd1a4f..74ed90fd4 100644
--- a/Source/Editor/Surface/NodeFlags.cs
+++ b/Source/Editor/Surface/NodeFlags.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using FlaxEngine;
diff --git a/Source/Editor/Surface/ParticleEmitterFunctionSurface.cs b/Source/Editor/Surface/ParticleEmitterFunctionSurface.cs
index c5995392b..12dbe2025 100644
--- a/Source/Editor/Surface/ParticleEmitterFunctionSurface.cs
+++ b/Source/Editor/Surface/ParticleEmitterFunctionSurface.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using FlaxEditor.Surface.Archetypes;
diff --git a/Source/Editor/Surface/ParticleEmitterSurface.cs b/Source/Editor/Surface/ParticleEmitterSurface.cs
index 1e28d2c48..4368569a1 100644
--- a/Source/Editor/Surface/ParticleEmitterSurface.cs
+++ b/Source/Editor/Surface/ParticleEmitterSurface.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using System.Collections.Generic;
diff --git a/Source/Editor/Surface/SurfaceComment.cs b/Source/Editor/Surface/SurfaceComment.cs
index 078ce793e..2ab7f836b 100644
--- a/Source/Editor/Surface/SurfaceComment.cs
+++ b/Source/Editor/Surface/SurfaceComment.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using FlaxEditor.GUI;
diff --git a/Source/Editor/Surface/SurfaceControl.cs b/Source/Editor/Surface/SurfaceControl.cs
index 262ab423b..7ba8efdbc 100644
--- a/Source/Editor/Surface/SurfaceControl.cs
+++ b/Source/Editor/Surface/SurfaceControl.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using FlaxEngine;
using FlaxEngine.GUI;
diff --git a/Source/Editor/Surface/SurfaceMeta.cs b/Source/Editor/Surface/SurfaceMeta.cs
index 47edd2e46..4cd8405e4 100644
--- a/Source/Editor/Surface/SurfaceMeta.cs
+++ b/Source/Editor/Surface/SurfaceMeta.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using System.Collections.Generic;
diff --git a/Source/Editor/Surface/SurfaceNode.cs b/Source/Editor/Surface/SurfaceNode.cs
index 82b667e57..cf39384ce 100644
--- a/Source/Editor/Surface/SurfaceNode.cs
+++ b/Source/Editor/Surface/SurfaceNode.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using System.Collections.Generic;
diff --git a/Source/Editor/Surface/SurfaceNodeElementControl.cs b/Source/Editor/Surface/SurfaceNodeElementControl.cs
index 6a32cf85a..678357b08 100644
--- a/Source/Editor/Surface/SurfaceNodeElementControl.cs
+++ b/Source/Editor/Surface/SurfaceNodeElementControl.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using FlaxEngine;
using FlaxEngine.GUI;
diff --git a/Source/Editor/Surface/SurfaceParameter.cs b/Source/Editor/Surface/SurfaceParameter.cs
index 803ad3906..675843fb4 100644
--- a/Source/Editor/Surface/SurfaceParameter.cs
+++ b/Source/Editor/Surface/SurfaceParameter.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using FlaxEditor.Scripting;
diff --git a/Source/Editor/Surface/SurfaceRootControl.cs b/Source/Editor/Surface/SurfaceRootControl.cs
index b9e353a4c..e068f0a29 100644
--- a/Source/Editor/Surface/SurfaceRootControl.cs
+++ b/Source/Editor/Surface/SurfaceRootControl.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using FlaxEngine;
using FlaxEngine.GUI;
diff --git a/Source/Editor/Surface/SurfaceStyle.cs b/Source/Editor/Surface/SurfaceStyle.cs
index e23e01898..18de19118 100644
--- a/Source/Editor/Surface/SurfaceStyle.cs
+++ b/Source/Editor/Surface/SurfaceStyle.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using FlaxEditor.Scripting;
diff --git a/Source/Editor/Surface/SurfaceUtils.cs b/Source/Editor/Surface/SurfaceUtils.cs
index c92dbf97c..18f2e9693 100644
--- a/Source/Editor/Surface/SurfaceUtils.cs
+++ b/Source/Editor/Surface/SurfaceUtils.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using System.Collections.Generic;
diff --git a/Source/Editor/Surface/TransformCoordinateSystem.cs b/Source/Editor/Surface/TransformCoordinateSystem.cs
index 6e9aac239..a8ce3c5be 100644
--- a/Source/Editor/Surface/TransformCoordinateSystem.cs
+++ b/Source/Editor/Surface/TransformCoordinateSystem.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using FlaxEngine;
diff --git a/Source/Editor/Surface/Undo/AddRemoveNodeAction.cs b/Source/Editor/Surface/Undo/AddRemoveNodeAction.cs
index d808b3297..9d01ae59b 100644
--- a/Source/Editor/Surface/Undo/AddRemoveNodeAction.cs
+++ b/Source/Editor/Surface/Undo/AddRemoveNodeAction.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using FlaxEngine;
diff --git a/Source/Editor/Surface/Undo/BoxHandle.cs b/Source/Editor/Surface/Undo/BoxHandle.cs
index d9a6a13d1..f50adcfeb 100644
--- a/Source/Editor/Surface/Undo/BoxHandle.cs
+++ b/Source/Editor/Surface/Undo/BoxHandle.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using FlaxEditor.Surface.Elements;
diff --git a/Source/Editor/Surface/Undo/ConnectBoxesAction.cs b/Source/Editor/Surface/Undo/ConnectBoxesAction.cs
index 315854fa3..6627364ed 100644
--- a/Source/Editor/Surface/Undo/ConnectBoxesAction.cs
+++ b/Source/Editor/Surface/Undo/ConnectBoxesAction.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System.Collections.Generic;
using FlaxEditor.Surface.Elements;
diff --git a/Source/Editor/Surface/Undo/ContextHandle.cs b/Source/Editor/Surface/Undo/ContextHandle.cs
index 9b889389e..682040de5 100644
--- a/Source/Editor/Surface/Undo/ContextHandle.cs
+++ b/Source/Editor/Surface/Undo/ContextHandle.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using FlaxEngine;
diff --git a/Source/Editor/Surface/Undo/EditNodeConnections.cs b/Source/Editor/Surface/Undo/EditNodeConnections.cs
index 28f3adb6f..43b0b8c67 100644
--- a/Source/Editor/Surface/Undo/EditNodeConnections.cs
+++ b/Source/Editor/Surface/Undo/EditNodeConnections.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using System.Collections.Generic;
diff --git a/Source/Editor/Surface/Undo/EditNodeValuesAction.cs b/Source/Editor/Surface/Undo/EditNodeValuesAction.cs
index 96fb9f969..c279273ff 100644
--- a/Source/Editor/Surface/Undo/EditNodeValuesAction.cs
+++ b/Source/Editor/Surface/Undo/EditNodeValuesAction.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
diff --git a/Source/Editor/Surface/Undo/MoveNodesAction.cs b/Source/Editor/Surface/Undo/MoveNodesAction.cs
index 9b3adff66..b37146c0a 100644
--- a/Source/Editor/Surface/Undo/MoveNodesAction.cs
+++ b/Source/Editor/Surface/Undo/MoveNodesAction.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using FlaxEngine;
diff --git a/Source/Editor/Surface/VisjectSurface.Connecting.cs b/Source/Editor/Surface/VisjectSurface.Connecting.cs
index 308bef537..33d589ad0 100644
--- a/Source/Editor/Surface/VisjectSurface.Connecting.cs
+++ b/Source/Editor/Surface/VisjectSurface.Connecting.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using FlaxEditor.Scripting;
using FlaxEngine;
diff --git a/Source/Editor/Surface/VisjectSurface.Context.cs b/Source/Editor/Surface/VisjectSurface.Context.cs
index 6a5d6ff4b..c44234e8a 100644
--- a/Source/Editor/Surface/VisjectSurface.Context.cs
+++ b/Source/Editor/Surface/VisjectSurface.Context.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using System.Collections.Generic;
diff --git a/Source/Editor/Surface/VisjectSurface.ContextMenu.cs b/Source/Editor/Surface/VisjectSurface.ContextMenu.cs
index 2e5cf7d79..6b38ffdfc 100644
--- a/Source/Editor/Surface/VisjectSurface.ContextMenu.cs
+++ b/Source/Editor/Surface/VisjectSurface.ContextMenu.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System.Collections.Generic;
using System.Linq;
diff --git a/Source/Editor/Surface/VisjectSurface.CopyPaste.cs b/Source/Editor/Surface/VisjectSurface.CopyPaste.cs
index 3374fc3c3..0d991191a 100644
--- a/Source/Editor/Surface/VisjectSurface.CopyPaste.cs
+++ b/Source/Editor/Surface/VisjectSurface.CopyPaste.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using System.Collections.Generic;
diff --git a/Source/Editor/Surface/VisjectSurface.DragDrop.cs b/Source/Editor/Surface/VisjectSurface.DragDrop.cs
index d814cb4eb..323ef8510 100644
--- a/Source/Editor/Surface/VisjectSurface.DragDrop.cs
+++ b/Source/Editor/Surface/VisjectSurface.DragDrop.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System.Collections.Generic;
using System.IO;
diff --git a/Source/Editor/Surface/VisjectSurface.Draw.cs b/Source/Editor/Surface/VisjectSurface.Draw.cs
index 5f11116f3..488324a0a 100644
--- a/Source/Editor/Surface/VisjectSurface.Draw.cs
+++ b/Source/Editor/Surface/VisjectSurface.Draw.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using FlaxEngine;
diff --git a/Source/Editor/Surface/VisjectSurface.Input.cs b/Source/Editor/Surface/VisjectSurface.Input.cs
index 38b1bc393..68966370c 100644
--- a/Source/Editor/Surface/VisjectSurface.Input.cs
+++ b/Source/Editor/Surface/VisjectSurface.Input.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System.Collections.Generic;
using System.Linq;
diff --git a/Source/Editor/Surface/VisjectSurface.Paramaters.cs b/Source/Editor/Surface/VisjectSurface.Paramaters.cs
index af76e42ee..32714f31a 100644
--- a/Source/Editor/Surface/VisjectSurface.Paramaters.cs
+++ b/Source/Editor/Surface/VisjectSurface.Paramaters.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using System.Collections.Generic;
diff --git a/Source/Editor/Surface/VisjectSurface.Serialization.cs b/Source/Editor/Surface/VisjectSurface.Serialization.cs
index 1bbbdcca1..3208f19ab 100644
--- a/Source/Editor/Surface/VisjectSurface.Serialization.cs
+++ b/Source/Editor/Surface/VisjectSurface.Serialization.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System.Runtime.InteropServices;
using FlaxEngine;
diff --git a/Source/Editor/Surface/VisjectSurface.cs b/Source/Editor/Surface/VisjectSurface.cs
index f05aa855c..d98e2c421 100644
--- a/Source/Editor/Surface/VisjectSurface.cs
+++ b/Source/Editor/Surface/VisjectSurface.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using System.Collections.Generic;
diff --git a/Source/Editor/Surface/VisjectSurfaceContext.Serialization.cs b/Source/Editor/Surface/VisjectSurfaceContext.Serialization.cs
index 2b8040acb..556d4a6dc 100644
--- a/Source/Editor/Surface/VisjectSurfaceContext.Serialization.cs
+++ b/Source/Editor/Surface/VisjectSurfaceContext.Serialization.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using System.Collections.Generic;
diff --git a/Source/Editor/Surface/VisjectSurfaceContext.cs b/Source/Editor/Surface/VisjectSurfaceContext.cs
index 88d7fc235..d436cd91e 100644
--- a/Source/Editor/Surface/VisjectSurfaceContext.cs
+++ b/Source/Editor/Surface/VisjectSurfaceContext.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using System.Collections.Generic;
diff --git a/Source/Editor/Surface/VisjectSurfaceWindow.cs b/Source/Editor/Surface/VisjectSurfaceWindow.cs
index 259a04462..38415565a 100644
--- a/Source/Editor/Surface/VisjectSurfaceWindow.cs
+++ b/Source/Editor/Surface/VisjectSurfaceWindow.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using System.Collections.Generic;
@@ -332,7 +332,10 @@ namespace FlaxEditor.Surface
///
public class ParametersEditor : CustomEditor
{
- private static readonly Attribute[] DefaultAttributes = { new LimitAttribute(float.MinValue, float.MaxValue, 0.1f) };
+ private static readonly Attribute[] DefaultAttributes =
+ {
+ //new LimitAttribute(float.MinValue, float.MaxValue, 0.1f),
+ };
///
public override DisplayStyle Style => DisplayStyle.InlineIntoParent;
diff --git a/Source/Editor/Surface/VisualScriptSurface.cs b/Source/Editor/Surface/VisualScriptSurface.cs
index cb7010d3a..ccabc8f2f 100644
--- a/Source/Editor/Surface/VisualScriptSurface.cs
+++ b/Source/Editor/Surface/VisualScriptSurface.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
//#define DEBUG_INVOKE_METHODS_SEARCHING
//#define DEBUG_FIELDS_SEARCHING
diff --git a/Source/Editor/Tools/Foliage/Brush.cs b/Source/Editor/Tools/Foliage/Brush.cs
index 64f84f490..da71f0d43 100644
--- a/Source/Editor/Tools/Foliage/Brush.cs
+++ b/Source/Editor/Tools/Foliage/Brush.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using FlaxEngine;
diff --git a/Source/Editor/Tools/Foliage/EditFoliageGizmo.cs b/Source/Editor/Tools/Foliage/EditFoliageGizmo.cs
index a637b1203..3e3730769 100644
--- a/Source/Editor/Tools/Foliage/EditFoliageGizmo.cs
+++ b/Source/Editor/Tools/Foliage/EditFoliageGizmo.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using FlaxEditor.Gizmo;
diff --git a/Source/Editor/Tools/Foliage/EditFoliageGizmoMode.cs b/Source/Editor/Tools/Foliage/EditFoliageGizmoMode.cs
index b7aec0ca3..0b9df7835 100644
--- a/Source/Editor/Tools/Foliage/EditFoliageGizmoMode.cs
+++ b/Source/Editor/Tools/Foliage/EditFoliageGizmoMode.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using FlaxEditor.SceneGraph.Actors;
diff --git a/Source/Editor/Tools/Foliage/EditFoliageSelectionOutline.cs b/Source/Editor/Tools/Foliage/EditFoliageSelectionOutline.cs
index 5f9749cd4..b79a4847a 100644
--- a/Source/Editor/Tools/Foliage/EditFoliageSelectionOutline.cs
+++ b/Source/Editor/Tools/Foliage/EditFoliageSelectionOutline.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using FlaxEditor.Gizmo;
using FlaxEngine;
diff --git a/Source/Editor/Tools/Foliage/EditTab.cs b/Source/Editor/Tools/Foliage/EditTab.cs
index e9fc9f797..9cc867d5b 100644
--- a/Source/Editor/Tools/Foliage/EditTab.cs
+++ b/Source/Editor/Tools/Foliage/EditTab.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using FlaxEditor.CustomEditors;
diff --git a/Source/Editor/Tools/Foliage/FoliageTab.cs b/Source/Editor/Tools/Foliage/FoliageTab.cs
index eee320656..9dbb17e88 100644
--- a/Source/Editor/Tools/Foliage/FoliageTab.cs
+++ b/Source/Editor/Tools/Foliage/FoliageTab.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using System.Collections.Generic;
diff --git a/Source/Editor/Tools/Foliage/FoliageTools.cpp b/Source/Editor/Tools/Foliage/FoliageTools.cpp
index 8602f9802..a0cbf8e14 100644
--- a/Source/Editor/Tools/Foliage/FoliageTools.cpp
+++ b/Source/Editor/Tools/Foliage/FoliageTools.cpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#include "FoliageTools.h"
#include "Engine/Core/Math/BoundingSphere.h"
@@ -36,17 +36,13 @@ struct GeometryTriangle
void GetRandomPoint(Vector3& result) const
{
- // Sample parallelogram
float x = Random::Rand();
float y = Random::Rand();
-
- // Flip if we're outside the triangle
if (x + y > 1.0f)
{
x = 1.0f - x;
y = 1.0f - y;
}
-
result = Vertex + x * Vector1 + y * Vector2;
}
};
@@ -234,15 +230,13 @@ void FoliageTools::Paint(Foliage* foliage, Span foliageTypesIndices, cons
continue;
}
- // This is the total set of instances disregarding parameters like slope, height or layer
- const float desiredInstanceCountFloat = triangle.Area * foliageType.PaintDensity * densityScale / (1000.0f * 1000.0f);
+ // Calculate amount of foliage instances to place
+ const float targetInstanceCountEst = triangle.Area * foliageType.PaintDensity * densityScale / (1000.0f * 1000.0f);
+ const int32 targetInstanceCount = targetInstanceCountEst > 1.0f ? Math::RoundToInt(targetInstanceCountEst) : Random::Rand() < targetInstanceCountEst ? 1 : 0;
- // Allow a single instance with a random chance, if the brush is smaller than the density
- const int32 desiredInstanceCount = desiredInstanceCountFloat > 1.0f ? Math::RoundToInt(desiredInstanceCountFloat) : Random::Rand() < desiredInstanceCountFloat ? 1 : 0;
-
- // Try to new instances
+ // Try to add new instances
FoliagePlacement placement;
- for (int32 j = 0; j < desiredInstanceCount; j++)
+ for (int32 j = 0; j < targetInstanceCount; j++)
{
triangle.GetRandomPoint(placement.Location);
diff --git a/Source/Editor/Tools/Foliage/FoliageTools.h b/Source/Editor/Tools/Foliage/FoliageTools.h
index 1e6001f8d..75e9b2447 100644
--- a/Source/Editor/Tools/Foliage/FoliageTools.h
+++ b/Source/Editor/Tools/Foliage/FoliageTools.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Editor/Tools/Foliage/FoliageTypesTab.cs b/Source/Editor/Tools/Foliage/FoliageTypesTab.cs
index 4bc185fb4..9c05afab8 100644
--- a/Source/Editor/Tools/Foliage/FoliageTypesTab.cs
+++ b/Source/Editor/Tools/Foliage/FoliageTypesTab.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using System.ComponentModel;
diff --git a/Source/Editor/Tools/Foliage/PaintFoliageGizmo.cs b/Source/Editor/Tools/Foliage/PaintFoliageGizmo.cs
index fe0046fb4..b24f503aa 100644
--- a/Source/Editor/Tools/Foliage/PaintFoliageGizmo.cs
+++ b/Source/Editor/Tools/Foliage/PaintFoliageGizmo.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using System.Collections.Generic;
diff --git a/Source/Editor/Tools/Foliage/PaintFoliageGizmoMode.cs b/Source/Editor/Tools/Foliage/PaintFoliageGizmoMode.cs
index 50630fd74..65cbf8750 100644
--- a/Source/Editor/Tools/Foliage/PaintFoliageGizmoMode.cs
+++ b/Source/Editor/Tools/Foliage/PaintFoliageGizmoMode.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using FlaxEditor.SceneGraph.Actors;
using FlaxEditor.Viewport;
diff --git a/Source/Editor/Tools/Foliage/PaintTab.cs b/Source/Editor/Tools/Foliage/PaintTab.cs
index 1ab114cfe..b6dc6094b 100644
--- a/Source/Editor/Tools/Foliage/PaintTab.cs
+++ b/Source/Editor/Tools/Foliage/PaintTab.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using FlaxEditor.CustomEditors;
using FlaxEditor.CustomEditors.Editors;
diff --git a/Source/Editor/Tools/Foliage/Undo/DeleteInstanceAction.cs b/Source/Editor/Tools/Foliage/Undo/DeleteInstanceAction.cs
index 5697ef3b6..da378a955 100644
--- a/Source/Editor/Tools/Foliage/Undo/DeleteInstanceAction.cs
+++ b/Source/Editor/Tools/Foliage/Undo/DeleteInstanceAction.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using FlaxEngine;
diff --git a/Source/Editor/Tools/Foliage/Undo/EditFoliageAction.cs b/Source/Editor/Tools/Foliage/Undo/EditFoliageAction.cs
index 1774b859e..7cd5c40e2 100644
--- a/Source/Editor/Tools/Foliage/Undo/EditFoliageAction.cs
+++ b/Source/Editor/Tools/Foliage/Undo/EditFoliageAction.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using FlaxEngine;
diff --git a/Source/Editor/Tools/Foliage/Undo/EditInstanceAction.cs b/Source/Editor/Tools/Foliage/Undo/EditInstanceAction.cs
index ee8a4da74..709824614 100644
--- a/Source/Editor/Tools/Foliage/Undo/EditInstanceAction.cs
+++ b/Source/Editor/Tools/Foliage/Undo/EditInstanceAction.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using FlaxEngine;
diff --git a/Source/Editor/Tools/Foliage/Undo/EditSelectedInstanceIndexAction.cs b/Source/Editor/Tools/Foliage/Undo/EditSelectedInstanceIndexAction.cs
index 29a9940b3..1e87ec493 100644
--- a/Source/Editor/Tools/Foliage/Undo/EditSelectedInstanceIndexAction.cs
+++ b/Source/Editor/Tools/Foliage/Undo/EditSelectedInstanceIndexAction.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using FlaxEngine;
diff --git a/Source/Editor/Tools/Terrain/Brushes/Brush.cs b/Source/Editor/Tools/Terrain/Brushes/Brush.cs
index 0027eb8f5..720d9a17b 100644
--- a/Source/Editor/Tools/Terrain/Brushes/Brush.cs
+++ b/Source/Editor/Tools/Terrain/Brushes/Brush.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using FlaxEngine;
diff --git a/Source/Editor/Tools/Terrain/Brushes/CircleBrush.cs b/Source/Editor/Tools/Terrain/Brushes/CircleBrush.cs
index b1cd9bbc4..046ea9e93 100644
--- a/Source/Editor/Tools/Terrain/Brushes/CircleBrush.cs
+++ b/Source/Editor/Tools/Terrain/Brushes/CircleBrush.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using FlaxEngine;
diff --git a/Source/Editor/Tools/Terrain/CarveTab.cs b/Source/Editor/Tools/Terrain/CarveTab.cs
index a2cd5b5f0..a3a65c52a 100644
--- a/Source/Editor/Tools/Terrain/CarveTab.cs
+++ b/Source/Editor/Tools/Terrain/CarveTab.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using FlaxEditor.GUI.Tabs;
diff --git a/Source/Editor/Tools/Terrain/CreateTerrainDialog.cs b/Source/Editor/Tools/Terrain/CreateTerrainDialog.cs
index 89c2bede5..1834c20d3 100644
--- a/Source/Editor/Tools/Terrain/CreateTerrainDialog.cs
+++ b/Source/Editor/Tools/Terrain/CreateTerrainDialog.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using System.ComponentModel;
diff --git a/Source/Editor/Tools/Terrain/EditTab.cs b/Source/Editor/Tools/Terrain/EditTab.cs
index adf8c741f..e7b281f13 100644
--- a/Source/Editor/Tools/Terrain/EditTab.cs
+++ b/Source/Editor/Tools/Terrain/EditTab.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using FlaxEditor.GUI;
diff --git a/Source/Editor/Tools/Terrain/EditTerrainGizmo.cs b/Source/Editor/Tools/Terrain/EditTerrainGizmo.cs
index 2f55c21bc..314a6cfb8 100644
--- a/Source/Editor/Tools/Terrain/EditTerrainGizmo.cs
+++ b/Source/Editor/Tools/Terrain/EditTerrainGizmo.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using FlaxEditor.Gizmo;
diff --git a/Source/Editor/Tools/Terrain/EditTerrainGizmoMode.cs b/Source/Editor/Tools/Terrain/EditTerrainGizmoMode.cs
index 721eb2365..a80dfa524 100644
--- a/Source/Editor/Tools/Terrain/EditTerrainGizmoMode.cs
+++ b/Source/Editor/Tools/Terrain/EditTerrainGizmoMode.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using FlaxEditor.Viewport;
diff --git a/Source/Editor/Tools/Terrain/Paint/Mode.cs b/Source/Editor/Tools/Terrain/Paint/Mode.cs
index 80289d1ac..1a1373d05 100644
--- a/Source/Editor/Tools/Terrain/Paint/Mode.cs
+++ b/Source/Editor/Tools/Terrain/Paint/Mode.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using FlaxEditor.Tools.Terrain.Brushes;
using FlaxEngine;
diff --git a/Source/Editor/Tools/Terrain/Paint/SingleLayerMode.cs b/Source/Editor/Tools/Terrain/Paint/SingleLayerMode.cs
index f7589e286..ca4423cbe 100644
--- a/Source/Editor/Tools/Terrain/Paint/SingleLayerMode.cs
+++ b/Source/Editor/Tools/Terrain/Paint/SingleLayerMode.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using FlaxEngine;
diff --git a/Source/Editor/Tools/Terrain/PaintTab.cs b/Source/Editor/Tools/Terrain/PaintTab.cs
index 62cde2add..188c659df 100644
--- a/Source/Editor/Tools/Terrain/PaintTab.cs
+++ b/Source/Editor/Tools/Terrain/PaintTab.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using FlaxEditor.CustomEditors;
using FlaxEditor.GUI.Tabs;
diff --git a/Source/Editor/Tools/Terrain/PaintTerrainGizmo.cs b/Source/Editor/Tools/Terrain/PaintTerrainGizmo.cs
index 62bbfff8e..51372f290 100644
--- a/Source/Editor/Tools/Terrain/PaintTerrainGizmo.cs
+++ b/Source/Editor/Tools/Terrain/PaintTerrainGizmo.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using FlaxEditor.Gizmo;
diff --git a/Source/Editor/Tools/Terrain/PaintTerrainGizmoMode.cs b/Source/Editor/Tools/Terrain/PaintTerrainGizmoMode.cs
index 5b20f416c..f41c5303d 100644
--- a/Source/Editor/Tools/Terrain/PaintTerrainGizmoMode.cs
+++ b/Source/Editor/Tools/Terrain/PaintTerrainGizmoMode.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using System.Collections.Generic;
diff --git a/Source/Editor/Tools/Terrain/Sculpt/FlattenMode.cs b/Source/Editor/Tools/Terrain/Sculpt/FlattenMode.cs
index f22ca1060..008bdf5b9 100644
--- a/Source/Editor/Tools/Terrain/Sculpt/FlattenMode.cs
+++ b/Source/Editor/Tools/Terrain/Sculpt/FlattenMode.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using FlaxEngine;
diff --git a/Source/Editor/Tools/Terrain/Sculpt/HolesMode.cs b/Source/Editor/Tools/Terrain/Sculpt/HolesMode.cs
index a1f93a48e..1247f07da 100644
--- a/Source/Editor/Tools/Terrain/Sculpt/HolesMode.cs
+++ b/Source/Editor/Tools/Terrain/Sculpt/HolesMode.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using FlaxEngine;
diff --git a/Source/Editor/Tools/Terrain/Sculpt/Mode.cs b/Source/Editor/Tools/Terrain/Sculpt/Mode.cs
index e26631db4..14fbe0175 100644
--- a/Source/Editor/Tools/Terrain/Sculpt/Mode.cs
+++ b/Source/Editor/Tools/Terrain/Sculpt/Mode.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using FlaxEditor.Tools.Terrain.Brushes;
using FlaxEngine;
diff --git a/Source/Editor/Tools/Terrain/Sculpt/NoiseMode.cs b/Source/Editor/Tools/Terrain/Sculpt/NoiseMode.cs
index b3ad28946..a13b427c3 100644
--- a/Source/Editor/Tools/Terrain/Sculpt/NoiseMode.cs
+++ b/Source/Editor/Tools/Terrain/Sculpt/NoiseMode.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using FlaxEngine;
using FlaxEngine.Utilities;
diff --git a/Source/Editor/Tools/Terrain/Sculpt/SculptMode.cs b/Source/Editor/Tools/Terrain/Sculpt/SculptMode.cs
index dc77196c4..64b7c341f 100644
--- a/Source/Editor/Tools/Terrain/Sculpt/SculptMode.cs
+++ b/Source/Editor/Tools/Terrain/Sculpt/SculptMode.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using FlaxEngine;
diff --git a/Source/Editor/Tools/Terrain/Sculpt/SmoothMode.cs b/Source/Editor/Tools/Terrain/Sculpt/SmoothMode.cs
index c95331869..e92b71d5e 100644
--- a/Source/Editor/Tools/Terrain/Sculpt/SmoothMode.cs
+++ b/Source/Editor/Tools/Terrain/Sculpt/SmoothMode.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using FlaxEngine;
diff --git a/Source/Editor/Tools/Terrain/SculptTab.cs b/Source/Editor/Tools/Terrain/SculptTab.cs
index fbb1ac00d..3e26ad0ed 100644
--- a/Source/Editor/Tools/Terrain/SculptTab.cs
+++ b/Source/Editor/Tools/Terrain/SculptTab.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using FlaxEditor.CustomEditors;
using FlaxEditor.GUI.Tabs;
diff --git a/Source/Editor/Tools/Terrain/SculptTerrainGizmo.cs b/Source/Editor/Tools/Terrain/SculptTerrainGizmo.cs
index c46855bfa..88cd83d46 100644
--- a/Source/Editor/Tools/Terrain/SculptTerrainGizmo.cs
+++ b/Source/Editor/Tools/Terrain/SculptTerrainGizmo.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using FlaxEditor.Gizmo;
diff --git a/Source/Editor/Tools/Terrain/SculptTerrainGizmoMode.cs b/Source/Editor/Tools/Terrain/SculptTerrainGizmoMode.cs
index 25110f933..82ba9c905 100644
--- a/Source/Editor/Tools/Terrain/SculptTerrainGizmoMode.cs
+++ b/Source/Editor/Tools/Terrain/SculptTerrainGizmoMode.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using System.Collections.Generic;
diff --git a/Source/Editor/Tools/Terrain/TerrainTools.cpp b/Source/Editor/Tools/Terrain/TerrainTools.cpp
index 1ced1ffb9..6bf4f8fd4 100644
--- a/Source/Editor/Tools/Terrain/TerrainTools.cpp
+++ b/Source/Editor/Tools/Terrain/TerrainTools.cpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#include "TerrainTools.h"
#include "Engine/Core/Cache.h"
diff --git a/Source/Editor/Tools/Terrain/TerrainTools.h b/Source/Editor/Tools/Terrain/TerrainTools.h
index afe9cd19a..543913eeb 100644
--- a/Source/Editor/Tools/Terrain/TerrainTools.h
+++ b/Source/Editor/Tools/Terrain/TerrainTools.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Editor/Tools/Terrain/Undo/EditTerrainHeightMapAction.cs b/Source/Editor/Tools/Terrain/Undo/EditTerrainHeightMapAction.cs
index 3846e462e..859be244b 100644
--- a/Source/Editor/Tools/Terrain/Undo/EditTerrainHeightMapAction.cs
+++ b/Source/Editor/Tools/Terrain/Undo/EditTerrainHeightMapAction.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using FlaxEngine;
diff --git a/Source/Editor/Tools/Terrain/Undo/EditTerrainHolesMapAction.cs b/Source/Editor/Tools/Terrain/Undo/EditTerrainHolesMapAction.cs
index 8bc8e4fb5..de1144f6e 100644
--- a/Source/Editor/Tools/Terrain/Undo/EditTerrainHolesMapAction.cs
+++ b/Source/Editor/Tools/Terrain/Undo/EditTerrainHolesMapAction.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using FlaxEngine;
diff --git a/Source/Editor/Tools/Terrain/Undo/EditTerrainMapAction.cs b/Source/Editor/Tools/Terrain/Undo/EditTerrainMapAction.cs
index cae55bea2..f9a48d659 100644
--- a/Source/Editor/Tools/Terrain/Undo/EditTerrainMapAction.cs
+++ b/Source/Editor/Tools/Terrain/Undo/EditTerrainMapAction.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using System.Collections.Generic;
diff --git a/Source/Editor/Tools/Terrain/Undo/EditTerrainSplatMapAction.cs b/Source/Editor/Tools/Terrain/Undo/EditTerrainSplatMapAction.cs
index 91f945775..b9940c043 100644
--- a/Source/Editor/Tools/Terrain/Undo/EditTerrainSplatMapAction.cs
+++ b/Source/Editor/Tools/Terrain/Undo/EditTerrainSplatMapAction.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using FlaxEngine;
diff --git a/Source/Editor/Tools/VertexPainting.cs b/Source/Editor/Tools/VertexPainting.cs
index 7e64fb99d..c130370e7 100644
--- a/Source/Editor/Tools/VertexPainting.cs
+++ b/Source/Editor/Tools/VertexPainting.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using System.Threading;
diff --git a/Source/Editor/Undo/Actions/AddRemoveScriptAction.cs b/Source/Editor/Undo/Actions/AddRemoveScriptAction.cs
index 482e55b3a..12d6a201c 100644
--- a/Source/Editor/Undo/Actions/AddRemoveScriptAction.cs
+++ b/Source/Editor/Undo/Actions/AddRemoveScriptAction.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using FlaxEditor.Scripting;
diff --git a/Source/Editor/Undo/Actions/BreakPrefabLinkAction.cs b/Source/Editor/Undo/Actions/BreakPrefabLinkAction.cs
index 14d4d47cf..b9aed3c61 100644
--- a/Source/Editor/Undo/Actions/BreakPrefabLinkAction.cs
+++ b/Source/Editor/Undo/Actions/BreakPrefabLinkAction.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using System.Collections.Generic;
diff --git a/Source/Editor/Undo/Actions/ChangeScriptAction.cs b/Source/Editor/Undo/Actions/ChangeScriptAction.cs
index 68947e2e9..294fb23d2 100644
--- a/Source/Editor/Undo/Actions/ChangeScriptAction.cs
+++ b/Source/Editor/Undo/Actions/ChangeScriptAction.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using FlaxEditor.Modules;
diff --git a/Source/Editor/Undo/Actions/DeleteActorsAction.cs b/Source/Editor/Undo/Actions/DeleteActorsAction.cs
index ae85783d0..fa319e6f3 100644
--- a/Source/Editor/Undo/Actions/DeleteActorsAction.cs
+++ b/Source/Editor/Undo/Actions/DeleteActorsAction.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using System.Collections.Generic;
diff --git a/Source/Editor/Undo/Actions/PasteActorsAction.cs b/Source/Editor/Undo/Actions/PasteActorsAction.cs
index 3ceef65a5..c65aa6bf0 100644
--- a/Source/Editor/Undo/Actions/PasteActorsAction.cs
+++ b/Source/Editor/Undo/Actions/PasteActorsAction.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using System.Collections.Generic;
diff --git a/Source/Editor/Undo/Actions/SelectionChangeAction.cs b/Source/Editor/Undo/Actions/SelectionChangeAction.cs
index 2618fa4de..37a8a4d29 100644
--- a/Source/Editor/Undo/Actions/SelectionChangeAction.cs
+++ b/Source/Editor/Undo/Actions/SelectionChangeAction.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using FlaxEditor.SceneGraph;
diff --git a/Source/Editor/Undo/Actions/TransformObjectsAction.cs b/Source/Editor/Undo/Actions/TransformObjectsAction.cs
index 70d7e07ab..1bfe3cc4f 100644
--- a/Source/Editor/Undo/Actions/TransformObjectsAction.cs
+++ b/Source/Editor/Undo/Actions/TransformObjectsAction.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using System.Collections.Generic;
diff --git a/Source/Editor/Undo/EditorUndo.cs b/Source/Editor/Undo/EditorUndo.cs
index 5643ab75c..24341f347 100644
--- a/Source/Editor/Undo/EditorUndo.cs
+++ b/Source/Editor/Undo/EditorUndo.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using FlaxEditor.History;
diff --git a/Source/Editor/Undo/ISceneEditAction.cs b/Source/Editor/Undo/ISceneEditAction.cs
index 6763af5fe..a83776839 100644
--- a/Source/Editor/Undo/ISceneEditAction.cs
+++ b/Source/Editor/Undo/ISceneEditAction.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using FlaxEditor.Modules;
diff --git a/Source/Editor/Undo/IUndoAction.cs b/Source/Editor/Undo/IUndoAction.cs
index de69d8651..833253dea 100644
--- a/Source/Editor/Undo/IUndoAction.cs
+++ b/Source/Editor/Undo/IUndoAction.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using FlaxEditor.History;
diff --git a/Source/Editor/Undo/MultiUndoAction.cs b/Source/Editor/Undo/MultiUndoAction.cs
index 8ed7fe323..53a3ccb4e 100644
--- a/Source/Editor/Undo/MultiUndoAction.cs
+++ b/Source/Editor/Undo/MultiUndoAction.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using System.Collections.Generic;
diff --git a/Source/Editor/Undo/Undo.cs b/Source/Editor/Undo/Undo.cs
index 2f0a84fae..709e21a32 100644
--- a/Source/Editor/Undo/Undo.cs
+++ b/Source/Editor/Undo/Undo.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using System.Collections.Generic;
diff --git a/Source/Editor/Undo/UndoActionBase.cs b/Source/Editor/Undo/UndoActionBase.cs
index ca82e0c22..5de052a45 100644
--- a/Source/Editor/Undo/UndoActionBase.cs
+++ b/Source/Editor/Undo/UndoActionBase.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using FlaxEditor.SceneGraph;
diff --git a/Source/Editor/Undo/UndoBlock.cs b/Source/Editor/Undo/UndoBlock.cs
index be9697e87..3e6ed3e2c 100644
--- a/Source/Editor/Undo/UndoBlock.cs
+++ b/Source/Editor/Undo/UndoBlock.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using FlaxEngine;
diff --git a/Source/Editor/Undo/UndoMultiBlock.cs b/Source/Editor/Undo/UndoMultiBlock.cs
index 3e4b8ff13..2424bfcf0 100644
--- a/Source/Editor/Undo/UndoMultiBlock.cs
+++ b/Source/Editor/Undo/UndoMultiBlock.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using System.Collections.Generic;
diff --git a/Source/Editor/Utilities/Constants.cs b/Source/Editor/Utilities/Constants.cs
index aef76936d..128aa0875 100644
--- a/Source/Editor/Utilities/Constants.cs
+++ b/Source/Editor/Utilities/Constants.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
namespace FlaxEditor.Utilities
{
@@ -7,12 +7,12 @@ namespace FlaxEditor.Utilities
///
internal class Constants
{
- public static readonly string DiscordUrl = "https://flaxengine.com/discord";
- public static readonly string DocsUrl = "https://docs.flaxengine.com/";
- public static readonly string BugTrackerUrl = "https://github.com/FlaxEngine/FlaxEngine/issues";
- public static readonly string WebsiteUrl = "https://flaxengine.com";
- public static readonly string FacebookUrl = "https://facebook.com/FlaxEngine";
- public static readonly string YoutubeUrl = "https://www.youtube.com/channel/UChdER2A3n19rJWIMOZJClhw";
- public static readonly string TwitterUrl = "https://twitter.com/FlaxEngine";
+ public const string DiscordUrl = "https://flaxengine.com/discord";
+ public const string DocsUrl = "https://docs.flaxengine.com/";
+ public const string BugTrackerUrl = "https://github.com/FlaxEngine/FlaxEngine/issues";
+ public const string WebsiteUrl = "https://flaxengine.com";
+ public const string FacebookUrl = "https://facebook.com/FlaxEngine";
+ public const string YoutubeUrl = "https://youtube.com/c/FlaxEngine";
+ public const string TwitterUrl = "https://twitter.com/FlaxEngine";
}
}
diff --git a/Source/Editor/Utilities/DuplicateScenes.cs b/Source/Editor/Utilities/DuplicateScenes.cs
index 3300706d3..bff0b6714 100644
--- a/Source/Editor/Utilities/DuplicateScenes.cs
+++ b/Source/Editor/Utilities/DuplicateScenes.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using System.Collections.Generic;
diff --git a/Source/Editor/Utilities/EditorUtilities.cpp b/Source/Editor/Utilities/EditorUtilities.cpp
index 86769eb45..d0ad412d9 100644
--- a/Source/Editor/Utilities/EditorUtilities.cpp
+++ b/Source/Editor/Utilities/EditorUtilities.cpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#include "EditorUtilities.h"
#include "Engine/Platform/File.h"
diff --git a/Source/Editor/Utilities/EditorUtilities.h b/Source/Editor/Utilities/EditorUtilities.h
index 4f35a2cc9..236d10e6f 100644
--- a/Source/Editor/Utilities/EditorUtilities.h
+++ b/Source/Editor/Utilities/EditorUtilities.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Editor/Utilities/Extensions.cs b/Source/Editor/Utilities/Extensions.cs
index 89391463d..3e4cb0f33 100644
--- a/Source/Editor/Utilities/Extensions.cs
+++ b/Source/Editor/Utilities/Extensions.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using System.Collections.Generic;
diff --git a/Source/Editor/Utilities/MemberComparison.cs b/Source/Editor/Utilities/MemberComparison.cs
index 2627eefb0..eed089d1d 100644
--- a/Source/Editor/Utilities/MemberComparison.cs
+++ b/Source/Editor/Utilities/MemberComparison.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using FlaxEditor.Scripting;
diff --git a/Source/Editor/Utilities/MemberInfoPath.cs b/Source/Editor/Utilities/MemberInfoPath.cs
index 0b33d78b4..ef2c6394a 100644
--- a/Source/Editor/Utilities/MemberInfoPath.cs
+++ b/Source/Editor/Utilities/MemberInfoPath.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using System.Collections.Generic;
diff --git a/Source/Editor/Utilities/ObjectSnapshot.cs b/Source/Editor/Utilities/ObjectSnapshot.cs
index aefaacf0a..a64ddf306 100644
--- a/Source/Editor/Utilities/ObjectSnapshot.cs
+++ b/Source/Editor/Utilities/ObjectSnapshot.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
//#define DEBUG_OBJECT_SNAPSHOT_COMPARISION
diff --git a/Source/Editor/Utilities/QueryFilterHelper.cs b/Source/Editor/Utilities/QueryFilterHelper.cs
index afc2eb745..fe539652e 100644
--- a/Source/Editor/Utilities/QueryFilterHelper.cs
+++ b/Source/Editor/Utilities/QueryFilterHelper.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using System.Collections.Generic;
diff --git a/Source/Editor/Utilities/SelectionCache.cs b/Source/Editor/Utilities/SelectionCache.cs
index 0c2daae96..766e1fd47 100644
--- a/Source/Editor/Utilities/SelectionCache.cs
+++ b/Source/Editor/Utilities/SelectionCache.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using System.Collections.Generic;
diff --git a/Source/Editor/Utilities/ShuntingYardParser.cs b/Source/Editor/Utilities/ShuntingYardParser.cs
index 5d0bbc4e8..dfd83b1f8 100644
--- a/Source/Editor/Utilities/ShuntingYardParser.cs
+++ b/Source/Editor/Utilities/ShuntingYardParser.cs
@@ -1,10 +1,11 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Text;
+using FlaxEngine;
namespace FlaxEditor.Utilities
{
@@ -172,24 +173,49 @@ namespace FlaxEditor.Utilities
// Necessary to correctly parse negative numbers
var previous = TokenType.WhiteSpace;
+ var token = new StringBuilder();
for (int i = 0; i < text.Length; i++)
{
- var token = new StringBuilder();
var type = DetermineType(text[i]);
-
if (type == TokenType.WhiteSpace)
continue;
+ token.Clear();
token.Append(text[i]);
// Handle fractions and negative numbers (dot . is considered a figure)
if (type == TokenType.Number || text[i] == '-' && previous != TokenType.Number)
{
- // Continue till the end of the number
- while (i + 1 < text.Length && DetermineType(text[i + 1]) == TokenType.Number)
+ // Parse the whole number till the end
+ if (i + 1 < text.Length)
{
- i++;
- token.Append(text[i]);
+ switch (text[i + 1])
+ {
+ case 'x':
+ case 'X':
+ // Hexadecimal value
+ i++;
+ token.Clear();
+ if (i + 1 == text.Length || !StringUtils.IsHexDigit(text[i + 1]))
+ throw new ParsingException("invalid hexadecimal number");
+ while (i + 1 < text.Length && StringUtils.IsHexDigit(text[i + 1]))
+ {
+ i++;
+ token.Append(text[i]);
+ }
+ var value = ulong.Parse(token.ToString(), NumberStyles.HexNumber);
+ token.Clear();
+ token.Append(value.ToString());
+ break;
+ default:
+ // Decimal value
+ while (i + 1 < text.Length && DetermineType(text[i + 1]) == TokenType.Number)
+ {
+ i++;
+ token.Append(text[i]);
+ }
+ break;
+ }
}
// Discard solo '-'
diff --git a/Source/Editor/Utilities/Utils.cs b/Source/Editor/Utilities/Utils.cs
index b0c67a4e0..5f1636239 100644
--- a/Source/Editor/Utilities/Utils.cs
+++ b/Source/Editor/Utilities/Utils.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using System.Collections.Generic;
diff --git a/Source/Editor/Utilities/ViewportIconsRenderer.cpp b/Source/Editor/Utilities/ViewportIconsRenderer.cpp
index b3dee570c..631e8b56f 100644
--- a/Source/Editor/Utilities/ViewportIconsRenderer.cpp
+++ b/Source/Editor/Utilities/ViewportIconsRenderer.cpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#include "ViewportIconsRenderer.h"
#include "Engine/Content/Assets/Model.h"
diff --git a/Source/Editor/Utilities/ViewportIconsRenderer.h b/Source/Editor/Utilities/ViewportIconsRenderer.h
index fe6156489..8aacbe76b 100644
--- a/Source/Editor/Utilities/ViewportIconsRenderer.h
+++ b/Source/Editor/Utilities/ViewportIconsRenderer.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Editor/Viewport/Cameras/ArcBallCamera.cs b/Source/Editor/Viewport/Cameras/ArcBallCamera.cs
index 806b88d9a..9e0fd4859 100644
--- a/Source/Editor/Viewport/Cameras/ArcBallCamera.cs
+++ b/Source/Editor/Viewport/Cameras/ArcBallCamera.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using FlaxEngine;
diff --git a/Source/Editor/Viewport/Cameras/FPSCamera.cs b/Source/Editor/Viewport/Cameras/FPSCamera.cs
index 5058bbc19..c9e65d6e4 100644
--- a/Source/Editor/Viewport/Cameras/FPSCamera.cs
+++ b/Source/Editor/Viewport/Cameras/FPSCamera.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System.Collections.Generic;
using FlaxEditor.Gizmo;
diff --git a/Source/Editor/Viewport/Cameras/IViewportCamera.cs b/Source/Editor/Viewport/Cameras/IViewportCamera.cs
index 8fd5eb6ba..3d5f14a4b 100644
--- a/Source/Editor/Viewport/Cameras/IViewportCamera.cs
+++ b/Source/Editor/Viewport/Cameras/IViewportCamera.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using FlaxEngine;
diff --git a/Source/Editor/Viewport/Cameras/ViewportCamera.cs b/Source/Editor/Viewport/Cameras/ViewportCamera.cs
index ec688683b..a01000035 100644
--- a/Source/Editor/Viewport/Cameras/ViewportCamera.cs
+++ b/Source/Editor/Viewport/Cameras/ViewportCamera.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using FlaxEngine;
diff --git a/Source/Editor/Viewport/EditorGizmoViewport.cs b/Source/Editor/Viewport/EditorGizmoViewport.cs
index d00ab58f7..ae2db1e9b 100644
--- a/Source/Editor/Viewport/EditorGizmoViewport.cs
+++ b/Source/Editor/Viewport/EditorGizmoViewport.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using FlaxEditor.Gizmo;
using FlaxEditor.Viewport.Cameras;
diff --git a/Source/Editor/Viewport/EditorViewport.cs b/Source/Editor/Viewport/EditorViewport.cs
index 0230ee686..02696f743 100644
--- a/Source/Editor/Viewport/EditorViewport.cs
+++ b/Source/Editor/Viewport/EditorViewport.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using FlaxEditor.GUI.ContextMenu;
diff --git a/Source/Editor/Viewport/MainEditorGizmoViewport.Modes.cs b/Source/Editor/Viewport/MainEditorGizmoViewport.Modes.cs
index 5b33befa1..33f34a9a4 100644
--- a/Source/Editor/Viewport/MainEditorGizmoViewport.Modes.cs
+++ b/Source/Editor/Viewport/MainEditorGizmoViewport.Modes.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using System.Collections.Generic;
diff --git a/Source/Editor/Viewport/MainEditorGizmoViewport.cs b/Source/Editor/Viewport/MainEditorGizmoViewport.cs
index e6a9e3999..7906cc6e5 100644
--- a/Source/Editor/Viewport/MainEditorGizmoViewport.cs
+++ b/Source/Editor/Viewport/MainEditorGizmoViewport.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using System.Collections.Generic;
diff --git a/Source/Editor/Viewport/Modes/EditorGizmoMode.cs b/Source/Editor/Viewport/Modes/EditorGizmoMode.cs
index 2fd999558..565dd7388 100644
--- a/Source/Editor/Viewport/Modes/EditorGizmoMode.cs
+++ b/Source/Editor/Viewport/Modes/EditorGizmoMode.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using FlaxEngine;
diff --git a/Source/Editor/Viewport/Modes/NoGizmoMode.cs b/Source/Editor/Viewport/Modes/NoGizmoMode.cs
index ddca5b0b3..c75e4373f 100644
--- a/Source/Editor/Viewport/Modes/NoGizmoMode.cs
+++ b/Source/Editor/Viewport/Modes/NoGizmoMode.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
namespace FlaxEditor.Viewport.Modes
{
diff --git a/Source/Editor/Viewport/Modes/TransformGizmoMode.cs b/Source/Editor/Viewport/Modes/TransformGizmoMode.cs
index bde9c38f9..5d2ee2bbd 100644
--- a/Source/Editor/Viewport/Modes/TransformGizmoMode.cs
+++ b/Source/Editor/Viewport/Modes/TransformGizmoMode.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
namespace FlaxEditor.Viewport.Modes
{
diff --git a/Source/Editor/Viewport/PrefabWindowViewport.cs b/Source/Editor/Viewport/PrefabWindowViewport.cs
index ef7e8131f..94b994ac8 100644
--- a/Source/Editor/Viewport/PrefabWindowViewport.cs
+++ b/Source/Editor/Viewport/PrefabWindowViewport.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using System.Collections.Generic;
diff --git a/Source/Editor/Viewport/Previews/AnimatedModelPreview.cs b/Source/Editor/Viewport/Previews/AnimatedModelPreview.cs
index 2f369c568..24ae53261 100644
--- a/Source/Editor/Viewport/Previews/AnimatedModelPreview.cs
+++ b/Source/Editor/Viewport/Previews/AnimatedModelPreview.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System.Collections.Generic;
using FlaxEngine;
diff --git a/Source/Editor/Viewport/Previews/AssetPreview.cs b/Source/Editor/Viewport/Previews/AssetPreview.cs
index 7df1ae3ff..012837f87 100644
--- a/Source/Editor/Viewport/Previews/AssetPreview.cs
+++ b/Source/Editor/Viewport/Previews/AssetPreview.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using FlaxEditor.GUI.ContextMenu;
using FlaxEditor.Viewport.Cameras;
diff --git a/Source/Editor/Viewport/Previews/AudioClipPreview.cs b/Source/Editor/Viewport/Previews/AudioClipPreview.cs
index 08d08d24e..99c56c711 100644
--- a/Source/Editor/Viewport/Previews/AudioClipPreview.cs
+++ b/Source/Editor/Viewport/Previews/AudioClipPreview.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using System.Threading.Tasks;
@@ -115,11 +115,9 @@ namespace FlaxEditor.Viewport.Previews
var color = Color;
if (!EnabledInHierarchy)
color *= 0.4f;
+ var sampleValueScale = height / info.NumChannels;
- // Compute the scaled y-value used to render the channel data
- float sampleYScale = height / info.NumChannels;
-
- // Compute amount of samples that are contained in the view
+ // Calculate the amount of samples that are contained in the view
float unitsPerSecond = UnitsPerSecond * ViewScale;
float clipDefaultWidth = length * unitsPerSecond;
float clipsInView = width / clipDefaultWidth;
@@ -152,20 +150,16 @@ namespace FlaxEditor.Viewport.Previews
var clipX = clipWidth * clipIndex;
var clipRight = Mathf.Min(width, clipX + clipWidth);
- // Render each channel separately so outer loop is the sound wave channel index
+ // Render every audio channel separately
for (uint channelIndex = 0; channelIndex < info.NumChannels; channelIndex++)
{
uint currentSample = channelIndex;
float yCenter = Y + ((2 * channelIndex) + 1) * height / (2.0f * info.NumChannels);
-
- // Loop through each pixel (in x direction)
for (float pixelX = clipX; pixelX < clipRight; pixelX++)
{
- // Reset the sample sum and num samples in pixel for each pixel
float samplesSum = 0;
int samplesInPixel = 0;
- // Loop through all pixels in this x-frame and sum all audio data
uint samplesEnd = Math.Min(currentSample + samplesPerIndex, info.NumSamples);
for (uint sampleIndex = currentSample; sampleIndex < samplesEnd; sampleIndex += samplesPerIndexDiff)
{
@@ -173,16 +167,14 @@ namespace FlaxEditor.Viewport.Previews
samplesInPixel++;
}
currentSample = samplesEnd;
+
if (samplesInPixel > 0)
{
- float averageSampleValue = samplesSum / samplesInPixel;
- float averageSampleValueScaled = averageSampleValue * sampleYScale;
-
- // Don't try to draw anything if the audio data was too quiet
- if (averageSampleValueScaled > 0.1f)
+ float sampleValueAvg = samplesSum / samplesInPixel;
+ float sampleValueAvgScaled = sampleValueAvg * sampleValueScale;
+ if (sampleValueAvgScaled > 0.1f)
{
- // Draw vertical line mirrored around x-axis for channel equal to average sample value height
- Render2D.DrawLine(new Vector2(pixelX, yCenter - averageSampleValueScaled), new Vector2(pixelX, yCenter + averageSampleValueScaled), color);
+ Render2D.DrawLine(new Vector2(pixelX, yCenter - sampleValueAvgScaled), new Vector2(pixelX, yCenter + sampleValueAvgScaled), color);
}
}
}
diff --git a/Source/Editor/Viewport/Previews/CubeTexturePreview.cs b/Source/Editor/Viewport/Previews/CubeTexturePreview.cs
index 8e65a4aa3..4b41eb5c4 100644
--- a/Source/Editor/Viewport/Previews/CubeTexturePreview.cs
+++ b/Source/Editor/Viewport/Previews/CubeTexturePreview.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using FlaxEditor.GUI.ContextMenu;
using FlaxEditor.Viewport.Widgets;
diff --git a/Source/Editor/Viewport/Previews/IESProfilePreview.cs b/Source/Editor/Viewport/Previews/IESProfilePreview.cs
index bd8323e26..311c17ad2 100644
--- a/Source/Editor/Viewport/Previews/IESProfilePreview.cs
+++ b/Source/Editor/Viewport/Previews/IESProfilePreview.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using FlaxEngine;
diff --git a/Source/Editor/Viewport/Previews/MaterialPreview.cs b/Source/Editor/Viewport/Previews/MaterialPreview.cs
index da1b58cf1..a03598193 100644
--- a/Source/Editor/Viewport/Previews/MaterialPreview.cs
+++ b/Source/Editor/Viewport/Previews/MaterialPreview.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using FlaxEditor.Surface;
diff --git a/Source/Editor/Viewport/Previews/ModelPreview.cs b/Source/Editor/Viewport/Previews/ModelPreview.cs
index 9ed9a80e2..e4789bdb8 100644
--- a/Source/Editor/Viewport/Previews/ModelPreview.cs
+++ b/Source/Editor/Viewport/Previews/ModelPreview.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using FlaxEditor.GUI.Input;
using FlaxEngine;
diff --git a/Source/Editor/Viewport/Previews/ParticleEmitterPreview.cs b/Source/Editor/Viewport/Previews/ParticleEmitterPreview.cs
index 0c93b9717..e7021050b 100644
--- a/Source/Editor/Viewport/Previews/ParticleEmitterPreview.cs
+++ b/Source/Editor/Viewport/Previews/ParticleEmitterPreview.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using FlaxEditor.GUI.Input;
using FlaxEngine;
diff --git a/Source/Editor/Viewport/Previews/ParticleSystemPreview.cs b/Source/Editor/Viewport/Previews/ParticleSystemPreview.cs
index 4a2d96136..ad2502b23 100644
--- a/Source/Editor/Viewport/Previews/ParticleSystemPreview.cs
+++ b/Source/Editor/Viewport/Previews/ParticleSystemPreview.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using FlaxEditor.GUI.ContextMenu;
using FlaxEditor.Viewport.Cameras;
diff --git a/Source/Editor/Viewport/Previews/PrefabPreview.cs b/Source/Editor/Viewport/Previews/PrefabPreview.cs
index 009828d51..d0ed8a0c2 100644
--- a/Source/Editor/Viewport/Previews/PrefabPreview.cs
+++ b/Source/Editor/Viewport/Previews/PrefabPreview.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using FlaxEngine;
using FlaxEngine.GUI;
diff --git a/Source/Editor/Viewport/Previews/TexturePreview.cs b/Source/Editor/Viewport/Previews/TexturePreview.cs
index 01c9e0884..d1904027a 100644
--- a/Source/Editor/Viewport/Previews/TexturePreview.cs
+++ b/Source/Editor/Viewport/Previews/TexturePreview.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using FlaxEditor.GUI.ContextMenu;
diff --git a/Source/Editor/Viewport/Widgets/ViewportWidgetButton.cs b/Source/Editor/Viewport/Widgets/ViewportWidgetButton.cs
index 637419177..9f4451cab 100644
--- a/Source/Editor/Viewport/Widgets/ViewportWidgetButton.cs
+++ b/Source/Editor/Viewport/Widgets/ViewportWidgetButton.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using FlaxEditor.GUI.ContextMenu;
diff --git a/Source/Editor/Viewport/Widgets/ViewportWidgetsContainer.cs b/Source/Editor/Viewport/Widgets/ViewportWidgetsContainer.cs
index d4e5df33b..e9e27c11c 100644
--- a/Source/Editor/Viewport/Widgets/ViewportWidgetsContainer.cs
+++ b/Source/Editor/Viewport/Widgets/ViewportWidgetsContainer.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using FlaxEngine;
using FlaxEngine.GUI;
diff --git a/Source/Editor/ViewportDebugDrawData.cs b/Source/Editor/ViewportDebugDrawData.cs
index 30b6d33a0..e2687b8de 100644
--- a/Source/Editor/ViewportDebugDrawData.cs
+++ b/Source/Editor/ViewportDebugDrawData.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using System.Collections.Generic;
diff --git a/Source/Editor/Windows/AboutDialog.cs b/Source/Editor/Windows/AboutDialog.cs
index 7683ca352..03e60f43c 100644
--- a/Source/Editor/Windows/AboutDialog.cs
+++ b/Source/Editor/Windows/AboutDialog.cs
@@ -1,5 +1,5 @@
//#define USE_AUTODESK_FBX_SDK
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System.Collections.Generic;
using FlaxEditor.GUI.Dialogs;
@@ -19,7 +19,7 @@ namespace FlaxEditor.Windows
public AboutDialog()
: base("About Flax")
{
- _dialogSize = Size = new Vector2(400, 260);
+ _dialogSize = Size = new Vector2(400, 320);
Control header = CreateHeader();
Control authorsLabel = CreateAuthorsLabels(header);
@@ -47,12 +47,12 @@ namespace FlaxEditor.Windows
};
new Label(nameLabel.Left, nameLabel.Bottom + 4, nameLabel.Width, 50)
{
- Text = string.Format("Version: {0}\nCopyright (c) 2012-2020 Wojciech Figat.\nAll rights reserved.", Globals.EngineVersion),
+ Text = string.Format("Version: {0}\nCopyright (c) 2012-2021 Wojciech Figat.\nAll rights reserved.", Globals.EngineVersion),
HorizontalAlignment = TextAlignment.Near,
VerticalAlignment = TextAlignment.Near,
Parent = this
};
- var copyVersionButton = new Button(Width - 104, 4, 100, 20)
+ var copyVersionButton = new Button(Width - 104, 6, 100, 20)
{
Text = "Copy version info",
TooltipText = "Copies the current engine version information to system clipboard.",
@@ -90,9 +90,12 @@ namespace FlaxEditor.Windows
"Tomasz Juszczak",
"Damian Korczowski",
"Michał Winiarski",
+ "Stefan Brandmair",
+ "Lukáš Jech",
+ "Jean-Baptiste Perrier",
});
authors.Sort();
- var authorsLabel = new Label(4, topParentControl.Bottom + 20, Width - 8, 50)
+ var authorsLabel = new Label(4, topParentControl.Bottom + 20, Width - 8, 70)
{
Text = "People who made it:\n" + string.Join(", ", authors),
HorizontalAlignment = TextAlignment.Near,
diff --git a/Source/Editor/Windows/Assets/AnimationGraphFunctionWindow.cs b/Source/Editor/Windows/Assets/AnimationGraphFunctionWindow.cs
index f04d09da6..439f61c9f 100644
--- a/Source/Editor/Windows/Assets/AnimationGraphFunctionWindow.cs
+++ b/Source/Editor/Windows/Assets/AnimationGraphFunctionWindow.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using FlaxEditor.Content;
using FlaxEditor.Surface;
diff --git a/Source/Editor/Windows/Assets/AnimationGraphWindow.cs b/Source/Editor/Windows/Assets/AnimationGraphWindow.cs
index 0e798bc4c..a728e9281 100644
--- a/Source/Editor/Windows/Assets/AnimationGraphWindow.cs
+++ b/Source/Editor/Windows/Assets/AnimationGraphWindow.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using System.Collections.Generic;
diff --git a/Source/Editor/Windows/Assets/AnimationWindow.cs b/Source/Editor/Windows/Assets/AnimationWindow.cs
index 88538a781..fc6092fb7 100644
--- a/Source/Editor/Windows/Assets/AnimationWindow.cs
+++ b/Source/Editor/Windows/Assets/AnimationWindow.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using System.Reflection;
diff --git a/Source/Editor/Windows/Assets/AssetEditorWindow.cs b/Source/Editor/Windows/Assets/AssetEditorWindow.cs
index 88798a3e1..756adbe05 100644
--- a/Source/Editor/Windows/Assets/AssetEditorWindow.cs
+++ b/Source/Editor/Windows/Assets/AssetEditorWindow.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using FlaxEditor.Content;
@@ -51,7 +51,6 @@ namespace FlaxEditor.Windows.Assets
_toolstrip = new ToolStrip
{
- Offsets = new Margin(0, 0, 0, 32),
Parent = this
};
_toolstrip.AddButton(editor.Icons.Find32, () => Editor.Windows.ContentWin.Select(_item)).LinkTooltip("Show and select in Content Window");
diff --git a/Source/Editor/Windows/Assets/AudioClipWindow.cs b/Source/Editor/Windows/Assets/AudioClipWindow.cs
index d96c2eb36..009a1ff3d 100644
--- a/Source/Editor/Windows/Assets/AudioClipWindow.cs
+++ b/Source/Editor/Windows/Assets/AudioClipWindow.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System.Xml;
using FlaxEditor.Content;
diff --git a/Source/Editor/Windows/Assets/CollisionDataWindow.cs b/Source/Editor/Windows/Assets/CollisionDataWindow.cs
index 6c679d768..26b74931b 100644
--- a/Source/Editor/Windows/Assets/CollisionDataWindow.cs
+++ b/Source/Editor/Windows/Assets/CollisionDataWindow.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System.Xml;
using FlaxEditor.Content;
diff --git a/Source/Editor/Windows/Assets/CubeTextureWindow.cs b/Source/Editor/Windows/Assets/CubeTextureWindow.cs
index 3489ce22e..1a0ae3770 100644
--- a/Source/Editor/Windows/Assets/CubeTextureWindow.cs
+++ b/Source/Editor/Windows/Assets/CubeTextureWindow.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System.Xml;
using FlaxEditor.Content;
diff --git a/Source/Editor/Windows/Assets/FontWindow.cs b/Source/Editor/Windows/Assets/FontWindow.cs
index 11ba34b47..d0bd3aa8b 100644
--- a/Source/Editor/Windows/Assets/FontWindow.cs
+++ b/Source/Editor/Windows/Assets/FontWindow.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System.ComponentModel;
using FlaxEditor.Content;
diff --git a/Source/Editor/Windows/Assets/GameplayGlobalsWindow.cs b/Source/Editor/Windows/Assets/GameplayGlobalsWindow.cs
index 754222957..f185e3eec 100644
--- a/Source/Editor/Windows/Assets/GameplayGlobalsWindow.cs
+++ b/Source/Editor/Windows/Assets/GameplayGlobalsWindow.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using System.Collections.Generic;
diff --git a/Source/Editor/Windows/Assets/IESProfileWindow.cs b/Source/Editor/Windows/Assets/IESProfileWindow.cs
index 0c17a4705..81ea9b496 100644
--- a/Source/Editor/Windows/Assets/IESProfileWindow.cs
+++ b/Source/Editor/Windows/Assets/IESProfileWindow.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using FlaxEditor.Content;
using FlaxEditor.Viewport.Previews;
diff --git a/Source/Editor/Windows/Assets/JsonAssetWindow.cs b/Source/Editor/Windows/Assets/JsonAssetWindow.cs
index 5930a1bb2..670414241 100644
--- a/Source/Editor/Windows/Assets/JsonAssetWindow.cs
+++ b/Source/Editor/Windows/Assets/JsonAssetWindow.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using FlaxEditor.Content;
using FlaxEditor.CustomEditors;
diff --git a/Source/Editor/Windows/Assets/MaterialFunctionWindow.cs b/Source/Editor/Windows/Assets/MaterialFunctionWindow.cs
index 2aa449b1a..20b091a04 100644
--- a/Source/Editor/Windows/Assets/MaterialFunctionWindow.cs
+++ b/Source/Editor/Windows/Assets/MaterialFunctionWindow.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using FlaxEditor.Content;
using FlaxEditor.Surface;
diff --git a/Source/Editor/Windows/Assets/MaterialInstanceWindow.cs b/Source/Editor/Windows/Assets/MaterialInstanceWindow.cs
index c11198cba..6087eb86b 100644
--- a/Source/Editor/Windows/Assets/MaterialInstanceWindow.cs
+++ b/Source/Editor/Windows/Assets/MaterialInstanceWindow.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System.Collections.Generic;
using System.Linq;
diff --git a/Source/Editor/Windows/Assets/MaterialWindow.cs b/Source/Editor/Windows/Assets/MaterialWindow.cs
index ca99f6a2e..f49e6a79c 100644
--- a/Source/Editor/Windows/Assets/MaterialWindow.cs
+++ b/Source/Editor/Windows/Assets/MaterialWindow.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using System.Collections.Generic;
diff --git a/Source/Editor/Windows/Assets/ModelBaseWindow.cs b/Source/Editor/Windows/Assets/ModelBaseWindow.cs
index 9469c3803..9bb500deb 100644
--- a/Source/Editor/Windows/Assets/ModelBaseWindow.cs
+++ b/Source/Editor/Windows/Assets/ModelBaseWindow.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System.Xml;
using FlaxEditor.Content;
diff --git a/Source/Editor/Windows/Assets/ModelWindow.cs b/Source/Editor/Windows/Assets/ModelWindow.cs
index afbdee208..9910c6e7a 100644
--- a/Source/Editor/Windows/Assets/ModelWindow.cs
+++ b/Source/Editor/Windows/Assets/ModelWindow.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using System.Collections.Generic;
diff --git a/Source/Editor/Windows/Assets/ParticleEmitterFunctionWindow.cs b/Source/Editor/Windows/Assets/ParticleEmitterFunctionWindow.cs
index b24541431..a449aec82 100644
--- a/Source/Editor/Windows/Assets/ParticleEmitterFunctionWindow.cs
+++ b/Source/Editor/Windows/Assets/ParticleEmitterFunctionWindow.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using FlaxEditor.Content;
using FlaxEditor.Surface;
diff --git a/Source/Editor/Windows/Assets/ParticleEmitterWindow.cs b/Source/Editor/Windows/Assets/ParticleEmitterWindow.cs
index 84f2d8785..17b5a928d 100644
--- a/Source/Editor/Windows/Assets/ParticleEmitterWindow.cs
+++ b/Source/Editor/Windows/Assets/ParticleEmitterWindow.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using System.Collections.Generic;
diff --git a/Source/Editor/Windows/Assets/ParticleSystemWindow.cs b/Source/Editor/Windows/Assets/ParticleSystemWindow.cs
index d11e39d95..fbf1a2d01 100644
--- a/Source/Editor/Windows/Assets/ParticleSystemWindow.cs
+++ b/Source/Editor/Windows/Assets/ParticleSystemWindow.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using System.Linq;
diff --git a/Source/Editor/Windows/Assets/PrefabWindow.Actions.cs b/Source/Editor/Windows/Assets/PrefabWindow.Actions.cs
index 7165b6725..00a96910f 100644
--- a/Source/Editor/Windows/Assets/PrefabWindow.Actions.cs
+++ b/Source/Editor/Windows/Assets/PrefabWindow.Actions.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using System.Collections.Generic;
diff --git a/Source/Editor/Windows/Assets/PrefabWindow.Hierarchy.cs b/Source/Editor/Windows/Assets/PrefabWindow.Hierarchy.cs
index 6225929c6..08621f2ec 100644
--- a/Source/Editor/Windows/Assets/PrefabWindow.Hierarchy.cs
+++ b/Source/Editor/Windows/Assets/PrefabWindow.Hierarchy.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using System.Collections.Generic;
diff --git a/Source/Editor/Windows/Assets/PrefabWindow.Selection.cs b/Source/Editor/Windows/Assets/PrefabWindow.Selection.cs
index 62b05ebd1..be4bf3070 100644
--- a/Source/Editor/Windows/Assets/PrefabWindow.Selection.cs
+++ b/Source/Editor/Windows/Assets/PrefabWindow.Selection.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using System.Collections.Generic;
diff --git a/Source/Editor/Windows/Assets/PrefabWindow.cs b/Source/Editor/Windows/Assets/PrefabWindow.cs
index 53cffcb8f..a8b3e24a4 100644
--- a/Source/Editor/Windows/Assets/PrefabWindow.cs
+++ b/Source/Editor/Windows/Assets/PrefabWindow.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using System.Xml;
diff --git a/Source/Editor/Windows/Assets/PreviewsCacheWindow.cs b/Source/Editor/Windows/Assets/PreviewsCacheWindow.cs
index 234834c87..d1fe73976 100644
--- a/Source/Editor/Windows/Assets/PreviewsCacheWindow.cs
+++ b/Source/Editor/Windows/Assets/PreviewsCacheWindow.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using FlaxEditor.Content;
using FlaxEditor.Viewport.Previews;
diff --git a/Source/Editor/Windows/Assets/SceneAnimationWindow.cs b/Source/Editor/Windows/Assets/SceneAnimationWindow.cs
index af0cea824..cbed724bc 100644
--- a/Source/Editor/Windows/Assets/SceneAnimationWindow.cs
+++ b/Source/Editor/Windows/Assets/SceneAnimationWindow.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using System.Globalization;
diff --git a/Source/Editor/Windows/Assets/SkeletonMaskWindow.cs b/Source/Editor/Windows/Assets/SkeletonMaskWindow.cs
index 25a1cc215..8ead2cba0 100644
--- a/Source/Editor/Windows/Assets/SkeletonMaskWindow.cs
+++ b/Source/Editor/Windows/Assets/SkeletonMaskWindow.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System.Collections;
using System.Xml;
diff --git a/Source/Editor/Windows/Assets/SkinnedModelWindow.cs b/Source/Editor/Windows/Assets/SkinnedModelWindow.cs
index 5e15b7936..2f6c952ba 100644
--- a/Source/Editor/Windows/Assets/SkinnedModelWindow.cs
+++ b/Source/Editor/Windows/Assets/SkinnedModelWindow.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using System.Collections.Generic;
diff --git a/Source/Editor/Windows/Assets/SpriteAtlasWindow.cs b/Source/Editor/Windows/Assets/SpriteAtlasWindow.cs
index 9b6579109..b4c8f3145 100644
--- a/Source/Editor/Windows/Assets/SpriteAtlasWindow.cs
+++ b/Source/Editor/Windows/Assets/SpriteAtlasWindow.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System.Xml;
using FlaxEditor.Content;
diff --git a/Source/Editor/Windows/Assets/TextureWindow.cs b/Source/Editor/Windows/Assets/TextureWindow.cs
index 20e7e9930..81a258c3f 100644
--- a/Source/Editor/Windows/Assets/TextureWindow.cs
+++ b/Source/Editor/Windows/Assets/TextureWindow.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System.Xml;
using FlaxEditor.Content;
diff --git a/Source/Editor/Windows/Assets/VisjectFunctionSurfaceWindow.cs b/Source/Editor/Windows/Assets/VisjectFunctionSurfaceWindow.cs
index 7c7b13af2..57041169a 100644
--- a/Source/Editor/Windows/Assets/VisjectFunctionSurfaceWindow.cs
+++ b/Source/Editor/Windows/Assets/VisjectFunctionSurfaceWindow.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using FlaxEditor.Content;
using FlaxEditor.GUI;
diff --git a/Source/Editor/Windows/Assets/VisualScriptWindow.cs b/Source/Editor/Windows/Assets/VisualScriptWindow.cs
index 736ae3ab7..a9b62df62 100644
--- a/Source/Editor/Windows/Assets/VisualScriptWindow.cs
+++ b/Source/Editor/Windows/Assets/VisualScriptWindow.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using System.Collections.Generic;
diff --git a/Source/Editor/Windows/ContentWindow.ContextMenu.cs b/Source/Editor/Windows/ContentWindow.ContextMenu.cs
index d273ead49..1b4d2be31 100644
--- a/Source/Editor/Windows/ContentWindow.ContextMenu.cs
+++ b/Source/Editor/Windows/ContentWindow.ContextMenu.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using FlaxEditor.Content;
diff --git a/Source/Editor/Windows/ContentWindow.Navigation.cs b/Source/Editor/Windows/ContentWindow.Navigation.cs
index 6d19a12f4..e3720a06e 100644
--- a/Source/Editor/Windows/ContentWindow.Navigation.cs
+++ b/Source/Editor/Windows/ContentWindow.Navigation.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System.Collections.Generic;
using FlaxEditor.Content;
diff --git a/Source/Editor/Windows/ContentWindow.Search.cs b/Source/Editor/Windows/ContentWindow.Search.cs
index e8291fe11..e8ef60e23 100644
--- a/Source/Editor/Windows/ContentWindow.Search.cs
+++ b/Source/Editor/Windows/ContentWindow.Search.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System.Collections.Generic;
using FlaxEditor.Content;
diff --git a/Source/Editor/Windows/ContentWindow.cs b/Source/Editor/Windows/ContentWindow.cs
index 655ac653f..66ed50daf 100644
--- a/Source/Editor/Windows/ContentWindow.cs
+++ b/Source/Editor/Windows/ContentWindow.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using System.Collections.Generic;
@@ -72,10 +72,9 @@ namespace FlaxEditor.Windows
editor.ContentDatabase.ItemRemoved += ContentDatabaseOnItemRemoved;
// Toolstrip
- _toolStrip = new ToolStrip
+ _toolStrip = new ToolStrip(34.0f)
{
Parent = this,
- Bounds = new Rectangle(0, 0, Width, 34),
};
_importButton = (ToolStripButton)_toolStrip.AddButton(Editor.Icons.Import32, () => Editor.ContentImporting.ShowImportFileDialog(CurrentViewFolder)).LinkTooltip("Import content");
_toolStrip.AddSeparator();
diff --git a/Source/Editor/Windows/DebugLogWindow.cs b/Source/Editor/Windows/DebugLogWindow.cs
index f90d63cad..8aad9fc35 100644
--- a/Source/Editor/Windows/DebugLogWindow.cs
+++ b/Source/Editor/Windows/DebugLogWindow.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using System.Collections.Generic;
@@ -282,9 +282,8 @@ namespace FlaxEditor.Windows
OnEditorOptionsChanged(Editor.Options.Options);
// Toolstrip
- var toolstrip = new ToolStrip
+ var toolstrip = new ToolStrip(22.0f)
{
- Offsets = new Margin(0, 0, 0, 22),
Parent = this,
};
toolstrip.AddButton("Clear", Clear).LinkTooltip("Clears all log entries");
diff --git a/Source/Editor/Windows/EditGameWindow.cs b/Source/Editor/Windows/EditGameWindow.cs
index 32871b5f7..a9f85490d 100644
--- a/Source/Editor/Windows/EditGameWindow.cs
+++ b/Source/Editor/Windows/EditGameWindow.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using System.Collections.Generic;
diff --git a/Source/Editor/Windows/EditorOptionsWindow.cs b/Source/Editor/Windows/EditorOptionsWindow.cs
index a2d133407..01b26a65c 100644
--- a/Source/Editor/Windows/EditorOptionsWindow.cs
+++ b/Source/Editor/Windows/EditorOptionsWindow.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using System.Collections.Generic;
@@ -36,7 +36,6 @@ namespace FlaxEditor.Windows
var toolstrip = new ToolStrip
{
- Offsets = new Margin(0, 0, 0, 32),
Parent = this
};
_saveButton = (ToolStripButton)toolstrip.AddButton(editor.Icons.Save32, SaveData).LinkTooltip("Save");
diff --git a/Source/Editor/Windows/EditorWindow.cs b/Source/Editor/Windows/EditorWindow.cs
index 243e899a1..4db8bc094 100644
--- a/Source/Editor/Windows/EditorWindow.cs
+++ b/Source/Editor/Windows/EditorWindow.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using FlaxEditor.Content;
diff --git a/Source/Editor/Windows/GameCookerWindow.cs b/Source/Editor/Windows/GameCookerWindow.cs
index 0e820535a..442cc4c34 100644
--- a/Source/Editor/Windows/GameCookerWindow.cs
+++ b/Source/Editor/Windows/GameCookerWindow.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using System.Collections.Generic;
diff --git a/Source/Editor/Windows/GameWindow.cs b/Source/Editor/Windows/GameWindow.cs
index 76bbe0a5d..a29869825 100644
--- a/Source/Editor/Windows/GameWindow.cs
+++ b/Source/Editor/Windows/GameWindow.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using FlaxEditor.GUI.ContextMenu;
using FlaxEditor.GUI.Input;
@@ -206,9 +206,12 @@ namespace FlaxEditor.Windows
Editor.StateMachine.PlayingState.SceneRestored += PlayingStateOnSceneRestored;
// Link editor options
- var options = Editor.Options;
- options.OptionsChanged += OnOptionsChanged;
- OnOptionsChanged(options.Options);
+ Editor.Options.OptionsChanged += OnOptionsChanged;
+ OnOptionsChanged(Editor.Options.Options);
+
+ InputActions.Add(options => options.Play, Editor.Simulation.RequestPlayOrStopPlay);
+ InputActions.Add(options => options.Pause, Editor.Simulation.RequestResumeOrPause);
+ InputActions.Add(options => options.StepFrame, Editor.Simulation.RequestPlayOneFrame);
}
private void OnOptionsChanged(EditorOptions options)
@@ -369,10 +372,6 @@ namespace FlaxEditor.Windows
{
switch (key)
{
- case KeyboardKeys.Pause:
- Editor.Simulation.RequestResumeOrPause();
- UnlockMouseInPlay();
- return true;
case KeyboardKeys.F12:
Screenshot.Capture(string.Empty);
return true;
diff --git a/Source/Editor/Windows/GraphicsQualityWindow.cs b/Source/Editor/Windows/GraphicsQualityWindow.cs
index 44c87ac24..33e5a3ff4 100644
--- a/Source/Editor/Windows/GraphicsQualityWindow.cs
+++ b/Source/Editor/Windows/GraphicsQualityWindow.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System.ComponentModel;
using FlaxEditor.CustomEditors;
diff --git a/Source/Editor/Windows/OutputLogWindow.cs b/Source/Editor/Windows/OutputLogWindow.cs
index 8b1007423..cd13e4cdc 100644
--- a/Source/Editor/Windows/OutputLogWindow.cs
+++ b/Source/Editor/Windows/OutputLogWindow.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using System.Collections.Generic;
diff --git a/Source/Editor/Windows/PluginsWindow.cs b/Source/Editor/Windows/PluginsWindow.cs
index 50af21d46..28b6c20a5 100644
--- a/Source/Editor/Windows/PluginsWindow.cs
+++ b/Source/Editor/Windows/PluginsWindow.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using System.Collections.Generic;
diff --git a/Source/Editor/Windows/Profiler/CPU.cs b/Source/Editor/Windows/Profiler/CPU.cs
index 44a778ef0..9e79832ab 100644
--- a/Source/Editor/Windows/Profiler/CPU.cs
+++ b/Source/Editor/Windows/Profiler/CPU.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using FlaxEditor.GUI;
diff --git a/Source/Editor/Windows/Profiler/GPU.cs b/Source/Editor/Windows/Profiler/GPU.cs
index be9ba9ab9..b7cee5517 100644
--- a/Source/Editor/Windows/Profiler/GPU.cs
+++ b/Source/Editor/Windows/Profiler/GPU.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using FlaxEditor.GUI;
using FlaxEngine;
diff --git a/Source/Editor/Windows/Profiler/Memory.cs b/Source/Editor/Windows/Profiler/Memory.cs
index ca84738be..4cc48ce73 100644
--- a/Source/Editor/Windows/Profiler/Memory.cs
+++ b/Source/Editor/Windows/Profiler/Memory.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using FlaxEngine.GUI;
diff --git a/Source/Editor/Windows/Profiler/Overall.cs b/Source/Editor/Windows/Profiler/Overall.cs
index d70124c01..65ba320b5 100644
--- a/Source/Editor/Windows/Profiler/Overall.cs
+++ b/Source/Editor/Windows/Profiler/Overall.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using FlaxEngine;
using FlaxEngine.GUI;
diff --git a/Source/Editor/Windows/Profiler/ProfilerMode.cs b/Source/Editor/Windows/Profiler/ProfilerMode.cs
index d7788358a..578cfaebf 100644
--- a/Source/Editor/Windows/Profiler/ProfilerMode.cs
+++ b/Source/Editor/Windows/Profiler/ProfilerMode.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using FlaxEditor.GUI.Tabs;
diff --git a/Source/Editor/Windows/Profiler/ProfilerWindow.cs b/Source/Editor/Windows/Profiler/ProfilerWindow.cs
index 97204703f..e6de1fd69 100644
--- a/Source/Editor/Windows/Profiler/ProfilerWindow.cs
+++ b/Source/Editor/Windows/Profiler/ProfilerWindow.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using FlaxEditor.GUI;
@@ -90,7 +90,6 @@ namespace FlaxEditor.Windows.Profiler
var toolstrip = new ToolStrip
{
- Offsets = new Margin(0, 0, 0, 32),
Parent = this,
};
_liveRecordingButton = toolstrip.AddButton(editor.Icons.Play32);
diff --git a/Source/Editor/Windows/Profiler/SamplesBuffer.cs b/Source/Editor/Windows/Profiler/SamplesBuffer.cs
index a975f0fec..1a4ea527c 100644
--- a/Source/Editor/Windows/Profiler/SamplesBuffer.cs
+++ b/Source/Editor/Windows/Profiler/SamplesBuffer.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
namespace FlaxEditor.Windows.Profiler
{
diff --git a/Source/Editor/Windows/Profiler/SingleChart.cs b/Source/Editor/Windows/Profiler/SingleChart.cs
index 496242dc5..81214bd71 100644
--- a/Source/Editor/Windows/Profiler/SingleChart.cs
+++ b/Source/Editor/Windows/Profiler/SingleChart.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using FlaxEngine;
diff --git a/Source/Editor/Windows/Profiler/Timeline.cs b/Source/Editor/Windows/Profiler/Timeline.cs
index 7c39d65a0..53f4c9987 100644
--- a/Source/Editor/Windows/Profiler/Timeline.cs
+++ b/Source/Editor/Windows/Profiler/Timeline.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using FlaxEngine;
using FlaxEngine.GUI;
diff --git a/Source/Editor/Windows/PropertiesWindow.cs b/Source/Editor/Windows/PropertiesWindow.cs
index d7d550658..70f58dcc6 100644
--- a/Source/Editor/Windows/PropertiesWindow.cs
+++ b/Source/Editor/Windows/PropertiesWindow.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System.Collections.Generic;
using System.Linq;
diff --git a/Source/Editor/Windows/SceneEditorWindow.cs b/Source/Editor/Windows/SceneEditorWindow.cs
index 5c9009b5e..ec8b68e67 100644
--- a/Source/Editor/Windows/SceneEditorWindow.cs
+++ b/Source/Editor/Windows/SceneEditorWindow.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using FlaxEngine.GUI;
@@ -38,7 +38,7 @@ namespace FlaxEditor.Windows
InputActions.Add(options => options.SelectAll, Editor.SceneEditing.SelectAllScenes);
InputActions.Add(options => options.Delete, Editor.SceneEditing.Delete);
InputActions.Add(options => options.Search, () => Editor.Windows.SceneWin.Search());
- InputActions.Add(options => options.Play, Editor.Simulation.RequestStartPlay);
+ InputActions.Add(options => options.Play, Editor.Simulation.RequestPlayOrStopPlay);
InputActions.Add(options => options.Pause, Editor.Simulation.RequestResumeOrPause);
InputActions.Add(options => options.StepFrame, Editor.Simulation.RequestPlayOneFrame);
}
diff --git a/Source/Editor/Windows/SceneTreeWindow.Actors.cs b/Source/Editor/Windows/SceneTreeWindow.Actors.cs
index 65bcdac16..d3fff78d8 100644
--- a/Source/Editor/Windows/SceneTreeWindow.Actors.cs
+++ b/Source/Editor/Windows/SceneTreeWindow.Actors.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using System.Collections.Generic;
diff --git a/Source/Editor/Windows/SceneTreeWindow.ContextMenu.cs b/Source/Editor/Windows/SceneTreeWindow.ContextMenu.cs
index 2554c6766..b6756b438 100644
--- a/Source/Editor/Windows/SceneTreeWindow.ContextMenu.cs
+++ b/Source/Editor/Windows/SceneTreeWindow.ContextMenu.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using FlaxEditor.GUI.ContextMenu;
diff --git a/Source/Editor/Windows/SceneTreeWindow.cs b/Source/Editor/Windows/SceneTreeWindow.cs
index a72d5cb6f..3db4df799 100644
--- a/Source/Editor/Windows/SceneTreeWindow.cs
+++ b/Source/Editor/Windows/SceneTreeWindow.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using System.Collections.Generic;
diff --git a/Source/Editor/Windows/SplashScreen.cpp b/Source/Editor/Windows/SplashScreen.cpp
index feef79a69..98578950f 100644
--- a/Source/Editor/Windows/SplashScreen.cpp
+++ b/Source/Editor/Windows/SplashScreen.cpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#include "SplashScreen.h"
#include "Engine/Core/Log.h"
@@ -124,20 +124,6 @@ void SplashScreen::Show()
if (IsVisible() || CommandLine::Options.Headless)
return;
-#if GRAPHICS_API_OPENGL && PLATFORM_WINDOWS
-
- // Notes:
- // We cannot show splash screen on OpenGL because it sucks.
- // Actually it's because the first window we show (it should be the main editor window)
- // the OpenGL backend will use its context to submit all graphics commands.
- // also other contexts (child windows, tooltip windows, etc.)
- // will share the main context command line.
- // TODO: we could show the splash screen after the main window is created!
-
- LOG(Warning, "The current platform does not support showing splash screen.");
-
-#else
-
LOG(Info, "Showing splash screen");
// Create window
@@ -203,7 +189,6 @@ void SplashScreen::Show()
}
_window->Show();
-#endif
}
void SplashScreen::Close()
diff --git a/Source/Editor/Windows/SplashScreen.h b/Source/Editor/Windows/SplashScreen.h
index cdb9adf53..55d02caac 100644
--- a/Source/Editor/Windows/SplashScreen.h
+++ b/Source/Editor/Windows/SplashScreen.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Editor/Windows/StyleEditorWindow.cs b/Source/Editor/Windows/StyleEditorWindow.cs
index 1e118676a..8f84cf17b 100644
--- a/Source/Editor/Windows/StyleEditorWindow.cs
+++ b/Source/Editor/Windows/StyleEditorWindow.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System.Collections.Generic;
using FlaxEditor.CustomEditors;
diff --git a/Source/Editor/Windows/ToolboxWindow.cs b/Source/Editor/Windows/ToolboxWindow.cs
index ef2937e84..d10a111b6 100644
--- a/Source/Editor/Windows/ToolboxWindow.cs
+++ b/Source/Editor/Windows/ToolboxWindow.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using System.Collections.Generic;
@@ -308,11 +308,12 @@ namespace FlaxEditor.Windows
///
public override void OnInit()
{
+ float tabSize = 48 * Editor.Options.Options.Interface.IconsScale;
TabsControl = new Tabs
{
AnchorPreset = AnchorPresets.StretchAll,
Offsets = Margin.Zero,
- TabsSize = new Vector2(48, 48),
+ TabsSize = new Vector2(tabSize, tabSize),
Parent = this
};
diff --git a/Source/Editor/Windows/VisualScriptDebuggerWindow.cs b/Source/Editor/Windows/VisualScriptDebuggerWindow.cs
index 155188dca..897f30552 100644
--- a/Source/Editor/Windows/VisualScriptDebuggerWindow.cs
+++ b/Source/Editor/Windows/VisualScriptDebuggerWindow.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System.Collections.Generic;
using System.IO;
@@ -399,7 +399,6 @@ namespace FlaxEditor.Windows
var toolstrip = new ToolStrip
{
- Offsets = new Margin(0, 0, 0, 32),
Parent = this
};
toolstrip.AddButton(editor.Icons.Docs32, () => Platform.OpenUrl(Utilities.Constants.DocsUrl + "manual/scripting/visual/index.html")).LinkTooltip("See documentation to learn more");
@@ -416,7 +415,7 @@ namespace FlaxEditor.Windows
var tabs = new Tabs
{
AnchorPreset = AnchorPresets.StretchAll,
- Offsets = new Margin(0, 0, 32, 0),
+ Offsets = new Margin(0, 0, toolstrip.Bottom, 0),
TabsSize = new Vector2(80, 20),
TabsTextHorizontalAlignment = TextAlignment.Center,
UseScroll = true,
diff --git a/Source/Engine/Animations/AlphaBlend.h b/Source/Engine/Animations/AlphaBlend.h
index 656eb0851..b86973739 100644
--- a/Source/Engine/Animations/AlphaBlend.h
+++ b/Source/Engine/Animations/AlphaBlend.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/Animations/AnimationData.h b/Source/Engine/Animations/AnimationData.h
index a4f97b749..139c06aa9 100644
--- a/Source/Engine/Animations/AnimationData.h
+++ b/Source/Engine/Animations/AnimationData.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/Animations/AnimationGraph.cs b/Source/Engine/Animations/AnimationGraph.cs
index 6034f493f..1a5c9133d 100644
--- a/Source/Engine/Animations/AnimationGraph.cs
+++ b/Source/Engine/Animations/AnimationGraph.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using System.Runtime.CompilerServices;
diff --git a/Source/Engine/Animations/AnimationManager.cpp b/Source/Engine/Animations/AnimationManager.cpp
index 068b4cff7..c64a61856 100644
--- a/Source/Engine/Animations/AnimationManager.cpp
+++ b/Source/Engine/Animations/AnimationManager.cpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#include "AnimationManager.h"
#include "Engine/Profiler/ProfilerCPU.h"
diff --git a/Source/Engine/Animations/AnimationManager.h b/Source/Engine/Animations/AnimationManager.h
index b29759109..fc4e733ce 100644
--- a/Source/Engine/Animations/AnimationManager.h
+++ b/Source/Engine/Animations/AnimationManager.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/Animations/AnimationUtils.h b/Source/Engine/Animations/AnimationUtils.h
index 8a091487a..248efea0c 100644
--- a/Source/Engine/Animations/AnimationUtils.h
+++ b/Source/Engine/Animations/AnimationUtils.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/Animations/Animations.Build.cs b/Source/Engine/Animations/Animations.Build.cs
index 175edbbd8..edd70192f 100644
--- a/Source/Engine/Animations/Animations.Build.cs
+++ b/Source/Engine/Animations/Animations.Build.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using Flax.Build;
using Flax.Build.NativeCpp;
diff --git a/Source/Engine/Animations/Config.h b/Source/Engine/Animations/Config.h
index 3b7d34025..6f77e4532 100644
--- a/Source/Engine/Animations/Config.h
+++ b/Source/Engine/Animations/Config.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/Animations/Curve.cs b/Source/Engine/Animations/Curve.cs
index 3dd3dfd32..d9762d05f 100644
--- a/Source/Engine/Animations/Curve.cs
+++ b/Source/Engine/Animations/Curve.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using System.Collections.Generic;
diff --git a/Source/Engine/Animations/Curve.h b/Source/Engine/Animations/Curve.h
index c14c3b632..8261dea5b 100644
--- a/Source/Engine/Animations/Curve.h
+++ b/Source/Engine/Animations/Curve.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/Animations/Graph/AnimGraph.Base.cpp b/Source/Engine/Animations/Graph/AnimGraph.Base.cpp
index e87bf3221..22b74e6f8 100644
--- a/Source/Engine/Animations/Graph/AnimGraph.Base.cpp
+++ b/Source/Engine/Animations/Graph/AnimGraph.Base.cpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#include "AnimGraph.h"
#include "Engine/Core/Collections/Array.h"
diff --git a/Source/Engine/Animations/Graph/AnimGraph.Custom.cpp b/Source/Engine/Animations/Graph/AnimGraph.Custom.cpp
index 6d98bc8c2..eaa080f9a 100644
--- a/Source/Engine/Animations/Graph/AnimGraph.Custom.cpp
+++ b/Source/Engine/Animations/Graph/AnimGraph.Custom.cpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#include "AnimGraph.h"
#include "Engine/Debug/DebugLog.h"
@@ -178,12 +178,12 @@ bool AnimGraph::InitCustomNode(Node* node)
MMethod* evaluate = type->GetMethod("Evaluate", 1);
if (load == nullptr)
{
- LOG(Warning, "Invalid custom node type {0}. Missng Load method.", typeName);
+ LOG(Warning, "Invalid custom node type {0}. Missing Load method.", typeName);
return false;
}
if (evaluate == nullptr)
{
- LOG(Warning, "Invalid custom node type {0}. Missng Evaluate method.", typeName);
+ LOG(Warning, "Invalid custom node type {0}. Missing Evaluate method.", typeName);
return false;
}
diff --git a/Source/Engine/Animations/Graph/AnimGraph.cpp b/Source/Engine/Animations/Graph/AnimGraph.cpp
index d2175b8d9..2abbb3ff3 100644
--- a/Source/Engine/Animations/Graph/AnimGraph.cpp
+++ b/Source/Engine/Animations/Graph/AnimGraph.cpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#include "AnimGraph.h"
#include "Engine/Engine/Time.h"
@@ -119,8 +119,9 @@ bool AnimGraph::Load(ReadStream* stream, bool loadMeta)
// Register for scripts reloading events (only if using any custom nodes)
// Handle load event always because anim graph asset may be loaded before game scripts
- if (_customNodes.HasItems())
+ if (_customNodes.HasItems() && !_isRegisteredForScriptingEvents)
{
+ _isRegisteredForScriptingEvents = true;
#if USE_EDITOR
Scripting::ScriptsReloading.Bind(this);
Scripting::ScriptsReloaded.Bind(this);
@@ -131,6 +132,19 @@ bool AnimGraph::Load(ReadStream* stream, bool loadMeta)
return false;
}
+AnimGraph::~AnimGraph()
+{
+ // Unregister for scripts reloading events (only if using any custom nodes)
+ if (_isRegisteredForScriptingEvents)
+ {
+#if USE_EDITOR
+ Scripting::ScriptsReloading.Unbind(this);
+ Scripting::ScriptsReloaded.Unbind(this);
+#endif
+ Scripting::ScriptsLoaded.Unbind(this);
+ }
+}
+
bool AnimGraph::onParamCreated(Parameter* p)
{
if (p->Identifier == ANIM_GRAPH_PARAM_BASE_MODEL_ID)
diff --git a/Source/Engine/Animations/Graph/AnimGraph.h b/Source/Engine/Animations/Graph/AnimGraph.h
index 50f691949..714f6e9b8 100644
--- a/Source/Engine/Animations/Graph/AnimGraph.h
+++ b/Source/Engine/Animations/Graph/AnimGraph.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
@@ -311,7 +311,7 @@ public:
public:
///
- /// The instance data version number. Used to sync the Anim Graph data with the instance state. Handles Anim Graph reloads to enure data is valid.
+ /// The instance data version number. Used to sync the Anim Graph data with the instance state. Handles Anim Graph reloads to ensure data is valid.
///
uint32 Version = 0;
@@ -443,7 +443,7 @@ public:
struct MultiBlend1DData
{
///
- /// The computed length of the mixes animations. Shared for all blend points to provide mor stabilization during looped playback.
+ /// The computed length of the mixes animations. Shared for all blend points to provide more stabilization during looped playback.
///
float Length;
@@ -456,7 +456,7 @@ public:
struct MultiBlend2DData
{
///
- /// The computed length of the mixes animations. Shared for all blend points to provide mor stabilization during looped playback.
+ /// The computed length of the mixes animations. Shared for all blend points to provide more stabilization during looped playback.
///
float Length;
@@ -733,7 +733,7 @@ private:
typedef void (*InitBucketHandler)(AnimGraphInstanceData::Bucket&);
- bool _isFunction;
+ bool _isFunction, _isRegisteredForScriptingEvents;
int32 _bucketsCounter;
Array _bucketInitializerList;
Array _customNodes;
@@ -751,13 +751,16 @@ public:
, _isFunction(isFunction)
, _bucketInitializerList(64)
, _owner(owner)
+ , _isRegisteredForScriptingEvents(false)
{
}
+ ~AnimGraph();
+
public:
///
- /// The Anim Graph data version number. Used to sync the Anim Graph data with the instances state. Handles Anim Graph reloads to enure data is valid.
+ /// The Anim Graph data version number. Used to sync the Anim Graph data with the instances state. Handles Anim Graph reloads to ensure data is valid.
///
uint32 Version = 0;
@@ -834,7 +837,7 @@ private:
public:
#if USE_EDITOR
- // Custom event that is called every time the Anim Graph signal flows over the graph (including the data connections). Can be used to read nad visualize the animation blending logic.
+ // Custom event that is called every time the Anim Graph signal flows over the graph (including the data connections). Can be used to read and visualize the animation blending logic.
static Delegate DebugFlow;
#endif
diff --git a/Source/Engine/Animations/Graph/AnimGroup.Animation.cpp b/Source/Engine/Animations/Graph/AnimGroup.Animation.cpp
index 83e6476db..8f43506d2 100644
--- a/Source/Engine/Animations/Graph/AnimGroup.Animation.cpp
+++ b/Source/Engine/Animations/Graph/AnimGroup.Animation.cpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#include "AnimGraph.h"
#include "Engine/Content/Assets/Animation.h"
diff --git a/Source/Engine/Animations/InverseKinematics.cpp b/Source/Engine/Animations/InverseKinematics.cpp
index 40985d040..d66994318 100644
--- a/Source/Engine/Animations/InverseKinematics.cpp
+++ b/Source/Engine/Animations/InverseKinematics.cpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#include "InverseKinematics.h"
@@ -17,7 +17,7 @@ void InverseKinematics::SolveTwoBoneIK(Transform& rootNode, Transform& jointNode
Vector3 jointPos = jointNode.Translation;
Vector3 desiredDelta = target - rootNode.Translation;
float desiredLength = desiredDelta.Length();
- float maxLimbLength = lowerLimbLength + upperLimbLength;
+ float limbLengthLimit = lowerLimbLength + upperLimbLength;
Vector3 desiredDir;
if (desiredLength < ZeroTolerance)
@@ -56,17 +56,17 @@ void InverseKinematics::SolveTwoBoneIK(Transform& rootNode, Transform& jointNode
if (allowStretching)
{
- const float startStretchRatio = 1.0f;
- const float scaleRange = maxStretchScale - startStretchRatio;
- if (scaleRange > ZeroTolerance && maxLimbLength > ZeroTolerance)
+ const float initialStretchRatio = 1.0f;
+ const float range = maxStretchScale - initialStretchRatio;
+ if (range > ZeroTolerance && limbLengthLimit > ZeroTolerance)
{
- const float reachRatio = desiredLength / maxLimbLength;
- const float scalingFactor = (maxStretchScale - 1.0f) * Math::Saturate((reachRatio - startStretchRatio) / scaleRange);
+ const float reachRatio = desiredLength / limbLengthLimit;
+ const float scalingFactor = (maxStretchScale - 1.0f) * Math::Saturate((reachRatio - initialStretchRatio) / range);
if (scalingFactor > ZeroTolerance)
{
lowerLimbLength *= 1.0f + scalingFactor;
upperLimbLength *= 1.0f + scalingFactor;
- maxLimbLength *= 1.0f + scalingFactor;
+ limbLengthLimit *= 1.0f + scalingFactor;
}
}
}
@@ -74,9 +74,9 @@ void InverseKinematics::SolveTwoBoneIK(Transform& rootNode, Transform& jointNode
Vector3 resultEndPos = target;
Vector3 resultJointPos = jointPos;
- if (desiredLength >= maxLimbLength)
+ if (desiredLength >= limbLengthLimit)
{
- resultEndPos = rootNode.Translation + maxLimbLength * desiredDir;
+ resultEndPos = rootNode.Translation + limbLengthLimit * desiredDir;
resultJointPos = rootNode.Translation + upperLimbLength * desiredDir;
}
else
diff --git a/Source/Engine/Animations/InverseKinematics.h b/Source/Engine/Animations/InverseKinematics.h
index 37e6d710f..255624221 100644
--- a/Source/Engine/Animations/InverseKinematics.h
+++ b/Source/Engine/Animations/InverseKinematics.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
@@ -29,7 +29,7 @@ public:
/// The end node transformation (in model space).
/// The target position of the end node to reach (in model space).
/// The target position of the middle node to face into (in model space).
- /// True if allow bones stretching, otherwise bone lengths will be preserved when trying to reach teh target.
+ /// True if allow bones stretching, otherwise bone lengths will be preserved when trying to reach the target.
/// The maximum scale when stretching bones. Used only if allowStretching is true.
static void SolveTwoBoneIK(Transform& rootNode, Transform& jointNode, Transform& targetNode, const Vector3& target, const Vector3& jointTarget, bool allowStretching = false, float maxStretchScale = 1.5f);
};
diff --git a/Source/Engine/Animations/SceneAnimations/SceneAnimation.cpp b/Source/Engine/Animations/SceneAnimations/SceneAnimation.cpp
index aa9adccb6..1693a8f4d 100644
--- a/Source/Engine/Animations/SceneAnimations/SceneAnimation.cpp
+++ b/Source/Engine/Animations/SceneAnimations/SceneAnimation.cpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#include "SceneAnimation.h"
#include "Engine/Content/Factories/BinaryAssetFactory.h"
@@ -289,7 +289,7 @@ Asset::LoadResult SceneAnimation::load()
trackRuntime->DataType = CurvePropertyTrack::DataTypes::Color32;
if (trackRuntime->DataType == CurvePropertyTrack::DataTypes::Unknown)
{
- LOG(Warning, "Unknwon curve animation property type {2} for the track {1}, type {0}.", (int32)track.Type, track.Name, String(trackRuntime->PropertyTypeName));
+ LOG(Warning, "Unknown curve animation property type {2} for the track {1}, type {0}.", (int32)track.Type, track.Name, String(trackRuntime->PropertyTypeName));
track.Disabled = true;
}
needsParent = true;
diff --git a/Source/Engine/Animations/SceneAnimations/SceneAnimation.h b/Source/Engine/Animations/SceneAnimations/SceneAnimation.h
index cd14fdcae..3961edf79 100644
--- a/Source/Engine/Animations/SceneAnimations/SceneAnimation.h
+++ b/Source/Engine/Animations/SceneAnimations/SceneAnimation.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
@@ -102,7 +102,7 @@ public:
void* Data;
///
- /// The track dependant data (from the shared runtime allocation).
+ /// The track dependent data (from the shared runtime allocation).
///
void* RuntimeData;
diff --git a/Source/Engine/Animations/SceneAnimations/SceneAnimationPlayer.cpp b/Source/Engine/Animations/SceneAnimations/SceneAnimationPlayer.cpp
index 231914c5f..09b7cf874 100644
--- a/Source/Engine/Animations/SceneAnimations/SceneAnimationPlayer.cpp
+++ b/Source/Engine/Animations/SceneAnimations/SceneAnimationPlayer.cpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#include "SceneAnimationPlayer.h"
#include "Engine/Core/Random.h"
diff --git a/Source/Engine/Animations/SceneAnimations/SceneAnimationPlayer.h b/Source/Engine/Animations/SceneAnimations/SceneAnimationPlayer.h
index 31a6f9757..8015ab067 100644
--- a/Source/Engine/Animations/SceneAnimations/SceneAnimationPlayer.h
+++ b/Source/Engine/Animations/SceneAnimations/SceneAnimationPlayer.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
@@ -129,7 +129,7 @@ public:
public:
///
- /// Gets the value that determinates whether the scene animation is playing.
+ /// Gets the value that determines whether the scene animation is playing.
///
API_PROPERTY() FORCE_INLINE bool IsPlaying() const
{
@@ -137,7 +137,7 @@ public:
}
///
- /// Gets the value that determinates whether the scene animation is paused.
+ /// Gets the value that determines whether the scene animation is paused.
///
API_PROPERTY() FORCE_INLINE bool IsPaused() const
{
@@ -145,7 +145,7 @@ public:
}
///
- /// Gets the value that determinates whether the scene animation is stopped.
+ /// Gets the value that determines whether the scene animation is stopped.
///
API_PROPERTY() FORCE_INLINE bool IsStopped() const
{
diff --git a/Source/Engine/Audio/Audio.Build.cs b/Source/Engine/Audio/Audio.Build.cs
index 0ef5d8e5e..d4b63e82b 100644
--- a/Source/Engine/Audio/Audio.Build.cs
+++ b/Source/Engine/Audio/Audio.Build.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System.Collections.Generic;
using System.IO;
diff --git a/Source/Engine/Audio/Audio.cpp b/Source/Engine/Audio/Audio.cpp
index eb7837327..1dd0393b4 100644
--- a/Source/Engine/Audio/Audio.cpp
+++ b/Source/Engine/Audio/Audio.cpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#include "Audio.h"
#include "AudioBackend.h"
@@ -127,7 +127,7 @@ void Audio::OnAddListener(AudioListener* listener)
if (Listeners.Count() >= AUDIO_MAX_LISTENERS)
{
- LOG(Error, "Unsupported amount of the audio listneres!");
+ LOG(Error, "Unsupported amount of the audio listeners!");
return;
}
diff --git a/Source/Engine/Audio/Audio.h b/Source/Engine/Audio/Audio.h
index 5c04fddc1..1cc7b87ce 100644
--- a/Source/Engine/Audio/Audio.h
+++ b/Source/Engine/Audio/Audio.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/Audio/AudioBackend.h b/Source/Engine/Audio/AudioBackend.h
index 24e4ad605..00b25f471 100644
--- a/Source/Engine/Audio/AudioBackend.h
+++ b/Source/Engine/Audio/AudioBackend.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/Audio/AudioClip.cpp b/Source/Engine/Audio/AudioClip.cpp
index de8e4e893..4005e46b9 100644
--- a/Source/Engine/Audio/AudioClip.cpp
+++ b/Source/Engine/Audio/AudioClip.cpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#include "AudioClip.h"
#include "Audio.h"
diff --git a/Source/Engine/Audio/AudioClip.h b/Source/Engine/Audio/AudioClip.h
index b0f0ebe21..94aaa57b5 100644
--- a/Source/Engine/Audio/AudioClip.h
+++ b/Source/Engine/Audio/AudioClip.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/Audio/AudioDevice.h b/Source/Engine/Audio/AudioDevice.h
index 0c3c1d1f5..4e7b5388b 100644
--- a/Source/Engine/Audio/AudioDevice.h
+++ b/Source/Engine/Audio/AudioDevice.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/Audio/AudioListener.cpp b/Source/Engine/Audio/AudioListener.cpp
index abe664139..40e7bac3e 100644
--- a/Source/Engine/Audio/AudioListener.cpp
+++ b/Source/Engine/Audio/AudioListener.cpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#include "AudioListener.h"
#include "Engine/Engine/Time.h"
diff --git a/Source/Engine/Audio/AudioListener.h b/Source/Engine/Audio/AudioListener.h
index 25f84012d..1302d6aab 100644
--- a/Source/Engine/Audio/AudioListener.h
+++ b/Source/Engine/Audio/AudioListener.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/Audio/AudioSettings.h b/Source/Engine/Audio/AudioSettings.h
index 388e901b5..2f73e3d1d 100644
--- a/Source/Engine/Audio/AudioSettings.h
+++ b/Source/Engine/Audio/AudioSettings.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
@@ -19,7 +19,7 @@ public:
bool DisableAudio = false;
///
- /// The doppler doppler effect factor. Scale for source and listener velocities. Default is 1.
+ /// The doppler effect factor. Scale for source and listener velocities. Default is 1.
///
float DopplerFactor = 1.0f;
diff --git a/Source/Engine/Audio/AudioSource.cpp b/Source/Engine/Audio/AudioSource.cpp
index 8bdcc8f2e..e85722e32 100644
--- a/Source/Engine/Audio/AudioSource.cpp
+++ b/Source/Engine/Audio/AudioSource.cpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#include "AudioSource.h"
#include "Engine/Level/SceneObjectsFactory.h"
diff --git a/Source/Engine/Audio/AudioSource.h b/Source/Engine/Audio/AudioSource.h
index d259278bd..ac15b5a4b 100644
--- a/Source/Engine/Audio/AudioSource.h
+++ b/Source/Engine/Audio/AudioSource.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
@@ -196,7 +196,7 @@ public:
API_FUNCTION() void Stop();
///
- /// Gets the the current state of the audio playback (playing/paused/stopped).
+ /// Gets the current state of the audio playback (playing/paused/stopped).
///
/// The value.
API_PROPERTY() FORCE_INLINE States GetState() const
diff --git a/Source/Engine/Audio/Config.h b/Source/Engine/Audio/Config.h
index b5f137ce1..c33a0d40b 100644
--- a/Source/Engine/Audio/Config.h
+++ b/Source/Engine/Audio/Config.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/Audio/None/AudioBackendNone.cpp b/Source/Engine/Audio/None/AudioBackendNone.cpp
index 20ff05f67..1a2abb7c3 100644
--- a/Source/Engine/Audio/None/AudioBackendNone.cpp
+++ b/Source/Engine/Audio/None/AudioBackendNone.cpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#if AUDIO_API_NONE
diff --git a/Source/Engine/Audio/None/AudioBackendNone.h b/Source/Engine/Audio/None/AudioBackendNone.h
index e33c50bc4..a0bb43a70 100644
--- a/Source/Engine/Audio/None/AudioBackendNone.h
+++ b/Source/Engine/Audio/None/AudioBackendNone.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/Audio/OpenAL/AudioBackendOAL.cpp b/Source/Engine/Audio/OpenAL/AudioBackendOAL.cpp
index 8ff038375..e06ab35aa 100644
--- a/Source/Engine/Audio/OpenAL/AudioBackendOAL.cpp
+++ b/Source/Engine/Audio/OpenAL/AudioBackendOAL.cpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#if AUDIO_API_OPENAL
diff --git a/Source/Engine/Audio/OpenAL/AudioBackendOAL.h b/Source/Engine/Audio/OpenAL/AudioBackendOAL.h
index b73a660c8..22998c8e8 100644
--- a/Source/Engine/Audio/OpenAL/AudioBackendOAL.h
+++ b/Source/Engine/Audio/OpenAL/AudioBackendOAL.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/Audio/Types.h b/Source/Engine/Audio/Types.h
index ce6fcb18d..7ae2f0d34 100644
--- a/Source/Engine/Audio/Types.h
+++ b/Source/Engine/Audio/Types.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/Audio/XAudio2/AudioBackendXAudio2.cpp b/Source/Engine/Audio/XAudio2/AudioBackendXAudio2.cpp
index 1f9b6c2db..a201253ac 100644
--- a/Source/Engine/Audio/XAudio2/AudioBackendXAudio2.cpp
+++ b/Source/Engine/Audio/XAudio2/AudioBackendXAudio2.cpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#if AUDIO_API_XAUDIO2
diff --git a/Source/Engine/Audio/XAudio2/AudioBackendXAudio2.h b/Source/Engine/Audio/XAudio2/AudioBackendXAudio2.h
index 7ce31f45f..beb612ee4 100644
--- a/Source/Engine/Audio/XAudio2/AudioBackendXAudio2.h
+++ b/Source/Engine/Audio/XAudio2/AudioBackendXAudio2.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/CSG/Brush.h b/Source/Engine/CSG/Brush.h
index 97b4bb94f..55784fa92 100644
--- a/Source/Engine/CSG/Brush.h
+++ b/Source/Engine/CSG/Brush.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/CSG/CSG.Build.cs b/Source/Engine/CSG/CSG.Build.cs
index 7bd6c6763..b61e480cb 100644
--- a/Source/Engine/CSG/CSG.Build.cs
+++ b/Source/Engine/CSG/CSG.Build.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System.Collections.Generic;
using System.IO;
diff --git a/Source/Engine/CSG/CSGBuilder.cpp b/Source/Engine/CSG/CSGBuilder.cpp
index 56de33a1f..fbe40edc8 100644
--- a/Source/Engine/CSG/CSGBuilder.cpp
+++ b/Source/Engine/CSG/CSGBuilder.cpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#include "CSGBuilder.h"
#include "CSGMesh.h"
diff --git a/Source/Engine/CSG/CSGBuilder.h b/Source/Engine/CSG/CSGBuilder.h
index bf446ff91..18b0bdedb 100644
--- a/Source/Engine/CSG/CSGBuilder.h
+++ b/Source/Engine/CSG/CSGBuilder.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/CSG/CSGData.cpp b/Source/Engine/CSG/CSGData.cpp
index 08792f5d0..253179f1d 100644
--- a/Source/Engine/CSG/CSGData.cpp
+++ b/Source/Engine/CSG/CSGData.cpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#include "CSGData.h"
#include "Brush.h"
diff --git a/Source/Engine/CSG/CSGData.h b/Source/Engine/CSG/CSGData.h
index f2a44fb15..dc91256fb 100644
--- a/Source/Engine/CSG/CSGData.h
+++ b/Source/Engine/CSG/CSGData.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/CSG/CSGMesh.Build.cpp b/Source/Engine/CSG/CSGMesh.Build.cpp
index 53d634c88..8151732b9 100644
--- a/Source/Engine/CSG/CSGMesh.Build.cpp
+++ b/Source/Engine/CSG/CSGMesh.Build.cpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#include "CSGMesh.h"
diff --git a/Source/Engine/CSG/CSGMesh.Split.cpp b/Source/Engine/CSG/CSGMesh.Split.cpp
index 046b63a96..7241d0ede 100644
--- a/Source/Engine/CSG/CSGMesh.Split.cpp
+++ b/Source/Engine/CSG/CSGMesh.Split.cpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#include "CSGMesh.h"
diff --git a/Source/Engine/CSG/CSGMesh.Triangulate.cpp b/Source/Engine/CSG/CSGMesh.Triangulate.cpp
index 7f2d30628..bb814653b 100644
--- a/Source/Engine/CSG/CSGMesh.Triangulate.cpp
+++ b/Source/Engine/CSG/CSGMesh.Triangulate.cpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#include "CSGMesh.h"
diff --git a/Source/Engine/CSG/CSGMesh.cpp b/Source/Engine/CSG/CSGMesh.cpp
index bb1de1a50..cc4897d3a 100644
--- a/Source/Engine/CSG/CSGMesh.cpp
+++ b/Source/Engine/CSG/CSGMesh.cpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#include "CSGMesh.h"
diff --git a/Source/Engine/CSG/CSGMesh.h b/Source/Engine/CSG/CSGMesh.h
index 4576e6ce8..598ce5bcc 100644
--- a/Source/Engine/CSG/CSGMesh.h
+++ b/Source/Engine/CSG/CSGMesh.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/CSG/HalfEdge.h b/Source/Engine/CSG/HalfEdge.h
index ebdb84a1b..3a054aff0 100644
--- a/Source/Engine/CSG/HalfEdge.h
+++ b/Source/Engine/CSG/HalfEdge.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/CSG/Polygon.h b/Source/Engine/CSG/Polygon.h
index 5ea586f7f..de9407907 100644
--- a/Source/Engine/CSG/Polygon.h
+++ b/Source/Engine/CSG/Polygon.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/CSG/Types.h b/Source/Engine/CSG/Types.h
index 153c23eec..e9c05c4e9 100644
--- a/Source/Engine/CSG/Types.h
+++ b/Source/Engine/CSG/Types.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/Content/Asset.cpp b/Source/Engine/Content/Asset.cpp
index 13e7976e4..5f11cfb54 100644
--- a/Source/Engine/Content/Asset.cpp
+++ b/Source/Engine/Content/Asset.cpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#include "Asset.h"
#include "Content.h"
diff --git a/Source/Engine/Content/Asset.cs b/Source/Engine/Content/Asset.cs
index 4387448dd..4e52cca84 100644
--- a/Source/Engine/Content/Asset.cs
+++ b/Source/Engine/Content/Asset.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
namespace FlaxEngine
{
diff --git a/Source/Engine/Content/Asset.h b/Source/Engine/Content/Asset.h
index 3485a0739..fb62e659c 100644
--- a/Source/Engine/Content/Asset.h
+++ b/Source/Engine/Content/Asset.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/Content/AssetInfo.h b/Source/Engine/Content/AssetInfo.h
index 74c6474ee..ba8d6cd89 100644
--- a/Source/Engine/Content/AssetInfo.h
+++ b/Source/Engine/Content/AssetInfo.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/Content/AssetReference.h b/Source/Engine/Content/AssetReference.h
index 066ac5d85..c78aa5aef 100644
--- a/Source/Engine/Content/AssetReference.h
+++ b/Source/Engine/Content/AssetReference.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/Content/Assets/Animation.cpp b/Source/Engine/Content/Assets/Animation.cpp
index 9c85a000a..c6927530e 100644
--- a/Source/Engine/Content/Assets/Animation.cpp
+++ b/Source/Engine/Content/Assets/Animation.cpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#include "Animation.h"
#include "SkinnedModel.h"
diff --git a/Source/Engine/Content/Assets/Animation.h b/Source/Engine/Content/Assets/Animation.h
index e21c226c9..6ce114867 100644
--- a/Source/Engine/Content/Assets/Animation.h
+++ b/Source/Engine/Content/Assets/Animation.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/Content/Assets/AnimationGraph.cpp b/Source/Engine/Content/Assets/AnimationGraph.cpp
index 2a30d1963..2c0a1c803 100644
--- a/Source/Engine/Content/Assets/AnimationGraph.cpp
+++ b/Source/Engine/Content/Assets/AnimationGraph.cpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#include "AnimationGraph.h"
#if USE_EDITOR
diff --git a/Source/Engine/Content/Assets/AnimationGraph.h b/Source/Engine/Content/Assets/AnimationGraph.h
index 2c5a39745..486e02a55 100644
--- a/Source/Engine/Content/Assets/AnimationGraph.h
+++ b/Source/Engine/Content/Assets/AnimationGraph.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/Content/Assets/AnimationGraphFunction.cpp b/Source/Engine/Content/Assets/AnimationGraphFunction.cpp
index 56601a967..7674d93bc 100644
--- a/Source/Engine/Content/Assets/AnimationGraphFunction.cpp
+++ b/Source/Engine/Content/Assets/AnimationGraphFunction.cpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#include "AnimationGraphFunction.h"
#include "Engine/Core/Log.h"
diff --git a/Source/Engine/Content/Assets/AnimationGraphFunction.h b/Source/Engine/Content/Assets/AnimationGraphFunction.h
index eb7555378..6a046ff9a 100644
--- a/Source/Engine/Content/Assets/AnimationGraphFunction.h
+++ b/Source/Engine/Content/Assets/AnimationGraphFunction.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/Content/Assets/CubeTexture.cpp b/Source/Engine/Content/Assets/CubeTexture.cpp
index d43092419..084955a88 100644
--- a/Source/Engine/Content/Assets/CubeTexture.cpp
+++ b/Source/Engine/Content/Assets/CubeTexture.cpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#include "CubeTexture.h"
#include "Engine/Content/Factories/BinaryAssetFactory.h"
diff --git a/Source/Engine/Content/Assets/CubeTexture.h b/Source/Engine/Content/Assets/CubeTexture.h
index da472afe0..be9c1cdd3 100644
--- a/Source/Engine/Content/Assets/CubeTexture.h
+++ b/Source/Engine/Content/Assets/CubeTexture.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/Content/Assets/IESProfile.cpp b/Source/Engine/Content/Assets/IESProfile.cpp
index dfa39863f..34f0c59c1 100644
--- a/Source/Engine/Content/Assets/IESProfile.cpp
+++ b/Source/Engine/Content/Assets/IESProfile.cpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#include "IESProfile.h"
#include "Engine/Content/Factories/BinaryAssetFactory.h"
diff --git a/Source/Engine/Content/Assets/IESProfile.h b/Source/Engine/Content/Assets/IESProfile.h
index e9b39944a..bbf694769 100644
--- a/Source/Engine/Content/Assets/IESProfile.h
+++ b/Source/Engine/Content/Assets/IESProfile.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/Content/Assets/Material.cpp b/Source/Engine/Content/Assets/Material.cpp
index d019a5bfe..b40e1e9c0 100644
--- a/Source/Engine/Content/Assets/Material.cpp
+++ b/Source/Engine/Content/Assets/Material.cpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#include "Material.h"
#include "Engine/Core/Log.h"
diff --git a/Source/Engine/Content/Assets/Material.h b/Source/Engine/Content/Assets/Material.h
index e398e6c79..bdaba7abb 100644
--- a/Source/Engine/Content/Assets/Material.h
+++ b/Source/Engine/Content/Assets/Material.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/Content/Assets/MaterialBase.cpp b/Source/Engine/Content/Assets/MaterialBase.cpp
index de8a33de6..3b2a039db 100644
--- a/Source/Engine/Content/Assets/MaterialBase.cpp
+++ b/Source/Engine/Content/Assets/MaterialBase.cpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#include "MaterialBase.h"
#include "MaterialInstance.h"
diff --git a/Source/Engine/Content/Assets/MaterialBase.h b/Source/Engine/Content/Assets/MaterialBase.h
index 34ebb7632..23c2fb747 100644
--- a/Source/Engine/Content/Assets/MaterialBase.h
+++ b/Source/Engine/Content/Assets/MaterialBase.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/Content/Assets/MaterialFunction.cpp b/Source/Engine/Content/Assets/MaterialFunction.cpp
index e7da442cb..97af31960 100644
--- a/Source/Engine/Content/Assets/MaterialFunction.cpp
+++ b/Source/Engine/Content/Assets/MaterialFunction.cpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#include "MaterialFunction.h"
#if COMPILE_WITH_MATERIAL_GRAPH
diff --git a/Source/Engine/Content/Assets/MaterialFunction.h b/Source/Engine/Content/Assets/MaterialFunction.h
index a37780e9f..755b42359 100644
--- a/Source/Engine/Content/Assets/MaterialFunction.h
+++ b/Source/Engine/Content/Assets/MaterialFunction.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/Content/Assets/MaterialInstance.cpp b/Source/Engine/Content/Assets/MaterialInstance.cpp
index bbf0d8098..ace2fcee9 100644
--- a/Source/Engine/Content/Assets/MaterialInstance.cpp
+++ b/Source/Engine/Content/Assets/MaterialInstance.cpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#include "MaterialInstance.h"
#include "Engine/Core/Types/Variant.h"
diff --git a/Source/Engine/Content/Assets/MaterialInstance.h b/Source/Engine/Content/Assets/MaterialInstance.h
index f07ca9ee7..9fe92e39c 100644
--- a/Source/Engine/Content/Assets/MaterialInstance.h
+++ b/Source/Engine/Content/Assets/MaterialInstance.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/Content/Assets/Model.cpp b/Source/Engine/Content/Assets/Model.cpp
index 1bb0d78e0..897e589a8 100644
--- a/Source/Engine/Content/Assets/Model.cpp
+++ b/Source/Engine/Content/Assets/Model.cpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#include "Model.h"
#include "Engine/Core/Log.h"
diff --git a/Source/Engine/Content/Assets/Model.h b/Source/Engine/Content/Assets/Model.h
index 60033ba0f..e96b47d90 100644
--- a/Source/Engine/Content/Assets/Model.h
+++ b/Source/Engine/Content/Assets/Model.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/Content/Assets/ModelBase.h b/Source/Engine/Content/Assets/ModelBase.h
index f82ab0976..ebf05570d 100644
--- a/Source/Engine/Content/Assets/ModelBase.h
+++ b/Source/Engine/Content/Assets/ModelBase.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/Content/Assets/RawDataAsset.cpp b/Source/Engine/Content/Assets/RawDataAsset.cpp
index 2fe461f5b..f93395579 100644
--- a/Source/Engine/Content/Assets/RawDataAsset.cpp
+++ b/Source/Engine/Content/Assets/RawDataAsset.cpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#include "RawDataAsset.h"
#include "Engine/Content/Factories/BinaryAssetFactory.h"
diff --git a/Source/Engine/Content/Assets/RawDataAsset.h b/Source/Engine/Content/Assets/RawDataAsset.h
index b69d7e340..683338c5f 100644
--- a/Source/Engine/Content/Assets/RawDataAsset.h
+++ b/Source/Engine/Content/Assets/RawDataAsset.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/Content/Assets/Shader.cpp b/Source/Engine/Content/Assets/Shader.cpp
index cd7cf0763..929abc933 100644
--- a/Source/Engine/Content/Assets/Shader.cpp
+++ b/Source/Engine/Content/Assets/Shader.cpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#include "Shader.h"
#include "Engine/Core/Log.h"
diff --git a/Source/Engine/Content/Assets/Shader.h b/Source/Engine/Content/Assets/Shader.h
index 75d06b798..b97aafd98 100644
--- a/Source/Engine/Content/Assets/Shader.h
+++ b/Source/Engine/Content/Assets/Shader.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/Content/Assets/SkeletonMask.cpp b/Source/Engine/Content/Assets/SkeletonMask.cpp
index dbaf28818..4747e0e44 100644
--- a/Source/Engine/Content/Assets/SkeletonMask.cpp
+++ b/Source/Engine/Content/Assets/SkeletonMask.cpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#include "SkeletonMask.h"
#include "Engine/Core/Log.h"
diff --git a/Source/Engine/Content/Assets/SkeletonMask.h b/Source/Engine/Content/Assets/SkeletonMask.h
index 7c72d53b8..115e3977a 100644
--- a/Source/Engine/Content/Assets/SkeletonMask.h
+++ b/Source/Engine/Content/Assets/SkeletonMask.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/Content/Assets/SkinnedModel.cpp b/Source/Engine/Content/Assets/SkinnedModel.cpp
index 85fe21ee1..5309cf6b9 100644
--- a/Source/Engine/Content/Assets/SkinnedModel.cpp
+++ b/Source/Engine/Content/Assets/SkinnedModel.cpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#include "SkinnedModel.h"
#include "Engine/Core/Log.h"
diff --git a/Source/Engine/Content/Assets/SkinnedModel.h b/Source/Engine/Content/Assets/SkinnedModel.h
index 5d4c9d361..ce5f5f7ac 100644
--- a/Source/Engine/Content/Assets/SkinnedModel.h
+++ b/Source/Engine/Content/Assets/SkinnedModel.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/Content/Assets/Texture.cpp b/Source/Engine/Content/Assets/Texture.cpp
index bcd00ff53..22c86028a 100644
--- a/Source/Engine/Content/Assets/Texture.cpp
+++ b/Source/Engine/Content/Assets/Texture.cpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#include "Texture.h"
#include "Engine/Content/Content.h"
diff --git a/Source/Engine/Content/Assets/Texture.h b/Source/Engine/Content/Assets/Texture.h
index 3b9a13418..afefc59d2 100644
--- a/Source/Engine/Content/Assets/Texture.h
+++ b/Source/Engine/Content/Assets/Texture.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/Content/Assets/VisualScript.cpp b/Source/Engine/Content/Assets/VisualScript.cpp
index bb27a233e..65a75d1ef 100644
--- a/Source/Engine/Content/Assets/VisualScript.cpp
+++ b/Source/Engine/Content/Assets/VisualScript.cpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#include "VisualScript.h"
#include "Engine/Core/Log.h"
diff --git a/Source/Engine/Content/Assets/VisualScript.h b/Source/Engine/Content/Assets/VisualScript.h
index eeff52062..0a7f34b1c 100644
--- a/Source/Engine/Content/Assets/VisualScript.h
+++ b/Source/Engine/Content/Assets/VisualScript.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
@@ -370,7 +370,7 @@ public:
///
/// Gets the current stack trace of the current thread Visual Script execution.
///
- /// The the stack trace string.
+ /// The stack trace string.
static String GetStackTrace();
///
diff --git a/Source/Engine/Content/BinaryAsset.cpp b/Source/Engine/Content/BinaryAsset.cpp
index 0572a50b1..7160cb287 100644
--- a/Source/Engine/Content/BinaryAsset.cpp
+++ b/Source/Engine/Content/BinaryAsset.cpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#include "BinaryAsset.h"
#include "Storage/ContentStorageManager.h"
@@ -118,16 +118,16 @@ void BinaryAsset::GetImportMetadata(String& path, String& username) const
}
// Parse metadata and try to get import info
- rapidjson_flax::Document doc;
- doc.Parse((const char*)Metadata.Get(), Metadata.Length());
- if (doc.HasParseError() == false)
+ rapidjson_flax::Document document;
+ document.Parse((const char*)Metadata.Get(), Metadata.Length());
+ if (document.HasParseError() == false)
{
- path = JsonTools::GetString(doc, "ImportPath");
- username = JsonTools::GetString(doc, "ImportUsername");
+ path = JsonTools::GetString(document, "ImportPath");
+ username = JsonTools::GetString(document, "ImportUsername");
}
else
{
- Log::JsonParseException(doc.GetParseError(), GetPath());
+ Log::JsonParseException(document.GetParseError(), document.GetErrorOffset(), GetPath());
}
}
diff --git a/Source/Engine/Content/BinaryAsset.h b/Source/Engine/Content/BinaryAsset.h
index 7bac40a18..c533399d2 100644
--- a/Source/Engine/Content/BinaryAsset.h
+++ b/Source/Engine/Content/BinaryAsset.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/Content/Cache/AssetsCache.cpp b/Source/Engine/Content/Cache/AssetsCache.cpp
index dee2c7155..049064b63 100644
--- a/Source/Engine/Content/Cache/AssetsCache.cpp
+++ b/Source/Engine/Content/Cache/AssetsCache.cpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#include "AssetsCache.h"
#include "Engine/Core/Log.h"
@@ -346,7 +346,7 @@ void AssetsCache::RegisterAssets(FlaxStorage* storage)
// Check if storage contains ID which has been already registered
if (FindAsset(e.ID, info))
{
- LOG(Warning, "Founded dupplicated asset \'{0}\'. Locations: \'{1}\' and \'{2}\'", e.ID, storagePath, info.Path);
+ LOG(Warning, "Founded duplicated asset \'{0}\'. Locations: \'{1}\' and \'{2}\'", e.ID, storagePath, info.Path);
duplicatedEntries.Add(i);
}
}
diff --git a/Source/Engine/Content/Cache/AssetsCache.h b/Source/Engine/Content/Cache/AssetsCache.h
index 5205701e5..ba0ee0303 100644
--- a/Source/Engine/Content/Cache/AssetsCache.h
+++ b/Source/Engine/Content/Cache/AssetsCache.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/Content/Config.h b/Source/Engine/Content/Config.h
index 8025bff2e..6f23dd40f 100644
--- a/Source/Engine/Content/Config.h
+++ b/Source/Engine/Content/Config.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/Content/Content.Build.cs b/Source/Engine/Content/Content.Build.cs
index 9468c6bb6..372222b22 100644
--- a/Source/Engine/Content/Content.Build.cs
+++ b/Source/Engine/Content/Content.Build.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System.Collections.Generic;
using System.IO;
diff --git a/Source/Engine/Content/Content.cpp b/Source/Engine/Content/Content.cpp
index 78d0ff1d6..c56c2e658 100644
--- a/Source/Engine/Content/Content.cpp
+++ b/Source/Engine/Content/Content.cpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#include "Content.h"
#include "JsonAsset.h"
@@ -574,17 +574,21 @@ bool Content::RenameAsset(const StringView& oldPath, const StringView& newPath)
Asset* newAsset = GetAsset(newPath);
// Validate name
- if (newAsset != nullptr || FileSystem::FileExists(newPath))
+ if (newAsset != nullptr && newAsset != oldAsset)
{
LOG(Error, "Invalid name '{0}' when trying to rename '{1}'.", newPath, oldPath);
return true;
}
- // Check if is create
+ // Ensure asset is ready for renaming
if (oldAsset)
{
// Wait for data loaded
- oldAsset->WaitForLoaded();
+ if (oldAsset->WaitForLoaded())
+ {
+ LOG(Error, "Failed to load asset '{0}'.", oldAsset->ToString());
+ return true;
+ }
// Unload
// Don't unload asset fully, only release ref to file, don't call OnUnload so managed asset and all refs will remain alive
diff --git a/Source/Engine/Content/Content.cs b/Source/Engine/Content/Content.cs
index 54021dd1d..168de5742 100644
--- a/Source/Engine/Content/Content.cs
+++ b/Source/Engine/Content/Content.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using System.Runtime.CompilerServices;
diff --git a/Source/Engine/Content/Content.h b/Source/Engine/Content/Content.h
index 939858764..a690e4e30 100644
--- a/Source/Engine/Content/Content.h
+++ b/Source/Engine/Content/Content.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/Content/Factories/BinaryAssetFactory.cpp b/Source/Engine/Content/Factories/BinaryAssetFactory.cpp
index 0691eb769..6eee4eaa2 100644
--- a/Source/Engine/Content/Factories/BinaryAssetFactory.cpp
+++ b/Source/Engine/Content/Factories/BinaryAssetFactory.cpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#include "BinaryAssetFactory.h"
#include "../BinaryAsset.h"
diff --git a/Source/Engine/Content/Factories/BinaryAssetFactory.h b/Source/Engine/Content/Factories/BinaryAssetFactory.h
index c76bc19e3..25dd38aeb 100644
--- a/Source/Engine/Content/Factories/BinaryAssetFactory.h
+++ b/Source/Engine/Content/Factories/BinaryAssetFactory.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/Content/Factories/IAssetFactory.h b/Source/Engine/Content/Factories/IAssetFactory.h
index 666a4d38f..dbc7b1e90 100644
--- a/Source/Engine/Content/Factories/IAssetFactory.h
+++ b/Source/Engine/Content/Factories/IAssetFactory.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
@@ -42,7 +42,7 @@ public:
public:
///
- /// Determinates whenever the virtual assets are supported by this asset tpe factory.
+ /// Determines whenever the virtual assets are supported by this asset tpe factory.
///
/// True if can create virtual assets, otherwise false.
virtual bool SupportsVirtualAssets() const
diff --git a/Source/Engine/Content/Factories/JsonAssetFactory.h b/Source/Engine/Content/Factories/JsonAssetFactory.h
index a1da716ec..0269ec596 100644
--- a/Source/Engine/Content/Factories/JsonAssetFactory.h
+++ b/Source/Engine/Content/Factories/JsonAssetFactory.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/Content/JsonAsset.cpp b/Source/Engine/Content/JsonAsset.cpp
index 4e1f90d70..3612a88b8 100644
--- a/Source/Engine/Content/JsonAsset.cpp
+++ b/Source/Engine/Content/JsonAsset.cpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#include "JsonAsset.h"
#include "Storage/ContentStorageManager.h"
@@ -128,7 +128,7 @@ Asset::LoadResult JsonAssetBase::loadAsset()
Document.Parse(data.Get(), data.Length());
if (Document.HasParseError())
{
- Log::JsonParseException(Document.GetParseError());
+ Log::JsonParseException(Document.GetParseError(), Document.GetErrorOffset());
return LoadResult::CannotLoadData;
}
diff --git a/Source/Engine/Content/JsonAsset.cs b/Source/Engine/Content/JsonAsset.cs
index a378c9a60..fb9ebe9f9 100644
--- a/Source/Engine/Content/JsonAsset.cs
+++ b/Source/Engine/Content/JsonAsset.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using FlaxEngine.Json;
diff --git a/Source/Engine/Content/JsonAsset.h b/Source/Engine/Content/JsonAsset.h
index d5f785418..ce617938d 100644
--- a/Source/Engine/Content/JsonAsset.h
+++ b/Source/Engine/Content/JsonAsset.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/Content/Loading/ContentLoadTask.h b/Source/Engine/Content/Loading/ContentLoadTask.h
index 71deafddd..94e8d5ec7 100644
--- a/Source/Engine/Content/Loading/ContentLoadTask.h
+++ b/Source/Engine/Content/Loading/ContentLoadTask.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/Content/Loading/ContentLoadingManager.cpp b/Source/Engine/Content/Loading/ContentLoadingManager.cpp
index 70f982bd5..ac2dd8257 100644
--- a/Source/Engine/Content/Loading/ContentLoadingManager.cpp
+++ b/Source/Engine/Content/Loading/ContentLoadingManager.cpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#include "ContentLoadingManager.h"
#include "ContentLoadTask.h"
diff --git a/Source/Engine/Content/Loading/ContentLoadingManager.h b/Source/Engine/Content/Loading/ContentLoadingManager.h
index 5860e5766..3efeadd58 100644
--- a/Source/Engine/Content/Loading/ContentLoadingManager.h
+++ b/Source/Engine/Content/Loading/ContentLoadingManager.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/Content/Loading/Tasks/LoadAssetDataTask.h b/Source/Engine/Content/Loading/Tasks/LoadAssetDataTask.h
index 2a6b8075b..9d97a439f 100644
--- a/Source/Engine/Content/Loading/Tasks/LoadAssetDataTask.h
+++ b/Source/Engine/Content/Loading/Tasks/LoadAssetDataTask.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/Content/Loading/Tasks/LoadAssetTask.h b/Source/Engine/Content/Loading/Tasks/LoadAssetTask.h
index a939dd663..7eed30399 100644
--- a/Source/Engine/Content/Loading/Tasks/LoadAssetTask.h
+++ b/Source/Engine/Content/Loading/Tasks/LoadAssetTask.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/Content/MaterialBase.cs b/Source/Engine/Content/MaterialBase.cs
index f67ddc126..4d5a3593e 100644
--- a/Source/Engine/Content/MaterialBase.cs
+++ b/Source/Engine/Content/MaterialBase.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
namespace FlaxEngine
{
diff --git a/Source/Engine/Content/SkinnedModel.cs b/Source/Engine/Content/SkinnedModel.cs
index 6af1e53c8..582565085 100644
--- a/Source/Engine/Content/SkinnedModel.cs
+++ b/Source/Engine/Content/SkinnedModel.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
namespace FlaxEngine
{
diff --git a/Source/Engine/Content/Storage/AssetHeader.h b/Source/Engine/Content/Storage/AssetHeader.h
index 5a215c5ee..19609fd2c 100644
--- a/Source/Engine/Content/Storage/AssetHeader.h
+++ b/Source/Engine/Content/Storage/AssetHeader.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/Content/Storage/ContentStorageManager.cpp b/Source/Engine/Content/Storage/ContentStorageManager.cpp
index 9a97fc4d7..1b830458d 100644
--- a/Source/Engine/Content/Storage/ContentStorageManager.cpp
+++ b/Source/Engine/Content/Storage/ContentStorageManager.cpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#include "ContentStorageManager.h"
#include "Engine/Core/Log.h"
diff --git a/Source/Engine/Content/Storage/ContentStorageManager.h b/Source/Engine/Content/Storage/ContentStorageManager.h
index 49ae682b5..91b0522d0 100644
--- a/Source/Engine/Content/Storage/ContentStorageManager.h
+++ b/Source/Engine/Content/Storage/ContentStorageManager.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/Content/Storage/FlaxChunk.h b/Source/Engine/Content/Storage/FlaxChunk.h
index 9a86a64c9..a5af7cc72 100644
--- a/Source/Engine/Content/Storage/FlaxChunk.h
+++ b/Source/Engine/Content/Storage/FlaxChunk.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/Content/Storage/FlaxFile.h b/Source/Engine/Content/Storage/FlaxFile.h
index c92a5700d..0f7cae45c 100644
--- a/Source/Engine/Content/Storage/FlaxFile.h
+++ b/Source/Engine/Content/Storage/FlaxFile.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/Content/Storage/FlaxPackage.cpp b/Source/Engine/Content/Storage/FlaxPackage.cpp
index 54d2c2e6c..4ec920339 100644
--- a/Source/Engine/Content/Storage/FlaxPackage.cpp
+++ b/Source/Engine/Content/Storage/FlaxPackage.cpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#include "FlaxPackage.h"
diff --git a/Source/Engine/Content/Storage/FlaxPackage.h b/Source/Engine/Content/Storage/FlaxPackage.h
index c1507e18a..db61426c2 100644
--- a/Source/Engine/Content/Storage/FlaxPackage.h
+++ b/Source/Engine/Content/Storage/FlaxPackage.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/Content/Storage/FlaxStorage.cpp b/Source/Engine/Content/Storage/FlaxStorage.cpp
index 0a3aac966..99c229544 100644
--- a/Source/Engine/Content/Storage/FlaxStorage.cpp
+++ b/Source/Engine/Content/Storage/FlaxStorage.cpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#include "FlaxStorage.h"
#include "ContentStorageManager.h"
diff --git a/Source/Engine/Content/Storage/FlaxStorage.h b/Source/Engine/Content/Storage/FlaxStorage.h
index 24385b4e6..185cc81ae 100644
--- a/Source/Engine/Content/Storage/FlaxStorage.h
+++ b/Source/Engine/Content/Storage/FlaxStorage.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/Content/Storage/FlaxStorageReference.h b/Source/Engine/Content/Storage/FlaxStorageReference.h
index 7b1b38395..d690227ae 100644
--- a/Source/Engine/Content/Storage/FlaxStorageReference.h
+++ b/Source/Engine/Content/Storage/FlaxStorageReference.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/Content/Storage/JsonStorageProxy.cpp b/Source/Engine/Content/Storage/JsonStorageProxy.cpp
index 22934fd51..7b2fef534 100644
--- a/Source/Engine/Content/Storage/JsonStorageProxy.cpp
+++ b/Source/Engine/Content/Storage/JsonStorageProxy.cpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#include "JsonStorageProxy.h"
#include "Engine/Platform/File.h"
@@ -35,7 +35,7 @@ bool JsonStorageProxy::GetAssetInfo(const StringView& path, Guid& resultId, Stri
document.Parse((const char*)fileData.Get(), fileData.Count());
if (document.HasParseError())
{
- Log::JsonParseException(document.GetParseError(), String(path));
+ Log::JsonParseException(document.GetParseError(), document.GetErrorOffset(), String(path));
return false;
}
@@ -104,7 +104,7 @@ bool JsonStorageProxy::ChangeId(const StringView& path, const Guid& newId)
document.Parse((const char*)fileData.Get(), fileData.Count());
if (document.HasParseError())
{
- Log::JsonParseException(document.GetParseError(), String(path));
+ Log::JsonParseException(document.GetParseError(), document.GetErrorOffset(), String(path));
return false;
}
diff --git a/Source/Engine/Content/Storage/JsonStorageProxy.h b/Source/Engine/Content/Storage/JsonStorageProxy.h
index 977d6f829..f14eb82b0 100644
--- a/Source/Engine/Content/Storage/JsonStorageProxy.h
+++ b/Source/Engine/Content/Storage/JsonStorageProxy.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/Content/Types.h b/Source/Engine/Content/Types.h
index 28ae98050..b562449d2 100644
--- a/Source/Engine/Content/Types.h
+++ b/Source/Engine/Content/Types.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/Content/Upgraders/AudioClipUpgrader.h b/Source/Engine/Content/Upgraders/AudioClipUpgrader.h
index a1c6256e5..5e2555958 100644
--- a/Source/Engine/Content/Upgraders/AudioClipUpgrader.h
+++ b/Source/Engine/Content/Upgraders/AudioClipUpgrader.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/Content/Upgraders/BinaryAssetUpgrader.h b/Source/Engine/Content/Upgraders/BinaryAssetUpgrader.h
index 32a05072b..2c2d0f03e 100644
--- a/Source/Engine/Content/Upgraders/BinaryAssetUpgrader.h
+++ b/Source/Engine/Content/Upgraders/BinaryAssetUpgrader.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/Content/Upgraders/FontAssetUpgrader.h b/Source/Engine/Content/Upgraders/FontAssetUpgrader.h
index 097165e3e..cb26fa8d2 100644
--- a/Source/Engine/Content/Upgraders/FontAssetUpgrader.h
+++ b/Source/Engine/Content/Upgraders/FontAssetUpgrader.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/Content/Upgraders/IAssetUpgrader.h b/Source/Engine/Content/Upgraders/IAssetUpgrader.h
index a6dcb701c..f54616a45 100644
--- a/Source/Engine/Content/Upgraders/IAssetUpgrader.h
+++ b/Source/Engine/Content/Upgraders/IAssetUpgrader.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/Content/Upgraders/MaterialInstanceUpgrader.h b/Source/Engine/Content/Upgraders/MaterialInstanceUpgrader.h
index 9a6839720..31caeb230 100644
--- a/Source/Engine/Content/Upgraders/MaterialInstanceUpgrader.h
+++ b/Source/Engine/Content/Upgraders/MaterialInstanceUpgrader.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/Content/Upgraders/ModelAssetUpgrader.h b/Source/Engine/Content/Upgraders/ModelAssetUpgrader.h
index a69be759d..17b2bda38 100644
--- a/Source/Engine/Content/Upgraders/ModelAssetUpgrader.h
+++ b/Source/Engine/Content/Upgraders/ModelAssetUpgrader.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/Content/Upgraders/ShaderAssetUpgrader.h b/Source/Engine/Content/Upgraders/ShaderAssetUpgrader.h
index 2e6d5a801..827197009 100644
--- a/Source/Engine/Content/Upgraders/ShaderAssetUpgrader.h
+++ b/Source/Engine/Content/Upgraders/ShaderAssetUpgrader.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/Content/Upgraders/SkeletonMaskUpgrader.h b/Source/Engine/Content/Upgraders/SkeletonMaskUpgrader.h
index 90052969e..5058aed68 100644
--- a/Source/Engine/Content/Upgraders/SkeletonMaskUpgrader.h
+++ b/Source/Engine/Content/Upgraders/SkeletonMaskUpgrader.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/Content/Upgraders/SkinnedModelAssetUpgrader.h b/Source/Engine/Content/Upgraders/SkinnedModelAssetUpgrader.h
index 929394438..9a5b4c5ae 100644
--- a/Source/Engine/Content/Upgraders/SkinnedModelAssetUpgrader.h
+++ b/Source/Engine/Content/Upgraders/SkinnedModelAssetUpgrader.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/Content/Upgraders/TextureAssetUpgrader.h b/Source/Engine/Content/Upgraders/TextureAssetUpgrader.h
index c16a9881f..e1d75dba5 100644
--- a/Source/Engine/Content/Upgraders/TextureAssetUpgrader.h
+++ b/Source/Engine/Content/Upgraders/TextureAssetUpgrader.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/Content/Utilities/AssetsContainer.h b/Source/Engine/Content/Utilities/AssetsContainer.h
index 439033141..f2c56d747 100644
--- a/Source/Engine/Content/Utilities/AssetsContainer.h
+++ b/Source/Engine/Content/Utilities/AssetsContainer.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/Content/Utilities/IESLoader.cpp b/Source/Engine/Content/Utilities/IESLoader.cpp
index 35f81a9c4..0ef7c320a 100644
--- a/Source/Engine/Content/Utilities/IESLoader.cpp
+++ b/Source/Engine/Content/Utilities/IESLoader.cpp
@@ -1,20 +1,14 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#include "Engine/Core/Log.h"
#include "Engine/Core/RandomStream.h"
-#include "Engine/Core/Enums.h"
#include "Engine/Core/Math/Packed.h"
#include "IESLoader.h"
-///
-/// IES profile format version
-///
-DECLARE_ENUM_4(IESVersion, EIESV_1986, EIESV_1991, EIESV_1995, EIESV_2002);
+#define MAX_LINE 200
-static void JumpOverWhiteSpace(const uint8*& bufferPos)
+static void SkipWhiteSpace(const uint8*& bufferPos)
{
- // Space and return
-
while (*bufferPos)
{
if (*bufferPos == 13 && *(bufferPos + 1) == 10)
@@ -22,15 +16,13 @@ static void JumpOverWhiteSpace(const uint8*& bufferPos)
bufferPos += 2;
continue;
}
-
if (*bufferPos == 10)
{
- // No valid MSDOS return file
- CRASH;
+ bufferPos++;
+ continue;
}
- else if (*bufferPos <= ' ')
+ if (*bufferPos <= ' ')
{
- // Tab, space, invisible characters
bufferPos++;
continue;
}
@@ -39,14 +31,12 @@ static void JumpOverWhiteSpace(const uint8*& bufferPos)
}
}
-static void GetLineContent(const uint8*& bufferPos, char Line[256], bool bStopOnWhitespace)
+static void ReadLine(const uint8*& bufferPos, char line[MAX_LINE], bool skipUntilWhitespace)
{
- JumpOverWhiteSpace(bufferPos);
-
- char* linePtr = Line;
+ SkipWhiteSpace(bufferPos);
+ char* linePtr = line;
uint32 i;
-
for (i = 0; i < 255; i++)
{
if (*bufferPos == 0)
@@ -60,12 +50,11 @@ static void GetLineContent(const uint8*& bufferPos, char Line[256], bool bStopOn
}
if (*bufferPos == 10)
{
- // No valid MSDOS return file
- CRASH;
+ bufferPos++;
+ continue;
}
- else if (bStopOnWhitespace && (*bufferPos <= ' '))
+ if (skipUntilWhitespace && *bufferPos <= ' ')
{
- // Tab, space, invisible characters
bufferPos++;
break;
}
@@ -73,387 +62,231 @@ static void GetLineContent(const uint8*& bufferPos, char Line[256], bool bStopOn
*linePtr++ = *bufferPos++;
}
- Line[i] = 0;
+ line[i] = 0;
}
-static bool GetFloat(const uint8*& bufferPos, float& ret)
+static bool ReadFloat(const uint8*& bufferPos, float& ret)
{
- char line[256];
-
- GetLineContent(bufferPos, line, true);
-
+ char line[MAX_LINE];
+ ReadLine(bufferPos, line, true);
ret = static_cast(atof(line));
return true;
}
-static bool GetInt(const uint8*& bufferPos, int32& ret)
+static bool ReadLine(const uint8*& bufferPos, int32& ret)
{
- char line[256];
-
- GetLineContent(bufferPos, line, true);
-
+ char line[MAX_LINE];
+ ReadLine(bufferPos, line, true);
ret = atoi(line);
return true;
}
-IESLoader::IESLoader()
- : _brightness(0)
- , _cachedIntegral(-1)
-{
-}
-
-#define LOG_IES_IMPORT_ERROR(error) LOG(Warning, "Cannot import IES profile. {0}", error)
-#define PARSE_FLOAT(x) float x; if (!GetFloat(bufferPos, x)) { LOG_IES_IMPORT_ERROR(error); return true; }
-#define PARSE_INT(x) int32 x; if (!GetInt(bufferPos, x)) { LOG_IES_IMPORT_ERROR(error); return true; }
+#define PARSE_FLOAT(x) float x; if (!ReadFloat(bufferPos, x)) { return true; }
+#define PARSE_INT(x) int32 x; if (!ReadLine(bufferPos, x)) { return true; }
bool IESLoader::Load(const byte* buffer)
{
- // File format as described here:
+ // Referenced IES file format:
// http://www.ltblight.com/English.lproj/LTBLhelp/pages/iesformat.html
const uint8* bufferPos = buffer;
- const Char* error = nullptr;
-
- IESVersion version = IESVersion::EIESV_1986;
+ const char* version;
{
- error = TEXT("VersionError");
-
- char line1[256];
-
- GetLineContent(bufferPos, line1, false);
-
- if (StringUtils::CompareIgnoreCase(line1, "IESNA:LM-63-1995") == 0)
+ char line[MAX_LINE];
+ ReadLine(bufferPos, line, false);
+ if (StringUtils::CompareIgnoreCase(line, "IESNA:LM-63-1995") == 0)
{
- version = IESVersion::EIESV_1995;
+ version = "EIESV_1995";
}
- else if (StringUtils::CompareIgnoreCase(line1, "IESNA91") == 0)
+ else if (StringUtils::CompareIgnoreCase(line, "IESNA91") == 0)
{
- version = IESVersion::EIESV_1991;
+ version = "EIESV_1991";
}
- else if (StringUtils::CompareIgnoreCase(line1, "IESNA:LM-63-2002") == 0)
+ else if (StringUtils::CompareIgnoreCase(line, "IESNA:LM-63-2002") == 0)
{
- version = IESVersion::EIESV_2002;
+ version = "EIESV_2002";
}
else
{
- // EIESV_1986
+ version = "EIESV_1986";
}
}
- error = TEXT("HeaderError");
-
while (*bufferPos)
{
- char line[256];
-
- GetLineContent(bufferPos, line, false);
-
- if (strcmp(line, "TILT=NONE") == 0)
+ char line[MAX_LINE];
+ ReadLine(bufferPos, line, false);
+ if (StringUtils::Compare(line, "TILT=NONE") == 0)
{
- // At the moment we don't support only profiles with TILT=NONE
break;
}
- if (strncmp(line, "TILT=", 5) == 0)
+ if (StringUtils::Compare(line, "TILT=", 5) == 0)
{
- // "TILT=NONE", "TILT=INCLUDE", and "TILT={filename}"
- // not supported yet, seems rare
- LOG(Warning, "Cannot import IES profile. {0}", String(error));
return true;
}
}
- error = TEXT("HeaderParameterError");
+ PARSE_INT(lights);
+ PARSE_FLOAT(lumensPerLight);
+ PARSE_FLOAT(candalaScale);
+ PARSE_INT(vAnglesCount);
+ PARSE_INT(hAnglesCount);
+ PARSE_INT(photometricType);
+ PARSE_INT(unitType);
+ PARSE_FLOAT(width);
+ PARSE_FLOAT(length);
+ PARSE_FLOAT(height);
+ PARSE_FLOAT(ballastWeight);
+ PARSE_FLOAT(dummy);
+ PARSE_FLOAT(watts);
- PARSE_INT(LightCount);
-
- if (LightCount < 1)
+ if (lights < 1)
{
- error = TEXT("Light count needs to be positive.");
- LOG(Warning, "Cannot import IES profile. {0}", error);
return true;
}
- // if there is any file with that - do we need to parse it differently?
- ASSERT(LightCount >= 1);
-
- PARSE_FLOAT(LumensPerLamp);
-
- _brightness = LumensPerLamp / LightCount;
-
- PARSE_FLOAT(CandalaMult);
-
- if (CandalaMult < 0)
+ if (candalaScale < 0 || vAnglesCount < 0 || hAnglesCount < 0)
{
- error = TEXT("CandalaMult is negative");
- LOG_IES_IMPORT_ERROR(error);
return true;
}
- PARSE_INT(VAnglesNum);
- PARSE_INT(HAnglesNum);
-
- if (VAnglesNum < 0)
- {
- error = TEXT("VAnglesNum is not valid");
- LOG_IES_IMPORT_ERROR(error);
- return true;
- }
-
- if (HAnglesNum < 0)
- {
- error = TEXT("HAnglesNum is not valid");
- LOG_IES_IMPORT_ERROR(error);
- return true;
- }
-
- PARSE_INT(PhotometricType);
-
- // 1:feet, 2:meter
- PARSE_INT(UnitType);
-
- PARSE_FLOAT(Width);
- PARSE_FLOAT(Length);
- PARSE_FLOAT(Height);
-
- PARSE_FLOAT(BallastFactor);
- PARSE_FLOAT(FutureUse);
-
- PARSE_FLOAT(InputWatts);
-
- LOG(Info, "IES profile version: {0}, VAngles: {1}, HAngles: {2}", ::ToString(version), VAnglesNum, HAnglesNum);
-
- error = TEXT("ContentError");
+ _brightness = lumensPerLight / lights;
{
- float minSoFar = MIN_float;
-
- _vAngles.SetCapacity(VAnglesNum, false);
- for (int32 y = 0; y < VAnglesNum; y++)
+ float minValue = MIN_float;
+ _vAngles.SetCapacity(vAnglesCount, false);
+ for (int32 y = 0; y < vAnglesCount; y++)
{
- PARSE_FLOAT(Value);
-
- if (Value < minSoFar)
- {
- // binary search later relies on that
- error = TEXT("V Values are not in increasing order");
- LOG_IES_IMPORT_ERROR(error);
+ PARSE_FLOAT(value);
+ if (value < minValue)
return true;
- }
-
- minSoFar = Value;
- _vAngles.Add(Value);
+ minValue = value;
+ _vAngles.Add(value);
}
}
{
- float minSoFar = MIN_float;
-
- _hAngles.SetCapacity(HAnglesNum, false);
- for (int32 x = 0; x < HAnglesNum; x++)
+ float minValue = MIN_float;
+ _hAngles.SetCapacity(hAnglesCount, false);
+ for (int32 x = 0; x < hAnglesCount; x++)
{
- PARSE_FLOAT(Value);
-
- if (Value < minSoFar)
- {
- // binary search later relies on that
- error = TEXT("H Values are not in increasing order");
- LOG_IES_IMPORT_ERROR(error);
+ PARSE_FLOAT(value);
+ if (value < minValue)
return true;
- }
-
- minSoFar = Value;
- _hAngles.Add(Value);
+ minValue = value;
+ _hAngles.Add(value);
}
}
- _candalaValues.SetCapacity(HAnglesNum * VAnglesNum, false);
- for (int32 y = 0; y < HAnglesNum; y++)
+ _candalaValues.SetCapacity(hAnglesCount * vAnglesCount, false);
+ for (int32 y = 0; y < hAnglesCount; y++)
{
- for (int32 x = 0; x < VAnglesNum; x++)
+ for (int32 x = 0; x < vAnglesCount; x++)
{
- PARSE_FLOAT(Value);
-
- _candalaValues.Add(Value * CandalaMult);
+ PARSE_FLOAT(value);
+ _candalaValues.Add(value * candalaScale);
}
}
- error = TEXT("Unexpected content after candala values.");
-
- JumpOverWhiteSpace(bufferPos);
-
+ SkipWhiteSpace(bufferPos);
if (*bufferPos)
{
- // some files are terminated with "END"
- char Line[256];
-
- GetLineContent(bufferPos, Line, true);
-
- if (strcmp(Line, "END") == 0)
+ char line[MAX_LINE];
+ ReadLine(bufferPos, line, true);
+ if (StringUtils::Compare(line, "END") == 0)
{
- JumpOverWhiteSpace(bufferPos);
+ SkipWhiteSpace(bufferPos);
}
}
-
if (*bufferPos)
{
- error = TEXT("Unexpected content after END.");
- LOG_IES_IMPORT_ERROR(error);
return true;
}
if (_brightness <= 0)
{
- // Some samples have -1, then the brightness comes from the samples
- // Brightness = ComputeFullIntegral();
-
- // Use some reasonable value
_brightness = 1000;
}
return false;
}
+
#undef PARSE_FLOAT
#undef PARSE_INT
-float IESLoader::ExtractInR16F(Array& output)
+float IESLoader::ExtractInR16(Array& output)
{
- uint32 width = GetWidth();
- uint32 height = GetHeight();
+ const uint32 width = GetWidth();
+ const uint32 height = GetHeight();
- ASSERT(output.IsEmpty());
+ output.Clear();
output.Resize(width * height * sizeof(Half), false);
Half* out = reinterpret_cast(output.Get());
- float invWidth = 1.0f / width;
- float maxValue = ComputeMax();
- float invMaxValue = 1.0f / maxValue;
+ const float invWidth = 1.0f / (float)width;
+ float maxValue = _candalaValues[0];
+ for (int32 i = 1; i < _candalaValues.Count(); i++)
+ maxValue = Math::Max(maxValue, _candalaValues[i]);
+ const float invMaxValue = 1.0f / maxValue;
+ const uint32 hAnglesCount = static_cast(_hAngles.Count());
for (uint32 y = 0; y < height; y++)
{
for (uint32 x = 0; x < width; x++)
{
- // 0..1
- float fraction = x * invWidth;
-
- // TODO: distort for better quality? eg. Fraction = Square(Fraction);
-
- float value = invMaxValue * Interpolate1D(fraction * 180.0f);
-
- *out++ = ConvertFloatToHalf(value);
+ const float vAngle = (float)x * invWidth * 180.0f;
+ const float v = ComputeFilterPos(vAngle, _vAngles);
+ float result = 0.0f;
+ for (uint32 i = 0; i < hAnglesCount; i++)
+ result += InterpolateBilinear(static_cast(i), v);
+ *out++ = ConvertFloatToHalf(invMaxValue * result / (float)hAnglesCount);
}
}
- float integral = ComputeFullIntegral();
+ float integral;
+ {
+ // Calculate integral using Monte Carlo
+ const int32 count = 500000;
+ const RandomStream randomStream(0x1234);
+ double sum = 0;
+ for (uint32 i = 0; i < count; i++)
+ {
+ const Vector3 v = randomStream.GetUnitVector();
+ const float hAngle = Math::Acos(v.Z) / PI * 180;
+ const float vAngle = Math::Atan2(v.Y, v.X) / PI * 180 + 180;
+ sum += InterpolateBilinear(ComputeFilterPos(hAngle, _hAngles), ComputeFilterPos(vAngle, _vAngles));
+ }
+ integral = static_cast(sum / count);
+ }
return maxValue / integral;
}
-float IESLoader::InterpolatePoint(int32 X, int32 Y) const
+float IESLoader::InterpolatePoint(int32 x, int32 y) const
{
- int32 HAnglesNum = _hAngles.Count();
- int32 VAnglesNum = _vAngles.Count();
-
- ASSERT(X >= 0);
- ASSERT(Y >= 0);
-
- X %= HAnglesNum;
- Y %= VAnglesNum;
-
- ASSERT(X < HAnglesNum);
- ASSERT(Y < VAnglesNum);
-
- return _candalaValues[Y + VAnglesNum * X];
+ x %= _hAngles.Count();
+ y %= _vAngles.Count();
+ return _candalaValues[y + _vAngles.Count() * x];
}
-float IESLoader::InterpolateBilinear(float fX, float fY) const
+float IESLoader::InterpolateBilinear(float x, float y) const
{
- int32 X = static_cast(fX);
- int32 Y = static_cast(fY);
+ const int32 xInt = static_cast(x);
+ const int32 yInt = static_cast(y);
- float fracX = fX - X;
- float fracY = fY - Y;
+ const float xFrac = x - xInt;
+ const float yFrac = y - yInt;
- float p00 = InterpolatePoint(X + 0, Y + 0);
- float p10 = InterpolatePoint(X + 1, Y + 0);
- float p01 = InterpolatePoint(X + 0, Y + 1);
- float p11 = InterpolatePoint(X + 1, Y + 1);
+ const float p00 = InterpolatePoint(xInt + 0, yInt + 0);
+ const float p10 = InterpolatePoint(xInt + 1, yInt + 0);
+ const float p01 = InterpolatePoint(xInt + 0, yInt + 1);
+ const float p11 = InterpolatePoint(xInt + 1, yInt + 1);
- float p0 = Math::Lerp(p00, p01, fracY);
- float p1 = Math::Lerp(p10, p11, fracY);
+ const float p0 = Math::Lerp(p00, p01, yFrac);
+ const float p1 = Math::Lerp(p10, p11, yFrac);
- return Math::Lerp(p0, p1, fracX);
-}
-
-float IESLoader::Interpolate2D(float HAngle, float VAngle) const
-{
- float u = ComputeFilterPos(HAngle, _hAngles);
- float v = ComputeFilterPos(VAngle, _vAngles);
-
- return InterpolateBilinear(u, v);
-}
-
-float IESLoader::Interpolate1D(float VAngle) const
-{
- float v = ComputeFilterPos(VAngle, _vAngles);
-
- float ret = 0.0f;
-
- uint32 HAnglesNum = static_cast(_hAngles.Count());
-
- for (uint32 i = 0; i < HAnglesNum; i++)
- {
- ret += InterpolateBilinear(static_cast(i), v);
- }
-
- return ret / HAnglesNum;
-}
-
-float IESLoader::ComputeMax() const
-{
- float result = 0.0f;
-
- for (int32 i = 0; i < _candalaValues.Count(); i++)
- result = Math::Max(result, _candalaValues[i]);
-
- return result;
-}
-
-float IESLoader::ComputeFullIntegral()
-{
- // Compute only if needed
- if (_cachedIntegral < 0)
- {
- // Monte carlo integration
- // If quality is a problem we can improve on this algorithm or increase SampleCount
-
- // Larger number costs more time but improves quality
- const int32 SamplesCount = 1000000;
-
- RandomStream randomStream(0x1234);
-
- double sum = 0;
- for (uint32 i = 0; i < SamplesCount; i++)
- {
- Vector3 v = randomStream.GetUnitVector();
-
- // http://en.wikipedia.org/wiki/Spherical_coordinate_system
-
- // 0..180
- float HAngle = Math::Acos(v.Z) / PI * 180;
- // 0..360
- float VAngle = Math::Atan2(v.Y, v.X) / PI * 180 + 180;
-
- ASSERT(HAngle >= 0 && HAngle <= 180);
- ASSERT(VAngle >= 0 && VAngle <= 360);
-
- sum += Interpolate2D(HAngle, VAngle);
- }
-
- _cachedIntegral = static_cast(sum / SamplesCount);
- }
-
- return _cachedIntegral;
+ return Math::Lerp(p0, p1, xFrac);
}
float IESLoader::ComputeFilterPos(float value, const Array& sortedValues)
@@ -467,46 +300,35 @@ float IESLoader::ComputeFilterPos(float value, const Array& sortedValues)
{
return 0.0f;
}
-
if (value > sortedValues[endPos])
{
return static_cast(endPos);
}
- // Binary search
while (startPos < endPos)
{
- uint32 testPos = (startPos + endPos + 1) / 2;
-
- float testValue = sortedValues[testPos];
+ const uint32 testPos = (startPos + endPos + 1) / 2;
+ const float testValue = sortedValues[testPos];
if (value >= testValue)
{
- // Prevent endless loop
ASSERT(startPos != testPos);
-
startPos = testPos;
}
else
{
- // Prevent endless loop
ASSERT(endPos != testPos - 1);
-
endPos = testPos - 1;
}
}
- float leftValue = sortedValues[startPos];
-
+ const float leftValue = sortedValues[startPos];
float fraction = 0.0f;
-
if (startPos + 1 < static_cast(sortedValues.Count()))
{
- // If not at right border
- float rightValue = sortedValues[startPos + 1];
- float deltaValue = rightValue - leftValue;
-
- if (deltaValue > 0.0001f)
+ const float rightValue = sortedValues[startPos + 1];
+ const float deltaValue = rightValue - leftValue;
+ if (deltaValue > 0.00005f)
{
fraction = (value - leftValue) / deltaValue;
}
diff --git a/Source/Engine/Content/Utilities/IESLoader.h b/Source/Engine/Content/Utilities/IESLoader.h
index 4a23244b9..f25a9d7ff 100644
--- a/Source/Engine/Content/Utilities/IESLoader.h
+++ b/Source/Engine/Content/Utilities/IESLoader.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
@@ -6,16 +6,13 @@
#include "Engine/Core/Collections/Array.h"
///
-/// To load the IES file image format. IES files exist for many real world lights. The file stores how much light is emitted in a specific direction.
-/// The data is usually measured but tools to paint IES files exist.
+/// Utility for loading IES files and extract light emission information.
///
class IESLoader
{
private:
- float _brightness;
- float _cachedIntegral;
-
+ float _brightness = 0;
Array _hAngles;
Array _vAngles;
Array _candalaValues;
@@ -23,108 +20,39 @@ private:
public:
///
- /// Init
+ /// Loads the IES file.
///
- IESLoader();
-
-public:
-
- ///
- /// Load IES file
- ///
- /// Buffer with data
- /// True if cannot load, otherwise false
- FORCE_INLINE bool Load(const Array& buffer)
- {
- return Load(buffer.Get());
- }
-
- ///
- /// Load IES file
- ///
- /// Buffer with data
- /// True if cannot load, otherwise false
+ /// The buffer with data.
+ /// True if cannot load, otherwise false.
bool Load(const byte* buffer);
+ ///
+ /// Extracts IES profile data to R16 format (float).
+ ///
+ /// The result data container.
+ /// Thr multiplier as the texture is normalized.
+ float ExtractInR16(Array& output);
+
public:
- ///
- /// Gets width
- ///
- /// Width in pixels
- FORCE_INLINE uint32 GetWidth() const
+ uint32 GetWidth() const
{
- // We use contant size
return 256;
}
- ///
- /// Gets height
- ///
- /// Height in pixels
- FORCE_INLINE uint32 GetHeight() const
+ uint32 GetHeight() const
{
- // We use contant size
return 1;
}
- ///
- /// Gets IES profile brightness value in lumens (always > 0)
- ///
- /// Brightness (in lumens)
- FORCE_INLINE float GetBrightness() const
+ float GetBrightness() const
{
return _brightness;
}
-public:
+private:
- ///
- /// Extracts IES profile data to R16F format
- ///
- /// Result data container
- /// Multiplier as the texture is normalized
- float ExtractInR16F(Array& output);
-
-public:
-
- float InterpolatePoint(int32 X, int32 Y) const;
- float InterpolateBilinear(float fX, float fY) const;
-
- ///
- /// Compute the Candala value for a given direction
- ///
- /// HAngle (in degrees e.g. 0..180)
- /// VAngle (in degrees e.g. 0..180)
- /// Sampled value
- float Interpolate2D(float HAngle, float VAngle) const;
-
- ///
- /// Compute the Candala value for a given direction (integrates over HAngle)
- ///
- /// VAngle (in degrees e.g. 0..180)
- /// Sampled value
- float Interpolate1D(float VAngle) const;
-
-public:
-
- ///
- /// Calculates maximum value
- ///
- /// Maximum value
- float ComputeMax() const;
-
- ///
- /// Integrate over the unit sphere
- ///
- /// Integral value
- float ComputeFullIntegral();
-
- ///
- /// Computes filtering position for given value in sorted set of values
- ///
- /// Value to find
- /// Value to use
- /// Filter position
+ float InterpolatePoint(int32 x, int32 y) const;
+ float InterpolateBilinear(float x, float y) const;
static float ComputeFilterPos(float value, const Array& sortedValues);
};
diff --git a/Source/Engine/Content/WeakAssetReference.h b/Source/Engine/Content/WeakAssetReference.h
index 06bfae339..9ed81b521 100644
--- a/Source/Engine/Content/WeakAssetReference.h
+++ b/Source/Engine/Content/WeakAssetReference.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/ContentExporters/AssetExporters.h b/Source/Engine/ContentExporters/AssetExporters.h
index 159f3060b..68f67415c 100644
--- a/Source/Engine/ContentExporters/AssetExporters.h
+++ b/Source/Engine/ContentExporters/AssetExporters.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/ContentExporters/AssetsExportingManager.cpp b/Source/Engine/ContentExporters/AssetsExportingManager.cpp
index 0fc719e9e..b1d591257 100644
--- a/Source/Engine/ContentExporters/AssetsExportingManager.cpp
+++ b/Source/Engine/ContentExporters/AssetsExportingManager.cpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#if COMPILE_WITH_ASSETS_EXPORTER
diff --git a/Source/Engine/ContentExporters/AssetsExportingManager.h b/Source/Engine/ContentExporters/AssetsExportingManager.h
index 78b180a6c..b5125bb24 100644
--- a/Source/Engine/ContentExporters/AssetsExportingManager.h
+++ b/Source/Engine/ContentExporters/AssetsExportingManager.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/ContentExporters/ContentExporters.Build.cs b/Source/Engine/ContentExporters/ContentExporters.Build.cs
index 115b962a4..5f7840b46 100644
--- a/Source/Engine/ContentExporters/ContentExporters.Build.cs
+++ b/Source/Engine/ContentExporters/ContentExporters.Build.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System.Collections.Generic;
using Flax.Build;
diff --git a/Source/Engine/ContentExporters/ExportAudio.cpp b/Source/Engine/ContentExporters/ExportAudio.cpp
index 8c7aea63a..4e6d5ce5c 100644
--- a/Source/Engine/ContentExporters/ExportAudio.cpp
+++ b/Source/Engine/ContentExporters/ExportAudio.cpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#include "AssetExporters.h"
diff --git a/Source/Engine/ContentExporters/ExportModel.cpp b/Source/Engine/ContentExporters/ExportModel.cpp
index 5dddcf28a..efc13419b 100644
--- a/Source/Engine/ContentExporters/ExportModel.cpp
+++ b/Source/Engine/ContentExporters/ExportModel.cpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#include "AssetExporters.h"
diff --git a/Source/Engine/ContentExporters/ExportTexture.cpp b/Source/Engine/ContentExporters/ExportTexture.cpp
index 94a3df28c..60391bf1c 100644
--- a/Source/Engine/ContentExporters/ExportTexture.cpp
+++ b/Source/Engine/ContentExporters/ExportTexture.cpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#if COMPILE_WITH_ASSETS_EXPORTER
diff --git a/Source/Engine/ContentExporters/Types.h b/Source/Engine/ContentExporters/Types.h
index 8af03ce93..02bdcc2cc 100644
--- a/Source/Engine/ContentExporters/Types.h
+++ b/Source/Engine/ContentExporters/Types.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/ContentImporters/AssetsImportingManager.cpp b/Source/Engine/ContentImporters/AssetsImportingManager.cpp
index e7035c8b0..3a39bd64b 100644
--- a/Source/Engine/ContentImporters/AssetsImportingManager.cpp
+++ b/Source/Engine/ContentImporters/AssetsImportingManager.cpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#if COMPILE_WITH_ASSETS_IMPORTER
diff --git a/Source/Engine/ContentImporters/AssetsImportingManager.h b/Source/Engine/ContentImporters/AssetsImportingManager.h
index 35de3cc70..f628f6ba3 100644
--- a/Source/Engine/ContentImporters/AssetsImportingManager.h
+++ b/Source/Engine/ContentImporters/AssetsImportingManager.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/ContentImporters/ContentImporters.Build.cs b/Source/Engine/ContentImporters/ContentImporters.Build.cs
index 963e0576b..53af04653 100644
--- a/Source/Engine/ContentImporters/ContentImporters.Build.cs
+++ b/Source/Engine/ContentImporters/ContentImporters.Build.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System.Collections.Generic;
using Flax.Build;
diff --git a/Source/Engine/ContentImporters/CreateAnimationGraph.cpp b/Source/Engine/ContentImporters/CreateAnimationGraph.cpp
index 409788a47..b0e8cabe8 100644
--- a/Source/Engine/ContentImporters/CreateAnimationGraph.cpp
+++ b/Source/Engine/ContentImporters/CreateAnimationGraph.cpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#include "CreateAnimationGraph.h"
diff --git a/Source/Engine/ContentImporters/CreateAnimationGraph.h b/Source/Engine/ContentImporters/CreateAnimationGraph.h
index 3dd08c2b7..74dbb8246 100644
--- a/Source/Engine/ContentImporters/CreateAnimationGraph.h
+++ b/Source/Engine/ContentImporters/CreateAnimationGraph.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/ContentImporters/CreateAnimationGraphFunction.h b/Source/Engine/ContentImporters/CreateAnimationGraphFunction.h
index 354b366f6..b7705c7bd 100644
--- a/Source/Engine/ContentImporters/CreateAnimationGraphFunction.h
+++ b/Source/Engine/ContentImporters/CreateAnimationGraphFunction.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/ContentImporters/CreateCollisionData.cpp b/Source/Engine/ContentImporters/CreateCollisionData.cpp
index db415ca94..f2d90ea10 100644
--- a/Source/Engine/ContentImporters/CreateCollisionData.cpp
+++ b/Source/Engine/ContentImporters/CreateCollisionData.cpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#include "CreateCollisionData.h"
diff --git a/Source/Engine/ContentImporters/CreateCollisionData.h b/Source/Engine/ContentImporters/CreateCollisionData.h
index 6633b71f4..3c95ce966 100644
--- a/Source/Engine/ContentImporters/CreateCollisionData.h
+++ b/Source/Engine/ContentImporters/CreateCollisionData.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/ContentImporters/CreateJson.cpp b/Source/Engine/ContentImporters/CreateJson.cpp
index eec7f7ee6..49ccc6e90 100644
--- a/Source/Engine/ContentImporters/CreateJson.cpp
+++ b/Source/Engine/ContentImporters/CreateJson.cpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#include "CreateJson.h"
diff --git a/Source/Engine/ContentImporters/CreateJson.h b/Source/Engine/ContentImporters/CreateJson.h
index 4f73d4d06..f280b262e 100644
--- a/Source/Engine/ContentImporters/CreateJson.h
+++ b/Source/Engine/ContentImporters/CreateJson.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/ContentImporters/CreateMaterial.cpp b/Source/Engine/ContentImporters/CreateMaterial.cpp
index 25aefb63a..a2b55f46f 100644
--- a/Source/Engine/ContentImporters/CreateMaterial.cpp
+++ b/Source/Engine/ContentImporters/CreateMaterial.cpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#include "CreateMaterial.h"
diff --git a/Source/Engine/ContentImporters/CreateMaterial.h b/Source/Engine/ContentImporters/CreateMaterial.h
index abd409bc2..7a0fc2f05 100644
--- a/Source/Engine/ContentImporters/CreateMaterial.h
+++ b/Source/Engine/ContentImporters/CreateMaterial.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/ContentImporters/CreateMaterialFunction.h b/Source/Engine/ContentImporters/CreateMaterialFunction.h
index 3d3ee0397..c4df9c7bf 100644
--- a/Source/Engine/ContentImporters/CreateMaterialFunction.h
+++ b/Source/Engine/ContentImporters/CreateMaterialFunction.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/ContentImporters/CreateMaterialInstance.h b/Source/Engine/ContentImporters/CreateMaterialInstance.h
index 1ae0050e3..07f8f277a 100644
--- a/Source/Engine/ContentImporters/CreateMaterialInstance.h
+++ b/Source/Engine/ContentImporters/CreateMaterialInstance.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/ContentImporters/CreateParticleEmitter.h b/Source/Engine/ContentImporters/CreateParticleEmitter.h
index fb1050f34..728a72946 100644
--- a/Source/Engine/ContentImporters/CreateParticleEmitter.h
+++ b/Source/Engine/ContentImporters/CreateParticleEmitter.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/ContentImporters/CreateParticleEmitterFunction.h b/Source/Engine/ContentImporters/CreateParticleEmitterFunction.h
index 16dfd2003..36e73ac6a 100644
--- a/Source/Engine/ContentImporters/CreateParticleEmitterFunction.h
+++ b/Source/Engine/ContentImporters/CreateParticleEmitterFunction.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/ContentImporters/CreateParticleSystem.h b/Source/Engine/ContentImporters/CreateParticleSystem.h
index f92d7c1a3..5a0d3214c 100644
--- a/Source/Engine/ContentImporters/CreateParticleSystem.h
+++ b/Source/Engine/ContentImporters/CreateParticleSystem.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/ContentImporters/CreateRawData.h b/Source/Engine/ContentImporters/CreateRawData.h
index 492bc1b7a..c774cb448 100644
--- a/Source/Engine/ContentImporters/CreateRawData.h
+++ b/Source/Engine/ContentImporters/CreateRawData.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/ContentImporters/CreateSceneAnimation.h b/Source/Engine/ContentImporters/CreateSceneAnimation.h
index c9058f007..017b19732 100644
--- a/Source/Engine/ContentImporters/CreateSceneAnimation.h
+++ b/Source/Engine/ContentImporters/CreateSceneAnimation.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/ContentImporters/CreateSkeletonMask.h b/Source/Engine/ContentImporters/CreateSkeletonMask.h
index 3c6af99fe..625d6f0a3 100644
--- a/Source/Engine/ContentImporters/CreateSkeletonMask.h
+++ b/Source/Engine/ContentImporters/CreateSkeletonMask.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/ContentImporters/CreateVisualScript.h b/Source/Engine/ContentImporters/CreateVisualScript.h
index bebdb66e1..0531983b0 100644
--- a/Source/Engine/ContentImporters/CreateVisualScript.h
+++ b/Source/Engine/ContentImporters/CreateVisualScript.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/ContentImporters/ImportAudio.cpp b/Source/Engine/ContentImporters/ImportAudio.cpp
index 90e6eaccc..36fc65911 100644
--- a/Source/Engine/ContentImporters/ImportAudio.cpp
+++ b/Source/Engine/ContentImporters/ImportAudio.cpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#include "ImportAudio.h"
diff --git a/Source/Engine/ContentImporters/ImportAudio.h b/Source/Engine/ContentImporters/ImportAudio.h
index 4500907e2..b8913b33b 100644
--- a/Source/Engine/ContentImporters/ImportAudio.h
+++ b/Source/Engine/ContentImporters/ImportAudio.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/ContentImporters/ImportFont.cpp b/Source/Engine/ContentImporters/ImportFont.cpp
index 0689ad987..bbb977d19 100644
--- a/Source/Engine/ContentImporters/ImportFont.cpp
+++ b/Source/Engine/ContentImporters/ImportFont.cpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#include "ImportFont.h"
diff --git a/Source/Engine/ContentImporters/ImportFont.h b/Source/Engine/ContentImporters/ImportFont.h
index 0f365d663..b897729b6 100644
--- a/Source/Engine/ContentImporters/ImportFont.h
+++ b/Source/Engine/ContentImporters/ImportFont.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/ContentImporters/ImportModel.h b/Source/Engine/ContentImporters/ImportModel.h
index 60e17e811..2279d4e01 100644
--- a/Source/Engine/ContentImporters/ImportModel.h
+++ b/Source/Engine/ContentImporters/ImportModel.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/ContentImporters/ImportModelFile.cpp b/Source/Engine/ContentImporters/ImportModelFile.cpp
index 359a3f845..073f3edbd 100644
--- a/Source/Engine/ContentImporters/ImportModelFile.cpp
+++ b/Source/Engine/ContentImporters/ImportModelFile.cpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#include "ImportModel.h"
diff --git a/Source/Engine/ContentImporters/ImportModelFile.h b/Source/Engine/ContentImporters/ImportModelFile.h
index 83a3bc5a5..ace478bd9 100644
--- a/Source/Engine/ContentImporters/ImportModelFile.h
+++ b/Source/Engine/ContentImporters/ImportModelFile.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/ContentImporters/ImportShader.cpp b/Source/Engine/ContentImporters/ImportShader.cpp
index af50e2685..dec11237f 100644
--- a/Source/Engine/ContentImporters/ImportShader.cpp
+++ b/Source/Engine/ContentImporters/ImportShader.cpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#include "ImportShader.h"
diff --git a/Source/Engine/ContentImporters/ImportShader.h b/Source/Engine/ContentImporters/ImportShader.h
index 6fd3e6f02..aa5730f8e 100644
--- a/Source/Engine/ContentImporters/ImportShader.h
+++ b/Source/Engine/ContentImporters/ImportShader.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/ContentImporters/ImportTexture.cpp b/Source/Engine/ContentImporters/ImportTexture.cpp
index f63624c61..4537d496f 100644
--- a/Source/Engine/ContentImporters/ImportTexture.cpp
+++ b/Source/Engine/ContentImporters/ImportTexture.cpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#include "ImportTexture.h"
@@ -528,14 +528,14 @@ CreateAssetResult ImportTexture::ImportIES(class CreateAssetContext& context)
// Load IES profile data
IESLoader loader;
- if (loader.Load(fileData))
+ if (loader.Load(fileData.Get()))
{
return CreateAssetResult::Error;
}
// Extract texture data
Array rawData;
- const float multiplier = loader.ExtractInR16F(rawData);
+ const float multiplier = loader.ExtractInR16(rawData);
// Fill texture header
TextureHeader textureHeader;
diff --git a/Source/Engine/ContentImporters/ImportTexture.h b/Source/Engine/ContentImporters/ImportTexture.h
index 38ed19306..ed44e9f6c 100644
--- a/Source/Engine/ContentImporters/ImportTexture.h
+++ b/Source/Engine/ContentImporters/ImportTexture.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/ContentImporters/Types.h b/Source/Engine/ContentImporters/Types.h
index 54f168d82..051b865d8 100644
--- a/Source/Engine/ContentImporters/Types.h
+++ b/Source/Engine/ContentImporters/Types.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/Core/Cache.cpp b/Source/Engine/Core/Cache.cpp
index 139367f97..be55fa12c 100644
--- a/Source/Engine/Core/Cache.cpp
+++ b/Source/Engine/Core/Cache.cpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#include "Cache.h"
#include "FlaxEngine.Gen.h"
diff --git a/Source/Engine/Core/Cache.h b/Source/Engine/Core/Cache.h
index efc24148d..ffec6ba95 100644
--- a/Source/Engine/Core/Cache.h
+++ b/Source/Engine/Core/Cache.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/Core/Collections/Array.h b/Source/Engine/Core/Collections/Array.h
index 6eaa00dd9..6a841bac5 100644
--- a/Source/Engine/Core/Collections/Array.h
+++ b/Source/Engine/Core/Collections/Array.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/Core/Collections/ArrayExtensions.h b/Source/Engine/Core/Collections/ArrayExtensions.h
index d00ac6ec9..e48209d13 100644
--- a/Source/Engine/Core/Collections/ArrayExtensions.h
+++ b/Source/Engine/Core/Collections/ArrayExtensions.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/Core/Collections/BitArray.h b/Source/Engine/Core/Collections/BitArray.h
index 84606ca8f..c3051c678 100644
--- a/Source/Engine/Core/Collections/BitArray.h
+++ b/Source/Engine/Core/Collections/BitArray.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/Core/Collections/ChunkedArray.h b/Source/Engine/Core/Collections/ChunkedArray.h
index 253274713..1ed78ffe2 100644
--- a/Source/Engine/Core/Collections/ChunkedArray.h
+++ b/Source/Engine/Core/Collections/ChunkedArray.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/Core/Collections/CircularBuffer.cs b/Source/Engine/Core/Collections/CircularBuffer.cs
index 2ffebdff1..eb8adb2cd 100644
--- a/Source/Engine/Core/Collections/CircularBuffer.cs
+++ b/Source/Engine/Core/Collections/CircularBuffer.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using System.Collections;
diff --git a/Source/Engine/Core/Collections/CollectionPoolCache.h b/Source/Engine/Core/Collections/CollectionPoolCache.h
index 02a9a9400..d575c0b25 100644
--- a/Source/Engine/Core/Collections/CollectionPoolCache.h
+++ b/Source/Engine/Core/Collections/CollectionPoolCache.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/Core/Collections/Config.h b/Source/Engine/Core/Collections/Config.h
index 2799435bb..cb4cd6bef 100644
--- a/Source/Engine/Core/Collections/Config.h
+++ b/Source/Engine/Core/Collections/Config.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/Core/Collections/Dictionary.h b/Source/Engine/Core/Collections/Dictionary.h
index 169b8e7b9..e61cfc4d9 100644
--- a/Source/Engine/Core/Collections/Dictionary.h
+++ b/Source/Engine/Core/Collections/Dictionary.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/Core/Collections/HashFunctions.h b/Source/Engine/Core/Collections/HashFunctions.h
index 277cd5327..83e8907d0 100644
--- a/Source/Engine/Core/Collections/HashFunctions.h
+++ b/Source/Engine/Core/Collections/HashFunctions.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/Core/Collections/HashSet.h b/Source/Engine/Core/Collections/HashSet.h
index cb79b8469..3059cce8d 100644
--- a/Source/Engine/Core/Collections/HashSet.h
+++ b/Source/Engine/Core/Collections/HashSet.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/Core/Collections/IOrderedDictionary.cs b/Source/Engine/Core/Collections/IOrderedDictionary.cs
index 4bf71942e..657155ff9 100644
--- a/Source/Engine/Core/Collections/IOrderedDictionary.cs
+++ b/Source/Engine/Core/Collections/IOrderedDictionary.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System.Collections.Generic;
using System.Collections.Specialized;
diff --git a/Source/Engine/Core/Collections/OrderedDictionary.cs b/Source/Engine/Core/Collections/OrderedDictionary.cs
index f8c6e71c3..dc427193c 100644
--- a/Source/Engine/Core/Collections/OrderedDictionary.cs
+++ b/Source/Engine/Core/Collections/OrderedDictionary.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using System.Collections;
diff --git a/Source/Engine/Core/Collections/SamplesBuffer.h b/Source/Engine/Core/Collections/SamplesBuffer.h
index 032231fae..95a68bcd0 100644
--- a/Source/Engine/Core/Collections/SamplesBuffer.h
+++ b/Source/Engine/Core/Collections/SamplesBuffer.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/Core/Collections/Sorting.cpp b/Source/Engine/Core/Collections/Sorting.cpp
index e182b1076..4874c46ee 100644
--- a/Source/Engine/Core/Collections/Sorting.cpp
+++ b/Source/Engine/Core/Collections/Sorting.cpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#include "Sorting.h"
#include "Engine/Threading/ThreadLocal.h"
diff --git a/Source/Engine/Core/Collections/Sorting.h b/Source/Engine/Core/Collections/Sorting.h
index 1cc536994..4fd26f794 100644
--- a/Source/Engine/Core/Collections/Sorting.h
+++ b/Source/Engine/Core/Collections/Sorting.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/Core/Common.h b/Source/Engine/Core/Common.h
index 3551091de..7416692e2 100644
--- a/Source/Engine/Core/Common.h
+++ b/Source/Engine/Core/Common.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/Core/Compiler.h b/Source/Engine/Core/Compiler.h
index 38b0fd863..1c072f07e 100644
--- a/Source/Engine/Core/Compiler.h
+++ b/Source/Engine/Core/Compiler.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/Core/Config.h b/Source/Engine/Core/Config.h
index 152a170b2..0a9a10b3d 100644
--- a/Source/Engine/Core/Config.h
+++ b/Source/Engine/Core/Config.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/Core/Config/BuildSettings.h b/Source/Engine/Core/Config/BuildSettings.h
index 26bf13d61..d0ae40e0f 100644
--- a/Source/Engine/Core/Config/BuildSettings.h
+++ b/Source/Engine/Core/Config/BuildSettings.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/Core/Config/GameSettings.cpp b/Source/Engine/Core/Config/GameSettings.cpp
index 254921e6b..38e036de6 100644
--- a/Source/Engine/Core/Config/GameSettings.cpp
+++ b/Source/Engine/Core/Config/GameSettings.cpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#include "GameSettings.h"
#include "Engine/Serialization/JsonTools.h"
diff --git a/Source/Engine/Core/Config/GameSettings.h b/Source/Engine/Core/Config/GameSettings.h
index 047b766e4..6870d8c22 100644
--- a/Source/Engine/Core/Config/GameSettings.h
+++ b/Source/Engine/Core/Config/GameSettings.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/Core/Config/GraphicsSettings.cpp b/Source/Engine/Core/Config/GraphicsSettings.cpp
index 3bf3fb945..43678d03d 100644
--- a/Source/Engine/Core/Config/GraphicsSettings.cpp
+++ b/Source/Engine/Core/Config/GraphicsSettings.cpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#include "GraphicsSettings.h"
#include "Engine/Graphics/Graphics.h"
diff --git a/Source/Engine/Core/Config/GraphicsSettings.h b/Source/Engine/Core/Config/GraphicsSettings.h
index 2efd08eac..b13972cc7 100644
--- a/Source/Engine/Core/Config/GraphicsSettings.h
+++ b/Source/Engine/Core/Config/GraphicsSettings.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/Core/Config/LayersTagsSettings.h b/Source/Engine/Core/Config/LayersTagsSettings.h
index 161302d49..4ed9394fb 100644
--- a/Source/Engine/Core/Config/LayersTagsSettings.h
+++ b/Source/Engine/Core/Config/LayersTagsSettings.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/Core/Config/PlatformSettings.h b/Source/Engine/Core/Config/PlatformSettings.h
index af0f99c22..2148989b9 100644
--- a/Source/Engine/Core/Config/PlatformSettings.h
+++ b/Source/Engine/Core/Config/PlatformSettings.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/Core/Config/PlatformSettingsBase.h b/Source/Engine/Core/Config/PlatformSettingsBase.h
index be7e172fd..c33cd42d9 100644
--- a/Source/Engine/Core/Config/PlatformSettingsBase.h
+++ b/Source/Engine/Core/Config/PlatformSettingsBase.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/Core/Config/Settings.h b/Source/Engine/Core/Config/Settings.h
index 6400a43a7..0380c96b3 100644
--- a/Source/Engine/Core/Config/Settings.h
+++ b/Source/Engine/Core/Config/Settings.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/Core/Config/TimeSettings.h b/Source/Engine/Core/Config/TimeSettings.h
index 385cbad7e..8ac7ae741 100644
--- a/Source/Engine/Core/Config/TimeSettings.h
+++ b/Source/Engine/Core/Config/TimeSettings.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/Core/Core.Build.cs b/Source/Engine/Core/Core.Build.cs
index 2f5b91d1f..9e892c382 100644
--- a/Source/Engine/Core/Core.Build.cs
+++ b/Source/Engine/Core/Core.Build.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using Flax.Build;
using Flax.Build.NativeCpp;
diff --git a/Source/Engine/Core/Core.h b/Source/Engine/Core/Core.h
index f492e1e9a..f1d6f0197 100644
--- a/Source/Engine/Core/Core.h
+++ b/Source/Engine/Core/Core.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/Core/Delegate.h b/Source/Engine/Core/Delegate.h
index bfbc1634f..d4118c3da 100644
--- a/Source/Engine/Core/Delegate.h
+++ b/Source/Engine/Core/Delegate.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/Core/DeleteMe.h b/Source/Engine/Core/DeleteMe.h
index 41cca02a0..fddb16f7a 100644
--- a/Source/Engine/Core/DeleteMe.h
+++ b/Source/Engine/Core/DeleteMe.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/Core/Encoding.h b/Source/Engine/Core/Encoding.h
index 54f9e7b7c..5675fdc48 100644
--- a/Source/Engine/Core/Encoding.h
+++ b/Source/Engine/Core/Encoding.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/Core/Enums.h b/Source/Engine/Core/Enums.h
index 36c01af90..f5316acfe 100644
--- a/Source/Engine/Core/Enums.h
+++ b/Source/Engine/Core/Enums.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/Core/Formatting.h b/Source/Engine/Core/Formatting.h
index 37bf4cf9b..f20ed3ebf 100644
--- a/Source/Engine/Core/Formatting.h
+++ b/Source/Engine/Core/Formatting.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/Core/Log.cpp b/Source/Engine/Core/Log.cpp
index 68ff7deab..2213672c9 100644
--- a/Source/Engine/Core/Log.cpp
+++ b/Source/Engine/Core/Log.cpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#include "Log.h"
#include "Engine/Engine/CommandLine.h"
diff --git a/Source/Engine/Core/Log.h b/Source/Engine/Core/Log.h
index 9b98eb90d..0e28092f1 100644
--- a/Source/Engine/Core/Log.h
+++ b/Source/Engine/Core/Log.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/Core/Math/AABB.h b/Source/Engine/Core/Math/AABB.h
index b285fca1e..39e8a5bf6 100644
--- a/Source/Engine/Core/Math/AABB.h
+++ b/Source/Engine/Core/Math/AABB.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/Core/Math/BoundingBox.cpp b/Source/Engine/Core/Math/BoundingBox.cpp
index 224d65550..d7932e1b1 100644
--- a/Source/Engine/Core/Math/BoundingBox.cpp
+++ b/Source/Engine/Core/Math/BoundingBox.cpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#include "BoundingBox.h"
#include "BoundingSphere.h"
diff --git a/Source/Engine/Core/Math/BoundingBox.cs b/Source/Engine/Core/Math/BoundingBox.cs
index 1d17338ca..f69e14d3a 100644
--- a/Source/Engine/Core/Math/BoundingBox.cs
+++ b/Source/Engine/Core/Math/BoundingBox.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
// -----------------------------------------------------------------------------
// Original code from SharpDX project. https://github.com/sharpdx/SharpDX/
diff --git a/Source/Engine/Core/Math/BoundingBox.h b/Source/Engine/Core/Math/BoundingBox.h
index a13e75da6..f669370ff 100644
--- a/Source/Engine/Core/Math/BoundingBox.h
+++ b/Source/Engine/Core/Math/BoundingBox.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/Core/Math/BoundingFrustum.cpp b/Source/Engine/Core/Math/BoundingFrustum.cpp
index 9faabdf76..89b738a54 100644
--- a/Source/Engine/Core/Math/BoundingFrustum.cpp
+++ b/Source/Engine/Core/Math/BoundingFrustum.cpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#include "BoundingFrustum.h"
#include "BoundingBox.h"
diff --git a/Source/Engine/Core/Math/BoundingFrustum.cs b/Source/Engine/Core/Math/BoundingFrustum.cs
index b1b72c231..be7afff75 100644
--- a/Source/Engine/Core/Math/BoundingFrustum.cs
+++ b/Source/Engine/Core/Math/BoundingFrustum.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
// -----------------------------------------------------------------------------
// Original code from SharpDX project. https://github.com/sharpdx/SharpDX/
diff --git a/Source/Engine/Core/Math/BoundingFrustum.h b/Source/Engine/Core/Math/BoundingFrustum.h
index 61134490e..b8b16c412 100644
--- a/Source/Engine/Core/Math/BoundingFrustum.h
+++ b/Source/Engine/Core/Math/BoundingFrustum.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/Core/Math/BoundingSphere.cpp b/Source/Engine/Core/Math/BoundingSphere.cpp
index ef73a2480..3cdacfcc5 100644
--- a/Source/Engine/Core/Math/BoundingSphere.cpp
+++ b/Source/Engine/Core/Math/BoundingSphere.cpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#include "BoundingSphere.h"
#include "BoundingBox.h"
diff --git a/Source/Engine/Core/Math/BoundingSphere.cs b/Source/Engine/Core/Math/BoundingSphere.cs
index cf43875a9..0a9bc3784 100644
--- a/Source/Engine/Core/Math/BoundingSphere.cs
+++ b/Source/Engine/Core/Math/BoundingSphere.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
// -----------------------------------------------------------------------------
// Original code from SharpDX project. https://github.com/sharpdx/SharpDX/
diff --git a/Source/Engine/Core/Math/BoundingSphere.h b/Source/Engine/Core/Math/BoundingSphere.h
index 576c95651..bc6aa1e6e 100644
--- a/Source/Engine/Core/Math/BoundingSphere.h
+++ b/Source/Engine/Core/Math/BoundingSphere.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/Core/Math/CollisionsHelper.cpp b/Source/Engine/Core/Math/CollisionsHelper.cpp
index 7b27c8778..48e7472d1 100644
--- a/Source/Engine/Core/Math/CollisionsHelper.cpp
+++ b/Source/Engine/Core/Math/CollisionsHelper.cpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#include "CollisionsHelper.h"
#include "Vector2.h"
diff --git a/Source/Engine/Core/Math/CollisionsHelper.cs b/Source/Engine/Core/Math/CollisionsHelper.cs
index 60ca35ec1..22a3846f5 100644
--- a/Source/Engine/Core/Math/CollisionsHelper.cs
+++ b/Source/Engine/Core/Math/CollisionsHelper.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
// -----------------------------------------------------------------------------
// Original code from SharpDX project. https://github.com/sharpdx/SharpDX/
diff --git a/Source/Engine/Core/Math/CollisionsHelper.h b/Source/Engine/Core/Math/CollisionsHelper.h
index 9fac0e4a9..33631a682 100644
--- a/Source/Engine/Core/Math/CollisionsHelper.h
+++ b/Source/Engine/Core/Math/CollisionsHelper.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/Core/Math/Color.Palette.cs b/Source/Engine/Core/Math/Color.Palette.cs
index 7fcbcf317..abdbd657f 100644
--- a/Source/Engine/Core/Math/Color.Palette.cs
+++ b/Source/Engine/Core/Math/Color.Palette.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
// -----------------------------------------------------------------------------
// Original code from SharpDX project. https://github.com/sharpdx/SharpDX/
diff --git a/Source/Engine/Core/Math/Color.cpp b/Source/Engine/Core/Math/Color.cpp
index 9ec561b25..168db71a5 100644
--- a/Source/Engine/Core/Math/Color.cpp
+++ b/Source/Engine/Core/Math/Color.cpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#include "Color.h"
#include "../Types/String.h"
@@ -70,23 +70,21 @@ Color Color::FromHex(const String& hexString, bool& isValid)
return FromBytes(r, g, b, a);
}
-Color Color::FromHSV(const Vector3& hsv)
+Color Color::FromHSV(float hue, float saturation, float value, float alpha)
{
- const float Hue = hsv.X;
- const float Saturation = hsv.Y;
- const float Value = hsv.Z;
+ const float hDiv60 = hue / 60.0f;
+ const float hDiv60Floor = Math::Floor(hDiv60);
+ const float hDiv60Fraction = hDiv60 - hDiv60Floor;
- const float HDiv60 = Hue / 60.0f;
- const float HDiv60_Floor = floorf(HDiv60);
- const float HDiv60_Fraction = HDiv60 - HDiv60_Floor;
-
- const float RGBValues[4] = {
- Value,
- Value * (1.0f - Saturation),
- Value * (1.0f - HDiv60_Fraction * Saturation),
- Value * (1.0f - (1.0f - HDiv60_Fraction) * Saturation),
+ const float rgbValues[4] =
+ {
+ value,
+ value * (1.0f - saturation),
+ value * (1.0f - hDiv60Fraction * saturation),
+ value * (1.0f - (1.0f - hDiv60Fraction) * saturation),
};
- const uint32 RGBSwizzle[6][3] = {
+ const int32 rgbSwizzle[6][3]
+ {
{ 0, 3, 1 },
{ 2, 0, 1 },
{ 1, 0, 3 },
@@ -94,12 +92,17 @@ Color Color::FromHSV(const Vector3& hsv)
{ 3, 1, 0 },
{ 0, 1, 2 },
};
- const uint32 SwizzleIndex = (uint32)HDiv60_Floor % 6;
+ const int32 swizzleIndex = (int32)hDiv60Floor % 6;
- return Color(RGBValues[RGBSwizzle[SwizzleIndex][0]],
- RGBValues[RGBSwizzle[SwizzleIndex][1]],
- RGBValues[RGBSwizzle[SwizzleIndex][2]],
- 1.0f);
+ return Color(rgbValues[rgbSwizzle[swizzleIndex][0]],
+ rgbValues[rgbSwizzle[swizzleIndex][1]],
+ rgbValues[rgbSwizzle[swizzleIndex][2]],
+ alpha);
+}
+
+Color Color::FromHSV(const Vector3& hsv, float alpha)
+{
+ return FromHSV(hsv.X, hsv.Y, hsv.Z, alpha);
}
Color Color::Random()
diff --git a/Source/Engine/Core/Math/Color.cs b/Source/Engine/Core/Math/Color.cs
index 69565bf11..5aee4c428 100644
--- a/Source/Engine/Core/Math/Color.cs
+++ b/Source/Engine/Core/Math/Color.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using System.ComponentModel;
@@ -516,7 +516,7 @@ namespace FlaxEngine
}
///
- /// Creates RGB color from Hue[0-360], Saturation[0-1] and Value[0-1] paked to XYZ vector.
+ /// Creates RGB color from Hue[0-360], Saturation[0-1] and Value[0-1] packed to XYZ vector.
///
/// The HSV color.
/// The alpha value. Default is 1.
diff --git a/Source/Engine/Core/Math/Color.h b/Source/Engine/Core/Math/Color.h
index 84c68f411..d11097d5c 100644
--- a/Source/Engine/Core/Math/Color.h
+++ b/Source/Engine/Core/Math/Color.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
@@ -152,12 +152,23 @@ public:
static Color FromHex(const String& hexString, bool& isValid);
+ ///
+ /// Creates RGB color from Hue[0-360], Saturation[0-1] and Value[0-1].
+ ///
+ /// The hue angle in degrees [0-360].
+ /// The saturation normalized [0-1].
+ /// The value normalized [0-1].
+ /// The alpha value. Default is 1.
+ /// The RGB color.
+ static Color FromHSV(float hue, float saturation, float value, float alpha = 1.0f);
+
///
/// Creates RGB color from Hue[0-360], Saturation[0-1] and Value[0-1] packed to XYZ vector.
///
/// The HSV color.
+ /// The alpha value. Default is 1.
/// The RGB color.
- static Color FromHSV(const Vector3& hsv);
+ static Color FromHSV(const Vector3& hsv, float alpha = 1.0f);
///
/// Gets random color with opaque alpha.
diff --git a/Source/Engine/Core/Math/Color32.cpp b/Source/Engine/Core/Math/Color32.cpp
index f39188b86..465d2dc9b 100644
--- a/Source/Engine/Core/Math/Color32.cpp
+++ b/Source/Engine/Core/Math/Color32.cpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#include "Color32.h"
#include "../Types/String.h"
diff --git a/Source/Engine/Core/Math/Color32.cs b/Source/Engine/Core/Math/Color32.cs
index 44a69162b..c8421715c 100644
--- a/Source/Engine/Core/Math/Color32.cs
+++ b/Source/Engine/Core/Math/Color32.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using System.Runtime.InteropServices;
diff --git a/Source/Engine/Core/Math/Color32.h b/Source/Engine/Core/Math/Color32.h
index e45054ff3..89f64cc35 100644
--- a/Source/Engine/Core/Math/Color32.h
+++ b/Source/Engine/Core/Math/Color32.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/Core/Math/ColorHSV.cs b/Source/Engine/Core/Math/ColorHSV.cs
index aa83b7ea2..7e8a2b47a 100644
--- a/Source/Engine/Core/Math/ColorHSV.cs
+++ b/Source/Engine/Core/Math/ColorHSV.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using System.Globalization;
diff --git a/Source/Engine/Core/Math/FloatR10G10B10A2.cs b/Source/Engine/Core/Math/FloatR10G10B10A2.cs
index 0bd0328ed..100b849e7 100644
--- a/Source/Engine/Core/Math/FloatR10G10B10A2.cs
+++ b/Source/Engine/Core/Math/FloatR10G10B10A2.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using System.Globalization;
diff --git a/Source/Engine/Core/Math/FloatR11G11B10.cs b/Source/Engine/Core/Math/FloatR11G11B10.cs
index 930794c9b..e173a67c9 100644
--- a/Source/Engine/Core/Math/FloatR11G11B10.cs
+++ b/Source/Engine/Core/Math/FloatR11G11B10.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using System.Globalization;
diff --git a/Source/Engine/Core/Math/Half.cpp b/Source/Engine/Core/Math/Half.cpp
index d0317b494..47bf66802 100644
--- a/Source/Engine/Core/Math/Half.cpp
+++ b/Source/Engine/Core/Math/Half.cpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#include "Half.h"
#include "Rectangle.h"
diff --git a/Source/Engine/Core/Math/Half.cs b/Source/Engine/Core/Math/Half.cs
index c529a3509..d2519578a 100644
--- a/Source/Engine/Core/Math/Half.cs
+++ b/Source/Engine/Core/Math/Half.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
// -----------------------------------------------------------------------------
// Original code from SharpDX project. https://github.com/sharpdx/SharpDX/
diff --git a/Source/Engine/Core/Math/Half.h b/Source/Engine/Core/Math/Half.h
index be5cf6d71..19059ad0c 100644
--- a/Source/Engine/Core/Math/Half.h
+++ b/Source/Engine/Core/Math/Half.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/Core/Math/Half2.cs b/Source/Engine/Core/Math/Half2.cs
index 7e3f67d20..5d4f031e0 100644
--- a/Source/Engine/Core/Math/Half2.cs
+++ b/Source/Engine/Core/Math/Half2.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
// -----------------------------------------------------------------------------
// Original code from SharpDX project. https://github.com/sharpdx/SharpDX/
diff --git a/Source/Engine/Core/Math/Half3.cs b/Source/Engine/Core/Math/Half3.cs
index c8257bc8c..caa4011f5 100644
--- a/Source/Engine/Core/Math/Half3.cs
+++ b/Source/Engine/Core/Math/Half3.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
// -----------------------------------------------------------------------------
// Original code from SharpDX project. https://github.com/sharpdx/SharpDX/
diff --git a/Source/Engine/Core/Math/Half4.cs b/Source/Engine/Core/Math/Half4.cs
index 1c859f945..6ce806021 100644
--- a/Source/Engine/Core/Math/Half4.cs
+++ b/Source/Engine/Core/Math/Half4.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
// -----------------------------------------------------------------------------
// Original code from SharpDX project. https://github.com/sharpdx/SharpDX/
diff --git a/Source/Engine/Core/Math/HalfUtils.cs b/Source/Engine/Core/Math/HalfUtils.cs
index 066a2f18c..7665b5794 100644
--- a/Source/Engine/Core/Math/HalfUtils.cs
+++ b/Source/Engine/Core/Math/HalfUtils.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
// -----------------------------------------------------------------------------
// Original code from SharpDX project. https://github.com/sharpdx/SharpDX/
diff --git a/Source/Engine/Core/Math/Int2.cs b/Source/Engine/Core/Math/Int2.cs
index 4515f44e4..dc492c989 100644
--- a/Source/Engine/Core/Math/Int2.cs
+++ b/Source/Engine/Core/Math/Int2.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using System.ComponentModel;
diff --git a/Source/Engine/Core/Math/Int3.cs b/Source/Engine/Core/Math/Int3.cs
index 91e17f73f..432614e40 100644
--- a/Source/Engine/Core/Math/Int3.cs
+++ b/Source/Engine/Core/Math/Int3.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using System.ComponentModel;
diff --git a/Source/Engine/Core/Math/Int4.cs b/Source/Engine/Core/Math/Int4.cs
index dee9621d3..1a09eaebb 100644
--- a/Source/Engine/Core/Math/Int4.cs
+++ b/Source/Engine/Core/Math/Int4.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using System.ComponentModel;
diff --git a/Source/Engine/Core/Math/Math.cpp b/Source/Engine/Core/Math/Math.cpp
index bd08d8d0f..4075bcbda 100644
--- a/Source/Engine/Core/Math/Math.cpp
+++ b/Source/Engine/Core/Math/Math.cpp
@@ -1,26 +1,57 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#include "Math.h"
#include "Vector3.h"
+void Math::SinCos(float angle, float& sine, float& cosine)
+{
+ sine = sin(angle);
+ cosine = cos(angle);
+}
+
+uint32 Math::FloorLog2(uint32 value)
+{
+ // References:
+ // http://codinggorilla.domemtech.com/?p=81
+ // http://en.wikipedia.org/wiki/Binary_logarithm
+
+ uint32 pos = 0;
+ if (value >= 1 << 16)
+ {
+ value >>= 16;
+ pos += 16;
+ }
+ if (value >= 1 << 8)
+ {
+ value >>= 8;
+ pos += 8;
+ }
+ if (value >= 1 << 4)
+ {
+ value >>= 4;
+ pos += 4;
+ }
+ if (value >= 1 << 2)
+ {
+ value >>= 2;
+ pos += 2;
+ }
+ if (value >= 1 << 1)
+ {
+ pos += 1;
+ }
+ return value == 0 ? 0 : pos;
+}
+
Vector3 Math::RotateAboutAxis(const Vector3& normalizedRotationAxis, float angle, const Vector3& positionOnAxis, const Vector3& position)
{
- // Project position onto the rotation axis and find the closest point on the axis to Position
const Vector3 closestPointOnAxis = positionOnAxis + normalizedRotationAxis * Vector3::Dot(normalizedRotationAxis, position - positionOnAxis);
-
- // Construct orthogonal axes in the plane of the rotation
const Vector3 axisU = position - closestPointOnAxis;
const Vector3 axisV = Vector3::Cross(normalizedRotationAxis, axisU);
float cosAngle, sinAngle;
Math::SinCos(angle, sinAngle, cosAngle);
-
- // Rotate using the orthogonal axes
const Vector3 rotation = axisU * cosAngle + axisV * sinAngle;
-
- // Reconstruct the rotated world space position
const Vector3 rotatedPosition = closestPointOnAxis + rotation;
-
- // Convert from position to a position offset
return rotatedPosition - position;
}
diff --git a/Source/Engine/Core/Math/Math.h b/Source/Engine/Core/Math/Math.h
index 3035e213f..ee3b34b9a 100644
--- a/Source/Engine/Core/Math/Math.h
+++ b/Source/Engine/Core/Math/Math.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
@@ -18,10 +18,10 @@
#define ZeroTolerance 1e-6f
// Converts radians to degrees.
-#define RadiansToDegrees (180.f / PI)
+#define RadiansToDegrees (180.0f / PI)
// Converts degrees to radians.
-#define DegreesToRadians (PI / 180.f)
+#define DegreesToRadians (PI / 180.0f)
namespace Math
{
@@ -31,97 +31,14 @@ namespace Math
/// The input angle (in radians).
/// The output sine value.
/// The output cosine value.
- static void SinCos(float angle, float& sine, float& cosine)
- {
-#if 1
- // Map value to y in [-pi,pi], x = 2*pi*quotient + remainder
- float quotient = PI_INV * 0.5f * angle;
- if (angle >= 0.0f)
- {
- quotient = (float)(int)(quotient + 0.5f);
- }
- else
- {
- quotient = (float)(int)(quotient - 0.5f);
- }
- float y = angle - 2.0f * PI * quotient;
-
- // Map y to [-pi/2,pi/2] with sin(y) = sin(value)
- float sign;
- if (y > PI_OVER_2)
- {
- y = PI - y;
- sign = -1.0f;
- }
- else if (y < -PI_OVER_2)
- {
- y = -PI - y;
- sign = -1.0f;
- }
- else
- {
- sign = +1.0f;
- }
-
- const float y2 = y * y;
-
- // 11-degree minimax approximation
- sine = (((((-2.3889859e-08f * y2 + 2.7525562e-06f) * y2 - 0.00019840874f) * y2 + 0.0083333310f) * y2 - 0.16666667f) * y2 + 1.0f) * y;
-
- // 10-degree minimax approximation
- const float p = ((((-2.6051615e-07f * y2 + 2.4760495e-05f) * y2 - 0.0013888378f) * y2 + 0.041666638f) * y2 - 0.5f) * y2 + 1.0f;
- cosine = sign * p;
-#else
- sine = sin(angle);
- cosine = cos(angle);
-#endif
- }
+ FLAXENGINE_API void SinCos(float angle, float& sine, float& cosine);
///
/// Computes the base 2 logarithm for an integer value that is greater than 0. The result is rounded down to the nearest integer.
///
/// The value to compute the log of.
/// The Log2 of value. 0 if value is 0.
- static uint32 FloorLog2(uint32 value)
- {
- // Reference implementation
- // uint32 bit = 32;
- // for (; bit > 0;)
- // {
- // bit--;
- // if (value & (1 << bit))
- // break;
- // }
- // return bit;
-
- // Optimized version http://codinggorilla.domemtech.com/?p=81 or http://en.wikipedia.org/wiki/Binary_logarithm but modified to return 0 for a input value of 0
- uint32 pos = 0;
- if (value >= 1 << 16)
- {
- value >>= 16;
- pos += 16;
- }
- if (value >= 1 << 8)
- {
- value >>= 8;
- pos += 8;
- }
- if (value >= 1 << 4)
- {
- value >>= 4;
- pos += 4;
- }
- if (value >= 1 << 2)
- {
- value >>= 2;
- pos += 2;
- }
- if (value >= 1 << 1)
- {
- pos += 1;
- }
- return value == 0 ? 0 : pos;
- }
+ FLAXENGINE_API uint32 FloorLog2(uint32 value);
static FORCE_INLINE float Trunc(float value)
{
@@ -712,68 +629,38 @@ namespace Math
static float ClampAxis(float angle)
{
- // returns angle in the range (-360,360)
angle = Mod(angle, 360.f);
-
- if (angle < 0.f)
- {
- // shift to [0,360) range
- angle += 360.f;
- }
-
+ if (angle < 0.0f)
+ angle += 360.0f;
return angle;
}
static float NormalizeAxis(float angle)
{
- // returns angle in the range [0,360)
angle = ClampAxis(angle);
-
if (angle > 180.f)
- {
- // shift to (-180,180]
angle -= 360.f;
- }
-
return angle;
}
// Find the smallest angle between two headings (in radians).
static float FindDeltaAngle(float a1, float a2)
{
- // Find the difference
- float Delta = a2 - a1;
-
- // If change is larger than PI
- if (Delta > PI)
- {
- // Flip to negative equivalent
- Delta = Delta - PI * 2.0f;
- }
- else if (Delta < -PI)
- {
- // Otherwise, if change is smaller than -PI
- // Flip to positive equivalent
- Delta = Delta + PI * 2.0f;
- }
-
- // Return delta in [-PI,PI] range
- return Delta;
+ float delta = a2 - a1;
+ if (delta > PI)
+ delta = delta - PI * 2.0f;
+ else if (delta < -PI)
+ delta = delta + PI * 2.0f;
+ return delta;
}
// Given a heading which may be outside the +/- PI range, 'unwind' it back into that range
static float UnwindRadians(float a)
{
while (a > PI)
- {
a -= (float)PI * 2.0f;
- }
-
while (a < -PI)
- {
a += (float)PI * 2.0f;
- }
-
return a;
}
@@ -781,15 +668,9 @@ namespace Math
static float UnwindDegrees(float a)
{
while (a > 180.f)
- {
a -= 360.f;
- }
-
while (a < -180.f)
- {
a += 360.f;
- }
-
return a;
}
@@ -818,13 +699,9 @@ namespace Math
static float SmoothStep(float a, float b, float x)
{
if (x < a)
- {
return 0.0f;
- }
if (x >= b)
- {
return 1.0f;
- }
const float fraction = (x - a) / (b - a);
return fraction * fraction * (3.0f - 2.0f * fraction);
}
@@ -852,8 +729,8 @@ namespace Math
template
static FORCE_INLINE T InterpEaseIn(const T& a, const T& b, float alpha, float exponent)
{
- float const modifiedAlpha = Pow(alpha, exponent);
- return Lerp(a, b, modifiedAlpha);
+ const float blend = Pow(alpha, exponent);
+ return Lerp(a, b, blend);
}
///
@@ -862,8 +739,8 @@ namespace Math
template
static FORCE_INLINE T InterpEaseOut(const T& a, const T& b, float alpha, float exponent)
{
- float const modifiedAlpha = 1.f - Pow(1.f - alpha, exponent);
- return Lerp(a, b, modifiedAlpha);
+ const float blend = 1.f - Pow(1.f - alpha, exponent);
+ return Lerp(a, b, blend);
}
///
@@ -881,8 +758,8 @@ namespace Math
template
static FORCE_INLINE T InterpSinIn(const T& a, const T& b, float alpha)
{
- float const modifiedAlpha = -1.f * Cos(alpha * PI_HALF) + 1.f;
- return Lerp(a, b, modifiedAlpha);
+ const float blend = -1.f * Cos(alpha * PI_HALF) + 1.f;
+ return Lerp(a, b, blend);
}
///
@@ -891,8 +768,8 @@ namespace Math
template
static FORCE_INLINE T InterpSinOut(const T& a, const T& b, float alpha)
{
- float const modifiedAlpha = Sin(alpha * PI_HALF);
- return Lerp(a, b, modifiedAlpha);
+ const float blend = Sin(alpha * PI_HALF);
+ return Lerp(a, b, blend);
}
///
@@ -910,8 +787,8 @@ namespace Math
template
static FORCE_INLINE T InterpExpoIn(const T& a, const T& b, float alpha)
{
- float const modifiedAlpha = alpha == 0.f ? 0.f : Pow(2.f, 10.f * (alpha - 1.f));
- return Lerp(a, b, modifiedAlpha);
+ const float blend = alpha == 0.f ? 0.f : Pow(2.f, 10.f * (alpha - 1.f));
+ return Lerp(a, b, blend);
}
///
@@ -920,8 +797,8 @@ namespace Math
template
static FORCE_INLINE T InterpExpoOut(const T& a, const T& b, float alpha)
{
- float const modifiedAlpha = alpha == 1.f ? 1.f : -Pow(2.f, -10.f * alpha) + 1.f;
- return Lerp(a, b, modifiedAlpha);
+ const float blend = alpha == 1.f ? 1.f : -Pow(2.f, -10.f * alpha) + 1.f;
+ return Lerp(a, b, blend);
}
///
@@ -939,8 +816,8 @@ namespace Math
template
static FORCE_INLINE T InterpCircularIn(const T& a, const T& b, float alpha)
{
- float const modifiedAlpha = -1.f * (Sqrt(1.f - alpha * alpha) - 1.f);
- return Lerp(a, b, modifiedAlpha);
+ const float blend = -1.f * (Sqrt(1.f - alpha * alpha) - 1.f);
+ return Lerp(a, b, blend);
}
///
@@ -950,8 +827,8 @@ namespace Math
static FORCE_INLINE T InterpCircularOut(const T& a, const T& b, float alpha)
{
alpha -= 1.f;
- float const modifiedAlpha = Sqrt(1.f - alpha * alpha);
- return Lerp(a, b, modifiedAlpha);
+ const float blend = Sqrt(1.f - alpha * alpha);
+ return Lerp(a, b, blend);
}
///
diff --git a/Source/Engine/Core/Math/Mathf.cs b/Source/Engine/Core/Math/Mathf.cs
index d311799f2..7286573bf 100644
--- a/Source/Engine/Core/Math/Mathf.cs
+++ b/Source/Engine/Core/Math/Mathf.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using System.ComponentModel;
@@ -316,6 +316,16 @@ namespace FlaxEngine
return a <= b ? b : a;
}
+ ///
+ /// Returns the largest of two or more values.
+ ///
+ ///
+ ///
+ public static uint Max(uint a, uint b)
+ {
+ return a <= b ? b : a;
+ }
+
///
/// Returns the largest of two or more values.
///
@@ -401,6 +411,16 @@ namespace FlaxEngine
return a >= b ? b : a;
}
+ ///
+ /// Returns the smallest of two or more values.
+ ///
+ ///
+ ///
+ public static uint Min(uint a, uint b)
+ {
+ return a >= b ? b : a;
+ }
+
///
/// Returns the smallest of two or more values.
///
@@ -1173,6 +1193,18 @@ namespace FlaxEngine
return value < min ? min : value > max ? max : value;
}
+ ///
+ /// Clamps the specified value.
+ ///
+ /// The value.
+ /// The min.
+ /// The max.
+ /// The result of clamping a value between min and max
+ public static uint Clamp(uint value, uint min, uint max)
+ {
+ return value < min ? min : value > max ? max : value;
+ }
+
///
/// Interpolates between two values using a linear function by a given amount.
///
diff --git a/Source/Engine/Core/Math/Matrix.cpp b/Source/Engine/Core/Math/Matrix.cpp
index 0b540b774..a346d423b 100644
--- a/Source/Engine/Core/Math/Matrix.cpp
+++ b/Source/Engine/Core/Math/Matrix.cpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#include "Matrix.h"
#include "Vector2.h"
diff --git a/Source/Engine/Core/Math/Matrix.cs b/Source/Engine/Core/Math/Matrix.cs
index 56aec9f8a..a6ce7cb22 100644
--- a/Source/Engine/Core/Math/Matrix.cs
+++ b/Source/Engine/Core/Math/Matrix.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
// -----------------------------------------------------------------------------
// Original code from SharpDX project. https://github.com/sharpdx/SharpDX/
diff --git a/Source/Engine/Core/Math/Matrix.h b/Source/Engine/Core/Math/Matrix.h
index ad3682b85..584286082 100644
--- a/Source/Engine/Core/Math/Matrix.h
+++ b/Source/Engine/Core/Math/Matrix.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/Core/Math/Matrix2x2.cs b/Source/Engine/Core/Math/Matrix2x2.cs
index ea8f30349..fcc2151ef 100644
--- a/Source/Engine/Core/Math/Matrix2x2.cs
+++ b/Source/Engine/Core/Math/Matrix2x2.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using System.Globalization;
diff --git a/Source/Engine/Core/Math/Matrix3x3.cpp b/Source/Engine/Core/Math/Matrix3x3.cpp
index 4376fc380..0e2e1b15b 100644
--- a/Source/Engine/Core/Math/Matrix3x3.cpp
+++ b/Source/Engine/Core/Math/Matrix3x3.cpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#include "Matrix3x3.h"
#include "../Types/String.h"
diff --git a/Source/Engine/Core/Math/Matrix3x3.cs b/Source/Engine/Core/Math/Matrix3x3.cs
index 16dd1bf68..4ef12383e 100644
--- a/Source/Engine/Core/Math/Matrix3x3.cs
+++ b/Source/Engine/Core/Math/Matrix3x3.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
// -----------------------------------------------------------------------------
// Original code from SharpDX project. https://github.com/sharpdx/SharpDX/
diff --git a/Source/Engine/Core/Math/Matrix3x3.h b/Source/Engine/Core/Math/Matrix3x3.h
index be8f4f1e4..3cf690259 100644
--- a/Source/Engine/Core/Math/Matrix3x3.h
+++ b/Source/Engine/Core/Math/Matrix3x3.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/Core/Math/OrientedBoundingBox.cpp b/Source/Engine/Core/Math/OrientedBoundingBox.cpp
index 7c49a5369..61b554834 100644
--- a/Source/Engine/Core/Math/OrientedBoundingBox.cpp
+++ b/Source/Engine/Core/Math/OrientedBoundingBox.cpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#include "OrientedBoundingBox.h"
#include "BoundingSphere.h"
diff --git a/Source/Engine/Core/Math/OrientedBoundingBox.cs b/Source/Engine/Core/Math/OrientedBoundingBox.cs
index 01bb99c43..4e44746e7 100644
--- a/Source/Engine/Core/Math/OrientedBoundingBox.cs
+++ b/Source/Engine/Core/Math/OrientedBoundingBox.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
// -----------------------------------------------------------------------------
// Original code from SharpDX project. https://github.com/sharpdx/SharpDX/
diff --git a/Source/Engine/Core/Math/OrientedBoundingBox.h b/Source/Engine/Core/Math/OrientedBoundingBox.h
index 8685e5fda..03256633d 100644
--- a/Source/Engine/Core/Math/OrientedBoundingBox.h
+++ b/Source/Engine/Core/Math/OrientedBoundingBox.h
@@ -1,5 +1,5 @@
// Copyright (c) 2010-2014 SharpDX - Alexandre Mutel
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/Core/Math/Packed.cpp b/Source/Engine/Core/Math/Packed.cpp
index 47e5da45f..1538170b6 100644
--- a/Source/Engine/Core/Math/Packed.cpp
+++ b/Source/Engine/Core/Math/Packed.cpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#include "Packed.h"
#include "Vector2.h"
@@ -63,6 +63,8 @@ Vector3 Float1010102::ToVector3() const
FloatR11G11B10::FloatR11G11B10(float x, float y, float z)
{
+ // Reference: https://github.com/microsoft/DirectXMath
+
uint32 iValue[4];
iValue[0] = *(uint32*)&x;
iValue[1] = *(uint32*)&y;
@@ -197,6 +199,8 @@ FloatR11G11B10::operator Vector3() const
Vector3 FloatR11G11B10::ToVector3() const
{
+ // Reference: https://github.com/microsoft/DirectXMath
+
uint32 result[4];
uint32 mantissa;
uint32 exponent;
diff --git a/Source/Engine/Core/Math/Packed.h b/Source/Engine/Core/Math/Packed.h
index 15bc57e07..ec666bf61 100644
--- a/Source/Engine/Core/Math/Packed.h
+++ b/Source/Engine/Core/Math/Packed.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/Core/Math/Plane.cpp b/Source/Engine/Core/Math/Plane.cpp
index b93646a94..341f33a8c 100644
--- a/Source/Engine/Core/Math/Plane.cpp
+++ b/Source/Engine/Core/Math/Plane.cpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#include "Plane.h"
#include "Matrix.h"
@@ -216,7 +216,6 @@ void Plane::Transform(Plane planes[], int32 planesCount, const Quaternion& rotat
const float y = planes[i].Normal.Y;
const float z = planes[i].Normal.Z;
- // Factor common arithmetic out of loop
planes[i].Normal.X = x * (1.0f - yy - zz) + y * (xy - wz) + z * (xz + wy);
planes[i].Normal.Y = x * (xy + wz) + y * (1.0f - xx - zz) + z * (yz - wx);
planes[i].Normal.Z = x * (xz - wy) + y * (yz + wx) + z * (1.0f - xx - yy);
diff --git a/Source/Engine/Core/Math/Plane.cs b/Source/Engine/Core/Math/Plane.cs
index 5d11c2087..d37516fba 100644
--- a/Source/Engine/Core/Math/Plane.cs
+++ b/Source/Engine/Core/Math/Plane.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
// -----------------------------------------------------------------------------
// Original code from SharpDX project. https://github.com/sharpdx/SharpDX/
diff --git a/Source/Engine/Core/Math/Plane.h b/Source/Engine/Core/Math/Plane.h
index a24e1c3e0..2ca34258f 100644
--- a/Source/Engine/Core/Math/Plane.h
+++ b/Source/Engine/Core/Math/Plane.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/Core/Math/Quaternion.cpp b/Source/Engine/Core/Math/Quaternion.cpp
index 7a9a51c79..93c218d76 100644
--- a/Source/Engine/Core/Math/Quaternion.cpp
+++ b/Source/Engine/Core/Math/Quaternion.cpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#include "Quaternion.h"
#include "Vector3.h"
@@ -360,8 +360,8 @@ void Quaternion::FindBetween(const Vector3& from, const Vector3& to, Quaternion&
if (w < 1.e-6f * normFromNormTo)
{
result = Math::Abs(from.X) > Math::Abs(from.Z)
- ? Quaternion(-from.Y, from.X, 0.f, 0.f)
- : Quaternion(0.f, -from.Z, from.Y, 0.f);
+ ? Quaternion(-from.Y, from.X, 0.0f, 0.0f)
+ : Quaternion(0.0f, -from.Z, from.Y, 0.0f);
}
else
{
diff --git a/Source/Engine/Core/Math/Quaternion.cs b/Source/Engine/Core/Math/Quaternion.cs
index 280415a3d..bc86fa2c9 100644
--- a/Source/Engine/Core/Math/Quaternion.cs
+++ b/Source/Engine/Core/Math/Quaternion.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
// -----------------------------------------------------------------------------
// Original code from SharpDX project. https://github.com/sharpdx/SharpDX/
diff --git a/Source/Engine/Core/Math/Quaternion.h b/Source/Engine/Core/Math/Quaternion.h
index 09235203c..54ea49540 100644
--- a/Source/Engine/Core/Math/Quaternion.h
+++ b/Source/Engine/Core/Math/Quaternion.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/Core/Math/Ray.cpp b/Source/Engine/Core/Math/Ray.cpp
index a2e8a970a..25c8be887 100644
--- a/Source/Engine/Core/Math/Ray.cpp
+++ b/Source/Engine/Core/Math/Ray.cpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#include "Ray.h"
#include "Matrix.h"
diff --git a/Source/Engine/Core/Math/Ray.cs b/Source/Engine/Core/Math/Ray.cs
index b229ca10d..8802d9869 100644
--- a/Source/Engine/Core/Math/Ray.cs
+++ b/Source/Engine/Core/Math/Ray.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
// -----------------------------------------------------------------------------
// Original code from SharpDX project. https://github.com/sharpdx/SharpDX/
diff --git a/Source/Engine/Core/Math/Ray.h b/Source/Engine/Core/Math/Ray.h
index 7881ccb46..56d06a21e 100644
--- a/Source/Engine/Core/Math/Ray.h
+++ b/Source/Engine/Core/Math/Ray.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/Core/Math/Rectangle.cpp b/Source/Engine/Core/Math/Rectangle.cpp
index caa88256f..8ac93d71b 100644
--- a/Source/Engine/Core/Math/Rectangle.cpp
+++ b/Source/Engine/Core/Math/Rectangle.cpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#include "Rectangle.h"
#include "../Types/String.h"
diff --git a/Source/Engine/Core/Math/Rectangle.cs b/Source/Engine/Core/Math/Rectangle.cs
index aa61fc4a7..50f9adce4 100644
--- a/Source/Engine/Core/Math/Rectangle.cs
+++ b/Source/Engine/Core/Math/Rectangle.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using System.Globalization;
diff --git a/Source/Engine/Core/Math/Rectangle.h b/Source/Engine/Core/Math/Rectangle.h
index 5282e4a81..305ae70e1 100644
--- a/Source/Engine/Core/Math/Rectangle.h
+++ b/Source/Engine/Core/Math/Rectangle.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/Core/Math/SphericalHarmonics.cs b/Source/Engine/Core/Math/SphericalHarmonics.cs
index ee7fd4f2f..b6ccfc0cb 100644
--- a/Source/Engine/Core/Math/SphericalHarmonics.cs
+++ b/Source/Engine/Core/Math/SphericalHarmonics.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
diff --git a/Source/Engine/Core/Math/Transform.cpp b/Source/Engine/Core/Math/Transform.cpp
index b6313e09a..5ac71779b 100644
--- a/Source/Engine/Core/Math/Transform.cpp
+++ b/Source/Engine/Core/Math/Transform.cpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#include "Transform.h"
#include "Matrix.h"
diff --git a/Source/Engine/Core/Math/Transform.cs b/Source/Engine/Core/Math/Transform.cs
index dc6fe8dd4..21ed705ff 100644
--- a/Source/Engine/Core/Math/Transform.cs
+++ b/Source/Engine/Core/Math/Transform.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using System.Globalization;
diff --git a/Source/Engine/Core/Math/Transform.h b/Source/Engine/Core/Math/Transform.h
index a26b1024d..3b8cf71b7 100644
--- a/Source/Engine/Core/Math/Transform.h
+++ b/Source/Engine/Core/Math/Transform.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/Core/Math/Triangle.h b/Source/Engine/Core/Math/Triangle.h
index 907a607df..03f91ece3 100644
--- a/Source/Engine/Core/Math/Triangle.h
+++ b/Source/Engine/Core/Math/Triangle.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/Core/Math/TypeConverters/ColorConverter.cs b/Source/Engine/Core/Math/TypeConverters/ColorConverter.cs
index 5ebef0ac8..1bf1bb4a1 100644
--- a/Source/Engine/Core/Math/TypeConverters/ColorConverter.cs
+++ b/Source/Engine/Core/Math/TypeConverters/ColorConverter.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using System.ComponentModel;
diff --git a/Source/Engine/Core/Math/TypeConverters/Int2Converter.cs b/Source/Engine/Core/Math/TypeConverters/Int2Converter.cs
index 2efb1bf95..2e835405f 100644
--- a/Source/Engine/Core/Math/TypeConverters/Int2Converter.cs
+++ b/Source/Engine/Core/Math/TypeConverters/Int2Converter.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using System.ComponentModel;
diff --git a/Source/Engine/Core/Math/TypeConverters/Int3Converter.cs b/Source/Engine/Core/Math/TypeConverters/Int3Converter.cs
index bf9fa12a2..f6b61c6f6 100644
--- a/Source/Engine/Core/Math/TypeConverters/Int3Converter.cs
+++ b/Source/Engine/Core/Math/TypeConverters/Int3Converter.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using System.ComponentModel;
diff --git a/Source/Engine/Core/Math/TypeConverters/Int4Converter.cs b/Source/Engine/Core/Math/TypeConverters/Int4Converter.cs
index 2ff1e6d1a..fb05bbc61 100644
--- a/Source/Engine/Core/Math/TypeConverters/Int4Converter.cs
+++ b/Source/Engine/Core/Math/TypeConverters/Int4Converter.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using System.ComponentModel;
diff --git a/Source/Engine/Core/Math/TypeConverters/QuaternionConverter.cs b/Source/Engine/Core/Math/TypeConverters/QuaternionConverter.cs
index c7b81013e..76f4e5d91 100644
--- a/Source/Engine/Core/Math/TypeConverters/QuaternionConverter.cs
+++ b/Source/Engine/Core/Math/TypeConverters/QuaternionConverter.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using System.ComponentModel;
diff --git a/Source/Engine/Core/Math/TypeConverters/Vector2Converter.cs b/Source/Engine/Core/Math/TypeConverters/Vector2Converter.cs
index 24677ac39..b2c07b16f 100644
--- a/Source/Engine/Core/Math/TypeConverters/Vector2Converter.cs
+++ b/Source/Engine/Core/Math/TypeConverters/Vector2Converter.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using System.ComponentModel;
diff --git a/Source/Engine/Core/Math/TypeConverters/Vector3Converter.cs b/Source/Engine/Core/Math/TypeConverters/Vector3Converter.cs
index fad46c6e8..80c0b18e1 100644
--- a/Source/Engine/Core/Math/TypeConverters/Vector3Converter.cs
+++ b/Source/Engine/Core/Math/TypeConverters/Vector3Converter.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using System.ComponentModel;
diff --git a/Source/Engine/Core/Math/TypeConverters/Vector4Converter.cs b/Source/Engine/Core/Math/TypeConverters/Vector4Converter.cs
index e1eba39d1..07774aec7 100644
--- a/Source/Engine/Core/Math/TypeConverters/Vector4Converter.cs
+++ b/Source/Engine/Core/Math/TypeConverters/Vector4Converter.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using System.ComponentModel;
diff --git a/Source/Engine/Core/Math/Vector2.cpp b/Source/Engine/Core/Math/Vector2.cpp
index 2aa2b9e7c..6a0468033 100644
--- a/Source/Engine/Core/Math/Vector2.cpp
+++ b/Source/Engine/Core/Math/Vector2.cpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#include "Vector2.h"
#include "Vector3.h"
diff --git a/Source/Engine/Core/Math/Vector2.cs b/Source/Engine/Core/Math/Vector2.cs
index 129ff19a6..768007180 100644
--- a/Source/Engine/Core/Math/Vector2.cs
+++ b/Source/Engine/Core/Math/Vector2.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
// -----------------------------------------------------------------------------
// Original code from SharpDX project. https://github.com/sharpdx/SharpDX/
diff --git a/Source/Engine/Core/Math/Vector2.h b/Source/Engine/Core/Math/Vector2.h
index d8431413f..7a1b1519b 100644
--- a/Source/Engine/Core/Math/Vector2.h
+++ b/Source/Engine/Core/Math/Vector2.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/Core/Math/Vector3.cpp b/Source/Engine/Core/Math/Vector3.cpp
index 58ca08aa3..e3ff349ba 100644
--- a/Source/Engine/Core/Math/Vector3.cpp
+++ b/Source/Engine/Core/Math/Vector3.cpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#include "Vector2.h"
#include "Vector3.h"
@@ -311,39 +311,32 @@ void Vector3::Unproject(const Vector3& vector, float x, float y, float width, fl
void Vector3::CreateOrthonormalBasis(Vector3& xAxis, Vector3& yAxis, Vector3& zAxis)
{
- // Project the X and Y axes onto the plane perpendicular to the Z axis.
xAxis -= (xAxis | zAxis) / (zAxis | zAxis) * zAxis;
yAxis -= (yAxis | zAxis) / (zAxis | zAxis) * zAxis;
- // If the X axis was parallel to the Z axis, choose a vector which is orthogonal to the Y and Z axes.
if (xAxis.LengthSquared() < ZeroTolerance)
- {
xAxis = yAxis ^ zAxis;
- }
-
- // If the Y axis was parallel to the Z axis, choose a vector which is orthogonal to the X and Z axes.
if (yAxis.LengthSquared() < ZeroTolerance)
- {
yAxis = xAxis ^ zAxis;
- }
- // Normalize the basis vectors.
xAxis.Normalize();
yAxis.Normalize();
zAxis.Normalize();
}
-void Vector3::FindBestAxisVectors(Vector3& Axis1, Vector3& Axis2) const
+void Vector3::FindBestAxisVectors(Vector3& firstAxis, Vector3& secondAxis) const
{
const float absX = Math::Abs(X);
const float absY = Math::Abs(Y);
const float absZ = Math::Abs(Z);
+
if (absZ > absX && absZ > absY)
- Axis1 = Vector3(1, 0, 0);
+ firstAxis = Vector3(1, 0, 0);
else
- Axis1 = Vector3(0, 0, 1);
- Axis1 = (Axis1 - *this * (Axis1 | *this)).GetNormalized();
- Axis2 = Axis1 ^ *this;
+ firstAxis = Vector3(0, 0, 1);
+
+ firstAxis = (firstAxis - *this * (firstAxis | *this)).GetNormalized();
+ secondAxis = firstAxis ^ *this;
}
float Vector3::TriangleArea(const Vector3& v0, const Vector3& v1, const Vector3& v2)
diff --git a/Source/Engine/Core/Math/Vector3.cs b/Source/Engine/Core/Math/Vector3.cs
index 51d59eb71..db27cf8ed 100644
--- a/Source/Engine/Core/Math/Vector3.cs
+++ b/Source/Engine/Core/Math/Vector3.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
// -----------------------------------------------------------------------------
// Original code from SharpDX project. https://github.com/sharpdx/SharpDX/
diff --git a/Source/Engine/Core/Math/Vector3.h b/Source/Engine/Core/Math/Vector3.h
index 09d14f5dd..1f4792e31 100644
--- a/Source/Engine/Core/Math/Vector3.h
+++ b/Source/Engine/Core/Math/Vector3.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
@@ -866,9 +866,9 @@ public:
///
/// Finds the best arbitrary axis vectors to represent U and V axes of a plane, by using this vector as the normal of the plane.
///
- /// The reference to first axis.
- /// The reference to second axis.
- void FindBestAxisVectors(Vector3& Axis1, Vector3& Axis2) const;
+ /// The reference to first axis.
+ /// The reference to second axis.
+ void FindBestAxisVectors(Vector3& firstAxis, Vector3& secondAxis) const;
static Vector3 Round(const Vector3& v)
{
diff --git a/Source/Engine/Core/Math/Vector4.cpp b/Source/Engine/Core/Math/Vector4.cpp
index 335182b99..3caaab985 100644
--- a/Source/Engine/Core/Math/Vector4.cpp
+++ b/Source/Engine/Core/Math/Vector4.cpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#include "Vector4.h"
#include "Vector2.h"
diff --git a/Source/Engine/Core/Math/Vector4.cs b/Source/Engine/Core/Math/Vector4.cs
index 0c74d9ee7..8fc7ca298 100644
--- a/Source/Engine/Core/Math/Vector4.cs
+++ b/Source/Engine/Core/Math/Vector4.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
// -----------------------------------------------------------------------------
// Original code from SharpDX project. https://github.com/sharpdx/SharpDX/
diff --git a/Source/Engine/Core/Math/Vector4.h b/Source/Engine/Core/Math/Vector4.h
index 66761a987..adca955fc 100644
--- a/Source/Engine/Core/Math/Vector4.h
+++ b/Source/Engine/Core/Math/Vector4.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/Core/Math/VectorInt.cpp b/Source/Engine/Core/Math/VectorInt.cpp
index 3f397ba22..300343da5 100644
--- a/Source/Engine/Core/Math/VectorInt.cpp
+++ b/Source/Engine/Core/Math/VectorInt.cpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#include "VectorInt.h"
#include "Vector2.h"
diff --git a/Source/Engine/Core/Math/VectorInt.h b/Source/Engine/Core/Math/VectorInt.h
index 506f98364..80804c39a 100644
--- a/Source/Engine/Core/Math/VectorInt.h
+++ b/Source/Engine/Core/Math/VectorInt.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/Core/Math/Viewport.cpp b/Source/Engine/Core/Math/Viewport.cpp
index 57250e4fe..0bf6c9fbe 100644
--- a/Source/Engine/Core/Math/Viewport.cpp
+++ b/Source/Engine/Core/Math/Viewport.cpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#include "Viewport.h"
#include "Rectangle.h"
diff --git a/Source/Engine/Core/Math/Viewport.cs b/Source/Engine/Core/Math/Viewport.cs
index 2b406b41c..b8af0de7e 100644
--- a/Source/Engine/Core/Math/Viewport.cs
+++ b/Source/Engine/Core/Math/Viewport.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
// -----------------------------------------------------------------------------
// Original code from SharpDX project. https://github.com/sharpdx/SharpDX/
diff --git a/Source/Engine/Core/Math/Viewport.h b/Source/Engine/Core/Math/Viewport.h
index 3e1ec92d8..0b5871f2e 100644
--- a/Source/Engine/Core/Math/Viewport.h
+++ b/Source/Engine/Core/Math/Viewport.h
@@ -1,5 +1,5 @@
// Copyright (c) 2010-2014 SharpDX - Alexandre Mutel
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/Core/Memory/Allocation.h b/Source/Engine/Core/Memory/Allocation.h
index 4298f732a..0c3f93127 100644
--- a/Source/Engine/Core/Memory/Allocation.h
+++ b/Source/Engine/Core/Memory/Allocation.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/Core/Memory/CrtAllocator.h b/Source/Engine/Core/Memory/CrtAllocator.h
index 2ff39ac1d..4dbc7b848 100644
--- a/Source/Engine/Core/Memory/CrtAllocator.h
+++ b/Source/Engine/Core/Memory/CrtAllocator.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/Core/Memory/Memory.h b/Source/Engine/Core/Memory/Memory.h
index 0a2125a49..6341ca21f 100644
--- a/Source/Engine/Core/Memory/Memory.h
+++ b/Source/Engine/Core/Memory/Memory.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/Core/Memory/StlWrapper.h b/Source/Engine/Core/Memory/StlWrapper.h
index d3db0233c..d41103de9 100644
--- a/Source/Engine/Core/Memory/StlWrapper.h
+++ b/Source/Engine/Core/Memory/StlWrapper.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/Core/NonCopyable.h b/Source/Engine/Core/NonCopyable.h
index 35448963f..f5b07dce0 100644
--- a/Source/Engine/Core/NonCopyable.h
+++ b/Source/Engine/Core/NonCopyable.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/Core/Object.cpp b/Source/Engine/Core/Object.cpp
index 9dfaac7be..d931741dc 100644
--- a/Source/Engine/Core/Object.cpp
+++ b/Source/Engine/Core/Object.cpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#include "Object.h"
#include "ObjectsRemovalService.h"
diff --git a/Source/Engine/Core/Object.h b/Source/Engine/Core/Object.h
index 0dda3cd06..d48e151b7 100644
--- a/Source/Engine/Core/Object.h
+++ b/Source/Engine/Core/Object.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/Core/ObjectsRemovalService.cpp b/Source/Engine/Core/ObjectsRemovalService.cpp
index 89b96b082..a36265646 100644
--- a/Source/Engine/Core/ObjectsRemovalService.cpp
+++ b/Source/Engine/Core/ObjectsRemovalService.cpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#include "ObjectsRemovalService.h"
#include "Collections/Dictionary.h"
diff --git a/Source/Engine/Core/ObjectsRemovalService.h b/Source/Engine/Core/ObjectsRemovalService.h
index cdfaf042a..883dc19ae 100644
--- a/Source/Engine/Core/ObjectsRemovalService.h
+++ b/Source/Engine/Core/ObjectsRemovalService.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/Core/Random.h b/Source/Engine/Core/Random.h
index ffb0ae4cc..f77121c4f 100644
--- a/Source/Engine/Core/Random.h
+++ b/Source/Engine/Core/Random.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/Core/RandomStream.h b/Source/Engine/Core/RandomStream.h
index 2e88f2e2f..4fee95738 100644
--- a/Source/Engine/Core/RandomStream.h
+++ b/Source/Engine/Core/RandomStream.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
@@ -138,9 +138,9 @@ public:
float l;
do
{
- result.X = GetFraction() * 2.f - 1.f;
- result.Y = GetFraction() * 2.f - 1.f;
- result.Z = GetFraction() * 2.f - 1.f;
+ result.X = GetFraction() * 2.0f - 1.0f;
+ result.Y = GetFraction() * 2.0f - 1.0f;
+ result.Z = GetFraction() * 2.0f - 1.0f;
l = result.LengthSquared();
} while (l > 1.0f || l < ZeroTolerance);
return Vector3::Normalize(result);
diff --git a/Source/Engine/Core/SIMD.h b/Source/Engine/Core/SIMD.h
index b3e88ed48..c71f8ee04 100644
--- a/Source/Engine/Core/SIMD.h
+++ b/Source/Engine/Core/SIMD.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/Core/Singleton.h b/Source/Engine/Core/Singleton.h
index dcd044573..4748c4c38 100644
--- a/Source/Engine/Core/Singleton.h
+++ b/Source/Engine/Core/Singleton.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/Core/Templates.h b/Source/Engine/Core/Templates.h
index f2daba01a..57407d860 100644
--- a/Source/Engine/Core/Templates.h
+++ b/Source/Engine/Core/Templates.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/Core/Types/BaseTypes.h b/Source/Engine/Core/Types/BaseTypes.h
index 63638e304..c8cf21f99 100644
--- a/Source/Engine/Core/Types/BaseTypes.h
+++ b/Source/Engine/Core/Types/BaseTypes.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/Core/Types/CommonValue.cpp b/Source/Engine/Core/Types/CommonValue.cpp
index b2b2d8c55..9815670e4 100644
--- a/Source/Engine/Core/Types/CommonValue.cpp
+++ b/Source/Engine/Core/Types/CommonValue.cpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#include "CommonValue.h"
#include "Engine/Scripting/ScriptingObject.h"
diff --git a/Source/Engine/Core/Types/CommonValue.h b/Source/Engine/Core/Types/CommonValue.h
index 8fcfc3ca4..91e468a20 100644
--- a/Source/Engine/Core/Types/CommonValue.h
+++ b/Source/Engine/Core/Types/CommonValue.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/Core/Types/DataContainer.h b/Source/Engine/Core/Types/DataContainer.h
index 28cab6897..954ff24e2 100644
--- a/Source/Engine/Core/Types/DataContainer.h
+++ b/Source/Engine/Core/Types/DataContainer.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/Core/Types/DateTime.cpp b/Source/Engine/Core/Types/DateTime.cpp
index 7b68c3747..5090c62a1 100644
--- a/Source/Engine/Core/Types/DateTime.cpp
+++ b/Source/Engine/Core/Types/DateTime.cpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#include "DateTime.h"
#include "TimeSpan.h"
@@ -6,8 +6,8 @@
#include "Engine/Platform/Platform.h"
#include "Engine/Core/Math/Math.h"
-const int32 DateTime::DaysPerMonth[] = { 0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };
-const int32 DateTime::DaysToMonth[] = { 0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334, 365 };
+const int32 DateTime::CachedDaysPerMonth[] = { 0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };
+const int32 DateTime::CachedDaysToMonth[] = { 0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334, 365 };
DateTime::DateTime(int32 year, int32 month, int32 day, int32 hour, int32 minute, int32 second, int32 millisecond)
{
@@ -17,7 +17,7 @@ DateTime::DateTime(int32 year, int32 month, int32 day, int32 hour, int32 minute,
totalDays++;
year--;
month--;
- totalDays += year * 365 + year / 4 - year / 100 + year / 400 + DaysToMonth[month] + day - 1;
+ totalDays += year * 365 + year / 4 - year / 100 + year / 400 + CachedDaysToMonth[month] + day - 1;
Ticks = totalDays * Constants::TicksPerDay
+ hour * Constants::TicksPerHour
+ minute * Constants::TicksPerMinute
@@ -27,7 +27,7 @@ DateTime::DateTime(int32 year, int32 month, int32 day, int32 hour, int32 minute,
void DateTime::GetDate(int32& year, int32& month, int32& day) const
{
- // Based on FORTRAN code in:
+ // Based on:
// Fliegel, H. F. and van Flandern, T. C.,
// Communications of the ACM, Vol. 11, No. 10 (October 1968).
@@ -56,7 +56,6 @@ int32 DateTime::GetDay() const
DayOfWeek DateTime::GetDayOfWeek() const
{
- // January 1, 0001 was a Monday
return static_cast((Ticks / Constants::TicksPerDay) % 7);
}
@@ -64,8 +63,8 @@ int32 DateTime::GetDayOfYear() const
{
int32 year, month, day;
GetDate(year, month, day);
- for (int32 currentMonth = 1; currentMonth < month; currentMonth++)
- day += DaysInMonth(year, currentMonth);
+ for (int32 i = 1; i < month; i++)
+ day += DaysInMonth(year, i);
return day;
}
@@ -98,7 +97,7 @@ int32 DateTime::DaysInMonth(int32 year, int32 month)
ASSERT_LOW_LAYER((month >= 1) && (month <= 12));
if (month == 2 && IsLeapYear(year))
return 29;
- return DaysPerMonth[month];
+ return CachedDaysPerMonth[month];
}
int32 DateTime::DaysInYear(int32 year)
@@ -131,13 +130,7 @@ DateTime DateTime::NowUTC()
bool DateTime::Validate(int32 year, int32 month, int32 day, int32 hour, int32 minute, int32 second, int32 millisecond)
{
- return (year >= 1) && (year <= 9999) &&
- (month >= 1) && (month <= 12) &&
- (day >= 1) && (day <= DaysInMonth(year, month)) &&
- (hour >= 0) && (hour <= 23) &&
- (minute >= 0) && (minute <= 59) &&
- (second >= 0) && (second <= 59) &&
- (millisecond >= 0) && (millisecond <= 999);
+ return year >= 1 && year <= 999999 && month >= 1 && month <= 12 && day >= 1 && day <= DaysInMonth(year, month) && hour >= 0 && hour <= 23 && minute >= 0 && minute <= 59 && second >= 0 && second <= 59 && millisecond >= 0 && millisecond <= 999;
}
String DateTime::ToString() const
diff --git a/Source/Engine/Core/Types/DateTime.h b/Source/Engine/Core/Types/DateTime.h
index 03b71a433..a1bf245e1 100644
--- a/Source/Engine/Core/Types/DateTime.h
+++ b/Source/Engine/Core/Types/DateTime.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
@@ -23,8 +23,8 @@ API_STRUCT(InBuild, Namespace="System") struct FLAXENGINE_API DateTime
{
private:
- static const int32 DaysPerMonth[];
- static const int32 DaysToMonth[];
+ static const int32 CachedDaysPerMonth[];
+ static const int32 CachedDaysToMonth[];
public:
diff --git a/Source/Engine/Core/Types/Guid.cpp b/Source/Engine/Core/Types/Guid.cpp
index c56f60ab5..323949646 100644
--- a/Source/Engine/Core/Types/Guid.cpp
+++ b/Source/Engine/Core/Types/Guid.cpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#include "Guid.h"
#include "String.h"
diff --git a/Source/Engine/Core/Types/Guid.h b/Source/Engine/Core/Types/Guid.h
index 81b4e45e9..93deeb85c 100644
--- a/Source/Engine/Core/Types/Guid.h
+++ b/Source/Engine/Core/Types/Guid.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/Core/Types/Nullable.h b/Source/Engine/Core/Types/Nullable.h
index 9d1a36658..08746ffd1 100644
--- a/Source/Engine/Core/Types/Nullable.h
+++ b/Source/Engine/Core/Types/Nullable.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/Core/Types/Pair.h b/Source/Engine/Core/Types/Pair.h
index 352c9e0f9..d766aeff5 100644
--- a/Source/Engine/Core/Types/Pair.h
+++ b/Source/Engine/Core/Types/Pair.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/Core/Types/Span.h b/Source/Engine/Core/Types/Span.h
index 9a5c65af5..3fad2fcbf 100644
--- a/Source/Engine/Core/Types/Span.h
+++ b/Source/Engine/Core/Types/Span.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/Core/Types/String.cpp b/Source/Engine/Core/Types/String.cpp
index 76f6e40ad..103dbaf00 100644
--- a/Source/Engine/Core/Types/String.cpp
+++ b/Source/Engine/Core/Types/String.cpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#include "String.h"
#include "StringView.h"
diff --git a/Source/Engine/Core/Types/String.h b/Source/Engine/Core/Types/String.h
index da8bbc3ad..4d1ef4e7f 100644
--- a/Source/Engine/Core/Types/String.h
+++ b/Source/Engine/Core/Types/String.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
@@ -417,27 +417,23 @@ public:
int32 Replace(const T* searchText, const T* replacementText, StringSearchCase searchCase = StringSearchCase::CaseSensitive)
{
- int32 replacementCount = 0;
-
- if (HasChars()
- && searchText != nullptr && *searchText != 0
- && replacementText != nullptr && (searchCase == StringSearchCase::IgnoreCase || StringUtils::Compare(searchText, replacementText) != 0))
+ int32 replacedCount = 0;
+ if (HasChars() && searchText && *searchText && replacementText && (searchCase == StringSearchCase::IgnoreCase || StringUtils::Compare(searchText, replacementText) != 0))
{
- const int32 numCharsToReplace = StringUtils::Length(searchText);
- const int32 numCharsToInsert = StringUtils::Length(replacementText);
-
- if (numCharsToInsert == numCharsToReplace)
+ const int32 searchTextLength = StringUtils::Length(searchText);
+ const int32 replacementTextLength = StringUtils::Length(replacementText);
+ if (searchTextLength == replacementTextLength)
{
T* pos = (T*)(searchCase == StringSearchCase::IgnoreCase ? StringUtils::FindIgnoreCase(_data, searchText) : StringUtils::Find(_data, searchText));
while (pos != nullptr)
{
- replacementCount++;
+ replacedCount++;
- for (int32 i = 0; i < numCharsToInsert; i++)
+ for (int32 i = 0; i < replacementTextLength; i++)
pos[i] = replacementText[i];
- if (pos + numCharsToReplace - **this < Length())
- pos = (T*)(searchCase == StringSearchCase::IgnoreCase ? StringUtils::FindIgnoreCase(pos + numCharsToReplace, searchText) : StringUtils::Find(pos + numCharsToReplace, searchText));
+ if (pos + searchTextLength - **this < Length())
+ pos = (T*)(searchCase == StringSearchCase::IgnoreCase ? StringUtils::FindIgnoreCase(pos + searchTextLength, searchText) : StringUtils::Find(pos + searchTextLength, searchText));
else
break;
}
@@ -448,14 +444,14 @@ public:
T* searchPosition = (T*)(searchCase == StringSearchCase::IgnoreCase ? StringUtils::FindIgnoreCase(readPosition, searchText) : StringUtils::Find(readPosition, searchText));
while (searchPosition != nullptr)
{
- replacementCount++;
- readPosition = searchPosition + numCharsToReplace;
+ replacedCount++;
+ readPosition = searchPosition + searchTextLength;
searchPosition = (T*)(searchCase == StringSearchCase::IgnoreCase ? StringUtils::FindIgnoreCase(readPosition, searchText) : StringUtils::Find(readPosition, searchText));
}
const auto oldLength = _length;
const auto oldData = _data;
- _length += replacementCount * (numCharsToInsert - numCharsToReplace);
+ _length += replacedCount * (replacementTextLength - searchTextLength);
_data = (T*)Platform::Allocate((_length + 1) * sizeof(T), 16);
T* writePosition = _data;
@@ -467,10 +463,10 @@ public:
Platform::MemoryCopy(writePosition, readPosition, writeOffset * sizeof(T));
writePosition += writeOffset;
- Platform::MemoryCopy(writePosition, replacementText, numCharsToInsert * sizeof(T));
- writePosition += numCharsToInsert;
+ Platform::MemoryCopy(writePosition, replacementText, replacementTextLength * sizeof(T));
+ writePosition += replacementTextLength;
- readPosition = searchPosition + numCharsToReplace;
+ readPosition = searchPosition + searchTextLength;
searchPosition = (T*)(searchCase == StringSearchCase::IgnoreCase ? StringUtils::FindIgnoreCase(readPosition, searchText) : StringUtils::Find(readPosition, searchText));
}
@@ -482,7 +478,7 @@ public:
}
}
- return replacementCount;
+ return replacedCount;
}
///
diff --git a/Source/Engine/Core/Types/StringBuilder.h b/Source/Engine/Core/Types/StringBuilder.h
index 430b44072..f38d5279e 100644
--- a/Source/Engine/Core/Types/StringBuilder.h
+++ b/Source/Engine/Core/Types/StringBuilder.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/Core/Types/StringView.cpp b/Source/Engine/Core/Types/StringView.cpp
index 5d7102b6e..43776605a 100644
--- a/Source/Engine/Core/Types/StringView.cpp
+++ b/Source/Engine/Core/Types/StringView.cpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#include "StringView.h"
#include "String.h"
@@ -45,12 +45,12 @@ StringAnsi StringView::ToStringAnsi() const
bool operator==(const String& a, const StringView& b)
{
- return StringUtils::Compare(a.GetText(), b.GetText()) == 0;
+ return a.Length() == b.Length() && StringUtils::Compare(a.GetText(), b.GetText(), b.Length()) == 0;
}
bool operator!=(const String& a, const StringView& b)
{
- return StringUtils::Compare(a.GetText(), b.GetText()) != 0;
+ return a.Length() != b.Length() || StringUtils::Compare(a.GetText(), b.GetText(), b.Length()) != 0;
}
StringAnsiView StringAnsiView::Empty;
@@ -95,10 +95,10 @@ StringAnsi StringAnsiView::ToStringAnsi() const
bool operator==(const StringAnsi& a, const StringAnsiView& b)
{
- return StringUtils::Compare(a.GetText(), b.GetText()) == 0;
+ return a.Length() == b.Length() && StringUtils::Compare(a.GetText(), b.GetText(), b.Length()) == 0;
}
bool operator!=(const StringAnsi& a, const StringAnsiView& b)
{
- return StringUtils::Compare(a.GetText(), b.GetText()) != 0;
+ return a.Length() != b.Length() || StringUtils::Compare(a.GetText(), b.GetText(), b.Length()) != 0;
}
diff --git a/Source/Engine/Core/Types/StringView.h b/Source/Engine/Core/Types/StringView.h
index 09cebb697..5d5ad2799 100644
--- a/Source/Engine/Core/Types/StringView.h
+++ b/Source/Engine/Core/Types/StringView.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
@@ -347,8 +347,8 @@ inline uint32 GetHash(const StringView& key)
return StringUtils::GetHashCode(key.Get(), key.Length());
}
-bool operator==(const String& a, const StringView& b);
-bool operator!=(const String& a, const StringView& b);
+bool FLAXENGINE_API operator==(const String& a, const StringView& b);
+bool FLAXENGINE_API operator!=(const String& a, const StringView& b);
namespace fmt
{
@@ -525,8 +525,8 @@ inline uint32 GetHash(const StringAnsiView& key)
return StringUtils::GetHashCode(key.Get(), key.Length());
}
-bool operator==(const StringAnsi& a, const StringAnsiView& b);
-bool operator!=(const StringAnsi& a, const StringAnsiView& b);
+bool FLAXENGINE_API operator==(const StringAnsi& a, const StringAnsiView& b);
+bool FLAXENGINE_API operator!=(const StringAnsi& a, const StringAnsiView& b);
namespace fmt
{
diff --git a/Source/Engine/Core/Types/TimeSpan.cpp b/Source/Engine/Core/Types/TimeSpan.cpp
index aa90fcf8d..92700c0fe 100644
--- a/Source/Engine/Core/Types/TimeSpan.cpp
+++ b/Source/Engine/Core/Types/TimeSpan.cpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#include "TimeSpan.h"
#include "String.h"
@@ -33,7 +33,7 @@ TimeSpan TimeSpan::FromSeconds(double seconds)
return TimeSpan(static_cast(seconds * Constants::TicksPerSecond));
}
-void TimeSpan::Assign(int32 days, int32 hours, int32 minutes, int32 seconds, int32 milliseconds)
+void TimeSpan::Set(int32 days, int32 hours, int32 minutes, int32 seconds, int32 milliseconds)
{
const int64 totalMs = 1000 * (60 * 60 * 24 * (int64)days + 60 * 60 * (int64)hours + 60 * (int64)minutes + (int64)seconds) + (int64)milliseconds;
ASSERT_LOW_LAYER((totalMs >= MinValue().GetTotalMilliseconds()) && (totalMs <= MaxValue().GetTotalMilliseconds()));
diff --git a/Source/Engine/Core/Types/TimeSpan.h b/Source/Engine/Core/Types/TimeSpan.h
index e26c5cc5a..0b56d8ee1 100644
--- a/Source/Engine/Core/Types/TimeSpan.h
+++ b/Source/Engine/Core/Types/TimeSpan.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
@@ -49,8 +49,10 @@ public:
{
}
- // Init
- // @param ticks The number of ticks
+ ///
+ /// Initializes a new instance of the struct.
+ ///
+ /// The ticks in 100 nanoseconds resolution.
TimeSpan(int64 ticks)
: Ticks(ticks)
{
@@ -62,7 +64,7 @@ public:
// @param Minutes Amount of minutes
TimeSpan(int32 days, int32 hours, int32 minutes)
{
- Assign(days, hours, minutes, 0, 0);
+ Set(days, hours, minutes, 0, 0);
}
// Init
@@ -72,7 +74,7 @@ public:
// @param Seconds Amount of seconds
TimeSpan(int32 days, int32 hours, int32 minutes, int32 seconds)
{
- Assign(days, hours, minutes, seconds, 0);
+ Set(days, hours, minutes, seconds, 0);
}
// Init
@@ -83,7 +85,7 @@ public:
// @param Milliseconds Amount of milliseconds
TimeSpan(int32 days, int32 hours, int32 minutes, int32 seconds, int32 milliseconds)
{
- Assign(days, hours, minutes, seconds, milliseconds);
+ Set(days, hours, minutes, seconds, milliseconds);
}
public:
@@ -325,7 +327,7 @@ public:
private:
- void Assign(int32 days, int32 hours, int32 minutes, int32 seconds, int32 milliseconds);
+ void Set(int32 days, int32 hours, int32 minutes, int32 seconds, int32 milliseconds);
};
inline TimeSpan operator*(float scalar, const TimeSpan& timespan)
diff --git a/Source/Engine/Core/Types/Variant.cpp b/Source/Engine/Core/Types/Variant.cpp
index e35aad308..62c791875 100644
--- a/Source/Engine/Core/Types/Variant.cpp
+++ b/Source/Engine/Core/Types/Variant.cpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#include "Variant.h"
#include "CommonValue.h"
diff --git a/Source/Engine/Core/Types/Variant.h b/Source/Engine/Core/Types/Variant.h
index 24f8b94c2..98fd9cf24 100644
--- a/Source/Engine/Core/Types/Variant.h
+++ b/Source/Engine/Core/Types/Variant.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/Core/Types/Version.cpp b/Source/Engine/Core/Types/Version.cpp
index e19b2970e..07dbee646 100644
--- a/Source/Engine/Core/Types/Version.cpp
+++ b/Source/Engine/Core/Types/Version.cpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#include "Version.h"
#include "Engine/Core/Types/StringBuilder.h"
diff --git a/Source/Engine/Core/Types/Version.h b/Source/Engine/Core/Types/Version.h
index 4535eb197..6d0bac6b1 100644
--- a/Source/Engine/Core/Types/Version.h
+++ b/Source/Engine/Core/Types/Version.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/Core/Utilities.h b/Source/Engine/Core/Utilities.h
index a333245d0..8d77c508d 100644
--- a/Source/Engine/Core/Utilities.h
+++ b/Source/Engine/Core/Utilities.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/Debug/Assert.cs b/Source/Engine/Debug/Assert.cs
index af1d03ca1..8a80048c5 100644
--- a/Source/Engine/Debug/Assert.cs
+++ b/Source/Engine/Debug/Assert.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using System.Collections.Generic;
diff --git a/Source/Engine/Debug/AssertionException.cs b/Source/Engine/Debug/AssertionException.cs
index 19d75301a..c986fbc01 100644
--- a/Source/Engine/Debug/AssertionException.cs
+++ b/Source/Engine/Debug/AssertionException.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
diff --git a/Source/Engine/Debug/Debug.Build.cs b/Source/Engine/Debug/Debug.Build.cs
index c077ab814..efc8a9c6e 100644
--- a/Source/Engine/Debug/Debug.Build.cs
+++ b/Source/Engine/Debug/Debug.Build.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System.Collections.Generic;
using System.IO;
diff --git a/Source/Engine/Debug/DebugDraw.cpp b/Source/Engine/Debug/DebugDraw.cpp
index c147f104d..b5e4b8540 100644
--- a/Source/Engine/Debug/DebugDraw.cpp
+++ b/Source/Engine/Debug/DebugDraw.cpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#if COMPILE_WITH_DEBUG_DRAW
diff --git a/Source/Engine/Debug/DebugDraw.cs b/Source/Engine/Debug/DebugDraw.cs
index aa3e69bc9..e45cd4312 100644
--- a/Source/Engine/Debug/DebugDraw.cs
+++ b/Source/Engine/Debug/DebugDraw.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#if !FLAX_EDITOR
using System;
diff --git a/Source/Engine/Debug/DebugDraw.h b/Source/Engine/Debug/DebugDraw.h
index f0545ea78..6027c6697 100644
--- a/Source/Engine/Debug/DebugDraw.h
+++ b/Source/Engine/Debug/DebugDraw.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/Debug/DebugLog.cpp b/Source/Engine/Debug/DebugLog.cpp
index f738ce513..edd3b838d 100644
--- a/Source/Engine/Debug/DebugLog.cpp
+++ b/Source/Engine/Debug/DebugLog.cpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#include "DebugLog.h"
#include "Engine/Core/Log.h"
diff --git a/Source/Engine/Debug/DebugLog.h b/Source/Engine/Debug/DebugLog.h
index 905ed5ce5..6ef7f8242 100644
--- a/Source/Engine/Debug/DebugLog.h
+++ b/Source/Engine/Debug/DebugLog.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/Debug/Exception.cpp b/Source/Engine/Debug/Exception.cpp
index f495f6dd8..c224bf60a 100644
--- a/Source/Engine/Debug/Exception.cpp
+++ b/Source/Engine/Debug/Exception.cpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#include "Exception.h"
diff --git a/Source/Engine/Debug/Exception.h b/Source/Engine/Debug/Exception.h
index 39a1ddb83..481c78589 100644
--- a/Source/Engine/Debug/Exception.h
+++ b/Source/Engine/Debug/Exception.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/Debug/Exceptions/ArgumentException.h b/Source/Engine/Debug/Exceptions/ArgumentException.h
index 9d7fdb88a..2208eabb8 100644
--- a/Source/Engine/Debug/Exceptions/ArgumentException.h
+++ b/Source/Engine/Debug/Exceptions/ArgumentException.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/Debug/Exceptions/ArgumentNullException.h b/Source/Engine/Debug/Exceptions/ArgumentNullException.h
index ef1a4fe59..f7f71019c 100644
--- a/Source/Engine/Debug/Exceptions/ArgumentNullException.h
+++ b/Source/Engine/Debug/Exceptions/ArgumentNullException.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/Debug/Exceptions/ArgumentOutOfRangeException.h b/Source/Engine/Debug/Exceptions/ArgumentOutOfRangeException.h
index fdcef957a..dc6212d23 100644
--- a/Source/Engine/Debug/Exceptions/ArgumentOutOfRangeException.h
+++ b/Source/Engine/Debug/Exceptions/ArgumentOutOfRangeException.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/Debug/Exceptions/CLRInnerException.h b/Source/Engine/Debug/Exceptions/CLRInnerException.h
index f949d168d..d514277be 100644
--- a/Source/Engine/Debug/Exceptions/CLRInnerException.h
+++ b/Source/Engine/Debug/Exceptions/CLRInnerException.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/Debug/Exceptions/DivideByZeroException.h b/Source/Engine/Debug/Exceptions/DivideByZeroException.h
index e8e1ef165..6cdc6f44f 100644
--- a/Source/Engine/Debug/Exceptions/DivideByZeroException.h
+++ b/Source/Engine/Debug/Exceptions/DivideByZeroException.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/Debug/Exceptions/Exceptions.h b/Source/Engine/Debug/Exceptions/Exceptions.h
index 0d5319b11..46fb878cf 100644
--- a/Source/Engine/Debug/Exceptions/Exceptions.h
+++ b/Source/Engine/Debug/Exceptions/Exceptions.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/Debug/Exceptions/FileNotFoundException.h b/Source/Engine/Debug/Exceptions/FileNotFoundException.h
index 66b142084..bcd4892bd 100644
--- a/Source/Engine/Debug/Exceptions/FileNotFoundException.h
+++ b/Source/Engine/Debug/Exceptions/FileNotFoundException.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/Debug/Exceptions/IOException.h b/Source/Engine/Debug/Exceptions/IOException.h
index 771a6983a..d968b841a 100644
--- a/Source/Engine/Debug/Exceptions/IOException.h
+++ b/Source/Engine/Debug/Exceptions/IOException.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/Debug/Exceptions/IndexOutOfRangeException.h b/Source/Engine/Debug/Exceptions/IndexOutOfRangeException.h
index a025623f0..04a56918c 100644
--- a/Source/Engine/Debug/Exceptions/IndexOutOfRangeException.h
+++ b/Source/Engine/Debug/Exceptions/IndexOutOfRangeException.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/Debug/Exceptions/InvalidOperationException.h b/Source/Engine/Debug/Exceptions/InvalidOperationException.h
index 3cd9a212c..fafceeb04 100644
--- a/Source/Engine/Debug/Exceptions/InvalidOperationException.h
+++ b/Source/Engine/Debug/Exceptions/InvalidOperationException.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/Debug/Exceptions/JsonParseException.h b/Source/Engine/Debug/Exceptions/JsonParseException.h
index 767654ab9..765d7855e 100644
--- a/Source/Engine/Debug/Exceptions/JsonParseException.h
+++ b/Source/Engine/Debug/Exceptions/JsonParseException.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
@@ -23,8 +23,9 @@ namespace Log
/// Init
///
/// Parsing error code.
- JsonParseException(ErrorCode error)
- : JsonParseException(error, String::Empty)
+ /// Parsing error location.
+ JsonParseException(ErrorCode error, size_t offset)
+ : JsonParseException(error, offset, String::Empty)
{
}
@@ -32,9 +33,10 @@ namespace Log
/// Creates default exception with additional data
///
/// Parsing error code.
+ /// Parsing error location.
/// Additional information that help describe error
- JsonParseException(ErrorCode error, const String& additionalInfo)
- : Exception(String::Format(TEXT("Parsing Json failed with error code {0}. {1}"), static_cast(error), GetParseError_En(error)), additionalInfo)
+ JsonParseException(ErrorCode error, size_t offset, const String& additionalInfo)
+ : Exception(String::Format(TEXT("Parsing Json failed with error code {0} (offset {2}). {1}"), static_cast(error), GetParseError_En(error), offset), additionalInfo)
{
}
};
diff --git a/Source/Engine/Debug/Exceptions/NotImplementedException.h b/Source/Engine/Debug/Exceptions/NotImplementedException.h
index dfbaf4c44..42c14a4c0 100644
--- a/Source/Engine/Debug/Exceptions/NotImplementedException.h
+++ b/Source/Engine/Debug/Exceptions/NotImplementedException.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/Debug/Exceptions/NotSupportedException.h b/Source/Engine/Debug/Exceptions/NotSupportedException.h
index f1e8addad..42f0331b2 100644
--- a/Source/Engine/Debug/Exceptions/NotSupportedException.h
+++ b/Source/Engine/Debug/Exceptions/NotSupportedException.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/Debug/Exceptions/OverflowException.h b/Source/Engine/Debug/Exceptions/OverflowException.h
index 327c05b19..99c3a5444 100644
--- a/Source/Engine/Debug/Exceptions/OverflowException.h
+++ b/Source/Engine/Debug/Exceptions/OverflowException.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/Debug/Exceptions/PathTooLongException.h b/Source/Engine/Debug/Exceptions/PathTooLongException.h
index ae757bbfe..12902d84a 100644
--- a/Source/Engine/Debug/Exceptions/PathTooLongException.h
+++ b/Source/Engine/Debug/Exceptions/PathTooLongException.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/Debug/Exceptions/PlatformNotSupportedException.h b/Source/Engine/Debug/Exceptions/PlatformNotSupportedException.h
index 30336cd16..def664b90 100644
--- a/Source/Engine/Debug/Exceptions/PlatformNotSupportedException.h
+++ b/Source/Engine/Debug/Exceptions/PlatformNotSupportedException.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/Debug/Exceptions/TimeoutException.h b/Source/Engine/Debug/Exceptions/TimeoutException.h
index 7d0e1207d..2176ab8dc 100644
--- a/Source/Engine/Debug/Exceptions/TimeoutException.h
+++ b/Source/Engine/Debug/Exceptions/TimeoutException.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/Debug/FloatComparer.cs b/Source/Engine/Debug/FloatComparer.cs
index 52b4eef83..06cc6f661 100644
--- a/Source/Engine/Debug/FloatComparer.cs
+++ b/Source/Engine/Debug/FloatComparer.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using System.Collections.Generic;
diff --git a/Source/Engine/Engine/Android/AndroidGame.h b/Source/Engine/Engine/Android/AndroidGame.h
index 5a832038c..3f80dfa53 100644
--- a/Source/Engine/Engine/Android/AndroidGame.h
+++ b/Source/Engine/Engine/Android/AndroidGame.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/Engine/Application.h b/Source/Engine/Engine/Application.h
index 9a6ffdbf9..edf1da73d 100644
--- a/Source/Engine/Engine/Application.h
+++ b/Source/Engine/Engine/Application.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/Engine/Base/ApplicationBase.h b/Source/Engine/Engine/Base/ApplicationBase.h
index ed7248327..7ac7632a3 100644
--- a/Source/Engine/Engine/Base/ApplicationBase.h
+++ b/Source/Engine/Engine/Base/ApplicationBase.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/Engine/Base/GameBase.cpp b/Source/Engine/Engine/Base/GameBase.cpp
index d4e39028a..6c02ce1d1 100644
--- a/Source/Engine/Engine/Base/GameBase.cpp
+++ b/Source/Engine/Engine/Base/GameBase.cpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#include "../Game.h"
diff --git a/Source/Engine/Engine/Base/GameBase.h b/Source/Engine/Engine/Base/GameBase.h
index 273a61098..0c65e16db 100644
--- a/Source/Engine/Engine/Base/GameBase.h
+++ b/Source/Engine/Engine/Base/GameBase.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/Engine/CommandLine.cpp b/Source/Engine/Engine/CommandLine.cpp
index 3e73d8a45..707f99de1 100644
--- a/Source/Engine/Engine/CommandLine.cpp
+++ b/Source/Engine/Engine/CommandLine.cpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#include "CommandLine.h"
#include "Engine/Core/Collections/Array.h"
diff --git a/Source/Engine/Engine/CommandLine.h b/Source/Engine/Engine/CommandLine.h
index 6b1acb191..065135b48 100644
--- a/Source/Engine/Engine/CommandLine.h
+++ b/Source/Engine/Engine/CommandLine.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/Engine/Debug.cs b/Source/Engine/Engine/Debug.cs
index 79add4e49..3d908a5c2 100644
--- a/Source/Engine/Engine/Debug.cs
+++ b/Source/Engine/Engine/Debug.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using System.Diagnostics;
diff --git a/Source/Engine/Engine/DebugLogHandler.cs b/Source/Engine/Engine/DebugLogHandler.cs
index bd4052e35..c1dc9f9dd 100644
--- a/Source/Engine/Engine/DebugLogHandler.cs
+++ b/Source/Engine/Engine/DebugLogHandler.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using System.Diagnostics;
diff --git a/Source/Engine/Engine/Engine.Build.cs b/Source/Engine/Engine/Engine.Build.cs
index b380b437a..507651f8f 100644
--- a/Source/Engine/Engine/Engine.Build.cs
+++ b/Source/Engine/Engine/Engine.Build.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System.IO;
using Flax.Build;
diff --git a/Source/Engine/Engine/Engine.cpp b/Source/Engine/Engine/Engine.cpp
index 093b4080d..ef1a26e60 100644
--- a/Source/Engine/Engine/Engine.cpp
+++ b/Source/Engine/Engine/Engine.cpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#include "Engine.h"
#include "Game.h"
diff --git a/Source/Engine/Engine/Engine.h b/Source/Engine/Engine/Engine.h
index 2fcac273f..22aeac9f0 100644
--- a/Source/Engine/Engine/Engine.h
+++ b/Source/Engine/Engine/Engine.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/Engine/EngineService.cpp b/Source/Engine/Engine/EngineService.cpp
index ca9ccb626..90e9a8d78 100644
--- a/Source/Engine/Engine/EngineService.cpp
+++ b/Source/Engine/Engine/EngineService.cpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#include "EngineService.h"
#include "Engine/Core/Log.h"
diff --git a/Source/Engine/Engine/EngineService.h b/Source/Engine/Engine/EngineService.h
index 54ecc2808..23bc1b615 100644
--- a/Source/Engine/Engine/EngineService.h
+++ b/Source/Engine/Engine/EngineService.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/Engine/FlaxException.cs b/Source/Engine/Engine/FlaxException.cs
index aa1b677cc..64805d800 100644
--- a/Source/Engine/Engine/FlaxException.cs
+++ b/Source/Engine/Engine/FlaxException.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
diff --git a/Source/Engine/Engine/Game.h b/Source/Engine/Engine/Game.h
index a0a3c515c..2e9050314 100644
--- a/Source/Engine/Engine/Game.h
+++ b/Source/Engine/Engine/Game.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/Engine/GameplayGlobals.cpp b/Source/Engine/Engine/GameplayGlobals.cpp
index 791a823a7..944253b4a 100644
--- a/Source/Engine/Engine/GameplayGlobals.cpp
+++ b/Source/Engine/Engine/GameplayGlobals.cpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#include "GameplayGlobals.h"
#include "Engine/Core/Log.h"
diff --git a/Source/Engine/Engine/GameplayGlobals.h b/Source/Engine/Engine/GameplayGlobals.h
index 4bfdff91c..f07ab43c9 100644
--- a/Source/Engine/Engine/GameplayGlobals.h
+++ b/Source/Engine/Engine/GameplayGlobals.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/Engine/Globals.cpp b/Source/Engine/Engine/Globals.cpp
index a2516ec69..9f180fa12 100644
--- a/Source/Engine/Engine/Globals.cpp
+++ b/Source/Engine/Engine/Globals.cpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#include "Globals.h"
#include "Engine/Core/Types/String.h"
diff --git a/Source/Engine/Engine/Globals.h b/Source/Engine/Engine/Globals.h
index 9baf832ef..16c47d8ee 100644
--- a/Source/Engine/Engine/Globals.h
+++ b/Source/Engine/Engine/Globals.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/Engine/IDrawable.cs b/Source/Engine/Engine/IDrawable.cs
index 485445a7a..4babee303 100644
--- a/Source/Engine/Engine/IDrawable.cs
+++ b/Source/Engine/Engine/IDrawable.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
namespace FlaxEngine
{
diff --git a/Source/Engine/Engine/ILogHandler.cs b/Source/Engine/Engine/ILogHandler.cs
index ea97f6d4e..6fcfb6a8a 100644
--- a/Source/Engine/Engine/ILogHandler.cs
+++ b/Source/Engine/Engine/ILogHandler.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
diff --git a/Source/Engine/Engine/ILogger.cs b/Source/Engine/Engine/ILogger.cs
index bd3aa8e48..236544c7a 100644
--- a/Source/Engine/Engine/ILogger.cs
+++ b/Source/Engine/Engine/ILogger.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
diff --git a/Source/Engine/Engine/ISceneObject.cs b/Source/Engine/Engine/ISceneObject.cs
index e1e7b1f9d..2b5ae7706 100644
--- a/Source/Engine/Engine/ISceneObject.cs
+++ b/Source/Engine/Engine/ISceneObject.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
diff --git a/Source/Engine/Engine/ITransformable.cs b/Source/Engine/Engine/ITransformable.cs
index 31d5df2b8..a8bbd910c 100644
--- a/Source/Engine/Engine/ITransformable.cs
+++ b/Source/Engine/Engine/ITransformable.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
namespace FlaxEngine
{
diff --git a/Source/Engine/Engine/InputAxis.cs b/Source/Engine/Engine/InputAxis.cs
index b7c044a31..8c46662fd 100644
--- a/Source/Engine/Engine/InputAxis.cs
+++ b/Source/Engine/Engine/InputAxis.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
namespace FlaxEngine
{
diff --git a/Source/Engine/Engine/InputEvent.cs b/Source/Engine/Engine/InputEvent.cs
index 57acafc7b..36d369ae1 100644
--- a/Source/Engine/Engine/InputEvent.cs
+++ b/Source/Engine/Engine/InputEvent.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
diff --git a/Source/Engine/Engine/Linux/LinuxGame.cpp b/Source/Engine/Engine/Linux/LinuxGame.cpp
index a8b9d1353..43bfe4a6e 100644
--- a/Source/Engine/Engine/Linux/LinuxGame.cpp
+++ b/Source/Engine/Engine/Linux/LinuxGame.cpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#if PLATFORM_LINUX && !USE_EDITOR
diff --git a/Source/Engine/Engine/Linux/LinuxGame.h b/Source/Engine/Engine/Linux/LinuxGame.h
index d4399b19d..10cd3097d 100644
--- a/Source/Engine/Engine/Linux/LinuxGame.h
+++ b/Source/Engine/Engine/Linux/LinuxGame.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/Engine/Logger.cs b/Source/Engine/Engine/Logger.cs
index 5ae24bf23..8f3eedd97 100644
--- a/Source/Engine/Engine/Logger.cs
+++ b/Source/Engine/Engine/Logger.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using System.Runtime.CompilerServices;
diff --git a/Source/Engine/Engine/PhysicalMaterial.cs b/Source/Engine/Engine/PhysicalMaterial.cs
index 1ad1c732c..3136c8d8a 100644
--- a/Source/Engine/Engine/PhysicalMaterial.cs
+++ b/Source/Engine/Engine/PhysicalMaterial.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
namespace FlaxEngine
{
diff --git a/Source/Engine/Engine/PostProcessEffect.cs b/Source/Engine/Engine/PostProcessEffect.cs
index d4b97a585..1633f8f82 100644
--- a/Source/Engine/Engine/PostProcessEffect.cs
+++ b/Source/Engine/Engine/PostProcessEffect.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
namespace FlaxEngine
{
diff --git a/Source/Engine/Engine/SceneReference.cs b/Source/Engine/Engine/SceneReference.cs
index 0f1a31d83..0cdadf2e9 100644
--- a/Source/Engine/Engine/SceneReference.cs
+++ b/Source/Engine/Engine/SceneReference.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
diff --git a/Source/Engine/Engine/Screen.cpp b/Source/Engine/Engine/Screen.cpp
index 5a486cdff..999dc28cb 100644
--- a/Source/Engine/Engine/Screen.cpp
+++ b/Source/Engine/Engine/Screen.cpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#include "Screen.h"
#include "Engine/Core/Log.h"
diff --git a/Source/Engine/Engine/Screen.h b/Source/Engine/Engine/Screen.h
index 41f941b7a..88a44da43 100644
--- a/Source/Engine/Engine/Screen.h
+++ b/Source/Engine/Engine/Screen.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/Engine/Time.cpp b/Source/Engine/Engine/Time.cpp
index deaa8b8d8..1afe7e05a 100644
--- a/Source/Engine/Engine/Time.cpp
+++ b/Source/Engine/Engine/Time.cpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#include "Time.h"
#include "EngineService.h"
diff --git a/Source/Engine/Engine/Time.h b/Source/Engine/Engine/Time.h
index f2d16e01c..0e8c25806 100644
--- a/Source/Engine/Engine/Time.h
+++ b/Source/Engine/Engine/Time.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/Engine/UWP/UWPGame.cpp b/Source/Engine/Engine/UWP/UWPGame.cpp
index 431d19306..9ec6a27ac 100644
--- a/Source/Engine/Engine/UWP/UWPGame.cpp
+++ b/Source/Engine/Engine/UWP/UWPGame.cpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#if PLATFORM_UWP && !USE_EDITOR
diff --git a/Source/Engine/Engine/UWP/UWPGame.h b/Source/Engine/Engine/UWP/UWPGame.h
index ec2e87760..17377d5b1 100644
--- a/Source/Engine/Engine/UWP/UWPGame.h
+++ b/Source/Engine/Engine/UWP/UWPGame.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/Engine/Windows/WindowsGame.cpp b/Source/Engine/Engine/Windows/WindowsGame.cpp
index ea4baa44f..da82cc7fc 100644
--- a/Source/Engine/Engine/Windows/WindowsGame.cpp
+++ b/Source/Engine/Engine/Windows/WindowsGame.cpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#if PLATFORM_WINDOWS && !USE_EDITOR
diff --git a/Source/Engine/Engine/Windows/WindowsGame.h b/Source/Engine/Engine/Windows/WindowsGame.h
index 93aabb03a..8665ef549 100644
--- a/Source/Engine/Engine/Windows/WindowsGame.h
+++ b/Source/Engine/Engine/Windows/WindowsGame.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/Foliage/Config.h b/Source/Engine/Foliage/Config.h
index 458ddb172..8f93a2015 100644
--- a/Source/Engine/Foliage/Config.h
+++ b/Source/Engine/Foliage/Config.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/Foliage/Foliage.Build.cs b/Source/Engine/Foliage/Foliage.Build.cs
index 88f281f01..f2ba6169d 100644
--- a/Source/Engine/Foliage/Foliage.Build.cs
+++ b/Source/Engine/Foliage/Foliage.Build.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using Flax.Build;
diff --git a/Source/Engine/Foliage/Foliage.cpp b/Source/Engine/Foliage/Foliage.cpp
index 68b73a01e..dcfd50212 100644
--- a/Source/Engine/Foliage/Foliage.cpp
+++ b/Source/Engine/Foliage/Foliage.cpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#include "Foliage.h"
#include "FoliageType.h"
diff --git a/Source/Engine/Foliage/Foliage.h b/Source/Engine/Foliage/Foliage.h
index 0cdc8b1c2..3b22e1c67 100644
--- a/Source/Engine/Foliage/Foliage.h
+++ b/Source/Engine/Foliage/Foliage.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/Foliage/FoliageCluster.cpp b/Source/Engine/Foliage/FoliageCluster.cpp
index 29a6545d8..5aef06c75 100644
--- a/Source/Engine/Foliage/FoliageCluster.cpp
+++ b/Source/Engine/Foliage/FoliageCluster.cpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#include "FoliageCluster.h"
#include "FoliageInstance.h"
diff --git a/Source/Engine/Foliage/FoliageCluster.h b/Source/Engine/Foliage/FoliageCluster.h
index e72ca9c38..0dd170a6a 100644
--- a/Source/Engine/Foliage/FoliageCluster.h
+++ b/Source/Engine/Foliage/FoliageCluster.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/Foliage/FoliageInstance.h b/Source/Engine/Foliage/FoliageInstance.h
index c06724bdc..a11a6212d 100644
--- a/Source/Engine/Foliage/FoliageInstance.h
+++ b/Source/Engine/Foliage/FoliageInstance.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/Foliage/FoliageType.cpp b/Source/Engine/Foliage/FoliageType.cpp
index 59308ef96..ccf1b2f3e 100644
--- a/Source/Engine/Foliage/FoliageType.cpp
+++ b/Source/Engine/Foliage/FoliageType.cpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#include "FoliageType.h"
#include "Engine/Core/Collections/ArrayExtensions.h"
diff --git a/Source/Engine/Foliage/FoliageType.h b/Source/Engine/Foliage/FoliageType.h
index 39ea3d49f..6a84abb1a 100644
--- a/Source/Engine/Foliage/FoliageType.h
+++ b/Source/Engine/Foliage/FoliageType.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/Graphics/Async/DefaultGPUTasksExecutor.cpp b/Source/Engine/Graphics/Async/DefaultGPUTasksExecutor.cpp
index ae7ca097f..fe852857c 100644
--- a/Source/Engine/Graphics/Async/DefaultGPUTasksExecutor.cpp
+++ b/Source/Engine/Graphics/Async/DefaultGPUTasksExecutor.cpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#include "DefaultGPUTasksExecutor.h"
#include "GPUTasksContext.h"
diff --git a/Source/Engine/Graphics/Async/DefaultGPUTasksExecutor.h b/Source/Engine/Graphics/Async/DefaultGPUTasksExecutor.h
index 397ec8423..a7c9d51f1 100644
--- a/Source/Engine/Graphics/Async/DefaultGPUTasksExecutor.h
+++ b/Source/Engine/Graphics/Async/DefaultGPUTasksExecutor.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/Graphics/Async/GPUSyncPoint.h b/Source/Engine/Graphics/Async/GPUSyncPoint.h
index ac1a0ac54..45295116a 100644
--- a/Source/Engine/Graphics/Async/GPUSyncPoint.h
+++ b/Source/Engine/Graphics/Async/GPUSyncPoint.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/Graphics/Async/GPUTask.h b/Source/Engine/Graphics/Async/GPUTask.h
index 9e2b4ec23..fe2eb3930 100644
--- a/Source/Engine/Graphics/Async/GPUTask.h
+++ b/Source/Engine/Graphics/Async/GPUTask.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/Graphics/Async/GPUTasksContext.cpp b/Source/Engine/Graphics/Async/GPUTasksContext.cpp
index 60b774fa5..87ba04ae6 100644
--- a/Source/Engine/Graphics/Async/GPUTasksContext.cpp
+++ b/Source/Engine/Graphics/Async/GPUTasksContext.cpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#include "GPUTasksContext.h"
#include "GPUTask.h"
diff --git a/Source/Engine/Graphics/Async/GPUTasksContext.h b/Source/Engine/Graphics/Async/GPUTasksContext.h
index fa1a7d25b..5a46afb0b 100644
--- a/Source/Engine/Graphics/Async/GPUTasksContext.h
+++ b/Source/Engine/Graphics/Async/GPUTasksContext.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/Graphics/Async/GPUTasksExecutor.cpp b/Source/Engine/Graphics/Async/GPUTasksExecutor.cpp
index c3a1f109f..c71d11a83 100644
--- a/Source/Engine/Graphics/Async/GPUTasksExecutor.cpp
+++ b/Source/Engine/Graphics/Async/GPUTasksExecutor.cpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#include "GPUTasksExecutor.h"
#include "Engine/Graphics/GPUDevice.h"
diff --git a/Source/Engine/Graphics/Async/GPUTasksExecutor.h b/Source/Engine/Graphics/Async/GPUTasksExecutor.h
index 3eff6a1c6..663d9f517 100644
--- a/Source/Engine/Graphics/Async/GPUTasksExecutor.h
+++ b/Source/Engine/Graphics/Async/GPUTasksExecutor.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/Graphics/Async/GPUTasksManager.cpp b/Source/Engine/Graphics/Async/GPUTasksManager.cpp
index 923be2162..b2f361428 100644
--- a/Source/Engine/Graphics/Async/GPUTasksManager.cpp
+++ b/Source/Engine/Graphics/Async/GPUTasksManager.cpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#include "GPUTasksManager.h"
#include "GPUTask.h"
diff --git a/Source/Engine/Graphics/Async/GPUTasksManager.h b/Source/Engine/Graphics/Async/GPUTasksManager.h
index 0edf86702..5ec4d017c 100644
--- a/Source/Engine/Graphics/Async/GPUTasksManager.h
+++ b/Source/Engine/Graphics/Async/GPUTasksManager.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/Graphics/Async/Tasks/GPUCopyResourceTask.h b/Source/Engine/Graphics/Async/Tasks/GPUCopyResourceTask.h
index 5c6d81ece..abf29574d 100644
--- a/Source/Engine/Graphics/Async/Tasks/GPUCopyResourceTask.h
+++ b/Source/Engine/Graphics/Async/Tasks/GPUCopyResourceTask.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/Graphics/Async/Tasks/GPUCopySubresourceTask.h b/Source/Engine/Graphics/Async/Tasks/GPUCopySubresourceTask.h
index ac65ee5fa..c8d6047af 100644
--- a/Source/Engine/Graphics/Async/Tasks/GPUCopySubresourceTask.h
+++ b/Source/Engine/Graphics/Async/Tasks/GPUCopySubresourceTask.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/Graphics/Async/Tasks/GPUUploadBufferTask.h b/Source/Engine/Graphics/Async/Tasks/GPUUploadBufferTask.h
index a3aa6af67..02eeee107 100644
--- a/Source/Engine/Graphics/Async/Tasks/GPUUploadBufferTask.h
+++ b/Source/Engine/Graphics/Async/Tasks/GPUUploadBufferTask.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/Graphics/Async/Tasks/GPUUploadTextureMipTask.h b/Source/Engine/Graphics/Async/Tasks/GPUUploadTextureMipTask.h
index 303ac178a..98a2f4469 100644
--- a/Source/Engine/Graphics/Async/Tasks/GPUUploadTextureMipTask.h
+++ b/Source/Engine/Graphics/Async/Tasks/GPUUploadTextureMipTask.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/Graphics/Config.h b/Source/Engine/Graphics/Config.h
index f7cd20fc2..88fbc780d 100644
--- a/Source/Engine/Graphics/Config.h
+++ b/Source/Engine/Graphics/Config.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
@@ -33,11 +33,7 @@
#define GPU_ALLOW_PROFILE_EVENTS (!BUILD_RELEASE)
// Enable/disable creating GPU resources on separate threads (otherwise only the main thread can be used)
-#if GRAPHICS_API_OPENGL
-#define GPU_ENABLE_ASYNC_RESOURCES_CREATION 0
-#else
#define GPU_ENABLE_ASYNC_RESOURCES_CREATION 1
-#endif
// Enable/disable force shaders recompilation
#define GPU_FORCE_RECOMPILE_SHADERS 0
diff --git a/Source/Engine/Graphics/DynamicBuffer.cpp b/Source/Engine/Graphics/DynamicBuffer.cpp
index 652f0b93f..f5b32900d 100644
--- a/Source/Engine/Graphics/DynamicBuffer.cpp
+++ b/Source/Engine/Graphics/DynamicBuffer.cpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#include "DynamicBuffer.h"
#include "GPUDevice.h"
diff --git a/Source/Engine/Graphics/DynamicBuffer.h b/Source/Engine/Graphics/DynamicBuffer.h
index 2c5f4ecd9..10afb52b8 100644
--- a/Source/Engine/Graphics/DynamicBuffer.h
+++ b/Source/Engine/Graphics/DynamicBuffer.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/Graphics/Enums.h b/Source/Engine/Graphics/Enums.h
index 8b26d7c18..20836b300 100644
--- a/Source/Engine/Graphics/Enums.h
+++ b/Source/Engine/Graphics/Enums.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/Graphics/GPUAdapter.h b/Source/Engine/Graphics/GPUAdapter.h
index 98cb78673..efacae2ba 100644
--- a/Source/Engine/Graphics/GPUAdapter.h
+++ b/Source/Engine/Graphics/GPUAdapter.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/Graphics/GPUBuffer.cpp b/Source/Engine/Graphics/GPUBuffer.cpp
index c206ffb86..eba53aba2 100644
--- a/Source/Engine/Graphics/GPUBuffer.cpp
+++ b/Source/Engine/Graphics/GPUBuffer.cpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#include "GPUBuffer.h"
#include "GPUDevice.h"
diff --git a/Source/Engine/Graphics/GPUBuffer.h b/Source/Engine/Graphics/GPUBuffer.h
index efbd67ef6..84611419e 100644
--- a/Source/Engine/Graphics/GPUBuffer.h
+++ b/Source/Engine/Graphics/GPUBuffer.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/Graphics/GPUBufferDescription.cpp b/Source/Engine/Graphics/GPUBufferDescription.cpp
index 5118578a4..e679e8b06 100644
--- a/Source/Engine/Graphics/GPUBufferDescription.cpp
+++ b/Source/Engine/Graphics/GPUBufferDescription.cpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#include "GPUBufferDescription.h"
#include "PixelFormatExtensions.h"
diff --git a/Source/Engine/Graphics/GPUBufferDescription.cs b/Source/Engine/Graphics/GPUBufferDescription.cs
index f07e3e000..2f70fba39 100644
--- a/Source/Engine/Graphics/GPUBufferDescription.cs
+++ b/Source/Engine/Graphics/GPUBufferDescription.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
diff --git a/Source/Engine/Graphics/GPUBufferDescription.h b/Source/Engine/Graphics/GPUBufferDescription.h
index 40a5b0030..a5d07243b 100644
--- a/Source/Engine/Graphics/GPUBufferDescription.h
+++ b/Source/Engine/Graphics/GPUBufferDescription.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/Graphics/GPUContext.cpp b/Source/Engine/Graphics/GPUContext.cpp
index d49777d50..cff2c4766 100644
--- a/Source/Engine/Graphics/GPUContext.cpp
+++ b/Source/Engine/Graphics/GPUContext.cpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#include "GPUContext.h"
#include "GPUDevice.h"
diff --git a/Source/Engine/Graphics/GPUContext.h b/Source/Engine/Graphics/GPUContext.h
index 5b6622274..ed2417c96 100644
--- a/Source/Engine/Graphics/GPUContext.h
+++ b/Source/Engine/Graphics/GPUContext.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/Graphics/GPUDevice.cpp b/Source/Engine/Graphics/GPUDevice.cpp
index 40b992b37..a5195ff50 100644
--- a/Source/Engine/Graphics/GPUDevice.cpp
+++ b/Source/Engine/Graphics/GPUDevice.cpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#include "GPUDevice.h"
#include "RenderTargetPool.h"
diff --git a/Source/Engine/Graphics/GPUDevice.h b/Source/Engine/Graphics/GPUDevice.h
index ad8e237f6..0b5fb46b9 100644
--- a/Source/Engine/Graphics/GPUDevice.h
+++ b/Source/Engine/Graphics/GPUDevice.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/Graphics/GPULimits.h b/Source/Engine/Graphics/GPULimits.h
index e99d24986..485f5d866 100644
--- a/Source/Engine/Graphics/GPULimits.h
+++ b/Source/Engine/Graphics/GPULimits.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/Graphics/GPUPipelineState.h b/Source/Engine/Graphics/GPUPipelineState.h
index 96f13b1e1..5e16799c8 100644
--- a/Source/Engine/Graphics/GPUPipelineState.h
+++ b/Source/Engine/Graphics/GPUPipelineState.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/Graphics/GPUPipelineStatePermutations.h b/Source/Engine/Graphics/GPUPipelineStatePermutations.h
index ca5d85c30..65b227685 100644
--- a/Source/Engine/Graphics/GPUPipelineStatePermutations.h
+++ b/Source/Engine/Graphics/GPUPipelineStatePermutations.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/Graphics/GPUResource.h b/Source/Engine/Graphics/GPUResource.h
index 06d848217..288da6579 100644
--- a/Source/Engine/Graphics/GPUResource.h
+++ b/Source/Engine/Graphics/GPUResource.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/Graphics/GPUResourceProperty.h b/Source/Engine/Graphics/GPUResourceProperty.h
index 3b5993b61..5ad31439d 100644
--- a/Source/Engine/Graphics/GPUResourceProperty.h
+++ b/Source/Engine/Graphics/GPUResourceProperty.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/Graphics/GPUResourceState.h b/Source/Engine/Graphics/GPUResourceState.h
index 072b54cde..c5083b952 100644
--- a/Source/Engine/Graphics/GPUResourceState.h
+++ b/Source/Engine/Graphics/GPUResourceState.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
@@ -46,14 +46,13 @@ public:
{
ASSERT(_subresourceState.IsEmpty() && subresourceCount > 0);
- // Allocate space for per-subresource tracking structures
- // Note: for resources with single subresource we don't use this table
- if (usePerSubresourceTracking && subresourceCount > 1)
- _subresourceState.Resize(subresourceCount, false);
-
// Initialize state
_allSubresourcesSame = true;
_resourceState = initialState;
+
+ // Allocate space for per-subresource state tracking
+ if (usePerSubresourceTracking && subresourceCount > 1)
+ _subresourceState.Resize(subresourceCount, false);
#if BUILD_DEBUG
_subresourceState.SetAll(InvalidState);
#endif
@@ -87,9 +86,8 @@ public:
return state == _resourceState;
}
- // All subresources must be individually checked
- const uint32 numSubresourceStates = _subresourceState.Count();
- for (uint32 i = 0; i < numSubresourceStates; i++)
+ // Check all subresources
+ for (int32 i = 0; i < _subresourceState.Count(); i++)
{
if (_subresourceState[i] != state)
{
@@ -116,10 +114,8 @@ public:
_allSubresourcesSame = 1;
_resourceState = state;
- // State is now tracked per-resource, so _subresourceState should not be read
#if BUILD_DEBUG
- const uint32 numSubresourceStates = _subresourceState.Count();
- for (uint32 i = 0; i < numSubresourceStates; i++)
+ for (int32 i = 0; i < _subresourceState.Count(); i++)
{
_subresourceState[i] = InvalidState;
}
@@ -128,7 +124,7 @@ public:
void SetSubresourceState(int32 subresourceIndex, StateType state)
{
- // If setting all subresources, or the resource only has a single subresource, set the per-resource state
+ // Check if use single state for the whole resource
if (subresourceIndex == -1 || _subresourceState.Count() <= 1)
{
SetResourceState(state);
@@ -137,18 +133,14 @@ public:
{
ASSERT(subresourceIndex < static_cast(_subresourceState.Count()));
- // If state was previously tracked on a per-resource level, then transition to per-subresource tracking
+ // Transition for all sub-resources
if (_allSubresourcesSame)
{
- const int32 numSubresourceStates = _subresourceState.Count();
- for (int32 i = 0; i < numSubresourceStates; i++)
+ for (int32 i = 0; i < _subresourceState.Count(); i++)
{
_subresourceState[i] = _resourceState;
}
-
_allSubresourcesSame = 0;
-
- // State is now tracked per-subresource, so _resourceState should not be read
#if BUILD_DEBUG
_resourceState = InvalidState;
#endif
diff --git a/Source/Engine/Graphics/GPUResourcesCollection.cpp b/Source/Engine/Graphics/GPUResourcesCollection.cpp
index b1bf299bb..c78b09f86 100644
--- a/Source/Engine/Graphics/GPUResourcesCollection.cpp
+++ b/Source/Engine/Graphics/GPUResourcesCollection.cpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#include "GPUResourcesCollection.h"
#include "GPUResource.h"
diff --git a/Source/Engine/Graphics/GPUResourcesCollection.h b/Source/Engine/Graphics/GPUResourcesCollection.h
index 399bf8b06..8cb161cc1 100644
--- a/Source/Engine/Graphics/GPUResourcesCollection.h
+++ b/Source/Engine/Graphics/GPUResourcesCollection.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/Graphics/GPUSwapChain.cpp b/Source/Engine/Graphics/GPUSwapChain.cpp
index 0c2f16e7f..347fa6e46 100644
--- a/Source/Engine/Graphics/GPUSwapChain.cpp
+++ b/Source/Engine/Graphics/GPUSwapChain.cpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#include "GPUSwapChain.h"
#include "GPUDevice.h"
diff --git a/Source/Engine/Graphics/GPUSwapChain.h b/Source/Engine/Graphics/GPUSwapChain.h
index e9465d1fc..8efcd1d1c 100644
--- a/Source/Engine/Graphics/GPUSwapChain.h
+++ b/Source/Engine/Graphics/GPUSwapChain.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/Graphics/GPUTimerQuery.h b/Source/Engine/Graphics/GPUTimerQuery.h
index 72c5a3636..b2cabdf01 100644
--- a/Source/Engine/Graphics/GPUTimerQuery.h
+++ b/Source/Engine/Graphics/GPUTimerQuery.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/Graphics/Graphics.Build.cs b/Source/Engine/Graphics/Graphics.Build.cs
index 63f019d7f..92b0236d4 100644
--- a/Source/Engine/Graphics/Graphics.Build.cs
+++ b/Source/Engine/Graphics/Graphics.Build.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System.Collections.Generic;
using Flax.Build;
@@ -41,7 +41,6 @@ public class Graphics : EngineModule
{
case TargetPlatform.Windows:
options.PrivateDependencies.Add("GraphicsDeviceNull");
- //options.PrivateDependencies.Add("GraphicsDeviceOGL");
options.PrivateDependencies.Add("GraphicsDeviceDX11");
if (VulkanSdk.Instance.IsValid)
options.PrivateDependencies.Add("GraphicsDeviceVulkan");
diff --git a/Source/Engine/Graphics/Graphics.cpp b/Source/Engine/Graphics/Graphics.cpp
index 9463b4170..21b506ef1 100644
--- a/Source/Engine/Graphics/Graphics.cpp
+++ b/Source/Engine/Graphics/Graphics.cpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#include "Graphics.h"
#include "GPUDevice.h"
diff --git a/Source/Engine/Graphics/Graphics.h b/Source/Engine/Graphics/Graphics.h
index a7f82a098..0da46a105 100644
--- a/Source/Engine/Graphics/Graphics.h
+++ b/Source/Engine/Graphics/Graphics.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/Graphics/MaterialInfo.cs b/Source/Engine/Graphics/MaterialInfo.cs
index e2c472042..29dc07943 100644
--- a/Source/Engine/Graphics/MaterialInfo.cs
+++ b/Source/Engine/Graphics/MaterialInfo.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
namespace FlaxEngine
{
diff --git a/Source/Engine/Graphics/MaterialParams.cs b/Source/Engine/Graphics/MaterialParams.cs
index 0f3a75fc3..65d2e3aa3 100644
--- a/Source/Engine/Graphics/MaterialParams.cs
+++ b/Source/Engine/Graphics/MaterialParams.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
namespace FlaxEngine
{
diff --git a/Source/Engine/Graphics/Materials/DecalMaterialShader.cpp b/Source/Engine/Graphics/Materials/DecalMaterialShader.cpp
index 0fbdf5596..c5166a088 100644
--- a/Source/Engine/Graphics/Materials/DecalMaterialShader.cpp
+++ b/Source/Engine/Graphics/Materials/DecalMaterialShader.cpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#include "DecalMaterialShader.h"
#include "MaterialParams.h"
diff --git a/Source/Engine/Graphics/Materials/DecalMaterialShader.h b/Source/Engine/Graphics/Materials/DecalMaterialShader.h
index 550c2530e..0baf88b42 100644
--- a/Source/Engine/Graphics/Materials/DecalMaterialShader.h
+++ b/Source/Engine/Graphics/Materials/DecalMaterialShader.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/Graphics/Materials/DeferredMaterialShader.cpp b/Source/Engine/Graphics/Materials/DeferredMaterialShader.cpp
index 9736c3390..049484459 100644
--- a/Source/Engine/Graphics/Materials/DeferredMaterialShader.cpp
+++ b/Source/Engine/Graphics/Materials/DeferredMaterialShader.cpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#include "DeferredMaterialShader.h"
#include "MaterialParams.h"
diff --git a/Source/Engine/Graphics/Materials/DeferredMaterialShader.h b/Source/Engine/Graphics/Materials/DeferredMaterialShader.h
index 0bedc06c6..f8df968c9 100644
--- a/Source/Engine/Graphics/Materials/DeferredMaterialShader.h
+++ b/Source/Engine/Graphics/Materials/DeferredMaterialShader.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/Graphics/Materials/ForwardMaterialShader.cpp b/Source/Engine/Graphics/Materials/ForwardMaterialShader.cpp
index 240cad205..863af34e1 100644
--- a/Source/Engine/Graphics/Materials/ForwardMaterialShader.cpp
+++ b/Source/Engine/Graphics/Materials/ForwardMaterialShader.cpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#include "ForwardMaterialShader.h"
#include "MaterialParams.h"
diff --git a/Source/Engine/Graphics/Materials/ForwardMaterialShader.h b/Source/Engine/Graphics/Materials/ForwardMaterialShader.h
index 1c9c26446..d39fcea54 100644
--- a/Source/Engine/Graphics/Materials/ForwardMaterialShader.h
+++ b/Source/Engine/Graphics/Materials/ForwardMaterialShader.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/Graphics/Materials/GUIMaterialShader.cpp b/Source/Engine/Graphics/Materials/GUIMaterialShader.cpp
index 8b8eb4d97..4b079dd54 100644
--- a/Source/Engine/Graphics/Materials/GUIMaterialShader.cpp
+++ b/Source/Engine/Graphics/Materials/GUIMaterialShader.cpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#include "GUIMaterialShader.h"
#include "MaterialParams.h"
diff --git a/Source/Engine/Graphics/Materials/GUIMaterialShader.h b/Source/Engine/Graphics/Materials/GUIMaterialShader.h
index 3cd9b10fa..c84373c90 100644
--- a/Source/Engine/Graphics/Materials/GUIMaterialShader.h
+++ b/Source/Engine/Graphics/Materials/GUIMaterialShader.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/Graphics/Materials/IMaterial.h b/Source/Engine/Graphics/Materials/IMaterial.h
index 05a33d95b..8d5590354 100644
--- a/Source/Engine/Graphics/Materials/IMaterial.h
+++ b/Source/Engine/Graphics/Materials/IMaterial.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/Graphics/Materials/MaterialInfo.h b/Source/Engine/Graphics/Materials/MaterialInfo.h
index 3ea06e9b0..50b4c1e35 100644
--- a/Source/Engine/Graphics/Materials/MaterialInfo.h
+++ b/Source/Engine/Graphics/Materials/MaterialInfo.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/Graphics/Materials/MaterialParams.cpp b/Source/Engine/Graphics/Materials/MaterialParams.cpp
index d8eac48bb..1f1d1bac6 100644
--- a/Source/Engine/Graphics/Materials/MaterialParams.cpp
+++ b/Source/Engine/Graphics/Materials/MaterialParams.cpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#include "MaterialParams.h"
#include "MaterialInfo.h"
diff --git a/Source/Engine/Graphics/Materials/MaterialParams.h b/Source/Engine/Graphics/Materials/MaterialParams.h
index 5cc34e9a2..997b18d34 100644
--- a/Source/Engine/Graphics/Materials/MaterialParams.h
+++ b/Source/Engine/Graphics/Materials/MaterialParams.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/Graphics/Materials/MaterialShader.cpp b/Source/Engine/Graphics/Materials/MaterialShader.cpp
index 3be382472..478992959 100644
--- a/Source/Engine/Graphics/Materials/MaterialShader.cpp
+++ b/Source/Engine/Graphics/Materials/MaterialShader.cpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#include "MaterialShader.h"
#include "Engine/Core/Log.h"
diff --git a/Source/Engine/Graphics/Materials/MaterialShader.h b/Source/Engine/Graphics/Materials/MaterialShader.h
index b909043b9..58ba297fa 100644
--- a/Source/Engine/Graphics/Materials/MaterialShader.h
+++ b/Source/Engine/Graphics/Materials/MaterialShader.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/Graphics/Materials/ParticleMaterialShader.cpp b/Source/Engine/Graphics/Materials/ParticleMaterialShader.cpp
index 9dc8863f4..8c1c065ab 100644
--- a/Source/Engine/Graphics/Materials/ParticleMaterialShader.cpp
+++ b/Source/Engine/Graphics/Materials/ParticleMaterialShader.cpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#include "ParticleMaterialShader.h"
#include "MaterialParams.h"
diff --git a/Source/Engine/Graphics/Materials/ParticleMaterialShader.h b/Source/Engine/Graphics/Materials/ParticleMaterialShader.h
index 36111051d..3a8794183 100644
--- a/Source/Engine/Graphics/Materials/ParticleMaterialShader.h
+++ b/Source/Engine/Graphics/Materials/ParticleMaterialShader.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/Graphics/Materials/PostFxMaterialShader.cpp b/Source/Engine/Graphics/Materials/PostFxMaterialShader.cpp
index 0b23c849b..5c2fb1df0 100644
--- a/Source/Engine/Graphics/Materials/PostFxMaterialShader.cpp
+++ b/Source/Engine/Graphics/Materials/PostFxMaterialShader.cpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#include "PostFxMaterialShader.h"
#include "MaterialParams.h"
diff --git a/Source/Engine/Graphics/Materials/PostFxMaterialShader.h b/Source/Engine/Graphics/Materials/PostFxMaterialShader.h
index b13df7727..85767736f 100644
--- a/Source/Engine/Graphics/Materials/PostFxMaterialShader.h
+++ b/Source/Engine/Graphics/Materials/PostFxMaterialShader.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/Graphics/Materials/TerrainMaterialShader.cpp b/Source/Engine/Graphics/Materials/TerrainMaterialShader.cpp
index 5ccc78d68..212e27d87 100644
--- a/Source/Engine/Graphics/Materials/TerrainMaterialShader.cpp
+++ b/Source/Engine/Graphics/Materials/TerrainMaterialShader.cpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#include "TerrainMaterialShader.h"
#include "MaterialParams.h"
diff --git a/Source/Engine/Graphics/Materials/TerrainMaterialShader.h b/Source/Engine/Graphics/Materials/TerrainMaterialShader.h
index 0e1e3cb01..f69fc48ba 100644
--- a/Source/Engine/Graphics/Materials/TerrainMaterialShader.h
+++ b/Source/Engine/Graphics/Materials/TerrainMaterialShader.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/Graphics/Mesh.cs b/Source/Engine/Graphics/Mesh.cs
index 2dede0027..f639bff8f 100644
--- a/Source/Engine/Graphics/Mesh.cs
+++ b/Source/Engine/Graphics/Mesh.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using System.Collections.Generic;
diff --git a/Source/Engine/Graphics/Model.cs b/Source/Engine/Graphics/Model.cs
index 10438df0e..49b802d92 100644
--- a/Source/Engine/Graphics/Model.cs
+++ b/Source/Engine/Graphics/Model.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
namespace FlaxEngine
{
diff --git a/Source/Engine/Graphics/Models/BlendShape.cpp b/Source/Engine/Graphics/Models/BlendShape.cpp
index 46db3f6d8..0b21a57cd 100644
--- a/Source/Engine/Graphics/Models/BlendShape.cpp
+++ b/Source/Engine/Graphics/Models/BlendShape.cpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#include "BlendShape.h"
#include "Engine/Content/Assets/SkinnedModel.h"
diff --git a/Source/Engine/Graphics/Models/BlendShape.h b/Source/Engine/Graphics/Models/BlendShape.h
index c3ada8da5..898fe328a 100644
--- a/Source/Engine/Graphics/Models/BlendShape.h
+++ b/Source/Engine/Graphics/Models/BlendShape.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/Graphics/Models/CollisionProxy.h b/Source/Engine/Graphics/Models/CollisionProxy.h
index f93e91dc5..3a384c58d 100644
--- a/Source/Engine/Graphics/Models/CollisionProxy.h
+++ b/Source/Engine/Graphics/Models/CollisionProxy.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/Graphics/Models/Config.h b/Source/Engine/Graphics/Models/Config.h
index f970930f3..a9cf295f7 100644
--- a/Source/Engine/Graphics/Models/Config.h
+++ b/Source/Engine/Graphics/Models/Config.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/Graphics/Models/MaterialSlot.h b/Source/Engine/Graphics/Models/MaterialSlot.h
index ad0ae2cfd..bdd491d52 100644
--- a/Source/Engine/Graphics/Models/MaterialSlot.h
+++ b/Source/Engine/Graphics/Models/MaterialSlot.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/Graphics/Models/Mesh.cpp b/Source/Engine/Graphics/Models/Mesh.cpp
index 682f5487c..0ba51b2d7 100644
--- a/Source/Engine/Graphics/Models/Mesh.cpp
+++ b/Source/Engine/Graphics/Models/Mesh.cpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#include "Mesh.h"
#include "ModelInstanceEntry.h"
diff --git a/Source/Engine/Graphics/Models/Mesh.h b/Source/Engine/Graphics/Models/Mesh.h
index badea7d1f..c8311a1f3 100644
--- a/Source/Engine/Graphics/Models/Mesh.h
+++ b/Source/Engine/Graphics/Models/Mesh.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/Graphics/Models/ModelData.Tool.cpp b/Source/Engine/Graphics/Models/ModelData.Tool.cpp
index ea9a066d3..db36d7d4f 100644
--- a/Source/Engine/Graphics/Models/ModelData.Tool.cpp
+++ b/Source/Engine/Graphics/Models/ModelData.Tool.cpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#if COMPILE_WITH_MODEL_TOOL
@@ -99,7 +99,7 @@ bool MeshData::GenerateLightmapUVs()
// Generate UVs
std::vector vb;
std::vector ib;
- float outStretch = 0.f;
+ float outStretch = 0.0f;
size_t outCharts = 0;
std::vector facePartitioning;
std::vector vertexRemapArray;
diff --git a/Source/Engine/Graphics/Models/ModelData.cpp b/Source/Engine/Graphics/Models/ModelData.cpp
index 01aa108df..56981e65d 100644
--- a/Source/Engine/Graphics/Models/ModelData.cpp
+++ b/Source/Engine/Graphics/Models/ModelData.cpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#include "ModelData.h"
#include "Engine/Core/Log.h"
diff --git a/Source/Engine/Graphics/Models/ModelData.h b/Source/Engine/Graphics/Models/ModelData.h
index 55ac37a62..1e4b59d0a 100644
--- a/Source/Engine/Graphics/Models/ModelData.h
+++ b/Source/Engine/Graphics/Models/ModelData.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/Graphics/Models/ModelInstanceEntry.cpp b/Source/Engine/Graphics/Models/ModelInstanceEntry.cpp
index 4199e8657..476bdf39a 100644
--- a/Source/Engine/Graphics/Models/ModelInstanceEntry.cpp
+++ b/Source/Engine/Graphics/Models/ModelInstanceEntry.cpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#include "ModelInstanceEntry.h"
#include "Engine/Serialization/Serialization.h"
diff --git a/Source/Engine/Graphics/Models/ModelInstanceEntry.h b/Source/Engine/Graphics/Models/ModelInstanceEntry.h
index 33c78fcfe..cc41d29f3 100644
--- a/Source/Engine/Graphics/Models/ModelInstanceEntry.h
+++ b/Source/Engine/Graphics/Models/ModelInstanceEntry.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/Graphics/Models/ModelLOD.cpp b/Source/Engine/Graphics/Models/ModelLOD.cpp
index 183f0b182..842d0de80 100644
--- a/Source/Engine/Graphics/Models/ModelLOD.cpp
+++ b/Source/Engine/Graphics/Models/ModelLOD.cpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#include "ModelLOD.h"
#include "Engine/Graphics/GPUDevice.h"
diff --git a/Source/Engine/Graphics/Models/ModelLOD.h b/Source/Engine/Graphics/Models/ModelLOD.h
index 9b40bc82c..91d728aa7 100644
--- a/Source/Engine/Graphics/Models/ModelLOD.h
+++ b/Source/Engine/Graphics/Models/ModelLOD.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/Graphics/Models/SkeletonData.h b/Source/Engine/Graphics/Models/SkeletonData.h
index ec358dbfc..5f336d8be 100644
--- a/Source/Engine/Graphics/Models/SkeletonData.h
+++ b/Source/Engine/Graphics/Models/SkeletonData.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/Graphics/Models/SkeletonMapping.h b/Source/Engine/Graphics/Models/SkeletonMapping.h
index 29852e8e4..b5e3549c2 100644
--- a/Source/Engine/Graphics/Models/SkeletonMapping.h
+++ b/Source/Engine/Graphics/Models/SkeletonMapping.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/Graphics/Models/SkeletonUpdater.h b/Source/Engine/Graphics/Models/SkeletonUpdater.h
index 22aad26c4..3886813c4 100644
--- a/Source/Engine/Graphics/Models/SkeletonUpdater.h
+++ b/Source/Engine/Graphics/Models/SkeletonUpdater.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/Graphics/Models/SkinnedMesh.cpp b/Source/Engine/Graphics/Models/SkinnedMesh.cpp
index 610166cbf..90aa03d86 100644
--- a/Source/Engine/Graphics/Models/SkinnedMesh.cpp
+++ b/Source/Engine/Graphics/Models/SkinnedMesh.cpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#include "SkinnedMesh.h"
#include "ModelInstanceEntry.h"
diff --git a/Source/Engine/Graphics/Models/SkinnedMesh.h b/Source/Engine/Graphics/Models/SkinnedMesh.h
index f26ce1b4d..2c168980b 100644
--- a/Source/Engine/Graphics/Models/SkinnedMesh.h
+++ b/Source/Engine/Graphics/Models/SkinnedMesh.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/Graphics/Models/SkinnedMeshDrawData.cpp b/Source/Engine/Graphics/Models/SkinnedMeshDrawData.cpp
index ce37aa1ab..2094be3b2 100644
--- a/Source/Engine/Graphics/Models/SkinnedMeshDrawData.cpp
+++ b/Source/Engine/Graphics/Models/SkinnedMeshDrawData.cpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#include "SkinnedMeshDrawData.h"
#include "Engine/Graphics/GPUDevice.h"
diff --git a/Source/Engine/Graphics/Models/SkinnedMeshDrawData.h b/Source/Engine/Graphics/Models/SkinnedMeshDrawData.h
index 4a1702550..b5d86a34d 100644
--- a/Source/Engine/Graphics/Models/SkinnedMeshDrawData.h
+++ b/Source/Engine/Graphics/Models/SkinnedMeshDrawData.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/Graphics/Models/SkinnedModelLOD.cpp b/Source/Engine/Graphics/Models/SkinnedModelLOD.cpp
index eddecdf46..db0e8b86e 100644
--- a/Source/Engine/Graphics/Models/SkinnedModelLOD.cpp
+++ b/Source/Engine/Graphics/Models/SkinnedModelLOD.cpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#include "SkinnedModelLOD.h"
#include "Engine/Graphics/GPUDevice.h"
diff --git a/Source/Engine/Graphics/Models/SkinnedModelLOD.h b/Source/Engine/Graphics/Models/SkinnedModelLOD.h
index 0da0ef1d1..673bbb4e2 100644
--- a/Source/Engine/Graphics/Models/SkinnedModelLOD.h
+++ b/Source/Engine/Graphics/Models/SkinnedModelLOD.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/Graphics/Models/Types.h b/Source/Engine/Graphics/Models/Types.h
index 84f5f51a6..248988243 100644
--- a/Source/Engine/Graphics/Models/Types.h
+++ b/Source/Engine/Graphics/Models/Types.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/Graphics/PixelFormat.h b/Source/Engine/Graphics/PixelFormat.h
index abb7699e4..2f7389a65 100644
--- a/Source/Engine/Graphics/PixelFormat.h
+++ b/Source/Engine/Graphics/PixelFormat.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/Graphics/PixelFormatExtensions.cpp b/Source/Engine/Graphics/PixelFormatExtensions.cpp
index 3f45019e4..c93cc4661 100644
--- a/Source/Engine/Graphics/PixelFormatExtensions.cpp
+++ b/Source/Engine/Graphics/PixelFormatExtensions.cpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#include "PixelFormatExtensions.h"
#include "Engine/Core/Collections/Dictionary.h"
diff --git a/Source/Engine/Graphics/PixelFormatExtensions.h b/Source/Engine/Graphics/PixelFormatExtensions.h
index 6555d2fc7..9a719d749 100644
--- a/Source/Engine/Graphics/PixelFormatExtensions.h
+++ b/Source/Engine/Graphics/PixelFormatExtensions.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/Graphics/PostProcessBase.h b/Source/Engine/Graphics/PostProcessBase.h
index bdc2bdc0d..1c14ba7ae 100644
--- a/Source/Engine/Graphics/PostProcessBase.h
+++ b/Source/Engine/Graphics/PostProcessBase.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/Graphics/PostProcessSettings.cpp b/Source/Engine/Graphics/PostProcessSettings.cpp
index 8f9e3f004..4eae8adb0 100644
--- a/Source/Engine/Graphics/PostProcessSettings.cpp
+++ b/Source/Engine/Graphics/PostProcessSettings.cpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#include "PostProcessSettings.h"
#include "Engine/Serialization/JsonTools.h"
diff --git a/Source/Engine/Graphics/PostProcessSettings.cs b/Source/Engine/Graphics/PostProcessSettings.cs
index 60fcf84a6..129aa2f1c 100644
--- a/Source/Engine/Graphics/PostProcessSettings.cs
+++ b/Source/Engine/Graphics/PostProcessSettings.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
diff --git a/Source/Engine/Graphics/PostProcessSettings.h b/Source/Engine/Graphics/PostProcessSettings.h
index 225f2d06d..4279cfc9b 100644
--- a/Source/Engine/Graphics/PostProcessSettings.h
+++ b/Source/Engine/Graphics/PostProcessSettings.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/Graphics/RenderBuffers.cpp b/Source/Engine/Graphics/RenderBuffers.cpp
index 8b48fd23f..31ce925ee 100644
--- a/Source/Engine/Graphics/RenderBuffers.cpp
+++ b/Source/Engine/Graphics/RenderBuffers.cpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#include "RenderBuffers.h"
#include "Engine/Graphics/GPUDevice.h"
diff --git a/Source/Engine/Graphics/RenderBuffers.h b/Source/Engine/Graphics/RenderBuffers.h
index 9e9c7aafa..76ef50a05 100644
--- a/Source/Engine/Graphics/RenderBuffers.h
+++ b/Source/Engine/Graphics/RenderBuffers.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/Graphics/RenderTargetPool.cpp b/Source/Engine/Graphics/RenderTargetPool.cpp
index 0ce965d63..109ff8de9 100644
--- a/Source/Engine/Graphics/RenderTargetPool.cpp
+++ b/Source/Engine/Graphics/RenderTargetPool.cpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#include "RenderTargetPool.h"
#include "GPUDevice.h"
diff --git a/Source/Engine/Graphics/RenderTargetPool.h b/Source/Engine/Graphics/RenderTargetPool.h
index 26e072191..8b4e88326 100644
--- a/Source/Engine/Graphics/RenderTargetPool.h
+++ b/Source/Engine/Graphics/RenderTargetPool.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/Graphics/RenderTask.cpp b/Source/Engine/Graphics/RenderTask.cpp
index 72a7aa9fa..e3e261c96 100644
--- a/Source/Engine/Graphics/RenderTask.cpp
+++ b/Source/Engine/Graphics/RenderTask.cpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#include "RenderTask.h"
#include "RenderBuffers.h"
diff --git a/Source/Engine/Graphics/RenderTask.cs b/Source/Engine/Graphics/RenderTask.cs
index 6f582cdbc..5b6e2a1a7 100644
--- a/Source/Engine/Graphics/RenderTask.cs
+++ b/Source/Engine/Graphics/RenderTask.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using System.Collections.Generic;
diff --git a/Source/Engine/Graphics/RenderTask.h b/Source/Engine/Graphics/RenderTask.h
index 90b6fa067..b00d80a5f 100644
--- a/Source/Engine/Graphics/RenderTask.h
+++ b/Source/Engine/Graphics/RenderTask.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/Graphics/RenderTools.cpp b/Source/Engine/Graphics/RenderTools.cpp
index 447fd8e9b..4fc5e2e1d 100644
--- a/Source/Engine/Graphics/RenderTools.cpp
+++ b/Source/Engine/Graphics/RenderTools.cpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#include "RenderTools.h"
#include "PixelFormatExtensions.h"
diff --git a/Source/Engine/Graphics/RenderTools.h b/Source/Engine/Graphics/RenderTools.h
index 4ddd3d9ac..29ac22e40 100644
--- a/Source/Engine/Graphics/RenderTools.h
+++ b/Source/Engine/Graphics/RenderTools.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/Graphics/RenderView.cpp b/Source/Engine/Graphics/RenderView.cpp
index d8e554628..e7eb092d6 100644
--- a/Source/Engine/Graphics/RenderView.cpp
+++ b/Source/Engine/Graphics/RenderView.cpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#include "RenderView.h"
#include "Engine/Level/Actors/Camera.h"
diff --git a/Source/Engine/Graphics/RenderView.cs b/Source/Engine/Graphics/RenderView.cs
index 2a3deec11..1b495cd54 100644
--- a/Source/Engine/Graphics/RenderView.cs
+++ b/Source/Engine/Graphics/RenderView.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
namespace FlaxEngine
{
diff --git a/Source/Engine/Graphics/RenderView.h b/Source/Engine/Graphics/RenderView.h
index 0a6b98fd7..36cd55ffa 100644
--- a/Source/Engine/Graphics/RenderView.h
+++ b/Source/Engine/Graphics/RenderView.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/Graphics/Shaders/Cache/ShaderAssetBase.cpp b/Source/Engine/Graphics/Shaders/Cache/ShaderAssetBase.cpp
index ec84250ee..0ff65edf0 100644
--- a/Source/Engine/Graphics/Shaders/Cache/ShaderAssetBase.cpp
+++ b/Source/Engine/Graphics/Shaders/Cache/ShaderAssetBase.cpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#include "ShaderAssetBase.h"
#include "ShaderStorage.h"
diff --git a/Source/Engine/Graphics/Shaders/Cache/ShaderAssetBase.h b/Source/Engine/Graphics/Shaders/Cache/ShaderAssetBase.h
index 2380ca956..ab1f79aee 100644
--- a/Source/Engine/Graphics/Shaders/Cache/ShaderAssetBase.h
+++ b/Source/Engine/Graphics/Shaders/Cache/ShaderAssetBase.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/Graphics/Shaders/Cache/ShaderCacheManager.cpp b/Source/Engine/Graphics/Shaders/Cache/ShaderCacheManager.cpp
index 5b2c2c2df..92fa47e8c 100644
--- a/Source/Engine/Graphics/Shaders/Cache/ShaderCacheManager.cpp
+++ b/Source/Engine/Graphics/Shaders/Cache/ShaderCacheManager.cpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#if COMPILE_WITH_SHADER_CACHE_MANAGER
diff --git a/Source/Engine/Graphics/Shaders/Cache/ShaderCacheManager.h b/Source/Engine/Graphics/Shaders/Cache/ShaderCacheManager.h
index f2c3378dd..5ffa41393 100644
--- a/Source/Engine/Graphics/Shaders/Cache/ShaderCacheManager.h
+++ b/Source/Engine/Graphics/Shaders/Cache/ShaderCacheManager.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/Graphics/Shaders/Cache/ShaderStorage.h b/Source/Engine/Graphics/Shaders/Cache/ShaderStorage.h
index 6ff4fd8fc..03161343a 100644
--- a/Source/Engine/Graphics/Shaders/Cache/ShaderStorage.h
+++ b/Source/Engine/Graphics/Shaders/Cache/ShaderStorage.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/Graphics/Shaders/Config.h b/Source/Engine/Graphics/Shaders/Config.h
index 2aa0cfaa6..708cdc49f 100644
--- a/Source/Engine/Graphics/Shaders/Config.h
+++ b/Source/Engine/Graphics/Shaders/Config.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/Graphics/Shaders/GPUConstantBuffer.h b/Source/Engine/Graphics/Shaders/GPUConstantBuffer.h
index 7efdd6884..bd4358ac1 100644
--- a/Source/Engine/Graphics/Shaders/GPUConstantBuffer.h
+++ b/Source/Engine/Graphics/Shaders/GPUConstantBuffer.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/Graphics/Shaders/GPUShader.cpp b/Source/Engine/Graphics/Shaders/GPUShader.cpp
index 75c713eb9..c3095da4e 100644
--- a/Source/Engine/Graphics/Shaders/GPUShader.cpp
+++ b/Source/Engine/Graphics/Shaders/GPUShader.cpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#include "GPUShader.h"
#include "GPUConstantBuffer.h"
diff --git a/Source/Engine/Graphics/Shaders/GPUShader.h b/Source/Engine/Graphics/Shaders/GPUShader.h
index 2e0a19fa9..79b165396 100644
--- a/Source/Engine/Graphics/Shaders/GPUShader.h
+++ b/Source/Engine/Graphics/Shaders/GPUShader.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/Graphics/Shaders/GPUShaderProgram.h b/Source/Engine/Graphics/Shaders/GPUShaderProgram.h
index d62a8f538..c6a065a62 100644
--- a/Source/Engine/Graphics/Shaders/GPUShaderProgram.h
+++ b/Source/Engine/Graphics/Shaders/GPUShaderProgram.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/Graphics/SkinnedMesh.cs b/Source/Engine/Graphics/SkinnedMesh.cs
index 7d017eb30..e8e0d8353 100644
--- a/Source/Engine/Graphics/SkinnedMesh.cs
+++ b/Source/Engine/Graphics/SkinnedMesh.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
diff --git a/Source/Engine/Graphics/TextureBase.cs b/Source/Engine/Graphics/TextureBase.cs
index f43a4a688..3c22df929 100644
--- a/Source/Engine/Graphics/TextureBase.cs
+++ b/Source/Engine/Graphics/TextureBase.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using System.Runtime.InteropServices;
diff --git a/Source/Engine/Graphics/Textures/GPUSamplerDescription.cpp b/Source/Engine/Graphics/Textures/GPUSamplerDescription.cpp
index ae62191af..e4b868cc6 100644
--- a/Source/Engine/Graphics/Textures/GPUSamplerDescription.cpp
+++ b/Source/Engine/Graphics/Textures/GPUSamplerDescription.cpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#include "GPUSamplerDescription.h"
#include "Engine/Core/Types/String.h"
diff --git a/Source/Engine/Graphics/Textures/GPUSamplerDescription.h b/Source/Engine/Graphics/Textures/GPUSamplerDescription.h
index b4bdac4e6..1b91b419c 100644
--- a/Source/Engine/Graphics/Textures/GPUSamplerDescription.h
+++ b/Source/Engine/Graphics/Textures/GPUSamplerDescription.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/Graphics/Textures/GPUTexture.cpp b/Source/Engine/Graphics/Textures/GPUTexture.cpp
index 849977c05..e51d2e510 100644
--- a/Source/Engine/Graphics/Textures/GPUTexture.cpp
+++ b/Source/Engine/Graphics/Textures/GPUTexture.cpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#include "GPUTexture.h"
#include "TextureData.h"
diff --git a/Source/Engine/Graphics/Textures/GPUTexture.h b/Source/Engine/Graphics/Textures/GPUTexture.h
index 6b543059b..d0ae27e7f 100644
--- a/Source/Engine/Graphics/Textures/GPUTexture.h
+++ b/Source/Engine/Graphics/Textures/GPUTexture.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/Graphics/Textures/GPUTextureDescription.cpp b/Source/Engine/Graphics/Textures/GPUTextureDescription.cpp
index f86992b16..afd63295d 100644
--- a/Source/Engine/Graphics/Textures/GPUTextureDescription.cpp
+++ b/Source/Engine/Graphics/Textures/GPUTextureDescription.cpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#include "GPUTextureDescription.h"
#include "Engine/Core/Types/String.h"
diff --git a/Source/Engine/Graphics/Textures/GPUTextureDescription.cs b/Source/Engine/Graphics/Textures/GPUTextureDescription.cs
index 7262a9bef..48c4a82b4 100644
--- a/Source/Engine/Graphics/Textures/GPUTextureDescription.cs
+++ b/Source/Engine/Graphics/Textures/GPUTextureDescription.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
diff --git a/Source/Engine/Graphics/Textures/GPUTextureDescription.h b/Source/Engine/Graphics/Textures/GPUTextureDescription.h
index 81ee1d3e2..6caadefb5 100644
--- a/Source/Engine/Graphics/Textures/GPUTextureDescription.h
+++ b/Source/Engine/Graphics/Textures/GPUTextureDescription.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/Graphics/Textures/ITextureOwner.h b/Source/Engine/Graphics/Textures/ITextureOwner.h
index e786c6fd9..8f66298ba 100644
--- a/Source/Engine/Graphics/Textures/ITextureOwner.h
+++ b/Source/Engine/Graphics/Textures/ITextureOwner.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/Graphics/Textures/StreamingTexture.cpp b/Source/Engine/Graphics/Textures/StreamingTexture.cpp
index 9a29279d3..15b9c540c 100644
--- a/Source/Engine/Graphics/Textures/StreamingTexture.cpp
+++ b/Source/Engine/Graphics/Textures/StreamingTexture.cpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#include "StreamingTexture.h"
#include "Engine/Threading/Threading.h"
diff --git a/Source/Engine/Graphics/Textures/StreamingTexture.h b/Source/Engine/Graphics/Textures/StreamingTexture.h
index 27323fc5b..3b6e94959 100644
--- a/Source/Engine/Graphics/Textures/StreamingTexture.h
+++ b/Source/Engine/Graphics/Textures/StreamingTexture.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/Graphics/Textures/TextureBase.cpp b/Source/Engine/Graphics/Textures/TextureBase.cpp
index 90e43dbc9..83e781a5a 100644
--- a/Source/Engine/Graphics/Textures/TextureBase.cpp
+++ b/Source/Engine/Graphics/Textures/TextureBase.cpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#include "TextureBase.h"
#include "TextureData.h"
diff --git a/Source/Engine/Graphics/Textures/TextureBase.h b/Source/Engine/Graphics/Textures/TextureBase.h
index adecf8eb6..2cb895a23 100644
--- a/Source/Engine/Graphics/Textures/TextureBase.h
+++ b/Source/Engine/Graphics/Textures/TextureBase.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/Graphics/Textures/TextureData.h b/Source/Engine/Graphics/Textures/TextureData.h
index 77b93cbe1..e5e1eba57 100644
--- a/Source/Engine/Graphics/Textures/TextureData.h
+++ b/Source/Engine/Graphics/Textures/TextureData.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/Graphics/Textures/TextureUtils.h b/Source/Engine/Graphics/Textures/TextureUtils.h
index bb85c8e68..84e1772e9 100644
--- a/Source/Engine/Graphics/Textures/TextureUtils.h
+++ b/Source/Engine/Graphics/Textures/TextureUtils.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/Graphics/Textures/Types.h b/Source/Engine/Graphics/Textures/Types.h
index 072b0c0b2..e20af2b6a 100644
--- a/Source/Engine/Graphics/Textures/Types.h
+++ b/Source/Engine/Graphics/Textures/Types.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/GraphicsDevice/DirectX/DX11/GPUBufferDX11.cpp b/Source/Engine/GraphicsDevice/DirectX/DX11/GPUBufferDX11.cpp
index b23398ba1..042e3c547 100644
--- a/Source/Engine/GraphicsDevice/DirectX/DX11/GPUBufferDX11.cpp
+++ b/Source/Engine/GraphicsDevice/DirectX/DX11/GPUBufferDX11.cpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#if GRAPHICS_API_DIRECTX11
diff --git a/Source/Engine/GraphicsDevice/DirectX/DX11/GPUBufferDX11.h b/Source/Engine/GraphicsDevice/DirectX/DX11/GPUBufferDX11.h
index f7fae283f..b66c317d4 100644
--- a/Source/Engine/GraphicsDevice/DirectX/DX11/GPUBufferDX11.h
+++ b/Source/Engine/GraphicsDevice/DirectX/DX11/GPUBufferDX11.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/GraphicsDevice/DirectX/DX11/GPUContextDX11.cpp b/Source/Engine/GraphicsDevice/DirectX/DX11/GPUContextDX11.cpp
index 86210dcd2..45076f39f 100644
--- a/Source/Engine/GraphicsDevice/DirectX/DX11/GPUContextDX11.cpp
+++ b/Source/Engine/GraphicsDevice/DirectX/DX11/GPUContextDX11.cpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#include "GPUShaderDX11.h"
#if GRAPHICS_API_DIRECTX11
diff --git a/Source/Engine/GraphicsDevice/DirectX/DX11/GPUContextDX11.h b/Source/Engine/GraphicsDevice/DirectX/DX11/GPUContextDX11.h
index c9cf4519b..dffeae00c 100644
--- a/Source/Engine/GraphicsDevice/DirectX/DX11/GPUContextDX11.h
+++ b/Source/Engine/GraphicsDevice/DirectX/DX11/GPUContextDX11.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/GraphicsDevice/DirectX/DX11/GPUDeviceDX11.cpp b/Source/Engine/GraphicsDevice/DirectX/DX11/GPUDeviceDX11.cpp
index 714c86563..64151749b 100644
--- a/Source/Engine/GraphicsDevice/DirectX/DX11/GPUDeviceDX11.cpp
+++ b/Source/Engine/GraphicsDevice/DirectX/DX11/GPUDeviceDX11.cpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#if GRAPHICS_API_DIRECTX11
@@ -23,9 +23,8 @@
#define DX11_FORCE_USE_DX10 0
#define DX11_FORCE_USE_DX10_1 0
-static bool TryCreateDevice(IDXGIAdapter* adapter, D3D_FEATURE_LEVEL maxFeatureLevel, D3D_FEATURE_LEVEL* outFeatureLevel)
+static bool TryCreateDevice(IDXGIAdapter* adapter, D3D_FEATURE_LEVEL maxFeatureLevel, D3D_FEATURE_LEVEL* featureLevel)
{
- // Temporary data
ID3D11Device* device = nullptr;
ID3D11DeviceContext* context = nullptr;
uint32 deviceFlags = D3D11_CREATE_DEVICE_SINGLETHREADED | D3D11_CREATE_DEVICE_BGRA_SUPPORT;
@@ -33,26 +32,22 @@ static bool TryCreateDevice(IDXGIAdapter* adapter, D3D_FEATURE_LEVEL maxFeatureL
deviceFlags |= D3D11_CREATE_DEVICE_DEBUG;
#endif
- D3D_FEATURE_LEVEL requestedFeatureLevels[] =
+ // Pick the first level
+ D3D_FEATURE_LEVEL featureLevels[] =
{
D3D_FEATURE_LEVEL_11_1,
D3D_FEATURE_LEVEL_11_0,
D3D_FEATURE_LEVEL_10_1,
D3D_FEATURE_LEVEL_10_0
};
-
- int32 firstAllowedFeatureLevel = 0;
- int32 numAllowedFeatureLevels = ARRAY_COUNT(requestedFeatureLevels);
- while (firstAllowedFeatureLevel < numAllowedFeatureLevels)
+ int32 levelIndex = 0;
+ while (levelIndex < ARRAY_COUNT(featureLevels))
{
- if (requestedFeatureLevels[firstAllowedFeatureLevel] == maxFeatureLevel)
- {
+ if (featureLevels[levelIndex] == maxFeatureLevel)
break;
- }
- firstAllowedFeatureLevel++;
+ levelIndex++;
}
- numAllowedFeatureLevels -= firstAllowedFeatureLevel;
- if (numAllowedFeatureLevels == 0)
+ if (levelIndex >= ARRAY_COUNT(featureLevels))
{
return false;
}
@@ -63,18 +58,16 @@ static bool TryCreateDevice(IDXGIAdapter* adapter, D3D_FEATURE_LEVEL maxFeatureL
D3D_DRIVER_TYPE_UNKNOWN,
NULL,
deviceFlags,
- &requestedFeatureLevels[firstAllowedFeatureLevel],
- numAllowedFeatureLevels,
+ &featureLevels[levelIndex],
+ ARRAY_COUNT(featureLevels) - levelIndex,
D3D11_SDK_VERSION,
&device,
- outFeatureLevel,
+ featureLevel,
&context
)))
{
- // Release created stuff
device->Release();
context->Release();
-
return true;
}
diff --git a/Source/Engine/GraphicsDevice/DirectX/DX11/GPUDeviceDX11.h b/Source/Engine/GraphicsDevice/DirectX/DX11/GPUDeviceDX11.h
index 2b0cfb665..7b9bc367c 100644
--- a/Source/Engine/GraphicsDevice/DirectX/DX11/GPUDeviceDX11.h
+++ b/Source/Engine/GraphicsDevice/DirectX/DX11/GPUDeviceDX11.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/GraphicsDevice/DirectX/DX11/GPUPipelineStateDX11.cpp b/Source/Engine/GraphicsDevice/DirectX/DX11/GPUPipelineStateDX11.cpp
index e65c3c180..0451cc51e 100644
--- a/Source/Engine/GraphicsDevice/DirectX/DX11/GPUPipelineStateDX11.cpp
+++ b/Source/Engine/GraphicsDevice/DirectX/DX11/GPUPipelineStateDX11.cpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#if GRAPHICS_API_DIRECTX11
diff --git a/Source/Engine/GraphicsDevice/DirectX/DX11/GPUPipelineStateDX11.h b/Source/Engine/GraphicsDevice/DirectX/DX11/GPUPipelineStateDX11.h
index 560d58be0..245788d87 100644
--- a/Source/Engine/GraphicsDevice/DirectX/DX11/GPUPipelineStateDX11.h
+++ b/Source/Engine/GraphicsDevice/DirectX/DX11/GPUPipelineStateDX11.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/GraphicsDevice/DirectX/DX11/GPUShaderDX11.cpp b/Source/Engine/GraphicsDevice/DirectX/DX11/GPUShaderDX11.cpp
index 58c47e54c..5114ba281 100644
--- a/Source/Engine/GraphicsDevice/DirectX/DX11/GPUShaderDX11.cpp
+++ b/Source/Engine/GraphicsDevice/DirectX/DX11/GPUShaderDX11.cpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#if GRAPHICS_API_DIRECTX11
diff --git a/Source/Engine/GraphicsDevice/DirectX/DX11/GPUShaderDX11.h b/Source/Engine/GraphicsDevice/DirectX/DX11/GPUShaderDX11.h
index 35d5b1eb5..d0baf80dd 100644
--- a/Source/Engine/GraphicsDevice/DirectX/DX11/GPUShaderDX11.h
+++ b/Source/Engine/GraphicsDevice/DirectX/DX11/GPUShaderDX11.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/GraphicsDevice/DirectX/DX11/GPUShaderProgramDX11.h b/Source/Engine/GraphicsDevice/DirectX/DX11/GPUShaderProgramDX11.h
index fcc5a9dec..34e6b455a 100644
--- a/Source/Engine/GraphicsDevice/DirectX/DX11/GPUShaderProgramDX11.h
+++ b/Source/Engine/GraphicsDevice/DirectX/DX11/GPUShaderProgramDX11.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/GraphicsDevice/DirectX/DX11/GPUSwapChainDX11.cpp b/Source/Engine/GraphicsDevice/DirectX/DX11/GPUSwapChainDX11.cpp
index 36ffdfa6d..6ebd55384 100644
--- a/Source/Engine/GraphicsDevice/DirectX/DX11/GPUSwapChainDX11.cpp
+++ b/Source/Engine/GraphicsDevice/DirectX/DX11/GPUSwapChainDX11.cpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#if GRAPHICS_API_DIRECTX11
diff --git a/Source/Engine/GraphicsDevice/DirectX/DX11/GPUSwapChainDX11.h b/Source/Engine/GraphicsDevice/DirectX/DX11/GPUSwapChainDX11.h
index 295aa68f3..6de6d0fb8 100644
--- a/Source/Engine/GraphicsDevice/DirectX/DX11/GPUSwapChainDX11.h
+++ b/Source/Engine/GraphicsDevice/DirectX/DX11/GPUSwapChainDX11.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/GraphicsDevice/DirectX/DX11/GPUTextureDX11.cpp b/Source/Engine/GraphicsDevice/DirectX/DX11/GPUTextureDX11.cpp
index 5fdd4eb4a..cb88f4849 100644
--- a/Source/Engine/GraphicsDevice/DirectX/DX11/GPUTextureDX11.cpp
+++ b/Source/Engine/GraphicsDevice/DirectX/DX11/GPUTextureDX11.cpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#if GRAPHICS_API_DIRECTX11
diff --git a/Source/Engine/GraphicsDevice/DirectX/DX11/GPUTextureDX11.h b/Source/Engine/GraphicsDevice/DirectX/DX11/GPUTextureDX11.h
index 60f664f44..004ef6d5c 100644
--- a/Source/Engine/GraphicsDevice/DirectX/DX11/GPUTextureDX11.h
+++ b/Source/Engine/GraphicsDevice/DirectX/DX11/GPUTextureDX11.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/GraphicsDevice/DirectX/DX11/GPUTimerQueryDX11.cpp b/Source/Engine/GraphicsDevice/DirectX/DX11/GPUTimerQueryDX11.cpp
index f0bd24dea..63cd9bcb4 100644
--- a/Source/Engine/GraphicsDevice/DirectX/DX11/GPUTimerQueryDX11.cpp
+++ b/Source/Engine/GraphicsDevice/DirectX/DX11/GPUTimerQueryDX11.cpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#if GRAPHICS_API_DIRECTX11
@@ -107,13 +107,20 @@ float GPUTimerQueryDX11::GetResult()
if (disjointData.Disjoint == FALSE)
{
- const float frequency = static_cast(disjointData.Frequency);
const UINT64 delta = timeEnd - timeStart;
- _timeDelta = (float)((delta / frequency) * 1000.0);
+ _timeDelta = (float)(((double)delta / (double)disjointData.Frequency) * 1000.0);
}
else
{
- LOG(Warning, "Unrealiable GPU timer query detected.");
+ _timeDelta = 0.0f;
+#if !BUILD_RELEASE
+ static bool SingleShotLog = false;
+ if (!SingleShotLog)
+ {
+ SingleShotLog = true;
+ LOG(Warning, "Unrealiable GPU timer query detected.");
+ }
+#endif
}
_finalized = true;
diff --git a/Source/Engine/GraphicsDevice/DirectX/DX11/GPUTimerQueryDX11.h b/Source/Engine/GraphicsDevice/DirectX/DX11/GPUTimerQueryDX11.h
index 3979b9714..5ded4ae33 100644
--- a/Source/Engine/GraphicsDevice/DirectX/DX11/GPUTimerQueryDX11.h
+++ b/Source/Engine/GraphicsDevice/DirectX/DX11/GPUTimerQueryDX11.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/GraphicsDevice/DirectX/DX11/GraphicsDeviceDX11.Build.cs b/Source/Engine/GraphicsDevice/DirectX/DX11/GraphicsDeviceDX11.Build.cs
index c2e7f4fe5..d603089af 100644
--- a/Source/Engine/GraphicsDevice/DirectX/DX11/GraphicsDeviceDX11.Build.cs
+++ b/Source/Engine/GraphicsDevice/DirectX/DX11/GraphicsDeviceDX11.Build.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using Flax.Build.NativeCpp;
diff --git a/Source/Engine/GraphicsDevice/DirectX/DX11/IShaderResourceDX11.h b/Source/Engine/GraphicsDevice/DirectX/DX11/IShaderResourceDX11.h
index 518ad59a3..3d67a9e7e 100644
--- a/Source/Engine/GraphicsDevice/DirectX/DX11/IShaderResourceDX11.h
+++ b/Source/Engine/GraphicsDevice/DirectX/DX11/IShaderResourceDX11.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/GraphicsDevice/DirectX/DX12/CommandAllocatorPoolDX12.cpp b/Source/Engine/GraphicsDevice/DirectX/DX12/CommandAllocatorPoolDX12.cpp
index d82024581..f3f7cd897 100644
--- a/Source/Engine/GraphicsDevice/DirectX/DX12/CommandAllocatorPoolDX12.cpp
+++ b/Source/Engine/GraphicsDevice/DirectX/DX12/CommandAllocatorPoolDX12.cpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#if GRAPHICS_API_DIRECTX12
diff --git a/Source/Engine/GraphicsDevice/DirectX/DX12/CommandAllocatorPoolDX12.h b/Source/Engine/GraphicsDevice/DirectX/DX12/CommandAllocatorPoolDX12.h
index 8020e2b11..2c870d25b 100644
--- a/Source/Engine/GraphicsDevice/DirectX/DX12/CommandAllocatorPoolDX12.h
+++ b/Source/Engine/GraphicsDevice/DirectX/DX12/CommandAllocatorPoolDX12.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/GraphicsDevice/DirectX/DX12/CommandQueueDX12.cpp b/Source/Engine/GraphicsDevice/DirectX/DX12/CommandQueueDX12.cpp
index d5844e5ff..c9740dd03 100644
--- a/Source/Engine/GraphicsDevice/DirectX/DX12/CommandQueueDX12.cpp
+++ b/Source/Engine/GraphicsDevice/DirectX/DX12/CommandQueueDX12.cpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#if GRAPHICS_API_DIRECTX12
diff --git a/Source/Engine/GraphicsDevice/DirectX/DX12/CommandQueueDX12.h b/Source/Engine/GraphicsDevice/DirectX/DX12/CommandQueueDX12.h
index 963e5dcf0..e92a3b819 100644
--- a/Source/Engine/GraphicsDevice/DirectX/DX12/CommandQueueDX12.h
+++ b/Source/Engine/GraphicsDevice/DirectX/DX12/CommandQueueDX12.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/GraphicsDevice/DirectX/DX12/CommandSignatureDX12.h b/Source/Engine/GraphicsDevice/DirectX/DX12/CommandSignatureDX12.h
index 0cbe94abd..8406e6eba 100644
--- a/Source/Engine/GraphicsDevice/DirectX/DX12/CommandSignatureDX12.h
+++ b/Source/Engine/GraphicsDevice/DirectX/DX12/CommandSignatureDX12.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/GraphicsDevice/DirectX/DX12/DescriptorHeapDX12.cpp b/Source/Engine/GraphicsDevice/DirectX/DX12/DescriptorHeapDX12.cpp
index 09258dbb4..f07f66edc 100644
--- a/Source/Engine/GraphicsDevice/DirectX/DX12/DescriptorHeapDX12.cpp
+++ b/Source/Engine/GraphicsDevice/DirectX/DX12/DescriptorHeapDX12.cpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#if GRAPHICS_API_DIRECTX12
diff --git a/Source/Engine/GraphicsDevice/DirectX/DX12/DescriptorHeapDX12.h b/Source/Engine/GraphicsDevice/DirectX/DX12/DescriptorHeapDX12.h
index 18b09cea2..8123a1ead 100644
--- a/Source/Engine/GraphicsDevice/DirectX/DX12/DescriptorHeapDX12.h
+++ b/Source/Engine/GraphicsDevice/DirectX/DX12/DescriptorHeapDX12.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/GraphicsDevice/DirectX/DX12/GPUBufferDX12.cpp b/Source/Engine/GraphicsDevice/DirectX/DX12/GPUBufferDX12.cpp
index 2fc36dd7d..df8ff9606 100644
--- a/Source/Engine/GraphicsDevice/DirectX/DX12/GPUBufferDX12.cpp
+++ b/Source/Engine/GraphicsDevice/DirectX/DX12/GPUBufferDX12.cpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#if GRAPHICS_API_DIRECTX12
diff --git a/Source/Engine/GraphicsDevice/DirectX/DX12/GPUBufferDX12.h b/Source/Engine/GraphicsDevice/DirectX/DX12/GPUBufferDX12.h
index 29b01b4dd..7d607f960 100644
--- a/Source/Engine/GraphicsDevice/DirectX/DX12/GPUBufferDX12.h
+++ b/Source/Engine/GraphicsDevice/DirectX/DX12/GPUBufferDX12.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/GraphicsDevice/DirectX/DX12/GPUContextDX12.cpp b/Source/Engine/GraphicsDevice/DirectX/DX12/GPUContextDX12.cpp
index ef9fbd6c9..ce36a7347 100644
--- a/Source/Engine/GraphicsDevice/DirectX/DX12/GPUContextDX12.cpp
+++ b/Source/Engine/GraphicsDevice/DirectX/DX12/GPUContextDX12.cpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#if GRAPHICS_API_DIRECTX12
@@ -144,23 +144,17 @@ void GPUContextDX12::SetResourceState(ResourceOwnerDX12* resource, D3D12_RESOURC
auto& state = resource->State;
if (subresourceIndex == D3D12_RESOURCE_BARRIER_ALL_SUBRESOURCES && !state.AreAllSubresourcesSame())
{
- // Slow path. Want to transition the entire resource (with multiple subresources). But they aren't in the same state.
-
+ // Slow path because we have to transition the entire resource with multiple subresources that aren't in the same state
const uint32 subresourceCount = resource->GetSubresourcesCount();
for (uint32 i = 0; i < subresourceCount; i++)
{
const D3D12_RESOURCE_STATES before = state.GetSubresourceState(i);
-
- // We're not using IsTransitionNeeded() because we do want to transition even if 'after' is a subset of 'before'
- // This is so that we can ensure all subresources are in the same state, simplifying future barriers
if (before != after)
{
AddTransitionBarrier(resource, before, after, i);
state.SetSubresourceState(i, after);
}
}
-
- // The entire resource should now be in the after state on this command list
ASSERT(state.CheckResourceState(after));
state.SetResourceState(after);
}
diff --git a/Source/Engine/GraphicsDevice/DirectX/DX12/GPUContextDX12.h b/Source/Engine/GraphicsDevice/DirectX/DX12/GPUContextDX12.h
index 08983786f..6fb670e7b 100644
--- a/Source/Engine/GraphicsDevice/DirectX/DX12/GPUContextDX12.h
+++ b/Source/Engine/GraphicsDevice/DirectX/DX12/GPUContextDX12.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/GraphicsDevice/DirectX/DX12/GPUDeviceDX12.cpp b/Source/Engine/GraphicsDevice/DirectX/DX12/GPUDeviceDX12.cpp
index aaeda76f1..29d417834 100644
--- a/Source/Engine/GraphicsDevice/DirectX/DX12/GPUDeviceDX12.cpp
+++ b/Source/Engine/GraphicsDevice/DirectX/DX12/GPUDeviceDX12.cpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#if GRAPHICS_API_DIRECTX12
diff --git a/Source/Engine/GraphicsDevice/DirectX/DX12/GPUDeviceDX12.h b/Source/Engine/GraphicsDevice/DirectX/DX12/GPUDeviceDX12.h
index abaa229b6..ee6e69002 100644
--- a/Source/Engine/GraphicsDevice/DirectX/DX12/GPUDeviceDX12.h
+++ b/Source/Engine/GraphicsDevice/DirectX/DX12/GPUDeviceDX12.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
@@ -172,12 +172,8 @@ public:
{
if (sampleCount <= 8)
{
- // 0 has better quality (a more even distribution)
- // Higher quality levels might be useful for non box filtered AA or when using weighted samples.
return 0;
}
-
- // Not supported.
return 0xffffffff;
}
@@ -187,7 +183,7 @@ public:
#endif
private:
-
+
#if PLATFORM_XBOX_SCARLETT
void updateFrameEvents();
#endif
diff --git a/Source/Engine/GraphicsDevice/DirectX/DX12/GPUPipelineStateDX12.cpp b/Source/Engine/GraphicsDevice/DirectX/DX12/GPUPipelineStateDX12.cpp
index 3de0073fa..5c18c2e2d 100644
--- a/Source/Engine/GraphicsDevice/DirectX/DX12/GPUPipelineStateDX12.cpp
+++ b/Source/Engine/GraphicsDevice/DirectX/DX12/GPUPipelineStateDX12.cpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#if GRAPHICS_API_DIRECTX12
diff --git a/Source/Engine/GraphicsDevice/DirectX/DX12/GPUPipelineStateDX12.h b/Source/Engine/GraphicsDevice/DirectX/DX12/GPUPipelineStateDX12.h
index c7ad9bb82..020d03d82 100644
--- a/Source/Engine/GraphicsDevice/DirectX/DX12/GPUPipelineStateDX12.h
+++ b/Source/Engine/GraphicsDevice/DirectX/DX12/GPUPipelineStateDX12.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/GraphicsDevice/DirectX/DX12/GPUShaderDX12.cpp b/Source/Engine/GraphicsDevice/DirectX/DX12/GPUShaderDX12.cpp
index b87743c4c..61a52c0e7 100644
--- a/Source/Engine/GraphicsDevice/DirectX/DX12/GPUShaderDX12.cpp
+++ b/Source/Engine/GraphicsDevice/DirectX/DX12/GPUShaderDX12.cpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#if GRAPHICS_API_DIRECTX12
diff --git a/Source/Engine/GraphicsDevice/DirectX/DX12/GPUShaderDX12.h b/Source/Engine/GraphicsDevice/DirectX/DX12/GPUShaderDX12.h
index cd466b35c..2ea9177cf 100644
--- a/Source/Engine/GraphicsDevice/DirectX/DX12/GPUShaderDX12.h
+++ b/Source/Engine/GraphicsDevice/DirectX/DX12/GPUShaderDX12.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/GraphicsDevice/DirectX/DX12/GPUShaderProgramDX12.h b/Source/Engine/GraphicsDevice/DirectX/DX12/GPUShaderProgramDX12.h
index 8e35ce39b..11f16d5c2 100644
--- a/Source/Engine/GraphicsDevice/DirectX/DX12/GPUShaderProgramDX12.h
+++ b/Source/Engine/GraphicsDevice/DirectX/DX12/GPUShaderProgramDX12.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/GraphicsDevice/DirectX/DX12/GPUSwapChainDX12.cpp b/Source/Engine/GraphicsDevice/DirectX/DX12/GPUSwapChainDX12.cpp
index 2ab4cd1e9..669b217e4 100644
--- a/Source/Engine/GraphicsDevice/DirectX/DX12/GPUSwapChainDX12.cpp
+++ b/Source/Engine/GraphicsDevice/DirectX/DX12/GPUSwapChainDX12.cpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#if GRAPHICS_API_DIRECTX12
diff --git a/Source/Engine/GraphicsDevice/DirectX/DX12/GPUSwapChainDX12.h b/Source/Engine/GraphicsDevice/DirectX/DX12/GPUSwapChainDX12.h
index fcc48875a..8f8ba9078 100644
--- a/Source/Engine/GraphicsDevice/DirectX/DX12/GPUSwapChainDX12.h
+++ b/Source/Engine/GraphicsDevice/DirectX/DX12/GPUSwapChainDX12.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/GraphicsDevice/DirectX/DX12/GPUTextureDX12.cpp b/Source/Engine/GraphicsDevice/DirectX/DX12/GPUTextureDX12.cpp
index b346b5ece..03ba98eaf 100644
--- a/Source/Engine/GraphicsDevice/DirectX/DX12/GPUTextureDX12.cpp
+++ b/Source/Engine/GraphicsDevice/DirectX/DX12/GPUTextureDX12.cpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#if GRAPHICS_API_DIRECTX12
@@ -144,10 +144,8 @@ bool GPUTextureDX12::OnInit()
{
resourceDesc.Flags |= D3D12_RESOURCE_FLAG_ALLOW_DEPTH_STENCIL;
initialState = D3D12_RESOURCE_STATE_DEPTH_WRITE;
-
if (!useSRV)
{
- // Only deny shader resources if it's a depth resource that will never be used as SRV
resourceDesc.Flags |= D3D12_RESOURCE_FLAG_DENY_SHADER_RESOURCE;
}
}
diff --git a/Source/Engine/GraphicsDevice/DirectX/DX12/GPUTextureDX12.h b/Source/Engine/GraphicsDevice/DirectX/DX12/GPUTextureDX12.h
index 71c4e4362..e38d5a712 100644
--- a/Source/Engine/GraphicsDevice/DirectX/DX12/GPUTextureDX12.h
+++ b/Source/Engine/GraphicsDevice/DirectX/DX12/GPUTextureDX12.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/GraphicsDevice/DirectX/DX12/GPUTimerQueryDX12.cpp b/Source/Engine/GraphicsDevice/DirectX/DX12/GPUTimerQueryDX12.cpp
index a7a953ac4..afd30ca1d 100644
--- a/Source/Engine/GraphicsDevice/DirectX/DX12/GPUTimerQueryDX12.cpp
+++ b/Source/Engine/GraphicsDevice/DirectX/DX12/GPUTimerQueryDX12.cpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#if GRAPHICS_API_DIRECTX12
diff --git a/Source/Engine/GraphicsDevice/DirectX/DX12/GPUTimerQueryDX12.h b/Source/Engine/GraphicsDevice/DirectX/DX12/GPUTimerQueryDX12.h
index 295811c21..f406edda1 100644
--- a/Source/Engine/GraphicsDevice/DirectX/DX12/GPUTimerQueryDX12.h
+++ b/Source/Engine/GraphicsDevice/DirectX/DX12/GPUTimerQueryDX12.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/GraphicsDevice/DirectX/DX12/GraphicsDeviceDX12.Build.cs b/Source/Engine/GraphicsDevice/DirectX/DX12/GraphicsDeviceDX12.Build.cs
index c5eb1a35c..b8581bff0 100644
--- a/Source/Engine/GraphicsDevice/DirectX/DX12/GraphicsDeviceDX12.Build.cs
+++ b/Source/Engine/GraphicsDevice/DirectX/DX12/GraphicsDeviceDX12.Build.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System.IO;
using Flax.Build;
diff --git a/Source/Engine/GraphicsDevice/DirectX/DX12/IShaderResourceDX12.h b/Source/Engine/GraphicsDevice/DirectX/DX12/IShaderResourceDX12.h
index cc0ec87fe..155b018e3 100644
--- a/Source/Engine/GraphicsDevice/DirectX/DX12/IShaderResourceDX12.h
+++ b/Source/Engine/GraphicsDevice/DirectX/DX12/IShaderResourceDX12.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/GraphicsDevice/DirectX/DX12/QueryHeapDX12.cpp b/Source/Engine/GraphicsDevice/DirectX/DX12/QueryHeapDX12.cpp
index aa2d17bed..a7bbb6f2c 100644
--- a/Source/Engine/GraphicsDevice/DirectX/DX12/QueryHeapDX12.cpp
+++ b/Source/Engine/GraphicsDevice/DirectX/DX12/QueryHeapDX12.cpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#if GRAPHICS_API_DIRECTX12
@@ -86,7 +86,7 @@ void QueryHeapDX12::EndQueryBatchAndResolveQueryData(GPUContextDX12* context)
{
ASSERT(_currentBatch.Open);
- // Discard empty batches
+ // Skip empty batches
if (_currentBatch.Count == 0)
{
return;
diff --git a/Source/Engine/GraphicsDevice/DirectX/DX12/QueryHeapDX12.h b/Source/Engine/GraphicsDevice/DirectX/DX12/QueryHeapDX12.h
index 9a405e8b7..cc3a07e61 100644
--- a/Source/Engine/GraphicsDevice/DirectX/DX12/QueryHeapDX12.h
+++ b/Source/Engine/GraphicsDevice/DirectX/DX12/QueryHeapDX12.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/GraphicsDevice/DirectX/DX12/ResourceOwnerDX12.cpp b/Source/Engine/GraphicsDevice/DirectX/DX12/ResourceOwnerDX12.cpp
index e1b460a8f..0c482f55a 100644
--- a/Source/Engine/GraphicsDevice/DirectX/DX12/ResourceOwnerDX12.cpp
+++ b/Source/Engine/GraphicsDevice/DirectX/DX12/ResourceOwnerDX12.cpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#if GRAPHICS_API_DIRECTX12
diff --git a/Source/Engine/GraphicsDevice/DirectX/DX12/ResourceOwnerDX12.h b/Source/Engine/GraphicsDevice/DirectX/DX12/ResourceOwnerDX12.h
index 14e25bc85..c3e241f8d 100644
--- a/Source/Engine/GraphicsDevice/DirectX/DX12/ResourceOwnerDX12.h
+++ b/Source/Engine/GraphicsDevice/DirectX/DX12/ResourceOwnerDX12.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
@@ -33,14 +33,11 @@ public:
/// Returns true if resource state transition is needed in order to use resource in given state.
///
/// The current resource state.
- /// the destination resource state.
+ /// the destination resource state.
/// True if need to perform a transition, otherwise false.
- static bool IsTransitionNeeded(D3D12_RESOURCE_STATES currentState, D3D12_RESOURCE_STATES targeState)
+ static bool IsTransitionNeeded(D3D12_RESOURCE_STATES currentState, D3D12_RESOURCE_STATES targetState)
{
- // If 'targeState' is a subset of 'before', then there's no need for a transition
- // Note: COMMON is an oddball state that doesn't follow the RESOURE_STATE pattern of
- // having exactly one bit set so we need to special case these
- return currentState != targeState && ((currentState | targeState) != currentState || targeState == D3D12_RESOURCE_STATE_COMMON);
+ return currentState != targetState && ((currentState | targetState) != currentState || targetState == D3D12_RESOURCE_STATE_COMMON);
}
};
diff --git a/Source/Engine/GraphicsDevice/DirectX/DX12/UploadBufferDX12.cpp b/Source/Engine/GraphicsDevice/DirectX/DX12/UploadBufferDX12.cpp
index 2a06ad930..c4680b57e 100644
--- a/Source/Engine/GraphicsDevice/DirectX/DX12/UploadBufferDX12.cpp
+++ b/Source/Engine/GraphicsDevice/DirectX/DX12/UploadBufferDX12.cpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#if GRAPHICS_API_DIRECTX12
diff --git a/Source/Engine/GraphicsDevice/DirectX/DX12/UploadBufferDX12.h b/Source/Engine/GraphicsDevice/DirectX/DX12/UploadBufferDX12.h
index 4cfcc140c..6995e5c65 100644
--- a/Source/Engine/GraphicsDevice/DirectX/DX12/UploadBufferDX12.h
+++ b/Source/Engine/GraphicsDevice/DirectX/DX12/UploadBufferDX12.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/GraphicsDevice/DirectX/GPUAdapterDX.h b/Source/Engine/GraphicsDevice/DirectX/GPUAdapterDX.h
index 78829e353..5aafbacf6 100644
--- a/Source/Engine/GraphicsDevice/DirectX/GPUAdapterDX.h
+++ b/Source/Engine/GraphicsDevice/DirectX/GPUAdapterDX.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/GraphicsDevice/DirectX/GPUDeviceDX.h b/Source/Engine/GraphicsDevice/DirectX/GPUDeviceDX.h
index 818dd0aeb..2671f43f7 100644
--- a/Source/Engine/GraphicsDevice/DirectX/GPUDeviceDX.h
+++ b/Source/Engine/GraphicsDevice/DirectX/GPUDeviceDX.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
@@ -267,43 +267,33 @@ protected:
// [GPUDevice]
bool Init() override
{
- // Cache adapter description
const DXGI_ADAPTER_DESC& adapterDesc = _adapter->Description;
const uint64 dedicatedVideoMemory = static_cast(adapterDesc.DedicatedVideoMemory);
const uint64 dedicatedSystemMemory = static_cast(adapterDesc.DedicatedSystemMemory);
const uint64 sharedSystemMemory = static_cast(adapterDesc.SharedSystemMemory);
- // Total amount of system memory clamped to 8 GB
- const uint64 totalPhysicalMemory = Math::Min(Platform::GetMemoryStats().TotalPhysicalMemory, 8Ull * 1024Ull * 1024Ull * 1024Ull);
-
- // Consider 50% of the shared memory but max 25% of total system memory
- const uint64 consideredSharedSystemMemory = Math::Min(sharedSystemMemory / 2Ull, totalPhysicalMemory / 4Ull);
-
// Calculate total GPU memory
+ const uint64 totalPhysicalMemory = Math::Min(Platform::GetMemoryStats().TotalPhysicalMemory, 16Ull * 1024Ull * 1024Ull * 1024Ull);
+ const uint64 totalSystemMemory = Math::Min(sharedSystemMemory / 2Ull, totalPhysicalMemory / 4Ull);
TotalGraphicsMemory = 0;
if (_adapter->IsIntel())
{
- // Use total memory for integrated cards
- TotalGraphicsMemory = dedicatedVideoMemory + dedicatedSystemMemory + consideredSharedSystemMemory;
+ TotalGraphicsMemory = dedicatedVideoMemory + dedicatedSystemMemory + totalSystemMemory;
}
else if (dedicatedVideoMemory >= 200 * 1024 * 1024)
{
- // Use dedicated video memory, if it's more than 200 MB
TotalGraphicsMemory = dedicatedVideoMemory;
}
else if (dedicatedSystemMemory >= 200 * 1024 * 1024)
{
- // Use dedicated system memory, if it's more than 200 MB
TotalGraphicsMemory = dedicatedSystemMemory;
}
else if (sharedSystemMemory >= 400 * 1024 * 1024)
{
- // Use some shared system memory, if it's more than 400 MB
- TotalGraphicsMemory = consideredSharedSystemMemory;
+ TotalGraphicsMemory = totalSystemMemory;
}
else
{
- // Otherwise consider 25% of total system memory for graphics
TotalGraphicsMemory = totalPhysicalMemory / 4Ull;
}
diff --git a/Source/Engine/GraphicsDevice/DirectX/IncludeDirectXHeaders.h b/Source/Engine/GraphicsDevice/DirectX/IncludeDirectXHeaders.h
index 9dd60d134..8351deb71 100644
--- a/Source/Engine/GraphicsDevice/DirectX/IncludeDirectXHeaders.h
+++ b/Source/Engine/GraphicsDevice/DirectX/IncludeDirectXHeaders.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/GraphicsDevice/DirectX/RenderToolsDX.h b/Source/Engine/GraphicsDevice/DirectX/RenderToolsDX.h
index f62b837ca..0d13db1f0 100644
--- a/Source/Engine/GraphicsDevice/DirectX/RenderToolsDX.h
+++ b/Source/Engine/GraphicsDevice/DirectX/RenderToolsDX.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/GraphicsDevice/Null/GPUAdapterNull.h b/Source/Engine/GraphicsDevice/Null/GPUAdapterNull.h
index 5361b947f..52be9695d 100644
--- a/Source/Engine/GraphicsDevice/Null/GPUAdapterNull.h
+++ b/Source/Engine/GraphicsDevice/Null/GPUAdapterNull.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/GraphicsDevice/Null/GPUBufferNull.h b/Source/Engine/GraphicsDevice/Null/GPUBufferNull.h
index 4f2dbe22d..667e2c557 100644
--- a/Source/Engine/GraphicsDevice/Null/GPUBufferNull.h
+++ b/Source/Engine/GraphicsDevice/Null/GPUBufferNull.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/GraphicsDevice/Null/GPUContextNull.h b/Source/Engine/GraphicsDevice/Null/GPUContextNull.h
index 236726f0b..f45417976 100644
--- a/Source/Engine/GraphicsDevice/Null/GPUContextNull.h
+++ b/Source/Engine/GraphicsDevice/Null/GPUContextNull.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/GraphicsDevice/Null/GPUDeviceNull.cpp b/Source/Engine/GraphicsDevice/Null/GPUDeviceNull.cpp
index a2fdacb1d..e20fe0ac0 100644
--- a/Source/Engine/GraphicsDevice/Null/GPUDeviceNull.cpp
+++ b/Source/Engine/GraphicsDevice/Null/GPUDeviceNull.cpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#if GRAPHICS_API_NULL
diff --git a/Source/Engine/GraphicsDevice/Null/GPUDeviceNull.h b/Source/Engine/GraphicsDevice/Null/GPUDeviceNull.h
index b6abb55ef..d13166a27 100644
--- a/Source/Engine/GraphicsDevice/Null/GPUDeviceNull.h
+++ b/Source/Engine/GraphicsDevice/Null/GPUDeviceNull.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/GraphicsDevice/Null/GPUPipelineStateNull.h b/Source/Engine/GraphicsDevice/Null/GPUPipelineStateNull.h
index 33fe97c5b..f90333c1c 100644
--- a/Source/Engine/GraphicsDevice/Null/GPUPipelineStateNull.h
+++ b/Source/Engine/GraphicsDevice/Null/GPUPipelineStateNull.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/GraphicsDevice/Null/GPUShaderNull.h b/Source/Engine/GraphicsDevice/Null/GPUShaderNull.h
index 7a0a2124a..db8f75326 100644
--- a/Source/Engine/GraphicsDevice/Null/GPUShaderNull.h
+++ b/Source/Engine/GraphicsDevice/Null/GPUShaderNull.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/GraphicsDevice/Null/GPUSwapChainNull.h b/Source/Engine/GraphicsDevice/Null/GPUSwapChainNull.h
index 0d9e9855b..61142d84d 100644
--- a/Source/Engine/GraphicsDevice/Null/GPUSwapChainNull.h
+++ b/Source/Engine/GraphicsDevice/Null/GPUSwapChainNull.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/GraphicsDevice/Null/GPUTextureNull.h b/Source/Engine/GraphicsDevice/Null/GPUTextureNull.h
index 608373f95..eaa000081 100644
--- a/Source/Engine/GraphicsDevice/Null/GPUTextureNull.h
+++ b/Source/Engine/GraphicsDevice/Null/GPUTextureNull.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/GraphicsDevice/Null/GPUTimerQueryNull.h b/Source/Engine/GraphicsDevice/Null/GPUTimerQueryNull.h
index da5f96d13..3b2a6de92 100644
--- a/Source/Engine/GraphicsDevice/Null/GPUTimerQueryNull.h
+++ b/Source/Engine/GraphicsDevice/Null/GPUTimerQueryNull.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/GraphicsDevice/Null/GraphicsDeviceNull.Build.cs b/Source/Engine/GraphicsDevice/Null/GraphicsDeviceNull.Build.cs
index 52f2ccd08..230945c52 100644
--- a/Source/Engine/GraphicsDevice/Null/GraphicsDeviceNull.Build.cs
+++ b/Source/Engine/GraphicsDevice/Null/GraphicsDeviceNull.Build.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using Flax.Build.NativeCpp;
diff --git a/Source/Engine/GraphicsDevice/OpenGL/Config.h b/Source/Engine/GraphicsDevice/OpenGL/Config.h
deleted file mode 100644
index 403f32535..000000000
--- a/Source/Engine/GraphicsDevice/OpenGL/Config.h
+++ /dev/null
@@ -1,22 +0,0 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
-
-#pragma once
-
-#include "Engine/Graphics/Config.h"
-
-// Flax uses DirectX versioning to switch between graphics features.
-// Version mapping:
-// DirectX 10 = OpenGL ES 3.0 = OpenGL 4.1
-// DirectX 11 = OpenGl ES 3.1 = OpenGL 4.4
-
-#define SHADER_DATA_FORMAT_RAW 0
-#define SHADER_DATA_FORMAT_LZ4 1
-
-// Enables force OpenGL shaders verification
-#define GPU_OGL_DEBUG_SHADERS 1
-
-// True if use OpenGL Debug Layer
-#define GPU_OGL_USE_DEBUG_LAYER GPU_ENABLE_DIAGNOSTICS
-
-// True if don't release the OpenGL shaders source code, can be used to debug rendering
-#define GPU_OGL_KEEP_SHADER_SRC GPU_ENABLE_DIAGNOSTICS
diff --git a/Source/Engine/GraphicsDevice/OpenGL/ContextOGL.h b/Source/Engine/GraphicsDevice/OpenGL/ContextOGL.h
deleted file mode 100644
index d7893c10c..000000000
--- a/Source/Engine/GraphicsDevice/OpenGL/ContextOGL.h
+++ /dev/null
@@ -1,11 +0,0 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
-
-#pragma once
-
-#if PLATFORM_WINDOWS
-
-#include "Win32/Win32ContextOGL.h"
-
-typedef Win32ContextOGL ContextOGL;
-
-#endif
diff --git a/Source/Engine/GraphicsDevice/OpenGL/FBOCache.cpp b/Source/Engine/GraphicsDevice/OpenGL/FBOCache.cpp
deleted file mode 100644
index 04eba0f85..000000000
--- a/Source/Engine/GraphicsDevice/OpenGL/FBOCache.cpp
+++ /dev/null
@@ -1,167 +0,0 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
-
-#include "FBOCache.h"
-
-#if GRAPHICS_API_OPENGL
-
-#include "TextureOGL.h"
-#include "RenderToolsOGL.h"
-
-FBOCache::FBOCache()
- : Table(2048)
-{
-}
-
-FBOCache::~FBOCache()
-{
- Dispose();
-}
-
-GLuint FBOCache::GetFBO(uint32 rtCount, GPUTextureViewOGL* depthStencil, GPUTextureViewOGL* rts[])
-{
- ASSERT(rtCount > 0 || depthStencil != nullptr);
-
- Key key(rtCount, depthStencil, rts);
- GLuint fbo;
-
- if (!Table.TryGet(key, fbo))
- {
- // Create new FBO
- glGenFramebuffers(1, &fbo);
- VALIDATE_OPENGL_RESULT();
-
- // Bind FBO
- glBindFramebuffer(GL_DRAW_FRAMEBUFFER, fbo);
- VALIDATE_OPENGL_RESULT();
- glBindFramebuffer(GL_READ_FRAMEBUFFER, fbo);
- VALIDATE_OPENGL_RESULT();
-
- // Initialize FBO
- for (int32 i = 0; i < rtCount; i++)
- {
- rts[i]->AttachToFramebuffer(GL_COLOR_ATTACHMENT0 + i);
- }
- if(depthStencil)
- {
- GLenum attachmentPoint = PixelFormatExtensions::HasStencil(depthStencil->GetFormat()) ? GL_DEPTH_STENCIL_ATTACHMENT : GL_DEPTH_ATTACHMENT;
- depthStencil->AttachToFramebuffer(attachmentPoint);
- }
-
- // We now need to set mapping between shader outputs and
-// color attachments. This largely redundant step is performed
- // by glDrawBuffers()
- static const GLenum DrawBuffers[] =
- {
- GL_COLOR_ATTACHMENT0,
- GL_COLOR_ATTACHMENT1,
- GL_COLOR_ATTACHMENT2,
- GL_COLOR_ATTACHMENT3,
- GL_COLOR_ATTACHMENT4,
- GL_COLOR_ATTACHMENT5,
- GL_COLOR_ATTACHMENT6,
- GL_COLOR_ATTACHMENT7,
- GL_COLOR_ATTACHMENT8,
- GL_COLOR_ATTACHMENT9,
- GL_COLOR_ATTACHMENT10,
- GL_COLOR_ATTACHMENT11,
- GL_COLOR_ATTACHMENT12,
- GL_COLOR_ATTACHMENT13,
- GL_COLOR_ATTACHMENT14,
- GL_COLOR_ATTACHMENT15
- };
- // The state set by glDrawBuffers() is part of the state of the framebuffer.
- // So it can be set up once and left it set.
- glDrawBuffers(rtCount, DrawBuffers);
- VALIDATE_OPENGL_RESULT();
-
- // Validate
- GLenum status = glCheckFramebufferStatus(GL_FRAMEBUFFER);
- if (status != GL_FRAMEBUFFER_COMPLETE)
- {
- const Char* str = TEXT("Unknown");
- switch (status)
- {
-#define STATUS_TO_STR(name) case name: str = TEXT(#name); break
- STATUS_TO_STR(GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT);
- STATUS_TO_STR(GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT);
- STATUS_TO_STR(GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER);
- STATUS_TO_STR(GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER);
- STATUS_TO_STR(GL_FRAMEBUFFER_UNSUPPORTED);
- STATUS_TO_STR(GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE);
- STATUS_TO_STR(GL_FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS);
-#undef STATUS_TO_STR
- }
- LOG(Error, "Framebuffer is incomplete. Status: {0}", str);
- }
-
- // Register in cache
- Table.Add(key, fbo);
- }
-
- return fbo;
-}
-
-void FBOCache::OnTextureRelease(TextureOGL* texture)
-{
- for (auto i = Table.Begin(); i.IsNotEnd(); ++i)
- {
- if (i->Key.HasReference(texture))
- {
- GLuint fbo = i->Value;
- glDeleteFramebuffers(1, &fbo);
- Table.Remove(i);
- }
- }
-}
-
-void FBOCache::Dispose()
-{
- for (auto i = Table.Begin(); i.IsNotEnd(); ++i)
- {
- GLuint fbo = i->Value;
- glDeleteFramebuffers(1, &fbo);
- }
- Table.Clear();
-}
-
-FBOCache::Key::Key(uint32 rtCount, GPUTextureViewOGL* depthStencil, GPUTextureViewOGL* rts[])
-{
- Hash = rtCount * 371;
- HashCombinePointer(Hash, depthStencil);
- RTCount = rtCount;
- DepthStencil = depthStencil;
- for (int32 i = 0; i < rtCount; i++)
- {
- RT[i] = rts[i];
- HashCombinePointer(Hash, rts[i]);
- }
-}
-
-bool FBOCache::Key::HasReference(TextureOGL* texture)
-{
- for (int32 i = 0; i < RTCount; i++)
- {
- if (RT[i] && RT[i]->GetTexture() == texture)
- return true;
- }
- return (DepthStencil && DepthStencil->GetTexture() == texture);
-}
-
-bool FBOCache::Key::operator==(const Key & other) const
-{
- if (Hash != 0 && other.Hash != 0 && Hash != other.Hash)
- return false;
-
- if (RTCount != other.RTCount)
- return false;
-
- for (int32 rt = 0; rt < RTCount; rt++)
- {
- if (RT[rt] != other.RT[rt])
- return false;
- }
-
- return DepthStencil == other.DepthStencil;
-}
-
-#endif
diff --git a/Source/Engine/GraphicsDevice/OpenGL/FBOCache.h b/Source/Engine/GraphicsDevice/OpenGL/FBOCache.h
deleted file mode 100644
index a75968647..000000000
--- a/Source/Engine/GraphicsDevice/OpenGL/FBOCache.h
+++ /dev/null
@@ -1,62 +0,0 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
-
-#pragma once
-
-#include "Engine/Core/Common.h"
-#include "Config.h"
-
-#if GRAPHICS_API_OPENGL
-
-#include "IncludeOpenGLHeaders.h"
-
-class GPUTextureViewOGL;
-class TextureOGL;
-
-class FBOCache
-{
-private:
-
- struct Key
- {
- uint32 Hash;
- uint32 RTCount;
- GPUTextureViewOGL* DepthStencil;
- GPUTextureViewOGL* RT[GPU_MAX_RT_BINDED];
-
- Key()
- : Hash(0)
- , RTCount(0)
- , DepthStencil(nullptr)
- {
- for (int32 rt = 0; rt < GPU_MAX_RT_BINDED; rt++)
- RT[rt] = nullptr;
- }
-
- Key(uint32 rtCount, GPUTextureViewOGL* depthStencil, GPUTextureViewOGL* rts[]);
-
- bool HasReference(TextureOGL* texture);
-
- bool operator== (const Key& other) const;
-
- static uint32 HashFunction(const Key& key)
- {
- return key.Hash;
- }
- };
-
- Dictionary Table;
-
-public:
-
- FBOCache();
-
- ~FBOCache();
-
-public:
-
- GLuint GetFBO(uint32 rtCount, GPUTextureViewOGL* depthStencil, GPUTextureViewOGL* rts[]);
- void OnTextureRelease(TextureOGL* texture);
- void Dispose();
-};
-
-#endif
diff --git a/Source/Engine/GraphicsDevice/OpenGL/GPUAdapterOGL.h b/Source/Engine/GraphicsDevice/OpenGL/GPUAdapterOGL.h
deleted file mode 100644
index a7262c9ed..000000000
--- a/Source/Engine/GraphicsDevice/OpenGL/GPUAdapterOGL.h
+++ /dev/null
@@ -1,185 +0,0 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
-
-#pragma once
-
-#if GRAPHICS_API_OPENGL
-
-#include "Engine/Graphics/Config.h"
-#include "Engine/Core/Core.h"
-#include "Engine/Graphics/GPUAdapter.h"
-#include "Engine/Platform/Platform.h"
-#include "IncludeOpenGLHeaders.h"
-
-///
-/// Graphics Device adapter implementation for OpenGL backend.
-///
-class GPUAdapterOGL : public GPUAdapter
-{
-public:
-
- AdapterOGL()
- {
- }
-
-public:
-
- int32 Version = 0;
- int32 VersionMajor = 0;
- int32 VersionMinor = 0;
-
- String Vendor;
- String Renderer;
-
- uint32 VendorId = 0;
- bool AmdWorkaround = false;
-
- typedef StringAnsi Extension;
- Array Extensions;
-
-public:
-
- bool HasExtension(const char* str)
- {
- for (int32 i = 0; i < Extensions.Count(); i++)
- {
- if (Extensions[i] == str)
- return true;
- }
- return false;
- }
-
-public:
-
- bool Init(HDC deviceContext)
- {
-#define CHECK_NULL(obj) if (obj == nullptr) { return true; }
-
- // Get OpenGL version
- const char* pcVer;
- {
- pcVer = (const char*)glGetString(GL_VERSION);
- ASSERT(pcVer);
- StringAnsi version = pcVer;
- version = version.substr(0, version.find(' '));
- const auto split = version.Find('.');
- if (split == -1)
- {
- VersionMajor = atoi(version.c_str());
- }
- else
- {
- VersionMajor = atoi(version.substr(0, split).Get());
- VersionMinor = atoi(version.substr(split + 1).Get());
- }
- }
- Version = VersionMajor * 100 + VersionMinor * 10;
-
- // Get GPU info
- const char* pcVendor = (const char*)glGetString(GL_VENDOR);
- CHECK_NULL(pcVendor);
- Vendor = pcVendor;
- const char* pcRenderer = (const char*)glGetString(GL_RENDERER);
- CHECK_NULL(pcRenderer);
- Renderer = pcRenderer;
-
- // Get extensions list
-#if PLATFORM_WINDOWS && false
-/*
-// Check for Win32 specific extensions probe function
-auto _wglGetExtensionsString = (PFNWGLGETEXTENSIONSSTRINGARBPROC)GetGLFuncAddress("wglGetExtensionsString");
-CHECK_NULL(_wglGetExtensionsString);
-const char* wglExtensions = _wglGetExtensionsString(deviceContext);
-
-// Parse them, and add them to the main list
-Extensions.EnsureCapacity(512);
-std::stringstream ext;
-ext << wglExtensions;
-std::string instr;
-while (ext >> instr)
- Extensions.Add(instr);
-*/
-#else
- GLint numExtensions = 0;
- glGetIntegerv(GL_NUM_EXTENSIONS, &numExtensions);
- Extensions.Resize(numExtensions);
- for (GLint i = 0; i < numExtensions; i++)
- {
- Extensions[i] = (const char*)glGetStringi(GL_EXTENSIONS, i);
- }
-#endif
-
-// Pick a GPU vendor id
-#if PLATFORM_IOS
- VendorId = 0x1010;
-#else
- if (Vendor.Contains(TEXT("ATI ")))
- {
- VendorId = 0x1002;
-#if PLATFORM_WINDOWS || PLATFORM_LINUX
- AmdWorkaround = true;
-#endif
- }
-#if PLATFORM_LINUX
- else if (Vendor.Contains(TEXT("X.Org")))
- {
- VendorId = 0x1002;
- bAmdWorkaround = true;
- }
-#endif
- else if (Vendor.Contains(TEXT("Intel ")) || Vendor == TEXT("Intel"))
- {
- VendorId = 0x8086;
-#if PLATFORM_WINDOWS || PLATFORM_LINUX
- AmdWorkaround = true;
-#endif
- }
- else if (Vendor.Contains(TEXT("NVIDIA ")))
- {
- VendorId = 0x10DE;
- }
- else if (Vendor.Contains(TEXT("ImgTec")))
- {
- VendorId = 0x1010;
- }
- else if (Vendor.Contains(TEXT("ARM")))
- {
- VendorId = 0x13B5;
- }
- else if (Vendor.Contains(TEXT("Qualcomm")))
- {
- VendorId = 0x5143;
- }
- if (VendorId == 0)
- {
- // Fix for Mesa Radeon
- if (strstr(pcVer, "Mesa") && (strstr(pcRenderer, "AMD") || strstr(pcRenderer, "ATI")))
- {
- VendorId = 0x1002;
- }
- }
-#endif
-
-#undef CHECK_NULL
-
- return false;
- }
-
-public:
-
- // [GPUAdapter]
- bool IsValid() const override
- {
- return true;
- }
- uint32 GetVendorId() const override
- {
- return VendorId;
- }
- const Char* GetDescription() const override
- {
- static String desc = Vendor + TEXT(" ") + Renderer;
- return *desc;
- }
-};
-
-#endif
diff --git a/Source/Engine/GraphicsDevice/OpenGL/GPUBufferOGL.cpp b/Source/Engine/GraphicsDevice/OpenGL/GPUBufferOGL.cpp
deleted file mode 100644
index ba28cceaf..000000000
--- a/Source/Engine/GraphicsDevice/OpenGL/GPUBufferOGL.cpp
+++ /dev/null
@@ -1,209 +0,0 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
-
-#if GRAPHICS_API_OPENGL
-
-#include "GPUBufferOGL.h"
-#include "GPUDeviceOGL.h"
-#include "RenderToolsOGL.h"
-#include "Engine/Graphics/PixelFormatExtensions.h"
-#include "Engine/Debug/Exceptions/ArgumentNullException.h"
-#include "Engine/Debug/Exceptions/ArgumentOutOfRangeException.h"
-#include "Engine/Debug/Exceptions/InvalidOperationException.h"
-
-GPUBufferOGL::GPUBufferOGL(GPUDeviceOGL* device, const String& name)
- : GPUResourceOGL(device, name)
-{
-}
-
-GPUBufferOGL::~GPUBufferOGL()
-{
-}
-
-bool GPUBufferOGL::init()
-{
- ASSERT(IsInMainThread());
-
- // Pick a buffer usage mode
- GLenum usage;
- switch (_desc.Usage)
- {
- case GPUResourceUsage::Default:
- case GPUResourceUsage::Immutable: usage = GL_STATIC_DRAW; break;
- case GPUResourceUsage::Staging:
- case GPUResourceUsage::Dynamic: usage = GL_DYNAMIC_DRAW; break;
- }
-
- // Pick a buffer target
- GLenum target = GL_ARRAY_BUFFER;
- if (_desc.Flags & GPUBufferFlags::VertexBuffer)
- target = GL_ARRAY_BUFFER;
- else if (_desc.Flags & GPUBufferFlags::IndexBuffer)
- target = GL_ELEMENT_ARRAY_BUFFER;
- else if (_desc.Flags & GPUBufferFlags::UnorderedAccess)
- target = GL_SHADER_STORAGE_BUFFER;
- else if (_desc.Flags & GPUBufferFlags::Argument)
- target = GL_DRAW_INDIRECT_BUFFER;
- else if (_desc.Flags & GPUBufferFlags::ShaderResource)
- target = GL_TEXTURE_BUFFER;
- else if (_desc.Usage == GPUResourceUsage::Staging)
- target = GL_PIXEL_UNPACK_BUFFER;
- BufferTarget = target;
-
- // Create a buffer
- glGenBuffers(1, &BufferId);
- VALIDATE_OPENGL_RESULT();
- if (!BufferId)
- {
- LOG(Warning, "Cannot create OpenGL buffer");
- return true;
- }
-
- // Initialize
- if (_desc.InitData)
- {
- glBindBuffer(target, BufferId);
- VALIDATE_OPENGL_RESULT();
- glBufferData(target, _desc.Size, _desc.InitData, usage);
- VALIDATE_OPENGL_RESULT();
- glBindBuffer(target, 0);
- }
-
- if (_desc.Flags & GPUBufferFlags::ShaderResource)
- {
- MISSING_CODE("Shader resource OpenGL GPU buffer");
- /*TextureTarget = TextureTarget.TextureBuffer;
- glGenTextures(1, &_textureId);
- VALIDATE_OPENGL_RESULT();
- glBindTexture(TextureTarget, _textureId);
- glTexBuffer(TextureBufferTarget::TextureBuffer, (SizedInternalFormat)TextureInternalFormat, BufferId);
- glBindTexture(TextureTarget, 0);
- */
- }
-
- return false;
-}
-
-void GPUBufferOGL::release()
-{
- _device->VAOCache.OnObjectRelease(this);
-
- // Release resource
- if (BufferId != 0)
- {
- glDeleteBuffers(1, &BufferId);
- VALIDATE_OPENGL_RESULT();
- }
- BufferId = 0;
- BufferTarget = 0;
- _memoryUsage = 0;
-
- // Base
- GPUBuffer::release();
-}
-
-bool GPUBufferOGL::SetData(const void* data, uint64 size)
-{
- // Validate input and buffer state
- if (size == 0 || data == nullptr)
- {
- Log::ArgumentNullException(TEXT("Buffer.SetData"));
- return true;
- }
- if (size > GetSize())
- {
- Log::ArgumentOutOfRangeException(TEXT("Buffer.SetData"));
- return true;
- }
- if (!IsDynamic() && !IsStaging())
- {
- Log::InvalidOperationException(TEXT("Buffer.SetData"));
- return true;
- }
- if (BufferId == 0)
- {
- return true;
- }
-
- GPUDeviceLock lock(_device);
-
- // Map the staging resource for reading
- GLenum access = GL_MAP_WRITE_BIT | GL_MAP_INVALIDATE_BUFFER_BIT;
- glBindBuffer(BufferTarget, BufferId);
- VALIDATE_OPENGL_RESULT();
- glBufferData(BufferTarget, size, 0, GL_DYNAMIC_DRAW);
- VALIDATE_OPENGL_RESULT();
- void* buffer = glMapBufferRange(BufferTarget, 0, size, access);
- VALIDATE_OPENGL_RESULT();
- if (buffer == nullptr)
- {
- LOG(Warning, "Cannot map OpenGL buffer.");
- return true;
- }
-
- // Copy memory
- Platform::MemoryCopy(buffer, data, size);
-
- // Unmap resource
- if (!glUnmapBuffer(BufferTarget))
- {
- VALIDATE_OPENGL_RESULT();
- LOG(Warning, "OpenGL buffer data corrupted");
- return true;
- }
- glBindBuffer(BufferTarget, 0);
- VALIDATE_OPENGL_RESULT();
-
- return false;
-}
-
-bool GPUBufferOGL::GetData(BytesContainer& data)
-{
- // Validate input and buffer state
- if (!IsDynamic() && !IsStaging())
- {
- Log::InvalidOperationException(TEXT("Buffer.GetData"));
- return true;
- }
- if (BufferId == 0)
- {
- return true;
- }
- auto size = GetSize();
-
- GPUDeviceLock lock(_device);
-
- // Map the staging resource for reading
- GLenum access = GL_MAP_READ_BIT;
- glBindBuffer(BufferTarget, BufferId);
- VALIDATE_OPENGL_RESULT();
- void* buffer = glMapBufferRange(BufferTarget, 0, size, access);
- VALIDATE_OPENGL_RESULT();
- if (buffer == nullptr)
- {
- LOG(Warning, "Cannot map OpenGL buffer.");
- return true;
- }
-
- // Copy memory
- data.Copy((byte*)buffer, size);
-
- // Unmap resource
- glBindBuffer(BufferTarget, BufferId);
- VALIDATE_OPENGL_RESULT();
- if (!glUnmapBuffer(BufferTarget))
- {
- VALIDATE_OPENGL_RESULT();
- LOG(Warning, "OpenGL buffer data corrupted");
- return true;
- }
-
- return false;
-}
-
-void GPUBufferOGL::Bind(int32 slotIndex)
-{
- // TODO: finish this
- CRASH;
-}
-
-#endif
diff --git a/Source/Engine/GraphicsDevice/OpenGL/GPUBufferOGL.h b/Source/Engine/GraphicsDevice/OpenGL/GPUBufferOGL.h
deleted file mode 100644
index 799b7fc46..000000000
--- a/Source/Engine/GraphicsDevice/OpenGL/GPUBufferOGL.h
+++ /dev/null
@@ -1,53 +0,0 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
-
-#pragma once
-
-
-#if GRAPHICS_API_OPENGL
-
-#include "Engine/Graphics/GPUBuffer.h"
-#include "GPUResourceOGL.h"
-#include "IShaderResourceOGL.h"
-
-///
-/// GPU buffer for OpenGL
-///
-///
-class GPUBufferOGL : public GPUResourceOGL, public IShaderResourceOGL
-{
-public:
-
- ///
- /// Initializes a new instance of the class.
- ///
- /// The graphics device.
- /// The resource name.
- GPUBufferOGL(GPUDeviceOGL* device, const String& name);
-
- ///
- /// Finalizes an instance of the class.
- ///
- ~GPUBufferOGL();
-
-public:
-
- GLenum BufferTarget = 0;
- GLuint BufferId = 0;
-
-public:
-
- // [GPUBuffer]
- bool SetData(const void* data, uint64 size) override;
- bool GetData(BytesContainer& data) override;
-
- // [IShaderResourceOGL]
- void Bind(int32 slotIndex) override;
-
-protected:
-
- // [GPUBuffer]
- bool OnInit() override;
- void OnReleaseGPU() override;
-};
-
-#endif
diff --git a/Source/Engine/GraphicsDevice/OpenGL/GPUConstantBufferOGL.cpp b/Source/Engine/GraphicsDevice/OpenGL/GPUConstantBufferOGL.cpp
deleted file mode 100644
index 9437f0166..000000000
--- a/Source/Engine/GraphicsDevice/OpenGL/GPUConstantBufferOGL.cpp
+++ /dev/null
@@ -1,53 +0,0 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
-
-#include "GPUConstantBufferOGL.h"
-
-#if GRAPHICS_API_OPENGL
-
-#include "../RenderToolsOGL.h"
-#include "Engine/Threading/Threading.h"
-
-GPUConstantBufferOGL::GPUConstantBufferOGL(GPUDeviceOGL* device, const String& name, uint32 size)
- : GPUResourceOGL(device, name)
-{
- _size = size;
-}
-
-GPUConstantBufferOGL::~GPUConstantBufferOGL()
-{
- ReleaseGPU();
-}
-
-GLuint GPUConstantBufferOGL::GetHandle()
-{
- // Create buffer if missing
- if (_handle == 0)
- {
- glGenBuffers(1, &_handle);
- VALIDATE_OPENGL_RESULT();
-
- glBindBuffer(GL_UNIFORM_BUFFER, _handle);
- VALIDATE_OPENGL_RESULT();
-
- glBufferData(GL_UNIFORM_BUFFER, _size, nullptr, GL_DYNAMIC_DRAW);
- VALIDATE_OPENGL_RESULT();
-
- glBindBuffer(GL_UNIFORM_BUFFER, 0);
- VALIDATE_OPENGL_RESULT();
- }
-
- return _handle;
-}
-
-void GPUConstantBufferOGL::ReleaseGPU()
-{
- if (_handle != 0)
- {
- glDeleteBuffers(1, &_handle);
- VALIDATE_OPENGL_RESULT();
- _handle = 0;
- }
- _memoryUsage = 0;
-}
-
-#endif
diff --git a/Source/Engine/GraphicsDevice/OpenGL/GPUContextOGL.cpp b/Source/Engine/GraphicsDevice/OpenGL/GPUContextOGL.cpp
deleted file mode 100644
index a9730402f..000000000
--- a/Source/Engine/GraphicsDevice/OpenGL/GPUContextOGL.cpp
+++ /dev/null
@@ -1,887 +0,0 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
-
-#include "GPUContextOGL.h"
-
-#if GRAPHICS_API_OPENGL
-
-#include "Engine/Core/Math/Viewport.h"
-#include "Engine/Profiler/RenderStats.h"
-#include "Engine/Threading/Threading.h"
-#include "PipelineStateOGL.h"
-#include "BufferOGL.h"
-#include "TextureOGL.h"
-#include "GPUTextureViewOGL.h"
-#include "GPUDeviceOGL.h"
-#include "GPULimitsOGL.h"
-#include "IShaderResourceOGL.h"
-#include "Shaders/GPUConstantBufferOGL.h"
-#include "Shaders/GPUShaderProgramOGL.h"
-#include "feature/PixelFormatExtensions.h"
-
-GPUContextOGL::GPUContextOGL(GPUDeviceOGL* device)
- : GPUContext(device)
- , _device(device)
- , _omDirtyFlag(false)
- , _rtCount(0)
- , _rtDepth(nullptr)
- , _uaOutput(nullptr)
- , _srDirtyFlag(false)
- , _uaDirtyFlag(false)
- , _cbDirtyFlag(false)
- , _activeTextureUnit(-1)
-{
-}
-
-GPUContextOGL::~GPUContextOGL()
-{
-}
-
-void GPUContextOGL::FrameBegin()
-{
- // Base
- GPUContext::FrameBegin();
-
- // Setup
- _omDirtyFlag = false;
- _uaDirtyFlag = false;
- _srDirtyFlag = false;
- _cbDirtyFlag = false;
- _rtCount = 0;
- _currentState = nullptr;
- _rtDepth = nullptr;
- _uaOutput = nullptr;
- Platform::MemoryClear(_rtHandles, sizeof(_rtHandles));
- Platform::MemoryClear(_srHandles, sizeof(_srHandles));
- Platform::MemoryClear(_uaHandles, sizeof(_uaHandles));
- Platform::MemoryClear(_cbHandles, sizeof(_cbHandles));
- Platform::MemoryClear(_vbHandles, sizeof(_vbHandles));
- Platform::MemoryClear(_vbStrides, sizeof(_vbStrides));
- _ibHandle = nullptr;
-
- // TODO: dont setup this state every frame
- m_DepthEnableState = true;
- glEnable(GL_DEPTH_TEST);
- m_DepthWritesEnableState = true;
- m_DepthCmpFunc = ComparisonFunc::Less;
- glDepthFunc(RenderToolsOGL::ComparisonFuncToOGL(m_DepthCmpFunc));
- glDepthMask(1);
- Writeframe = false;
- glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
- CullMode = ::CullMode::TwoSided;
- glDisable(GL_CULL_FACE);
- DepthClampEnable = true;
- glEnable(GL_DEPTH_CLAMP);
- BlendMode = BlendingMode::Opaque;
- glDisable(GL_BLEND);
-}
-
-void GPUContextOGL::Clear(GPUTextureView* rt, const Color& color)
-{
- auto rtOGL = reinterpret_cast(rt);
-
- int32 rtIndex = -1;
- for (int32 i = 0; i < _rtCount; i++)
- {
- if (_rtHandles[i] == rtOGL)
- {
- rtIndex = i;
- break;
- }
- }
- if (rtIndex == -1)
- {
- // Check if not render targets is binded
- if (_rtCount == 0)
- {
- // Bind target just for clear
- SetRenderTarget(rtOGL);
- flushOM();
- glClearBufferfv(GL_COLOR, 0, color.Raw);
- VALIDATE_OPENGL_RESULT();
- SetRenderTarget();
- return;
- }
-
- LOG(Fatal, "Failed to clear the render target. On OpenGL, it must be binded to the pipeline first.");
- }
-
- flushOM();
-
- glClearBufferfv(GL_COLOR, rtIndex, color.Raw);
- VALIDATE_OPENGL_RESULT();
-}
-
-void GPUContextOGL::ClearDepth(GPUTextureView* depthBuffer, float depthValue)
-{
- auto depthBufferOGL = static_cast(depthBuffer);
- if (depthBufferOGL != _rtDepth)
- {
- LOG(Fatal, "Failed to clear the depth buffer. On OpenGL, it must be binded to the pipeline first.");
- }
-
- glClearDepthf(depthValue);
- RENDER_STAT_DISPATCH_CALL();
-
- glDepthMask(1);
- VALIDATE_OPENGL_RESULT();
-
- glClear(GL_DEPTH_BUFFER_BIT);
- VALIDATE_OPENGL_RESULT();
-}
-
-void GPUContextOGL::ClearUA(Buffer* buf, const Vector4& value)
-{
- ASSERT(buf != nullptr && buf->IsUnorderedAccess());
-
- auto bufOGL = reinterpret_cast(buf);
-
- MISSING_CODE("GPUContextOGL::ClearUA");
- /*GL.BindBuffer(bufOGL->BufferTarget, bufOGL->BufferId);
- GL.ClearBufferData(bufOGL->BufferTarget, buffer.TextureInternalFormat, buffer.TextureFormat, All.UnsignedInt8888, value);
- GL.BindBuffer(buffer.BufferTarget, 0);*/
-}
-
-void GPUContextOGL::ResetRenderTarget()
-{
- if (_rtCount > 0 || _uaOutput || _rtDepth)
- {
- _omDirtyFlag = true;
- _rtCount = 0;
- _rtDepth = nullptr;
- _uaOutput = nullptr;
-
- Platform::MemoryClear(_rtHandles, sizeof(_rtHandles));
-
- flushOM();
- }
-}
-
-void GPUContextOGL::SetRenderTarget(GPUTextureView* rt)
-{
- auto rtOGL = reinterpret_cast(rt);
-
- GPUTextureViewOGL* rtv = rtOGL;
- int32 newRtCount = rtv ? 1 : 0;
-
- if (_rtCount != newRtCount || _rtHandles[0] != rtv || _rtDepth != nullptr || _uaOutput)
- {
- _omDirtyFlag = true;
- _rtCount = newRtCount;
- _rtDepth = nullptr;
- _rtHandles[0] = rtv;
- _uaOutput = nullptr;
- }
-}
-
-void GPUContextOGL::SetRenderTarget(GPUTextureView* depthBuffer, GPUTextureView* rt)
-{
- auto rtOGL = reinterpret_cast(rt);
- auto depthBufferOGL = static_cast(depthBuffer);
-
- GPUTextureViewOGL* rtv = rtOGL;
- GPUTextureViewOGL* dsv = depthBufferOGL && depthBufferOGL->GetTexture()->IsDepthStencil() ? depthBufferOGL : nullptr;
- int32 newRtCount = rtv ? 1 : 0;
-
- if (_rtCount != newRtCount || _rtHandles[0] != rtv || _rtDepth != dsv || _uaOutput)
- {
- _omDirtyFlag = true;
- _rtCount = newRtCount;
- _rtDepth = dsv;
- _rtHandles[0] = rtv;
- _uaOutput = nullptr;
- }
-}
-
-void GPUContextOGL::SetRenderTarget(GPUTextureView* depthBuffer, const Span& rts)
-{
- ASSERT(Math::IsInRange(rtsCount, 1, GPU_MAX_RT_BINDED));
-
- auto depthBufferOGL = static_cast(depthBuffer);
- GPUTextureViewOGL* dsv = depthBufferOGL && depthBufferOGL->GetTexture()->IsDepthStencil() ? depthBufferOGL : nullptr;
-
- GPUTextureViewOGL* rtvs[GPU_MAX_RT_BINDED];
- for (int32 i = 0; i < rtsCount; i++)
- {
- auto rtOGL = reinterpret_cast(rts[i]);
- rtvs[i] = rtOGL;
- }
- int32 rtvsSize = sizeof(GPUTextureViewOGL*) * rtsCount;
-
- if (_rtCount != rtsCount || _rtDepth != dsv || _uaOutput || Platform::MemoryCompare(_rtHandles, rtvs, rtvsSize) != 0)
- {
- _omDirtyFlag = true;
- _rtCount = rtsCount;
- _rtDepth = dsv;
- _uaOutput = nullptr;
- Platform::MemoryCopy(_rtHandles, rtvs, rtvsSize);
- }
-}
-
-void GPUContextOGL::SetRenderTarget(GPUTextureView* rt, Buffer* uaOutput)
-{
- auto rtOGL = reinterpret_cast(rt);
- auto uaOutputOGL = reinterpret_cast(uaOutput);
-
- MISSING_CODE("GPUContextOGL::SetRenderTarget with UAV");
- /*GPUTextureViewOGL* rtv = rtOGL ? rtOGL : nullptr;
- GPUTextureViewOGL* uav = uaOutputOGL ? uaOutputOGL->GetUAV() : nullptr;
- int32 newRtCount = rtv ? 1 : 0;
-
- if (_rtCount != newRtCount || _rtHandles[0] != rtv || _rtDepth != nullptr || _uaOutput != uav)
- {
- _omDirtyFlag = true;
- _rtCount = newRtCount;
- _rtDepth = nullptr;
- _rtHandles[0] = rtv;
- _uaOutput = uav;
- }*/
-}
-
-void GPUContextOGL::ResetSR()
-{
- // TODO: check if need to set dirty flag always to true?
- _srDirtyFlag = true;
- Platform::MemoryClear(_srHandles, sizeof(_srHandles));
-}
-
-void GPUContextOGL::ResetUA()
-{
- // TODO: check if need to set dirty flag always to true?
- _uaDirtyFlag = true;
- Platform::MemoryClear(_uaHandles, sizeof(_uaHandles));
-}
-
-void GPUContextOGL::ResetCB()
-{
- // TODO: check if need to set dirty flag always to true?
- _cbDirtyFlag = true;
- Platform::MemoryClear(_cbHandles, sizeof(_cbHandles));
-}
-
-void GPUContextOGL::BindCB(int32 slot, ConstantBuffer* cb)
-{
- ASSERT(slot >= 0 && slot < GPU_MAX_CB_BINDED);
-
- auto cbOGL = static_cast(cb);
-
- if (_cbHandles[slot] != cbOGL)
- {
- _cbDirtyFlag = true;
- _cbHandles[slot] = cbOGL;
- }
-}
-
-void GPUContextOGL::BindSR(int32 slot, GPUTextureView* rt)
-{
- ASSERT(slot >= 0 && slot < GPU_MAX_SR_BINDED);
-
- auto rtOGL = reinterpret_cast(rt);
-
- if (_srHandles[slot] != rtOGL)
- {
- _srDirtyFlag = true;
- _srHandles[slot] = rtOGL;
- }
-}
-
-void GPUContextOGL::BindSR(int32 slot, Buffer* buf)
-{
- ASSERT(slot >= 0 && slot < GPU_MAX_SR_BINDED);
- ASSERT(buf == nullptr || buf->IsShaderResource());
-
- auto bufOGL = reinterpret_cast(buf);
-
- if (_srHandles[slot] != bufOGL)
- {
- _srDirtyFlag = true;
- _srHandles[slot] = bufOGL;
- }
-}
-
-void GPUContextOGL::BindUA(int32 slot, Buffer* buf)
-{
- MISSING_CODE("GPUContextOGL::BindUA");
-}
-
-void GPUContextOGL::BindUA(int32 slot, RenderTarget* rt)
-{
- MISSING_CODE("GPUContextOGL::BindUA");
-}
-
-void GPUContextOGL::Dispatch(GPUShaderProgramCS* shader, uint32 threadGroupCountX, uint32 threadGroupCountY, uint32 threadGroupCountZ)
-{
- ASSERT(shader);
-
- // Bind compute shader
- glUseProgram((GLuint)shader->GetBufferHandle());
- VALIDATE_OPENGL_RESULT();
-
- // Flush
- flushCBs();
- flushSRVs();
- flushUAVs();
- flushOM();
-
- // Dispatch
- glDispatchCompute(threadGroupCountX, threadGroupCountY, threadGroupCountZ);
- VALIDATE_OPENGL_RESULT();
- RENDER_STAT_DISPATCH_CALL();
-}
-
-void GPUContextOGL::ResolveMultisample(Texture* sourceMultisampleTexture, Texture* destTexture, int32 sourceSubResource, int32 destSubResource, PixelFormat format)
-{
- MISSING_CODE("GPUContextOGL::ResolveMultisample");
-}
-
-GLint getGLDrawMode(PipelineStateOGL* state)
-{
- GLint primType;
- switch (state->PrimitiveTopologyType)
- {
- case PrimitiveTopologyType::Point:
- primType = GL_POINTS;
- break;
- case PrimitiveTopologyType::Line:
- primType = GL_LINES;
- break;
- case PrimitiveTopologyType::Triangle:
- primType = GL_TRIANGLES;
- break;
- }
-
- return primType;
-}
-
-void GPUContextOGL::Draw(Buffer** vertexBuffers, int32 vertexBuffersCount, uint32 startVertex, uint32 verticesCount)
-{
- ASSERT(_currentState && vertexBuffers && vertexBuffers[0] && vertexBuffersCount > 0 && vertexBuffersCount <= GPU_MAX_VB_BINDED);
-
- VAOCache::StreamData streams[GPU_MAX_VB_BINDED];
- for (int32 i = 0; i < vertexBuffersCount; i++)
- {
- auto bufferOGL = (BufferOGL*)vertexBuffers[i];
- ASSERT(bufferOGL->BufferId != 0);
- streams[i].Buffer = bufferOGL;
- streams[i].Offset = 0;
- streams[i].Stride = bufferOGL ? bufferOGL->GetStride() : 0;
- }
- GLuint vao = _device->VAOCache.GetVAO(_currentState->VS, nullptr, vertexBuffersCount, streams);
- GLint primType = getGLDrawMode(_currentState);
-
- // Draw
- onDrawCall();
- glBindVertexArray(vao);
- VALIDATE_OPENGL_RESULT();
- glDrawArrays(primType, startIndex, vertices);
- VALIDATE_OPENGL_RESULT();
- RENDER_STAT_DRAW_CALL(vertices, vertices / 3);
-}
-
-void GPUContextOGL::DrawIndexed(Buffer** vertexBuffers, int32 vertexBuffersCount, Buffer* indexBuffer, uint32 indicesCount, int32 startVertex, int32 startIndex)
-{
- // TODO: implement VAO binding
- MISSING_CODE("GPUContextOGL::DrawIndexed");
-}
-
-void GPUContextOGL::DrawIndexedInstanced(Buffer** vertexBuffers, int32 vertexBuffersCount, Buffer* indexBuffer, uint32 indicesCount, uint32 instanceCount, int32 startInstance, int32 startVertex, int32 startIndex)
-{
- MISSING_CODE("GPUContextOGL::DrawIndexedInstanced");
-}
-
-void GPUContextOGL::DrawInstancedIndirect(Buffer* bufferForArgs, uint32 offsetForArgs)
-{
- MISSING_CODE("GPUContextOGL::DrawInstancedIndirect");
-}
-
-void GPUContextOGL::SetViewport(int width, int height)
-{
- // TODO: cache viewport depth to reduce api calls
- glDepthRangef(0.0, 1.0);
- glViewport(0, 0, width, height);
- VALIDATE_OPENGL_RESULT();
-}
-
-void GPUContextOGL::SetViewport(const Viewport& viewport)
-{
- // TODO: cache viewport depth to reduce api calls
- glDepthRangef(viewport.MinDepth, viewport.MaxDepth);
- glViewport((GLsizei)viewport.X, (GLsizei)viewport.Y, (GLsizei)viewport.Width, (GLsizei)viewport.Height);
- VALIDATE_OPENGL_RESULT();
-}
-
-void GPUContextOGL::SetState(PipelineState* state)
-{
- // Check if state will change
- if (_currentState != state)
- {
- // Set new state
- _currentState = (PipelineStateOGL*)state;
-
- // Invalidate pipeline state
- // TODO: maybe don't flush all or only on draw call?
- _cbDirtyFlag = true;
- _srDirtyFlag = true;
- _uaDirtyFlag = true;
-
- if (_currentState)
- {
- _currentState->OnBind();
-
- glUseProgram(0);
- VALIDATE_OPENGL_RESULT();
-
- glBindProgramPipeline(_currentState->ProgramPipeline);
- VALIDATE_OPENGL_RESULT();
-
- if (m_DepthEnableState != _currentState->DepthTestEnable)
- {
- m_DepthEnableState = _currentState->DepthTestEnable;
- if (m_DepthEnableState)
- {
- glEnable(GL_DEPTH_TEST);
- }
- else
- {
- glDisable(GL_DEPTH_TEST);
- }
- }
-
- if (m_DepthWritesEnableState != _currentState->EnableDepthWrite)
- {
- m_DepthWritesEnableState = _currentState->EnableDepthWrite;
- glDepthMask(m_DepthWritesEnableState ? 1 : 0);
- }
-
- if (m_DepthCmpFunc != _currentState->DepthFunc)
- {
- m_DepthCmpFunc = _currentState->DepthFunc;
- glDepthFunc(RenderToolsOGL::ComparisonFuncToOGL(m_DepthCmpFunc));
- }
-
- if (Writeframe != _currentState->Wireframe)
- {
- Writeframe = _currentState->Wireframe;
- auto PolygonMode = Writeframe ? GL_LINE : GL_FILL;
- glPolygonMode(GL_FRONT_AND_BACK, PolygonMode);
- }
-
- if (CullMode != _currentState->CullMode)
- {
- CullMode = _currentState->CullMode;
- if (CullMode == CullMode::TwoSided)
- {
- glDisable(GL_CULL_FACE);
- }
- else
- {
- glEnable(GL_CULL_FACE);
- auto CullFace = CullMode == CullMode::Normal ? GL_BACK : GL_FRONT;
- glCullFace(CullFace);
- }
- }
-
- if (DepthClampEnable != _currentState->DepthClipEnable)
- {
- DepthClampEnable = _currentState->DepthClipEnable;
- if (DepthClampEnable)
- {
- glEnable(GL_DEPTH_CLAMP);
- }
- else
- {
- glDisable(GL_DEPTH_CLAMP);
- }
- }
-
- if (BlendMode != _currentState->BlendMode)
- {
- BlendMode = _currentState->BlendMode;
- todo_update_pipeline_state_for_opengl_to_match_new_blend_state
- const auto& desc = GPUDeviceOGL::BlendModes[(int32)BlendMode];
- if (desc.BlendEnable)
- {
- glBlendFuncSeparate(desc.SrcBlend, desc.DestBlend, desc.SrcBlendAlpha, desc.DestBlendAlpha);
- VALIDATE_OPENGL_RESULT();
-
- glBlendEquationSeparate(desc.BlendOp, desc.BlendOpAlpha);
- VALIDATE_OPENGL_RESULT();
- }
- else
- {
- glDisable(GL_BLEND);
- }
- }
- }
- else
- {
- // TODO: what to do when no state is binded?
- }
-
- RENDER_STAT_PS_STATE_CHANGE();
- }
-}
-
-void GPUContextOGL::ClearState()
-{
- ResetRenderTarget();
- ResetSR();
- ResetUA();
- SetState(nullptr);
-
- FlushState();
-}
-
-void GPUContextOGL::FlushState()
-{
- // Flush
- flushCBs();
- flushSRVs();
- flushUAVs();
- flushOM();
-}
-
-void GPUContextOGL::Flush()
-{
- glFinish();
-}
-
-void GPUContextOGL::UpdateSubresource(Texture* texture, int32 arrayIndex, int32 mipIndex, void* data, uint32 rowPitch, uint32 slicePitch)
-{
- ASSERT(IsInMainThread());
- ASSERT(texture && texture->IsAllocated() && data && !texture->IsMultiSample());
-
- auto textureOGL = static_cast(texture);
- auto target = textureOGL->Target;
- auto format = textureOGL->FormatGL;
- bool isCompressed = PixelFormatExtensions::IsCompressed(texture->Format());
- int formatSize = PixelFormatExtensions::SizeInBytes(texture->Format());
-
- SetActiveTextureUnit(0);
-
- glBindTexture(target, textureOGL->TextureID);
- VALIDATE_OPENGL_RESULT();
-
- // TODO: maybe don't bind it?
- glBindBuffer(GL_PIXEL_UNPACK_BUFFER, 0);
-
- int32 mipWidth, mipHeight, mipDepth;
- texture->GetMipSize(mipIndex, mipWidth, mipHeight, mipDepth);
-
- // Determine the opengl read unpack alignment
- auto expectedRowPitch = mipWidth * formatSize;
- auto packAlignment = 1;
- if ((rowPitch & 1) != 0)
- {
- if (rowPitch == expectedRowPitch)
- packAlignment = 1;
- }
- else if ((rowPitch & 2) != 0)
- {
- auto diff = rowPitch - expectedRowPitch;
- if (diff >= 0 && diff < 2)
- packAlignment = 2;
- }
- else if ((rowPitch & 4) != 0)
- {
- auto diff = rowPitch - expectedRowPitch;
- if (diff >= 0 && diff < 4)
- packAlignment = 4;
- }
- else if ((rowPitch & 8) != 0)
- {
- auto diff = rowPitch - expectedRowPitch;
- if (diff >= 0 && diff < 8)
- packAlignment = 8;
- }
- else if (rowPitch == expectedRowPitch)
- {
- packAlignment = 4;
- }
- glPixelStorei(GL_UNPACK_ALIGNMENT, packAlignment);
- VALIDATE_OPENGL_RESULT();
-
- // Just to be clear: OpenGL sucks and is very shitty graphics API
-
- switch (texture->GetDescription().Dimensions)
- {
- case TextureDimensions::Texture:
- {
- glPixelStorei(GL_UNPACK_ROW_LENGTH, mipWidth);
- VALIDATE_OPENGL_RESULT();
- glPixelStorei(GL_UNPACK_SKIP_PIXELS, 0);
- glPixelStorei(GL_UNPACK_SKIP_ROWS, 0);
-
- if (texture->IsArray())
- {
- CRASH;
- }
- else
- {
- ASSERT(arrayIndex == 0);
-
- if (isCompressed)
- {
- glCompressedTexSubImage2D(target, mipIndex, 0, 0, mipWidth, mipHeight, format, slicePitch, data);
- VALIDATE_OPENGL_RESULT();
- }
- else
- {
- auto formatInfo = _device->GetLimits()->TextureFormats[(int32)texture->Format()];
- glTexSubImage2D(target, mipIndex, 0, 0, mipWidth, mipHeight, formatInfo.Format, formatInfo.Type, data);
- VALIDATE_OPENGL_RESULT();
- }
- }
- break;
- }
- case TextureDimensions::CubeTexture:
- {
- if (texture->IsArray())
- {
- CRASH;
- }
- else
- {
- ASSERT(arrayIndex == 0);
- CRASH;
- }
- break;
- }
- case TextureDimensions::VolumeTexture:
- {
- CRASH;
- break;
- }
- }
-}
-
-void GPUContextOGL::CopyTexture(Texture* dstResource, uint32 dstSubresource, uint32 dstX, uint32 dstY, uint32 dstZ, Texture* srcResource, uint32 srcSubresource)
-{
- MISSING_CODE("GPUContextOGL::CopyTexture");
-}
-
-void GPUContextOGL::ResetCounter(Buffer* buffer, uint32 alignedByteOffset)
-{
- MISSING_CODE("GPUContextOGL::ResetCounter");
-}
-
-void GPUContextOGL::CopyCounter(Buffer* dstBuffer, uint32 dstAlignedByteOffset, Buffer* srcBuffer)
-{
- MISSING_CODE("GPUContextOGL::CopyCounter");
-}
-
-void GPUContextOGL::CopyResource(GPUResource* dstResource, GPUResource* srcResource)
-{
- MISSING_CODE("GPUContextOGL::CopyResource");
-
- /*glBindBuffer(GL_COPY_READ_BUFFER, mBufferId);
- VALIDATE_OPENGL_RESULT();
-
- glBindBuffer(GL_COPY_WRITE_BUFFER, dstBuffer.getGLBufferId());
- VALIDATE_OPENGL_RESULT();
-
- glCopyBufferSubData(GL_COPY_READ_BUFFER, GL_COPY_WRITE_BUFFER, srcOffset, dstOffset, length);
- VALIDATE_OPENGL_RESULT();*/
-
- /*VERIFY_GL_SCOPE();
- ASSERT(FOpenGL::SupportsCopyBuffer());
- FOpenGLVertexBuffer* SourceBuffer = ResourceCast(SourceBufferRHI);
- FOpenGLVertexBuffer* DestBuffer = ResourceCast(DestBufferRHI);
- ASSERT(SourceBuffer->GetSize() == DestBuffer->GetSize());
-
- glBindBuffer(GL_COPY_READ_BUFFER, SourceBuffer->Resource);
- glBindBuffer(GL_COPY_WRITE_BUFFER, DestBuffer->Resource);
- FOpenGL::CopyBufferSubData(GL_COPY_READ_BUFFER, GL_COPY_WRITE_BUFFER, 0, 0, SourceBuffer->GetSize());
- glBindBuffer(GL_COPY_READ_BUFFER, 0);
- glBindBuffer(GL_COPY_WRITE_BUFFER, 0);*/
-}
-
-void GPUContextOGL::CopySubresource(GPUResource* dstResource, uint32 dstSubresource, GPUResource* srcResource, uint32 srcSubresource)
-{
- MISSING_CODE("GPUContextOGL::CopySubresource");
-}
-
-void GPUContextOGL::SetActiveTextureUnit(int32 unit)
-{
- if (_activeTextureUnit != unit)
- {
- glActiveTexture(GL_TEXTURE0 + unit);
- VALIDATE_OPENGL_RESULT();
-
- _activeTextureUnit = unit;
- }
-}
-
-void GPUContextOGL::flushSRVs()
-{
- // Check if need to flush shader resources
- if (_srDirtyFlag)
- {
- // Clear flag
- _srDirtyFlag = false;
-
- // TODO: din't interate over all slots, only the used ones by the given pipeline state (cache it)
-
- int32 shaderStagesCount = ShaderStage_Count;
- for (int32 slot = 0; slot < GPU_MAX_SR_BINDED; slot++)
- {
- const auto srOGL = _srHandles[slot];
-
- if (srOGL == nullptr || !_currentState->IsUsingSR(slot))
- continue;
-
- SetActiveTextureUnit(slot);
-
- //for (int32 stageIndex = 0; stageIndex < shaderStagesCount; stageIndex++)
- {
- //const auto stage = (ShaderStage)stageIndex;
-
- srOGL->Bind(slot);
-
- //glProgramUniform1i(GLProgramObj, it->Location + ArrInd, slot);
-// TODO: don't use glUniform1i all the time? maybe bind only on shader init?
-//glUniform1i(slot, slot);
- //VALIDATE_OPENGL_RESULT();
- }
- }
- }
-}
-
-void GPUContextOGL::flushUAVs()
-{
- // Check if need to flush unordered access
- if (_uaDirtyFlag)
- {
- // Clear flag
- _uaDirtyFlag = false;
-
- if (_currentState == nullptr)
- return;
-
- // Set shader resources views table
- //_context->CSSetUnorderedAccessViews(0, ARRAY_COUNT(_uaHandles), _uaHandles, nullptr);
- }
-}
-
-void GPUContextOGL::flushCBs()
-{
- // Check if need to flush constant buffers
- if (_cbDirtyFlag)
- {
- // Clear flag
- _cbDirtyFlag = false;
-
- if (_currentState == nullptr)
- return;
-
- for (int32 slot = 0; slot < MAX_CONSTANT_BUFFER_SLOTS; slot++)
- {
- auto cbOGL = _cbHandles[slot];
- GLuint handle = cbOGL ? cbOGL->GetHandle() : 0;
-
- if (handle == 0)
- continue;
-
- // Update buffer is need to
- if (cbOGL->IsDirty())
- {
- // Update buffer
- glBindBuffer(GL_UNIFORM_BUFFER, handle);
- VALIDATE_OPENGL_RESULT();
- glBufferSubData(GL_UNIFORM_BUFFER, 0, cbOGL->GetSize(), cbOGL->GetDataToUpload());
- VALIDATE_OPENGL_RESULT();
- glBindBuffer(GL_UNIFORM_BUFFER, 0);
- VALIDATE_OPENGL_RESULT();
-
- // Register as flushed
- cbOGL->OnUploaded();
- }
-
- // Bind
- if (_currentState->VS && _currentState->VS->IsUsingCB(slot))
- {
- glUniformBlockBinding(_currentState->VS->GetHandle(), slot, slot);
- VALIDATE_OPENGL_RESULT();
- }
- if (_currentState->GS && _currentState->GS->IsUsingCB(slot))
- {
- glUniformBlockBinding(_currentState->GS->GetHandle(), slot, slot);
- VALIDATE_OPENGL_RESULT();
- }
- if (_currentState->PS && _currentState->PS->IsUsingCB(slot))
- {
- glUniformBlockBinding(_currentState->PS->GetHandle(), slot, slot);
- VALIDATE_OPENGL_RESULT();
- }
- // TODO: bind constant buffer to Compute Shader ???
- glBindBufferBase(GL_UNIFORM_BUFFER, slot, handle);
- VALIDATE_OPENGL_RESULT();
- }
- }
-}
-
-void GPUContextOGL::flushOM()
-{
- // Check if need to flush output merger state or/and unorder access views
- if (_omDirtyFlag)
- {
-#if _DEBUG
- // Validate binded render targets amount
- int32 rtCount = 0;
- for (int i = 0; i < ARRAY_COUNT(_rtHandles) && i < _rtCount; i++)
- {
- if (_rtHandles[i] != nullptr)
- rtCount++;
- else
- break;
- }
- ASSERT(rtCount == _rtCount);
-#endif
-
- // Check if render to window backbuffer
- if (_rtCount == 1 && _rtHandles[0]->IsBackbuffer())
- {
- // On-screen rendering
- glBindFramebuffer(GL_DRAW_FRAMEBUFFER, 0);
- VALIDATE_OPENGL_RESULT();
- }
- // Check if use UAV
- else if (_uaOutput)
- {
-
- }
- // Check if bind sth
- else if(_rtCount || _rtDepth)
- {
- // Get or create FBO
- GLuint fbo = _device->FBOCache.GetFBO(_rtCount, _rtDepth, _rtHandles);
-
- // Bind FBO
- glBindFramebuffer(GL_DRAW_FRAMEBUFFER, fbo);
- VALIDATE_OPENGL_RESULT();
- glBindFramebuffer(GL_READ_FRAMEBUFFER, fbo);
- VALIDATE_OPENGL_RESULT();
- }
- else
- {
- // Unbind FBO
- glBindFramebuffer(GL_DRAW_FRAMEBUFFER, 0);
- VALIDATE_OPENGL_RESULT();
- glBindFramebuffer(GL_READ_FRAMEBUFFER, 0);
- VALIDATE_OPENGL_RESULT();
- }
-
- // Clear flag
- _omDirtyFlag = false;
- }
-}
-
-void GPUContextOGL::onDrawCall()
-{
- // Flush
- flushCBs();
- flushSRVs();
- flushUAVs();
- flushOM();
-}
-
-#endif
diff --git a/Source/Engine/GraphicsDevice/OpenGL/GPUContextOGL.h b/Source/Engine/GraphicsDevice/OpenGL/GPUContextOGL.h
deleted file mode 100644
index 8142b00e0..000000000
--- a/Source/Engine/GraphicsDevice/OpenGL/GPUContextOGL.h
+++ /dev/null
@@ -1,149 +0,0 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
-
-#pragma once
-
-#include "Engine/Graphics/GPUContext.h"
-#include "GPUDeviceOGL.h"
-#include "GPUResourceOGL.h"
-#include "PipelineStateOGL.h"
-#include "RenderToolsOGL.h"
-
-#if GRAPHICS_API_OPENGL
-
-class GPUConstantBufferOGL;
-class GPUTextureViewOGL;
-class BufferOGL;
-class IShaderResourceOGL;
-
-///
-/// GPU Context for OpenGL
-///
-class GPUContextOGL : public GPUContext
-{
-private:
-
- GPUDeviceOGL* _device;
-
- // Output Merger
- bool _omDirtyFlag;
- int32 _rtCount;
- GPUTextureViewOGL* _rtDepth;
- GPUTextureViewOGL* _rtHandles[GPU_MAX_RT_BINDED];
- GPUTextureViewOGL* _uaOutput;
-
- // Shader Resources
- bool _srDirtyFlag;
- IShaderResourceOGL* _srHandles[GPU_MAX_SR_BINDED];
-
- // Unordered Access
- bool _uaDirtyFlag;
- GPUResource* _uaHandles[GPU_MAX_UA_BINDED];
-
- // Constant Buffers
- bool _cbDirtyFlag;
- GPUConstantBufferOGL* _cbHandles[GPU_MAX_CB_BINDED];
-
- // Vertex Buffers
- BufferOGL* _ibHandle;
- BufferOGL* _vbHandles[GPU_MAX_VB_BINDED];
- uint32 _vbStrides[GPU_MAX_VB_BINDED];
-
- // Pipeline State
- PipelineStateOGL* _currentState;
- bool m_DepthEnableState;
- bool m_DepthWritesEnableState;
- ComparisonFunc m_DepthCmpFunc;
- /*bool m_StencilTestEnableState; // TODO: support stencil buffer usage
- uint16 m_StencilReadMask = 0xFFFF;
- uint16 m_StencilWriteMask = 0xFFFF;
- struct StencilOpState
- {
- COMPARISON_FUNCTION Func = COMPARISON_FUNC_UNKNOWN;
- STENCIL_OP StencilFailOp = STENCIL_OP_UNDEFINED;
- STENCIL_OP StencilDepthFailOp = STENCIL_OP_UNDEFINED;
- STENCIL_OP StencilPassOp = STENCIL_OP_UNDEFINED;
- int32 Ref = std::numeric_limits::min();
- uint32 Mask = MAX_uint32;
- }m_StencilOpState[2];*/
- bool Writeframe;
- CullMode CullMode;
- bool DepthClampEnable;
- BlendingMode BlendMode;
-
- // OpenGL state
- int32 _activeTextureUnit;
-
-public:
-
- ///
- /// Initializes a new instance of the class.
- ///
- /// The graphics device.
- GPUContextOGL(GPUDeviceOGL* device);
-
- ///
- /// Finalizes an instance of the class.
- ///
- ~GPUContextOGL();
-
-private:
-
- void SetActiveTextureUnit(int32 unit);
-
- void flushSRVs();
- void flushUAVs();
- void flushCBs();
- void flushOM();
- void onDrawCall();
-
-public:
-
- // [GPUContext]
- void FrameBegin() override;
- bool IsDepthBufferBinded() override
- {
- return _rtDepth != nullptr;
- }
- void Clear(GPUTextureView* rt, const Color& color) override;
- void ClearDepth(GPUTextureView* depthBuffer, float depthValue) override;
- void ClearUA(Buffer* buf, const Vector4& value) override;
- void ResetRenderTarget() override;
- void SetRenderTarget(GPUTextureView* rt) override;
- void SetRenderTarget(GPUTextureView* depthBuffer, GPUTextureView* rt) override;
- void SetRenderTarget(GPUTextureView* depthBuffer, const Span& rts) override;
- void SetRenderTarget(GPUTextureView* rt, Buffer* uaOutput) override;
- void ResetSR() override;
- void ResetUA() override;
- void ResetCB() override;
- void BindCB(int32 slot, ConstantBuffer* cb) override;
- void BindSR(int32 slot, GPUTextureView* rt) override;
- void BindSR(int32 slot, Buffer* buf) override;
- void BindUA(int32 slot, Buffer* buf) override;
- void BindUA(int32 slot, Texture* rt) override;
- void UpdateCB(ConstantBuffer* cb, const void* data) override;
- void UpdateBuffer(Buffer* buffer, const void* data, uint32 size) override;
- void Dispatch(GPUShaderProgramCS* shader, uint32 threadGroupCountX, uint32 threadGroupCountY, uint32 threadGroupCountZ) override;
- void ResolveMultisample(Texture* sourceMultisampleTexture, Texture* destTexture, int32 sourceSubResource, int32 destSubResource, PixelFormat format) override;
- void Draw(Buffer** vertexBuffers, int32 vertexBuffersCount, uint32 startVertex, uint32 verticesCount) override;
- void DrawInstanced(Buffer** vertexBuffers, int32 vertexBuffersCount, uint32 instanceCount, int32 startInstance, uint32 startVertex, uint32 verticesCount) override;
- void DrawIndexed(Buffer** vertexBuffers, int32 vertexBuffersCount, Buffer* indexBuffer, uint32 indicesCount, int32 startVertex, int32 startIndex) override;
- void DrawIndexedInstanced(Buffer** vertexBuffers, int32 vertexBuffersCount, Buffer* indexBuffer, uint32 indicesCount, uint32 instanceCount, int32 startInstance, int32 startVertex, int32 startIndex) override;
- void DrawInstancedIndirect(Buffer* bufferForArgs, uint32 offsetForArgs) override;
- void SetViewport(const Viewport& viewport) override;
- PipelineState* GetState() const override
- {
- return _currentState;
- }
- void SetState(PipelineState* state) override;
- void ClearState() override;
- void FlushState() override;
- void Flush() override;
- void UpdateSubresource(Texture* texture, int32 arrayIndex, int32 mipIndex, void* data, uint32 rowPitch, uint32 slicePitch) override;
- void CopyTexture(Texture* dstResource, uint32 dstSubresource, uint32 dstX, uint32 dstY, uint32 dstZ, Texture* srcResource, uint32 srcSubresource) override;
- void ResetCounter(Buffer* buffer, uint32 alignedByteOffset) override;
- void CopyCounter(Buffer* dstBuffer, uint32 dstAlignedByteOffset, Buffer* srcBuffer) override;
- void CopyResource(GPUResource* dstResource, GPUResource* srcResource) override;
- void CopySubresource(GPUResource* dstResource, uint32 dstSubresource, GPUResource* srcResource, uint32 srcSubresource) override;
-};
-
-#endif
diff --git a/Source/Engine/GraphicsDevice/OpenGL/GPUDeviceOGL.cpp b/Source/Engine/GraphicsDevice/OpenGL/GPUDeviceOGL.cpp
deleted file mode 100644
index b14413a48..000000000
--- a/Source/Engine/GraphicsDevice/OpenGL/GPUDeviceOGL.cpp
+++ /dev/null
@@ -1,315 +0,0 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
-
-#include "Engine/Graphics/Config.h"
-
-#if GRAPHICS_API_OPENGL
-
-#include "GPUDeviceOGL.h"
-#include "GPUResourcesFactoryOGL.h"
-#include "GPULimitsOGL.h"
-#include "ContextOGL.h"
-#include "Win32/Win32ContextOGL.h"
-#include "Engine/Core/Log.h"
-#include "Engine/Render2D/Render2D.h"
-#include "Engine/Graphics/RenderTask.h"
-#include
-
-GPUDeviceOGL::BlendDesc GPUDeviceOGL::BlendModes[5] =
-{
- // Opaque rendering (default)
- {
- false,
- GL_ONE, GL_ZERO, GL_FUNC_ADD,
- GL_ONE, GL_ZERO, GL_FUNC_ADD,
- },
-
- // Additive rendering
- {
- true,
- GL_SRC_ALPHA, GL_ONE, GL_FUNC_ADD,
- GL_SRC_ALPHA, GL_ONE, GL_FUNC_ADD,
- },
-
- // Alpha blended rendering
- {
- true,
- GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA, GL_FUNC_ADD,
- GL_ONE, GL_ONE_MINUS_SRC_ALPHA, GL_FUNC_ADD,
- },
-
- // Add color rendering
- {
- true,
- GL_ONE, GL_ONE, GL_FUNC_ADD,
- GL_ONE, GL_ONE, GL_FUNC_ADD,
- },
-
- // Multiply output color with texture color
- {
- true,
- GL_ZERO, GL_SRC_COLOR, GL_FUNC_ADD,
- GL_ZERO, GL_SRC_ALPHA, GL_FUNC_ADD,
- },
-};
-
-#define DEFINE_GL_ENTRYPOINTS(Type,Func) Type Func = NULL;
-ENUM_GL_ENTRYPOINTS_ALL(DEFINE_GL_ENTRYPOINTS);
-
-GPUDeviceOGL::GPUDeviceOGL(RendererType type, ShaderProfile profile, AdapterOGL* adapter, GPULimits* limits)
- : GPUDevice(type, profile, limits, New(this))
- , _adapter(adapter)
-{
-}
-
-GPUDeviceOGL* GPUDeviceOGL::Create()
-{
-#define CHECK_NULL(obj) if (obj == nullptr) { return nullptr; }
-
- bool GRunningUnderRenderDoc = false;
-
- // Create a dummy context so that wglCreateContextAttribsARB can be initialized
- Win32ContextOGL::Data DummyContext;
- Win32ContextOGL::CreateDummyGLWindow(&DummyContext);
- DummyContext.OpenGLContext = wglCreateContext(DummyContext.DeviceContext);
- CHECK_NULL(DummyContext.OpenGLContext);
- ASSERT(DummyContext.OpenGLContext);
- Win32ContextOGL::ContextMakeCurrent(DummyContext.DeviceContext, DummyContext.OpenGLContext);
- Win32ContextOGL::wglCreateContextAttribsARB = (PFNWGLCREATECONTEXTATTRIBSARBPROC)GetGLFuncAddress("wglCreateContextAttribsARB");
- CHECK_NULL(DummyContext.OpenGLContext);
- Win32ContextOGL::ContextMakeCurrent(NULL, NULL);
- wglDeleteContext(DummyContext.OpenGLContext);
-
-#if GRAPHICS_API_OPENGLES
- todo_support-opengles
-#else
- // Try to create OpenGL 4.4 context
- Win32ContextOGL::PlatformCreateOpenGLContextCore(&DummyContext, 4, 4, NULL);
- if (DummyContext.OpenGLContext == nullptr)
- {
- // Try to create OpenGL 4.1 context
- Win32ContextOGL::PlatformCreateOpenGLContextCore(&DummyContext, 4, 1, NULL);
- if (DummyContext.OpenGLContext == nullptr)
- {
- LOG(Error, "OpenGL 4.1 is not supported by the driver.");
- return nullptr;
- }
- }
-#endif
- Win32ContextOGL::ContextMakeCurrent(DummyContext.DeviceContext, DummyContext.OpenGLContext);
-
- // Get all OpenGL functions from the OpenGL DLL
- {
- // Retrieve the OpenGL DLL
- void* OpenGLDLL = Platform::GetDllHandle(TEXT("opengl32.dll"));
- if (!OpenGLDLL)
- {
- LOG(Error, "Couldn't load opengl32.dll");
- return nullptr;
- }
-
- // Initialize entry points required from opengl32.dll
-#define GET_GL_ENTRYPOINTS_DLL(Type,Func) Func = (Type)Platform::GetDllExport(OpenGLDLL, #Func);
- ENUM_GL_ENTRYPOINTS_DLL(GET_GL_ENTRYPOINTS_DLL);
-
- // Release the OpenGL DLL
- Platform::FreeDllHandle(OpenGLDLL);
-
- // Initialize all entry points required by Flax
-#define GET_GL_ENTRYPOINTS(Type,Func) Func = (Type)wglGetProcAddress(#Func);
- ENUM_GL_ENTRYPOINTS(GET_GL_ENTRYPOINTS);
- ENUM_GL_ENTRYPOINTS_OPTIONAL(GET_GL_ENTRYPOINTS);
-
- // Check that all of the entry points have been initialized
- bool isMissing = false;
-#define CHECK_GL_ENTRYPOINTS(Type,Func) if (Func == NULL) { isMissing = true; LOG(Warning, "Failed to find entry point for {0}", TEXT(#Func)); }
- ENUM_GL_ENTRYPOINTS_DLL(CHECK_GL_ENTRYPOINTS);
- ENUM_GL_ENTRYPOINTS(CHECK_GL_ENTRYPOINTS);
- if (isMissing)
- {
- LOG(Error, "Failed to find all OpenGL entry points.");
- return nullptr;
- }
- }
-
- // Create adapter
- auto adapter = New();
- if (adapter->Init(DummyContext.DeviceContext))
- {
- Delete(adapter);
- LOG(Error, "Failed to init OpenGL adapter.");
- return nullptr;
- }
-
- // Create device
- GPUDeviceOGL* device = nullptr;
-#if GRAPHICS_API_OPENGLES
- {
- todo_support_opengles
- //device = New(adapter);
- }
-#else
- {
- if (adapter->Version >= 440)
- device = New(adapter);
- else
- device = New(adapter);
- }
-#endif
- if (device->Init())
- {
- LOG(Warning, "Graphics Device init failed");
- Delete(device);
- return nullptr;
- }
-
- return device;
-
-#undef CHECK_NULL
-}
-
-bool GPUDeviceOGL::Init()
-{
- // Base
- if (GPUDevice::Init())
- return true;
-
- _state = DeviceState::Created;
-
- // Init device limits
- if (Limits->Init())
- {
- LOG(Warning, "Cannot initialize device limits.");
- return true;
- }
-
- // Create main context
- _mainContext = New(this);
-
- // TODO: create vertex buffer for the quad drawing?
-
- // Finished
- _state = DeviceState::Inited;
- return false;
-}
-
-bool GPUDeviceOGL::CanDraw()
-{
- return GPUDevice::CanDraw() && ContextOGL::IsReady();
-}
-
-GPUDeviceOGL::~GPUDeviceOGL()
-{
- // Ensure to be disposed
- GPUDeviceOGL::Dispose();
-}
-
-#if GPU_OGL_USE_DEBUG_LAYER
-
-void OpenGlErrorCallback(GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar *message, const void *userParam)
-{
- if (type != GL_DEBUG_TYPE_PERFORMANCE && type != GL_DEBUG_TYPE_OTHER)
- {
- LOG(Warning, "OpenGL error: {0}", (const char*)message);
- }
-}
-
-#endif
-
-void GPUDeviceOGL::InitWithMainContext()
-{
-#if GPU_OGL_USE_DEBUG_LAYER
- if (_adapter->HasExtension("GL_ARB_debug_output"))
- {
- glDebugMessageCallbackARB(&OpenGlErrorCallback, 0);
- glEnable(GL_DEBUG_OUTPUT_SYNCHRONOUS);
- }
-#endif
-
- // Init some OpenGL states
- glFrontFace(GL_CW);
-
- // Intel HD4000 under <= 10.8.4 requires GL_DITHER disabled or dithering will occur on any channel < 8bits.
- // No other driver does this but we don't need GL_DITHER on anyway.
- glDisable(GL_DITHER);
-
- // Render targets with sRGB flag should do sRGB conversion like in D3D11
- glEnable(GL_FRAMEBUFFER_SRGB);
-
- // Engine always expects seamless cubemap, so enable it if available
- if (GetLimits()->SupportsSeamlessCubemap)
- {
- glEnable(GL_TEXTURE_CUBE_MAP_SEAMLESS);
- }
-
-#if PLATFORM_WINDOWS || PLATFORM_LINUX
- if (GetLimits()->SupportsClipControl)
- {
- glClipControl(GL_UPPER_LEFT, GL_ZERO_TO_ONE);
- }
-#endif
-}
-
-void GPUDeviceOGL::Dispose()
-{
- GPUDeviceLock lock(this);
-
- // Check if has been disposed already
- if (_state == DeviceState::Disposed)
- return;
-
- // Set current state
- _state = DeviceState::Disposing;
-
- // Wait for rendering end
- WaitForGPU();
-
- // Pre dispose
- preDispose();
-
- // Clear device resources
- FBOCache.Dispose();
- VAOCache.Dispose();
-
- // Clear OpenGL stuff
- SAFE_DELETE(_mainContext);
- SAFE_DELETE(_adapter);
-
- // Base
- GPUDevice::Dispose();
-
- // Set current state
- _state = DeviceState::Disposed;
-}
-
-void GPUDeviceOGL::WaitForGPU()
-{
- // Note: in OpenGL driver manages CPU/GPU work synchronization and work submission
-}
-
-#if GRAPHICS_API_OPENGLES
-
-GPUDeviceOGLES3::GPUDeviceOGLES3(AdapterOGL* adapter)
- : GPUDeviceOGL(RendererType::OpenGLES3, ShaderProfile::Unknown, adapter, New(this))
-{
-}
-
-GPUDeviceOGLES3_1::GPUDeviceOGLES3_1(AdapterOGL* adapter)
- : GPUDeviceOGL(RendererType::OpenGLES3_1, ShaderProfile::Unknown, adapter, New(this))
-{
-}
-
-#else
-
-GPUDeviceOGL4_1::GPUDeviceOGL4_1(AdapterOGL* adapter)
- : GPUDeviceOGL(RendererType::OpenGL4_1, ShaderProfile::GLSL_410, adapter, New(this))
-{
-}
-
-GPUDeviceOGL4_4::GPUDeviceOGL4_4(AdapterOGL* adapter)
- : GPUDeviceOGL(RendererType::OpenGL4_4, ShaderProfile::GLSL_440, adapter, New(this))
-{
-}
-
-#endif
-
-#endif
diff --git a/Source/Engine/GraphicsDevice/OpenGL/GPUDeviceOGL.h b/Source/Engine/GraphicsDevice/OpenGL/GPUDeviceOGL.h
deleted file mode 100644
index e517163ac..000000000
--- a/Source/Engine/GraphicsDevice/OpenGL/GPUDeviceOGL.h
+++ /dev/null
@@ -1,177 +0,0 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
-
-#pragma once
-
-#if GRAPHICS_API_OPENGL
-
-#include "Engine/Graphics/Config.h"
-#include "Engine/Core/Collections/Dictionary.h"
-#include "AdapterOGL.h"
-#include "FBOCache.h"
-#include "VAOCache.h"
-#include "Engine/Graphics/GPUDevice.h"
-
-class Engine;
-class GPUContextOGL;
-class GPULimitsOGL;
-class GPUSwapChainOGL;
-
-///
-/// Base for all OpenGL graphics devices.
-///
-class GPUDeviceOGL : public GPUDevice
-{
- friend GPUContextOGL;
- friend GPUSwapChainOGL;
-
-public:
-
- typedef struct BlendDesc
- {
- bool BlendEnable;
- GLenum SrcBlend;
- GLenum DestBlend;
- GLenum BlendOp;
- GLenum SrcBlendAlpha;
- GLenum DestBlendAlpha;
- GLenum BlendOpAlpha;
- } BlendDesc;
-
- static BlendDesc BlendModes[5];
-
-protected:
-
- GPUContextOGL* _mainContext;
- AdapterOGL* _adapter;
-
-protected:
-
- GPUDeviceOGL(RendererType type, ShaderProfile profile, AdapterOGL* adapter, GPULimits* limits);
-
-public:
-
- static GPUDeviceOGL* Create();
-
- ~GPUDeviceOGL();
-
-public:
-
- GPULimitsOGL* GetLimits()
- {
- return (GPULimitsOGL*)Limits;
- }
-
- ///
- /// The frame buffer objects cache.
- ///
- FBOCache FBOCache;
-
- ///
- /// The vertex array objects cache.
- ///
- VAOCache VAOCache;
-
- ///
- /// Performs graphics device initialization after OpenGL main context creation and assign.
- ///
- void InitWithMainContext();
-
-public:
-
- // [GPUDevice]
- Adapter* GetAdapter() const override
- {
- return _adapter;
- }
- GPUContext* GetMainContext() override
- {
- return reinterpret_cast(_mainContext);
- }
- void* GetNativePtr() const override
- {
- return nullptr;
- }
- bool Init() override;
- bool CanDraw() override;
- void WaitForGPU() override;
- void Dispose() override;
- Texture* CreateTexture(const StringView& name) override
- {
- return New(_device, name);
- }
- Shader* CreateShader(const StringView& name) override
- {
- return New(_device, name);
- }
- PipelineState* CreatePipelineState() override
- {
- return New(_device);
- }
- GPUTimerQuery* CreateTimerQuery() override
- {
- return New(_device);
- }
- Buffer* CreateBuffer(const StringView& name) override
- {
- return New(_device, name);
- }
- GPUSwapChain* CreateGPUSwapChain(Window* parent, int32 width, int32 height, bool fullscreen) override
- {
- return GPUSwapChainOGL::Create(_device, parent, width, height, fullscreen);
- }
-};
-
-#if GRAPHICS_API_OPENGLES
-
-///
-/// Base for all OpenGL ES graphics devices
-///
-class GPUDeviceOGLES : public GPUDeviceOGL
-{
-};
-
-///
-/// Implementation of Graphics Device for OpenGL ES 3.0 (or higher) rendering system.
-///
-class GPUDeviceOGLES3 : public GPUDeviceOGLES
-{
-public:
-
- GPUDeviceOGLES3(AdapterOGL* adapter);
-};
-
-///
-/// Implementation of Graphics Device for OpenGL ES 3.1 (or higher) rendering system.
-///
-class GPUDeviceOGLES3_1 : public GPUDeviceOGLES
-{
-public:
-
- GPUDeviceOGLES3_1(AdapterOGL* adapter);
-};
-
-#else
-
-///
-/// Implementation of Graphics Device for OpenGL 4.1 (or higher) rendering system.
-///
-class GPUDeviceOGL4_1 : public GPUDeviceOGL
-{
-public:
-
- GPUDeviceOGL4_1(AdapterOGL* adapter);
-};
-
-///
-/// Implementation of Graphics Device for OpenGL 4.4 (or higher) rendering system.
-///
-class GPUDeviceOGL4_4 : public GPUDeviceOGL
-{
-public:
-
- GPUDeviceOGL4_4(AdapterOGL* adapter);
-};
-
-#endif
-
-#endif
diff --git a/Source/Engine/GraphicsDevice/OpenGL/GPULimitsOGL.h b/Source/Engine/GraphicsDevice/OpenGL/GPULimitsOGL.h
deleted file mode 100644
index c58e95d4f..000000000
--- a/Source/Engine/GraphicsDevice/OpenGL/GPULimitsOGL.h
+++ /dev/null
@@ -1,559 +0,0 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
-
-#pragma once
-
-#if GRAPHICS_API_OPENGL
-
-#include "Engine/Graphics/Config.h"
-#include "Engine/Graphics/GPULimits.h"
-#include "Engine/Graphics/RenderTools.h"
-#include "GPUDeviceOGL.h"
-#if BUILD_DEBUG
-#include "Engine/Core/Types/StringBuilder.h"
-#endif
-
-struct TextureFormatOGL
-{
-public:
-
- GLenum InternalFormat;
- GLenum Format;
- GLenum Type;
- bool IsCompressed;
-
-public:
-
- TextureFormatOGL()
- {
- InternalFormat = GL_NONE;
- Format = GL_NONE;
- Type = GL_NONE;
- IsCompressed = false;
- }
-
- TextureFormatOGL(GLenum internalFormat, GLenum format, GLenum type, bool isCompressed = false, bool isBGRA = false)
- {
- InternalFormat = internalFormat;
- Format = format;
- Type = type;
- IsCompressed = isCompressed;
- }
-};
-
-///
-/// Implementation of GPU Limits for OpenGL
-///
-///
-class GPULimitsOGL : public GPULimits
-{
-protected:
-
- GPUDeviceOGL * _device;
-
-public:
-
- ///
- /// Initializes a new instance of the class.
- ///
- /// The device.
- GPULimitsOGL(GPUDeviceOGL* device)
- : _device(device)
- {
- }
-
-public:
-
- bool SupportsTessellation;
- bool SupportsGPUMemoryInfo;
- bool SupportsComputeShaders;
- bool SupportsVertexAttribBinding;
- bool SupportsTextureView;
- bool SupportsVolumeTextureRendering;
- bool SupportsASTC;
- bool SupportsCopyImage;
- bool SupportsSeamlessCubemap;
- bool SupportsTextureFilterAnisotropic;
- bool SupportsDrawBuffersBlend;
- bool SupportsSeparateShaderObjects;
- bool SupportsClipControl;
-
- uint64 VideoMemorySize;
- int32 MaxTextureMipCount;
- int32 MaxTextureSize;
- int32 MaxCubeTextureSize;
- int32 MaxVolumeTextureSize;
- int32 MaxTextureArraySize;
- int32 MaxOpenGLDrawBuffers;
- int32 MaxTextureImageUnits;
- int32 MaxCombinedTextureImageUnits;
- int32 MaxVertexTextureImageUnits;
- int32 MaxGeometryTextureImageUnits;
- int32 MaxHullTextureImageUnits;
- int32 MaxDomainTextureImageUnits;
- int32 MaxVaryingVectors;
- int32 MaxVertexUniformComponents;
- int32 MaxPixelUniformComponents;
- int32 MaxGeometryUniformComponents;
- int32 MaxHullUniformComponents;
- int32 MaxDomainUniformComponents;
- int32 MaxComputeTextureImageUnits;
- int32 MaxComputeUniformComponents;
-
- TextureFormatOGL TextureFormats[static_cast(PixelFormat::Maximum)];
-
-public:
-
- GLenum GetInternalTextureFormat(PixelFormat format)
- {
- return TextureFormats[(int32)format].InternalFormat;
- }
-
- GLenum GetInternalTextureFormat(PixelFormat format, GPUTextureFlags flags)
- {
- GLenum f = TextureFormats[(int32)format].InternalFormat;
-
- // Correct GL texure format
- if (flags & GPUTextureFlags::DepthStencil)
- {
- if (f == GL_R32F)
- f = GL_DEPTH_COMPONENT32F;
- else if (f == GL_R16)
- f = GL_DEPTH_COMPONENT16;
- }
-
- return f;
- }
-
-private:
-
- void InitFormats()
- {
- // References:
-// http://www.opengl.org/wiki/Image_Format
-// http://www.g-truc.net/post-0335.html
- // http://renderingpipeline.com/2012/07/texture-compression/
-
- TextureFormats[(int32)PixelFormat::Unknown] = TextureFormatOGL();
-
- TextureFormats[(int32)PixelFormat::R32G32B32A32_Typeless] = TextureFormatOGL(GL_RGBA32F, GL_RGBA, GL_FLOAT);
- TextureFormats[(int32)PixelFormat::R32G32B32A32_Float] = TextureFormatOGL(GL_RGBA32F, GL_RGBA, GL_FLOAT);
- TextureFormats[(int32)PixelFormat::R32G32B32A32_UInt] = TextureFormatOGL(GL_RGBA32UI, GL_RGBA_INTEGER, GL_UNSIGNED_INT);
- TextureFormats[(int32)PixelFormat::R32G32B32A32_SInt] = TextureFormatOGL(GL_RGBA32I, GL_RGBA_INTEGER, GL_INT);
-
- TextureFormats[(int32)PixelFormat::R32G32B32_Typeless] = TextureFormatOGL(GL_RGB32F, GL_RGB, GL_FLOAT);
- TextureFormats[(int32)PixelFormat::R32G32B32_Float] = TextureFormatOGL(GL_RGB32F, GL_RGB, GL_FLOAT);
- TextureFormats[(int32)PixelFormat::R32G32B32_UInt] = TextureFormatOGL(GL_RGB32UI, GL_RGB_INTEGER, GL_UNSIGNED_INT);
- TextureFormats[(int32)PixelFormat::R32G32B32_SInt] = TextureFormatOGL(GL_RGB32I, GL_RGB_INTEGER, GL_INT);
-
- TextureFormats[(int32)PixelFormat::R16G16B16A16_Typeless] = TextureFormatOGL(GL_RGBA16F, GL_RGBA, GL_HALF_FLOAT);
- TextureFormats[(int32)PixelFormat::R16G16B16A16_Float] = TextureFormatOGL(GL_RGBA16F, GL_RGBA, GL_HALF_FLOAT);
- TextureFormats[(int32)PixelFormat::R16G16B16A16_UNorm] = TextureFormatOGL(GL_RGBA16, GL_RGBA, GL_UNSIGNED_SHORT);
- TextureFormats[(int32)PixelFormat::R16G16B16A16_UInt] = TextureFormatOGL(GL_RGBA16UI, GL_RGBA_INTEGER, GL_UNSIGNED_SHORT);
- TextureFormats[(int32)PixelFormat::R16G16B16A16_SNorm] = TextureFormatOGL(GL_RGBA16_SNORM, GL_RGBA, GL_SHORT);
- TextureFormats[(int32)PixelFormat::R16G16B16A16_SInt] = TextureFormatOGL(GL_RGBA16I, GL_RGBA_INTEGER, GL_SHORT);
-
- TextureFormats[(int32)PixelFormat::R32G32_Typeless] = TextureFormatOGL(GL_RG32F, GL_RG, GL_FLOAT);
- TextureFormats[(int32)PixelFormat::R32G32_Float] = TextureFormatOGL(GL_RG32F, GL_RG, GL_FLOAT);
- TextureFormats[(int32)PixelFormat::R32G32_UInt] = TextureFormatOGL(GL_RG32UI, GL_RG_INTEGER, GL_UNSIGNED_INT);
- TextureFormats[(int32)PixelFormat::R32G32_SInt] = TextureFormatOGL(GL_RG32I, GL_RG_INTEGER, GL_INT);
-
- TextureFormats[(int32)PixelFormat::R32G8X24_Typeless] = TextureFormatOGL(GL_DEPTH32F_STENCIL8, GL_DEPTH_STENCIL, GL_FLOAT_32_UNSIGNED_INT_24_8_REV);
- TextureFormats[(int32)PixelFormat::D32_Float_S8X24_UInt] = TextureFormatOGL(GL_DEPTH32F_STENCIL8, GL_DEPTH_STENCIL, GL_FLOAT_32_UNSIGNED_INT_24_8_REV);
- TextureFormats[(int32)PixelFormat::R32_Float_X8X24_Typeless] = TextureFormatOGL(GL_DEPTH32F_STENCIL8, GL_DEPTH_STENCIL, GL_FLOAT_32_UNSIGNED_INT_24_8_REV);
- TextureFormats[(int32)PixelFormat::X32_Typeless_G8X24_UInt] = TextureFormatOGL(GL_DEPTH32F_STENCIL8, GL_DEPTH_STENCIL, GL_FLOAT_32_UNSIGNED_INT_24_8_REV);
-
- TextureFormats[(int32)PixelFormat::R10G10B10A2_Typeless] = TextureFormatOGL(GL_RGB10_A2, GL_RGBA, GL_UNSIGNED_INT_2_10_10_10_REV);
- TextureFormats[(int32)PixelFormat::R10G10B10A2_UNorm] = TextureFormatOGL(GL_RGB10_A2, GL_RGBA, GL_UNSIGNED_INT_2_10_10_10_REV);
- TextureFormats[(int32)PixelFormat::R10G10B10A2_UInt] = TextureFormatOGL(GL_RGB10_A2UI, GL_RGBA_INTEGER, GL_UNSIGNED_INT_2_10_10_10_REV);
- TextureFormats[(int32)PixelFormat::R11G11B10_Float] = TextureFormatOGL(GL_R11F_G11F_B10F, GL_RGB, GL_UNSIGNED_INT_10F_11F_11F_REV);
-
- TextureFormats[(int32)PixelFormat::R8G8B8A8_Typeless] = TextureFormatOGL(GL_RGBA8, GL_RGBA, GL_UNSIGNED_BYTE);
- TextureFormats[(int32)PixelFormat::R8G8B8A8_UNorm] = TextureFormatOGL(GL_RGBA8, GL_RGBA, GL_UNSIGNED_BYTE);
- TextureFormats[(int32)PixelFormat::R8G8B8A8_UNorm_sRGB] = TextureFormatOGL(GL_SRGB8_ALPHA8, GL_RGBA, GL_UNSIGNED_BYTE);
- TextureFormats[(int32)PixelFormat::R8G8B8A8_UInt] = TextureFormatOGL(GL_RGBA8UI, GL_RGBA_INTEGER, GL_UNSIGNED_BYTE);
- TextureFormats[(int32)PixelFormat::R8G8B8A8_SNorm] = TextureFormatOGL(GL_RGBA8_SNORM, GL_RGBA, GL_BYTE);
- TextureFormats[(int32)PixelFormat::R8G8B8A8_SInt] = TextureFormatOGL(GL_RGBA8I, GL_RGBA_INTEGER, GL_BYTE);
-
- TextureFormats[(int32)PixelFormat::R16G16_Typeless] = TextureFormatOGL(GL_RG16F, GL_RG, GL_HALF_FLOAT);
- TextureFormats[(int32)PixelFormat::R16G16_Float] = TextureFormatOGL(GL_RG16F, GL_RG, GL_HALF_FLOAT);
- TextureFormats[(int32)PixelFormat::R16G16_UNorm] = TextureFormatOGL(GL_RG16, GL_RG, GL_UNSIGNED_SHORT);
- TextureFormats[(int32)PixelFormat::R16G16_UInt] = TextureFormatOGL(GL_RG16UI, GL_RG_INTEGER, GL_UNSIGNED_SHORT);
- TextureFormats[(int32)PixelFormat::R16G16_SNorm] = TextureFormatOGL(GL_RG16_SNORM, GL_RG, GL_SHORT);
- TextureFormats[(int32)PixelFormat::R16G16_SInt] = TextureFormatOGL(GL_RG16I, GL_RG_INTEGER, GL_SHORT);
-
- TextureFormats[(int32)PixelFormat::R32_Typeless] = TextureFormatOGL(GL_R32F, GL_RED, GL_FLOAT);
- TextureFormats[(int32)PixelFormat::D32_Float] = TextureFormatOGL(GL_DEPTH_COMPONENT32F, GL_DEPTH_COMPONENT, GL_FLOAT);
- TextureFormats[(int32)PixelFormat::R32_Float] = TextureFormatOGL(GL_R32F, GL_RED, GL_FLOAT);
- TextureFormats[(int32)PixelFormat::R32_UInt] = TextureFormatOGL(GL_R32UI, GL_RED_INTEGER, GL_UNSIGNED_INT);
- TextureFormats[(int32)PixelFormat::R32_SInt] = TextureFormatOGL(GL_R32I, GL_RED_INTEGER, GL_INT);
-
- TextureFormats[(int32)PixelFormat::R24G8_Typeless] = TextureFormatOGL(GL_DEPTH24_STENCIL8, GL_DEPTH_STENCIL, GL_UNSIGNED_INT_24_8);
- TextureFormats[(int32)PixelFormat::D24_UNorm_S8_UInt] = TextureFormatOGL(GL_DEPTH24_STENCIL8, GL_DEPTH_STENCIL, GL_UNSIGNED_INT_24_8);
- TextureFormats[(int32)PixelFormat::R24_UNorm_X8_Typeless] = TextureFormatOGL(GL_DEPTH24_STENCIL8, GL_DEPTH_STENCIL, GL_UNSIGNED_INT_24_8);
- TextureFormats[(int32)PixelFormat::X24_Typeless_G8_UInt] = TextureFormatOGL(GL_DEPTH24_STENCIL8, GL_DEPTH_STENCIL, GL_UNSIGNED_INT_24_8);
-
- TextureFormats[(int32)PixelFormat::R8G8_Typeless] = TextureFormatOGL(GL_RG8, GL_RG, GL_UNSIGNED_BYTE);
- TextureFormats[(int32)PixelFormat::R8G8_UNorm] = TextureFormatOGL(GL_RG8, GL_RG, GL_UNSIGNED_BYTE);
- TextureFormats[(int32)PixelFormat::R8G8_UInt] = TextureFormatOGL(GL_RG8UI, GL_RG_INTEGER, GL_UNSIGNED_BYTE);
- TextureFormats[(int32)PixelFormat::R8G8_SNorm] = TextureFormatOGL(GL_RG8_SNORM, GL_RG, GL_BYTE);
- TextureFormats[(int32)PixelFormat::R8G8_SInt] = TextureFormatOGL(GL_RG8I, GL_RG_INTEGER, GL_BYTE);
-
- TextureFormats[(int32)PixelFormat::R16_Typeless] = TextureFormatOGL(GL_R16F, GL_RED, GL_HALF_FLOAT);
- TextureFormats[(int32)PixelFormat::R16_Float] = TextureFormatOGL(GL_R16F, GL_RED, GL_HALF_FLOAT);
- TextureFormats[(int32)PixelFormat::D16_UNorm] = TextureFormatOGL(GL_DEPTH_COMPONENT16, GL_DEPTH_COMPONENT, GL_UNSIGNED_SHORT);
- TextureFormats[(int32)PixelFormat::R16_UNorm] = TextureFormatOGL(GL_R16, GL_RED, GL_UNSIGNED_SHORT);
- TextureFormats[(int32)PixelFormat::R16_UInt] = TextureFormatOGL(GL_R16UI, GL_RED_INTEGER, GL_UNSIGNED_SHORT);
- TextureFormats[(int32)PixelFormat::R16_SNorm] = TextureFormatOGL(GL_R16_SNORM, GL_RED, GL_SHORT);
- TextureFormats[(int32)PixelFormat::R16_SInt] = TextureFormatOGL(GL_R16I, GL_RED_INTEGER, GL_SHORT);
-
- TextureFormats[(int32)PixelFormat::R8_Typeless] = TextureFormatOGL(GL_R8, GL_RED, GL_UNSIGNED_BYTE);
- TextureFormats[(int32)PixelFormat::R8_UNorm] = TextureFormatOGL(GL_R8, GL_RED, GL_UNSIGNED_BYTE);
- TextureFormats[(int32)PixelFormat::R8_UInt] = TextureFormatOGL(GL_R8UI, GL_RED_INTEGER, GL_UNSIGNED_BYTE);
- TextureFormats[(int32)PixelFormat::R8_SNorm] = TextureFormatOGL(GL_R8_SNORM, GL_RED, GL_BYTE);
- TextureFormats[(int32)PixelFormat::R8_SInt] = TextureFormatOGL(GL_R8I, GL_RED_INTEGER, GL_BYTE);
- TextureFormats[(int32)PixelFormat::A8_UNorm] = TextureFormatOGL();
-
- TextureFormats[(int32)PixelFormat::R1_UNorm] = TextureFormatOGL();
-
- TextureFormats[(int32)PixelFormat::R9G9B9E5_SharedExp] = TextureFormatOGL(GL_RGB9_E5, GL_RGB, GL_UNSIGNED_INT_5_9_9_9_REV);
- TextureFormats[(int32)PixelFormat::R8G8_B8G8_UNorm] = TextureFormatOGL();
- TextureFormats[(int32)PixelFormat::G8R8_G8B8_UNorm] = TextureFormatOGL();
-
- TextureFormats[(int32)PixelFormat::BC1_Typeless] = TextureFormatOGL(GL_COMPRESSED_RGB_S3TC_DXT1_EXT, GL_RGB, GL_UNSIGNED_BYTE, true);
- TextureFormats[(int32)PixelFormat::BC1_UNorm] = TextureFormatOGL(GL_COMPRESSED_RGB_S3TC_DXT1_EXT, GL_RGB, GL_UNSIGNED_BYTE, true);
- TextureFormats[(int32)PixelFormat::BC1_UNorm_sRGB] = TextureFormatOGL(GL_COMPRESSED_SRGB_S3TC_DXT1_EXT, GL_RGB, GL_UNSIGNED_BYTE, true);
- TextureFormats[(int32)PixelFormat::BC2_Typeless] = TextureFormatOGL(GL_COMPRESSED_RGBA_S3TC_DXT3_EXT, GL_RGBA, GL_UNSIGNED_BYTE, true);
- TextureFormats[(int32)PixelFormat::BC2_UNorm] = TextureFormatOGL(GL_COMPRESSED_RGBA_S3TC_DXT3_EXT, GL_RGBA, GL_UNSIGNED_BYTE, true);
- TextureFormats[(int32)PixelFormat::BC2_UNorm_sRGB] = TextureFormatOGL(GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT, GL_RGBA, GL_UNSIGNED_BYTE, true);
- TextureFormats[(int32)PixelFormat::BC3_Typeless] = TextureFormatOGL(GL_COMPRESSED_RGBA_S3TC_DXT5_EXT, GL_RGBA, GL_UNSIGNED_BYTE, true);
- TextureFormats[(int32)PixelFormat::BC3_UNorm] = TextureFormatOGL(GL_COMPRESSED_RGBA_S3TC_DXT5_EXT, GL_RGBA, GL_UNSIGNED_BYTE, true);
- TextureFormats[(int32)PixelFormat::BC3_UNorm_sRGB] = TextureFormatOGL(GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT, GL_RGBA, GL_UNSIGNED_BYTE, true);
- TextureFormats[(int32)PixelFormat::BC4_Typeless] = TextureFormatOGL(GL_COMPRESSED_RED_RGTC1, GL_RED, GL_UNSIGNED_BYTE, true);
- TextureFormats[(int32)PixelFormat::BC4_UNorm] = TextureFormatOGL(GL_COMPRESSED_RED_RGTC1, GL_RED, GL_UNSIGNED_BYTE, true);
- TextureFormats[(int32)PixelFormat::BC4_SNorm] = TextureFormatOGL(GL_COMPRESSED_SIGNED_RED_RGTC1, GL_RED, GL_UNSIGNED_BYTE, true);
- TextureFormats[(int32)PixelFormat::BC5_Typeless] = TextureFormatOGL(GL_COMPRESSED_RG_RGTC2, GL_RG, GL_UNSIGNED_BYTE, true);
- TextureFormats[(int32)PixelFormat::BC5_UNorm] = TextureFormatOGL(GL_COMPRESSED_RG_RGTC2, GL_RG, GL_UNSIGNED_BYTE, true);
- TextureFormats[(int32)PixelFormat::BC5_SNorm] = TextureFormatOGL(GL_COMPRESSED_SIGNED_RG_RGTC2, GL_RG, GL_UNSIGNED_BYTE, true);
- TextureFormats[(int32)PixelFormat::B5G6R5_UNorm] = TextureFormatOGL(GL_RGB565, GL_RGB, GL_UNSIGNED_SHORT_5_6_5_REV);
- TextureFormats[(int32)PixelFormat::B5G5R5A1_UNorm] = TextureFormatOGL(GL_RGB5_A1, GL_RGBA, GL_UNSIGNED_SHORT_1_5_5_5_REV);
- TextureFormats[(int32)PixelFormat::B8G8R8A8_UNorm] = TextureFormatOGL();
- TextureFormats[(int32)PixelFormat::B8G8R8X8_UNorm] = TextureFormatOGL();
- TextureFormats[(int32)PixelFormat::R10G10B10_Xr_Bias_A2_UNorm] = TextureFormatOGL();
- TextureFormats[(int32)PixelFormat::B8G8R8A8_Typeless] = TextureFormatOGL(GL_RGBA8, GL_BGRA, GL_UNSIGNED_INT_8_8_8_8_REV);
- TextureFormats[(int32)PixelFormat::B8G8R8A8_UNorm_sRGB] = TextureFormatOGL(GL_SRGB8_ALPHA8, GL_BGRA, GL_UNSIGNED_INT_8_8_8_8_REV);
- TextureFormats[(int32)PixelFormat::B8G8R8X8_Typeless] = TextureFormatOGL(GL_RGBA8, GL_BGRA, GL_UNSIGNED_INT_8_8_8_8_REV);
- TextureFormats[(int32)PixelFormat::B8G8R8X8_UNorm_sRGB] = TextureFormatOGL(GL_SRGB8_ALPHA8, GL_BGRA, GL_UNSIGNED_INT_8_8_8_8_REV);
- TextureFormats[(int32)PixelFormat::BC6H_Typeless] = TextureFormatOGL(GL_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT, GL_RGB, GL_UNSIGNED_BYTE, true);
- TextureFormats[(int32)PixelFormat::BC6H_Uf16] = TextureFormatOGL(GL_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT, GL_RGB, GL_UNSIGNED_BYTE, true);
- TextureFormats[(int32)PixelFormat::BC6H_Sf16] = TextureFormatOGL(GL_COMPRESSED_RGB_BPTC_SIGNED_FLOAT, GL_RGB, GL_UNSIGNED_BYTE, true);
- TextureFormats[(int32)PixelFormat::BC7_Typeless] = TextureFormatOGL(GL_COMPRESSED_RGBA_BPTC_UNORM, GL_RGB, GL_UNSIGNED_BYTE, true);
- TextureFormats[(int32)PixelFormat::BC7_UNorm] = TextureFormatOGL(GL_COMPRESSED_RGBA_BPTC_UNORM, GL_RGB, GL_UNSIGNED_BYTE, true);
- TextureFormats[(int32)PixelFormat::BC7_UNorm_sRGB] = TextureFormatOGL(GL_COMPRESSED_SRGB_ALPHA_BPTC_UNORM, GL_RGB, GL_UNSIGNED_BYTE, true);
-
- // Check features for each PixelFormat
- for (int32 i = 0; i < static_cast(PixelFormat::Maximum); i++)
- {
- // TODO: try to detect MSAA or some feature levels like on D3D11
- auto format = static_cast(i);
- auto& info = TextureFormats[i];
- FormatSupport support = FormatSupport::None;
- if (info.Format != 0)
- {
- support = FormatSupport::Texture1D | FormatSupport::Texture2D | FormatSupport::Texture3D | FormatSupport::DepthStencil | FormatSupport::Buffer;
- }
- _featuresPerFormat[i] = FeaturesPerFormat(format, MSAALevel::None, support);
- }
- }
-
-#if BUILD_DEBUG
-
- void PrintStats()
- {
-#define PRINT_STAT(name) sb.AppendFormat(TEXT("{0} = {1}\n"), TEXT(#name), name)
-
- StringBuilder sb;
- sb.AppendLine();
- sb.AppendLine();
-
- auto adapter = (AdapterOGL*)_device->GetAdapter();
- sb.AppendFormat(TEXT("OpenGL {0}.{1}\n"), adapter->VersionMajor, adapter->VersionMinor);
-
- sb.AppendLine();
- PRINT_STAT(SupportsTessellation);
- PRINT_STAT(SupportsGPUMemoryInfo);
- PRINT_STAT(SupportsComputeShaders);
- PRINT_STAT(SupportsVertexAttribBinding);
- PRINT_STAT(SupportsTextureView);
- PRINT_STAT(SupportsVolumeTextureRendering);
- PRINT_STAT(SupportsASTC);
- PRINT_STAT(SupportsCopyImage);
- PRINT_STAT(SupportsSeamlessCubemap);
- PRINT_STAT(SupportsTextureFilterAnisotropic);
- PRINT_STAT(SupportsDrawBuffersBlend);
- PRINT_STAT(SupportsSeparateShaderObjects);
- PRINT_STAT(SupportsClipControl);
-
- sb.AppendLine();
- PRINT_STAT(VideoMemorySize);
- PRINT_STAT(MaxTextureMipCount);
- PRINT_STAT(MaxTextureSize);
- PRINT_STAT(MaxCubeTextureSize);
- PRINT_STAT(MaxVolumeTextureSize);
- PRINT_STAT(MaxTextureArraySize);
- PRINT_STAT(MaxOpenGLDrawBuffers);
- PRINT_STAT(MaxTextureImageUnits);
- PRINT_STAT(MaxCombinedTextureImageUnits);
- PRINT_STAT(MaxVertexTextureImageUnits);
- PRINT_STAT(MaxGeometryTextureImageUnits);
- PRINT_STAT(MaxHullTextureImageUnits);
- PRINT_STAT(MaxDomainTextureImageUnits);
- PRINT_STAT(MaxVaryingVectors);
- PRINT_STAT(MaxVertexUniformComponents);
- PRINT_STAT(MaxPixelUniformComponents);
- PRINT_STAT(MaxGeometryUniformComponents);
- PRINT_STAT(MaxHullUniformComponents);
- PRINT_STAT(MaxDomainUniformComponents);
- PRINT_STAT(MaxComputeTextureImageUnits);
- PRINT_STAT(MaxComputeUniformComponents);
-
- sb.AppendLine();
-
- LOG_STR(Info, sb.ToString());
-
-#undef PRINT_STAT
- }
-
-#endif
-
-public:
-
- // [GPULimits]
- bool Init() override
- {
- auto adapter = (AdapterOGL*)_device->GetAdapter();
- auto VersionMajor = adapter->VersionMajor;
- auto VersionMinor = adapter->VersionMinor;
-
- // Test graphics pipeline features support
- SupportsTessellation = (VersionMajor >= 4) || adapter->HasExtension("GL_ARB_tessellation_shader");
- SupportsGPUMemoryInfo = adapter->HasExtension("GL_NVX_gpu_memory_info");
- SupportsComputeShaders = (VersionMajor == 4 && VersionMinor >= 3) || (VersionMajor > 4) || adapter->HasExtension("GL_ARB_compute_shader");
- SupportsVertexAttribBinding = (VersionMajor == 4 && VersionMinor >= 3) || (VersionMajor > 4) || adapter->HasExtension("GL_ARB_vertex_attrib_binding");
- SupportsTextureView = (VersionMajor == 4 && VersionMinor >= 3) || (VersionMajor > 4) || adapter->HasExtension("GL_ARB_texture_view");
- SupportsASTC = adapter->HasExtension("GL_KHR_texture_compression_astc_ldr");
- SupportsCopyImage = adapter->HasExtension("GL_ARB_copy_image");
- SupportsSeamlessCubemap = adapter->HasExtension("GL_ARB_seamless_cube_map");
- SupportsTextureFilterAnisotropic = adapter->HasExtension("GL_EXT_texture_filter_anisotropic");
- SupportsDrawBuffersBlend = adapter->HasExtension("GL_ARB_draw_buffers_blend");
- SupportsClipControl = adapter->HasExtension("GL_ARB_clip_control");
-#if GRAPHICS_API_OPENGL_ES
- SupportsSeparateShaderObjects = false;
-#else
- SupportsSeparateShaderObjects = (VersionMajor == 4 && VersionMinor >= 4) || adapter->HasExtension("GL_ARB_separate_shader_objects");
-#endif
-
- // Get video memory size (in bytes)
- VideoMemorySize = 0;
- if (SupportsGPUMemoryInfo)
- {
- GLint VMSizeKB = 0;
- glGetIntegerv(GL_GPU_MEMORY_INFO_DEDICATED_VIDMEM_NVX, &VMSizeKB);
- VideoMemorySize = VMSizeKB * 1024ll;
- }
-
- // Test whether the GPU can support volume-texture rendering.
- // There is no API to query this - you just have to test whether a 3D texture is framebuffer-complete.
- {
- GLuint frameBuffer;
- glGenFramebuffers(1, &frameBuffer);
- glBindFramebuffer(GL_DRAW_FRAMEBUFFER, frameBuffer);
- GLuint volumeTexture;
- glGenTextures(1, &volumeTexture);
- glBindTexture(GL_TEXTURE_3D, volumeTexture);
- glTexImage3D(GL_TEXTURE_3D, 0, GL_RGBA8, 256, 256, 256, 0, GL_RGBA, GL_UNSIGNED_BYTE, NULL);
- glFramebufferTexture(GL_DRAW_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, volumeTexture, 0);
-
- SupportsVolumeTextureRendering = (glCheckFramebufferStatus(GL_DRAW_FRAMEBUFFER) == GL_FRAMEBUFFER_COMPLETE);
-
- glDeleteTextures(1, &volumeTexture);
- glDeleteFramebuffers(1, &frameBuffer);
- }
-
- // Get the device limits with OpenGL API
-#define LOG_AND_GET_GL_INT_TEMP(IntEnum, Default) GLint Value_##IntEnum = Default; if (IntEnum) {glGetIntegerv(IntEnum, &Value_##IntEnum); glGetError();} else {Value_##IntEnum = Default;}
- LOG_AND_GET_GL_INT_TEMP(GL_MAX_TEXTURE_SIZE, 0);
- LOG_AND_GET_GL_INT_TEMP(GL_MAX_CUBE_MAP_TEXTURE_SIZE, 0);
- LOG_AND_GET_GL_INT_TEMP(GL_MAX_ARRAY_TEXTURE_LAYERS, 0);
- LOG_AND_GET_GL_INT_TEMP(GL_MAX_3D_TEXTURE_SIZE, 0);
- LOG_AND_GET_GL_INT_TEMP(GL_MAX_RENDERBUFFER_SIZE, 0);
- LOG_AND_GET_GL_INT_TEMP(GL_MAX_TEXTURE_IMAGE_UNITS, 0);
- LOG_AND_GET_GL_INT_TEMP(GL_MAX_DRAW_BUFFERS, 1);
- LOG_AND_GET_GL_INT_TEMP(GL_MAX_COLOR_ATTACHMENTS, 1);
- LOG_AND_GET_GL_INT_TEMP(GL_MAX_SAMPLES, 1);
- LOG_AND_GET_GL_INT_TEMP(GL_MAX_COLOR_TEXTURE_SAMPLES, 1);
- LOG_AND_GET_GL_INT_TEMP(GL_MAX_DEPTH_TEXTURE_SAMPLES, 1);
- LOG_AND_GET_GL_INT_TEMP(GL_MAX_INTEGER_SAMPLES, 1);
- LOG_AND_GET_GL_INT_TEMP(GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS, 0);
- LOG_AND_GET_GL_INT_TEMP(GL_MAX_VERTEX_ATTRIBS, 0);
- LOG_AND_GET_GL_INT_TEMP(GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT, 0);
- LOG_AND_GET_GL_INT_TEMP(GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS, 0);
- LOG_AND_GET_GL_INT_TEMP(GL_MAX_GEOMETRY_TEXTURE_IMAGE_UNITS, 0);
- LOG_AND_GET_GL_INT_TEMP(GL_MAX_TESS_CONTROL_TEXTURE_IMAGE_UNITS, 0);
- LOG_AND_GET_GL_INT_TEMP(GL_MAX_TESS_EVALUATION_TEXTURE_IMAGE_UNITS, 0);
- LOG_AND_GET_GL_INT_TEMP(GL_MAX_VERTEX_UNIFORM_COMPONENTS, 0);
- LOG_AND_GET_GL_INT_TEMP(GL_MAX_FRAGMENT_UNIFORM_COMPONENTS, 0);
- LOG_AND_GET_GL_INT_TEMP(GL_MAX_GEOMETRY_UNIFORM_COMPONENTS, 0);
- LOG_AND_GET_GL_INT_TEMP(GL_MAX_VARYING_VECTORS, 0);
-
- // Setup the actual limits
- MaxTextureSize = Value_GL_MAX_TEXTURE_SIZE;
- MaxTextureMipCount = Math::Min(GPU_MAX_TEXTURE_MIP_LEVELS, MipLevelsCount(MaxTextureSize));
- MaxCubeTextureSize = Value_GL_MAX_CUBE_MAP_TEXTURE_SIZE;
- MaxTextureArraySize = Value_GL_MAX_ARRAY_TEXTURE_LAYERS;
- MaxVolumeTextureSize = MaxCubeTextureSize;
- MaxOpenGLDrawBuffers = Value_GL_MAX_DRAW_BUFFERS;
- MaxTextureImageUnits = Value_GL_MAX_TEXTURE_IMAGE_UNITS;
- MaxCombinedTextureImageUnits = Value_GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS;
- MaxVertexTextureImageUnits = Value_GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS;
- MaxGeometryTextureImageUnits = Value_GL_MAX_GEOMETRY_TEXTURE_IMAGE_UNITS;
- MaxHullTextureImageUnits = Value_GL_MAX_TESS_CONTROL_TEXTURE_IMAGE_UNITS;
- MaxDomainTextureImageUnits = Value_GL_MAX_TESS_EVALUATION_TEXTURE_IMAGE_UNITS;
- MaxVaryingVectors = Value_GL_MAX_VARYING_VECTORS;
- MaxVertexUniformComponents = Value_GL_MAX_VERTEX_UNIFORM_COMPONENTS;
- MaxPixelUniformComponents = Value_GL_MAX_FRAGMENT_UNIFORM_COMPONENTS;
- MaxGeometryUniformComponents = Value_GL_MAX_GEOMETRY_UNIFORM_COMPONENTS;
- if (SupportsTessellation)
- {
- LOG_AND_GET_GL_INT_TEMP(GL_MAX_TESS_CONTROL_UNIFORM_COMPONENTS, 0);
- LOG_AND_GET_GL_INT_TEMP(GL_MAX_TESS_EVALUATION_UNIFORM_COMPONENTS, 0);
- MaxHullUniformComponents = Value_GL_MAX_TESS_CONTROL_UNIFORM_COMPONENTS;
- MaxDomainUniformComponents = Value_GL_MAX_TESS_EVALUATION_UNIFORM_COMPONENTS;
- }
- else
- {
- MaxHullUniformComponents = 0;
- MaxDomainUniformComponents = 0;
- }
- if (SupportsComputeShaders)
- {
- LOG_AND_GET_GL_INT_TEMP(GL_MAX_COMPUTE_TEXTURE_IMAGE_UNITS, 0);
- LOG_AND_GET_GL_INT_TEMP(GL_MAX_COMPUTE_UNIFORM_COMPONENTS, 0);
- MaxComputeTextureImageUnits = Value_GL_MAX_COMPUTE_TEXTURE_IMAGE_UNITS;
- MaxComputeUniformComponents = Value_GL_MAX_COMPUTE_UNIFORM_COMPONENTS;
- }
- else
- {
- MaxComputeTextureImageUnits = 0;
- MaxComputeUniformComponents = 0;
- }
-
- // For now, just allocate additional units if available and advertise no tessellation units for HW that can't handle more
- if (MaxCombinedTextureImageUnits < 48)
- {
- // To work around AMD driver limitation of 32 GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS,
-// Going to hard code this for now (16 units in PS, 8 units in VS, 8 units in GS).
- // This is going to be a problem for tessellation.
- MaxTextureImageUnits = MaxTextureImageUnits > 16 ? 16 : MaxTextureImageUnits;
- MaxVertexTextureImageUnits = MaxVertexTextureImageUnits > 8 ? 8 : MaxVertexTextureImageUnits;
- MaxGeometryTextureImageUnits = MaxGeometryTextureImageUnits > 8 ? 8 : MaxGeometryTextureImageUnits;
- MaxHullTextureImageUnits = 0;
- MaxDomainTextureImageUnits = 0;
- MaxCombinedTextureImageUnits = MaxCombinedTextureImageUnits > 32 ? 32 : MaxCombinedTextureImageUnits;
- }
- else
- {
- // Clamp things to the levels that the other path is going, but allow additional units for tessellation
- MaxTextureImageUnits = MaxTextureImageUnits > 16 ? 16 : MaxTextureImageUnits;
- MaxVertexTextureImageUnits = MaxVertexTextureImageUnits > 8 ? 8 : MaxVertexTextureImageUnits;
- MaxGeometryTextureImageUnits = MaxGeometryTextureImageUnits > 8 ? 8 : MaxGeometryTextureImageUnits;
- MaxHullTextureImageUnits = MaxHullTextureImageUnits > 8 ? 8 : MaxHullTextureImageUnits;
- MaxDomainTextureImageUnits = MaxDomainTextureImageUnits > 8 ? 8 : MaxDomainTextureImageUnits;
- MaxCombinedTextureImageUnits = MaxCombinedTextureImageUnits > 48 ? 48 : MaxCombinedTextureImageUnits;
- }
-
- InitFormats();
-
-#if BUILD_DEBUG
- PrintStats();
-#endif
-
- // Validate minimum specs for the engine to start
- if (!SupportsTextureView)
- {
- LOG(Error, "The GPU does not meet minimal requirements.");
- return true;
- }
-
- return false;
- }
- bool HasCompute() const override
- {
- return SupportsComputeShaders;
- }
- bool HasTessellation() const override
- {
- return SupportsTessellation;
- }
- bool HasGeometryShaders() const override
- {
-#if GRAPHICS_API_OPENGLES
- return false;
-#else
- return true;
-#endif
- }
- bool HasVolumeTextureRendering() const override
- {
- return SupportsVolumeTextureRendering;
- }
- bool HasDrawIndirect() const override
- {
- return false;
- }
- bool HasAppendConsumeBuffers() const override
- {
- return false;
- }
- bool HasSeparateRenderTargetBlendState() const override
- {
- return false;
- }
- bool HasDepthAsSRV() const override
- {
- return true;
- }
- bool HasMultisampleDepthAsSRV() const override
- {
- return true;
- }
- int32 MaximumMipLevelsCount() const override
- {
- return MaxTextureMipCount;
- }
- int32 MaximumTexture1DSize() const override
- {
- return MaxTextureSize;
- }
- int32 MaximumTexture1DArraySize() const override
- {
- return MaxTextureArraySize;
- }
- int32 MaximumTexture2DSize() const override
- {
- return MaxTextureSize;
- }
- int32 MaximumTexture2DArraySize() const override
- {
- return MaxTextureArraySize;
- }
- int32 MaximumTexture3DSize() const override
- {
- return MaxVolumeTextureSize;
- }
- int32 MaximumTextureCubeSize() const override
- {
- return MaxCubeTextureSize;
- }
-};
-
-#endif
diff --git a/Source/Engine/GraphicsDevice/OpenGL/GPUPipelineStateOGL.cpp b/Source/Engine/GraphicsDevice/OpenGL/GPUPipelineStateOGL.cpp
deleted file mode 100644
index 061c50e40..000000000
--- a/Source/Engine/GraphicsDevice/OpenGL/GPUPipelineStateOGL.cpp
+++ /dev/null
@@ -1,101 +0,0 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
-
-#if GRAPHICS_API_OPENGL
-
-#include "GPUPipelineStateOGL.h"
-#include "GPUDeviceOGL.h"
-#include "GPULimitsOGL.h"
-#include "RenderToolsOGL.h"
-#include "Shaders/GPUShaderProgramOGL.h"
-
-GPUPipelineStateOGL::GPUPipelineStateOGL(GPUDeviceOGL* device)
- : GPUResourceOGL(device, StringView::Empty)
-{
-}
-
-GPUPipelineStateOGL::~GPUPipelineStateOGL()
-{
- ReleaseGPU();
-}
-
-void GPUPipelineStateOGL::OnBind()
-{
- if (!IsCreated)
- {
- ASSERT(ProgramPipeline == 0 && Program == 0);
-
- glGenProgramPipelines(1, &ProgramPipeline);
- VALIDATE_OPENGL_RESULT();
-
- _usedSRsMask = 0;
-
- if (VS != nullptr)
- {
- glUseProgramStages(ProgramPipeline, GL_VERTEX_SHADER_BIT, VS->GetHandle());
- VALIDATE_OPENGL_RESULT();
- _usedSRsMask |= VS->GetSRsMask();
- }
-
- if (PS != nullptr)
- {
- glUseProgramStages(ProgramPipeline, GL_FRAGMENT_SHADER_BIT, PS->GetHandle());
- VALIDATE_OPENGL_RESULT();
- _usedSRsMask |= PS->GetSRsMask();
- }
-
- if (GS != nullptr)
- {
- glUseProgramStages(ProgramPipeline, GL_GEOMETRY_SHADER_BIT, GS->GetHandle());
- VALIDATE_OPENGL_RESULT();
- _usedSRsMask |= GS->GetSRsMask();
- }
-
- IsCreated = true;
- }
-}
-
-void GPUPipelineStateOGL::ReleaseGPU()
-{
- if (_memoryUsage == 0)
- return;
-
- if (Program != 0)
- {
- glDeleteProgram(Program);
- Program = 0;
- }
- if (ProgramPipeline != 0)
- {
- glDeleteProgramPipelines(1, &ProgramPipeline);
- ProgramPipeline = 0;
- }
-
- IsCreated = false;
- _memoryUsage = 0;
-}
-
-bool GPUPipelineStateOGL::IsValid() const
-{
- return _memoryUsage != 0;
-}
-
-bool GPUPipelineStateOGL::Init(const Description& desc)
-{
- // Cache state
- _memoryUsage = 1;
- EnableDepthWrite = desc.EnableDepthWrite;
- DepthTestEnable = desc.DepthTestEnable;
- DepthClipEnable = desc.DepthClipEnable;
- DepthFunc = desc.DepthFunc;
- VS = (GPUShaderProgramVSOGL*)desc.VS;
- GS = (GPUShaderProgramGSOGL*)desc.GS;
- PS = (GPUShaderProgramPSOGL*)desc.PS;
- PrimitiveTopologyType = desc.PrimitiveTopologyType;
- Wireframe = desc.Wireframe;
- CullMode = desc.CullMode;
- BlendMode = desc.BlendMode;
-
- return PipelineState::Create(desc);
-}
-
-#endif
diff --git a/Source/Engine/GraphicsDevice/OpenGL/GPUPipelineStateOGL.h b/Source/Engine/GraphicsDevice/OpenGL/GPUPipelineStateOGL.h
deleted file mode 100644
index c3a95a169..000000000
--- a/Source/Engine/GraphicsDevice/OpenGL/GPUPipelineStateOGL.h
+++ /dev/null
@@ -1,80 +0,0 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
-
-#pragma once
-
-#include "Engine/Graphics/GPUPipelineState.h"
-#include "GPUResourceOGL.h"
-
-#if GRAPHICS_API_OPENGL
-
-class GPUShaderProgramVSOGL;
-class GPUShaderProgramGSOGL;
-class GPUShaderProgramPSOGL;
-
-///
-/// Graphics pipeline state object for OpenGL.
-///
-class GPUPipelineStateOGL : public GPUResourceOGL
-{
-private:
-
- int32 _usedSRsMask;
-
-public:
-
- ///
- /// Initializes a new instance of the class.
- ///
- /// The graphics device.
- GPUPipelineStateOGL(GPUDeviceOGL* device);
-
- ///
- /// Finalizes an instance of the class.
- ///
- ~GPUPipelineStateOGL();
-
-public:
-
- bool EnableDepthWrite;
- bool DepthTestEnable;
- bool DepthClipEnable;
- ComparisonFunc DepthFunc;
- GPUShaderProgramVSOGL* VS;
- GPUShaderProgramGSOGL* GS;
- GPUShaderProgramPSOGL* PS;
- PrimitiveTopologyType PrimitiveTopologyType;
- bool Wireframe;
- CullMode CullMode;
- BlendingMode BlendMode;
-
- bool IsCreated = false;
- GLuint Program = 0;
- GLuint ProgramPipeline = 0;
-
-public:
-
- int32 GetSRsMask() const
- {
- return _usedSRsMask;
- }
-
- bool IsUsingSR(int32 slotIndex) const
- {
- return _usedSRsMask & (1 << slotIndex) != 0;
- }
-
-public:
-
- void OnBind();
-
-public:
-
- // [GPUResourceOGL]
- void ReleaseGPU() final override;
-
- // [GPUPipelineState]
- bool IsValid() const override;
- bool Init(const Description& desc) override;
-};
-
-#endif
diff --git a/Source/Engine/GraphicsDevice/OpenGL/GPUResourceOGL.h b/Source/Engine/GraphicsDevice/OpenGL/GPUResourceOGL.h
deleted file mode 100644
index 64136bb95..000000000
--- a/Source/Engine/GraphicsDevice/OpenGL/GPUResourceOGL.h
+++ /dev/null
@@ -1,103 +0,0 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
-
-#pragma once
-
-#include "Engine/Graphics/Config.h"
-
-#if GRAPHICS_API_OPENGL
-
-#include "Engine/Graphics/GPUResource.h"
-#include "Engine/Core/Log.h"
-#include "IncludeOpenGLHeaders.h"
-#include "GPUDeviceOGL.h"
-
-///
-/// Describes base implementation of Graphics Device resource for OpenGL (BaseType must be GPUResource or inherit from)
-///
-template
-class GPUResourceOGL : public BaseType
-{
-protected:
-
- GPUDeviceOGL* _device;
- uint64 _memoryUsage;
-
-private:
-
-#if GPU_ENABLE_RESOURCE_NAMING
- String _name;
-#endif
-
-protected:
-
- ///
- /// Init
- ///
- /// Graphics Device handle
- /// Resource name
- GPUResourceOGL(GPUDeviceOGL* device, const String& name)
- : _device(device)
- , _memoryUsage(0)
-#if GPU_ENABLE_RESOURCE_NAMING
- , _name(name)
-#endif
- {
- ASSERT(device);
-
- // Register
- device->Resources.Add(this);
- }
-
-public:
-
- ///
- /// Destructor
- ///
- virtual ~GPUResourceOGL()
- {
- // Unregister
- if (_device)
- _device->Resources.Remove(this);
-
- // Check if is still using any GPU memory
- if (_memoryUsage != 0)
- {
- LOG(Fatal, "GPU resource \'{0}\' has not been fully disposed.", GPUResource::ToString());
- }
- }
-
-public:
-
- ///
- /// Gets graphics device
- ///
- /// Device
- FORCE_INLINE GPUDeviceOGL* GetDevice() const
- {
- return _device;
- }
-
-public:
-
- // [GPUResource]
- uint64 GetMemoryUsage() const override
- {
- return _memoryUsage;
- }
-#if GPU_ENABLE_RESOURCE_NAMING
- String GetName() const override
- {
- return _name;
- }
-#endif
- void OnDeviceDispose() override
- {
- // Base
- GPUResource::OnDeviceDispose();
-
- // Unlink device handle
- _device = nullptr;
- }
-};
-
-#endif
diff --git a/Source/Engine/GraphicsDevice/OpenGL/GPUShaderOGL.cpp b/Source/Engine/GraphicsDevice/OpenGL/GPUShaderOGL.cpp
deleted file mode 100644
index 039ad3ce8..000000000
--- a/Source/Engine/GraphicsDevice/OpenGL/GPUShaderOGL.cpp
+++ /dev/null
@@ -1,258 +0,0 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
-
-#if GRAPHICS_API_OPENGL
-
-#include "GPUShaderOGL.h"
-#include "Engine/Core/Memory/Allocator.h"
-#include "Engine/Serialization/MemoryReadStream.h"
-#include "GPUConstantBufferOGL.h"
-#include "GPUShaderProgramOGL.h"
-#include "Engine/Graphics/GPULimitsOGL.h"
-#include
-
-GPUShaderOGL::GPUShaderOGL(GPUDeviceOGL* device, const String& name)
- : GPUResourceOGL(device, name)
-{
-}
-
-GPUShaderOGL::~GPUShaderOGL()
-{
-}
-
-void GPUShaderOGL::ReleaseGPU()
-{
- // Base
- GPUResourceOGL::ReleaseGPU();
-}
-
-static bool SupportsSeparateShaderObjects()
-{
- return ((GPULimitsOGL*)GPUDevice::Instance->Limits)->SupportsSeparateShaderObjects;
-}
-
-// Verify that an OpenGL program has linked successfully.
-static bool VerifyLinkedProgram(GLuint program)
-{
-#if BUILD_DEBUG || GPU_OGL_DEBUG_SHADERS
- GLint linkStatus = 0;
- glGetProgramiv(program, GL_LINK_STATUS, &linkStatus);
- if (linkStatus != GL_TRUE)
- {
- GLint logLength;
- char defaultLog[] = "No log";
- char* compileLog = defaultLog;
- glGetProgramiv(program, GL_INFO_LOG_LENGTH, &logLength);
- if (logLength > 1)
- {
- compileLog = (char*)Allocator::Allocate(logLength);
- glGetProgramInfoLog(program, logLength, NULL, compileLog);
- }
-
- LOG(Error, "Failed to link program. Compile log: \n{0}", compileLog);
-
- if (logLength > 1)
- {
- Allocator::Free(compileLog);
- }
-
- return false;
- }
-#endif
- return true;
-}
-
-// Verify that an OpenGL shader has compiled successfully.
-static bool VerifyCompiledShader(GLuint shader, const char* glslCode)
-{
-#if BUILD_DEBUG || GPU_OGL_DEBUG_SHADERS
- if (SupportsSeparateShaderObjects() && glIsProgram(shader))
- {
- bool const compiledOK = VerifyLinkedProgram(shader);
-#if GPU_OGL_DEBUG_SHADERS
- if (!compiledOK && glslCode)
- {
- LOG(Warning, "Shader: \n{0}", glslCode);
- }
-#endif
- return compiledOK;
- }
- else
- {
- GLint compileStatus;
- glGetShaderiv(shader, GL_COMPILE_STATUS, &compileStatus);
- if (compileStatus != GL_TRUE)
- {
- GLint logLength;
- char defaultLog[] = "No log";
- char* compileLog = defaultLog;
- glGetShaderiv(shader, GL_INFO_LOG_LENGTH, &logLength);
-#if PLATFORM_ANDROID
- if (LogLength == 0)
- {
- // Make it big anyway
-// There was a bug in android 2.2 where glGetShaderiv would return 0 even though there was a error message
- // https://code.google.com/p/android/issues/detail?id=9953
- LogLength = 4096;
- }
-#endif
- if (logLength > 1)
- {
- compileLog = (char*)Allocator::Allocate(logLength);
- glGetShaderInfoLog(shader, logLength, NULL, compileLog);
- }
-
-#if GPU_OGL_DEBUG_SHADERS
- if (glslCode)
- {
- LOG(Warning, "Shader: \n{0}", glslCode);
- }
-#endif
- LOG(Fatal, "Failed to compile shader. Compile log: \n{0}", compileLog);
-
- if (logLength > 1)
- {
- Allocator::Free(compileLog);
- }
- return false;
- }
- }
-#endif
- return true;
-}
-
-static bool VerifyProgramPipeline(GLuint Program)
-{
- bool result = true;
-
- // Don't try and validate SSOs here - the draw state matters to SSOs and it definitely can't be guaranteed to be valid at this stage
- if (SupportsSeparateShaderObjects())
- {
-#if GPU_OGL_DEBUG_SHADERS
- result = glIsProgramPipeline(Program) == GL_TRUE;
-#endif
- }
- else
- {
- result = VerifyLinkedProgram(Program);
- }
-
- return result;
-}
-
-bool GPUShaderOGL::Create(MemoryReadStream& stream)
-{
- ASSERT(_device);
-
- ReleaseGPU();
-
- // Version
- int32 version;
- stream.ReadInt32(&version);
- if (version != GPU_SHADER_CACHE_VERSION)
- {
- LOG(Warning, "Unsupported OpenGL shader version {0}.", version);
- return true;
- }
-
- Array cache;
- Array cache2;
-
- // Shaders count
- int32 shadersCount;
- stream.ReadInt32(&shadersCount);
- for (int32 i = 0; i < shadersCount; i++)
- {
- uint32 cacheSize;
- ShaderStage type = static_cast(stream.ReadByte());
- int32 permutationsCount = stream.ReadByte();
- ASSERT(Math::IsInRange(permutationsCount, 1, SHADER_PERMUTATIONS_MAX_COUNT));
-
- // Load shader name
- StringAnsi name;
- stream.ReadStringAnsi(&name, 11);
-
- for (int32 permutationIndex = 0; permutationIndex < permutationsCount; permutationIndex++)
- {
- // Load cache
- int32 cacheType;
- stream.ReadInt32(&cacheType);
- uint32 cacheOriginalSize;
- stream.ReadUint32(&cacheOriginalSize);
- stream.ReadUint32(&cacheSize);
- ASSERT(Math::IsInRange(cacheSize, 1, 1024 * 1024));
- cache.EnsureCapacity(cacheSize);
- stream.ReadBytes(cache.Get(), cacheSize);
-
- // Check if unpack the data
- byte* shaderBytes = cache.Get();
- if (cacheType == SHADER_DATA_FORMAT_RAW)
- {
- ASSERT(cacheOriginalSize == cacheSize);
- }
- else if (cacheType == SHADER_DATA_FORMAT_LZ4)
- {
- // Decompress LZ4 data
- cache2.EnsureCapacity(cacheOriginalSize);
- int32 res = LZ4_decompress_safe((const char*)cache.Get(), (char*)cache2.Get(), cacheSize, cacheOriginalSize);
- if (res <= 0)
- {
- LOG(Warning, "Failed to decompress OpenGL shader data. Result: {0}.", res);
- return true;
- }
- cacheSize = cacheOriginalSize;
- shaderBytes = cache2.Get();
- }
- else
- {
- LOG(Warning, "Unknown OpenGL shader data format.");
- return true;
- }
-
- // Create Flax shader object
- GPUShaderProgram* shader;
- switch (type)
- {
- case ShaderStage::Vertex: shader = New(_device, shaderBytes, cacheSize, stream, name); break;
- case ShaderStage::Hull: shader = New(_device, shaderBytes, cacheSize, stream, name); break;
- case ShaderStage::Domain: shader = New(_device, shaderBytes, cacheSize, stream, name); break;
- case ShaderStage::Geometry: shader = New(shaderBytes, cacheSize, stream, name); break;
- case ShaderStage::Pixel: shader = New(shaderBytes, cacheSize, stream, name); break;
- case ShaderStage::Compute: shader = New(shaderBytes, cacheSize, stream, name); break;
- default: return true;
- }
-
- // Add to collection
- _shaders.Add(shader, permutationIndex);
- }
- }
-
- // Constant Buffers
- byte constantBuffersCount = stream.ReadByte();
- byte maximumConstantBufferSlot = stream.ReadByte();
- if (constantBuffersCount > 0)
- {
- ASSERT(maximumConstantBufferSlot < MAX_CONSTANT_BUFFER_SLOTS);
-
- for (int32 i = 0; i < constantBuffersCount; i++)
- {
- // Load info
- byte slotIndex = stream.ReadByte();
- uint32 size;
- stream.ReadUint32(&size);
-
- // Create CB
-#if GPU_ENABLE_RESOURCE_NAMING
- String name = ToString() + TEXT(".CB") + i;
-#else
- String name;
-#endif
- auto cb = New(_device, name, size);
- ASSERT(_constantBuffers[slotIndex] == nullptr);
- _constantBuffers[slotIndex] = cb;
- }
- }
-
- return false;
-}
-
-#endif
diff --git a/Source/Engine/GraphicsDevice/OpenGL/GPUShaderOGL.h b/Source/Engine/GraphicsDevice/OpenGL/GPUShaderOGL.h
deleted file mode 100644
index bc74f2189..000000000
--- a/Source/Engine/GraphicsDevice/OpenGL/GPUShaderOGL.h
+++ /dev/null
@@ -1,39 +0,0 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
-
-#pragma once
-
-#if GRAPHICS_API_OPENGL
-
-#include "Engine/Graphics/Shaders/GPUShader.h"
-#include "GPUDeviceOGL.h"
-#include "GPUResourceOGL.h"
-
-///
-/// Shader for OpenGL
-///
-class GPUShaderOGL : public GPUResourceOGL
-{
-public:
-
- ///
- /// Initializes a new instance of the class.
- ///
- /// The device.
- /// The name.
- ShaderOGL(GPUDeviceOGL* device, const String& name);
-
- ///
- /// Destructor
- ///
- ~ShaderOGL();
-
-public:
-
- // [GPUResourceOGL]
- void ReleaseGPU() final override;
-
- // [GPUShader]
- bool Create(MemoryReadStream& stream) override;
-};
-
-#endif
diff --git a/Source/Engine/GraphicsDevice/OpenGL/GPUShaderProgramOGL.cpp b/Source/Engine/GraphicsDevice/OpenGL/GPUShaderProgramOGL.cpp
deleted file mode 100644
index aebeba13d..000000000
--- a/Source/Engine/GraphicsDevice/OpenGL/GPUShaderProgramOGL.cpp
+++ /dev/null
@@ -1,57 +0,0 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
-
-#include "GPUShaderProgramOGL.h"
-
-#if GRAPHICS_API_OPENGL
-
-#include "../RenderToolsOGL.h"
-#include "../GPUDeviceOGL.h"
-#include "../GPULimitsOGL.h"
-
-GPUShaderProgramVSOGL::GPUShaderProgramVSOGL(GPUDeviceOGL* device, byte* shaderBytes, uint32 shaderBytesSize, ReadStream& stream, const StringAnsi& name)
- : GPUShaderProgramOGL(GL_VERTEX_SHADER, shaderBytes, shaderBytesSize, stream, name)
- , _device(device)
-{
- // Temporary variables
- byte Type, Format, SemanticIndex, InputSlot, InputSlotClass;
- uint32 AlignedByteOffset, InstanceDataStepRate;
-
- // Load Input Layout (it may be empty)
- byte layoutSize;
- stream.ReadByte(&layoutSize);
- ASSERT(layoutSize <= VERTEX_SHADER_MAX_INPUT_ELEMENTS);
- Layout.SetSize(layoutSize);
- uint32 offset = 0;
- for (int32 a = 0; a < layoutSize; a++)
- {
- auto& e = Layout[a];
-
- // TODO: cleanup the old vertex input layout loading style to be more robust
-
- stream.ReadByte(&Type);
- stream.ReadByte(&SemanticIndex);
- stream.ReadByte(&Format);
- stream.ReadByte(&InputSlot);
- stream.ReadUint32(&AlignedByteOffset);
- stream.ReadByte(&InputSlotClass);
- stream.ReadUint32(&InstanceDataStepRate);
-
- e.BufferSlot = InputSlot;
- e.Format = (PixelFormat)Format;
- e.Size = PixelFormatExtensions::SizeInBytes(e.Format);
- e.InstanceDataStepRate = InstanceDataStepRate;
- e.InputIndex = SemanticIndex;
- e.TypeCount = PixelFormatExtensions::ComputeComponentsCount(e.Format);
- if (PixelFormatExtensions::IsBGRAOrder(e.Format))
- e.TypeCount = GL_BGRA;
- e.Normalized = PixelFormatExtensions::IsNormalized(e.Format) ? GL_TRUE : GL_FALSE;
- e.GlType = _device->GetLimits()->TextureFormats[(int32)e.Format].Type;
- e.IsInteger = e.GlType == GL_SHORT || e.GlType == GL_UNSIGNED_SHORT || e.GlType == GL_INT || e.GlType == GL_UNSIGNED_INT || e.GlType == GL_UNSIGNED_BYTE;
-
- // Items are always specified in a sequential order
- e.RelativeOffset = AlignedByteOffset == INPUT_LAYOUT_ELEMENT_ALIGN ? offset : AlignedByteOffset;
- offset = (e.RelativeOffset == 0 ? 0 : offset) + e.Size;
- }
-}
-
-#endif
diff --git a/Source/Engine/GraphicsDevice/OpenGL/GPUShaderProgramOGL.h b/Source/Engine/GraphicsDevice/OpenGL/GPUShaderProgramOGL.h
deleted file mode 100644
index b2001c849..000000000
--- a/Source/Engine/GraphicsDevice/OpenGL/GPUShaderProgramOGL.h
+++ /dev/null
@@ -1,282 +0,0 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
-
-#pragma once
-
-#include "Engine/Serialization/ReadStream.h"
-#include "Engine/Graphics/Shaders/GPUShaderProgram.h"
-#include "../RenderToolsOGL.h"
-#include "../GPUDeviceOGL.h"
-
-#if GRAPHICS_API_OPENGL
-
-///
-/// Shaders base class for OpenGL
-///
-template
-class GPUShaderProgramOGL : public BaseType
-{
-protected:
-
- GLuint _handle;
- GLenum _shaderType;
- Array _shader;
-#if GPU_OGL_KEEP_SHADER_SRC
- const char* ShaderSource = nullptr;
-#endif
-
-public:
-
- ///
- /// Init
- ///
- /// Type of the OpenGL shader
- /// Bytes with an compiled shader
- /// Size in bytes of the cached shader
- /// Stream with data to read
- /// Shader function name
- GPUShaderProgramOGL(GLenum shaderType, byte* shaderBytes, uint32 shaderBytesSize, ReadStream& stream, const StringAnsi& name)
- : _handle(0)
- , _shaderType(shaderType)
- {
- _name = name;
-
- // Cache shader source (it cannot be compiled on content loading thread) - because OpenGL sucks
- // TODO: use shared context and compile shaders on a content threads instead of main thread
- _shader.Set(shaderBytes, shaderBytesSize);
-
- // Load meta
- stream.ReadUint32(&_instructionsCount);
- stream.ReadUint32(&_usedCBsMask);
- stream.ReadUint32(&_usedSRsMask);
- stream.ReadUint32(&_usedUAsMask);
- }
-
- ///
- /// Destructor
- ///
- ~GPUShaderProgramOGL()
- {
-#if GPU_OGL_KEEP_SHADER_SRC
- Allocator::Free(ShaderSource);
-#endif
- if (_handle != 0)
- {
- glDeleteProgram(_handle);
- VALIDATE_OPENGL_RESULT();
- }
- }
-
-private:
-
- static GLuint glCreateGPUShaderProgram(GLenum type, const char* source)
- {
- const GLuint shader = glCreateShader(type);
- if (shader)
- {
- glShaderSource(shader, 1, &source, NULL);
- glCompileShader(shader);
- const GLuint program = glCreateProgram();
- if (program)
- {
- GLint compiled = GL_FALSE;
- glGetShaderiv(shader, GL_COMPILE_STATUS, &compiled);
- glProgramParameteri(program, GL_PROGRAM_SEPARABLE, GL_TRUE);
- if (compiled)
- {
- glAttachShader(program, shader);
- glLinkProgram(program);
- glDetachShader(program, shader);
- }
- }
- glDeleteShader(shader);
- return program;
- }
-
- return 0;
- }
-
-public:
-
- // Gets the OpenGL shader object handle. Performs compilation if shader has not been created yet.
- GLuint GetHandle()
- {
- if (_handle == 0)
- {
- // Compile the shader
- _handle = glCreateGPUShaderProgram(_shaderType, (const char*)_shader.Get());
- VALIDATE_OPENGL_RESULT();
-
- // Check the status and the messages
- {
- GLint linkCompileSuccess = 0;
- glGetProgramiv(_handle, GL_LINK_STATUS, &linkCompileSuccess);
- VALIDATE_OPENGL_RESULT();
-
- if (!linkCompileSuccess && _handle > 0)
- {
- GLint infologLength = 0;
- glGetProgramiv(_handle, GL_INFO_LOG_LENGTH, &infologLength);
- VALIDATE_OPENGL_RESULT();
-
- if (infologLength > 0)
- {
- GLint charsWritten = 0;
-
- Array infoLog;
- infoLog.Resize(infologLength);
- glGetProgramInfoLog(_handle, infologLength, &charsWritten, infoLog.Get());
- VALIDATE_OPENGL_RESULT();
-
- LOG(Warning, "Compile and linker info log:");
- LOG_STR(Warning, String(infoLog.Get()));
- }
- }
- }
-
-#if GPU_OGL_KEEP_SHADER_SRC
- ShaderSource = Allocator::Allocate(_shader.Count());
- Platform::MemoryCopy((void*)ShaderSource, (void*)_shader.Get(), _shader.Count() * sizeof(char));
-#endif
- // Cleanup source buffer
- _shader.Resize(0);
- }
-
- return _handle;
- }
-
-public:
-
- // [BaseType]
- uint32 GetBufferSize() const override
- {
- return 0;
- }
- void* GetBufferHandle() const override
- {
- return (void*)_handle;
- }
-};
-
-///
-/// Vertex Shader for OpenGL
-///
-class GPUShaderProgramVSOGL : public GPUShaderProgramOGL
-{
-public:
-
- struct LayoutElement
- {
- int32 BufferSlot;
- PixelFormat Format;
- int32 Size;
- int32 InstanceDataStepRate;
- int32 InputIndex;
- int32 RelativeOffset;
- int32 TypeCount;
- GLboolean Normalized;
- GLenum GlType;
- bool IsInteger;
- };
-
-private:
-
- GPUDeviceOGL* _device;
-
-public:
-
- ///
- /// Init
- ///
- /// The graphics device.
- /// Bytes with an compiled shader
- /// Size in bytes of the cached shader
- /// Stream with data to read
- /// Shader function name
- GPUShaderProgramVSOGL(GPUDeviceOGL* device, byte* shaderBytes, uint32 shaderBytesSize, ReadStream& stream, const StringAnsi& name);
-
- ///
- /// Destructor
- ///
- ~GPUShaderProgramVSOGL()
- {
- _device->VAOCache.OnObjectRelease(this);
- }
-
-public:
-
- Array> Layout;
-
-public:
-
- // [GPUShaderProgramOGL]
- void* GetInputLayout() const override
- {
- return (void*)nullptr;
- }
- byte GetInputLayoutSize() const override
- {
- return Layout.Count();
- }
-};
-
-///
-/// Geometry Shader for OpenGL
-///
-class GPUShaderProgramGSOGL : public GPUShaderProgramOGL
-{
-public:
-
- ///
- /// Init
- ///
- /// Bytes with an compiled shader
- /// Size in bytes of the cached shader
- /// Stream with data to read
- /// Shader function name
- GPUShaderProgramGSOGL(byte* shaderBytes, uint32 shaderBytesSize, ReadStream& stream, const StringAnsi& name)
- : GPUShaderProgramOGL(GL_GEOMETRY_SHADER, shaderBytes, shaderBytesSize, stream, name)
- {
- }
-};
-
-///
-/// Pixel Shader for OpenGL
-///
-class GPUShaderProgramPSOGL : public GPUShaderProgramOGL
-{
-public:
-
- ///
- /// Init
- ///
- /// Bytes with an compiled shader
- /// Size in bytes of the cached shader
- /// Stream with data to read
- /// Shader function name
- GPUShaderProgramPSOGL(byte* shaderBytes, uint32 shaderBytesSize, ReadStream& stream, const StringAnsi& name)
- : GPUShaderProgramOGL(GL_FRAGMENT_SHADER, shaderBytes, shaderBytesSize, stream, name)
- {
- }
-};
-
-///
-/// Compute Shader for OpenGL
-///
-class GPUShaderProgramCSOGL : public GPUShaderProgramOGL
-{
-public:
-
- ///
- /// Init
- ///
- /// Bytes with an compiled shader
- /// Size in bytes of the cached shader
- /// Stream with data to read
- /// Shader function name
- GPUShaderProgramCSOGL(byte* shaderBytes, uint32 shaderBytesSize, ReadStream& stream, const StringAnsi& name)
- : GPUShaderProgramOGL(GL_COMPUTE_SHADER, shaderBytes, shaderBytesSize, stream, name)
- {
- }
-};
-
-#endif
diff --git a/Source/Engine/GraphicsDevice/OpenGL/GPUSwapChainOGL.cpp b/Source/Engine/GraphicsDevice/OpenGL/GPUSwapChainOGL.cpp
deleted file mode 100644
index a751dbe60..000000000
--- a/Source/Engine/GraphicsDevice/OpenGL/GPUSwapChainOGL.cpp
+++ /dev/null
@@ -1,39 +0,0 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
-
-#include "GPUSwapChainOGL.h"
-
-#if GRAPHICS_API_OPENGL
-
-#include "Engine/Threading/Threading.h"
-#include "Engine/Platform/Window.h"
-#include "RenderToolsOGL.h"
-#if PLATFORM_WIN32
-#include "Win32/Win32GPUSwapChainOGL.h"
-#endif
-
-GPUSwapChainOGL* GPUSwapChainOGL::Create(GPUDeviceOGL* device, Window* parent, int32 width, int32 height, bool fullscreen)
-{
- // Create object
-#if PLATFORM_WIN32
- Win32GPUSwapChainOGL* result = Win32GPUSwapChainOGL::Create(device, parent);
-#else
-#Error "The current platform does not support OpenGL backend."
-#endif
-
- // Resize output
- result->Resize(width, height);
-
- // Check if enter fullscreen mode
- if (fullscreen)
- result->SetFullscreen(true);
-
- return result;
-}
-
-GPUSwapChainOGL::GPUSwapChainOGL(GPUDeviceOGL* device, Window* parent)
- : GPUResourceOGL(device, StringView::Empty)
-{
- setParent(parent);
-}
-
-#endif
diff --git a/Source/Engine/GraphicsDevice/OpenGL/GPUSwapChainOGL.h b/Source/Engine/GraphicsDevice/OpenGL/GPUSwapChainOGL.h
deleted file mode 100644
index 65303b3b5..000000000
--- a/Source/Engine/GraphicsDevice/OpenGL/GPUSwapChainOGL.h
+++ /dev/null
@@ -1,38 +0,0 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
-
-#pragma once
-
-#include "Engine/Graphics/GPUSwapChain.h"
-#include "GPUDeviceOGL.h"
-#include "GPUResourceOGL.h"
-#include "GPUTextureViewOGL.h"
-#include "IncludeOpenGLHeaders.h"
-
-#if GRAPHICS_API_OPENGL
-
-///
-/// Graphics Device rendering output for OpenGL
-///
-class GPUSwapChainOGL : public GPUResourceOGL
-{
-protected:
-
- GPUTextureViewOGL _backBufferHandle;
-
- GPUSwapChainOGL(GPUDeviceOGL* device, Window* parent);
-
-public:
-
- // Init
- static GPUSwapChainOGL* Create(GPUDeviceOGL* device, Window* parent, int32 width, int32 height, bool fullscreen);
-
-public:
-
- // [GPUSwapChain]
- GPUTextureView* GetBackBufferView() const override
- {
- return (GPUTextureView*)&_backBufferHandle;
- }
-};
-
-#endif
diff --git a/Source/Engine/GraphicsDevice/OpenGL/GPUTextureOGL.Handles.cpp b/Source/Engine/GraphicsDevice/OpenGL/GPUTextureOGL.Handles.cpp
deleted file mode 100644
index 85f2867b3..000000000
--- a/Source/Engine/GraphicsDevice/OpenGL/GPUTextureOGL.Handles.cpp
+++ /dev/null
@@ -1,94 +0,0 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
-
-#include "TextureOGL.h"
-
-#if GRAPHICS_API_OPENGL
-
-#include "RenderToolsOGL.h"
-#include "GPUDeviceOGL.h"
-#include "GPULimitsOGL.h"
-#include "Engine/Graphics/PixelFormatExtensions.h"
-
-void TextureOGL::initHandles()
-{
- // Cache properties
- bool useSRV = IsShaderResource();
- bool useDSV = IsDepthStencil();
- bool useRTV = IsRenderTarget();
- bool useUAV = IsUnorderedAccess();
- int32 arraySize = ArraySize();
- int32 mipLevels = MipLevels();
- bool isArray = arraySize > 1;
- bool isCubeMap = IsCubeMap();
- bool isMsaa = IsMultiSample();
- bool isVolume = IsVolume();
-
- // Create resource views
- if (useUAV)
- {
- _uav.InitAsFull(this, Format());
- }
- if (isVolume)
- {
- // Create handle for whole 3d texture
- _handleVolume.InitAsFull(this);
-
- // Init per slice views
- _handlesPerSlice.Resize(Depth(), false);
- if (_desc.HasPerSliceViews() && useRTV)
- {
- for (int32 sliceIndex = 0; sliceIndex < Depth(); sliceIndex++)
- {
- _handlesPerSlice[sliceIndex].InitAsView(this, Format(), GPUTextureViewOGL::ViewType::Texture2D, mipLevels, sliceIndex, 1);
- }
- }
- }
- else if (isArray)
- {
- // Resize handles
- _handlesPerSlice.Resize(ArraySize(), false);
-
- // Create per array slice handles
- for (int32 arrayIndex = 0; arrayIndex < arraySize; arrayIndex++)
- {
- _handlesPerSlice[arrayIndex].InitAsView(this, Format(), GPUTextureViewOGL::ViewType::Texture2D, mipLevels, arrayIndex, 1);
- }
-
- // Create whole array handle
- {
- if (isCubeMap)
- {
- _handleArray.InitAsView(this, Format(), GPUTextureViewOGL::ViewType::Texture2D_Array, mipLevels, 0, arraySize);
- }
- else
- {
- _handleArray.InitAsView(this, Format(), GPUTextureViewOGL::ViewType::TextureCube_Array, mipLevels, 0, arraySize);
- }
- }
- }
- else
- {
- // Create single handle for the whole texture
- _handlesPerSlice.Resize(1, false);
- _handlesPerSlice[0].InitAsFull(this);
- }
-
- // Init per mip map handles
- if (HasPerMipViews())
- {
- // Init handles
- _handlesPerMip.Resize(arraySize, false);
- for (int32 arrayIndex = 0; arrayIndex < arraySize; arrayIndex++)
- {
- auto& slice = _handlesPerMip[arrayIndex];
- slice.Resize(mipLevels, false);
-
- for (int32 mipIndex = 0; mipIndex < mipLevels; mipIndex++)
- {
- slice[mipIndex].InitAsView(this, Format(), GPUTextureViewOGL::ViewType::Texture2D, mipLevels, arrayIndex, 1, mipIndex);
- }
- }
- }
-}
-
-#endif
diff --git a/Source/Engine/GraphicsDevice/OpenGL/GPUTextureOGL.cpp b/Source/Engine/GraphicsDevice/OpenGL/GPUTextureOGL.cpp
deleted file mode 100644
index acd1621f9..000000000
--- a/Source/Engine/GraphicsDevice/OpenGL/GPUTextureOGL.cpp
+++ /dev/null
@@ -1,166 +0,0 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
-
-#include "TextureOGL.h"
-
-#if GRAPHICS_API_OPENGL
-
-#include "RenderToolsOGL.h"
-#include "GPUDeviceOGL.h"
-#include "GPULimitsOGL.h"
-#include "Engine/Threading/Threading.h"
-#include "Engine/Graphics/PixelFormatExtensions.h"
-
-TextureOGL::TextureOGL(GPUDeviceOGL* device, const String& name)
- : GPUResourceOGL(device, name)
-{
-}
-
-bool TextureOGL::init()
-{
- ASSERT(IsInMainThread());
-
- switch (_desc.Dimensions)
- {
- case TextureDimensions::Texture:
- {
- if (IsMultiSample())
- {
- Target = IsArray() ? GL_TEXTURE_2D_MULTISAMPLE_ARRAY : GL_TEXTURE_2D_MULTISAMPLE;
- }
- else
- {
- Target = IsArray() ? GL_TEXTURE_2D_ARRAY : GL_TEXTURE_2D;
- }
- }
- break;
- case TextureDimensions::CubeTexture:
- {
- Target = IsArray() ? GL_TEXTURE_CUBE_MAP_ARRAY : GL_TEXTURE_CUBE_MAP;
- }
- break;
- case TextureDimensions::VolumeTexture:
- {
- Target = GL_TEXTURE_3D;
- }
- break;
- }
-
- // Generate texture handle
- glGenTextures(1, &TextureID);
- VALIDATE_OPENGL_RESULT();
-
- // Set texture type
- glBindTexture(Target, TextureID);
- VALIDATE_OPENGL_RESULT();
-
- glTexParameteri(Target, GL_TEXTURE_MAX_LEVEL, _desc.MipLevels - 1);
- VALIDATE_OPENGL_RESULT();
-
- // Allocate internal buffer so that glTexSubImageXD can be used
- FormatGL = _device->GetLimits()->GetInternalTextureFormat(_desc.Format, _desc.Flags);
-
- // Init storage info
- switch (_desc.Dimensions)
- {
- case TextureDimensions::Texture:
- {
- if (IsMultiSample())
- {
- if (IsArray())
- {
- CRASH;
- //glTexStorage3DMultisample(Target, (GLsizei)_desc.MultiSampleLevel, FormatGL, _desc.Width, _desc.Height, _desc.ArraySize, GL_TRUE);
- }
- else
- {
- glTexStorage2DMultisample(Target, (GLsizei)_desc.MultiSampleLevel, FormatGL, _desc.Width, _desc.Height, GL_TRUE);
- }
- }
- else
- {
- if (IsArray())
- {
- glTexStorage3D(Target, _desc.MipLevels, FormatGL, _desc.Width, _desc.Height, _desc.ArraySize);
- }
- else
- {
- glTexStorage2D(Target, _desc.MipLevels, FormatGL, _desc.Width, _desc.Height);
- }
- }
- }
- break;
- case TextureDimensions::CubeTexture:
- {
- if (IsArray())
- {
- glTexStorage3D(Target, _desc.MipLevels, FormatGL, _desc.Width, _desc.Height, _desc.ArraySize);
- }
- else
- {
- glTexStorage2D(Target, _desc.MipLevels, FormatGL, _desc.Width, _desc.Height);
- }
- }
- break;
- case TextureDimensions::VolumeTexture:
- {
- glTexStorage3D(Target, _desc.MipLevels, FormatGL, _desc.Width, _desc.Height, _desc.Depth);
- }
- break;
- }
- VALIDATE_OPENGL_RESULT();
-
- // Update memory usage
- _memoryUsage = calculateMemoryUsage();
-
- // Initialize handles to the resource
- if (IsRegularTexture())
- {
- // 'Regular' texture is using only one handle (texture/cubemap)
- _handlesPerSlice.Resize(1, false);
- _handlesPerSlice[0].InitAsFull(this);
- }
- else
- {
- // Create all handles
- initHandles();
- }
-
- return false;
-}
-
-void TextureOGL::onResidentMipsChanged()
-{
- // TODO: change GL_TEXTURE_BASE_LEVEL and GL_TEXTURE_MAX_LEVEL to match D3D11 behaviour
-}
-
-void TextureOGL::release()
-{
- if (IsRenderTarget() || IsUnorderedAccess())
- _device->FBOCache.OnTextureRelease(this);
-
- // Release views
- _handlesPerMip.Resize(0, false);
- _handlesPerSlice.Resize(0, false);
- _handleArray.Release();
- _handleVolume.Release();
-
- // Release texture
- glDeleteTextures(1, &TextureID);
- VALIDATE_OPENGL_RESULT();
- TextureID = 0;
- Target = 0;
- FormatGL = 0;
- _memoryUsage = 0;
-
- // Base
- Texture::release();
-}
-
-bool TextureOGL::GetData(int32 arrayOrDepthSliceIndex, int32 mipMapIndex, TextureData::MipData& data, uint32 mipRowPitch)
-{
- MISSING_CODE("TextureOGL::GetData");
-
- return true;
-}
-
-#endif
diff --git a/Source/Engine/GraphicsDevice/OpenGL/GPUTextureOGL.h b/Source/Engine/GraphicsDevice/OpenGL/GPUTextureOGL.h
deleted file mode 100644
index e698655be..000000000
--- a/Source/Engine/GraphicsDevice/OpenGL/GPUTextureOGL.h
+++ /dev/null
@@ -1,88 +0,0 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
-
-#pragma once
-
-#include "Engine/Graphics/Textures/GPUTexture.h"
-#include "GPUDeviceOGL.h"
-#include "GPUResourceOGL.h"
-#include "GPUTextureViewOGL.h"
-
-#if GRAPHICS_API_OPENGL
-
-///
-/// Texture object for OpenGL
-///
-class GPUTextureOGL : public GPUResourceOGL
-{
-private:
-
- GPUTextureViewOGL _uav;
- GPUTextureViewOGL _handleArray;
- GPUTextureViewOGL _handleVolume;
- Array _handlesPerSlice; // [slice]
- Array> _handlesPerMip; // [slice][mip]
-
-public:
-
- ///
- /// Initializes a new instance of the class.
- ///
- /// The device.
- /// The name.
- GPUTextureOGL(GPUDeviceOGL* device, const String& name);
-
- ///
- /// Finalizes an instance of the class.
- ///
- ~GPUTextureOGL()
- {
- }
-
-public:
-
- GLuint TextureID = 0;
- GLenum Target = 0;
- GLenum FormatGL = 0;
-
- GPUTextureViewOGL* HandleUAV() const
- {
- ASSERT((GetDescription().Flags & GPUTextureFlags::UnorderedAccess) != 0);
- return (GPUTextureViewOGL*)&_uav;
- }
-
-private:
-
- void initHandles();
-
-public:
-
- // [GPUTexture]
- GPUTextureView* Handle(int32 arrayOrDepthIndex) const override
- {
- return (GPUTextureView*)&_handlesPerSlice[arrayOrDepthIndex];
- }
- GPUTextureView* Handle(int32 arrayOrDepthIndex, int32 mipMapIndex) const override
- {
- return (GPUTextureView*)&_handlesPerMip[arrayOrDepthIndex][mipMapIndex];
- }
- GPUTextureView* ViewArray() const override
- {
- ASSERT(ArraySize() > 1);
- return (GPUTextureView*)&_handleArray;
- }
- GPUTextureView* ViewVolume() const override
- {
- ASSERT(IsVolume());
- return (GPUTextureView*)&_handleVolume;
- }
- bool GetData(int32 arrayOrDepthSliceIndex, int32 mipMapIndex, TextureData::MipData& data, uint32 mipRowPitch) override;
-
-protected:
-
- // [GPUTexture]
- bool OnInit() override;
- void onResidentMipsChanged() override;
- void OnReleaseGPU() override;
-};
-
-#endif
diff --git a/Source/Engine/GraphicsDevice/OpenGL/GPUTextureViewOGL.cpp b/Source/Engine/GraphicsDevice/OpenGL/GPUTextureViewOGL.cpp
deleted file mode 100644
index 941082c26..000000000
--- a/Source/Engine/GraphicsDevice/OpenGL/GPUTextureViewOGL.cpp
+++ /dev/null
@@ -1,264 +0,0 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
-
-#include "GPUTextureViewOGL.h"
-
-#if GRAPHICS_API_OPENGL
-
-#include "TextureOGL.h"
-#include "GPUDeviceOGL.h"
-#include "GPULimitsOGL.h"
-#include "RenderToolsOGL.h"
-
-GPUTextureViewOGL::~GPUTextureViewOGL()
-{
- if (ViewID != 0)
- {
- glDeleteTextures(1, &ViewID);
- VALIDATE_OPENGL_RESULT();
- }
-}
-
-void GPUTextureViewOGL::InitAsBackbuffer(GPUResource* parent, PixelFormat format)
-{
- ASSERT(ViewID == 0);
-
- ViewTarget = 0;
- Texture = nullptr;
- IsFullView = true;
- MipLevels = 1;
- FirstArraySlice = 0;
- NumArraySlices = 1;
- MostDetailedMip = 0;
-
- Init(parent, format);
-}
-
-void GPUTextureViewOGL::InitAsFull(TextureOGL* parent)
-{
- InitAsFull(parent, parent->Format());
-}
-
-void GPUTextureViewOGL::InitAsFull(TextureOGL* parent, PixelFormat format)
-{
- ASSERT(ViewID == 0);
-
- ViewTarget = parent->Target;
- Texture = parent;
- IsFullView = true;
- MipLevels = parent->MipLevels();
- FirstArraySlice = 0;
- NumArraySlices = parent->ArraySize();
- MostDetailedMip = 0;
-
- Init(parent, format);
-}
-
-void GPUTextureViewOGL::InitAsView(TextureOGL* parent, PixelFormat format, ViewType type, int32 mipLevels, int32 firstArraySlice, int32 numArraySlices, int32 mostDetailedMipIndex)
-{
- ASSERT(ViewID == 0);
-
- switch (type)
- {
- case ViewType::Texture1D:
- ViewTarget = GL_TEXTURE_1D;
- break;
-
- case ViewType::Texture1D_Array:
- ViewTarget = GL_TEXTURE_1D_ARRAY;
- break;
-
- case ViewType::Texture2D:
- ViewTarget = parent->IsMultiSample() ? GL_TEXTURE_2D_MULTISAMPLE : GL_TEXTURE_2D;
- break;
-
- case ViewType::Texture2D_Array:
- ViewTarget = parent->IsMultiSample() ? GL_TEXTURE_2D_MULTISAMPLE_ARRAY : GL_TEXTURE_2D_ARRAY;
- break;
-
- case ViewType::Texture3D:
- ViewTarget = GL_TEXTURE_3D;
- break;
-
- case ViewType::TextureCube:
- ViewTarget = GL_TEXTURE_CUBE_MAP;
- break;
-
- case ViewType::TextureCube_Array:
- ViewTarget = GL_TEXTURE_CUBE_MAP_ARRAY;
- break;
- }
-
- glGenTextures(1, &ViewID);
- VALIDATE_OPENGL_RESULT();
-
- auto internalFormat = parent->GetDevice()->GetLimits()->GetInternalTextureFormat(format);
- glTextureView(ViewID, ViewTarget, parent->TextureID, internalFormat, mostDetailedMipIndex, mipLevels, firstArraySlice, numArraySlices);
- VALIDATE_OPENGL_RESULT();
-
- Texture = parent;
- IsFullView = false;
- MipLevels = mipLevels;
- FirstArraySlice = firstArraySlice;
- NumArraySlices = numArraySlices;
- MostDetailedMip = mostDetailedMipIndex;
-}
-
-void GPUTextureViewOGL::AttachToFramebuffer(GLenum attachmentPoint)
-{
- auto desc = GetTexture()->GetDescription();
- auto textureId = GetTexture()->TextureID;
- switch (desc.Dimensions)
- {
- case TextureDimensions::Texture:
- {
- if (desc.IsArray())
- {
- if (NumArraySlices == desc.ArraySize)
- {
- glFramebufferTexture(GL_DRAW_FRAMEBUFFER, attachmentPoint, textureId, MostDetailedMip);
- VALIDATE_OPENGL_RESULT();
- glFramebufferTexture(GL_READ_FRAMEBUFFER, attachmentPoint, textureId, MostDetailedMip);
- VALIDATE_OPENGL_RESULT();
- }
- else if (NumArraySlices == 1)
- {
- // Texture name must either be zero or the name of an existing 3D texture, 1D or 2D array texture,
- // cube map array texture, or multisample array texture.
- glFramebufferTextureLayer(GL_DRAW_FRAMEBUFFER, attachmentPoint, textureId, MostDetailedMip, FirstArraySlice);
- VALIDATE_OPENGL_RESULT();
- glFramebufferTextureLayer(GL_READ_FRAMEBUFFER, attachmentPoint, textureId, MostDetailedMip, FirstArraySlice);
- VALIDATE_OPENGL_RESULT();
- }
- else
- {
- LOG(Fatal, "Only one slice or the entire texture array can be attached to a framebuffer");
- }
- }
- else
- {
- glFramebufferTexture2D(GL_DRAW_FRAMEBUFFER, attachmentPoint, GetTexture()->Target, textureId, MostDetailedMip);
- VALIDATE_OPENGL_RESULT();
- glFramebufferTexture2D(GL_READ_FRAMEBUFFER, attachmentPoint, GetTexture()->Target, textureId, MostDetailedMip);
- VALIDATE_OPENGL_RESULT();
- }
- }
- break;
- case TextureDimensions::CubeTexture:
- {
- if (desc.IsArray())
- {
- // Every OpenGL API call that operates on cubemap array textures takes layer-faces, not array layers.
- // So the parameters that represent the Z component are layer-faces.
- if (NumArraySlices == desc.ArraySize)
- {
- // glFramebufferTexture() attaches the given mipmap levelas a layered image with the number of layers that the given texture has.
- glFramebufferTexture(GL_DRAW_FRAMEBUFFER, attachmentPoint, textureId, MostDetailedMip);
- VALIDATE_OPENGL_RESULT();
- glFramebufferTexture(GL_READ_FRAMEBUFFER, attachmentPoint, textureId, MostDetailedMip);
- VALIDATE_OPENGL_RESULT();
- }
- else if (NumArraySlices == 1)
- {
- // Texture name must either be zero or the name of an existing 3D texture, 1D or 2D array texture,
- // cube map array texture, or multisample array texture.
- glFramebufferTextureLayer(GL_DRAW_FRAMEBUFFER, attachmentPoint, textureId, MostDetailedMip, FirstArraySlice);
- VALIDATE_OPENGL_RESULT();
- glFramebufferTextureLayer(GL_READ_FRAMEBUFFER, attachmentPoint, textureId, MostDetailedMip, FirstArraySlice);
- VALIDATE_OPENGL_RESULT();
- }
- else
- {
- LOG(Fatal, "Only one slice or the entire cubemap array can be attached to a framebuffer");
- }
- }
- else
- {
- if (NumArraySlices == desc.ArraySize)
- {
- glFramebufferTexture(GL_DRAW_FRAMEBUFFER, attachmentPoint, textureId, MostDetailedMip);
- VALIDATE_OPENGL_RESULT();
- glFramebufferTexture(GL_READ_FRAMEBUFFER, attachmentPoint, textureId, MostDetailedMip);
- VALIDATE_OPENGL_RESULT();
- }
- else if (NumArraySlices == 1)
- {
- // Texture name must either be zero or the name of an existing 3D texture, 1D or 2D array texture,
- // cube map array texture, or multisample array texture.
- static const GLenum CubeMapFaces[6] =
- {
- GL_TEXTURE_CUBE_MAP_POSITIVE_X,
- GL_TEXTURE_CUBE_MAP_NEGATIVE_X,
- GL_TEXTURE_CUBE_MAP_POSITIVE_Y,
- GL_TEXTURE_CUBE_MAP_NEGATIVE_Y,
- GL_TEXTURE_CUBE_MAP_POSITIVE_Z,
- GL_TEXTURE_CUBE_MAP_NEGATIVE_Z
- };
- auto CubeMapFaceBindTarget = CubeMapFaces[FirstArraySlice];
-
- // For glFramebufferTexture2D, if texture is not zero, textarget must be one of GL_TEXTURE_2D, GL_TEXTURE_RECTANGLE,
-// GL_TEXTURE_CUBE_MAP_POSITIVE_X, GL_TEXTURE_CUBE_MAP_POSITIVE_Y, GL_TEXTURE_CUBE_MAP_POSITIVE_Z,
-// GL_TEXTURE_CUBE_MAP_NEGATIVE_X, GL_TEXTURE_CUBE_MAP_NEGATIVE_Y, GL_TEXTURE_CUBE_MAP_NEGATIVE_Z,
- // or GL_TEXTURE_2D_MULTISAMPLE.
- glFramebufferTexture2D(GL_DRAW_FRAMEBUFFER, attachmentPoint, textureId, CubeMapFaceBindTarget, MostDetailedMip);
- VALIDATE_OPENGL_RESULT();
- glFramebufferTexture2D(GL_READ_FRAMEBUFFER, attachmentPoint, textureId, CubeMapFaceBindTarget, MostDetailedMip);
- VALIDATE_OPENGL_RESULT();
- }
- else
- {
- LOG(Fatal, "Only one slice or the entire cubemap can be attached to a framebuffer");
- }
- }
- }
- break;
- case TextureDimensions::VolumeTexture:
- {
- if (NumArraySlices == desc.ArraySize)
- {
- glFramebufferTexture(GL_DRAW_FRAMEBUFFER, attachmentPoint, textureId, MostDetailedMip);
- VALIDATE_OPENGL_RESULT();
- glFramebufferTexture(GL_READ_FRAMEBUFFER, attachmentPoint, textureId, MostDetailedMip);
- VALIDATE_OPENGL_RESULT();
- }
- else if (NumArraySlices == 1)
- {
- glFramebufferTextureLayer(GL_DRAW_FRAMEBUFFER, attachmentPoint, textureId, MostDetailedMip, FirstArraySlice);
- VALIDATE_OPENGL_RESULT();
- glFramebufferTextureLayer(GL_READ_FRAMEBUFFER, attachmentPoint, textureId, MostDetailedMip, FirstArraySlice);
- VALIDATE_OPENGL_RESULT();
- }
- else
- {
- LOG(Fatal, "Only one slice or the entire 3D texture can be attached to a framebuffer");
- }
- }
- break;
- }
-}
-
-void GPUTextureViewOGL::Release()
-{
- if (ViewID != 0)
- {
- glDeleteTextures(1, &ViewID);
- VALIDATE_OPENGL_RESULT();
- ViewID = 0;
- }
- ViewTarget = 0;
-}
-
-void GPUTextureViewOGL::Bind(int32 slotIndex)
-{
- if (IsFullView)
- {
- glBindTexture(Texture->Target, Texture->TextureID);
- VALIDATE_OPENGL_RESULT();
- }
- else
- {
- // TODO: bind image with glBindImageTexture
- CRASH;
- }
-}
-
-#endif
diff --git a/Source/Engine/GraphicsDevice/OpenGL/GPUTextureViewOGL.h b/Source/Engine/GraphicsDevice/OpenGL/GPUTextureViewOGL.h
deleted file mode 100644
index dc736e1f3..000000000
--- a/Source/Engine/GraphicsDevice/OpenGL/GPUTextureViewOGL.h
+++ /dev/null
@@ -1,93 +0,0 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
-
-#pragma once
-
-#include "Engine/Graphics/GPUTextureView.h"
-#include "IncludeOpenGLHeaders.h"
-
-#if GRAPHICS_API_OPENGL
-
-#include "IShaderResourceOGL.h"
-
-class TextureOGL;
-
-///
-/// Render target handle for OpenGL
-///
-class GPUTextureViewOGL : public GPUTextureView, public IShaderResourceOGL
-{
-public:
-
- ///
- /// The OpenGL texture view target.
- ///
- GLuint ViewTarget;
-
- ///
- /// The OpenGL texture view target.
- ///
- GLuint ViewID;
-
-public:
-
- GPUTextureViewOGL()
- {
- ViewTarget = 0;
- ViewID = 0;
- Texture = nullptr;
- }
-
- ~GPUTextureViewOGL();
-
-public:
-
- TextureOGL* Texture;
- bool IsFullView;
- int32 MipLevels;
- int32 FirstArraySlice;
- int32 NumArraySlices;
- int32 MostDetailedMip;
-
-public:
-
- bool IsBackbuffer() const
- {
- // Render output backbuffers are used as a special case for rendering in OpenGL
- return IsFullView && Texture == nullptr;
- }
-
- TextureOGL* GetTexture() const
- {
- return Texture;
- }
-
- void InitAsBackbuffer(GPUResource* parent, PixelFormat format);
-
- void InitAsFull(TextureOGL* parent);
-
- void InitAsFull(TextureOGL* parent, PixelFormat format);
-
- enum class ViewType
- {
- Texture1D,
- Texture1D_Array,
- Texture2D,
- Texture2D_Array,
- Texture3D,
- TextureCube,
- TextureCube_Array,
- };
-
- void InitAsView(TextureOGL* parent, PixelFormat format, ViewType type, int32 mipLevels, int32 firstArraySlice, int32 numArraySlices, int32 mostDetailedMipIndex = 0);
-
- void AttachToFramebuffer(GLenum attachmentPoint);
-
- void Release();
-
-public:
-
- // [IShaderResourceOGL]
- void Bind(int32 slotIndex) override;
-};
-
-#endif
diff --git a/Source/Engine/GraphicsDevice/OpenGL/GPUTimerQueryOGL.cpp b/Source/Engine/GraphicsDevice/OpenGL/GPUTimerQueryOGL.cpp
deleted file mode 100644
index 741632a6c..000000000
--- a/Source/Engine/GraphicsDevice/OpenGL/GPUTimerQueryOGL.cpp
+++ /dev/null
@@ -1,98 +0,0 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
-
-#if GRAPHICS_API_OPENGL
-
-#include "GPUTimerQueryOGL.h"
-#include "RenderToolsOGL.h"
-
-GPUTimerQueryOGL::GPUTimerQueryOGL(GPUDeviceOGL* device)
- : GPUResourceOGL(device, String::Empty)
-{
- GLuint queries[2];
- glGenQueries(2, queries);
- VALIDATE_OPENGL_RESULT();
-
- _startQuery = queries[0];
- _endQuery = queries[1];
-
- // Set non-zero mem usage (fake)
- _memoryUsage = sizeof(queries);
-}
-
-GPUTimerQueryOGL::~GPUTimerQueryOGL()
-{
- ReleaseGPU();
-}
-
-void GPUTimerQueryOGL::ReleaseGPU()
-{
- if (_memoryUsage == 0)
- return;
-
- GLuint queries[2];
- queries[0] = _startQuery;
- queries[1] = _endQuery;
-
- glDeleteQueries(2, queries);
- VALIDATE_OPENGL_RESULT();
-
- _memoryUsage = 0;
-}
-
-void GPUTimerQueryOGL::Begin()
-{
- glQueryCounter(_startQuery, GL_TIMESTAMP);
- VALIDATE_OPENGL_RESULT();
-
- _endCalled = false;
-}
-
-void GPUTimerQueryOGL::End()
-{
- if (_endCalled)
- return;
-
- glQueryCounter(_endQuery, GL_TIMESTAMP);
- VALIDATE_OPENGL_RESULT();
-
- _endCalled = true;
- _finalized = false;
-}
-
-bool GPUTimerQueryOGL::HasResult()
-{
- if (!_endCalled)
- return false;
-
- GLint done = 0;
- glGetQueryObjectiv(_endQuery, GL_QUERY_RESULT_AVAILABLE, &done);
- VALIDATE_OPENGL_RESULT();
-
- return done == GL_TRUE;
-}
-
-float GPUTimerQueryOGL::GetResult()
-{
- if (!_finalized)
- {
-#if BUILD_DEBUG
- ASSERT(HasResult());
-#endif
-
- GLuint64 timeStart;
- GLuint64 timeEnd;
-
- glGetQueryObjectui64v(_startQuery, GL_QUERY_RESULT, &timeStart);
- VALIDATE_OPENGL_RESULT();
-
- glGetQueryObjectui64v(_endQuery, GL_QUERY_RESULT, &timeEnd);
- VALIDATE_OPENGL_RESULT();
-
- _timeDelta = (timeEnd - timeStart) / 1000000.0f;
-
- _finalized = true;
- }
- return _timeDelta;
-}
-
-#endif
diff --git a/Source/Engine/GraphicsDevice/OpenGL/GPUTimerQueryOGL.h b/Source/Engine/GraphicsDevice/OpenGL/GPUTimerQueryOGL.h
deleted file mode 100644
index 0d75b4c80..000000000
--- a/Source/Engine/GraphicsDevice/OpenGL/GPUTimerQueryOGL.h
+++ /dev/null
@@ -1,49 +0,0 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
-
-#pragma once
-
-#include "Engine/Graphics/GPUTimerQuery.h"
-#include "GPUResourceOGL.h"
-
-#if GRAPHICS_API_OPENGL
-
-///
-/// GPU timer query object for OpenGL
-///
-class GPUTimerQueryOGL : public GPUResourceOGL
-{
-private:
-
- bool _finalized = false;
- bool _endCalled = false;
- float _timeDelta = 0.0f;
-
- GLuint _startQuery;
- GLuint _endQuery;
-
-public:
-
- ///
- /// Initializes a new instance of the class.
- ///
- /// The graphics device.
- GPUTimerQueryOGL(GPUDeviceOGL* device);
-
- ///
- /// Finalizes an instance of the class.
- ///
- ~GPUTimerQueryOGL();
-
-public:
-
- // [GPUResourceOGL]
- void ReleaseGPU() final override;
-
- // [GPUTimerQuery]
- void Begin() override;
- void End() override;
- bool HasResult() override;
- float GetResult() override;
-};
-
-#endif
diff --git a/Source/Engine/GraphicsDevice/OpenGL/GraphicsDeviceOGL.Build.cs b/Source/Engine/GraphicsDevice/OpenGL/GraphicsDeviceOGL.Build.cs
deleted file mode 100644
index 3e01b9dfd..000000000
--- a/Source/Engine/GraphicsDevice/OpenGL/GraphicsDeviceOGL.Build.cs
+++ /dev/null
@@ -1,18 +0,0 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
-
-using Flax.Build.NativeCpp;
-
-///
-/// OpenGL graphics backend module.
-///
-public class GraphicsDeviceOGL : GraphicsDeviceBaseModule
-{
- ///
- public override void Setup(BuildOptions options)
- {
- base.Setup(options);
-
- options.PublicDefinitions.Add("GRAPHICS_API_OPENGL");
- //options.PublicDefinitions.Add("GRAPHICS_API_OPENGLES");
- }
-}
diff --git a/Source/Engine/GraphicsDevice/OpenGL/IShaderResourceOGL.h b/Source/Engine/GraphicsDevice/OpenGL/IShaderResourceOGL.h
deleted file mode 100644
index a8721e91f..000000000
--- a/Source/Engine/GraphicsDevice/OpenGL/IShaderResourceOGL.h
+++ /dev/null
@@ -1,12 +0,0 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
-
-#pragma once
-
-#include "Engine/Core/Types/BaseTypes.h"
-
-class IShaderResourceOGL
-{
-public:
-
- virtual void Bind(int32 slotIndex) = 0;
-};
diff --git a/Source/Engine/GraphicsDevice/OpenGL/IncludeOpenGLHeaders.h b/Source/Engine/GraphicsDevice/OpenGL/IncludeOpenGLHeaders.h
deleted file mode 100644
index 105cf00b5..000000000
--- a/Source/Engine/GraphicsDevice/OpenGL/IncludeOpenGLHeaders.h
+++ /dev/null
@@ -1,415 +0,0 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
-
-#pragma once
-
-#include "Config.h"
-
-#if GRAPHICS_API_OPENGL
-
-#if PLATFORM_WINDOWS
-#include "Engine/Platform/Windows/IncludeWindowsHeaders.h"
-#include "Engine/Platform/Windows/ComPtr.h"
-
-#include
-#include
-#include
-#include
-
-#pragma comment(lib, "opengl32.lib")
-
-// List all OpenGL entry points used by Flax that must be loaded from opengl32.dll
-#define ENUM_GL_ENTRYPOINTS_DLL(EnumMacro) \
- EnumMacro(PFNGLBINDTEXTUREPROC,glBindTexture) \
- EnumMacro(PFNGLBLENDFUNCPROC,glBlendFunc) \
- EnumMacro(PFNGLCOLORMASKPROC,glColorMask) \
- EnumMacro(PFNGLCOPYTEXIMAGE1DPROC,glCopyTexImage1D) \
- EnumMacro(PFNGLCOPYTEXIMAGE2DPROC,glCopyTexImage2D) \
- EnumMacro(PFNGLCOPYTEXSUBIMAGE1DPROC,glCopyTexSubImage1D) \
- EnumMacro(PFNGLCOPYTEXSUBIMAGE2DPROC,glCopyTexSubImage2D) \
- EnumMacro(PFNGLCULLFACEPROC,glCullFace) \
- EnumMacro(PFNGLDELETETEXTURESPROC,glDeleteTextures) \
- EnumMacro(PFNGLDEPTHFUNCPROC,glDepthFunc) \
- EnumMacro(PFNGLDEPTHMASKPROC,glDepthMask) \
- EnumMacro(PFNGLDEPTHRANGEPROC,glDepthRange) \
- EnumMacro(PFNGLDISABLEPROC,glDisable) \
- EnumMacro(PFNGLDRAWARRAYSPROC,glDrawArrays) \
- EnumMacro(PFNGLDRAWBUFFERPROC,glDrawBuffer) \
- EnumMacro(PFNGLDRAWELEMENTSPROC,glDrawElements) \
- EnumMacro(PFNGLENABLEPROC,glEnable) \
- EnumMacro(PFNGLFINISHPROC,glFinish) \
- EnumMacro(PFNGLFLUSHPROC,glFlush) \
- EnumMacro(PFNGLFRONTFACEPROC,glFrontFace) \
- EnumMacro(PFNGLGENTEXTURESPROC,glGenTextures) \
- EnumMacro(PFNGLGETBOOLEANVPROC,glGetBooleanv) \
- EnumMacro(PFNGLGETDOUBLEVPROC,glGetDoublev) \
- EnumMacro(PFNGLGETERRORPROC,glGetError) \
- EnumMacro(PFNGLGETFLOATVPROC,glGetFloatv) \
- EnumMacro(PFNGLGETINTEGERVPROC,glGetIntegerv) \
- EnumMacro(PFNGLGETPOINTERVPROC,glGetPointerv) \
- EnumMacro(PFNGLGETSTRINGPROC,glGetString) \
- EnumMacro(PFNGLGETTEXIMAGEPROC,glGetTexImage) \
- EnumMacro(PFNGLGETTEXLEVELPARAMETERFVPROC,glGetTexLevelParameterfv) \
- EnumMacro(PFNGLGETTEXLEVELPARAMETERIVPROC,glGetTexLevelParameteriv) \
- EnumMacro(PFNGLGETTEXPARAMETERFVPROC,glGetTexParameterfv) \
- EnumMacro(PFNGLGETTEXPARAMETERIVPROC,glGetTexParameteriv) \
- EnumMacro(PFNGLHINTPROC,glHint) \
- EnumMacro(PFNGLISENABLEDPROC,glIsEnabled) \
- EnumMacro(PFNGLISTEXTUREPROC,glIsTexture) \
- EnumMacro(PFNGLLINEWIDTHPROC,glLineWidth) \
- EnumMacro(PFNGLLOGICOPPROC,glLogicOp) \
- EnumMacro(PFNGLPIXELSTOREFPROC,glPixelStoref) \
- EnumMacro(PFNGLPIXELSTOREIPROC,glPixelStorei) \
- EnumMacro(PFNGLPOINTSIZEPROC,glPointSize) \
- EnumMacro(PFNGLPOLYGONMODEPROC,glPolygonMode) \
- EnumMacro(PFNGLPOLYGONOFFSETPROC,glPolygonOffset) \
- EnumMacro(PFNGLREADBUFFERPROC,glReadBuffer) \
- EnumMacro(PFNGLREADPIXELSPROC,glReadPixels) \
- EnumMacro(PFNGLSCISSORPROC,glScissor) \
- EnumMacro(PFNGLCLEARDEPTHPROC,glClearDepth) \
- EnumMacro(PFNGLCLEARCOLORPROC,glClearColor) \
- EnumMacro(PFNGLCLEARSTENCILPROC,glClearStencil) \
- EnumMacro(PFNGLCLEARPROC,glClear) \
- EnumMacro(PFNGLSTENCILFUNCPROC,glStencilFunc) \
- EnumMacro(PFNGLSTENCILMASKPROC,glStencilMask) \
- EnumMacro(PFNGLSTENCILOPPROC,glStencilOp) \
- EnumMacro(PFNGLTEXIMAGE1DPROC,glTexImage1D) \
- EnumMacro(PFNGLTEXIMAGE2DPROC,glTexImage2D) \
- EnumMacro(PFNGLTEXPARAMETERFPROC,glTexParameterf) \
- EnumMacro(PFNGLTEXPARAMETERFVPROC,glTexParameterfv) \
- EnumMacro(PFNGLTEXPARAMETERIPROC,glTexParameteri) \
- EnumMacro(PFNGLTEXPARAMETERIVPROC,glTexParameteriv) \
- EnumMacro(PFNGLTEXSUBIMAGE1DPROC,glTexSubImage1D) \
- EnumMacro(PFNGLTEXSUBIMAGE2DPROC,glTexSubImage2D) \
- EnumMacro(PFNGLVIEWPORTPROC,glViewport)
-
-// List all OpenGL entry points used by Flax
-#define ENUM_GL_ENTRYPOINTS(EnumMacro) \
- EnumMacro(PFNGLBINDSAMPLERPROC,glBindSampler) \
- EnumMacro(PFNGLDELETESAMPLERSPROC,glDeleteSamplers) \
- EnumMacro(PFNGLGENSAMPLERSPROC,glGenSamplers) \
- EnumMacro(PFNGLSAMPLERPARAMETERIPROC,glSamplerParameteri) \
- EnumMacro(PFNGLCLEARBUFFERFVPROC,glClearBufferfv) \
- EnumMacro(PFNGLCLEARBUFFERIVPROC,glClearBufferiv) \
- EnumMacro(PFNGLCLEARBUFFERUIVPROC,glClearBufferuiv) \
- EnumMacro(PFNGLCLEARBUFFERFIPROC,glClearBufferfi) \
- EnumMacro(PFNGLCOLORMASKIPROC,glColorMaski) \
- EnumMacro(PFNGLDISABLEIPROC,glDisablei) \
- EnumMacro(PFNGLENABLEIPROC,glEnablei) \
- EnumMacro(PFNGLGETBOOLEANI_VPROC,glGetBooleani_v) \
- EnumMacro(PFNGLGETINTEGERI_VPROC,glGetIntegeri_v) \
- EnumMacro(PFNGLISENABLEDIPROC,glIsEnabledi) \
- EnumMacro(PFNGLBLENDCOLORPROC,glBlendColor) \
- EnumMacro(PFNGLBLENDEQUATIONPROC,glBlendEquation) \
- EnumMacro(PFNGLDRAWRANGEELEMENTSPROC,glDrawRangeElements) \
- EnumMacro(PFNGLTEXIMAGE3DPROC,glTexImage3D) \
- EnumMacro(PFNGLTEXSUBIMAGE3DPROC,glTexSubImage3D) \
- EnumMacro(PFNGLCOPYTEXSUBIMAGE3DPROC,glCopyTexSubImage3D) \
- EnumMacro(PFNGLACTIVETEXTUREPROC,glActiveTexture) \
- EnumMacro(PFNGLSAMPLECOVERAGEPROC,glSampleCoverage) \
- EnumMacro(PFNGLCOMPRESSEDTEXIMAGE3DPROC,glCompressedTexImage3D) \
- EnumMacro(PFNGLCOMPRESSEDTEXIMAGE2DPROC,glCompressedTexImage2D) \
- EnumMacro(PFNGLCOMPRESSEDTEXIMAGE1DPROC,glCompressedTexImage1D) \
- EnumMacro(PFNGLCOMPRESSEDTEXSUBIMAGE3DPROC,glCompressedTexSubImage3D) \
- EnumMacro(PFNGLCOMPRESSEDTEXSUBIMAGE2DPROC,glCompressedTexSubImage2D) \
- EnumMacro(PFNGLCOMPRESSEDTEXSUBIMAGE1DPROC,glCompressedTexSubImage1D) \
- EnumMacro(PFNGLGETCOMPRESSEDTEXIMAGEPROC,glGetCompressedTexImage) \
- EnumMacro(PFNGLBLENDFUNCSEPARATEPROC,glBlendFuncSeparate) \
- EnumMacro(PFNGLMULTIDRAWARRAYSPROC,glMultiDrawArrays) \
- EnumMacro(PFNGLMULTIDRAWELEMENTSPROC,glMultiDrawElements) \
- EnumMacro(PFNGLPOINTPARAMETERFPROC,glPointParameterf) \
- EnumMacro(PFNGLPOINTPARAMETERFVPROC,glPointParameterfv) \
- EnumMacro(PFNGLPOINTPARAMETERIPROC,glPointParameteri) \
- EnumMacro(PFNGLPOINTPARAMETERIVPROC,glPointParameteriv) \
- EnumMacro(PFNGLGENQUERIESPROC,glGenQueries) \
- EnumMacro(PFNGLDELETEQUERIESPROC,glDeleteQueries) \
- EnumMacro(PFNGLISQUERYPROC,glIsQuery) \
- EnumMacro(PFNGLBEGINQUERYPROC,glBeginQuery) \
- EnumMacro(PFNGLENDQUERYPROC,glEndQuery) \
- EnumMacro(PFNGLGETQUERYIVPROC,glGetQueryiv) \
- EnumMacro(PFNGLGETQUERYOBJECTIVPROC,glGetQueryObjectiv) \
- EnumMacro(PFNGLGETQUERYOBJECTUIVPROC,glGetQueryObjectuiv) \
- EnumMacro(PFNGLBINDBUFFERPROC,glBindBuffer) \
- EnumMacro(PFNGLBINDBUFFERBASEPROC,glBindBufferBase) \
- EnumMacro(PFNGLDELETEBUFFERSPROC,glDeleteBuffers) \
- EnumMacro(PFNGLGENBUFFERSPROC,glGenBuffers) \
- EnumMacro(PFNGLISBUFFERPROC,glIsBuffer) \
- EnumMacro(PFNGLBUFFERDATAPROC,glBufferData) \
- EnumMacro(PFNGLBUFFERSUBDATAPROC,glBufferSubData) \
- EnumMacro(PFNGLGETBUFFERSUBDATAPROC,glGetBufferSubData) \
- EnumMacro(PFNGLMAPBUFFERPROC,glMapBuffer) \
- EnumMacro(PFNGLUNMAPBUFFERPROC,glUnmapBuffer) \
- EnumMacro(PFNGLGETBUFFERPARAMETERIVPROC,glGetBufferParameteriv) \
- EnumMacro(PFNGLGETBUFFERPOINTERVPROC,glGetBufferPointerv) \
- EnumMacro(PFNGLBLENDEQUATIONSEPARATEPROC,glBlendEquationSeparate) \
- EnumMacro(PFNGLDRAWBUFFERSPROC,glDrawBuffers) \
- EnumMacro(PFNGLSTENCILOPSEPARATEPROC,glStencilOpSeparate) \
- EnumMacro(PFNGLSTENCILFUNCSEPARATEPROC,glStencilFuncSeparate) \
- EnumMacro(PFNGLSTENCILMASKSEPARATEPROC,glStencilMaskSeparate) \
- EnumMacro(PFNGLATTACHSHADERPROC,glAttachShader) \
- EnumMacro(PFNGLBINDATTRIBLOCATIONPROC,glBindAttribLocation) \
- EnumMacro(PFNGLBINDFRAGDATALOCATIONPROC,glBindFragDataLocation) \
- EnumMacro(PFNGLCOMPILESHADERPROC,glCompileShader) \
- EnumMacro(PFNGLCREATEPROGRAMPROC,glCreateProgram) \
- EnumMacro(PFNGLCREATESHADERPROC,glCreateShader) \
- EnumMacro(PFNGLDELETEPROGRAMPROC,glDeleteProgram) \
- EnumMacro(PFNGLDELETESHADERPROC,glDeleteShader) \
- EnumMacro(PFNGLDETACHSHADERPROC,glDetachShader) \
- EnumMacro(PFNGLDISABLEVERTEXATTRIBARRAYPROC,glDisableVertexAttribArray) \
- EnumMacro(PFNGLENABLEVERTEXATTRIBARRAYPROC,glEnableVertexAttribArray) \
- EnumMacro(PFNGLGETACTIVEATTRIBPROC,glGetActiveAttrib) \
- EnumMacro(PFNGLGETACTIVEUNIFORMPROC,glGetActiveUniform) \
- EnumMacro(PFNGLGETATTACHEDSHADERSPROC,glGetAttachedShaders) \
- EnumMacro(PFNGLGETATTRIBLOCATIONPROC,glGetAttribLocation) \
- EnumMacro(PFNGLGETPROGRAMIVPROC,glGetProgramiv) \
- EnumMacro(PFNGLGETPROGRAMINFOLOGPROC,glGetProgramInfoLog) \
- EnumMacro(PFNGLGETSHADERIVPROC,glGetShaderiv) \
- EnumMacro(PFNGLGETSHADERINFOLOGPROC,glGetShaderInfoLog) \
- EnumMacro(PFNGLGETSHADERSOURCEPROC,glGetShaderSource) \
- EnumMacro(PFNGLGETUNIFORMLOCATIONPROC,glGetUniformLocation) \
- EnumMacro(PFNGLGETUNIFORMBLOCKINDEXPROC,glGetUniformBlockIndex) \
- EnumMacro(PFNGLGETUNIFORMFVPROC,glGetUniformfv) \
- EnumMacro(PFNGLGETUNIFORMIVPROC,glGetUniformiv) \
- EnumMacro(PFNGLGETVERTEXATTRIBDVPROC,glGetVertexAttribdv) \
- EnumMacro(PFNGLGETVERTEXATTRIBFVPROC,glGetVertexAttribfv) \
- EnumMacro(PFNGLGETVERTEXATTRIBIVPROC,glGetVertexAttribiv) \
- EnumMacro(PFNGLGETVERTEXATTRIBPOINTERVPROC,glGetVertexAttribPointerv) \
- EnumMacro(PFNGLISPROGRAMPROC,glIsProgram) \
- EnumMacro(PFNGLISSHADERPROC,glIsShader) \
- EnumMacro(PFNGLLINKPROGRAMPROC,glLinkProgram) \
- EnumMacro(PFNGLSHADERSOURCEPROC,glShaderSource) \
- EnumMacro(PFNGLUSEPROGRAMPROC,glUseProgram) \
- EnumMacro(PFNGLUNIFORM1FPROC,glUniform1f) \
- EnumMacro(PFNGLUNIFORM2FPROC,glUniform2f) \
- EnumMacro(PFNGLUNIFORM3FPROC,glUniform3f) \
- EnumMacro(PFNGLUNIFORM4FPROC,glUniform4f) \
- EnumMacro(PFNGLUNIFORM1IPROC,glUniform1i) \
- EnumMacro(PFNGLUNIFORM2IPROC,glUniform2i) \
- EnumMacro(PFNGLUNIFORM3IPROC,glUniform3i) \
- EnumMacro(PFNGLUNIFORM4IPROC,glUniform4i) \
- EnumMacro(PFNGLUNIFORM1FVPROC,glUniform1fv) \
- EnumMacro(PFNGLUNIFORM2FVPROC,glUniform2fv) \
- EnumMacro(PFNGLUNIFORM3FVPROC,glUniform3fv) \
- EnumMacro(PFNGLUNIFORM4FVPROC,glUniform4fv) \
- EnumMacro(PFNGLUNIFORM1IVPROC,glUniform1iv) \
- EnumMacro(PFNGLUNIFORM2IVPROC,glUniform2iv) \
- EnumMacro(PFNGLUNIFORM3IVPROC,glUniform3iv) \
- EnumMacro(PFNGLUNIFORM4IVPROC,glUniform4iv) \
- EnumMacro(PFNGLUNIFORM1UIVPROC,glUniform1uiv) \
- EnumMacro(PFNGLUNIFORM2UIVPROC,glUniform2uiv) \
- EnumMacro(PFNGLUNIFORM3UIVPROC,glUniform3uiv) \
- EnumMacro(PFNGLUNIFORM4UIVPROC,glUniform4uiv) \
- EnumMacro(PFNGLUNIFORMBLOCKBINDINGPROC,glUniformBlockBinding) \
- EnumMacro(PFNGLUNIFORMMATRIX2FVPROC,glUniformMatrix2fv) \
- EnumMacro(PFNGLUNIFORMMATRIX3FVPROC,glUniformMatrix3fv) \
- EnumMacro(PFNGLUNIFORMMATRIX4FVPROC,glUniformMatrix4fv) \
- EnumMacro(PFNGLVALIDATEPROGRAMPROC,glValidateProgram) \
- EnumMacro(PFNGLVERTEXATTRIB1DPROC,glVertexAttrib1d) \
- EnumMacro(PFNGLVERTEXATTRIB1DVPROC,glVertexAttrib1dv) \
- EnumMacro(PFNGLVERTEXATTRIB1FPROC,glVertexAttrib1f) \
- EnumMacro(PFNGLVERTEXATTRIB1FVPROC,glVertexAttrib1fv) \
- EnumMacro(PFNGLVERTEXATTRIB1SPROC,glVertexAttrib1s) \
- EnumMacro(PFNGLVERTEXATTRIB1SVPROC,glVertexAttrib1sv) \
- EnumMacro(PFNGLVERTEXATTRIB2DPROC,glVertexAttrib2d) \
- EnumMacro(PFNGLVERTEXATTRIB2DVPROC,glVertexAttrib2dv) \
- EnumMacro(PFNGLVERTEXATTRIB2FPROC,glVertexAttrib2f) \
- EnumMacro(PFNGLVERTEXATTRIB2FVPROC,glVertexAttrib2fv) \
- EnumMacro(PFNGLVERTEXATTRIB2SPROC,glVertexAttrib2s) \
- EnumMacro(PFNGLVERTEXATTRIB2SVPROC,glVertexAttrib2sv) \
- EnumMacro(PFNGLVERTEXATTRIB3DPROC,glVertexAttrib3d) \
- EnumMacro(PFNGLVERTEXATTRIB3DVPROC,glVertexAttrib3dv) \
- EnumMacro(PFNGLVERTEXATTRIB3FPROC,glVertexAttrib3f) \
- EnumMacro(PFNGLVERTEXATTRIB3FVPROC,glVertexAttrib3fv) \
- EnumMacro(PFNGLVERTEXATTRIB3SPROC,glVertexAttrib3s) \
- EnumMacro(PFNGLVERTEXATTRIB3SVPROC,glVertexAttrib3sv) \
- EnumMacro(PFNGLVERTEXATTRIB4NBVPROC,glVertexAttrib4Nbv) \
- EnumMacro(PFNGLVERTEXATTRIB4NIVPROC,glVertexAttrib4Niv) \
- EnumMacro(PFNGLVERTEXATTRIB4NSVPROC,glVertexAttrib4Nsv) \
- EnumMacro(PFNGLVERTEXATTRIB4NUBPROC,glVertexAttrib4Nub) \
- EnumMacro(PFNGLVERTEXATTRIB4NUBVPROC,glVertexAttrib4Nubv) \
- EnumMacro(PFNGLVERTEXATTRIB4NUIVPROC,glVertexAttrib4Nuiv) \
- EnumMacro(PFNGLVERTEXATTRIB4NUSVPROC,glVertexAttrib4Nusv) \
- EnumMacro(PFNGLVERTEXATTRIB4BVPROC,glVertexAttrib4bv) \
- EnumMacro(PFNGLVERTEXATTRIB4DPROC,glVertexAttrib4d) \
- EnumMacro(PFNGLVERTEXATTRIB4DVPROC,glVertexAttrib4dv) \
- EnumMacro(PFNGLVERTEXATTRIB4FPROC,glVertexAttrib4f) \
- EnumMacro(PFNGLVERTEXATTRIB4FVPROC,glVertexAttrib4fv) \
- EnumMacro(PFNGLVERTEXATTRIB4IVPROC,glVertexAttrib4iv) \
- EnumMacro(PFNGLVERTEXATTRIB4SPROC,glVertexAttrib4s) \
- EnumMacro(PFNGLVERTEXATTRIB4SVPROC,glVertexAttrib4sv) \
- EnumMacro(PFNGLVERTEXATTRIB4UBVPROC,glVertexAttrib4ubv) \
- EnumMacro(PFNGLVERTEXATTRIB4UIVPROC,glVertexAttrib4uiv) \
- EnumMacro(PFNGLVERTEXATTRIB4USVPROC,glVertexAttrib4usv) \
- EnumMacro(PFNGLVERTEXATTRIBI4IVPROC,glVertexAttribI4iv) \
- EnumMacro(PFNGLVERTEXATTRIBI4UIVPROC,glVertexAttribI4uiv) \
- EnumMacro(PFNGLVERTEXATTRIBI4SVPROC,glVertexAttribI4sv) \
- EnumMacro(PFNGLVERTEXATTRIBI4USVPROC,glVertexAttribI4usv) \
- EnumMacro(PFNGLVERTEXATTRIBI4BVPROC,glVertexAttribI4bv) \
- EnumMacro(PFNGLVERTEXATTRIBI4UBVPROC,glVertexAttribI4ubv) \
- EnumMacro(PFNGLVERTEXATTRIBPOINTERPROC,glVertexAttribPointer) \
- EnumMacro(PFNGLVERTEXATTRIBIPOINTERPROC,glVertexAttribIPointer) \
- EnumMacro(PFNGLUNIFORMMATRIX2X3FVPROC,glUniformMatrix2x3fv) \
- EnumMacro(PFNGLUNIFORMMATRIX3X2FVPROC,glUniformMatrix3x2fv) \
- EnumMacro(PFNGLUNIFORMMATRIX2X4FVPROC,glUniformMatrix2x4fv) \
- EnumMacro(PFNGLUNIFORMMATRIX4X2FVPROC,glUniformMatrix4x2fv) \
- EnumMacro(PFNGLUNIFORMMATRIX3X4FVPROC,glUniformMatrix3x4fv) \
- EnumMacro(PFNGLUNIFORMMATRIX4X3FVPROC,glUniformMatrix4x3fv) \
- EnumMacro(PFNGLISRENDERBUFFERPROC,glIsRenderbuffer) \
- EnumMacro(PFNGLBINDRENDERBUFFERPROC,glBindRenderbuffer) \
- EnumMacro(PFNGLDELETERENDERBUFFERSPROC,glDeleteRenderbuffers) \
- EnumMacro(PFNGLGENRENDERBUFFERSPROC,glGenRenderbuffers) \
- EnumMacro(PFNGLRENDERBUFFERSTORAGEPROC,glRenderbufferStorage) \
- EnumMacro(PFNGLGETRENDERBUFFERPARAMETERIVPROC,glGetRenderbufferParameteriv) \
- EnumMacro(PFNGLISFRAMEBUFFERPROC,glIsFramebuffer) \
- EnumMacro(PFNGLBINDFRAMEBUFFERPROC,glBindFramebuffer) \
- EnumMacro(PFNGLDELETEFRAMEBUFFERSPROC,glDeleteFramebuffers) \
- EnumMacro(PFNGLGENFRAMEBUFFERSPROC,glGenFramebuffers) \
- EnumMacro(PFNGLCHECKFRAMEBUFFERSTATUSPROC,glCheckFramebufferStatus) \
- EnumMacro(PFNGLFRAMEBUFFERTEXTURE1DPROC,glFramebufferTexture1D) \
- EnumMacro(PFNGLFRAMEBUFFERTEXTURE2DPROC,glFramebufferTexture2D) \
- EnumMacro(PFNGLFRAMEBUFFERTEXTURE3DPROC,glFramebufferTexture3D) \
- EnumMacro(PFNGLFRAMEBUFFERTEXTUREPROC,glFramebufferTexture) \
- EnumMacro(PFNGLFRAMEBUFFERRENDERBUFFERPROC,glFramebufferRenderbuffer) \
- EnumMacro(PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVPROC,glGetFramebufferAttachmentParameteriv) \
- EnumMacro(PFNGLGENERATEMIPMAPPROC,glGenerateMipmap) \
- EnumMacro(PFNGLBLITFRAMEBUFFERPROC,glBlitFramebuffer) \
- EnumMacro(PFNGLRENDERBUFFERSTORAGEMULTISAMPLEPROC,glRenderbufferStorageMultisample) \
- EnumMacro(PFNGLFRAMEBUFFERTEXTURELAYERPROC,glFramebufferTextureLayer) \
- EnumMacro(PFNGLMAPBUFFERRANGEPROC,glMapBufferRange) \
- EnumMacro(PFNGLFLUSHMAPPEDBUFFERRANGEPROC,glFlushMappedBufferRange) \
- EnumMacro(PFNGLVERTEXATTRIBDIVISORPROC,glVertexAttribDivisor) \
- EnumMacro(PFNGLDRAWARRAYSINSTANCEDPROC,glDrawArraysInstanced) \
- EnumMacro(PFNGLDRAWELEMENTSINSTANCEDPROC,glDrawElementsInstanced) \
- EnumMacro(PFNGLGETSTRINGIPROC,glGetStringi) \
- EnumMacro(PFNGLGENVERTEXARRAYSPROC,glGenVertexArrays) \
- EnumMacro(PFNGLDELETEVERTEXARRAYSPROC,glDeleteVertexArrays) \
- EnumMacro(PFNGLBINDVERTEXARRAYPROC,glBindVertexArray) \
- EnumMacro(PFNGLCOPYBUFFERSUBDATAPROC,glCopyBufferSubData) \
- EnumMacro(PFNGLTEXBUFFERPROC,glTexBuffer) \
- EnumMacro(PFNGLTEXIMAGE2DMULTISAMPLEPROC,glTexImage2DMultisample) \
- EnumMacro(PFNGLQUERYCOUNTERPROC, glQueryCounter)\
- EnumMacro(PFNGLISSYNCPROC, glIsSync)\
- EnumMacro(PFNGLDELETESYNCPROC, glDeleteSync)\
- EnumMacro(PFNGLGETQUERYOBJECTUI64VPROC, glGetQueryObjectui64v)\
- EnumMacro(PFNGLFENCESYNCPROC, glFenceSync)\
- EnumMacro(PFNGLGETSYNCIVPROC, glGetSynciv)\
- EnumMacro(PFNGLCLIENTWAITSYNCPROC, glClientWaitSync)\
- EnumMacro(PFNGLBINDBUFFERRANGEPROC, glBindBufferRange)
-
-#define ENUM_GL_ENTRYPOINTS_OPTIONAL(EnumMacro) \
- EnumMacro(PFNGLCLIPCONTROLPROC,glClipControl) \
- EnumMacro(PFNGLDEBUGMESSAGECALLBACKARBPROC,glDebugMessageCallbackARB) \
- EnumMacro(PFNGLDEBUGMESSAGECONTROLARBPROC,glDebugMessageControlARB) \
- EnumMacro(PFNGLDEBUGMESSAGECALLBACKAMDPROC,glDebugMessageCallbackAMD) \
- EnumMacro(PFNGLDEBUGMESSAGEENABLEAMDPROC,glDebugMessageEnableAMD) \
- EnumMacro(PFNGLGETACTIVEUNIFORMSIVPROC,glGetActiveUniformsiv) \
- EnumMacro(PFNGLGETVERTEXATTRIBIUIVPROC,glGetVertexAttribIuiv) \
- EnumMacro(PFNGLGETACTIVEUNIFORMNAMEPROC,glGetActiveUniformName) \
- EnumMacro(PFNGLGETUNIFORMUIVPROC,glGetUniformuiv) \
- EnumMacro(PFNGLGETACTIVEUNIFORMBLOCKIVPROC,glGetActiveUniformBlockiv) \
- EnumMacro(PFNGLGETBUFFERPARAMETERI64VPROC,glGetBufferParameteri64v) \
- EnumMacro(PFNGLGETACTIVEUNIFORMBLOCKNAMEPROC,glGetActiveUniformBlockName) \
- EnumMacro(PFNGLGETSAMPLERPARAMETERFVPROC,glGetSamplerParameterfv) \
- EnumMacro(PFNGLGETSAMPLERPARAMETERIVPROC,glGetSamplerParameteriv) \
- EnumMacro(PFNGLDISPATCHCOMPUTEPROC, glDispatchCompute) \
- EnumMacro(PFNGLDISPATCHCOMPUTEINDIRECTPROC, glDispatchComputeIndirect) \
- EnumMacro(PFNGLBINDIMAGETEXTUREPROC, glBindImageTexture) \
- EnumMacro(PFNGLMEMORYBARRIERPROC, glMemoryBarrier) \
- EnumMacro(PFNGLBLENDEQUATIONIPROC, glBlendEquationi) \
- EnumMacro(PFNGLBLENDEQUATIONSEPARATEIPROC, glBlendEquationSeparatei) \
- EnumMacro(PFNGLBLENDFUNCIPROC, glBlendFunci) \
- EnumMacro(PFNGLBLENDFUNCSEPARATEIPROC, glBlendFuncSeparatei)\
- EnumMacro(PFNGLBLENDEQUATIONSEPARATEIARBPROC,glBlendEquationSeparateiARB)\
- EnumMacro(PFNGLBLENDEQUATIONIARBPROC,glBlendEquationiARB)\
- EnumMacro(PFNGLBLENDFUNCSEPARATEIARBPROC,glBlendFuncSeparateiARB)\
- EnumMacro(PFNGLBLENDFUNCIARBPROC,glBlendFunciARB)\
- EnumMacro(PFNGLCLEARBUFFERDATAPROC, glClearBufferData)\
- EnumMacro(PFNGLCLEARBUFFERSUBDATAPROC, glClearBufferSubData)\
- EnumMacro(PFNGLPUSHDEBUGGROUPPROC, glPushDebugGroup)\
- EnumMacro(PFNGLPOPDEBUGGROUPPROC, glPopDebugGroup)\
- EnumMacro(PFNGLOBJECTLABELPROC, glObjectLabel)\
- EnumMacro(PFNGLOBJECTLABELPROC, glObjectPtrLabel)\
- EnumMacro(PFNGLPATCHPARAMETERIPROC, glPatchParameteri)\
- EnumMacro(PFNGLBINDVERTEXBUFFERPROC, glBindVertexBuffer)\
- EnumMacro(PFNGLVERTEXATTRIBFORMATPROC, glVertexAttribFormat)\
- EnumMacro(PFNGLVERTEXATTRIBIFORMATPROC, glVertexAttribIFormat)\
- EnumMacro(PFNGLVERTEXATTRIBBINDINGPROC, glVertexAttribBinding)\
- EnumMacro(PFNGLVERTEXBINDINGDIVISORPROC, glVertexBindingDivisor)\
- EnumMacro(PFNGLCOPYIMAGESUBDATAPROC, glCopyImageSubData)\
- EnumMacro(PFNGLTEXSTORAGE1DPROC, glTexStorage1D)\
- EnumMacro(PFNGLTEXSTORAGE2DPROC, glTexStorage2D)\
- EnumMacro(PFNGLTEXSTORAGE3DPROC, glTexStorage3D)\
- EnumMacro(PFNGLBUFFERSTORAGEPROC, glBufferStorage)\
- EnumMacro(PFNGLTEXTUREVIEWPROC, glTextureView)\
- EnumMacro(PFNGLTEXSTORAGE2DMULTISAMPLEPROC, glTexStorage2DMultisample)\
- EnumMacro(PFNGLDRAWELEMENTSINDIRECTPROC, glDrawElementsIndirect)\
- EnumMacro(PFNGLDRAWARRAYSINDIRECTPROC, glDrawArraysIndirect)\
- EnumMacro(PFNGLDEPTHBOUNDSEXTPROC, glDepthBoundsEXT)\
- EnumMacro(PFNGLGETTEXTUREHANDLENVPROC, glGetTextureHandleARB)\
- EnumMacro(PFNGLGETTEXTURESAMPLERHANDLENVPROC, glGetTextureSamplerHandleARB)\
- EnumMacro(PFNGLMAKETEXTUREHANDLERESIDENTNVPROC, glMakeTextureHandleResidentARB)\
- EnumMacro(PFNGLUNIFORMHANDLEUI64NVPROC, glUniformHandleui64ARB)\
- EnumMacro(PFNGLMAKETEXTUREHANDLENONRESIDENTNVPROC, glMakeTextureHandleNonResidentARB)\
- EnumMacro(PFNGLPUSHDEBUGGROUPPROC, glPushDebugGroupKHR)\
- EnumMacro(PFNGLPOPDEBUGGROUPPROC, glPopDebugGroupKHR)\
- EnumMacro(PFNGLOBJECTLABELPROC, glObjectLabelKHR)\
- EnumMacro(PFNGLOBJECTLABELPROC, glObjectPtrLabelKHR)\
- EnumMacro(PFNGLDEBUGMESSAGECALLBACKARBPROC,glDebugMessageCallbackKHR) \
- EnumMacro(PFNGLDEBUGMESSAGECONTROLARBPROC,glDebugMessageControlKHR) \
- EnumMacro(PFNGLPATCHPARAMETERIPROC, glPatchParameteriEXT)\
- EnumMacro(PFNGLTEXTUREVIEWPROC, glTextureViewEXT)\
- EnumMacro(PFNGLBLENDEQUATIONIPROC, glBlendEquationiEXT) \
- EnumMacro(PFNGLBLENDEQUATIONSEPARATEIPROC, glBlendEquationSeparateiEXT) \
- EnumMacro(PFNGLBLENDFUNCIPROC, glBlendFunciEXT) \
- EnumMacro(PFNGLBLENDFUNCSEPARATEIPROC, glBlendFuncSeparateiEXT)\
- EnumMacro(PFNGLCOLORMASKIPROC,glColorMaskiEXT) \
- EnumMacro(PFNGLDISABLEIPROC,glDisableiEXT) \
- EnumMacro(PFNGLENABLEIPROC,glEnableiEXT) \
- EnumMacro(PFNGLFRAMEBUFFERTEXTUREPROC,glFramebufferTextureEXT) \
- EnumMacro(PFNGLCOPYIMAGESUBDATAPROC, glCopyImageSubDataEXT) \
- EnumMacro(PFNGLTEXBUFFERPROC,glTexBufferEXT) \
- EnumMacro(PFNGLDEPTHRANGEFPROC,glDepthRangef) \
- EnumMacro(PFNGLCLEARDEPTHFPROC,glClearDepthf) \
- EnumMacro(PFNGLGETSHADERPRECISIONFORMATPROC, glGetShaderPrecisionFormat) \
- EnumMacro(PFNGLPROGRAMPARAMETERIPROC, glProgramParameteri) \
- EnumMacro(PFNGLUSEPROGRAMSTAGESPROC, glUseProgramStages) \
- EnumMacro(PFNGLBINDPROGRAMPIPELINEPROC, glBindProgramPipeline) \
- EnumMacro(PFNGLDELETEPROGRAMPIPELINESPROC, glDeleteProgramPipelines) \
- EnumMacro(PFNGLGENPROGRAMPIPELINESPROC, glGenProgramPipelines) \
- EnumMacro(PFNGLPROGRAMUNIFORM1IPROC, glProgramUniform1i) \
- EnumMacro(PFNGLPROGRAMUNIFORM4IVPROC, glProgramUniform4iv) \
- EnumMacro(PFNGLPROGRAMUNIFORM4FVPROC, glProgramUniform4fv) \
- EnumMacro(PFNGLPROGRAMUNIFORM4UIVPROC, glProgramUniform4uiv) \
- EnumMacro(PFNGLGETPROGRAMPIPELINEIVPROC, glGetProgramPipelineiv) \
- EnumMacro(PFNGLVALIDATEPROGRAMPIPELINEPROC, glValidateProgramPipeline) \
- EnumMacro(PFNGLGETPROGRAMPIPELINEINFOLOGPROC, glGetProgramPipelineInfoLog) \
- EnumMacro(PFNGLISPROGRAMPIPELINEPROC, glIsProgramPipeline) \
- EnumMacro(PFNGLGETPROGRAMBINARYPROC, glGetProgramBinary) \
- EnumMacro(PFNGLPROGRAMBINARYPROC, glProgramBinary)
-
-// List of all OpenGL entry points
-#define ENUM_GL_ENTRYPOINTS_ALL(EnumMacro) \
- ENUM_GL_ENTRYPOINTS_DLL(EnumMacro) \
- ENUM_GL_ENTRYPOINTS(EnumMacro) \
- ENUM_GL_ENTRYPOINTS_OPTIONAL(EnumMacro)
-
-// Declare all GL functions
-#define DECLARE_GL_ENTRYPOINTS(Type,Func) extern Type Func;
-ENUM_GL_ENTRYPOINTS_ALL(DECLARE_GL_ENTRYPOINTS);
-
-inline void* GetGLFuncAddress(const char* name)
-{
- // Reference: https://www.khronos.org/opengl/wiki/Load_OpenGL_Functions
-
- void* p = (void*)wglGetProcAddress(name);
- if (p == 0 || (p == (void*)0x1) || (p == (void*)0x2) || (p == (void*)0x3) || (p == (void*)-1))
- {
- HMODULE module = LoadLibraryA("opengl32.dll");
- p = (void*)GetProcAddress(module, name);
- }
-
- return p;
-}
-
-#endif
-
-#endif
diff --git a/Source/Engine/GraphicsDevice/OpenGL/RenderToolsOGL.cpp b/Source/Engine/GraphicsDevice/OpenGL/RenderToolsOGL.cpp
deleted file mode 100644
index f8c810797..000000000
--- a/Source/Engine/GraphicsDevice/OpenGL/RenderToolsOGL.cpp
+++ /dev/null
@@ -1,75 +0,0 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
-
-#include "RenderToolsOGL.h"
-
-#if GRAPHICS_API_OPENGL
-
-#include "Engine/Core/Types/StringBuilder.h"
-#include "Engine/Core/Log.h"
-
-const Char* RenderToolsOGL::GetErrorString(GLenum errorCode)
-{
- switch (errorCode)
- {
-#define OGL_ERROR(name) case name: return TEXT(#name)
- OGL_ERROR(GL_INVALID_ENUM);
- OGL_ERROR(GL_INVALID_VALUE);
- OGL_ERROR(GL_INVALID_OPERATION);
- OGL_ERROR(GL_OUT_OF_MEMORY);
- OGL_ERROR(GL_INVALID_FRAMEBUFFER_OPERATION);
-#undef OGL_ERROR
- }
-
- return nullptr;
-}
-
-void RenderToolsOGL::CheckError(const char* file, uint32 line)
-{
- GLenum errorCode = glGetError();
- if (errorCode != GL_NO_ERROR)
- {
- StringBuilder sb;
- sb.AppendFormat(TEXT("OpenGL error at {0}:{1}"), file, line);
-
- const Char* errorString = GetErrorString(errorCode);
- if (errorString)
- {
- sb.AppendLine().Append(errorString);
- }
-
-#if PLATFORM_WINDOWS
- {
- HGLRC context = wglGetCurrentContext();
- if (!context)
- {
- sb.AppendLine().Append(TEXT("No OpenGL context set!"));
- }
- }
-#endif
-
- /*
- do
- {
- const Char* errorString = GetErrorString(errorCode);
- if (errorString)
- {
- sb.AppendLine().Append(errorString);
- }
-
- errorCode = glGetError();
- } while (errorCode != GL_NO_ERROR);
- */
-
- LOG_STR(Fatal, sb.ToString());
- }
-}
-
-void RenderToolsOGL::ErrorCallback(GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar* message, GLvoid* userParam)
-{
- if (type != GL_DEBUG_TYPE_PERFORMANCE && type != GL_DEBUG_TYPE_OTHER)
- {
- LOG(Fatal, "OpenGL error: {0}", message);
- }
-}
-
-#endif
diff --git a/Source/Engine/GraphicsDevice/OpenGL/RenderToolsOGL.h b/Source/Engine/GraphicsDevice/OpenGL/RenderToolsOGL.h
deleted file mode 100644
index b8e677c62..000000000
--- a/Source/Engine/GraphicsDevice/OpenGL/RenderToolsOGL.h
+++ /dev/null
@@ -1,53 +0,0 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
-
-#pragma once
-
-#include "Engine/Core/Types/BaseTypes.h"
-#include "Engine/Graphics/RenderTools.h"
-#include "Engine/Graphics/Enums.h"
-
-#if GRAPHICS_API_OPENGL
-
-#include "Engine/Graphics/Textures/GPUTextureDescription.h"
-#include "IncludeOpenGLHeaders.h"
-
-#if GPU_ENABLE_ASSERTION
-
-// OpenGL results validation
-#define VALIDATE_OPENGL_RESULT() RenderToolsOGL::CheckError(__FILE__, __LINE__)
-
-#else
-
-#define VALIDATE_OPENGL_RESULT(x)
-
-#endif
-
-///
-/// Set of utilities for rendering on OpenGL platform.
-///
-namespace RenderToolsOGL
-{
- inline GLenum ComparisonFuncToOGL(ComparisonFunc func)
- {
- switch (func)
- {
- case ComparisonFunc::Never: return GL_NEVER;
- case ComparisonFunc::Less: return GL_LESS;
- case ComparisonFunc::Equal: return GL_EQUAL;
- case ComparisonFunc::LessEqual: return GL_LEQUAL;
- case ComparisonFunc::Grather: return GL_GREATER;
- case ComparisonFunc::NotEqual: return GL_NOTEQUAL;
- case ComparisonFunc::GratherEqual: return GL_GEQUAL;
- case ComparisonFunc::Always: return GL_ALWAYS;
- default: CRASH; return GL_ALWAYS;
- }
- }
-
- const Char* GetErrorString(GLenum errorCode);
-
- void CheckError(const char* file, uint32 line);
-
- void ErrorCallback(GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar *message, GLvoid *userParam);
-};
-
-#endif
diff --git a/Source/Engine/GraphicsDevice/OpenGL/VAOCache.cpp b/Source/Engine/GraphicsDevice/OpenGL/VAOCache.cpp
deleted file mode 100644
index 3780200c0..000000000
--- a/Source/Engine/GraphicsDevice/OpenGL/VAOCache.cpp
+++ /dev/null
@@ -1,167 +0,0 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
-
-#include "VAOCache.h"
-
-#if GRAPHICS_API_OPENGL
-
-#include "TextureOGL.h"
-#include "BufferOGL.h"
-#include "RenderToolsOGL.h"
-#include "Shaders/GPUShaderProgramOGL.h"
-
-VAOCache::VAOCache()
- : Table(2048)
-{
-}
-
-VAOCache::~VAOCache()
-{
- Dispose();
-}
-
-GLuint VAOCache::GetVAO(GPUShaderProgramVSOGL* vs, BufferOGL* indexBuffer, uint32 streamsCount, StreamData streams[])
-{
- Key key(vs, indexBuffer, streamsCount, streams);
- GLuint vao;
-
- if (!Table.TryGet(key, vao))
- {
- // Create new VAO
- glGenVertexArrays(1, &vao);
- VALIDATE_OPENGL_RESULT();
-
- // Bind VAO
- glBindVertexArray(vao);
- VALIDATE_OPENGL_RESULT();
-
- // Initialize VAO
- for (int32 i = 0; i < vs->Layout.Count(); i++)
- {
- auto& item = vs->Layout[i];
-
- auto bufferSlot = item.BufferSlot;
- if (bufferSlot >= streamsCount)
- {
- LOG(Error, "Incorrect input buffer slot");
- continue;
- }
-
- auto& stream = streams[bufferSlot];
- ASSERT(stream.Buffer != nullptr && stream.Buffer->BufferId != 0);
-
- glBindBuffer(GL_ARRAY_BUFFER, stream.Buffer->BufferId);
- VALIDATE_OPENGL_RESULT();
-
- GLvoid* DataStartOffset = reinterpret_cast(static_cast(stream.Offset + item.RelativeOffset));
- if (item.IsInteger)
- glVertexAttribIPointer(i, item.TypeCount, item.GlType, stream.Stride, DataStartOffset);
- else
- glVertexAttribPointer(i, item.TypeCount, item.GlType, item.Normalized, stream.Stride, DataStartOffset);
- VALIDATE_OPENGL_RESULT();
-
- glVertexAttribDivisor(i, item.InstanceDataStepRate);
- VALIDATE_OPENGL_RESULT();
-
- glEnableVertexAttribArray(i);
- VALIDATE_OPENGL_RESULT();
- }
- if (indexBuffer)
- {
- glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, indexBuffer->BufferId);
- }
-
- // Register in cache
- Table.Add(key, vao);
- }
-
- return vao;
-}
-
-void VAOCache::OnObjectRelease(GPUShaderProgramVSOGL* obj)
-{
- for (auto i = Table.Begin(); i.IsNotEnd(); ++i)
- {
- if (i->Key.HasReference(obj))
- {
- GLuint fbo = i->Value;
- glDeleteVertexArrays(1, &fbo);
- Table.Remove(i);
- }
- }
-}
-
-void VAOCache::OnObjectRelease(BufferOGL* obj)
-{
- for (auto i = Table.Begin(); i.IsNotEnd(); ++i)
- {
- if (i->Key.HasReference(obj))
- {
- GLuint fbo = i->Value;
- glDeleteVertexArrays(1, &fbo);
- Table.Remove(i);
- }
- }
-}
-
-void VAOCache::Dispose()
-{
- for (auto i = Table.Begin(); i.IsNotEnd(); ++i)
- {
- GLuint fbo = i->Value;
- glDeleteVertexArrays(1, &fbo);
- }
- Table.Clear();
-}
-
-VAOCache::Key::Key(GPUShaderProgramVSOGL* vs, BufferOGL* indexBuffer, uint32 streamsCount, StreamData streams[])
-{
- VS = vs;
- IndexBuffer = indexBuffer;
- StreamsCount = streamsCount;
-
- Hash = streamsCount * 371;
- HashCombinePointer(Hash, vs);
- HashCombinePointer(Hash, indexBuffer);
-
- for (int32 i = 0; i < streamsCount; i++)
- {
- Streams[i] = streams[i];
- HashCombinePointer(Hash, streams[i].Buffer);
- HashCombine(Hash, streams[i].Offset);
- HashCombine(Hash, streams[i].Stride);
- }
-}
-
-bool VAOCache::Key::HasReference(GPUShaderProgramVSOGL* obj)
-{
- return obj == VS;
-}
-
-bool VAOCache::Key::HasReference(BufferOGL* obj)
-{
- for (int32 i = 0; i < ARRAY_COUNT(Streams); i++)
- {
- if (Streams[i].Buffer == obj)
- return true;
- }
- return IndexBuffer == obj;
-}
-
-bool VAOCache::Key::operator==(const Key & other) const
-{
- if (Hash != 0 && other.Hash != 0 && Hash != other.Hash)
- return false;
-
- if (StreamsCount != other.StreamsCount || IndexBuffer != other.IndexBuffer)
- return false;
-
- for (int32 rt = 0; rt < StreamsCount; rt++)
- {
- if (Streams[rt] != other.Streams[rt])
- return false;
- }
-
- return true;
-}
-
-#endif
diff --git a/Source/Engine/GraphicsDevice/OpenGL/VAOCache.h b/Source/Engine/GraphicsDevice/OpenGL/VAOCache.h
deleted file mode 100644
index 227c21633..000000000
--- a/Source/Engine/GraphicsDevice/OpenGL/VAOCache.h
+++ /dev/null
@@ -1,92 +0,0 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
-
-#pragma once
-
-#include "Engine/Core/Common.h"
-#include "Config.h"
-
-#if GRAPHICS_API_OPENGL
-
-#include "IncludeOpenGLHeaders.h"
-
-class GPUTextureViewOGL;
-class PipelineStateOGL;
-class GPUShaderProgramVSOGL;
-class TextureOGL;
-class BufferOGL;
-
-class VAOCache
-{
-public:
-
- struct StreamData
- {
- BufferOGL* Buffer;
- uint32 Stride;
- uint32 Offset;
-
- StreamData()
- : Buffer(nullptr)
- , Stride(0)
- , Offset(0)
- {
- }
-
- bool operator== (const StreamData& other) const
- {
- return Buffer == other.Buffer && Stride == other.Stride && Offset == other.Offset;
- }
-
- bool operator!= (const StreamData& other) const
- {
- return !operator==(other);
- }
- };
-
-private:
-
- struct Key
- {
- uint32 Hash;
- GPUShaderProgramVSOGL* VS;
- BufferOGL* IndexBuffer;
- uint32 StreamsCount;
- StreamData Streams[GPU_MAX_VB_BINDED];
-
- Key()
- : Hash(0)
- , StreamsCount(0)
- , VS(nullptr)
- , IndexBuffer(nullptr)
- {
- }
-
- Key(GPUShaderProgramVSOGL* vs, BufferOGL* indexBuffer, uint32 streamsCount, StreamData streams[]);
-
- bool HasReference(GPUShaderProgramVSOGL* obj);
- bool HasReference(BufferOGL* obj);
-
- bool operator== (const Key& other) const;
-
- static uint32 HashFunction(const Key& key)
- {
- return key.Hash;
- }
- };
-
- Dictionary Table;
-
-public:
-
- VAOCache();
- ~VAOCache();
-
-public:
-
- GLuint GetVAO(GPUShaderProgramVSOGL* vs, BufferOGL* indexBuffer, uint32 streamsCount, StreamData streams[]);
- void OnObjectRelease(GPUShaderProgramVSOGL* obj);
- void OnObjectRelease(BufferOGL* obj);
- void Dispose();
-};
-
-#endif
diff --git a/Source/Engine/GraphicsDevice/OpenGL/Win32/Win32ContextOGL.cpp b/Source/Engine/GraphicsDevice/OpenGL/Win32/Win32ContextOGL.cpp
deleted file mode 100644
index 451d692a1..000000000
--- a/Source/Engine/GraphicsDevice/OpenGL/Win32/Win32ContextOGL.cpp
+++ /dev/null
@@ -1,126 +0,0 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
-
-#include "Win32ContextOGL.h"
-
-#if GRAPHICS_API_OPENGL && PLATFORM_WINDOWS
-
-#include "Engine/Platform/Platform.h"
-#include "Engine/Core/Log.h"
-#include "../AdapterOGL.h"
-#include "../GPUDeviceOGL.h"
-
-PFNWGLCREATECONTEXTATTRIBSARBPROC Win32ContextOGL::wglCreateContextAttribsARB = NULL;
-
-HGLRC Win32ContextOGL::OpenGLContext = 0;
-HDC Win32ContextOGL::OpenGLContextWin = 0;
-Array> Win32ContextOGL::ChildWindows;
-
-// A dummy window procedure (for WinAPI).
-static LRESULT CALLBACK PlatformDummyGLWndproc(HWND hWnd, uint32 Message, WPARAM wParam, LPARAM lParam)
-{
- return DefWindowProc(hWnd, Message, wParam, lParam);
-}
-
-// Initializes a pixel format descriptor for the given window handle.
-void Win32ContextOGL::PlatformInitPixelFormatForDevice(HDC context)
-{
- // Pixel format descriptor for the context
- PIXELFORMATDESCRIPTOR PixelFormatDesc;
- Platform::MemoryClear(&PixelFormatDesc, sizeof(PixelFormatDesc));
- PixelFormatDesc.nSize = sizeof(PIXELFORMATDESCRIPTOR);
- PixelFormatDesc.nVersion = 1;
- PixelFormatDesc.dwFlags = PFD_DRAW_TO_WINDOW | PFD_SUPPORT_OPENGL | PFD_DOUBLEBUFFER;
- PixelFormatDesc.iPixelType = PFD_TYPE_RGBA;
- PixelFormatDesc.cColorBits = 32;
- PixelFormatDesc.cDepthBits = 0;
- PixelFormatDesc.cStencilBits = 0;
- PixelFormatDesc.iLayerType = PFD_MAIN_PLANE;
-
- // Set the pixel format
- int32 PixelFormat = ChoosePixelFormat(context, &PixelFormatDesc);
- if (!PixelFormat || !SetPixelFormat(context, PixelFormat, &PixelFormatDesc))
- {
- LOG(Error, "Failed to set pixel format for device context.");
- }
-}
-
-// Creates a dummy window used to construct OpenGL contexts.
-void Win32ContextOGL::CreateDummyGLWindow(Data* context)
-{
- const Char* DummyWindowClassName = TEXT("DummyGLWindow");
-
- // Register a dummy window class
- {
- WNDCLASS wc;
- Platform::MemoryClear(&wc, sizeof(wc));
- wc.style = CS_OWNDC;
- wc.lpfnWndProc = PlatformDummyGLWndproc;
- wc.cbClsExtra = 0;
- wc.cbWndExtra = 0;
- wc.hInstance = NULL;
- wc.hIcon = NULL;
- wc.hCursor = NULL;
- wc.hbrBackground = (HBRUSH)(COLOR_MENUTEXT);
- wc.lpszMenuName = NULL;
- wc.lpszClassName = DummyWindowClassName;
- ATOM ClassAtom = ::RegisterClass(&wc);
- ASSERT(ClassAtom);
- }
-
- // Create a dummy window
- context->WindowHandle = CreateWindowEx(
- WS_EX_WINDOWEDGE,
- DummyWindowClassName,
- NULL,
- WS_POPUP,
- 0, 0, 1, 1,
- NULL, NULL, NULL, NULL);
- ASSERT(context->WindowHandle);
- context->bReleaseWindowOnDestroy = true;
-
- // Get the device context.
- context->DeviceContext = GetDC(context->WindowHandle);
- ASSERT(context->DeviceContext);
- PlatformInitPixelFormatForDevice(context->DeviceContext);
-}
-
-// Create a core profile OpenGL context.
-void Win32ContextOGL::PlatformCreateOpenGLContextCore(Data* result, int majorVersion, int minorVersion, HGLRC parentContext)
-{
- ASSERT(result);
-
- result->SyncInterval = -1; // invalid value to enforce setup on first buffer swap
- result->ViewportFramebuffer = 0;
-
- PlatformCreateOpenGLContextCore(&result->OpenGLContext, result->DeviceContext, majorVersion, minorVersion, parentContext);
-}
-
-void Win32ContextOGL::PlatformCreateOpenGLContextCore(HGLRC* result, HDC deviceContext, int majorVersion, int minorVersion, HGLRC parentContext)
-{
- ASSERT(wglCreateContextAttribsARB);
- ASSERT(result && deviceContext);
-
- int debugFlag = 0;
-#if GPU_OGL_USE_DEBUG_LAYER
- debugFlag = WGL_CONTEXT_DEBUG_BIT_ARB;
-#endif
-
- int attributes[] =
- {
- WGL_CONTEXT_MAJOR_VERSION_ARB, majorVersion,
- WGL_CONTEXT_MINOR_VERSION_ARB, minorVersion,
- WGL_CONTEXT_FLAGS_ARB, WGL_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB | debugFlag,
- WGL_CONTEXT_PROFILE_MASK_ARB, WGL_CONTEXT_CORE_PROFILE_BIT_ARB,
- 0
- };
-
- *result = wglCreateContextAttribsARB(deviceContext, parentContext, attributes);
-}
-
-void Win32ContextOGL::PlatformCreateOpenGLContextCore(HGLRC* result, HDC deviceContext, HGLRC parentContext)
-{
- auto adapter = (AdapterOGL*)GPUDevice::Instance->GetAdapter();
- PlatformCreateOpenGLContextCore(result, deviceContext, adapter->VersionMajor, adapter->VersionMinor, parentContext);
-}
-
-#endif
diff --git a/Source/Engine/GraphicsDevice/OpenGL/Win32/Win32ContextOGL.h b/Source/Engine/GraphicsDevice/OpenGL/Win32/Win32ContextOGL.h
deleted file mode 100644
index 309977f56..000000000
--- a/Source/Engine/GraphicsDevice/OpenGL/Win32/Win32ContextOGL.h
+++ /dev/null
@@ -1,80 +0,0 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
-
-#pragma once
-
-#include "../IncludeOpenGLHeaders.h"
-
-#if GRAPHICS_API_OPENGL && PLATFORM_WINDOWS
-
-#include "Engine/Core/Common.h"
-
-class Win32GPUSwapChainOGL;
-
-class Win32ContextOGL
-{
-public:
-
- // Platform specific OpenGL context.
- struct Data
- {
- HWND WindowHandle;
- HDC DeviceContext;
- HGLRC OpenGLContext;
- bool bReleaseWindowOnDestroy;
- int32 SyncInterval;
- GLuint ViewportFramebuffer;
- GLuint VertexArrayObject; // one has to be generated and set for each context (OpenGL 3.2 Core requirements)
- GLuint BackBufferResource; // TODO: use it
- GLenum BackBufferTarget; // TODO: use it
-
- ~Data()
- {
- if (OpenGLContext)
- {
- ContextMakeCurrent(NULL, NULL);
- wglDeleteContext(OpenGLContext);
- }
- ReleaseDC(WindowHandle, DeviceContext);
- ASSERT(bReleaseWindowOnDestroy);
- DestroyWindow(WindowHandle);
- }
- };
-
- static PFNWGLCREATECONTEXTATTRIBSARBPROC wglCreateContextAttribsARB;
-
-public:
-
- static HGLRC OpenGLContext;
- static HDC OpenGLContextWin;
- static Array> ChildWindows;
-
-public:
-
- static bool IsReady()
- {
- return OpenGLContext != 0;
- }
-
- static void ContextMakeCurrent(HDC dc, HGLRC rc)
- {
- BOOL result = wglMakeCurrent(dc, rc);
- if (!result)
- {
- result = wglMakeCurrent(nullptr, nullptr);
- }
- ASSERT(result);
- }
-
- static HGLRC GetCurrentContext()
- {
- return wglGetCurrentContext();
- }
-
- static void PlatformInitPixelFormatForDevice(HDC context);
- static void CreateDummyGLWindow(Data* context);
- static void PlatformCreateOpenGLContextCore(Data* result, int majorVersion, int minorVersion, HGLRC parentContext);
- static void PlatformCreateOpenGLContextCore(HGLRC* result, HDC deviceContext, int majorVersion, int minorVersion, HGLRC parentContext);
- static void PlatformCreateOpenGLContextCore(HGLRC* result, HDC deviceContext, HGLRC parentContext);
-};
-
-#endif
diff --git a/Source/Engine/GraphicsDevice/OpenGL/Win32/Win32RenderOutputWindowOGL.cpp b/Source/Engine/GraphicsDevice/OpenGL/Win32/Win32RenderOutputWindowOGL.cpp
deleted file mode 100644
index 3a8e5662d..000000000
--- a/Source/Engine/GraphicsDevice/OpenGL/Win32/Win32RenderOutputWindowOGL.cpp
+++ /dev/null
@@ -1,185 +0,0 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
-
-#include "Win32GPUSwapChainOGL.h"
-
-#if GRAPHICS_API_OPENGL && PLATFORM_WINDOWS
-
-#include "Engine/Threading/Threading.h"
-#include "Engine/Platform/Window.h"
-#include "Engine/Platform/Windows/WindowsWindow.h"
-#include "Win32ContextOGL.h"
-#include "../RenderToolsOGL.h"
-
-Win32GPUSwapChainOGL* Win32GPUSwapChainOGL::Create(GPUDeviceOGL* device, const String& name, Window* parent)
-{
- auto winWindow = (WindowsWindow*)parent;
- auto hwnd = winWindow->GetHWND();
- auto hdc = GetDC(hwnd);
-
- Win32ContextOGL::PlatformInitPixelFormatForDevice(hdc);
-
- return New(device, name, parent, hwnd, hdc);
-}
-
-Win32GPUSwapChainOGL::Win32GPUSwapChainOGL(GPUDeviceOGL* device, const String& name, Window* parent, HWND hwnd, HDC hdc)
- : GPUSwapChainOGL(device, name, parent)
- , _hwnd(hwnd)
- , _hdc(hdc)
- , _context(0)
- , _isDisposing(false)
-{
-}
-
-Win32GPUSwapChainOGL::~Win32GPUSwapChainOGL()
-{
- ReleaseDC(_hwnd, _hdc);
-}
-
-void Win32GPUSwapChainOGL::ReleaseGPU()
-{
- if (_isDisposing || _memoryUsage == 0)
- return;
- _isDisposing = true;
-
- // TODO: disable fullscreenmode
-
- // Release data
- _backBufferHandle.Release();
- if (_context)
- {
- // Check if the main context is going to be closed
- if (_context == Win32ContextOGL::OpenGLContext)
- {
- // Release all GPU resources
- _device->Dispose();
-
- // Release all the child windows
- while (Win32ContextOGL::ChildWindows.HasItems())
- {
- Win32ContextOGL::ChildWindows[0]->ReleaseGPU();
- }
-
- Win32ContextOGL::OpenGLContext = 0;
- Win32ContextOGL::OpenGLContextWin = 0;
- }
- else
- {
- Win32ContextOGL::ChildWindows.Remove(this);
- }
- Win32ContextOGL::ContextMakeCurrent(NULL, NULL);
- wglDeleteContext(_context);
- _context = nullptr;
- }
- _memoryUsage = 0;
- _width = _height = 0;
-
- // Restore the main context if still valid
- if (Win32ContextOGL::OpenGLContext)
- {
- Win32ContextOGL::ContextMakeCurrent(Win32ContextOGL::OpenGLContextWin, Win32ContextOGL::OpenGLContext);
- }
-
- _isDisposing = false;
-}
-
-bool Win32GPUSwapChainOGL::IsFullscreen()
-{
- // TODO: support fullscreen on OpenGL
- return false;
-}
-
-void Win32GPUSwapChainOGL::SetFullscreen(bool isFullscreen)
-{
- // TODO: support fullscreen on OpenGL
- LOG(Warning, "TODO: support fullscreen on OpenGL/Windows");
-}
-
-bool Win32GPUSwapChainOGL::Resize(int32 width, int32 height)
-{
- // Check if size won't change
- if (width == _width && height == _height)
- {
- // Back
- return false;
- }
-
- // Wait for GPU to flush commands
- WaitForGPU();
-
- // Lock device
- GPUDeviceLock lock(_device);
-
- // Check if has no context
- if (_context == 0)
- {
- // Create the context
- Win32ContextOGL::PlatformCreateOpenGLContextCore(&_context, _hdc, Win32ContextOGL::OpenGLContext);
- if (_context == 0)
- {
- LOG(Error, "Failed to create OpenGL device context");
- return true;
- }
-
- // Check if the main context is missing
- if (Win32ContextOGL::OpenGLContext == 0)
- {
- // Be a master context
- Win32ContextOGL::OpenGLContext = _context;
- Win32ContextOGL::OpenGLContextWin = _hdc;
-
- // Init device
- _device->InitWithMainContext();
- }
- else
- {
- // Be a child context
- Win32ContextOGL::ChildWindows.Add(this);
- }
-
- // Use the main context
- Win32ContextOGL::ContextMakeCurrent(Win32ContextOGL::OpenGLContextWin, Win32ContextOGL::OpenGLContext);
- }
- else
- {
- // TODO: need to resize the backuffer? win32 window gets resized by the platform backend
- }
-
- // Init back buffer handle
- _backBufferHandle.InitAsBackbuffer(this, GPU_BACK_BUFFER_PIXEL_FORMAT);
-
- // Cache data
- _width = width;
- _height = height;
-
- // Calculate memory usage
- _memoryUsage = CalculateTextureMemoryUsage(PixelFormat::R8G8B8A8_UNorm, _width, _height, 1) * 2;
-
- return false;
-}
-
-void Win32GPUSwapChainOGL::Present(bool vsync)
-{
- // TODO: vsync on OpenGL
-//wglSwapIntervalEXT(vsync ? 1 : 0);
-//VALIDATE_OPENGL_RESULT();
-
- // Present frame
- SwapBuffers(_hdc);
-
- // Base
- GPUSwapChain::Present(vsync);
-}
-
-bool Win32GPUSwapChainOGL::DownloadData(TextureData* result)
-{
- MISSING_CODE("Win32GPUSwapChainOGL::DownloadData");
- return true;
-}
-
-Task* Win32GPUSwapChainOGL::DownloadDataAsync(TextureData* result)
-{
- MISSING_CODE("Win32GPUSwapChainOGL::DownloadDataAsync");
- return nullptr;
-}
-
-#endif
diff --git a/Source/Engine/GraphicsDevice/OpenGL/Win32/Win32RenderOutputWindowOGL.h b/Source/Engine/GraphicsDevice/OpenGL/Win32/Win32RenderOutputWindowOGL.h
deleted file mode 100644
index 084f7b36d..000000000
--- a/Source/Engine/GraphicsDevice/OpenGL/Win32/Win32RenderOutputWindowOGL.h
+++ /dev/null
@@ -1,45 +0,0 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
-
-#pragma once
-
-#include "../GPUSwapChainOGL.h"
-
-#if GRAPHICS_API_OPENGL && PLATFORM_WINDOWS
-
-#include "Engine/Platform/Win32/IncludeWindowsHeaders.h"
-
-///
-/// Graphics Device rendering output for OpenGL on Windows
-///
-class Win32GPUSwapChainOGL : public GPUSwapChainOGL
-{
-private:
-
- HWND _hwnd;
- HDC _hdc;
- HGLRC _context;
- bool _isDisposing;
-
- Win32GPUSwapChainOGL(GPUDeviceOGL* device, const String& name, Window* parent, HWND hwnd, HDC hdc);
- ~Win32GPUSwapChainOGL();
-
-public:
-
- // Init
- static Win32GPUSwapChainOGL* Create(GPUDeviceOGL* device, const String& name, Window* parent);
-
-public:
-
- // [GPUResourceOGL]
- void ReleaseGPU() override;
-
- // [GPUSwapChainOGL]
- bool IsFullscreen() override;
- void SetFullscreen(bool isFullscreen) override;
- bool DownloadData(TextureData* result) override;
- Task* DownloadDataAsync(TextureData* result) override;
- void Present(bool vsync) override;
- bool Resize(int32 width, int32 height) override;
-};
-
-#endif
diff --git a/Source/Engine/GraphicsDevice/Vulkan/Android/AndroidVulkanPlatform.cpp b/Source/Engine/GraphicsDevice/Vulkan/Android/AndroidVulkanPlatform.cpp
index fceee64ed..f3a981c08 100644
--- a/Source/Engine/GraphicsDevice/Vulkan/Android/AndroidVulkanPlatform.cpp
+++ b/Source/Engine/GraphicsDevice/Vulkan/Android/AndroidVulkanPlatform.cpp
@@ -1,29 +1,29 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#if GRAPHICS_API_VULKAN && PLATFORM_ANDROID
#include "AndroidVulkanPlatform.h"
#include "../RenderToolsVulkan.h"
-void AndroidVulkanPlatform::GetInstanceExtensions(Array& outExtensions)
+void AndroidVulkanPlatform::GetInstanceExtensions(Array& extensions)
{
- outExtensions.Add(VK_KHR_SURFACE_EXTENSION_NAME);
- outExtensions.Add(VK_KHR_ANDROID_SURFACE_EXTENSION_NAME);
+ extensions.Add(VK_KHR_SURFACE_EXTENSION_NAME);
+ extensions.Add(VK_KHR_ANDROID_SURFACE_EXTENSION_NAME);
}
-void AndroidVulkanPlatform::GetDeviceExtensions(Array& outExtensions)
+void AndroidVulkanPlatform::GetDeviceExtensions(Array& extensions)
{
- outExtensions.Add(VK_KHR_SURFACE_EXTENSION_NAME);
- outExtensions.Add(VK_KHR_ANDROID_SURFACE_EXTENSION_NAME);
+ extensions.Add(VK_KHR_SURFACE_EXTENSION_NAME);
+ extensions.Add(VK_KHR_ANDROID_SURFACE_EXTENSION_NAME);
}
-void AndroidVulkanPlatform::CreateSurface(void* windowHandle, VkInstance instance, VkSurfaceKHR* outSurface)
+void AndroidVulkanPlatform::CreateSurface(void* windowHandle, VkInstance instance, VkSurfaceKHR* surface)
{
ASSERT(windowHandle);
VkAndroidSurfaceCreateInfoKHR surfaceCreateInfo;
RenderToolsVulkan::ZeroStruct(surfaceCreateInfo, VK_STRUCTURE_TYPE_ANDROID_SURFACE_CREATE_INFO_KHR);
surfaceCreateInfo.window = (struct ANativeWindow*)windowHandle;
- VALIDATE_VULKAN_RESULT(vkCreateAndroidSurfaceKHR(instance, &surfaceCreateInfo, nullptr, outSurface));
+ VALIDATE_VULKAN_RESULT(vkCreateAndroidSurfaceKHR(instance, &surfaceCreateInfo, nullptr, surface));
}
#endif
diff --git a/Source/Engine/GraphicsDevice/Vulkan/Android/AndroidVulkanPlatform.h b/Source/Engine/GraphicsDevice/Vulkan/Android/AndroidVulkanPlatform.h
index 542e63644..6667ff268 100644
--- a/Source/Engine/GraphicsDevice/Vulkan/Android/AndroidVulkanPlatform.h
+++ b/Source/Engine/GraphicsDevice/Vulkan/Android/AndroidVulkanPlatform.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
@@ -13,9 +13,9 @@ class AndroidVulkanPlatform : public VulkanPlatformBase
{
public:
- static void GetInstanceExtensions(Array& outExtensions);
- static void GetDeviceExtensions(Array& outExtensions);
- static void CreateSurface(void* windowHandle, VkInstance instance, VkSurfaceKHR* outSurface);
+ static void GetInstanceExtensions(Array& extensions);
+ static void GetDeviceExtensions(Array& extensions);
+ static void CreateSurface(void* windowHandle, VkInstance instance, VkSurfaceKHR* surface);
};
typedef AndroidVulkanPlatform VulkanPlatform;
diff --git a/Source/Engine/GraphicsDevice/Vulkan/CmdBufferVulkan.cpp b/Source/Engine/GraphicsDevice/Vulkan/CmdBufferVulkan.cpp
index a143f7dd8..c327fd32a 100644
--- a/Source/Engine/GraphicsDevice/Vulkan/CmdBufferVulkan.cpp
+++ b/Source/Engine/GraphicsDevice/Vulkan/CmdBufferVulkan.cpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#if GRAPHICS_API_VULKAN
@@ -23,8 +23,8 @@ void CmdBufferVulkan::Begin()
VkCommandBufferBeginInfo beginInfo;
RenderToolsVulkan::ZeroStruct(beginInfo, VK_STRUCTURE_TYPE_COMMAND_BUFFER_BEGIN_INFO);
beginInfo.flags = VK_COMMAND_BUFFER_USAGE_ONE_TIME_SUBMIT_BIT;
- VALIDATE_VULKAN_RESULT(vkBeginCommandBuffer(_commandBufferHandle, &beginInfo));
-
+ VALIDATE_VULKAN_RESULT(vkBeginCommandBuffer(_commandBuffer, &beginInfo));
+
// Acquire a descriptor pool set on
if (_descriptorPoolSetContainer == nullptr)
{
@@ -68,14 +68,14 @@ void CmdBufferVulkan::BeginRenderPass(RenderPassVulkan* renderPass, FramebufferV
info.clearValueCount = clearValueCount;
info.pClearValues = clearValues;
- vkCmdBeginRenderPass(_commandBufferHandle, &info, VK_SUBPASS_CONTENTS_INLINE);
+ vkCmdBeginRenderPass(_commandBuffer, &info, VK_SUBPASS_CONTENTS_INLINE);
_state = State::IsInsideRenderPass;
}
void CmdBufferVulkan::EndRenderPass()
{
ASSERT(IsInsideRenderPass());
- vkCmdEndRenderPass(_commandBufferHandle);
+ vkCmdEndRenderPass(_commandBuffer);
_state = State::IsInsideBegin;
}
@@ -132,7 +132,7 @@ void CmdBufferVulkan::RefreshFenceStatus()
_submittedWaitSemaphores.Clear();
- vkResetCommandBuffer(_commandBufferHandle, VK_COMMAND_BUFFER_RESET_RELEASE_RESOURCES_BIT);
+ vkResetCommandBuffer(_commandBuffer, VK_COMMAND_BUFFER_RESET_RELEASE_RESOURCES_BIT);
_fence->GetOwner()->ResetFence(_fence);
_fenceSignaledCounter++;
@@ -151,7 +151,7 @@ void CmdBufferVulkan::RefreshFenceStatus()
CmdBufferVulkan::CmdBufferVulkan(GPUDeviceVulkan* device, CmdBufferPoolVulkan* pool)
: _device(device)
- , _commandBufferHandle(VK_NULL_HANDLE)
+ , _commandBuffer(VK_NULL_HANDLE)
, _state(State::ReadyForBegin)
, _fence(nullptr)
, _fenceSignaledCounter(0)
@@ -164,7 +164,7 @@ CmdBufferVulkan::CmdBufferVulkan(GPUDeviceVulkan* device, CmdBufferPoolVulkan* p
createCmdBufInfo.commandBufferCount = 1;
createCmdBufInfo.commandPool = _commandBufferPool->GetHandle();
- VALIDATE_VULKAN_RESULT(vkAllocateCommandBuffers(_device->Device, &createCmdBufInfo, &_commandBufferHandle));
+ VALIDATE_VULKAN_RESULT(vkAllocateCommandBuffers(_device->Device, &createCmdBufInfo, &_commandBuffer));
_fence = _device->FenceManager.AllocateFence();
}
@@ -183,13 +183,13 @@ CmdBufferVulkan::~CmdBufferVulkan()
fenceManager.ReleaseFence(_fence);
}
- vkFreeCommandBuffers(_device->Device, _commandBufferPool->GetHandle(), 1, &_commandBufferHandle);
+ vkFreeCommandBuffers(_device->Device, _commandBufferPool->GetHandle(), 1, &_commandBuffer);
}
CmdBufferVulkan* CmdBufferPoolVulkan::Create()
{
- const auto cmdBuffer = New(Device, this);
- CmdBuffers.Add(cmdBuffer);
+ const auto cmdBuffer = New(_device, this);
+ _cmdBuffers.Add(cmdBuffer);
return cmdBuffer;
}
@@ -200,30 +200,30 @@ void CmdBufferPoolVulkan::Create(uint32 queueFamilyIndex)
poolInfo.queueFamilyIndex = queueFamilyIndex;
// TODO: use VK_COMMAND_POOL_CREATE_TRANSIENT_BIT?
poolInfo.flags = VK_COMMAND_POOL_CREATE_RESET_COMMAND_BUFFER_BIT;
- VALIDATE_VULKAN_RESULT(vkCreateCommandPool(Device->Device, &poolInfo, nullptr, &Handle));
+ VALIDATE_VULKAN_RESULT(vkCreateCommandPool(_device->Device, &poolInfo, nullptr, &_handle));
}
CmdBufferPoolVulkan::CmdBufferPoolVulkan(GPUDeviceVulkan* device)
- : Device(device)
- , Handle(VK_NULL_HANDLE)
+ : _device(device)
+ , _handle(VK_NULL_HANDLE)
{
}
CmdBufferPoolVulkan::~CmdBufferPoolVulkan()
{
- for (int32 i = 0; i < CmdBuffers.Count(); i++)
+ for (int32 i = 0; i < _cmdBuffers.Count(); i++)
{
- Delete(CmdBuffers[i]);
+ Delete(_cmdBuffers[i]);
}
- vkDestroyCommandPool(Device->Device, Handle, nullptr);
+ vkDestroyCommandPool(_device->Device, _handle, nullptr);
}
void CmdBufferPoolVulkan::RefreshFenceStatus(CmdBufferVulkan* skipCmdBuffer)
{
- for (int32 i = 0; i < CmdBuffers.Count(); i++)
+ for (int32 i = 0; i < _cmdBuffers.Count(); i++)
{
- auto cmdBuffer = CmdBuffers[i];
+ auto cmdBuffer = _cmdBuffers[i];
if (cmdBuffer != skipCmdBuffer)
{
cmdBuffer->RefreshFenceStatus();
@@ -232,63 +232,63 @@ void CmdBufferPoolVulkan::RefreshFenceStatus(CmdBufferVulkan* skipCmdBuffer)
}
CmdBufferManagerVulkan::CmdBufferManagerVulkan(GPUDeviceVulkan* device, GPUContextVulkan* context)
- : Device(device)
- , Pool(device)
- , Queue(context->GetQueue())
- , ActiveCmdBuffer(nullptr)
+ : _device(device)
+ , _pool(device)
+ , _queue(context->GetQueue())
+ , _activeCmdBuffer(nullptr)
{
- Pool.Create(Queue->GetFamilyIndex());
+ _pool.Create(_queue->GetFamilyIndex());
}
void CmdBufferManagerVulkan::SubmitActiveCmdBuffer(SemaphoreVulkan* signalSemaphore)
{
- ASSERT(ActiveCmdBuffer);
- if (!ActiveCmdBuffer->IsSubmitted() && ActiveCmdBuffer->HasBegun())
+ ASSERT(_activeCmdBuffer);
+ if (!_activeCmdBuffer->IsSubmitted() && _activeCmdBuffer->HasBegun())
{
- if (ActiveCmdBuffer->IsInsideRenderPass())
+ if (_activeCmdBuffer->IsInsideRenderPass())
{
- ActiveCmdBuffer->EndRenderPass();
+ _activeCmdBuffer->EndRenderPass();
}
// Pause all active queries
- for (int32 i = 0; i < QueriesInProgress.Count(); i++)
+ for (int32 i = 0; i < _queriesInProgress.Count(); i++)
{
- QueriesInProgress[i]->Interrupt(ActiveCmdBuffer);
+ _queriesInProgress[i]->Interrupt(_activeCmdBuffer);
}
- ActiveCmdBuffer->End();
+ _activeCmdBuffer->End();
if (signalSemaphore)
{
- Queue->Submit(ActiveCmdBuffer, signalSemaphore->GetHandle());
+ _queue->Submit(_activeCmdBuffer, signalSemaphore->GetHandle());
}
else
{
- Queue->Submit(ActiveCmdBuffer);
+ _queue->Submit(_activeCmdBuffer);
}
}
- ActiveCmdBuffer = nullptr;
+ _activeCmdBuffer = nullptr;
}
void CmdBufferManagerVulkan::WaitForCmdBuffer(CmdBufferVulkan* cmdBuffer, float timeInSecondsToWait)
{
ASSERT(cmdBuffer->IsSubmitted());
- bool success = Device->FenceManager.WaitForFence(cmdBuffer->GetFence(), (uint64)(timeInSecondsToWait * 1e9));
- ASSERT(success);
+ const bool failed = _device->FenceManager.WaitForFence(cmdBuffer->GetFence(), (uint64)(timeInSecondsToWait * 1e9));
+ ASSERT(!failed);
cmdBuffer->RefreshFenceStatus();
}
void CmdBufferManagerVulkan::PrepareForNewActiveCommandBuffer()
{
- for (int32 i = 0; i < Pool.CmdBuffers.Count(); i++)
+ for (int32 i = 0; i < _pool._cmdBuffers.Count(); i++)
{
- auto cmdBuffer = Pool.CmdBuffers[i];
+ auto cmdBuffer = _pool._cmdBuffers[i];
cmdBuffer->RefreshFenceStatus();
if (cmdBuffer->GetState() == CmdBufferVulkan::State::ReadyForBegin)
{
- ActiveCmdBuffer = cmdBuffer;
- ActiveCmdBuffer->Begin();
+ _activeCmdBuffer = cmdBuffer;
+ _activeCmdBuffer->Begin();
return;
}
else
@@ -297,25 +297,25 @@ void CmdBufferManagerVulkan::PrepareForNewActiveCommandBuffer()
}
}
- // All cmd buffers are being executed still
- ActiveCmdBuffer = Pool.Create();
- ActiveCmdBuffer->Begin();
+ // Always begin fresh command buffer for rendering
+ _activeCmdBuffer = _pool.Create();
+ _activeCmdBuffer->Begin();
// Resume any paused queries with the new command buffer
- for (int32 i = 0; i < QueriesInProgress.Count(); i++)
+ for (int32 i = 0; i < _queriesInProgress.Count(); i++)
{
- QueriesInProgress[i]->Resume(ActiveCmdBuffer);
+ _queriesInProgress[i]->Resume(_activeCmdBuffer);
}
}
void CmdBufferManagerVulkan::OnQueryBegin(GPUTimerQueryVulkan* query)
{
- QueriesInProgress.Add(query);
+ _queriesInProgress.Add(query);
}
void CmdBufferManagerVulkan::OnQueryEnd(GPUTimerQueryVulkan* query)
{
- QueriesInProgress.Remove(query);
+ _queriesInProgress.Remove(query);
}
#endif
diff --git a/Source/Engine/GraphicsDevice/Vulkan/CmdBufferVulkan.h b/Source/Engine/GraphicsDevice/Vulkan/CmdBufferVulkan.h
index 553e844e7..b3e144e9b 100644
--- a/Source/Engine/GraphicsDevice/Vulkan/CmdBufferVulkan.h
+++ b/Source/Engine/GraphicsDevice/Vulkan/CmdBufferVulkan.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
@@ -34,33 +34,24 @@ public:
private:
GPUDeviceVulkan* _device;
- VkCommandBuffer _commandBufferHandle;
+ VkCommandBuffer _commandBuffer;
State _state;
Array _waitFlags;
Array _waitSemaphores;
Array _submittedWaitSemaphores;
- void MarkSemaphoresAsSubmitted()
- {
- _waitFlags.Clear();
-
- // Move to pending delete list
- _submittedWaitSemaphores = _waitSemaphores;
- _waitSemaphores.Clear();
- }
-
FenceVulkan* _fence;
#if GPU_ALLOW_PROFILE_EVENTS
int32 _eventsBegin = 0;
#endif
- // Last value passed after the fence got signaled
- volatile uint64 _fenceSignaledCounter;
-
- // Last value when we submitted the cmd buffer; useful to track down if something waiting for the fence has actually been submitted
+ // The latest value when command buffer was submitted.
volatile uint64 _submittedFenceCounter;
+ // The latest value passed after the fence was signaled.
+ volatile uint64 _fenceSignaledCounter;
+
CmdBufferPoolVulkan* _commandBufferPool;
DescriptorPoolSetContainerVulkan* _descriptorPoolSetContainer = nullptr;
@@ -73,17 +64,17 @@ public:
public:
- CmdBufferPoolVulkan* GetOwner()
+ CmdBufferPoolVulkan* GetOwner() const
{
return _commandBufferPool;
}
- State GetState()
+ State GetState() const
{
return _state;
}
- FenceVulkan* GetFence()
+ FenceVulkan* GetFence() const
{
return _fence;
}
@@ -115,7 +106,7 @@ public:
inline VkCommandBuffer GetHandle() const
{
- return _commandBufferHandle;
+ return _commandBuffer;
}
inline volatile uint64 GetFenceSignaledCounter() const
@@ -155,30 +146,28 @@ public:
class CmdBufferPoolVulkan
{
+ friend class CmdBufferManagerVulkan;
private:
- GPUDeviceVulkan* Device;
- VkCommandPool Handle;
+ GPUDeviceVulkan* _device;
+ VkCommandPool _handle;
+ Array _cmdBuffers;
CmdBufferVulkan* Create();
- Array CmdBuffers;
-
void Create(uint32 queueFamilyIndex);
- friend class CmdBufferManagerVulkan;
public:
CmdBufferPoolVulkan(GPUDeviceVulkan* device);
-
~CmdBufferPoolVulkan();
public:
inline VkCommandPool GetHandle() const
{
- ASSERT(Handle != VK_NULL_HANDLE);
- return Handle;
+ ASSERT(_handle != VK_NULL_HANDLE);
+ return _handle;
}
void RefreshFenceStatus(CmdBufferVulkan* skipCmdBuffer = nullptr);
@@ -188,11 +177,11 @@ class CmdBufferManagerVulkan
{
private:
- GPUDeviceVulkan* Device;
- CmdBufferPoolVulkan Pool;
- QueueVulkan* Queue;
- CmdBufferVulkan* ActiveCmdBuffer;
- Array QueriesInProgress;
+ GPUDeviceVulkan* _device;
+ CmdBufferPoolVulkan _pool;
+ QueueVulkan* _queue;
+ CmdBufferVulkan* _activeCmdBuffer;
+ Array _queriesInProgress;
public:
@@ -200,46 +189,46 @@ public:
public:
- inline VkCommandPool GetHandle() const
+ FORCE_INLINE VkCommandPool GetHandle() const
{
- return Pool.GetHandle();
+ return _pool.GetHandle();
}
- inline CmdBufferVulkan* GetActiveCmdBuffer() const
+ FORCE_INLINE CmdBufferVulkan* GetActiveCmdBuffer() const
{
- return ActiveCmdBuffer;
+ return _activeCmdBuffer;
}
- inline bool HasPendingActiveCmdBuffer() const
+ FORCE_INLINE bool HasPendingActiveCmdBuffer() const
{
- return ActiveCmdBuffer != nullptr;
+ return _activeCmdBuffer != nullptr;
}
- inline bool HasQueriesInProgress() const
+ FORCE_INLINE bool HasQueriesInProgress() const
{
- return QueriesInProgress.Count() != 0;
+ return _queriesInProgress.Count() != 0;
}
+ CmdBufferVulkan* GetCmdBuffer()
+ {
+ if (!_activeCmdBuffer)
+ PrepareForNewActiveCommandBuffer();
+ return _activeCmdBuffer;
+ }
+
+public:
+
void SubmitActiveCmdBuffer(SemaphoreVulkan* signalSemaphore = nullptr);
void WaitForCmdBuffer(CmdBufferVulkan* cmdBuffer, float timeInSecondsToWait = 1.0f);
- // Update the fences of all cmd buffers except SkipCmdBuffer
void RefreshFenceStatus(CmdBufferVulkan* skipCmdBuffer = nullptr)
{
- Pool.RefreshFenceStatus(skipCmdBuffer);
+ _pool.RefreshFenceStatus(skipCmdBuffer);
}
void PrepareForNewActiveCommandBuffer();
- inline CmdBufferVulkan* GetCmdBuffer()
- {
- if (!ActiveCmdBuffer)
- PrepareForNewActiveCommandBuffer();
-
- return ActiveCmdBuffer;
- }
-
void OnQueryBegin(GPUTimerQueryVulkan* query);
void OnQueryEnd(GPUTimerQueryVulkan* query);
};
diff --git a/Source/Engine/GraphicsDevice/Vulkan/Config.h b/Source/Engine/GraphicsDevice/Vulkan/Config.h
index a3bb1662c..a55292197 100644
--- a/Source/Engine/GraphicsDevice/Vulkan/Config.h
+++ b/Source/Engine/GraphicsDevice/Vulkan/Config.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
@@ -26,37 +26,10 @@
#define VULKAN_ENABLE_API_DUMP 0
#define VULKAN_RESET_QUERY_POOLS 0
#define VULKAN_HASH_POOLS_WITH_TYPES_USAGE_ID 1
-
-#ifndef VULKAN_USE_DEBUG_LAYER
#define VULKAN_USE_DEBUG_LAYER GPU_ENABLE_DIAGNOSTICS
-#endif
#ifndef VULKAN_HAS_PHYSICAL_DEVICE_PROPERTIES2
#define VULKAN_HAS_PHYSICAL_DEVICE_PROPERTIES2 0
#endif
-#ifdef VK_KHR_maintenance1
-#define VULKAN_SUPPORTS_MAINTENANCE_LAYER1 1
-#else
-#define VULKAN_SUPPORTS_MAINTENANCE_LAYER1 0
-#endif
-
-#ifdef VK_KHR_maintenance2
-#define VULKAN_SUPPORTS_MAINTENANCE_LAYER2 1
-#else
-#define VULKAN_SUPPORTS_MAINTENANCE_LAYER2 0
-#endif
-
-#ifdef VK_EXT_validation_cache
-#define VULKAN_SUPPORTS_VALIDATION_CACHE 1
-#else
-#define VULKAN_SUPPORTS_VALIDATION_CACHE 0
-#endif
-
-#ifdef VK_EXT_debug_utils
-#define VULKAN_SUPPORTS_DEBUG_UTILS 1
-#else
-#define VULKAN_SUPPORTS_DEBUG_UTILS 0
-#endif
-
#endif
diff --git a/Source/Engine/GraphicsDevice/Vulkan/DescriptorSetVulkan.cpp b/Source/Engine/GraphicsDevice/Vulkan/DescriptorSetVulkan.cpp
index 1a60dbbae..a06b4b1e4 100644
--- a/Source/Engine/GraphicsDevice/Vulkan/DescriptorSetVulkan.cpp
+++ b/Source/Engine/GraphicsDevice/Vulkan/DescriptorSetVulkan.cpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#if GRAPHICS_API_VULKAN
@@ -32,7 +32,6 @@ void DescriptorSetLayoutInfoVulkan::CacheTypesUsageID()
void DescriptorSetLayoutInfoVulkan::AddDescriptor(int32 descriptorSetIndex, const VkDescriptorSetLayoutBinding& descriptor)
{
- // Increment type usage
_layoutTypes[descriptor.descriptorType]++;
if (descriptorSetIndex >= _setLayouts.Count())
@@ -43,7 +42,6 @@ void DescriptorSetLayoutInfoVulkan::AddDescriptor(int32 descriptorSetIndex, cons
SetLayout& descSetLayout = _setLayouts[descriptorSetIndex];
descSetLayout.LayoutBindings.Add(descriptor);
- // TODO: manual hash update method?
_hash = Crc::MemCrc32(&descriptor, sizeof(descriptor), _hash);
}
@@ -82,61 +80,24 @@ void DescriptorSetLayoutVulkan::Compile()
{
ASSERT(_handles.IsEmpty());
- // Check if we obey limits
+ // Validate device limits for the engine
const VkPhysicalDeviceLimits& limits = _device->PhysicalDeviceLimits;
-
- // Check for maxDescriptorSetSamplers
- ASSERT(_layoutTypes[VK_DESCRIPTOR_TYPE_SAMPLER]
- + _layoutTypes[VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER]
- < limits.maxDescriptorSetSamplers);
-
- // Check for maxDescriptorSetUniformBuffers
- ASSERT(_layoutTypes[VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER]
- + _layoutTypes[VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC]
- < limits.maxDescriptorSetUniformBuffers);
-
- // Check for maxDescriptorSetUniformBuffersDynamic
- if (!_device->Adapter->IsAMD())
- {
- ASSERT(_layoutTypes[VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC]
- < limits.maxDescriptorSetUniformBuffersDynamic);
- }
-
- // Check for maxDescriptorSetStorageBuffers
- ASSERT(_layoutTypes[VK_DESCRIPTOR_TYPE_STORAGE_BUFFER]
- + _layoutTypes[VK_DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC]
- < limits.maxDescriptorSetStorageBuffers);
-
- // Check for maxDescriptorSetStorageBuffersDynamic
- if (_layoutTypes[VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC] > limits.maxDescriptorSetUniformBuffersDynamic)
- {
- // TODO: Downgrade to non-dynamic?
- }
- ASSERT(_layoutTypes[VK_DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC]
- < limits.maxDescriptorSetStorageBuffersDynamic);
-
- // Check for maxDescriptorSetSampledImages
- ASSERT(_layoutTypes[VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER]
- + _layoutTypes[VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE]
- + _layoutTypes[VK_DESCRIPTOR_TYPE_UNIFORM_TEXEL_BUFFER]
- < limits.maxDescriptorSetSampledImages);
-
- // Check for maxDescriptorSetStorageImages
- ASSERT(_layoutTypes[VK_DESCRIPTOR_TYPE_STORAGE_IMAGE]
- + _layoutTypes[VK_DESCRIPTOR_TYPE_STORAGE_TEXEL_BUFFER]
- < limits.maxDescriptorSetStorageImages);
+ ASSERT(_layoutTypes[VK_DESCRIPTOR_TYPE_SAMPLER] + _layoutTypes[VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER] < limits.maxDescriptorSetSamplers);
+ ASSERT(_layoutTypes[VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER]+ _layoutTypes[VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC] < limits.maxDescriptorSetUniformBuffers);
+ ASSERT(_layoutTypes[VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC] < limits.maxDescriptorSetUniformBuffersDynamic);
+ ASSERT(_layoutTypes[VK_DESCRIPTOR_TYPE_STORAGE_BUFFER] + _layoutTypes[VK_DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC] < limits.maxDescriptorSetStorageBuffers);
+ ASSERT(_layoutTypes[VK_DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC] < limits.maxDescriptorSetStorageBuffersDynamic);
+ ASSERT(_layoutTypes[VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER] + _layoutTypes[VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE] + _layoutTypes[VK_DESCRIPTOR_TYPE_UNIFORM_TEXEL_BUFFER] < limits.maxDescriptorSetSampledImages);
+ ASSERT(_layoutTypes[VK_DESCRIPTOR_TYPE_STORAGE_IMAGE] + _layoutTypes[VK_DESCRIPTOR_TYPE_STORAGE_TEXEL_BUFFER]< limits.maxDescriptorSetStorageImages);
_handles.Resize(_setLayouts.Count());
-
for (int32 i = 0; i < _setLayouts.Count(); i++)
{
auto& layout = _setLayouts[i];
-
VkDescriptorSetLayoutCreateInfo layoutInfo;
RenderToolsVulkan::ZeroStruct(layoutInfo, VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_CREATE_INFO);
layoutInfo.bindingCount = layout.LayoutBindings.Count();
layoutInfo.pBindings = layout.LayoutBindings.Get();
-
VALIDATE_VULKAN_RESULT(vkCreateDescriptorSetLayout(_device->Device, &layoutInfo, nullptr, &_handles[i]));
}
@@ -153,25 +114,20 @@ void DescriptorSetLayoutVulkan::Compile()
DescriptorPoolVulkan::DescriptorPoolVulkan(GPUDeviceVulkan* device, const DescriptorSetLayoutVulkan& layout)
: _device(device)
, _handle(VK_NULL_HANDLE)
- , DescriptorSetsMax(0)
- , AllocatedDescriptorSetsCount(0)
- , AllocatedDescriptorSetsCountMax(0)
- , Layout(layout)
+ , _descriptorSetsMax(0)
+ , _allocatedDescriptorSetsCount(0)
+ , _allocatedDescriptorSetsCountMax(0)
+ , _layout(layout)
{
Array> types;
// The maximum amount of descriptor sets layout allocations to hold
const uint32 MaxSetsAllocations = 256;
-
- // Descriptor sets number required to allocate the max number of descriptor sets layout.
- // When we're hashing pools with types usage ID the descriptor pool can be used for different layouts so the initial layout does not make much sense.
- // In the latter case we'll be probably over-allocating the descriptor types but given the relatively small number of max allocations this should not have
- // a serious impact.
- DescriptorSetsMax = MaxSetsAllocations * (VULKAN_HASH_POOLS_WITH_TYPES_USAGE_ID ? 1 : Layout.GetLayouts().Count());
+ _descriptorSetsMax = MaxSetsAllocations * (VULKAN_HASH_POOLS_WITH_TYPES_USAGE_ID ? 1 : _layout.GetLayouts().Count());
for (uint32 typeIndex = VULKAN_DESCRIPTOR_TYPE_BEGIN; typeIndex <= VULKAN_DESCRIPTOR_TYPE_END; typeIndex++)
{
const VkDescriptorType descriptorType = (VkDescriptorType)typeIndex;
- const uint32 typesUsed = Layout.GetTypesUsed(descriptorType);
+ const uint32 typesUsed = _layout.GetTypesUsed(descriptorType);
if (typesUsed > 0)
{
VkDescriptorPoolSize& type = types.AddOne();
@@ -186,7 +142,7 @@ DescriptorPoolVulkan::DescriptorPoolVulkan(GPUDeviceVulkan* device, const Descri
createInfo.flags = VK_DESCRIPTOR_POOL_CREATE_FREE_DESCRIPTOR_SET_BIT;
createInfo.poolSizeCount = types.Count();
createInfo.pPoolSizes = types.Get();
- createInfo.maxSets = DescriptorSetsMax;
+ createInfo.maxSets = _descriptorSetsMax;
VALIDATE_VULKAN_RESULT(vkCreateDescriptorPool(_device->Device, &createInfo, nullptr, &_handle));
}
@@ -198,16 +154,16 @@ DescriptorPoolVulkan::~DescriptorPoolVulkan()
}
}
-void DescriptorPoolVulkan::TrackAddUsage(const DescriptorSetLayoutVulkan& layout)
+void DescriptorPoolVulkan::Track(const DescriptorSetLayoutVulkan& layout)
{
- // Check and increment our current type usage
+#if !BUILD_RELEASE
for (uint32 typeIndex = VULKAN_DESCRIPTOR_TYPE_BEGIN; typeIndex <= VULKAN_DESCRIPTOR_TYPE_END; typeIndex++)
{
- ASSERT(Layout.GetTypesUsed((VkDescriptorType)typeIndex) == layout.GetTypesUsed((VkDescriptorType)typeIndex));
+ ASSERT(_layout.GetTypesUsed((VkDescriptorType)typeIndex) == layout.GetTypesUsed((VkDescriptorType)typeIndex));
}
-
- AllocatedDescriptorSetsCount += layout.GetLayouts().Count();
- AllocatedDescriptorSetsCountMax = Math::Max(AllocatedDescriptorSetsCount, AllocatedDescriptorSetsCountMax);
+#endif
+ _allocatedDescriptorSetsCount += layout.GetLayouts().Count();
+ _allocatedDescriptorSetsCountMax = Math::Max(_allocatedDescriptorSetsCount, _allocatedDescriptorSetsCountMax);
}
void DescriptorPoolVulkan::TrackRemoveUsage(const DescriptorSetLayoutVulkan& layout)
@@ -215,10 +171,10 @@ void DescriptorPoolVulkan::TrackRemoveUsage(const DescriptorSetLayoutVulkan& lay
// Check and increment our current type usage
for (uint32 typeIndex = VULKAN_DESCRIPTOR_TYPE_BEGIN; typeIndex <= VULKAN_DESCRIPTOR_TYPE_END; typeIndex++)
{
- ASSERT(Layout.GetTypesUsed((VkDescriptorType)typeIndex) == layout.GetTypesUsed((VkDescriptorType)typeIndex));
+ ASSERT(_layout.GetTypesUsed((VkDescriptorType)typeIndex) == layout.GetTypesUsed((VkDescriptorType)typeIndex));
}
- AllocatedDescriptorSetsCount -= layout.GetLayouts().Count();
+ _allocatedDescriptorSetsCount -= layout.GetLayouts().Count();
}
void DescriptorPoolVulkan::Reset()
@@ -227,7 +183,7 @@ void DescriptorPoolVulkan::Reset()
{
VALIDATE_VULKAN_RESULT(vkResetDescriptorPool(_device->Device, _handle, 0));
}
- AllocatedDescriptorSetsCount = 0;
+ _allocatedDescriptorSetsCount = 0;
}
bool DescriptorPoolVulkan::AllocateDescriptorSets(const VkDescriptorSetAllocateInfo& descriptorSetAllocateInfo, VkDescriptorSet* result)
@@ -377,8 +333,6 @@ void DescriptorPoolsManagerVulkan::ReleasePoolSet(DescriptorPoolSetContainerVulk
void DescriptorPoolsManagerVulkan::GC()
{
ScopeLock lock(_locker);
-
- // Pool sets are forward allocated - iterate from the back to increase the chance of finding an unused one
for (int32 i = _poolSets.Count() - 1; i >= 0; i--)
{
const auto poolSet = _poolSets[i];
@@ -416,12 +370,12 @@ PipelineLayoutVulkan::~PipelineLayoutVulkan()
}
}
-uint32 DescriptorSetWriterVulkan::SetupDescriptorWrites(const SpirvShaderDescriptorInfo& info, VkWriteDescriptorSet* writeDescriptors, VkDescriptorImageInfo* imageInfo, VkDescriptorBufferInfo* bufferInfo, uint8* bindingToDynamicOffsetMap)
+uint32 DescriptorSetWriterVulkan::SetupDescriptorWrites(const SpirvShaderDescriptorInfo& info, VkWriteDescriptorSet* writeDescriptors, VkDescriptorImageInfo* imageInfo, VkDescriptorBufferInfo* bufferInfo, uint8* bindingToDynamicOffset)
{
+ ASSERT(info.DescriptorTypesCount <= 64);
WriteDescriptors = writeDescriptors;
WritesCount = info.DescriptorTypesCount;
- ASSERT(info.DescriptorTypesCount <= 64 && TEXT("Out of bits for Dirty Mask! More than 64 resources in one descriptor set!"));
- BindingToDynamicOffsetMap = bindingToDynamicOffsetMap;
+ BindingToDynamicOffset = bindingToDynamicOffset;
uint32 dynamicOffsetIndex = 0;
for (uint32 i = 0; i < info.DescriptorTypesCount; i++)
@@ -434,8 +388,8 @@ uint32 DescriptorSetWriterVulkan::SetupDescriptorWrites(const SpirvShaderDescrip
switch (writeDescriptors->descriptorType)
{
case VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC:
- BindingToDynamicOffsetMap[i] = dynamicOffsetIndex;
- ++dynamicOffsetIndex;
+ BindingToDynamicOffset[i] = dynamicOffsetIndex;
+ dynamicOffsetIndex++;
writeDescriptors->pBufferInfo = bufferInfo++;
break;
case VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER:
diff --git a/Source/Engine/GraphicsDevice/Vulkan/DescriptorSetVulkan.h b/Source/Engine/GraphicsDevice/Vulkan/DescriptorSetVulkan.h
index 78ea83eb2..279a6f052 100644
--- a/Source/Engine/GraphicsDevice/Vulkan/DescriptorSetVulkan.h
+++ b/Source/Engine/GraphicsDevice/Vulkan/DescriptorSetVulkan.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
@@ -230,16 +230,15 @@ private:
GPUDeviceVulkan* _device;
VkDescriptorPool _handle;
- uint32 DescriptorSetsMax;
- uint32 AllocatedDescriptorSetsCount;
- uint32 AllocatedDescriptorSetsCountMax;
+ uint32 _descriptorSetsMax;
+ uint32 _allocatedDescriptorSetsCount;
+ uint32 _allocatedDescriptorSetsCountMax;
- const DescriptorSetLayoutVulkan& Layout;
+ const DescriptorSetLayoutVulkan& _layout;
public:
DescriptorPoolVulkan(GPUDeviceVulkan* device, const DescriptorSetLayoutVulkan& layout);
-
~DescriptorPoolVulkan();
public:
@@ -251,25 +250,24 @@ public:
inline bool IsEmpty() const
{
- return AllocatedDescriptorSetsCount == 0;
+ return _allocatedDescriptorSetsCount == 0;
}
inline bool CanAllocate(const DescriptorSetLayoutVulkan& layout) const
{
- return DescriptorSetsMax > AllocatedDescriptorSetsCount + layout.GetLayouts().Count();
+ return _descriptorSetsMax > _allocatedDescriptorSetsCount + layout.GetLayouts().Count();
}
inline uint32 GetAllocatedDescriptorSetsCount() const
{
- return AllocatedDescriptorSetsCount;
+ return _allocatedDescriptorSetsCount;
}
- void TrackAddUsage(const DescriptorSetLayoutVulkan& layout);
+public:
+ void Track(const DescriptorSetLayoutVulkan& layout);
void TrackRemoveUsage(const DescriptorSetLayoutVulkan& layout);
-
void Reset();
-
bool AllocateDescriptorSets(const VkDescriptorSetAllocateInfo& descriptorSetAllocateInfo, VkDescriptorSet* result);
};
@@ -416,14 +414,14 @@ struct DescriptorSetWriteContainerVulkan
Array DescriptorImageInfo;
Array DescriptorBufferInfo;
Array DescriptorWrites;
- Array BindingToDynamicOffsetMap;
+ Array BindingToDynamicOffset;
void Release()
{
DescriptorImageInfo.Resize(0);
DescriptorBufferInfo.Resize(0);
DescriptorWrites.Resize(0);
- BindingToDynamicOffsetMap.Resize(0);
+ BindingToDynamicOffset.Resize(0);
}
};
@@ -431,24 +429,14 @@ class DescriptorSetWriterVulkan
{
public:
- VkWriteDescriptorSet* WriteDescriptors;
- uint8* BindingToDynamicOffsetMap;
- uint32* DynamicOffsets;
- uint32 WritesCount;
+ VkWriteDescriptorSet* WriteDescriptors = nullptr;
+ byte* BindingToDynamicOffset = nullptr;
+ uint32* DynamicOffsets = nullptr;
+ uint32 WritesCount = 0;
public:
- DescriptorSetWriterVulkan()
- : WriteDescriptors(nullptr)
- , BindingToDynamicOffsetMap(nullptr)
- , DynamicOffsets(nullptr)
- , WritesCount(0)
- {
- }
-
-public:
-
- uint32 SetupDescriptorWrites(const SpirvShaderDescriptorInfo& info, VkWriteDescriptorSet* writeDescriptors, VkDescriptorImageInfo* imageInfo, VkDescriptorBufferInfo* bufferInfo, uint8* bindingToDynamicOffsetMap);
+ uint32 SetupDescriptorWrites(const SpirvShaderDescriptorInfo& info, VkWriteDescriptorSet* writeDescriptors, VkDescriptorImageInfo* imageInfo, VkDescriptorBufferInfo* bufferInfo, byte* bindingToDynamicOffset);
bool WriteUniformBuffer(uint32 descriptorIndex, VkBuffer buffer, VkDeviceSize offset, VkDeviceSize range) const
{
@@ -471,7 +459,7 @@ public:
bool edited = DescriptorSet::CopyAndReturnNotEqual(bufferInfo->buffer, buffer);
edited |= DescriptorSet::CopyAndReturnNotEqual(bufferInfo->offset, offset);
edited |= DescriptorSet::CopyAndReturnNotEqual(bufferInfo->range, range);
- const uint8 dynamicOffsetIndex = BindingToDynamicOffsetMap[descriptorIndex];
+ const byte dynamicOffsetIndex = BindingToDynamicOffset[descriptorIndex];
DynamicOffsets[dynamicOffsetIndex] = dynamicOffset;
return edited;
}
diff --git a/Source/Engine/GraphicsDevice/Vulkan/GPUAdapterVulkan.cpp b/Source/Engine/GraphicsDevice/Vulkan/GPUAdapterVulkan.cpp
index 4d451fa52..2ddeb19b4 100644
--- a/Source/Engine/GraphicsDevice/Vulkan/GPUAdapterVulkan.cpp
+++ b/Source/Engine/GraphicsDevice/Vulkan/GPUAdapterVulkan.cpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#if GRAPHICS_API_VULKAN
diff --git a/Source/Engine/GraphicsDevice/Vulkan/GPUAdapterVulkan.h b/Source/Engine/GraphicsDevice/Vulkan/GPUAdapterVulkan.h
index 17a9212e7..d35c596e4 100644
--- a/Source/Engine/GraphicsDevice/Vulkan/GPUAdapterVulkan.h
+++ b/Source/Engine/GraphicsDevice/Vulkan/GPUAdapterVulkan.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/GraphicsDevice/Vulkan/GPUBufferVulkan.cpp b/Source/Engine/GraphicsDevice/Vulkan/GPUBufferVulkan.cpp
index f3f3a80f9..1cd90b11b 100644
--- a/Source/Engine/GraphicsDevice/Vulkan/GPUBufferVulkan.cpp
+++ b/Source/Engine/GraphicsDevice/Vulkan/GPUBufferVulkan.cpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#if GRAPHICS_API_VULKAN
diff --git a/Source/Engine/GraphicsDevice/Vulkan/GPUBufferVulkan.h b/Source/Engine/GraphicsDevice/Vulkan/GPUBufferVulkan.h
index c51b2f828..2949c2725 100644
--- a/Source/Engine/GraphicsDevice/Vulkan/GPUBufferVulkan.h
+++ b/Source/Engine/GraphicsDevice/Vulkan/GPUBufferVulkan.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/GraphicsDevice/Vulkan/GPUContextVulkan.cpp b/Source/Engine/GraphicsDevice/Vulkan/GPUContextVulkan.cpp
index 881e575e7..ea8fa6502 100644
--- a/Source/Engine/GraphicsDevice/Vulkan/GPUContextVulkan.cpp
+++ b/Source/Engine/GraphicsDevice/Vulkan/GPUContextVulkan.cpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#if GRAPHICS_API_VULKAN
@@ -146,7 +146,6 @@ void GPUContextVulkan::AddImageBarrier(GPUTextureViewVulkan* handle, VkImageLayo
{
// Transition entire resource at once
const VkImageLayout srcLayout = state.GetSubresourceState(0);
-
VkImageSubresourceRange range;
range.aspectMask = handle->Info.subresourceRange.aspectMask;
range.baseMipLevel = 0;
@@ -157,7 +156,7 @@ void GPUContextVulkan::AddImageBarrier(GPUTextureViewVulkan* handle, VkImageLayo
}
else
{
- // Slow path. Want to transition the entire resource (with multiple subresources). But they aren't in the same state.
+ // Slow path to transition each subresource
for (int32 i = 0; i < state.GetSubresourcesCount(); i++)
{
const VkImageLayout srcLayout = state.GetSubresourceState(i);
@@ -174,8 +173,6 @@ void GPUContextVulkan::AddImageBarrier(GPUTextureViewVulkan* handle, VkImageLayo
state.SetSubresourceState(i, dstLayout);
}
}
-
- // The entire resource should now be in the after state on this command list
ASSERT(state.CheckResourceState(dstLayout));
}
@@ -538,7 +535,7 @@ void GPUContextVulkan::UpdateDescriptorSets(GPUPipelineStateVulkan* pipelineStat
remainingHasDescriptorsPerStageMask >>= 1;
}
- // Allocate sets based on what changed
+ // Allocate sets if need to
//if (needsWrite) // TODO: write on change only?
{
if (!pipelineState->AllocateDescriptorSets())
@@ -578,7 +575,7 @@ void GPUContextVulkan::UpdateDescriptorSets(ComputePipelineStateVulkan* pipeline
// Update descriptors
UpdateDescriptorSets(*pipelineState->DescriptorInfo, pipelineState->DSWriter, needsWrite);
- // Allocate sets based on what changed
+ // Allocate sets if need to
//if (needsWrite) // TODO: write on change only?f
{
if (!pipelineState->AllocateDescriptorSets())
diff --git a/Source/Engine/GraphicsDevice/Vulkan/GPUContextVulkan.h b/Source/Engine/GraphicsDevice/Vulkan/GPUContextVulkan.h
index 8fd884cf2..a3d26f017 100644
--- a/Source/Engine/GraphicsDevice/Vulkan/GPUContextVulkan.h
+++ b/Source/Engine/GraphicsDevice/Vulkan/GPUContextVulkan.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/GraphicsDevice/Vulkan/GPUDeviceVulkan.Layers.cpp b/Source/Engine/GraphicsDevice/Vulkan/GPUDeviceVulkan.Layers.cpp
index 88c30d660..a814906d3 100644
--- a/Source/Engine/GraphicsDevice/Vulkan/GPUDeviceVulkan.Layers.cpp
+++ b/Source/Engine/GraphicsDevice/Vulkan/GPUDeviceVulkan.Layers.cpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#include "GPUDeviceVulkan.h"
#include "RenderToolsVulkan.h"
@@ -34,7 +34,7 @@ static const char* GValidationLayers[] =
static const char* GInstanceExtensions[] =
{
-#if VULKAN_SUPPORTS_VALIDATION_CACHE
+#if VK_EXT_validation_cache
VK_EXT_VALIDATION_CACHE_EXTENSION_NAME,
#endif
nullptr
@@ -43,39 +43,41 @@ static const char* GInstanceExtensions[] =
static const char* GDeviceExtensions[] =
{
VK_KHR_SWAPCHAIN_EXTENSION_NAME,
-#if VULKAN_SUPPORTS_MAINTENANCE_LAYER1
+#if VK_KHR_maintenance1
VK_KHR_MAINTENANCE1_EXTENSION_NAME,
#endif
-#if VULKAN_SUPPORTS_VALIDATION_CACHE
+#if VK_EXT_validation_cache
VK_EXT_VALIDATION_CACHE_EXTENSION_NAME,
#endif
+#if VK_KHR_sampler_mirror_clamp_to_edge
VK_KHR_SAMPLER_MIRROR_CLAMP_TO_EDGE_EXTENSION_NAME,
+#endif
nullptr
};
struct LayerExtension
{
- VkLayerProperties LayerProps;
- Array ExtensionProps;
+ VkLayerProperties Layer;
+ Array Extensions;
LayerExtension()
{
- Platform::MemoryClear(&LayerProps, sizeof(LayerProps));
+ Platform::MemoryClear(&Layer, sizeof(Layer));
}
- void AddUniqueExtensionNames(Array& result)
+ void GetExtensions(Array& result)
{
- for (int32 index = 0; index < ExtensionProps.Count(); index++)
+ for (auto& e : Extensions)
{
- result.AddUnique(StringAnsi(ExtensionProps[index].extensionName));
+ result.AddUnique(StringAnsi(e.extensionName));
}
}
- void AddAnsiExtensionNames(Array& result)
+ void GetExtensions(Array& result)
{
- for (int32 index = 0; index < ExtensionProps.Count(); index++)
+ for (auto& e : Extensions)
{
- result.AddUnique(ExtensionProps[index].extensionName);
+ result.AddUnique(e.extensionName);
}
}
};
@@ -91,9 +93,9 @@ static void EnumerateInstanceExtensionProperties(const char* layerName, LayerExt
if (count > 0)
{
- outLayer.ExtensionProps.Clear();
- outLayer.ExtensionProps.AddDefault(count);
- result = vkEnumerateInstanceExtensionProperties(layerName, &count, outLayer.ExtensionProps.Get());
+ outLayer.Extensions.Clear();
+ outLayer.Extensions.AddDefault(count);
+ result = vkEnumerateInstanceExtensionProperties(layerName, &count, outLayer.Extensions.Get());
ASSERT(result >= VK_SUCCESS);
}
} while (result == VK_INCOMPLETE);
@@ -110,9 +112,9 @@ static void EnumerateDeviceExtensionProperties(VkPhysicalDevice device, const ch
if (count > 0)
{
- outLayer.ExtensionProps.Clear();
- outLayer.ExtensionProps.AddDefault(count);
- result = vkEnumerateDeviceExtensionProperties(device, layerName, &count, outLayer.ExtensionProps.Get());
+ outLayer.Extensions.Clear();
+ outLayer.Extensions.AddDefault(count);
+ result = vkEnumerateDeviceExtensionProperties(device, layerName, &count, outLayer.Extensions.Get());
ASSERT(result >= VK_SUCCESS);
}
} while (result == VK_INCOMPLETE);
@@ -120,52 +122,50 @@ static void EnumerateDeviceExtensionProperties(VkPhysicalDevice device, const ch
static void TrimDuplicates(Array& array)
{
- for (int32 outerIndex = array.Count() - 1; outerIndex >= 0; --outerIndex)
+ for (int32 i = array.Count() - 1; i >= 0; i--)
{
bool found = false;
- for (int32 innerIndex = outerIndex - 1; innerIndex >= 0; --innerIndex)
+ for (int32 j = i - 1; j >= 0; j--)
{
- if (!StringUtils::Compare(array[outerIndex], array[innerIndex]))
+ if (!StringUtils::Compare(array[i], array[j]))
{
found = true;
break;
}
}
-
if (found)
{
- array.RemoveAt(outerIndex);
+ array.RemoveAt(i);
}
}
}
-static inline int FindLayerIndexInList(const Array& list, const char* layerName)
+static int FindLayerIndex(const Array& list, const char* layerName)
{
- // 0 is reserved for NULL/instance
for (int32 i = 1; i < list.Count(); i++)
{
- if (!StringUtils::Compare(list[i].LayerProps.layerName, layerName))
+ if (!StringUtils::Compare(list[i].Layer.layerName, layerName))
{
return i;
}
}
- return INVALID_INDEX;
+ return -1;
}
-static bool FindLayerInList(const Array& list, const char* layerName)
+static bool ContainsLayer(const Array& list, const char* layerName)
{
- return FindLayerIndexInList(list, layerName) != INVALID_INDEX;
+ return FindLayerIndex(list, layerName) != -1;
}
-static bool FindLayerExtensionInList(const Array& list, const char* extensionName, const char*& foundLayer)
+static bool FindLayerExtension(const Array& list, const char* extensionName, const char*& foundLayer)
{
for (int32 extIndex = 0; extIndex < list.Count(); extIndex++)
{
- for (int32 i = 0; i < list[extIndex].ExtensionProps.Count(); i++)
+ for (int32 i = 0; i < list[extIndex].Extensions.Count(); i++)
{
- if (!StringUtils::Compare(list[extIndex].ExtensionProps[i].extensionName, extensionName))
+ if (!StringUtils::Compare(list[extIndex].Extensions[i].extensionName, extensionName))
{
- foundLayer = list[extIndex].LayerProps.layerName;
+ foundLayer = list[extIndex].Layer.layerName;
return true;
}
}
@@ -173,10 +173,10 @@ static bool FindLayerExtensionInList(const Array& list, const ch
return false;
}
-static bool FindLayerExtensionInList(const Array& list, const char* extensionName)
+static bool FindLayerExtension(const Array& list, const char* extensionName)
{
const char* dummy = nullptr;
- return FindLayerExtensionInList(list, extensionName, dummy);
+ return FindLayerExtension(list, extensionName, dummy);
}
void GPUDeviceVulkan::GetInstanceLayersAndExtensions(Array& outInstanceExtensions, Array& outInstanceLayers, bool& outDebugUtils)
@@ -185,17 +185,14 @@ void GPUDeviceVulkan::GetInstanceLayersAndExtensions(Array& outInst
outDebugUtils = false;
Array globalLayerExtensions;
- // 0 is reserved for NULL/instance
globalLayerExtensions.AddDefault(1);
-
- // Global extensions
EnumerateInstanceExtensionProperties(nullptr, globalLayerExtensions[0]);
Array foundUniqueExtensions;
Array foundUniqueLayers;
- for (int32 i = 0; i < globalLayerExtensions[0].ExtensionProps.Count(); i++)
+ for (int32 i = 0; i < globalLayerExtensions[0].Extensions.Count(); i++)
{
- foundUniqueExtensions.AddUnique(StringAnsi(globalLayerExtensions[0].ExtensionProps[i].extensionName));
+ foundUniqueExtensions.AddUnique(StringAnsi(globalLayerExtensions[0].Extensions[i].extensionName));
}
{
@@ -219,9 +216,9 @@ void GPUDeviceVulkan::GetInstanceLayersAndExtensions(Array& outInst
{
LayerExtension* layer = &globalLayerExtensions[i + 1];
auto& prop = globalLayerProperties[i];
- layer->LayerProps = prop;
+ layer->Layer = prop;
EnumerateInstanceExtensionProperties(prop.layerName, *layer);
- layer->AddUniqueExtensionNames(foundUniqueExtensions);
+ layer->GetExtensions(foundUniqueExtensions);
foundUniqueLayers.AddUnique(StringAnsi(prop.layerName));
}
}
@@ -254,7 +251,7 @@ void GPUDeviceVulkan::GetInstanceLayersAndExtensions(Array& outInst
if (useVkTrace)
{
const char* VkTraceName = "VK_LAYER_LUNARG_vktrace";
- if (FindLayerInList(globalLayerExtensions, VkTraceName))
+ if (ContainsLayer(globalLayerExtensions, VkTraceName))
{
outInstanceLayers.Add(VkTraceName);
vkTrace = true;
@@ -282,7 +279,7 @@ void GPUDeviceVulkan::GetInstanceLayersAndExtensions(Array& outInst
bool hasKhronosStandardValidationLayer = false, hasLunargStandardValidationLayer = false;
#if VULKAN_USE_KHRONOS_STANDARD_VALIDATION
const char* vkLayerKhronosValidation = "VK_LAYER_KHRONOS_validation";
- hasKhronosStandardValidationLayer = FindLayerInList(globalLayerExtensions, vkLayerKhronosValidation);
+ hasKhronosStandardValidationLayer = ContainsLayer(globalLayerExtensions, vkLayerKhronosValidation);
if (hasKhronosStandardValidationLayer)
{
outInstanceLayers.Add(vkLayerKhronosValidation);
@@ -296,7 +293,7 @@ void GPUDeviceVulkan::GetInstanceLayersAndExtensions(Array& outInst
if (!hasKhronosStandardValidationLayer)
{
const char* vkLayerLunargStandardValidation = "VK_LAYER_LUNARG_standard_validation";
- hasLunargStandardValidationLayer = FindLayerInList(globalLayerExtensions, vkLayerLunargStandardValidation);
+ hasLunargStandardValidationLayer = ContainsLayer(globalLayerExtensions, vkLayerLunargStandardValidation);
if (hasLunargStandardValidationLayer)
{
outInstanceLayers.Add(vkLayerLunargStandardValidation);
@@ -311,25 +308,25 @@ void GPUDeviceVulkan::GetInstanceLayersAndExtensions(Array& outInst
{
for (uint32 i = 0; GValidationLayers[i] != nullptr; i++)
{
- const char* currValidationLayer = GValidationLayers[i];
- const bool validationFound = FindLayerInList(globalLayerExtensions, currValidationLayer);
+ const char* validationLayer = GValidationLayers[i];
+ const bool validationFound = ContainsLayer(globalLayerExtensions, validationLayer);
if (validationFound)
{
- outInstanceLayers.Add(currValidationLayer);
+ outInstanceLayers.Add(validationLayer);
}
else
{
- LOG(Warning, "Unable to find Vulkan instance validation layer {0}", String(currValidationLayer));
+ LOG(Warning, "Unable to find Vulkan instance validation layer {0}", String(validationLayer));
}
}
}
}
-#if VULKAN_SUPPORTS_DEBUG_UTILS
+#if VK_EXT_debug_utils
if (!vkTrace && ValidationLevel != VulkanValidationLevel::Disabled)
{
const char* foundDebugUtilsLayer = nullptr;
- outDebugUtils = FindLayerExtensionInList(globalLayerExtensions, VK_EXT_DEBUG_UTILS_EXTENSION_NAME, foundDebugUtilsLayer);
+ outDebugUtils = FindLayerExtension(globalLayerExtensions, VK_EXT_DEBUG_UTILS_EXTENSION_NAME, foundDebugUtilsLayer);
if (outDebugUtils && *foundDebugUtilsLayer)
{
outInstanceLayers.Add(foundDebugUtilsLayer);
@@ -343,7 +340,7 @@ void GPUDeviceVulkan::GetInstanceLayersAndExtensions(Array& outInst
for (const char* extension : platformExtensions)
{
- if (FindLayerExtensionInList(globalLayerExtensions, extension))
+ if (FindLayerExtension(globalLayerExtensions, extension))
{
outInstanceExtensions.Add(extension);
}
@@ -351,21 +348,21 @@ void GPUDeviceVulkan::GetInstanceLayersAndExtensions(Array& outInst
for (int32 i = 0; GInstanceExtensions[i] != nullptr; i++)
{
- if (FindLayerExtensionInList(globalLayerExtensions, GInstanceExtensions[i]))
+ if (FindLayerExtension(globalLayerExtensions, GInstanceExtensions[i]))
{
outInstanceExtensions.Add(GInstanceExtensions[i]);
}
}
-#if VULKAN_SUPPORTS_DEBUG_UTILS
- if (!vkTrace && outDebugUtils && FindLayerExtensionInList(globalLayerExtensions, VK_EXT_DEBUG_UTILS_EXTENSION_NAME))
+#if VK_EXT_debug_utils
+ if (!vkTrace && outDebugUtils && FindLayerExtension(globalLayerExtensions, VK_EXT_DEBUG_UTILS_EXTENSION_NAME))
{
outInstanceExtensions.Add(VK_EXT_DEBUG_UTILS_EXTENSION_NAME);
}
#endif
if (!vkTrace && ValidationLevel == VulkanValidationLevel::Disabled)
{
- if (FindLayerExtensionInList(globalLayerExtensions, VK_EXT_DEBUG_REPORT_EXTENSION_NAME))
+ if (FindLayerExtension(globalLayerExtensions, VK_EXT_DEBUG_REPORT_EXTENSION_NAME))
{
outInstanceExtensions.Add(VK_EXT_DEBUG_REPORT_EXTENSION_NAME);
}
@@ -403,7 +400,6 @@ void GPUDeviceVulkan::GetInstanceLayersAndExtensions(Array& outInst
void GPUDeviceVulkan::GetDeviceExtensionsAndLayers(VkPhysicalDevice gpu, Array& outDeviceExtensions, Array& outDeviceLayers)
{
Array deviceLayerExtensions;
- // 0 is reserved for regular device
deviceLayerExtensions.AddDefault(1);
{
uint32 count = 0;
@@ -412,29 +408,29 @@ void GPUDeviceVulkan::GetDeviceExtensionsAndLayers(VkPhysicalDevice gpu, Array foundUniqueLayers;
Array foundUniqueExtensions;
- for (int32 index = 0; index < deviceLayerExtensions.Count(); index++)
+ for (int32 i = 0; i < deviceLayerExtensions.Count(); i++)
{
- if (index == 0)
+ if (i == 0)
{
- EnumerateDeviceExtensionProperties(gpu, nullptr, deviceLayerExtensions[index]);
+ EnumerateDeviceExtensionProperties(gpu, nullptr, deviceLayerExtensions[i]);
}
else
{
- foundUniqueLayers.AddUnique(StringAnsi(deviceLayerExtensions[index].LayerProps.layerName));
- EnumerateDeviceExtensionProperties(gpu, deviceLayerExtensions[index].LayerProps.layerName, deviceLayerExtensions[index]);
+ foundUniqueLayers.AddUnique(StringAnsi(deviceLayerExtensions[i].Layer.layerName));
+ EnumerateDeviceExtensionProperties(gpu, deviceLayerExtensions[i].Layer.layerName, deviceLayerExtensions[i]);
}
- deviceLayerExtensions[index].AddUniqueExtensionNames(foundUniqueExtensions);
+ deviceLayerExtensions[i].GetExtensions(foundUniqueExtensions);
}
if (foundUniqueLayers.HasItems())
@@ -464,7 +460,7 @@ void GPUDeviceVulkan::GetDeviceExtensionsAndLayers(VkPhysicalDevice gpu, Array availableExtensions;
{
- // All global
- for (int32 i = 0; i < deviceLayerExtensions[0].ExtensionProps.Count(); i++)
+ for (int32 i = 0; i < deviceLayerExtensions[0].Extensions.Count(); i++)
{
- availableExtensions.Add(deviceLayerExtensions[0].ExtensionProps[i].extensionName);
+ availableExtensions.Add(deviceLayerExtensions[0].Extensions[i].extensionName);
}
- // Now only find enabled layers
for (int32 layerIndex = 0; layerIndex < outDeviceLayers.Count(); layerIndex++)
{
- // Skip 0 as it's the null layer
int32 findLayerIndex;
for (findLayerIndex = 1; findLayerIndex < deviceLayerExtensions.Count(); findLayerIndex++)
{
- if (!StringUtils::Compare(deviceLayerExtensions[findLayerIndex].LayerProps.layerName, outDeviceLayers[layerIndex]))
+ if (!StringUtils::Compare(deviceLayerExtensions[findLayerIndex].Layer.layerName, outDeviceLayers[layerIndex]))
{
break;
}
@@ -518,7 +510,7 @@ void GPUDeviceVulkan::GetDeviceExtensionsAndLayers(VkPhysicalDevice gpu, Array platformExtensions;
VulkanPlatform::GetDeviceExtensions(platformExtensions);
for (const char* extension : platformExtensions)
@@ -589,18 +580,14 @@ void GPUDeviceVulkan::ParseOptionalDeviceExtensions(const Array& de
return ArrayExtensions::Any(deviceExtensions, CheckCallback);
};
-#if VULKAN_SUPPORTS_MAINTENANCE_LAYER1
+#if VK_KHR_maintenance1
OptionalDeviceExtensions.HasKHRMaintenance1 = HasExtension(VK_KHR_MAINTENANCE1_EXTENSION_NAME);
#endif
-#if VULKAN_SUPPORTS_MAINTENANCE_LAYER2
+#if VK_KHR_maintenance2
OptionalDeviceExtensions.HasKHRMaintenance2 = HasExtension(VK_KHR_MAINTENANCE2_EXTENSION_NAME);
#endif
OptionalDeviceExtensions.HasMirrorClampToEdge = HasExtension(VK_KHR_SAMPLER_MIRROR_CLAMP_TO_EDGE_EXTENSION_NAME);
-#if VULKAN_ENABLE_DESKTOP_HMD_SUPPORT
- OptionalDeviceExtensions.HasKHRExternalMemoryCapabilities = HasExtension(VK_KHR_EXTERNAL_MEMORY_CAPABILITIES_EXTENSION_NAME);
- OptionalDeviceExtensions.HasKHRGetPhysicalDeviceProperties2 = HasExtension(VK_KHR_GET_PHYSICAL_DEVICE_PROPERTIES_2_EXTENSION_NAME);
-#endif
-#if VULKAN_SUPPORTS_VALIDATION_CACHE
+#if VK_EXT_validation_cache
OptionalDeviceExtensions.HasEXTValidationCache = HasExtension(VK_EXT_VALIDATION_CACHE_EXTENSION_NAME);
#endif
}
diff --git a/Source/Engine/GraphicsDevice/Vulkan/GPUDeviceVulkan.cpp b/Source/Engine/GraphicsDevice/Vulkan/GPUDeviceVulkan.cpp
index 2d0aeb512..33df0db47 100644
--- a/Source/Engine/GraphicsDevice/Vulkan/GPUDeviceVulkan.cpp
+++ b/Source/Engine/GraphicsDevice/Vulkan/GPUDeviceVulkan.cpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#if GRAPHICS_API_VULKAN
@@ -43,7 +43,7 @@ Array GPUDeviceVulkan::InstanceLayers;
bool SupportsDebugUtilsExt = false;
#if VULKAN_USE_DEBUG_LAYER
-#if VULKAN_SUPPORTS_DEBUG_UTILS
+#if VK_EXT_debug_utils
VkDebugUtilsMessengerEXT Messenger = VK_NULL_HANDLE;
#endif
@@ -72,18 +72,6 @@ static VKAPI_ATTR VkBool32 VKAPI_PTR DebugReportFunction(VkDebugReportFlagsEXT m
return VK_FALSE;
}
}
- if (!StringUtils::Compare(layerPrefix, "DS"))
- {
- if (msgCode == 6)
- {
- auto* Found = StringUtils::Find(msg, " array layer ");
- if (Found && Found[13] >= '1' && Found[13] <= '9')
- {
- // Potential bug in the validation layers for slice > 1 on 3d textures
- return VK_FALSE;
- }
- }
- }
}
else if (msgFlags & VK_DEBUG_REPORT_WARNING_BIT_EXT)
{
@@ -138,7 +126,7 @@ static VKAPI_ATTR VkBool32 VKAPI_PTR DebugReportFunction(VkDebugReportFlagsEXT m
return VK_FALSE;
}
-#if VULKAN_SUPPORTS_DEBUG_UTILS
+#if VK_EXT_debug_utils
static VKAPI_ATTR VkBool32 VKAPI_PTR DebugUtilsCallback(VkDebugUtilsMessageSeverityFlagBitsEXT msgSeverity, VkDebugUtilsMessageTypeFlagsEXT msgType, const VkDebugUtilsMessengerCallbackDataEXT* callbackData, void* userData)
{
@@ -242,7 +230,7 @@ static VKAPI_ATTR VkBool32 VKAPI_PTR DebugUtilsCallback(VkDebugUtilsMessageSever
void SetupDebugLayerCallback()
{
-#if VULKAN_SUPPORTS_DEBUG_UTILS
+#if VK_EXT_debug_utils
if (SupportsDebugUtilsExt)
{
if (vkCreateDebugUtilsMessengerEXT)
@@ -324,7 +312,7 @@ void SetupDebugLayerCallback()
void RemoveDebugLayerCallback()
{
-#if VULKAN_SUPPORTS_DEBUG_UTILS
+#if VK_EXT_debug_utils
if (Messenger != VK_NULL_HANDLE)
{
if (vkDestroyDebugUtilsMessengerEXT)
@@ -357,10 +345,6 @@ DeferredDeletionQueueVulkan::~DeferredDeletionQueueVulkan()
void DeferredDeletionQueueVulkan::ReleaseResources(bool deleteImmediately)
{
ScopeLock lock(&_locker);
-
- const VkDevice device = _device->Device;
-
- // Traverse list backwards so the swap switches to elements already tested
const uint64 checkFrame = Engine::FrameCount - VULKAN_RESOURCE_DELETE_SAFE_FRAMES_COUNT;
for (int32 i = 0; i < _entries.Count(); i++)
{
@@ -373,24 +357,26 @@ void DeferredDeletionQueueVulkan::ReleaseResources(bool deleteImmediately)
{
switch (e->StructureType)
{
-#define VK_SWITCH(type) case Type::type: vkDestroy##type(device, (Vk##type)e->Handle, nullptr); break
- VK_SWITCH(RenderPass);
- VK_SWITCH(Buffer);
- VK_SWITCH(BufferView);
- VK_SWITCH(Image);
- VK_SWITCH(ImageView);
- VK_SWITCH(Pipeline);
- VK_SWITCH(PipelineLayout);
- VK_SWITCH(Framebuffer);
- VK_SWITCH(DescriptorSetLayout);
- VK_SWITCH(Sampler);
- VK_SWITCH(Semaphore);
- VK_SWITCH(ShaderModule);
- VK_SWITCH(Event);
- VK_SWITCH(QueryPool);
-#undef VK_SWITCH
+#define SWITCH_CASE(type) case Type::type: vkDestroy##type(_device->Device, (Vk##type)e->Handle, nullptr); break
+ SWITCH_CASE(RenderPass);
+ SWITCH_CASE(Buffer);
+ SWITCH_CASE(BufferView);
+ SWITCH_CASE(Image);
+ SWITCH_CASE(ImageView);
+ SWITCH_CASE(Pipeline);
+ SWITCH_CASE(PipelineLayout);
+ SWITCH_CASE(Framebuffer);
+ SWITCH_CASE(DescriptorSetLayout);
+ SWITCH_CASE(Sampler);
+ SWITCH_CASE(Semaphore);
+ SWITCH_CASE(ShaderModule);
+ SWITCH_CASE(Event);
+ SWITCH_CASE(QueryPool);
+#undef SWITCH_CASE
default:
+#if !BUILD_RELEASE
CRASH;
+#endif
break;
}
}
@@ -1080,23 +1066,10 @@ GPUDeviceVulkan::GPUDeviceVulkan(ShaderProfile shaderProfile, GPUAdapterVulkan*
, _renderPasses(512)
, _framebuffers(512)
, _layouts(4096)
- , MainContext(nullptr)
, Adapter(adapter)
- , Device(VK_NULL_HANDLE)
, DeferredDeletionQueue(this)
, StagingManager(this)
, HelperResources(this)
- , GraphicsQueue(nullptr)
- , ComputeQueue(nullptr)
- , TransferQueue(nullptr)
- , PresentQueue(nullptr)
- , Allocator(VK_NULL_HANDLE)
- , PipelineCache(VK_NULL_HANDLE)
-#if VULKAN_SUPPORTS_VALIDATION_CACHE
- , ValidationCache(VK_NULL_HANDLE)
-#endif
- , UniformBufferUploader(nullptr)
- , DescriptorPoolsManager(nullptr)
{
}
@@ -1163,7 +1136,7 @@ GPUDevice* GPUDeviceVulkan::Create()
}
if (result == VK_ERROR_EXTENSION_NOT_PRESENT)
{
- // Check for missing extensions
+ // Extensions error
uint32_t propertyCount;
vkEnumerateInstanceExtensionProperties(nullptr, &propertyCount, nullptr);
Array properties;
@@ -1171,28 +1144,27 @@ GPUDevice* GPUDeviceVulkan::Create()
vkEnumerateInstanceExtensionProperties(nullptr, &propertyCount, properties.Get());
for (const char* extension : InstanceExtensions)
{
- bool extensionFound = false;
+ bool found = false;
for (uint32_t propertyIndex = 0; propertyIndex < propertyCount; propertyIndex++)
{
if (!StringUtils::Compare(properties[propertyIndex].extensionName, extension))
{
- extensionFound = true;
+ found = true;
break;
}
}
- if (!extensionFound)
+ if (!found)
{
LOG(Warning, "Missing required Vulkan extension: {0}", String(extension));
}
}
-
- // Missing extensions
auto error = String::Format(TEXT("Vulkan driver doesn't contain specified extensions:\n{0}\nPlease make sure your layers path is set appropriately."));
Platform::Error(*error);
return nullptr;
}
if (result != VK_SUCCESS)
{
+ // Driver error
LOG(Warning, "Vulkan create instance failed with error code: {0}", RenderToolsVulkan::GetVkErrorString(result));
Platform::Fatal(TEXT("Vulkan failed to create instance\n\nDo you have a compatible Vulkan driver installed?"));
return nullptr;
@@ -1438,7 +1410,7 @@ PixelFormat GPUDeviceVulkan::GetClosestSupportedPixelFormat(PixelFormat format,
return format;
}
-#if VULKAN_SUPPORTS_VALIDATION_CACHE
+#if VK_EXT_validation_cache
void GetValidationCachePath(String& path)
{
@@ -1572,7 +1544,7 @@ bool GPUDeviceVulkan::Init()
_state = DeviceState::Created;
const auto gpu = Adapter->Gpu;
- // Query queues properties
+ // Get queues properties
uint32 queueCount = 0;
vkGetPhysicalDeviceQueueFamilyProperties(gpu, &queueCount, nullptr);
ASSERT(queueCount >= 1);
@@ -1582,23 +1554,21 @@ bool GPUDeviceVulkan::Init()
// Query device features
vkGetPhysicalDeviceFeatures(Adapter->Gpu, &PhysicalDeviceFeatures);
- // Setup extension and layer info
- VkDeviceCreateInfo deviceInfo;
- RenderToolsVulkan::ZeroStruct(deviceInfo, VK_STRUCTURE_TYPE_DEVICE_CREATE_INFO);
-
+ // Get extensions and layers
Array deviceExtensions;
Array validationLayers;
GetDeviceExtensionsAndLayers(gpu, deviceExtensions, validationLayers);
-
ParseOptionalDeviceExtensions(deviceExtensions);
+ // Setup device info
+ VkDeviceCreateInfo deviceInfo;
+ RenderToolsVulkan::ZeroStruct(deviceInfo, VK_STRUCTURE_TYPE_DEVICE_CREATE_INFO);
deviceInfo.enabledExtensionCount = deviceExtensions.Count();
deviceInfo.ppEnabledExtensionNames = deviceExtensions.Get();
-
deviceInfo.enabledLayerCount = validationLayers.Count();
deviceInfo.ppEnabledLayerNames = deviceInfo.enabledLayerCount > 0 ? validationLayers.Get() : nullptr;
- // Setup Queue info
+ // Setup queues info
Array queueFamilyInfos;
int32 graphicsQueueFamilyIndex = -1;
int32 computeQueueFamilyIndex = -1;
@@ -1634,7 +1604,7 @@ bool GPUDeviceVulkan::Init()
if ((curProps.queueFlags & VK_QUEUE_TRANSFER_BIT) == VK_QUEUE_TRANSFER_BIT)
{
- // Prefer a non-gfx transfer queue
+ // Favor a non-gfx transfer queue
if (transferQueueFamilyIndex == -1 && (curProps.queueFlags & VK_QUEUE_GRAPHICS_BIT) != VK_QUEUE_GRAPHICS_BIT && (curProps.queueFlags & VK_QUEUE_COMPUTE_BIT) != VK_QUEUE_COMPUTE_BIT)
{
transferQueueFamilyIndex = familyIndex;
@@ -1667,7 +1637,6 @@ bool GPUDeviceVulkan::Init()
numPriorities += curProps.queueCount;
LOG(Info, "- queue family {0}: {1} queues{2}", familyIndex, curProps.queueCount, queueTypeInfo);
}
-
Array queuePriorities;
queuePriorities.AddDefault(numPriorities);
float* currentPriority = queuePriorities.Get();
@@ -1675,14 +1644,12 @@ bool GPUDeviceVulkan::Init()
{
VkDeviceQueueCreateInfo& queue = queueFamilyInfos[index];
queue.pQueuePriorities = currentPriority;
-
const VkQueueFamilyProperties& properties = QueueFamilyProps[queue.queueFamilyIndex];
for (int32 queueIndex = 0; queueIndex < (int32)properties.queueCount; queueIndex++)
{
*currentPriority++ = 1.0f;
}
}
-
deviceInfo.queueCreateInfoCount = queueFamilyInfos.Count();
deviceInfo.pQueueCreateInfos = queueFamilyInfos.Get();
@@ -1872,7 +1839,7 @@ bool GPUDeviceVulkan::Init()
DescriptorPoolsManager = New(this);
MainContext = New(this, GraphicsQueue);
// TODO: create and load PipelineCache
-#if VULKAN_SUPPORTS_VALIDATION_CACHE
+#if VK_EXT_validation_cache
if (OptionalDeviceExtensions.HasEXTValidationCache && vkCreateValidationCacheEXT && vkDestroyValidationCacheEXT)
{
LoadValidationCache();
@@ -1934,7 +1901,7 @@ void GPUDeviceVulkan::Dispose()
vkDestroyPipelineCache(Device, PipelineCache, nullptr);
PipelineCache = VK_NULL_HANDLE;
}
-#if VULKAN_SUPPORTS_VALIDATION_CACHE
+#if VK_EXT_validation_cache
if (ValidationCache != VK_NULL_HANDLE)
{
if (SaveValidationCache())
@@ -2084,10 +2051,10 @@ bool FenceManagerVulkan::WaitForFence(FenceVulkan* fence, uint64 timeInNanosecon
if (result == VK_SUCCESS)
{
fence->_signaled = true;
- return true;
+ return false;
}
- return false;
+ return true;
}
void FenceManagerVulkan::ResetFence(FenceVulkan* fence)
@@ -2141,7 +2108,6 @@ bool FenceManagerVulkan::CheckFenceState(FenceVulkan* fence)
void FenceManagerVulkan::DestroyFence(FenceVulkan* fence)
{
- // Does not need to go in the deferred deletion queue
vkDestroyFence(_device->Device, fence->GetHandle(), nullptr);
fence->_handle = VK_NULL_HANDLE;
Delete(fence);
diff --git a/Source/Engine/GraphicsDevice/Vulkan/GPUDeviceVulkan.h b/Source/Engine/GraphicsDevice/Vulkan/GPUDeviceVulkan.h
index 8a1334450..9bab15dda 100644
--- a/Source/Engine/GraphicsDevice/Vulkan/GPUDeviceVulkan.h
+++ b/Source/Engine/GraphicsDevice/Vulkan/GPUDeviceVulkan.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
@@ -134,20 +134,20 @@ public:
return CheckFenceState(fence);
}
- // Returns false if it timed out
+ // Returns true if waiting timed out or failed, false otherwise.
bool WaitForFence(FenceVulkan* fence, uint64 timeInNanoseconds);
void ResetFence(FenceVulkan* fence);
- // Sets it to nullptr
+ // Sets the fence handle to null
void ReleaseFence(FenceVulkan*& fence);
- // Sets it to nullptr
+ // Sets the fence handle to null
void WaitAndReleaseFence(FenceVulkan*& fence, uint64 timeInNanoseconds);
private:
- // Returns true if signaled
+ // Returns true if fence was signaled, otherwise false.
bool CheckFenceState(FenceVulkan* fence);
void DestroyFence(FenceVulkan* fence);
@@ -209,14 +209,14 @@ public:
template
inline void EnqueueResource(Type type, T handle)
{
- static_assert(sizeof(T) <= sizeof(uint64), "Vulkan resource handle type size too large.");
+ static_assert(sizeof(T) <= sizeof(uint64), "Invalid handle size.");
EnqueueGenericResource(type, (uint64)handle, VK_NULL_HANDLE);
}
template
inline void EnqueueResource(Type type, T handle, VmaAllocation allocation)
{
- static_assert(sizeof(T) <= sizeof(uint64), "Vulkan resource handle type size too large.");
+ static_assert(sizeof(T) <= sizeof(uint64), "Invalid handle size.");
EnqueueGenericResource(type, (uint64)handle, allocation);
}
@@ -554,17 +554,17 @@ public:
///
/// The main Vulkan commands context.
///
- GPUContextVulkan* MainContext;
+ GPUContextVulkan* MainContext = nullptr;
///
/// The Vulkan adapter.
///
- GPUAdapterVulkan* Adapter;
+ GPUAdapterVulkan* Adapter = nullptr;
///
/// The Vulkan device.
///
- VkDevice Device;
+ VkDevice Device = VK_NULL_HANDLE;
///
/// The Vulkan device queues family properties.
@@ -594,51 +594,51 @@ public:
///
/// The graphics queue.
///
- QueueVulkan* GraphicsQueue;
+ QueueVulkan* GraphicsQueue = nullptr;
///
/// The compute queue.
///
- QueueVulkan* ComputeQueue;
+ QueueVulkan* ComputeQueue = nullptr;
///
/// The transfer queue.
///
- QueueVulkan* TransferQueue;
+ QueueVulkan* TransferQueue = nullptr;
///
/// The present queue.
///
- QueueVulkan* PresentQueue;
+ QueueVulkan* PresentQueue = nullptr;
///
/// The Vulkan memory allocator.
///
- VmaAllocator Allocator;
+ VmaAllocator Allocator = VK_NULL_HANDLE;
///
/// The pipeline cache.
///
- VkPipelineCache PipelineCache;
+ VkPipelineCache PipelineCache = VK_NULL_HANDLE;
-#if VULKAN_SUPPORTS_VALIDATION_CACHE
+#if VK_EXT_validation_cache
///
/// The optional validation cache.
///
- VkValidationCacheEXT ValidationCache;
+ VkValidationCacheEXT ValidationCache = VK_NULL_HANDLE;
#endif
///
/// The uniform buffers uploader.
///
- UniformBufferUploaderVulkan* UniformBufferUploader;
+ UniformBufferUploaderVulkan* UniformBufferUploader = nullptr;
///
/// The descriptor pools manager.
///
- DescriptorPoolsManagerVulkan* DescriptorPoolsManager;
+ DescriptorPoolsManagerVulkan* DescriptorPoolsManager = nullptr;
///
/// The physical device limits.
@@ -706,7 +706,7 @@ public:
/// The output format.
PixelFormat GetClosestSupportedPixelFormat(PixelFormat format, GPUTextureFlags flags, bool optimalTiling);
-#if VULKAN_SUPPORTS_VALIDATION_CACHE
+#if VK_EXT_validation_cache
///
/// Loads the validation cache.
diff --git a/Source/Engine/GraphicsDevice/Vulkan/GPUPipelineStateVulkan.cpp b/Source/Engine/GraphicsDevice/Vulkan/GPUPipelineStateVulkan.cpp
index ee7305daf..16043b0c7 100644
--- a/Source/Engine/GraphicsDevice/Vulkan/GPUPipelineStateVulkan.cpp
+++ b/Source/Engine/GraphicsDevice/Vulkan/GPUPipelineStateVulkan.cpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#if GRAPHICS_API_VULKAN
@@ -45,13 +45,10 @@ ComputePipelineStateVulkan* GPUShaderProgramCSVulkan::GetOrCreateState()
// Setup the state
_pipelineState = New(_device, pipeline, layout);
-
_pipelineState->DescriptorInfo = &DescriptorInfo;
_pipelineState->DescriptorSetsLayout = &layout->GetDescriptorSetLayout();
_pipelineState->DescriptorSetHandles.AddZeroed(_pipelineState->DescriptorSetsLayout->GetHandles().Count());
-
- uint32 totalNumDynamicOffsets = 0;
-
+ uint32 dynamicOffsetsCount = 0;
if (DescriptorInfo.DescriptorTypesCount != 0)
{
_pipelineState->DSWriteContainer.DescriptorWrites.AddZeroed(DescriptorInfo.DescriptorTypesCount);
@@ -59,18 +56,18 @@ ComputePipelineStateVulkan* GPUShaderProgramCSVulkan::GetOrCreateState()
_pipelineState->DSWriteContainer.DescriptorBufferInfo.AddZeroed(DescriptorInfo.BufferInfosCount);
ASSERT(DescriptorInfo.DescriptorTypesCount < 255);
- _pipelineState->DSWriteContainer.BindingToDynamicOffsetMap.AddDefault(DescriptorInfo.DescriptorTypesCount);
- _pipelineState->DSWriteContainer.BindingToDynamicOffsetMap.SetAll(255);
+ _pipelineState->DSWriteContainer.BindingToDynamicOffset.AddDefault(DescriptorInfo.DescriptorTypesCount);
+ _pipelineState->DSWriteContainer.BindingToDynamicOffset.SetAll(255);
VkWriteDescriptorSet* currentDescriptorWrite = _pipelineState->DSWriteContainer.DescriptorWrites.Get();
VkDescriptorImageInfo* currentImageInfo = _pipelineState->DSWriteContainer.DescriptorImageInfo.Get();
VkDescriptorBufferInfo* currentBufferInfo = _pipelineState->DSWriteContainer.DescriptorBufferInfo.Get();
- uint8* currentBindingToDynamicOffsetMap = _pipelineState->DSWriteContainer.BindingToDynamicOffsetMap.Get();
+ uint8* currentBindingToDynamicOffsetMap = _pipelineState->DSWriteContainer.BindingToDynamicOffset.Get();
- totalNumDynamicOffsets = _pipelineState->DSWriter.SetupDescriptorWrites(DescriptorInfo, currentDescriptorWrite, currentImageInfo, currentBufferInfo, currentBindingToDynamicOffsetMap);
+ dynamicOffsetsCount = _pipelineState->DSWriter.SetupDescriptorWrites(DescriptorInfo, currentDescriptorWrite, currentImageInfo, currentBufferInfo, currentBindingToDynamicOffsetMap);
}
- _pipelineState->DynamicOffsets.AddZeroed(totalNumDynamicOffsets);
+ _pipelineState->DynamicOffsets.AddZeroed(dynamicOffsetsCount);
_pipelineState->DSWriter.DynamicOffsets = _pipelineState->DynamicOffsets.Get();
return _pipelineState;
@@ -346,26 +343,26 @@ bool GPUPipelineStateVulkan::Init(const Description& desc)
DSWriteContainer.DescriptorBufferInfo.AddZeroed(descriptor->BufferInfosCount);
ASSERT(descriptor->DescriptorTypesCount < 255);
- DSWriteContainer.BindingToDynamicOffsetMap.AddDefault(descriptor->DescriptorTypesCount);
- DSWriteContainer.BindingToDynamicOffsetMap.SetAll(255);
+ DSWriteContainer.BindingToDynamicOffset.AddDefault(descriptor->DescriptorTypesCount);
+ DSWriteContainer.BindingToDynamicOffset.SetAll(255);
}
VkWriteDescriptorSet* currentDescriptorWrite = DSWriteContainer.DescriptorWrites.Get();
VkDescriptorImageInfo* currentImageInfo = DSWriteContainer.DescriptorImageInfo.Get();
VkDescriptorBufferInfo* currentBufferInfo = DSWriteContainer.DescriptorBufferInfo.Get();
- uint8* currentBindingToDynamicOffsetMap = DSWriteContainer.BindingToDynamicOffsetMap.Get();
+ byte* currentBindingToDynamicOffsetMap = DSWriteContainer.BindingToDynamicOffset.Get();
uint32 dynamicOffsetsStart[DescriptorSet::GraphicsStagesCount];
- uint32 totalNumDynamicOffsets = 0;
+ uint32 dynamicOffsetsCount = 0;
for (int32 stage = 0; stage < DescriptorSet::GraphicsStagesCount; stage++)
{
- dynamicOffsetsStart[stage] = totalNumDynamicOffsets;
+ dynamicOffsetsStart[stage] = dynamicOffsetsCount;
const auto descriptor = DescriptorInfoPerStage[stage];
if (descriptor == nullptr || descriptor->DescriptorTypesCount == 0)
continue;
const uint32 numDynamicOffsets = DSWriter[stage].SetupDescriptorWrites(*descriptor, currentDescriptorWrite, currentImageInfo, currentBufferInfo, currentBindingToDynamicOffsetMap);
- totalNumDynamicOffsets += numDynamicOffsets;
+ dynamicOffsetsCount += numDynamicOffsets;
currentDescriptorWrite += descriptor->DescriptorTypesCount;
currentImageInfo += descriptor->ImageInfosCount;
@@ -373,7 +370,7 @@ bool GPUPipelineStateVulkan::Init(const Description& desc)
currentBindingToDynamicOffsetMap += descriptor->DescriptorTypesCount;
}
- DynamicOffsets.AddZeroed(totalNumDynamicOffsets);
+ DynamicOffsets.AddZeroed(dynamicOffsetsCount);
for (int32 stage = 0; stage < DescriptorSet::GraphicsStagesCount; stage++)
{
DSWriter[stage].DynamicOffsets = dynamicOffsetsStart[stage] + DynamicOffsets.Get();
diff --git a/Source/Engine/GraphicsDevice/Vulkan/GPUPipelineStateVulkan.h b/Source/Engine/GraphicsDevice/Vulkan/GPUPipelineStateVulkan.h
index a51c105d2..53b3bb7af 100644
--- a/Source/Engine/GraphicsDevice/Vulkan/GPUPipelineStateVulkan.h
+++ b/Source/Engine/GraphicsDevice/Vulkan/GPUPipelineStateVulkan.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/GraphicsDevice/Vulkan/GPUShaderProgramVulkan.h b/Source/Engine/GraphicsDevice/Vulkan/GPUShaderProgramVulkan.h
index 4c13865c9..b058b5e1a 100644
--- a/Source/Engine/GraphicsDevice/Vulkan/GPUShaderProgramVulkan.h
+++ b/Source/Engine/GraphicsDevice/Vulkan/GPUShaderProgramVulkan.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/GraphicsDevice/Vulkan/GPUShaderVulkan.cpp b/Source/Engine/GraphicsDevice/Vulkan/GPUShaderVulkan.cpp
index f2ce3f851..5b38b926a 100644
--- a/Source/Engine/GraphicsDevice/Vulkan/GPUShaderVulkan.cpp
+++ b/Source/Engine/GraphicsDevice/Vulkan/GPUShaderVulkan.cpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#if GRAPHICS_API_VULKAN
@@ -118,7 +118,7 @@ GPUShaderProgram* GPUShaderVulkan::CreateGPUShaderProgram(ShaderStage type, cons
RenderToolsVulkan::ZeroStruct(createInfo, VK_STRUCTURE_TYPE_SHADER_MODULE_CREATE_INFO);
createInfo.codeSize = (size_t)spirv.Length();
createInfo.pCode = (const uint32_t*)spirv.Get();
-#if VULKAN_SUPPORTS_VALIDATION_CACHE
+#if VK_EXT_validation_cache
VkShaderModuleValidationCacheCreateInfoEXT validationInfo;
if (_device->ValidationCache != VK_NULL_HANDLE)
{
diff --git a/Source/Engine/GraphicsDevice/Vulkan/GPUShaderVulkan.h b/Source/Engine/GraphicsDevice/Vulkan/GPUShaderVulkan.h
index 8c40be054..842dfc145 100644
--- a/Source/Engine/GraphicsDevice/Vulkan/GPUShaderVulkan.h
+++ b/Source/Engine/GraphicsDevice/Vulkan/GPUShaderVulkan.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
@@ -49,8 +49,6 @@ private:
uint64 _offset;
uint32 _minAlignment;
byte* _mapped;
-
- // Fence for wrapping around
CmdBufferVulkan* _fenceCmdBuffer;
uint64 _fenceCounter;
diff --git a/Source/Engine/GraphicsDevice/Vulkan/GPUSwapChainVulkan.cpp b/Source/Engine/GraphicsDevice/Vulkan/GPUSwapChainVulkan.cpp
index 6354e9956..d90d8e59c 100644
--- a/Source/Engine/GraphicsDevice/Vulkan/GPUSwapChainVulkan.cpp
+++ b/Source/Engine/GraphicsDevice/Vulkan/GPUSwapChainVulkan.cpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#if GRAPHICS_API_VULKAN
@@ -92,7 +92,7 @@ GPUTextureView* GPUSwapChainVulkan::GetBackBufferView()
{
if (_acquiredImageIndex == -1)
{
- if (DoCheckedSwapChainJob(DoAcquireImageIndex) < 0)
+ if (TryPresent(DoAcquireImageIndex) < 0)
{
LOG(Fatal, "Swapchain acquire image index failed!");
}
@@ -187,10 +187,10 @@ bool GPUSwapChainVulkan::CreateSwapChain(int32 width, int32 height)
const auto& gpu = _device->Adapter->Gpu;
- // Find pixel format for presentable images
+ // Pick a format for backbuffer
PixelFormat resultFormat = GPU_BACK_BUFFER_PIXEL_FORMAT;
- VkSurfaceFormatKHR curFormat;
- Platform::MemoryClear(&curFormat, sizeof(curFormat));
+ VkSurfaceFormatKHR result;
+ Platform::MemoryClear(&result, sizeof(result));
{
uint32 surfaceFormatsCount;
VALIDATE_VULKAN_RESULT(vkGetPhysicalDeviceSurfaceFormatsKHR(gpu, _surface, &surfaceFormatsCount, nullptr));
@@ -210,7 +210,7 @@ bool GPUSwapChainVulkan::CreateSwapChain(int32 width, int32 height)
{
if (surfaceFormats[i].format == requested)
{
- curFormat = surfaceFormats[i];
+ result = surfaceFormats[i];
found = true;
break;
}
@@ -240,8 +240,8 @@ bool GPUSwapChainVulkan::CreateSwapChain(int32 width, int32 height)
if (surfaceFormats[i].format == RenderToolsVulkan::ToVulkanFormat(static_cast(pixelFormat)))
{
resultFormat = static_cast(pixelFormat);
- curFormat = surfaceFormats[i];
- LOG(Info, "No swapchain format requested, picking up Vulkan format {0}", (uint32)curFormat.format);
+ result = surfaceFormats[i];
+ LOG(Info, "No swapchain format requested, picking up Vulkan format {0}", (uint32)result.format);
break;
}
}
@@ -264,7 +264,7 @@ bool GPUSwapChainVulkan::CreateSwapChain(int32 width, int32 height)
if (surfaceFormats[i].format == format)
{
supported = true;
- curFormat = surfaceFormats[i];
+ result = surfaceFormats[i];
break;
}
}
@@ -290,13 +290,13 @@ bool GPUSwapChainVulkan::CreateSwapChain(int32 width, int32 height)
LOG(Error, "Unable to find a pixel format for the swapchain; swapchain returned {0} Vulkan formats {1}", surfaceFormats.Count(), *msg);
}
}
- curFormat.format = RenderToolsVulkan::ToVulkanFormat(resultFormat);
+ result.format = RenderToolsVulkan::ToVulkanFormat(resultFormat);
_format = resultFormat;
// Prepare present queue
_device->SetupPresentQueue(_surface);
- // Fetch present mode
+ // Calculate the swap chain present mode
VkPresentModeKHR presentMode = VK_PRESENT_MODE_FIFO_KHR;
{
uint32 presentModesCount = 0;
@@ -358,8 +358,8 @@ bool GPUSwapChainVulkan::CreateSwapChain(int32 width, int32 height)
RenderToolsVulkan::ZeroStruct(swapChainInfo, VK_STRUCTURE_TYPE_SWAPCHAIN_CREATE_INFO_KHR);
swapChainInfo.surface = _surface;
swapChainInfo.minImageCount = VULKAN_BACK_BUFFERS_COUNT;
- swapChainInfo.imageFormat = curFormat.format;
- swapChainInfo.imageColorSpace = curFormat.colorSpace;
+ swapChainInfo.imageFormat = result.format;
+ swapChainInfo.imageColorSpace = result.colorSpace;
swapChainInfo.imageExtent.width = width;
swapChainInfo.imageExtent.height = height;
swapChainInfo.imageUsage = VK_IMAGE_USAGE_TRANSFER_DST_BIT | VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT;
@@ -415,8 +415,7 @@ GPUSwapChainVulkan::Status GPUSwapChainVulkan::Present(QueueVulkan* presentQueue
{
if (_currentImageIndex == -1)
{
- // Skip present silently if image has not been acquired
- return Status::Healthy;
+ return Status::Ok;
}
VkPresentInfoKHR presentInfo;
@@ -436,23 +435,23 @@ GPUSwapChainVulkan::Status GPUSwapChainVulkan::Present(QueueVulkan* presentQueue
if (presentResult == VK_ERROR_OUT_OF_DATE_KHR)
{
- return Status::OutOfDate;
+ return Status::Outdated;
}
if (presentResult == VK_ERROR_SURFACE_LOST_KHR)
{
- return Status::SurfaceLost;
+ return Status::LostSurface;
}
if (presentResult != VK_SUCCESS && presentResult != VK_SUBOPTIMAL_KHR)
{
VALIDATE_VULKAN_RESULT(presentResult);
}
- return Status::Healthy;
+ return Status::Ok;
}
int32 GPUSwapChainVulkan::DoAcquireImageIndex(GPUSwapChainVulkan* viewport, void* customData)
{
- return viewport->_acquiredImageIndex = viewport->AcquireImageIndex(&viewport->_acquiredSemaphore);
+ return viewport->_acquiredImageIndex = viewport->AcquireNextImage(&viewport->_acquiredSemaphore);
}
int32 GPUSwapChainVulkan::DoPresent(GPUSwapChainVulkan* viewport, void* customData)
@@ -460,20 +459,20 @@ int32 GPUSwapChainVulkan::DoPresent(GPUSwapChainVulkan* viewport, void* customDa
return (int32)viewport->Present((QueueVulkan*)customData, viewport->_backBuffers[viewport->_acquiredImageIndex].RenderingDoneSemaphore);
}
-int32 GPUSwapChainVulkan::DoCheckedSwapChainJob(Function job, void* customData, bool skipOnOutOfDate)
+int32 GPUSwapChainVulkan::TryPresent(Function job, void* customData, bool skipOnOutOfDate)
{
int32 attemptsPending = 4;
int32 status = job(this, customData);
while (status < 0 && attemptsPending > 0)
{
- if (status == (int32)Status::OutOfDate)
+ if (status == (int32)Status::Outdated)
{
//LOG(Warning, "Swapchain is out of date");
if (skipOnOutOfDate)
return status;
}
- else if (status == (int32)Status::SurfaceLost)
+ else if (status == (int32)Status::LostSurface)
{
LOG(Warning, "Swapchain surface lost");
}
@@ -487,7 +486,7 @@ int32 GPUSwapChainVulkan::DoCheckedSwapChainJob(FunctionGetMainContext()->Flush();
_device->WaitForGPU();
@@ -499,7 +498,7 @@ int32 GPUSwapChainVulkan::DoCheckedSwapChainJob(FunctionGetCmdBufferManager()->SubmitActiveCmdBuffer(_backBuffers[_acquiredImageIndex].RenderingDoneSemaphore);
// Present the back buffer to the viewport window
- const auto result = DoCheckedSwapChainJob(DoPresent, _device->PresentQueue, true);
- if (result == (int32)Status::OutOfDate)
+ const auto result = TryPresent(DoPresent, _device->PresentQueue, true);
+ if (result == (int32)Status::Outdated)
{
// Failed to present, window can be minimized or doesn't want to swap the buffers so just ignore the present
if (_window->IsMinimized())
diff --git a/Source/Engine/GraphicsDevice/Vulkan/GPUSwapChainVulkan.h b/Source/Engine/GraphicsDevice/Vulkan/GPUSwapChainVulkan.h
index 36204581c..0980035d5 100644
--- a/Source/Engine/GraphicsDevice/Vulkan/GPUSwapChainVulkan.h
+++ b/Source/Engine/GraphicsDevice/Vulkan/GPUSwapChainVulkan.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
@@ -93,20 +93,19 @@ public:
public:
- // Has to be negative as we use this also on other callbacks as the acquired image index
enum class Status
{
- Healthy = 0,
- OutOfDate = -1,
- SurfaceLost = -2,
+ Ok = 0,
+ Outdated = -1,
+ LostSurface = -2,
};
Status Present(QueueVulkan* presentQueue, SemaphoreVulkan* backBufferRenderingDoneSemaphore);
static int32 DoAcquireImageIndex(GPUSwapChainVulkan* viewport, void* customData);
static int32 DoPresent(GPUSwapChainVulkan* viewport, void* customData);
- int32 DoCheckedSwapChainJob(Function job, void* customData = nullptr, bool skipOnOutOfDate = false);
- int32 AcquireImageIndex(SemaphoreVulkan** outSemaphore);
+ int32 TryPresent(Function job, void* customData = nullptr, bool skipOnOutOfDate = false);
+ int32 AcquireNextImage(SemaphoreVulkan** outSemaphore);
private:
diff --git a/Source/Engine/GraphicsDevice/Vulkan/GPUTextureVulkan.cpp b/Source/Engine/GraphicsDevice/Vulkan/GPUTextureVulkan.cpp
index 4e09fb021..272443b1e 100644
--- a/Source/Engine/GraphicsDevice/Vulkan/GPUTextureVulkan.cpp
+++ b/Source/Engine/GraphicsDevice/Vulkan/GPUTextureVulkan.cpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#if GRAPHICS_API_VULKAN
@@ -239,7 +239,7 @@ bool GPUTextureVulkan::OnInit()
{
imageInfo.flags |= VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT;
}
-#if VULKAN_SUPPORTS_MAINTENANCE_LAYER1
+#if VK_KHR_maintenance1
if (_device->OptionalDeviceExtensions.HasKHRMaintenance1 && imageInfo.imageType == VK_IMAGE_TYPE_3D)
{
imageInfo.flags |= VK_IMAGE_CREATE_2D_ARRAY_COMPATIBLE_BIT_KHR;
diff --git a/Source/Engine/GraphicsDevice/Vulkan/GPUTextureVulkan.h b/Source/Engine/GraphicsDevice/Vulkan/GPUTextureVulkan.h
index 3b9d310cb..aa6546362 100644
--- a/Source/Engine/GraphicsDevice/Vulkan/GPUTextureVulkan.h
+++ b/Source/Engine/GraphicsDevice/Vulkan/GPUTextureVulkan.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/GraphicsDevice/Vulkan/GPUTimerQueryVulkan.cpp b/Source/Engine/GraphicsDevice/Vulkan/GPUTimerQueryVulkan.cpp
index e592bb48e..11592b6f8 100644
--- a/Source/Engine/GraphicsDevice/Vulkan/GPUTimerQueryVulkan.cpp
+++ b/Source/Engine/GraphicsDevice/Vulkan/GPUTimerQueryVulkan.cpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#if GRAPHICS_API_VULKAN
diff --git a/Source/Engine/GraphicsDevice/Vulkan/GPUTimerQueryVulkan.h b/Source/Engine/GraphicsDevice/Vulkan/GPUTimerQueryVulkan.h
index c6b396e0b..79bf26997 100644
--- a/Source/Engine/GraphicsDevice/Vulkan/GPUTimerQueryVulkan.h
+++ b/Source/Engine/GraphicsDevice/Vulkan/GPUTimerQueryVulkan.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/GraphicsDevice/Vulkan/GraphicsDeviceVulkan.Build.cs b/Source/Engine/GraphicsDevice/Vulkan/GraphicsDeviceVulkan.Build.cs
index 5ff5927d1..68eb5ffcc 100644
--- a/Source/Engine/GraphicsDevice/Vulkan/GraphicsDeviceVulkan.Build.cs
+++ b/Source/Engine/GraphicsDevice/Vulkan/GraphicsDeviceVulkan.Build.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using System;
using System.IO;
diff --git a/Source/Engine/GraphicsDevice/Vulkan/IncludeVulkanHeaders.h b/Source/Engine/GraphicsDevice/Vulkan/IncludeVulkanHeaders.h
index 1c618529e..7779f790e 100644
--- a/Source/Engine/GraphicsDevice/Vulkan/IncludeVulkanHeaders.h
+++ b/Source/Engine/GraphicsDevice/Vulkan/IncludeVulkanHeaders.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/GraphicsDevice/Vulkan/Linux/LinuxVulkanPlatform.cpp b/Source/Engine/GraphicsDevice/Vulkan/Linux/LinuxVulkanPlatform.cpp
index 46ff42641..dc864ec47 100644
--- a/Source/Engine/GraphicsDevice/Vulkan/Linux/LinuxVulkanPlatform.cpp
+++ b/Source/Engine/GraphicsDevice/Vulkan/Linux/LinuxVulkanPlatform.cpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#if GRAPHICS_API_VULKAN && PLATFORM_LINUX
@@ -47,20 +47,20 @@ VKAPI_ATTR VkBool32 VKAPI_CALL vkGetPhysicalDeviceXlibPresentationSupportKHR(
extern PFN_vkCreateXlibSurfaceKHR vkCreateXlibSurfaceKHR;
extern PFN_vkGetPhysicalDeviceXlibPresentationSupportKHR vkGetPhysicalDeviceXlibPresentationSupportKHR;
-void LinuxVulkanPlatform::GetInstanceExtensions(Array& outExtensions)
+void LinuxVulkanPlatform::GetInstanceExtensions(Array& extensions)
{
// Include X11 surface extension
- outExtensions.Add(VK_KHR_SURFACE_EXTENSION_NAME);
- outExtensions.Add(VK_KHR_XLIB_SURFACE_EXTENSION_NAME);
+ extensions.Add(VK_KHR_SURFACE_EXTENSION_NAME);
+ extensions.Add(VK_KHR_XLIB_SURFACE_EXTENSION_NAME);
}
-void LinuxVulkanPlatform::CreateSurface(void* windowHandle, VkInstance instance, VkSurfaceKHR* outSurface)
+void LinuxVulkanPlatform::CreateSurface(void* windowHandle, VkInstance instance, VkSurfaceKHR* surface)
{
VkXlibSurfaceCreateInfoKHR surfaceCreateInfo;
RenderToolsVulkan::ZeroStruct(surfaceCreateInfo, VK_STRUCTURE_TYPE_XLIB_SURFACE_CREATE_INFO_KHR);
surfaceCreateInfo.dpy = (X11::Display*)LinuxPlatform::GetXDisplay();
surfaceCreateInfo.window = (X11::Window)windowHandle;
- VALIDATE_VULKAN_RESULT(vkCreateXlibSurfaceKHR(instance, &surfaceCreateInfo, nullptr, outSurface));
+ VALIDATE_VULKAN_RESULT(vkCreateXlibSurfaceKHR(instance, &surfaceCreateInfo, nullptr, surface));
}
#endif
diff --git a/Source/Engine/GraphicsDevice/Vulkan/Linux/LinuxVulkanPlatform.h b/Source/Engine/GraphicsDevice/Vulkan/Linux/LinuxVulkanPlatform.h
index 070d3a9c9..32742ecb0 100644
--- a/Source/Engine/GraphicsDevice/Vulkan/Linux/LinuxVulkanPlatform.h
+++ b/Source/Engine/GraphicsDevice/Vulkan/Linux/LinuxVulkanPlatform.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
@@ -6,7 +6,6 @@
#if GRAPHICS_API_VULKAN && PLATFORM_LINUX
-#define VULKAN_USE_DEBUG_LAYER GPU_ENABLE_DIAGNOSTICS
#define VULKAN_HAS_PHYSICAL_DEVICE_PROPERTIES2 1
///
@@ -16,7 +15,7 @@ class LinuxVulkanPlatform : public VulkanPlatformBase
{
public:
- static void GetInstanceExtensions(Array& outExtensions);
+ static void GetInstanceExtensions(Array& extensions);
static void CreateSurface(void* windowHandle, VkInstance instance, VkSurfaceKHR* outSurface);
};
diff --git a/Source/Engine/GraphicsDevice/Vulkan/QueueVulkan.cpp b/Source/Engine/GraphicsDevice/Vulkan/QueueVulkan.cpp
index 0fa456ed6..aef60c55f 100644
--- a/Source/Engine/GraphicsDevice/Vulkan/QueueVulkan.cpp
+++ b/Source/Engine/GraphicsDevice/Vulkan/QueueVulkan.cpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#if GRAPHICS_API_VULKAN
@@ -50,8 +50,11 @@ void QueueVulkan::Submit(CmdBufferVulkan* cmdBuffer, uint32 numSignalSemaphores,
VALIDATE_VULKAN_RESULT(vkQueueSubmit(_queue, 1, &submitInfo, fence->GetHandle()));
+ // Mark semaphores as submitted
cmdBuffer->_state = CmdBufferVulkan::State::Submitted;
- cmdBuffer->MarkSemaphoresAsSubmitted();
+ cmdBuffer->_waitFlags.Clear();
+ cmdBuffer->_submittedWaitSemaphores = cmdBuffer->_waitSemaphores;
+ cmdBuffer->_waitSemaphores.Clear();
cmdBuffer->_submittedFenceCounter = cmdBuffer->_fenceSignaledCounter;
#if 0
diff --git a/Source/Engine/GraphicsDevice/Vulkan/QueueVulkan.h b/Source/Engine/GraphicsDevice/Vulkan/QueueVulkan.h
index 2deb1d147..7c11c958d 100644
--- a/Source/Engine/GraphicsDevice/Vulkan/QueueVulkan.h
+++ b/Source/Engine/GraphicsDevice/Vulkan/QueueVulkan.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/GraphicsDevice/Vulkan/RenderToolsVulkan.cpp b/Source/Engine/GraphicsDevice/Vulkan/RenderToolsVulkan.cpp
index 8616260eb..e974396a4 100644
--- a/Source/Engine/GraphicsDevice/Vulkan/RenderToolsVulkan.cpp
+++ b/Source/Engine/GraphicsDevice/Vulkan/RenderToolsVulkan.cpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#if GRAPHICS_API_VULKAN
@@ -199,7 +199,7 @@ VkCompareOp RenderToolsVulkan::ComparisonFuncToVkCompareOp[static_cast(Co
void RenderToolsVulkan::SetObjectName(VkDevice device, uint64 objectHandle, VkObjectType objectType, const String& name)
{
-#if VULKAN_SUPPORTS_DEBUG_UTILS
+#if VK_EXT_debug_utils
auto str = name.ToStringAnsi();
SetObjectName(device, objectHandle, objectType, str.Get());
#endif
diff --git a/Source/Engine/GraphicsDevice/Vulkan/RenderToolsVulkan.h b/Source/Engine/GraphicsDevice/Vulkan/RenderToolsVulkan.h
index c0c45b636..b18ae9c1b 100644
--- a/Source/Engine/GraphicsDevice/Vulkan/RenderToolsVulkan.h
+++ b/Source/Engine/GraphicsDevice/Vulkan/RenderToolsVulkan.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
@@ -48,7 +48,7 @@ public:
static void SetObjectName(VkDevice device, uint64 objectHandle, VkObjectType objectType, const char* name)
{
-#if VULKAN_SUPPORTS_DEBUG_UTILS
+#if VK_EXT_debug_utils
// Check for valid function pointer (may not be present if not running in a debugging application)
if (vkSetDebugUtilsObjectNameEXT != nullptr && name != nullptr && *name != 0)
{
@@ -94,7 +94,7 @@ public:
case VK_ACCESS_SHADER_WRITE_BIT:
stageFlags = VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT;
break;
-#if VULKAN_SUPPORTS_MAINTENANCE_LAYER2
+#if VK_KHR_maintenance2
case VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_READ_BIT:
case VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_READ_BIT | VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_WRITE_BIT:
stageFlags = VK_PIPELINE_STAGE_EARLY_FRAGMENT_TESTS_BIT | VK_PIPELINE_STAGE_LATE_FRAGMENT_TESTS_BIT;
@@ -144,7 +144,7 @@ public:
accessFlags = VK_ACCESS_SHADER_READ_BIT;
stageFlags = VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT;
break;
-#if VULKAN_SUPPORTS_MAINTENANCE_LAYER2
+#if VK_KHR_maintenance2
case VK_IMAGE_LAYOUT_DEPTH_READ_ONLY_STENCIL_ATTACHMENT_OPTIMAL_KHR:
accessFlags = VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_READ_BIT | VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_WRITE_BIT;
stageFlags = VK_PIPELINE_STAGE_EARLY_FRAGMENT_TESTS_BIT | VK_PIPELINE_STAGE_LATE_FRAGMENT_TESTS_BIT;
diff --git a/Source/Engine/GraphicsDevice/Vulkan/ResourceOwnerVulkan.h b/Source/Engine/GraphicsDevice/Vulkan/ResourceOwnerVulkan.h
index 877747eed..f96180aba 100644
--- a/Source/Engine/GraphicsDevice/Vulkan/ResourceOwnerVulkan.h
+++ b/Source/Engine/GraphicsDevice/Vulkan/ResourceOwnerVulkan.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/GraphicsDevice/Vulkan/Types.h b/Source/Engine/GraphicsDevice/Vulkan/Types.h
index 064dfe3ff..05e43ce76 100644
--- a/Source/Engine/GraphicsDevice/Vulkan/Types.h
+++ b/Source/Engine/GraphicsDevice/Vulkan/Types.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/GraphicsDevice/Vulkan/VulkanPlatform.h b/Source/Engine/GraphicsDevice/Vulkan/VulkanPlatform.h
index 931721d30..8e585c78e 100644
--- a/Source/Engine/GraphicsDevice/Vulkan/VulkanPlatform.h
+++ b/Source/Engine/GraphicsDevice/Vulkan/VulkanPlatform.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/GraphicsDevice/Vulkan/VulkanPlatformBase.h b/Source/Engine/GraphicsDevice/Vulkan/VulkanPlatformBase.h
index 35fc589fe..a12aef222 100644
--- a/Source/Engine/GraphicsDevice/Vulkan/VulkanPlatformBase.h
+++ b/Source/Engine/GraphicsDevice/Vulkan/VulkanPlatformBase.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/GraphicsDevice/Vulkan/Win32/Win32VulkanPlatform.cpp b/Source/Engine/GraphicsDevice/Vulkan/Win32/Win32VulkanPlatform.cpp
index 19e8e6e28..beaa2751b 100644
--- a/Source/Engine/GraphicsDevice/Vulkan/Win32/Win32VulkanPlatform.cpp
+++ b/Source/Engine/GraphicsDevice/Vulkan/Win32/Win32VulkanPlatform.cpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#include "Win32VulkanPlatform.h"
@@ -7,20 +7,20 @@
#include "../RenderToolsVulkan.h"
#include "Engine/Graphics/GPUDevice.h"
-void Win32VulkanPlatform::GetInstanceExtensions(Array& outExtensions)
+void Win32VulkanPlatform::GetInstanceExtensions(Array& extensions)
{
// Include Windows surface extension
- outExtensions.Add(VK_KHR_SURFACE_EXTENSION_NAME);
- outExtensions.Add(VK_KHR_WIN32_SURFACE_EXTENSION_NAME);
+ extensions.Add(VK_KHR_SURFACE_EXTENSION_NAME);
+ extensions.Add(VK_KHR_WIN32_SURFACE_EXTENSION_NAME);
}
-void Win32VulkanPlatform::CreateSurface(void* windowHandle, VkInstance instance, VkSurfaceKHR* outSurface)
+void Win32VulkanPlatform::CreateSurface(void* windowHandle, VkInstance instance, VkSurfaceKHR* surface)
{
VkWin32SurfaceCreateInfoKHR surfaceCreateInfo;
RenderToolsVulkan::ZeroStruct(surfaceCreateInfo, VK_STRUCTURE_TYPE_WIN32_SURFACE_CREATE_INFO_KHR);
surfaceCreateInfo.hinstance = GetModuleHandle(nullptr);
surfaceCreateInfo.hwnd = static_cast(windowHandle);
- VALIDATE_VULKAN_RESULT(vkCreateWin32SurfaceKHR(instance, &surfaceCreateInfo, nullptr, outSurface));
+ VALIDATE_VULKAN_RESULT(vkCreateWin32SurfaceKHR(instance, &surfaceCreateInfo, nullptr, surface));
}
#endif
diff --git a/Source/Engine/GraphicsDevice/Vulkan/Win32/Win32VulkanPlatform.h b/Source/Engine/GraphicsDevice/Vulkan/Win32/Win32VulkanPlatform.h
index 4b3280a0a..53397b538 100644
--- a/Source/Engine/GraphicsDevice/Vulkan/Win32/Win32VulkanPlatform.h
+++ b/Source/Engine/GraphicsDevice/Vulkan/Win32/Win32VulkanPlatform.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
@@ -18,8 +18,8 @@ class Win32VulkanPlatform : public VulkanPlatformBase
{
public:
- static void GetInstanceExtensions(Array& outExtensions);
- static void CreateSurface(void* windowHandle, VkInstance instance, VkSurfaceKHR* outSurface);
+ static void GetInstanceExtensions(Array& extensions);
+ static void CreateSurface(void* windowHandle, VkInstance instance, VkSurfaceKHR* surface);
};
typedef Win32VulkanPlatform VulkanPlatform;
diff --git a/Source/Engine/Input/Enums.h b/Source/Engine/Input/Enums.h
index 7b2b14a09..764a17922 100644
--- a/Source/Engine/Input/Enums.h
+++ b/Source/Engine/Input/Enums.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/Input/Gamepad.cpp b/Source/Engine/Input/Gamepad.cpp
index 68434278a..a67ea1c39 100644
--- a/Source/Engine/Input/Gamepad.cpp
+++ b/Source/Engine/Input/Gamepad.cpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#include "Gamepad.h"
diff --git a/Source/Engine/Input/Gamepad.h b/Source/Engine/Input/Gamepad.h
index d32ce2893..4fdf70ee3 100644
--- a/Source/Engine/Input/Gamepad.h
+++ b/Source/Engine/Input/Gamepad.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/Input/Input.Build.cs b/Source/Engine/Input/Input.Build.cs
index 2a1cc7570..36c7aa22f 100644
--- a/Source/Engine/Input/Input.Build.cs
+++ b/Source/Engine/Input/Input.Build.cs
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
using Flax.Build;
diff --git a/Source/Engine/Input/Input.cpp b/Source/Engine/Input/Input.cpp
index 767d89d38..1dfa0e5fe 100644
--- a/Source/Engine/Input/Input.cpp
+++ b/Source/Engine/Input/Input.cpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#include "Input.h"
#include "InputSettings.h"
diff --git a/Source/Engine/Input/Input.h b/Source/Engine/Input/Input.h
index 9e5b42a0f..33852f9ec 100644
--- a/Source/Engine/Input/Input.h
+++ b/Source/Engine/Input/Input.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/Input/InputDevice.h b/Source/Engine/Input/InputDevice.h
index 716fd19d3..81b4eceb7 100644
--- a/Source/Engine/Input/InputDevice.h
+++ b/Source/Engine/Input/InputDevice.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/Input/InputSettings.h b/Source/Engine/Input/InputSettings.h
index 7fc7d64a0..18718bfab 100644
--- a/Source/Engine/Input/InputSettings.h
+++ b/Source/Engine/Input/InputSettings.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/Input/Keyboard.h b/Source/Engine/Input/Keyboard.h
index 63b58aa76..ae958bd86 100644
--- a/Source/Engine/Input/Keyboard.h
+++ b/Source/Engine/Input/Keyboard.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/Input/KeyboardKeys.h b/Source/Engine/Input/KeyboardKeys.h
index 0251f5fcf..fe6daa12b 100644
--- a/Source/Engine/Input/KeyboardKeys.h
+++ b/Source/Engine/Input/KeyboardKeys.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/Input/Mouse.h b/Source/Engine/Input/Mouse.h
index 301b1fac6..15fa17e6d 100644
--- a/Source/Engine/Input/Mouse.h
+++ b/Source/Engine/Input/Mouse.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/Input/VirtualInput.h b/Source/Engine/Input/VirtualInput.h
index 1f7f0ce75..a1fb4ef05 100644
--- a/Source/Engine/Input/VirtualInput.h
+++ b/Source/Engine/Input/VirtualInput.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#pragma once
diff --git a/Source/Engine/Level/Actor.cpp b/Source/Engine/Level/Actor.cpp
index 2dc5c3180..81a5b3155 100644
--- a/Source/Engine/Level/Actor.cpp
+++ b/Source/Engine/Level/Actor.cpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
+// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#include "Actor.h"
#include "ActorsCache.h"
@@ -1547,7 +1547,7 @@ bool Actor::FromBytes(const Span& data, Array& output, ISerializeM
document.Parse(buffer, bufferSize);
if (document.HasParseError())
{
- Log::JsonParseException(document.GetParseError());
+ Log::JsonParseException(document.GetParseError(), document.GetErrorOffset());
return true;
}
@@ -1587,7 +1587,7 @@ bool Actor::FromBytes(const Span