diff options
| author | @syxhe <https://t.me/syxhe> | 2024-09-02 22:26:32 -0500 |
|---|---|---|
| committer | @syxhe <https://t.me/syxhe> | 2024-09-02 22:26:32 -0500 |
| commit | 248f88a02aea778c989f9673dffe5ddf7b7f3ee3 (patch) | |
| tree | 06d243097d09347fb31f5e8dd3fc3da538c1b724 /src/screen.c | |
| parent | 92b2b42b0976a2849e0fd25cbd4ceedebb9b0a5e (diff) | |
Make the encrypt function less shitty
Diffstat (limited to 'src/screen.c')
| -rw-r--r-- | src/screen.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/screen.c b/src/screen.c index d5b7f2b..4667895 100644 --- a/src/screen.c +++ b/src/screen.c | |||
| @@ -26,6 +26,9 @@ | |||
| 26 | #include <stdio.h> | 26 | #include <stdio.h> |
| 27 | #include <stdlib.h> | 27 | #include <stdlib.h> |
| 28 | #include <string.h> | 28 | #include <string.h> |
| 29 | #include <threads.h> | ||
| 30 | |||
| 31 | #define TESTING | ||
| 29 | 32 | ||
| 30 | //////////////////////////////////// SPECIFICALLY USEFUL FUNCS //////////////////////////////////// | 33 | //////////////////////////////////// SPECIFICALLY USEFUL FUNCS //////////////////////////////////// |
| 31 | 34 | ||
| @@ -326,6 +329,9 @@ int spin(void *params) { | |||
| 326 | } | 329 | } |
| 327 | if(winning == 3) { | 330 | if(winning == 3) { |
| 328 | // Do winning anim | 331 | // Do winning anim |
| 332 | thrd_t decryptor; | ||
| 333 | thrd_create(&decryptor, p->decrypt_callback, p->decrypt_args); | ||
| 334 | |||
| 329 | mvaddch(0, 0, 'J'); | 335 | mvaddch(0, 0, 'J'); |
| 330 | for(int i = 0, color = CCP_WINNING1;; i++, color = rangemod(color, 1, CCP_WINNING1, CCP_WINNING2)) { | 336 | for(int i = 0, color = CCP_WINNING1;; i++, color = rangemod(color, 1, CCP_WINNING1, CCP_WINNING2)) { |
| 331 | bkgd(COLOR_PAIR(color)); | 337 | bkgd(COLOR_PAIR(color)); |
| @@ -334,6 +340,8 @@ int spin(void *params) { | |||
| 334 | refresh(); | 340 | refresh(); |
| 335 | nanosleep(&sleeper, NULL); | 341 | nanosleep(&sleeper, NULL); |
| 336 | } | 342 | } |
| 343 | |||
| 344 | thrd_join(decryptor, NULL); | ||
| 337 | } | 345 | } |
| 338 | 346 | ||
| 339 | // Revert colors back to normal | 347 | // Revert colors back to normal |
