forked from old/legacy-imlib2
GIF loader: Indent.
And remove now unused label "finish".
This commit is contained in:
parent
1efd421614
commit
a8ca99a2a4
|
@ -141,24 +141,25 @@ load(ImlibImage * im, ImlibProgressFunction progress, char progress_granularity,
|
||||||
|
|
||||||
if (im->loader || immediate_load || progress)
|
if (im->loader || immediate_load || progress)
|
||||||
{
|
{
|
||||||
DATA32 colormap[256];
|
DATA32 colormap[256];
|
||||||
|
|
||||||
bg = gif->SBackGroundColor;
|
bg = gif->SBackGroundColor;
|
||||||
cmap = (gif->Image.ColorMap ? gif->Image.ColorMap : gif->SColorMap);
|
cmap = (gif->Image.ColorMap ? gif->Image.ColorMap : gif->SColorMap);
|
||||||
memset (colormap, 0, sizeof(colormap));
|
memset(colormap, 0, sizeof(colormap));
|
||||||
if (cmap != NULL)
|
if (cmap != NULL)
|
||||||
{
|
{
|
||||||
for (i = cmap->ColorCount > 256 ? 256 : cmap->ColorCount; i-- > 0;)
|
for (i = cmap->ColorCount > 256 ? 256 : cmap->ColorCount; i-- > 0;)
|
||||||
{
|
{
|
||||||
r = cmap->Colors[i].Red;
|
r = cmap->Colors[i].Red;
|
||||||
g = cmap->Colors[i].Green;
|
g = cmap->Colors[i].Green;
|
||||||
b = cmap->Colors[i].Blue;
|
b = cmap->Colors[i].Blue;
|
||||||
colormap[i] = (0xff << 24) | (r << 16) | (g << 8) | b;
|
colormap[i] = (0xff << 24) | (r << 16) | (g << 8) | b;
|
||||||
}
|
}
|
||||||
/* if bg > cmap->ColorCount, it is transparent black already */
|
/* if bg > cmap->ColorCount, it is transparent black already */
|
||||||
if (transp >= 0 && transp < 256)
|
if (transp >= 0 && transp < 256)
|
||||||
colormap[transp] = bg >= 0 && bg < 256 ? colormap[bg] & 0x00ffffff : 0x00000000;
|
colormap[transp] = bg >= 0 && bg < 256 ?
|
||||||
}
|
colormap[bg] & 0x00ffffff : 0x00000000;
|
||||||
|
}
|
||||||
im->data = (DATA32 *) malloc(sizeof(DATA32) * w * h);
|
im->data = (DATA32 *) malloc(sizeof(DATA32) * w * h);
|
||||||
if (!im->data)
|
if (!im->data)
|
||||||
goto quit;
|
goto quit;
|
||||||
|
@ -171,21 +172,20 @@ load(ImlibImage * im, ImlibProgressFunction progress, char progress_granularity,
|
||||||
{
|
{
|
||||||
*ptr++ = colormap[rows[i][j]];
|
*ptr++ = colormap[rows[i][j]];
|
||||||
}
|
}
|
||||||
per += per_inc;
|
per += per_inc;
|
||||||
if (progress && (((int)per) != last_per)
|
if (progress && (((int)per) != last_per)
|
||||||
&& (((int)per) % progress_granularity == 0))
|
&& (((int)per) % progress_granularity == 0))
|
||||||
|
{
|
||||||
|
last_per = (int)per;
|
||||||
|
if (!(progress(im, (int)per, 0, last_y, w, i)))
|
||||||
{
|
{
|
||||||
last_per = (int)per;
|
rc = 2;
|
||||||
if (!(progress(im, (int)per, 0, last_y, w, i)))
|
goto quit;
|
||||||
{
|
|
||||||
rc = 2;
|
|
||||||
goto quit;
|
|
||||||
}
|
|
||||||
last_y = i;
|
|
||||||
}
|
}
|
||||||
|
last_y = i;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
finish:
|
|
||||||
if (progress)
|
if (progress)
|
||||||
progress(im, 100, 0, last_y, w, h);
|
progress(im, 100, 0, last_y, w, h);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue