aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkatherine <ageha@airen-no-jikken.icu>2021-02-13 23:28:44 -0700
committerkatherine <ageha@airen-no-jikken.icu>2021-02-13 23:28:44 -0700
commitc798ac3371859a40f480edadc1e798ca2550b204 (patch)
tree586818c65cca9f7e93ad28baeb7fa8a08d83aa4e
parent0d7a72fabf92abd2e8189cbe86af74f62a768631 (diff)
downloadallegro-sketches-c798ac3371859a40f480edadc1e798ca2550b204.tar.gz
ups
-rw-r--r--05-brain/src/main.c1
-rw-r--r--06-brain2/src/main.c6
2 files changed, 5 insertions, 2 deletions
diff --git a/05-brain/src/main.c b/05-brain/src/main.c
index dfa2d2c..bcd1660 100644
--- a/05-brain/src/main.c
+++ b/05-brain/src/main.c
@@ -76,6 +76,7 @@ int main(int argc, char **argv)
reset:
memset(bits1, 0, sizeof(bits1));
+ memset(bits2, 0, sizeof(bits2));
while(true) {
al_wait_for_event(eq, &e);
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 */