]> git.draconx.ca Git - liblbx.git/blobdiff - src/image.c
liblbx: Don't scale palette values internally.
[liblbx.git] / src / image.c
index 4657208a05ae28439496346473c8de7cb1566023..98d1a31118ceb03085d14d860045ef267ed52244 100644 (file)
@@ -413,9 +413,9 @@ lbx_img_loadpalette(void *f, const struct lbx_file_ops *fops,
                }
 
                palette[i] = (struct lbx_colour) {
-                       .red    = entry[1] << 2,
-                       .green  = entry[2] << 2,
-                       .blue   = entry[3] << 2,
+                       .red    = entry[1] & 0x3f,
+                       .green  = entry[2] & 0x3f,
+                       .blue   = entry[3] & 0x3f,
                        .active = 1,
                };
        }
@@ -451,9 +451,9 @@ lbx_img_getpalette(struct lbx_image *pub, struct lbx_colour palette[static 256])
                }
 
                palette[img->palstart + i] = (struct lbx_colour){
-                       .red    = entry[1] << 2,
-                       .green  = entry[2] << 2,
-                       .blue   = entry[3] << 2,
+                       .red    = entry[1],
+                       .green  = entry[2],
+                       .blue   = entry[3],
                        .active = 1,
                };
        }