Add in_area function. (Amend)
This commit is contained in:
@@ -20,6 +20,13 @@ namespace Cryville.Common.Pdt {
|
||||
Length = len;
|
||||
}
|
||||
/// <summary>
|
||||
/// Copies the memory in the span to another span.
|
||||
/// </summary>
|
||||
/// <param name="dest">The destination span.</param>
|
||||
public void CopyTo(PdtVariableMemory dest) {
|
||||
CopyTo(dest._ptr, 0, Length);
|
||||
}
|
||||
/// <summary>
|
||||
/// Copies the memory in the span to a buffer.
|
||||
/// </summary>
|
||||
/// <param name="dest">The destination buffer.</param>
|
||||
|
@@ -388,12 +388,16 @@ namespace Cryville.Crtr {
|
||||
public func_in_area() : base(1) { }
|
||||
protected override unsafe void Execute() {
|
||||
var arg = GetOperand(0);
|
||||
if (arg.Type == PdtInternalType.Number && arg.AsNumber() >= 0) {
|
||||
GetReturnFrame(PdtInternalType.Null, 0);
|
||||
return;
|
||||
if (arg.Type == PdtInternalType.Error) {
|
||||
throw new InvalidOperationException("Error");
|
||||
}
|
||||
else if (arg.Type == PdtInternalType.Number && arg.AsNumber() >= 0) {
|
||||
GetReturnFrame(PdtInternalType.Null, 0);
|
||||
}
|
||||
else {
|
||||
var ret = GetReturnFrame(arg.Type, arg.Length);
|
||||
arg.CopyTo(ret);
|
||||
}
|
||||
var ret = GetReturnFrame(arg.Type, arg.Length);
|
||||
arg.CopyTo(ret);
|
||||
}
|
||||
}
|
||||
unsafe static class oputil {
|
||||
|
Reference in New Issue
Block a user