summaryrefslogtreecommitdiff
path: root/binutils/resrc.c
diff options
context:
space:
mode:
authorChristopher Faylor <me+cygwin@cgf.cx>2003-10-02 14:13:10 +0000
committerChristopher Faylor <me+cygwin@cgf.cx>2003-10-02 14:13:10 +0000
commit986084fcde1bedbf6e49f894a3b8a8400bc2b0ec (patch)
treece757548026012b8705025cf5ad9a8a737b406c7 /binutils/resrc.c
parent2a7aa21dbcd399832187d3ea842c91ae325e3c2b (diff)
downloadbinutils-redhat-986084fcde1bedbf6e49f894a3b8a8400bc2b0ec.tar.gz
* resrc.c (define_icon): Fix storage of color attributes 'planes' and 'bit
count' in icon groups.
Diffstat (limited to 'binutils/resrc.c')
-rw-r--r--binutils/resrc.c18
1 files changed, 14 insertions, 4 deletions
diff --git a/binutils/resrc.c b/binutils/resrc.c
index 2613b396d5..b8b69e6fea 100644
--- a/binutils/resrc.c
+++ b/binutils/resrc.c
@@ -1040,10 +1040,20 @@ define_icon (struct res_id id, const struct res_res_info *resinfo,
cg->height = icondirs[i].height;
cg->colors = icondirs[i].colorcount;
- cg->planes = 1;
- cg->bits = 0;
- while ((1 << cg->bits) < cg->colors)
- ++cg->bits;
+ if (icondirs[i].u.icon.planes)
+ cg->planes = icondirs[i].u.icon.planes;
+ else
+ cg->planes = 1;
+
+ if (icondirs[i].u.icon.bits)
+ cg->bits = icondirs[i].u.icon.bits;
+ else
+ {
+ cg->bits = 0;
+
+ while ((1L << cg->bits) < cg->colors)
+ ++cg->bits;
+ }
cg->bytes = icondirs[i].bytes;
cg->index = first_icon + i + 1;