diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 4b1b82f..66ce543 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -16,7 +16,7 @@ jobs: - name: Compile documentation with JSDoc run: npx jsdoc ./icon.js -d ./documentation -R ./README.md - name: Upload Artifacts - uses: 'actions/upload-artifact@main' + uses: actions/upload-artifact@main with: name: JSDoc-compiled Documentation path: './documentation/*' diff --git a/.gitignore b/.gitignore index 0d4e9b3..3bd233a 100644 --- a/.gitignore +++ b/.gitignore @@ -9,6 +9,9 @@ icon.sys *.psv *.xps *.sps +*.npo +*.p2m +*.md # Unused data diff --git a/examples/example_001/id2_example_001.psu b/examples/example_001/id2_example_001.psu new file mode 100644 index 0000000..79fe4db Binary files /dev/null and b/examples/example_001/id2_example_001.psu differ diff --git a/examples/example_001/id2_example_001.sps b/examples/example_001/id2_example_001.sps new file mode 100644 index 0000000..848f4f2 Binary files /dev/null and b/examples/example_001/id2_example_001.sps differ diff --git a/examples/example_001/raw/description.obj b/examples/example_001/raw/description.obj new file mode 100644 index 0000000..20a4d46 --- /dev/null +++ b/examples/example_001/raw/description.obj @@ -0,0 +1,19 @@ +# A test 12-vertice icon for testing icondumper2 clients. +# Original Wavefront OBJ file: +o DefaultObject001 +v 1.250000 1.000000 0.000000 +v -0.750000 1.000000 -1.000000 +v -0.750000 1.000000 1.000000 +v 0.000000 0.000000 0.000000 +vn -0.0000 1.0000 -0.0000 +vn -0.8000 -0.6000 -0.0000 +vn 0.3904 -0.4880 0.7807 +vn 0.3904 -0.4880 -0.7807 +vt 0.000000 0.000000 +vt 0.875000 0.500000 +vt 0.875000 0.750000 +s 0 +f 1/1/1 2/2/1 3/3/1 +f 4/1/2 3/3/2 2/2/2 +f 3/3/3 4/1/3 1/1/3 +f 4/1/4 2/2/4 1/1/4 diff --git a/examples/example_001/raw/example_001.icn b/examples/example_001/raw/example_001.icn new file mode 100644 index 0000000..d825c14 Binary files /dev/null and b/examples/example_001/raw/example_001.icn differ diff --git a/examples/example_001/raw/icon.sys b/examples/example_001/raw/icon.sys new file mode 100644 index 0000000..5186aec Binary files /dev/null and b/examples/example_001/raw/icon.sys differ diff --git a/icon.js b/icon.js index cc85bc2..a7f5882 100644 --- a/icon.js +++ b/icon.js @@ -8,7 +8,7 @@ ICONJS_STRICT = true; * @constant {string} * @default */ -const ICONJS_VERSION = "0.6.0"; +const ICONJS_VERSION = "0.6.1"; /** * Extension of DataView to add shortcuts for datatypes that I use often. @@ -576,11 +576,22 @@ function readSharkXPortSxpsFile(input) { offset += (titleLength + 4); const descriptionLength = u32le(offset); const description = input.slice(offset + 4, (offset + 4) + descriptionLength); - offset += (descriptionLength + 8); + offset += (descriptionLength + 4); + const description2Length = u32le(offset); + let description2; + if(description2Length !== 0) { + description2 = input.slice(offset + 4, (offset + 4) + description2Length); + offset += (description2Length + 4); + } else { + offset += 4; + } const comments = { "game": stringScrubber((new TextDecoder("utf-8")).decode(title)), "name": stringScrubber((new TextDecoder("utf-8")).decode(description)) } + if(description2Length !== 0) { + comments.desc = stringScrubber((new TextDecoder("utf-8")).decode(description2)); + } const totalSize = u32le(offset); offset += 4; const header = readSxpsDescriptor(input.slice(offset, offset + 250)); diff --git a/index.htm b/index.htm index 985f7a5..e128d94 100644 --- a/index.htm +++ b/index.htm @@ -148,7 +148,7 @@ Date modified: --:--:-- --/--/---- UTC+09:00

- File comments: (no title) - (no description) + File comments: (no title) - (no description) - (no other text)