|
|
@ -39,7 +39,7 @@ function push_stroke(context, stroke) { |
|
|
|
// if (stroke.stroke_id !== 1123776468) {
|
|
|
|
// if (stroke.stroke_id !== 1123776468) {
|
|
|
|
// return;
|
|
|
|
// return;
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
|
|
const stroke_width = stroke.width; |
|
|
|
const stroke_width = stroke.width; |
|
|
|
const points = stroke.points; |
|
|
|
const points = stroke.points; |
|
|
|
const color_u32 = stroke.color; |
|
|
|
const color_u32 = stroke.color; |
|
|
@ -132,14 +132,17 @@ function geometry_prepare_stroke(state) { |
|
|
|
|
|
|
|
|
|
|
|
function geometry_add_stroke(state, context, stroke) { |
|
|
|
function geometry_add_stroke(state, context, stroke) { |
|
|
|
if (!state.online || !stroke) return; |
|
|
|
if (!state.online || !stroke) return; |
|
|
|
if (stroke.points.length < 2) return; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const stroke_quads = count_stroke_quads(stroke.points); |
|
|
|
const stroke_quads = count_stroke_quads(stroke.points); |
|
|
|
// const stroke_quads = Math.ceil(stroke.points.length / MAX_POINTS_PER_QUAD);
|
|
|
|
// const stroke_quads = Math.ceil(stroke.points.length / MAX_POINTS_PER_QUAD);
|
|
|
|
|
|
|
|
|
|
|
|
// Points
|
|
|
|
// Points
|
|
|
|
const point_bytes_left = context.point_serializer.size - context.point_serializer.offset; |
|
|
|
let point_bytes_left = context.point_serializer.size - context.point_serializer.offset; |
|
|
|
const point_bytes_needed = stroke.points.length * config.bytes_per_point; |
|
|
|
let point_bytes_needed = stroke.points.length * config.bytes_per_point; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (point_bytes_needed % 8192 != 0) { |
|
|
|
|
|
|
|
point_bytes_needed += 8192 - point_bytes_needed % 8192; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (point_bytes_left < point_bytes_needed) { |
|
|
|
if (point_bytes_left < point_bytes_needed) { |
|
|
|
const extend_points_by = Math.ceil((context.point_serializer.size + point_bytes_needed) * 1.62); |
|
|
|
const extend_points_by = Math.ceil((context.point_serializer.size + point_bytes_needed) * 1.62); |
|
|
|