aboutsummaryrefslogtreecommitdiff
path: root/drawing/op.ha
diff options
context:
space:
mode:
Diffstat (limited to 'drawing/op.ha')
-rw-r--r--drawing/op.ha8
1 files changed, 2 insertions, 6 deletions
diff --git a/drawing/op.ha b/drawing/op.ha
index aa7fac4..82a412f 100644
--- a/drawing/op.ha
+++ b/drawing/op.ha
@@ -11,7 +11,6 @@ export type op_stroke = struct {
pos1: pos,
color: u32,
radius: u8,
- count: u8,
};
export type op = (op_circle | op_stroke);
@@ -22,7 +21,6 @@ type op_type = enum u8 {
export type deser_fail = !void;
-
// return value must be freed... for now. ehh
export fn ser_op(op: op) []u8 = match (op) {
case let opc: op_circle => yield ser_op_circle(opc);
@@ -68,8 +66,8 @@ fn deser_op_circle(bytes: []u8) (op_circle|deser_fail) = {
};
};
-def SER_LEN_STROKE = 23;
-// type:1 pos0:8 pos1:8 color:4 radius:1 count:1
+def SER_LEN_STROKE = 22;
+// type:1 pos0:8 pos1:8 color:4 radius:1
fn ser_op_stroke(ops: op_stroke) []u8 = {
let buf: []u8 = alloc([0...], SER_LEN_STROKE);
buf[0] = op_type::STROKE;
@@ -79,7 +77,6 @@ fn ser_op_stroke(ops: op_stroke) []u8 = {
ser_pos(payload[8..16], ops.pos1);
endian::leputu32(payload[16..20], ops.color);
payload[20] = ops.radius;
- payload[21] = ops.count;
return buf;
};
fn deser_op_stroke(bytes: []u8) (op_stroke|deser_fail) = {
@@ -90,7 +87,6 @@ fn deser_op_stroke(bytes: []u8) (op_stroke|deser_fail) = {
pos1 = deser_pos(payload[8..16]),
color = endian::legetu32(payload[16..20]),
radius = payload[20],
- count = payload[21],
};
};