Skip to content

Instantly share code, notes, and snippets.

View flowtsohg's full-sized avatar

Chananya Freiman flowtsohg

View GitHub Profile
// 4 bit alpha
function setRgba8888Dxt3(dst, i, int565, a) {
dst[i] = Math.floor(((int565 >> 11) & 31) / 31 * 255);
dst[i + 1] = Math.floor(((int565 >> 5) & 63) / 63 * 255);
dst[i + 2] = Math.floor((int565 & 31) / 31 * 255);
dst[i + 3] = Math.floor((a / 15) * 255);
}
// 8 bit alpha
function setRgba8888Dxt5(dst, i, int565, a) {