Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
ArmorShaderDataSet.cs
Go to the documentation of this file.
3
5
7{
9
11
12 protected int _shaderDataCount;
13
14 public T BindShader<T>(int itemId, T shaderData) where T : ArmorShaderData
15 {
18 return shaderData;
19 }
20
21 public void Apply(int shaderId, Entity entity, DrawData? drawData = null)
22 {
23 if (shaderId >= 1 && shaderId <= _shaderDataCount)
24 {
25 _shaderData[shaderId - 1].Apply(entity, drawData);
26 }
27 else
28 {
29 Main.pixelShader.CurrentTechnique.Passes[0].Apply();
30 }
31 }
32
33 public void ApplySecondary(int shaderId, Entity entity, DrawData? drawData = null)
34 {
35 if (shaderId >= 1 && shaderId <= _shaderDataCount)
36 {
37 _shaderData[shaderId - 1].GetSecondaryShader(entity).Apply(entity, drawData);
38 }
39 else
40 {
41 Main.pixelShader.CurrentTechnique.Passes[0].Apply();
42 }
43 }
44
46 {
48 {
49 return _shaderData[_shaderLookupDictionary[type] - 1];
50 }
51 return null;
52 }
53
54 public int GetShaderIdFromItemId(int type)
55 {
57 {
58 return _shaderLookupDictionary[type];
59 }
60 return 0;
61 }
62
64 {
65 if (id != 0 && id <= _shaderDataCount && _shaderData[id - 1] != null)
66 {
67 return _shaderData[id - 1].GetSecondaryShader(player);
68 }
69 return null;
70 }
71}
void Add(TKey key, TValue value)
ArmorShaderData GetSecondaryShader(int id, Player player)
void Apply(int shaderId, Entity entity, DrawData? drawData=null)
void ApplySecondary(int shaderId, Entity entity, DrawData? drawData=null)
static Effect pixelShader
Definition Main.cs:2764