Add Vector Types to Ona Script #34
|
@ -41,8 +41,6 @@ pub const RuntimeEnv = struct {
|
|||
push_false,
|
||||
push_const: u16,
|
||||
push_local: u8,
|
||||
push_vector2,
|
||||
push_vector3,
|
||||
push_table: u32,
|
||||
push_builtin: Builtin,
|
||||
|
||||
local_set: u8,
|
||||
|
@ -346,47 +344,6 @@ pub const RuntimeEnv = struct {
|
|||
}
|
||||
},
|
||||
|
||||
.push_vector2 => {
|
||||
const x = try self.env.expect(try self.pop_local());
|
||||
|
||||
defer self.env.discard(x);
|
||||
|
||||
const y = try self.env.expect(try self.pop_local());
|
||||
|
||||
defer self.env.discard(y);
|
||||
|
||||
const vector = try self.env.new_vector2(
|
||||
@floatCast(try self.env.unbox_float(x)),
|
||||
@floatCast(try self.env.unbox_float(y)));
|
||||
|
||||
errdefer self.env.discard(vector);
|
||||
|
||||
try self.env.locals.push_one(vector);
|
||||
},
|
||||
|
||||
.push_vector3 => {
|
||||
const x = try self.env.expect(try self.pop_local());
|
||||
|
||||
defer self.env.discard(x);
|
||||
|
||||
const y = try self.env.expect(try self.pop_local());
|
||||
|
||||
defer self.env.discard(y);
|
||||
|
||||
const z = try self.env.expect(try self.pop_local());
|
||||
|
||||
defer self.env.discard(z);
|
||||
|
||||
const vector = try self.env.new_vector3(
|
||||
@floatCast(try self.env.unbox_float(x)),
|
||||
@floatCast(try self.env.unbox_float(y)),
|
||||
@floatCast(try self.env.unbox_float(z)));
|
||||
|
||||
errdefer self.env.discard(vector);
|
||||
|
||||
try self.env.locals.push_one(vector);
|
||||
},
|
||||
|
||||
.push_table => |push_table| {
|
||||
const table = try self.env.new_table();
|
||||
|
||||
|
|
Loading…
Reference in New Issue
These are no longer needed.