|
|
|
@ -13,23 +13,14 @@ function push_point(s, x, y, ax, ay, bx, by, thickness, r, g, b, stroke_id) {
@@ -13,23 +13,14 @@ function push_point(s, x, y, ax, ay, bx, by, thickness, r, g, b, stroke_id) {
|
|
|
|
|
ser_u32(s, stroke_id); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
function push_quad(s, p1x, p1y, p2x, p2y, p3x, p3y, p4x, p4y, ax, ay, bx, by, thickness, r, g, b, stroke_id, indexed = true) { |
|
|
|
|
if (indexed) { |
|
|
|
|
push_point(s, p1x, p1y, ax, ay, bx, by, thickness, r, g, b, stroke_id); |
|
|
|
|
push_point(s, p2x, p2y, ax, ay, bx, by, thickness, r, g, b, stroke_id); |
|
|
|
|
push_point(s, p3x, p3y, ax, ay, bx, by, thickness, r, g, b, stroke_id); |
|
|
|
|
push_point(s, p4x, p4y, ax, ay, bx, by, thickness, r, g, b, stroke_id); |
|
|
|
|
} else { |
|
|
|
|
push_point(s, p1x, p1y, ax, ay, bx, by, thickness, r, g, b, stroke_id); |
|
|
|
|
push_point(s, p2x, p2y, ax, ay, bx, by, thickness, r, g, b, stroke_id); |
|
|
|
|
push_point(s, p3x, p3y, ax, ay, bx, by, thickness, r, g, b, stroke_id); |
|
|
|
|
push_point(s, p4x, p4y, ax, ay, bx, by, thickness, r, g, b, stroke_id); |
|
|
|
|
push_point(s, p3x, p3y, ax, ay, bx, by, thickness, r, g, b, stroke_id); |
|
|
|
|
push_point(s, p2x, p2y, ax, ay, bx, by, thickness, r, g, b, stroke_id); |
|
|
|
|
} |
|
|
|
|
function push_quad(s, p1x, p1y, p2x, p2y, p3x, p3y, p4x, p4y, ax, ay, bx, by, thickness, r, g, b, stroke_id) { |
|
|
|
|
push_point(s, p1x, p1y, ax, ay, bx, by, thickness, r, g, b, stroke_id); |
|
|
|
|
push_point(s, p2x, p2y, ax, ay, bx, by, thickness, r, g, b, stroke_id); |
|
|
|
|
push_point(s, p3x, p3y, ax, ay, bx, by, thickness, r, g, b, stroke_id); |
|
|
|
|
push_point(s, p4x, p4y, ax, ay, bx, by, thickness, r, g, b, stroke_id); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
function push_stroke(s, stroke, stroke_index, indexed = true) { |
|
|
|
|
function push_stroke(s, stroke, stroke_index) { |
|
|
|
|
const stroke_width = stroke.width; |
|
|
|
|
const points = stroke.points; |
|
|
|
|
const color_u32 = stroke.color; |
|
|
|
@ -78,8 +69,7 @@ function push_stroke(s, stroke, stroke_index, indexed = true) {
@@ -78,8 +69,7 @@ function push_stroke(s, stroke, stroke_index, indexed = true) {
|
|
|
|
|
to.x, to.y, |
|
|
|
|
stroke_width, |
|
|
|
|
r, g, b, |
|
|
|
|
stroke_index, |
|
|
|
|
indexed |
|
|
|
|
stroke_index |
|
|
|
|
); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
@ -164,7 +154,7 @@ function recompute_dynamic_data(state, context) {
@@ -164,7 +154,7 @@ function recompute_dynamic_data(state, context) {
|
|
|
|
|
// player has the same data as their current stroke: points, color, width
|
|
|
|
|
const player = state.players[player_id]; |
|
|
|
|
if (player.points.length > 1) { |
|
|
|
|
push_stroke(context.dynamic_serializer, player, 0, false); |
|
|
|
|
push_stroke(context.dynamic_serializer, player, 0); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|