Skip to content
This repository was archived by the owner on Oct 10, 2020. It is now read-only.

Commit dec35dd

Browse files
author
Joseph Spencer
committed
Operational: no underlying issue, merely an oversight for something dumb
1 parent 867949f commit dec35dd

File tree

2 files changed

+19
-11
lines changed

2 files changed

+19
-11
lines changed

src/opcontrol.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ void opcontrol()
1111

1212
screen::Field field(scr);
1313

14-
field.setSideLength(200);
14+
field.setSideLength(400);
1515

1616
// two stacks use an array of colors
1717
// draw a purple stack with height 1 and an orange stack with height 3 in the far red zone

src/screen/field.cpp

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ void Field::setPos(uint8_t x, uint8_t y)
5656
void Field::setSideLength(uint ilength){
5757
scalar = ilength / 240.0;
5858
clean();
59-
pros::delay(25);
59+
lv_obj_set_size(obj, ilength, ilength);
6060
}
6161

6262
void Field::draw(const cubeGroup pos, const uint8_t presence)
@@ -407,6 +407,14 @@ void Field::drawColoredTiles()
407407

408408
void Field::drawLines()
409409
{
410+
411+
short s40, s80, s160, s200, s240;
412+
413+
static lv_point_t irzPts[3];
414+
static lv_point_t orzPts[4];
415+
static lv_point_t ibzPts[3];
416+
static lv_point_t obzPts[4];
417+
410418
lv_obj_t *middleLine1 = lv_obj_create(obj, NULL);
411419
lv_obj_set_style(middleLine1, &lineStyle);
412420
lv_obj_set_pos(middleLine1, scale(117), 3);
@@ -417,25 +425,25 @@ void Field::drawLines()
417425
lv_obj_t *innerRedZone = lv_line_create(obj, NULL);
418426
lv_line_set_style(innerRedZone, &lineStyle);
419427

420-
short s40 = static_cast<short>(scale(40));
421-
short s80 = static_cast<short>(scale(80));
422-
short s160 = static_cast<short>(scale(160));
423-
short s200 = static_cast<short>(scale(200));
424-
short s240 = static_cast<short>(scale(240));
428+
s40 = static_cast<short>(scale(40));
429+
s80 = static_cast<short>(scale(80));
430+
s160 = static_cast<short>(scale(160));
431+
s200 = static_cast<short>(scale(200));
432+
s240 = static_cast<short>(scale(240));
425433

426-
static lv_point_t irzPts[3] = {{0, s40}, {s40, s40}, {s40, 0}};
434+
irzPts[0] = {0, s40}; irzPts[1] = {s40, s40}; irzPts[2] = {s40, 0};
427435
lv_line_set_points(innerRedZone, irzPts, 3);
428436

429437
lv_obj_t *outerRedZone = lv_line_create(obj, innerRedZone);
430-
static lv_point_t orzPts[4] = {{0, s80}, {s40, s80}, {s80, s40}, {s80, 0}};
438+
orzPts[0] = {0, s80}; orzPts[1] = {s40, s80}; orzPts[2] = {s80, s40}; orzPts[3] = {s80, 0};
431439
lv_line_set_points(outerRedZone, orzPts, 4);
432440

433441
lv_obj_t *innerBlueZone = lv_line_create(obj, innerRedZone);
434-
static lv_point_t ibzPts[3] = {{s200, 0}, {s200, s40}, {s240, s40}};
442+
ibzPts[0] = {s200, 0}; ibzPts[1] = {s200, s40}; ibzPts[2] = {s240, s40};
435443
lv_line_set_points(innerBlueZone, ibzPts, 3);
436444

437445
lv_obj_t *outerBlueZone = lv_line_create(obj, innerRedZone);
438-
static lv_point_t obzPts[4] = {{s160, 0}, {s160, s40}, {s200, s80}, {s240, s80}};
446+
obzPts[0] = {s160, 0}; obzPts[1] = {s160, s40}; obzPts[2] = {s200, s80}; obzPts[3] = {s240, s80};
439447
lv_line_set_points(outerBlueZone, obzPts, 4);
440448
}
441449

0 commit comments

Comments
 (0)