diff --git a/icon.js b/icon.js index bd441cd..27ee66d 100644 --- a/icon.js +++ b/icon.js @@ -1,7 +1,7 @@ //todo: Make this a module/mjs file. C6 compatibility can stay, if needed. ICONJS_DEBUG = false; ICONJS_STRICT = true; -ICONJS_VERSION = "0.4.1"; +ICONJS_VERSION = "0.4.2"; function setDebug(value) { ICONJS_DEBUG = !!value; diff --git a/input.htm b/input.htm index 3c48d47..2dce93a 100644 --- a/input.htm +++ b/input.htm @@ -44,7 +44,7 @@ (a_position.x * pos.x) + (a_position.z * pos.y), //transform the x position (0.0 - a_position.y) - 2.75, // invert the y position and move down -2.75, which will center the model (a_position.x * -pos.y) + (a_position.z * pos.x), //transform the z position - 3.0 + 3.5 ); // flip it, scale it v_textureCoords = a_textureCoords; @@ -63,14 +63,21 @@ @@ -106,11 +113,11 @@

No File

Loaded

- Background/icon preview:
+ Background/icon preview (rotate: ←/→ keys):

-

Normal: (no file) Copying: (no file) Deleting: (no file)

+

Normal: (no file) Copying: (no file) Deleting: (no file)


@@ -131,9 +138,9 @@

- Date created: --:--:-- --/--/---- UTC+09:00 - | - Date modified: --:--:-- --/--/---- UTC+09:00 + Date created: --:--:-- --/--/---- UTC+09:00 + + Date modified: --:--:-- --/--/---- UTC+09:00

File comments: (no title) - (no description) @@ -202,7 +209,6 @@ document.getElementById("fileCommentName").textContent = "(no description)"; } function renderIcon(iconData, fileMetadata = null) { - console.log("rats", fileMetadata); if(fileMetadata === null) { fileMetadata = { "lighting": { @@ -243,7 +249,8 @@ if(iconData.textureFormat !== "N") { var attributes = { position: glFgContext.getAttribLocation(iconProgram, "a_position"), - textureCoords: glFgContext.getAttribLocation(iconProgram, "a_textureCoords") + textureCoords: glFgContext.getAttribLocation(iconProgram, "a_textureCoords"), + color: glFgContext.getAttribLocation(iconProgram, "a_color"), }; var uniforms = { rotation: glFgContext.getUniformLocation(iconProgram, "u_rotation"), @@ -281,14 +288,13 @@ glFgContext.enableVertexAttribArray(attributes.position); glFgContext.bufferData(glFgContext.ARRAY_BUFFER, new Float32Array(verticesArray), glFgContext.STATIC_DRAW); glFgContext.vertexAttribPointer(attributes.position, 3, glFgContext.FLOAT, false, 0, 0); - if(iconData.textureFormat === "N") { - //.section COLOURS - const colorBuffer = glFgContext.createBuffer(); - glFgContext.bindBuffer(glFgContext.ARRAY_BUFFER, colorBuffer); - glFgContext.enableVertexAttribArray(attributes.color); - glFgContext.bufferData(glFgContext.ARRAY_BUFFER, new Float32Array(colourArray), glFgContext.STATIC_DRAW); - glFgContext.vertexAttribPointer(attributes.color, 4, glFgContext.FLOAT, false, 0, 0); - } else { + //.section COLOURS + const colorBuffer = glFgContext.createBuffer(); + glFgContext.bindBuffer(glFgContext.ARRAY_BUFFER, colorBuffer); + glFgContext.enableVertexAttribArray(attributes.color); + glFgContext.bufferData(glFgContext.ARRAY_BUFFER, new Float32Array(colourArray), glFgContext.STATIC_DRAW); + glFgContext.vertexAttribPointer(attributes.color, 4, glFgContext.FLOAT, false, 0, 0); + if(iconData.textureFormat !== "N") { //.section UV const uvBuffer = glFgContext.createBuffer(); glFgContext.bindBuffer(glFgContext.ARRAY_BUFFER, uvBuffer); @@ -400,6 +406,7 @@ let output = readPS2D(inputData["icon.sys"]); updateDisplay(output); renderIcon(readIconFile(inputData.icons.n), output); + console.log(readIconFile(inputData.icons.n)); let cTime = inputData.timestamps.created; let mTime = inputData.timestamps.modified; //TODO: use Time() to align JST times to user-local timezone @@ -520,6 +527,6 @@ icondumper2 (unknown icon.js version) [C: Loading...] — © 2023 yellows111 - + \ No newline at end of file