diff options
author | Oxore <oxore@protonmail.com> | 2018-07-02 23:11:26 +0300 |
---|---|---|
committer | Oxore <oxore@protonmail.com> | 2018-07-02 23:11:26 +0300 |
commit | 21a0a44853451f3d791bafc80c01deab0ff4c79e (patch) | |
tree | 7636e99380c570d903db114ad2834f8bbd93fd7b /src/field.c | |
parent | bb9d1873ad414b09efdd7c8bf6798b431adb3cb2 (diff) |
Introduce draw manager, refactor main
Move timers to struct game. Partially move field painting to draw
manager.
Diffstat (limited to 'src/field.c')
-rw-r--r-- | src/field.c | 33 |
1 files changed, 3 insertions, 30 deletions
diff --git a/src/field.c b/src/field.c index 89abd02..c0e3fe5 100644 --- a/src/field.c +++ b/src/field.c @@ -53,36 +53,9 @@ void colorize_field(struct field *fld) void colorize_field_random(struct field *fld) { - int a; - for (int j = 0; j < fld->size.y; j++) { - for (int i = 0; i < fld->size.x; i++) { - a = rand() % 7 + 1; - switch (a) { - case 1 : - sfRectangleShape_setFillColor(fld->p[j][i], LCOLOR); - break; - case 2 : - sfRectangleShape_setFillColor(fld->p[j][i], RLCOLOR); - break; - case 3 : - sfRectangleShape_setFillColor(fld->p[j][i], ZCOLOR); - break; - case 4 : - sfRectangleShape_setFillColor(fld->p[j][i], SCOLOR); - break; - case 5 : - sfRectangleShape_setFillColor(fld->p[j][i], BCOLOR); - break; - case 6 : - sfRectangleShape_setFillColor(fld->p[j][i], ICOLOR); - break; - case 7 : - sfRectangleShape_setFillColor(fld->p[j][i], TCOLOR); - break; - } - sfRectangleShape_setOutlineColor(fld->p[j][i], UIFGACTIVECOLOR); - } - } + for (int j = 0; j < fld->size.y; j++) + for (int i = 0; i < fld->size.x; i++) + fld->c[j][i].color = rand() % 7 + 1; } void colorize_active_shape(struct field *fld, struct shape *shape) |