Add BeatTime properties.
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
using Cryville.Common.Pdt;
|
||||
using System;
|
||||
using RBeatTime = Cryville.Crtr.BeatTime;
|
||||
|
||||
namespace Cryville.Crtr {
|
||||
public abstract class PropSrc {
|
||||
@@ -55,5 +56,21 @@ namespace Cryville.Crtr {
|
||||
}
|
||||
}
|
||||
}
|
||||
public class BeatTime : PropSrc {
|
||||
readonly Func<RBeatTime> _cb;
|
||||
public BeatTime(Func<RBeatTime> cb) { _cb = cb; }
|
||||
protected override unsafe void InternalGet(out int type, out byte[] value) {
|
||||
var bt = _cb();
|
||||
type = PdtInternalType.Vector;
|
||||
value = new byte[4 * sizeof(int)];
|
||||
fixed (byte* _ptr = value) {
|
||||
int* ptr = (int*)_ptr;
|
||||
*ptr++ = bt.b;
|
||||
*ptr++ = bt.n;
|
||||
*ptr++ = bt.d;
|
||||
*ptr++ = PdtInternalType.Number;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user