From 52dec9fc579b98a2c9331aed7017eebc7f6e0119 Mon Sep 17 00:00:00 2001 From: Curtis McEnroe Date: Sun, 11 Feb 2018 11:13:34 -0500 Subject: Avoid xres/yres names in gfxx --- bin/gfxx.c | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) (limited to 'bin') diff --git a/bin/gfxx.c b/bin/gfxx.c index 051d4591..a8e15ac6 100644 --- a/bin/gfxx.c +++ b/bin/gfxx.c @@ -155,17 +155,17 @@ extern const char *status(void) { struct Iter { uint32_t *buf; - size_t xres; - size_t yres; + size_t bufWidth; + size_t bufHeight; size_t left; size_t x; size_t y; }; -static struct Iter iter(uint32_t *buf, size_t xres, size_t yres) { - struct Iter it = { .buf = buf, .xres = xres, .yres = yres }; +static struct Iter iter(uint32_t *buf, size_t bufWidth, size_t bufHeight) { + struct Iter it = { .buf = buf, .bufWidth = bufWidth, .bufHeight = bufHeight }; if (mirror) it.x = width - 1; - if (flip) it.y = yres / scale - 1; + if (flip) it.y = bufHeight / scale - 1; return it; } @@ -184,19 +184,19 @@ static bool nextY(struct Iter *it) { if (flip) { if (it->y == 0) { it->left += width; - it->y = it->yres / scale; + it->y = it->bufHeight / scale; } it->y--; } else { it->y++; - if (it->y == it->yres / scale) { + if (it->y == it->bufHeight / scale) { it->left += width; it->y = 0; } } it->x = it->left; if (mirror) it->x += width - 1; - return (it->left < it->xres / scale); + return (it->left < it->bufWidth / scale); } static bool next(struct Iter *it) { @@ -207,10 +207,10 @@ static void put(const struct Iter *it, uint32_t p) { size_t scaledX = it->x * scale; size_t scaledY = it->y * scale; for (size_t fillY = scaledY; fillY < scaledY + scale; ++fillY) { - if (fillY >= it->yres) break; + if (fillY >= it->bufHeight) break; for (size_t fillX = scaledX; fillX < scaledX + scale; ++fillX) { - if (fillX >= it->xres) break; - it->buf[fillY * it->xres + fillX] = p; + if (fillX >= it->bufWidth) break; + it->buf[fillY * it->bufWidth + fillX] = p; } } } @@ -275,9 +275,9 @@ static void drawBytes(struct Iter *it) { } } -extern void draw(uint32_t *buf, size_t xres, size_t yres) { - memset(buf, 0, 4 * xres * yres); - struct Iter it = iter(buf, xres, yres); +extern void draw(uint32_t *buf, size_t bufWidth, size_t bufHeight) { + memset(buf, 0, 4 * bufWidth * bufHeight); + struct Iter it = iter(buf, bufWidth, bufHeight); if (BITS_TOTAL >= 8) { drawBytes(&it); } else { -- cgit 1.4.1 oop.1?h=1.5&id=acf2e55a3383a6e4ee58e56d6933cc1fe1427145&follow=1'>Expand and clarify documentationJune McEnroe 2020-05-21Execute PAGER with the SHELLJune McEnroe 2020-05-21Automatically perform database migrations in litterboxJune McEnroe 2020-05-20Don't install rc scripts on other platformsJune McEnroe 2020-05-20Rewrite build and install like pounce 1.3June McEnroe 2020-05-20Update email addressesJune McEnroe 2020-04-23Call updateConsumer from handleError 1.2p1June McEnroe 2020-04-20Use . as ${LDLIBS.$@} separatorJune McEnroe 2020-04-05Error on invalid ISUPPORT values 1.2June McEnroe 2020-04-05Only set RCS on FreeBSDJune McEnroe 2020-04-05Log bans and unbansJune McEnroe 2020-04-05Parse mode types from ISUPPORTJune McEnroe 2020-04-05Add unscoop matchers for ban/unban eventsJune McEnroe 2020-04-05Check unscoop regexps with make testJune McEnroe 2020-04-05Add unscoop -n flag for checking regexpsJune McEnroe 2020-04-05Add Ban and Unban event typesJune McEnroe 2020-04-02Update styleJune McEnroe 2020-03-31Update unscoop catgirl matchersJune McEnroe 2020-03-31Fix writing verbose to stderrJune McEnroe 2020-03-02Include <>/-/* around nicks in scoop coloring 1.1June McEnroe 2020-03-02Replace .mk files with configure scriptJune McEnroe 2020-02-28Implement the causal.agency/consumer capabilityJune McEnroe 2020-02-22Include <>/-/* around nicks in coloringJune McEnroe 2020-02-22Use (almost) the full range of IRC colors for nicksJune McEnroe