summaryrefslogtreecommitdiff
path: root/src/screen.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/screen.c')
-rw-r--r--src/screen.c8
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