From: b Date: Wed, 30 Nov 2022 23:07:09 +0000 (+0000) Subject: fixed pallette mixing X-Git-Url: http://bicyclesonthemoon.info/git-projects/?a=commitdiff_plain;h=2e1e9453ef7016daba7f53c68a4c80fb0a29ad37;p=ott%2Fenhance fixed pallette mixing --- diff --git a/core.c b/core.c index 20118c1..31e5063 100644 --- a/core.c +++ b/core.c @@ -1556,7 +1556,7 @@ int palette_mix_index (ILuint n, struct PixelInfo *p, void *data) if (n < 3) return EIO; - p[2].index = p[0].index * p[0].info.palette_num_cols + p[1].index; + p[2].index = p[0].index * p[1].info.palette_num_cols + p[1].index; return 0; } diff --git a/pal_mix.c b/pal_mix.c index 973982c..2ced874 100644 --- a/pal_mix.c +++ b/pal_mix.c @@ -78,6 +78,13 @@ int subtool_pal_mix (int argc, char **argv, int argi, char **err) } data.p = data.p0 + data.p1; + r = reserve_pictures(3); + if (r) + { + *err = CREATE_FAILED; + return r; + } + r = load_picture(0, argv[argi], &(info[0]), &(flags[0])); if (r) { diff --git a/testimg/bsta-000367.png b/testimg/bsta-000367.png new file mode 100644 index 0000000..a9955c8 Binary files /dev/null and b/testimg/bsta-000367.png differ