Renamed Int-Vector and added swizzle

This commit is contained in:
Simon Lübeß
2021-12-08 20:58:26 +01:00
parent f28984bec5
commit e55b73db0f
10 changed files with 620 additions and 620 deletions
+6 -6
View File
@@ -82,11 +82,11 @@ namespace GlitchyEngine.Renderer
case typeof(int32):
EnsureTypeMatch(1, 1, .Int);
case typeof(Int32_2):
case typeof(Int2):
EnsureTypeMatch(1, 2, .Int);
case typeof(Int32_3):
case typeof(Int3):
EnsureTypeMatch(1, 3, .Int);
case typeof(Int32_4):
case typeof(Int4):
EnsureTypeMatch(1, 4, .Int);
case typeof(Matrix4x3):
@@ -127,9 +127,9 @@ namespace GlitchyEngine.Renderer
public void SetData(Vector4 value) => SetData<Vector4>(value);
public void SetData(int32 value) => SetData<int32>(value);
public void SetData(Int32_2 value) => SetData<Int32_2>(value);
public void SetData(Int32_3 value) => SetData<Int32_3>(value);
public void SetData(Int32_4 value) => SetData<Int32_4>(value);
public void SetData(Int2 value) => SetData<Int2>(value);
public void SetData(Int3 value) => SetData<Int3>(value);
public void SetData(Int4 value) => SetData<Int4>(value);
public void SetData(ColorRGB value) => SetData<ColorRGB>(value);
public void SetData(ColorRGBA value) => SetData<ColorRGBA>(value);
+3 -3
View File
@@ -124,9 +124,9 @@ namespace GlitchyEngine.Renderer
public void SetVariable(String name, Vector4 value) => SetVariable<Vector4>(name, value);
public void SetVariable(String name, int32 value) => SetVariable<int32>(name, value);
public void SetVariable(String name, Int32_2 value) => SetVariable<Int32_2>(name, value);
public void SetVariable(String name, Int32_3 value) => SetVariable<Int32_3>(name, value);
public void SetVariable(String name, Int32_4 value) => SetVariable<Int32_4>(name, value);
public void SetVariable(String name, Int2 value) => SetVariable<Int2>(name, value);
public void SetVariable(String name, Int3 value) => SetVariable<Int3>(name, value);
public void SetVariable(String name, Int4 value) => SetVariable<Int4>(name, value);
public void SetVariable(String name, Color value) => SetVariable<ColorRGBA>(name, value);
public void SetVariable(String name, ColorRGB value) => SetVariable<ColorRGB>(name, value);
+6 -6
View File
@@ -18,7 +18,7 @@ namespace GlitchyEngine.Renderer.Text
public FT_UInt GlyphIndex;
// TODO: Consider using floats
public Int32_3 MapCoord;
public Int3 MapCoord;
public int32 Width, Height;
public double TranslationX, TranslationY;
@@ -45,10 +45,10 @@ namespace GlitchyEngine.Renderer.Text
private int32 _faceIndex;
private bool _hasColor;
private Int32_3 _penPos;
private Int3 _penPos;
private int32 _lastRowHeight;
internal Texture2D _atlas ~ _?.ReleaseRef();
private Int32_3 _atlasSize;
private Int3 _atlasSize;
private Dictionary<char32, GlyphDescriptor> _glyphs = new .() ~ DeleteDictionaryAndValues!(_);
GlyphDescriptor _missingGlyph;
@@ -215,12 +215,12 @@ namespace GlitchyEngine.Renderer.Text
UpdateAtlas();
}
Int32_3 PrepareAtlas()
Int3 PrepareAtlas()
{
const uint32 maxRes = 16384; // D3D11_REQ_TEXTURE2D_U_OR_V_DIMENSION
const uint32 maxArray = 2048; // D3D11_REQ_TEXTURE2D_ARRAY_AXIS_DIMENSION
ref Int32_3 pen = ref _penPos;
ref Int3 pen = ref _penPos;
ref int32 rowHeight = ref _lastRowHeight;
int32 atlasWidth = _atlasSize.X;
@@ -298,7 +298,7 @@ namespace GlitchyEngine.Renderer.Text
void DrawAtlas()
{
Int32_3 oldAtlasSize = _atlasSize;
Int3 oldAtlasSize = _atlasSize;
_atlasSize = PrepareAtlas();
if(_atlasSize != oldAtlasSize)