From 824bc0b41abac175ba4747f4ab2a17de68b307e1 Mon Sep 17 00:00:00 2001 From: "sigonasr2, Sig, Sigo" Date: Wed, 29 Jun 2022 19:10:12 +0000 Subject: [PATCH] Log initializes to zero so it's hidden until keys are pressed. Co-authored-by: sigonasr2 --- main | Bin 17576 -> 17624 bytes main.c | 5 +++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/main b/main index cc7c52b052b2f1abf8f8c125e9d4fad991c1575e..f6daad897057027b6240f88ff0445e0e8d899f11 100755 GIT binary patch delta 2503 zcmZ`*eQZ-z6u-A$>th}3>j!UBq%FiSm|NF<&`q6f$DTeE<;%*@7#tvALV`pHYJhDn zQ(j8r#xZ75H1LP81*4E^gecHK;x?m^X;_9?OpOpr7-8c>irIXg``#^Go7Lr6K&=KYFXR7Y18Jl5Vx#>af=HK zdF4I}^MFFtA0c)ed$FxJ_>+kcBXPj8JWrrRXJwCRMFx{3+YcqIA1sTv!hyW!s12s_ zgkn9XDlZdKl^U`W%B(^_cc8-F2F+?l<~|FXU+4`&pfw+gVwYAa~XK}`@x^eaR= zb5IMMKy(bz{W+)=t{^&-vlSf4LG$50PJqRTCUel~@Fb!;IGgQk4hlp5V4{^J3OEL2&Y}}FD$|N8C@fPQ03R0hEm5&+5wVd*1QieezL7JDz(?IK`W8ui(73{tbRRC(yRVdl=M10 z&DZ8_@U~-4q7A^qYAf+X$N(D8mTbx#E6 zA?E8@piXDqyUY|bU&RctPU6cF(?MFZOf&po-=X2jC(X@*yrALJd@rt5OtHsSa`_YUQdsx*?N8=9Q9htvJy z7>f}DbTSe;&PT_xIM%*%Oxe1u@C$KRin}^kCZw2{k?84|I3^ny4)a`9Ez#lhSChED zR2-LNw56nOsqXZywwO2)UrOcZNbJdUEP5d#_eJCZc}R-8oAdFs>=ii0-j8FR%(I|7BTq-<$*2@B+lTOq#q*}5_AzUEN#aBI z@@ad$i|Yo)73B!VK7x7xb+^`hTREJ@;Y`we%G>!VA2h8`4UC*t?B9$-pmx)#x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{cyN7 zK_c)%xrd67FZa`fFoNqa@D+YOuD`8Vb~e1Qs=~u>&|k!?7uZNZd&NrXf=??v_Fwef zO(@Dk%m(W!%V3a;(FTZCmEl$_(BzM2zwo;#%Ty`24G+dPhM9201-^hl6L@u+i^v98 z6}XAw*AKN)4BLyg9A2Gfp2%<}u$D$Jfq-X-RyoZAX@F+b;viK$8W^7b8Nd`XahmX3 znEy}WnWb-z%|u&NK|_# zt7x!du&>%fhv0*1KV1wH)$?c`d^Pt|8KfFNy#)@{yyLX9dlNA{H2E>SaJAq*jW>fg zxryx}s|-9^ZTQ0H2_DR=`QT?j9Rkpx;Jyy64m^32e*f3&*5wcg`j@?jk(t%_*Mjd- zb!sf+tPc)7Ne`W$z5f zDHh<+4SxQh{{P32VVFSFXbMBlhfuAbbLk!Dg67&Fm(aBY^wtI^o6=}bFHF?7+6MKl zf-fS#vk|^z*sdX}gkG);7DP(n^9T<;5xXrnoi0Rq-YA73=Rzpz=ZwckhUVxW&{J0l y-F0@5arV_!a+80`V5BZMdGq6XHTOVhse-K^st`+k3(<$yng}vuIr-! diff --git a/main.c b/main.c index a61d742..2bce592 100644 --- a/main.c +++ b/main.c @@ -5,7 +5,7 @@ #include "project/utils/utils.h" int main(int argc,char**argv) { - unsigned int keyLog[25]; + int*keyLog=calloc(25,sizeof(int)); unsigned short currentLogCounter=0; unsigned int frameCount = 0; int rows,cols; @@ -33,7 +33,7 @@ int main(int argc,char**argv) { if (clock()-lastTime>FRAMETIME) { mvprintw(5,7,"There are %dx%d squares. (%d)",rows,cols,frameCount++); for (int i=0;i<25;i++) { - if (keyLog[i]!=ERR) { + if (keyLog[i]>0) { mvprintw(6+i,2,"Key %d was pressed.",keyLog[i]); } } @@ -41,6 +41,7 @@ int main(int argc,char**argv) { lastTime=clock(); } } + free(keyLog); endwin(); return 0; }