changeset 37002:9402cbe067c8

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().
author ib
date Fri, 28 Mar 2014 12:14:15 +0000
parents 64fabc358356
children 2d8157b3b386
files gui/ui/render.c
diffstat 1 files changed, 2 insertions(+), 36 deletions(-) [+]
line wrap: on
line diff
--- 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;