# HG changeset patch # User ib # Date 1396008855 0 # Node ID 9402cbe067c8661b801e41db292d9beb4fd6b128 # Parent 64fabc358356bf27bc04558429bc9076c4a6a469 Remove SinglePhasePutImage(). Nothing in the skin documentation indicates that a phase image with just one phase will be treated specially, and there is absolutely no reason to do so. Fortunately, there seems to be no skin relying on SinglePhasePutImage(). diff -r 64fabc358356 -r 9402cbe067c8 gui/ui/render.c --- a/gui/ui/render.c Fri Mar 28 12:04:57 2014 +0000 +++ b/gui/ui/render.c Fri Mar 28 12:14:15 2014 +0000 @@ -384,32 +384,6 @@ } } -static void SinglePhasePutImage(guiImage *bf, int x, int y, float frac) -{ - int i = 0, w, r, ix, iy; - uint32_t *drw, *buf; - register uint32_t tmp; - - if (!bf || (bf->Image == NULL)) - return; - - buf = (uint32_t *)image_buffer; - drw = (uint32_t *)bf->Image; - w = bf->Width * frac; - r = bf->Width - w; - - for (iy = y; iy < (int)(y + bf->Height); iy++) { - for (ix = x; ix < (int)(x + w); ix++) { - tmp = drw[i++]; - - if (!IS_TRANSPARENT(tmp)) - buf[iy * drawbuf_width + ix] = tmp; - } - - i += r; - } -} - void RenderAll(wsWindow *window, guiItem *items, int nrItems, char *drawbuf) { guiItem *item; @@ -444,20 +418,12 @@ case itPimage: - if (item->numphases == 1) - SinglePhasePutImage(&item->Bitmap, item->x, item->y, item->value / 100.0); - else - PutImage(&item->Bitmap, item->x, item->y, item->numphases, (item->numphases - 1) * (item->value / 100.0)); - + PutImage(&item->Bitmap, item->x, item->y, item->numphases, (item->numphases - 1) * (item->value / 100.0)); break; case itHPotmeter: - if (item->numphases == 1) - SinglePhasePutImage(&item->Bitmap, item->x, item->y, item->value / 100.0); - else - PutImage(&item->Bitmap, item->x, item->y, item->numphases, (item->numphases - 1) * (item->value / 100.0)); - + PutImage(&item->Bitmap, item->x, item->y, item->numphases, (item->numphases - 1) * (item->value / 100.0)); PutImage(&item->Mask, item->x + (item->width - item->pwidth) * (item->value / 100.0), item->y, 3, index); break;