make line drawing work

This commit is contained in:
Konstantin Käfer
2014-01-29 11:12:09 +01:00
parent e359d697fb
commit 04e16cf2ca
11 changed files with 127 additions and 83 deletions

View File

@@ -20,10 +20,15 @@ void LineBuffer::add(int16_t x, int16_t y, float ex, float ey, int8_t tx, int8_t
array.push_back((x * 2) | tx);
array.push_back((y * 2) | ty);
array.push_back(linesofar);
array.push_back(
((int16_t)round(extrudeScale * ex) << 8) |
((int16_t)round(extrudeScale * ey) & 0xFF)
);
int16_t extrude = 0;
int8_t *extrude_x = ((int8_t *)&extrude) + 0;
int8_t *extrude_y = ((int8_t *)&extrude) + 1;
*extrude_x = round(extrudeScale * ex);
*extrude_y = round(extrudeScale * ey);
array.push_back(extrude);
if (!dirty) dirty = true;
};