mayingzhen / nvidia-texture-tools

Automatically exported from code.google.com/p/nvidia-texture-tools
Other
0 stars 0 forks source link

ColorSet::setColors not accessing correct colour. #153

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
change this code from:
    // Set colors.
    for (uint y = 0, i = 0; y < h; y++)
    {
        for (uint x = 0; x < w; x++, i++)
        {
            colors[i].x = r[x + img_x, y + img_y];
            colors[i].y = g[x + img_x, y + img_y];
            colors[i].z = b[x + img_x, y + img_y];
            colors[i].w = a[x + img_x, y + img_y];
        }
    }

to:

    // Set colors.
    for (uint y = 0, i = 0; y < h; y++)
    {
        for (uint x = 0; x < w; x++, i++)
        {
            int offset = x + img_x + (y + img_y) * img_w;
            colors[i].x = r[offset];
            colors[i].y = g[offset];
            colors[i].z = b[offset];
            colors[i].w = a[offset];
        }
    }
}

Original issue reported on code.google.com by pope...@gmail.com on 6 Dec 2010 at 9:01

GoogleCodeExporter commented 8 years ago
See issue 152 for status.

Original comment by cast...@gmail.com on 8 Dec 2010 at 8:13