amatrix

AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
git clone git://git.kocotian.pl/amatrix.git
Log | Files | Refs | README | LICENSE

commit 8b716ffc7d303f2818119acc49b3de802ace2905
parent 67cf6ee0c41c06a74d89e572b6713e335b8b0704
Author: Abishek V Ashok <abishekvashok@gmail.com>
Date:   Wed, 27 Mar 2019 18:00:19 +0530

Merge pull request #69 from FrozenAndrey/fix#68

Fixes #68 (First symbol in a drawing line is green like others)
Diffstat:
Mcmatrix.c | 9+++++----
1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/cmatrix.c b/cmatrix.c @@ -60,6 +60,7 @@ /* Matrix typedef */ typedef struct cmatrix { int val; + bool is_head; } cmatrix; /* Global variables */ @@ -620,6 +621,7 @@ if (console) { y = 0; while (i <= LINES && (matrix[i][j].val != ' ' && matrix[i][j].val != -1)) { + matrix[i][j].is_head = false; i++; y++; } @@ -630,7 +632,7 @@ if (console) { } matrix[i][j].val = (int) rand() % randnum + randmin; - + matrix[i][j].is_head = true; /* If we're at the top of the collumn and it's reached its full length (about to start moving down), we do this @@ -657,7 +659,7 @@ if (console) { for (i = y; i <= z; i++) { move(i - y, j); - if (matrix[i][j].val == 0) { + if (matrix[i][j].is_head && !rainbow) { if (console || xwindow) { attron(A_ALTCHARSET); } @@ -683,8 +685,7 @@ if (console) { attroff(A_ALTCHARSET); } } else { - - if(rainbow){ + if(rainbow) { int randomColor = rand() % 6; switch(randomColor){