From d3e4ed96d6ba752055a7016c6870efa0bc8e9f84 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ki=C3=ABd=20Llaentenn?= Date: Thu, 17 Sep 2020 12:10:27 +0000 Subject: [PATCH] style: change --- draw.c | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/draw.c b/draw.c index 35f3b5b..5af219f 100644 --- a/draw.c +++ b/draw.c @@ -51,28 +51,30 @@ dofire(struct buffer *buf) struct tb_cell *realbuf = tb_cell_buffer(); - for (size_t x = 0; x < buf->width; ++x) - { - for (size_t y = 1; y < buf->height; ++y) - { + for (size_t x = 0; x < buf->width; ++x) { + for (size_t y = 1; y < buf->height; ++y) { src = y * buf->width + x; random = (rand() % 7) & 3; dest = src - random + 1; - if (buf->width > dest) + if (buf->width > dest) { dest = 0; - else + } else { dest -= buf->width; + } buf->buf[dest] = buf->buf[src] - (random & 1); - if (buf->buf[dest] > 12) + if (buf->buf[dest] > 12) { buf->buf[dest] = 0; + } struct tb_cell *colors; - if (opts->truecolor == TRUE) + if (opts->truecolor == TRUE) { colors = (struct tb_cell*) &truecolors; - else colors = (struct tb_cell*) &normcolors; + } else { + colors = (struct tb_cell*) &normcolors; + } realbuf[dest] = colors[buf->buf[dest]]; realbuf[src] = colors[buf->buf[src]];