Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
EffectAnnotation.cs
Go to the documentation of this file.
1using System;
4
6
7public sealed class EffectAnnotation
8{
9 internal unsafe ID3DXBaseEffect* pEffect;
10
11 internal unsafe sbyte* _handle;
12
13 internal string _name;
14
15 internal string _semantic;
16
17 internal int _rows;
18
19 internal int _columns;
20
22
24
26
28
29 public int ColumnCount => _columns;
30
31 public int RowCount => _rows;
32
33 public string Semantic => _semantic;
34
35 public string Name => _name;
36
37 internal unsafe EffectAnnotation(ID3DXBaseEffect* parent, sbyte* handle)
38 {
39 pEffect = parent;
41 base._002Ector();
42 ID3DXBaseEffect* ptr = pEffect;
43 System.Runtime.CompilerServices.Unsafe.SkipInit(out _D3DXPARAMETER_DESC d3DXPARAMETER_DESC);
44 int num = ((delegate* unmanaged[Stdcall, Stdcall]<IntPtr, sbyte*, _D3DXPARAMETER_DESC*, int>)(int)(*(uint*)(*(int*)ptr + 16)))((nint)ptr, _handle, &d3DXPARAMETER_DESC);
45 if (num < 0)
46 {
48 }
49 IntPtr ptr2 = (IntPtr)(void*)(int)(*(uint*)(&d3DXPARAMETER_DESC));
51 _semantic = ((System.Runtime.CompilerServices.Unsafe.As<_D3DXPARAMETER_DESC, int>(ref System.Runtime.CompilerServices.Unsafe.AddByteOffset(ref d3DXPARAMETER_DESC, 4)) == 0) ? string.Empty : Marshal.PtrToStringAnsi((IntPtr)(void*)(int)System.Runtime.CompilerServices.Unsafe.As<_D3DXPARAMETER_DESC, uint>(ref System.Runtime.CompilerServices.Unsafe.AddByteOffset(ref d3DXPARAMETER_DESC, 4))));
52 _rows = System.Runtime.CompilerServices.Unsafe.As<_D3DXPARAMETER_DESC, int>(ref System.Runtime.CompilerServices.Unsafe.AddByteOffset(ref d3DXPARAMETER_DESC, 16));
53 _columns = System.Runtime.CompilerServices.Unsafe.As<_D3DXPARAMETER_DESC, int>(ref System.Runtime.CompilerServices.Unsafe.AddByteOffset(ref d3DXPARAMETER_DESC, 20));
54 _paramClass = _003CModule_003E.ConvertDxParameterClassToXna(System.Runtime.CompilerServices.Unsafe.As<_D3DXPARAMETER_DESC, _D3DXPARAMETER_CLASS>(ref System.Runtime.CompilerServices.Unsafe.AddByteOffset(ref d3DXPARAMETER_DESC, 8)));
55 _paramType = _003CModule_003E.ConvertDxParameterTypeToXna(System.Runtime.CompilerServices.Unsafe.As<_D3DXPARAMETER_DESC, _D3DXPARAMETER_TYPE>(ref System.Runtime.CompilerServices.Unsafe.AddByteOffset(ref d3DXPARAMETER_DESC, 12)));
56 }
57
58 internal unsafe void UpdateHandle(ID3DXBaseEffect* parent, sbyte* handle)
59 {
60 pEffect = parent;
62 }
63
64 [return: MarshalAs(UnmanagedType.U1)]
65 public unsafe bool GetValueBoolean()
66 {
67 try
68 {
69 return new EffectParameter(pEffect, null, _handle, -1).GetValueBoolean();
70 }
71 finally
72 {
73 }
74 }
75
76 public unsafe int GetValueInt32()
77 {
78 try
79 {
80 return new EffectParameter(pEffect, null, _handle, -1).GetValueInt32();
81 }
82 finally
83 {
84 }
85 }
86
87 public unsafe float GetValueSingle()
88 {
89 try
90 {
91 return new EffectParameter(pEffect, null, _handle, -1).GetValueSingle();
92 }
93 finally
94 {
95 }
96 }
97
98 public unsafe Vector2 GetValueVector2()
99 {
100 try
101 {
102 return new EffectParameter(pEffect, null, _handle, -1).GetValueVector2();
103 }
104 finally
105 {
106 }
107 }
108
109 public unsafe Vector3 GetValueVector3()
110 {
111 try
112 {
113 return new EffectParameter(pEffect, null, _handle, -1).GetValueVector3();
114 }
115 finally
116 {
117 }
118 }
119
120 public unsafe Vector4 GetValueVector4()
121 {
122 try
123 {
124 return new EffectParameter(pEffect, null, _handle, -1).GetValueVector4();
125 }
126 finally
127 {
128 }
129 }
130
131 public unsafe Matrix GetValueMatrix()
132 {
133 try
134 {
135 return new EffectParameter(pEffect, null, _handle, -1).GetValueMatrix();
136 }
137 finally
138 {
139 }
140 }
141
142 public unsafe string GetValueString()
143 {
144 try
145 {
146 return new EffectParameter(pEffect, null, _handle, -1).GetValueString();
147 }
148 finally
149 {
150 }
151 }
152}
unsafe EffectAnnotation(ID3DXBaseEffect *parent, sbyte *handle)
unsafe void UpdateHandle(ID3DXBaseEffect *parent, sbyte *handle)
static Exception GetExceptionFromResult(uint result)
static unsafe? string PtrToStringAnsi(IntPtr ptr)
Definition Marshal.cs:630