Reconstruct property sources and operators to generic types.
This commit is contained in:
@@ -455,11 +455,9 @@ namespace Cryville.Crtr {
|
||||
}
|
||||
}
|
||||
|
||||
public unsafe class VectorSrc : PropSrc.FixedBuffer {
|
||||
public unsafe class VectorSrc : PropSrc.FixedBuffer<Vector> {
|
||||
const int MAX_DIMENSION = 4;
|
||||
protected readonly Func<Vector> _cb;
|
||||
public VectorSrc(Func<Vector> cb) : base(PdtInternalType.Vector, MAX_DIMENSION * sizeof(float) + sizeof(int)) {
|
||||
_cb = cb;
|
||||
public VectorSrc(Func<Vector> cb) : base(PdtInternalType.Vector, MAX_DIMENSION * sizeof(float) + sizeof(int), cb) {
|
||||
fixed (byte* rptr = buf) {
|
||||
var ptr = (float*)rptr;
|
||||
*(int*)(ptr + MAX_DIMENSION) = PdtInternalType.Number;
|
||||
@@ -475,9 +473,8 @@ namespace Cryville.Crtr {
|
||||
}
|
||||
}
|
||||
|
||||
public class VectorOp : PropOp {
|
||||
readonly Action<float[]> _cb;
|
||||
public VectorOp(Action<float[]> cb) { _cb = cb; }
|
||||
public class VectorOp : PropOp.Fixed<float[]> {
|
||||
public VectorOp(Action<float[]> cb) : base(cb) { }
|
||||
protected override unsafe void Execute() {
|
||||
var op = GetOperand(0);
|
||||
float[] values;
|
||||
|
Reference in New Issue
Block a user