diff options
author | katherine <ageha@airen-no-jikken.icu> | 2021-02-13 23:28:44 -0700 |
---|---|---|
committer | katherine <ageha@airen-no-jikken.icu> | 2021-02-13 23:28:44 -0700 |
commit | c798ac3371859a40f480edadc1e798ca2550b204 (patch) | |
tree | 586818c65cca9f7e93ad28baeb7fa8a08d83aa4e /06-brain2 | |
parent | 0d7a72fabf92abd2e8189cbe86af74f62a768631 (diff) | |
download | allegro-sketches-c798ac3371859a40f480edadc1e798ca2550b204.tar.gz |
ups
Diffstat (limited to '06-brain2')
-rw-r--r-- | 06-brain2/src/main.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/06-brain2/src/main.c b/06-brain2/src/main.c index 5e1f387..4640638 100644 --- a/06-brain2/src/main.c +++ b/06-brain2/src/main.c @@ -76,6 +76,7 @@ int main(int argc, char **argv) reset: memset(bits1, 0, sizeof(bits1)); + memset(bits2, 0, sizeof(bits1)); while(true) { al_wait_for_event(eq, &e); @@ -86,7 +87,7 @@ reset: goto done; case ALLEGRO_EVENT_MOUSE_BUTTON_DOWN: - bits1[e.mouse.y / DISP_SCALE][e.mouse.x / DISP_SCALE] = 1; + bits1[e.mouse.y / DISP_SCALE][e.mouse.x / DISP_SCALE] = 3; mouse_down = true; break; @@ -107,6 +108,7 @@ reset: case ALLEGRO_KEY_2: memset(bits1, 0, sizeof(bits1)); + memset(bits2, 0, sizeof(bits2)); for (x = 0; x < SEED_BITS; x++) { bits1[randombytes_random() % BUF_H][randombytes_random() % BUF_W] = 3; } @@ -131,7 +133,7 @@ reset: if (mouse_down) { al_get_mouse_state(&ms); - bits1[ms.y / DISP_SCALE][ms.x / DISP_SCALE] = 1; + bits1[ms.y / DISP_SCALE][ms.x / DISP_SCALE] = 3; } /* step */ |