DEbug not working so moving pcs

This commit is contained in:
2026-02-15 16:41:33 -06:00
parent 92a753560b
commit 99d030003c
20 changed files with 634 additions and 127 deletions

View File

@@ -396,6 +396,8 @@
// Width and Height
elError.style.display = 'none';
// Convert from little endian
imageWidth = dataView.getUint32(3);
imageHeight = dataView.getUint32(7);
@@ -631,12 +633,9 @@
// Create Dusk Palette File (.dpf)
const header = new Uint8Array([0x44, 0x50, 0x46, 0x01]); // 'DPF' + version 1 + number of colors (4 bytes)
const colorCount = palette.length;
const colorCountBytes = new Uint8Array(4);
colorCountBytes[0] = (colorCount >> 24) & 0xFF;
colorCountBytes[1] = (colorCount >> 16) & 0xFF;
colorCountBytes[2] = (colorCount >> 8) & 0xFF;
colorCountBytes[3] = colorCount & 0xFF;
// Color count (1 byte)
const colorCountBytes = new Uint8Array(1);
colorCountBytes[0] = palette.length;
// add color data (palette.length * 4 bytes)
const colorData = new Uint8Array(palette.length * 4);
@@ -661,19 +660,9 @@
btnDownloadImage.addEventListener('click', () => {
const header = new Uint8Array([0x44, 0x50, 0x54, 0x01]); // 'DPT' + version 1
// Width
const widthBytes = new Uint8Array(4);
widthBytes[3] = (imageWidth >> 24) & 0xFF;
widthBytes[2] = (imageWidth >> 16) & 0xFF;
widthBytes[1] = (imageWidth >> 8) & 0xFF;
widthBytes[0] = imageWidth & 0xFF;
// Height
const heightBytes = new Uint8Array(4);
heightBytes[3] = (imageHeight >> 24) & 0xFF;
heightBytes[2] = (imageHeight >> 16) & 0xFF;
heightBytes[1] = (imageHeight >> 8) & 0xFF;
heightBytes[0] = imageHeight & 0xFF;
// Dimensions
const widthBytes = new Uint8Array([ imageWidth ]);
const heightBytes = new Uint32Array([ imageHeight ]);
// add indexed image data (imageWidth * imageHeight bytes)
const imageData = new Uint8Array(indexedImage.length);