From 74f6e6577709d00306e336f5d824e01d7a107439 Mon Sep 17 00:00:00 2001 From: "@syxhe" Date: Tue, 3 Sep 2024 14:18:21 -0500 Subject: DECRYPTION WORKS --- src/screen.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'src/screen.c') diff --git a/src/screen.c b/src/screen.c index 4667895..dfee01d 100644 --- a/src/screen.c +++ b/src/screen.c @@ -13,6 +13,7 @@ #define _GNU_SOURCE #include "screen.h" + #include #include #include @@ -328,10 +329,14 @@ int spin(void *params) { winning++; } if(winning == 3) { - // Do winning anim - thrd_t decryptor; - thrd_create(&decryptor, p->decrypt_callback, p->decrypt_args); + // Do multithreading here + thrd_t decryptor; + if(thrd_create(&decryptor, p->decrypt_callback, p->decrypt_args) != thrd_success) { + endwin(); + error(1, 0, "Couldn't spawn thread to decrypt files"); + } + mvaddch(0, 0, 'J'); for(int i = 0, color = CCP_WINNING1;; i++, color = rangemod(color, 1, CCP_WINNING1, CCP_WINNING2)) { bkgd(COLOR_PAIR(color)); -- cgit v1.2.3