Do near-final touches, should of done this last commit but oh well.

Actually made C6JS C6JS and not node-specific. Didn't know there was a difference.
This commit is contained in:
yellows111 2023-11-28 12:52:34 +01:00
parent 4e27befc6f
commit 95172cf285
3 changed files with 51 additions and 41 deletions

View File

@ -1,30 +1,38 @@
# icondumper2 (working title)
A JavaScript library (sorta) to read PS2 icons, and their related formats.
## What it supports
* EMS Memory Adapter export files (.psu)
* PS3 virtual memory card export files (.psv)
* SharkPort export files (.sps)
* X-Port export files (.xps)
* PS2 icons (.ico, .icn)
* PS2D format (icon.sys)
## What can it do
* Allow any file in a PSU's or SPS/XPS's virtual filesystem to be dumped.
* Warn of invalid icon.sys display names.
* Read and parse an EMS MA export file.
* Export the icon model, with all seperate shapes included to a JavaScript Object.
* Node.js compatible (CommonJS) exporting while still being compatible with other JavaScript implementations.
* Convert a 128x128x16 BGR5A1 bitmap to a RGB5A1 format.
* Convert an icon or a set of icons to glTF, with textures.
## What it doesn't do
* (Re)build save files.
* Modify the original input files.
* Use any Node.js-exclusive features.
## Client compatibility
(todo: write this)
## Why "icondumper2"?
Because it replaced what *was* left of icondumper (1).
# icondumper2 (working title)
A JavaScript library (sorta) to read PS2 icons, and their related formats.
## What it supports
* EMS Memory Adapter export files (.psu)
* PS3 virtual memory card export files (.psv)
* SharkPort export files (.sps)
* X-Port export files (.xps)
* PS2 icons (.ico, .icn)
* PS2D format (icon.sys)
## What can it do
* Allow any file in a PSU's or SPS/XPS's virtual filesystem to be dumped.
* Warn of invalid icon.sys display names.
* Read and parse an EMS MA export file.
* Export the icon model, with all seperate shapes included to a JavaScript Object.
* Node.js compatible (CommonJS) exporting while still being compatible with other JavaScript implementations.
* Convert a 128x128x16 BGR5A1 bitmap to a RGB5A1 format.
* Convert an icon or a set of icons to glTF, with textures.
## What it doesn't do
* (Re)build save files.
* Modify the original input files.
* Use any Node.js-exclusive features.
## Client compatibility
(todo: write this)
## Why "icondumper2"?
Because it replaced what *was* left of icondumper (1).
## Included files
| File | Description |
| ---- | ----------------------------------------- |
| icon.js | The library itself. |
| index.js | Node.js example client. |
| gltf-exporter.js | Node.js client to export icons to glTF 2. |
| index.htm | HTML reference client. |

17
icon.js
View File

@ -590,13 +590,14 @@ function readSharkXPortSxpsFile(input) {
return fsOut;
}
/** If we have a module object, define module.exports with all public functions */
/** Define (module.)exports with all public functions */
exports = {
readers: {readIconFile, readPS2D, readEmsPsuFile, readPsvFile, readSharkXPortSxpsFile},
helpers: {uncompressTexture, convertBGR5A1toRGB5A1},
options: {setDebug, setStrictness},
version: ICONJS_VERSION
};
if(typeof module !== "undefined") {
// for C6JS
module.exports = {
readers: {readIconFile, readPS2D, readEmsPsuFile, readPsvFile, readSharkXPortSxpsFile},
helpers: {uncompressTexture, convertBGR5A1toRGB5A1},
options: {setDebug, setStrictness},
version: ICONJS_VERSION
};
module.exports = exports;
}

View File

@ -19,6 +19,7 @@
#titlebox {width: 99%;position: absolute;}
input[type="file"] {line-height: 2em;}
#version {text-shadow: 1px 1px 2px black;}
a {color: #ccc;}
</style>
<meta data-comment="WebGL Shader: Icon">
<script type="text/plain" id="shader-icon-v">
@ -631,11 +632,11 @@
}
//todo: More than one model shape rendering, other 2 icons (technically done? NMW though), Animation parsing, animation tweening
</script>
<span id="version">icondumper2 <span id="iconjsVersion">(unknown icon.js version)</span> [C: <span id="clientVersion">Loading...</span>] &mdash; &copy; <span id="currentYear">2023</span> yellows111</span>
<span id="version">icondumper2 <a href="./documentation" id="iconjsVersion">(unknown icon.js version)</a> [C: <span id="clientVersion">Loading...</span>] &mdash; &copy; <span id="currentYear">2023</span> yellows111</span>
<script>
document.getElementById("iconjsVersion").textContent = ICONJS_VERSION;
document.getElementById("iconjsVersion").textContent = exports.version;
document.getElementById("clientVersion").textContent = "0.6.5";
document.getElementById("currentYear").textContent = (new Date()).getFullYear().toString();
</script>
</body>
</html>
</html>