silphscope 1.3.2 → 1.3.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -161,6 +161,7 @@
161
161
  "possibleFrameWidth": 64,
162
162
  "possibleFrameHeight": 64,
163
163
  "note": "so I think this image is actually 4 images slapped into one... as such to extract the image will need to be unusually large... so let me test this I guess :p of course though without image slicing for now",
164
+ "note2": "erm I can't really figure this out... it appears when this image was concat(ed) it got very finely mushed together... so it is kinda hard to tell where the frames are... sure the image is separated but it doesn't line up with the pret image refrences...",
164
165
  "imageSize": "64x192",
165
166
  "imageWidth": 64,
166
167
  "imageHeight": 192,
@@ -227,9 +228,12 @@
227
228
  "imageHeight": 40,
228
229
  "frameCount": 1,
229
230
  "frames": [
230
- { "x": 0, "y": 0, "width": 32, "height": 40 }
231
+ { "x": 0, "y": 0, "width": 32, "height": 32 },
232
+ { "x": 0, "y": 32, "width": 16, "height": 8 },
233
+ { "x": 16, "y": 32, "width": 8, "height": 8 }
231
234
  ],
232
- "note": "yup so this is weird :p from what I can tell the image is actually made up of a 32x32 main area then on the bottom there are 2 I think 8x16 images? I don't know :p will fix later like everything else in this repo..."
235
+ "note": "yup so this is weird :p from what I can tell the image is actually made up of a 32x32 main area then on the bottom there are 2 I think 8x16 images? I don't know :p will fix later like everything else in this repo...",
236
+ "note2": "fixed! I think..."
233
237
  },
234
238
  "TIED_BAG": {
235
239
  "index": 15,
@@ -1740,9 +1744,10 @@
1740
1744
  "frameCount": 2,
1741
1745
  "frames": [
1742
1746
  { "x": 0, "y": 0, "width": 8, "height": 8 },
1743
- { "x": 0, "y": 8, "width": 16, "height": 16 }
1747
+ { "x": 8, "y": 0, "width": 8, "height": 16 },
1748
+ { "x": 0, "y": 8, "width": 8, "height": 16 }
1744
1749
  ],
1745
- "note": "oh how I hate concat images... hopefully though my understaing of how they are working should result in a correct image..."
1750
+ "note": "unless the image data itself was wrong... the resulting image was kinda weird... but this should \"fix it\" granted it is still weird..."
1746
1751
  },
1747
1752
  "ALERT": {
1748
1753
  "index": 75,
@@ -2324,9 +2329,9 @@
2324
2329
  "PENCIL_2": {
2325
2330
  "index": 95,
2326
2331
  "animTag": "ANIM_TAG_PENCIL_2",
2327
- "imageSize": "16x42",
2332
+ "imageSize": "16x48",
2328
2333
  "imageWidth": 16,
2329
- "imageHeight": 42,
2334
+ "imageHeight": 48,
2330
2335
  "frameCount": 3,
2331
2336
  "frames": [
2332
2337
  {
@@ -2514,7 +2519,7 @@
2514
2519
  "frames": [
2515
2520
  {
2516
2521
  "x": 0,
2517
- "y": 16,
2522
+ "y": 0,
2518
2523
  "width": 16,
2519
2524
  "height": 16
2520
2525
  }
@@ -3284,7 +3289,7 @@
3284
3289
  "x": 0,
3285
3290
  "y": 0,
3286
3291
  "width": 16,
3287
- "height": 32
3292
+ "height": 16
3288
3293
  }
3289
3294
  ],
3290
3295
  "unused": true
@@ -3610,19 +3615,20 @@
3610
3615
  "possibleFrameSize": "8x8",
3611
3616
  "possibleFrameWidth": 8,
3612
3617
  "possibleFrameHeight": 8,
3613
- "imageSize": "16x80",
3618
+ "imageSize": "16x56",
3614
3619
  "imageWidth": 16,
3615
- "imageHeight": 80,
3616
- "frameCount": 6,
3620
+ "imageHeight": 56,
3621
+ "frameCount": 7,
3617
3622
  "frames": [
3618
3623
  { "x": 0, "y": 0, "width": 16, "height": 16 },
3619
- { "x": 0, "y": 16, "width": 8, "height": 16 },
3620
- { "x": 0, "y": 32, "width": 8, "height": 8 },
3621
- { "x": 0, "y": 40, "width": 8, "height": 8 },
3622
- { "x": 0, "y": 48, "width": 16, "height": 16 },
3623
- { "x": 0, "y": 64, "width": 8, "height": 16 }
3624
+ { "x": 0, "y": 16, "width": 8, "height": 8 },
3625
+ { "x": 8, "y": 16, "width": 8, "height": 8 },
3626
+ { "x": 0, "y": 24, "width": 8, "height": 8 },
3627
+ { "x": 8, "y": 24, "width": 8, "height": 8 },
3628
+ { "x": 0, "y": 32, "width": 16, "height": 16 },
3629
+ { "x": 0, "y": 48, "width": 16, "height": 8 }
3624
3630
  ],
3625
- "note": "concat images strike again! seriously though I hope this works..."
3631
+ "note": "should be fixed... I think... if not I have to redo the math on how these strange frames are arranged..."
3626
3632
  },
3627
3633
  "ICE_SPIKES": {
3628
3634
  "index": 142,
@@ -5613,7 +5619,7 @@
5613
5619
  "imageHeight": 16,
5614
5620
  "frameCount": 1,
5615
5621
  "frames": [
5616
- { "x": 0, "y": 0, "width": 8, "height": 8 }
5622
+ { "x": 0, "y": 0, "width": 16, "height": 16 }
5617
5623
  ]
5618
5624
  },
5619
5625
  "WHITE_FEATHER": {
@@ -510,9 +510,9 @@
510
510
  "note": "once again I have to open aseprite for this one... but I am too lazy to do so right now :p"
511
511
  },
512
512
  "ANIM_TAG_PENCIL_2": {
513
- "imageSize": "16x42",
513
+ "imageSize": "16x48",
514
514
  "imageWidth": 16,
515
- "imageHeight": 42,
515
+ "imageHeight": 48,
516
516
  "frameCount": 3,
517
517
  "frames": [
518
518
  { "x": 0, "y": 0, "width": 16, "height": 16 },
@@ -568,7 +568,7 @@
568
568
  "imageHeight": 16,
569
569
  "frameCount": 1,
570
570
  "frames": [
571
- { "x": 0, "y": 16, "width": 16, "height": 16 }
571
+ { "x": 0, "y": 0, "width": 16, "height": 16 }
572
572
  ]
573
573
  },
574
574
  "ANIM_TAG_FANGS": {
@@ -830,7 +830,7 @@
830
830
  "imageHeight": 16,
831
831
  "frameCount": 1,
832
832
  "frames": [
833
- { "x": 0, "y": 0, "width": 16, "height": 32 }
833
+ { "x": 0, "y": 0, "width": 16, "height": 16 }
834
834
  ]
835
835
  },
836
836
  "ANIM_TAG_MONSTER_DOLL": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "silphscope",
3
- "version": "1.3.2",
3
+ "version": "1.3.4",
4
4
  "description": "A firered/leafgreen ROM asset extractor for use in web applications",
5
5
  "main": "main.js",
6
6
  "exports": {
@@ -105,6 +105,7 @@ export async function renderAllMoves(rom, options = {}) {
105
105
  moves: providedMoves = moves,
106
106
  outputDir = "./out",
107
107
  renderMasterImage = true,
108
+ sortUnused = true,
108
109
  } = options;
109
110
 
110
111
  fs.mkdirSync(outputDir, { recursive: true });
@@ -115,7 +116,8 @@ export async function renderAllMoves(rom, options = {}) {
115
116
  for (const moveName of Object.keys(providedMoves)) {
116
117
  await renderMove(moveName, providedMoves, reader, rom, {
117
118
  outputDir,
118
- renderMasterImage,
119
+ renderMasterImage,
120
+ sortUnused,
119
121
  });
120
122
  console.log(`Done: ${moveName}`);
121
123
  }
@@ -130,7 +132,8 @@ export async function renderAllGraphics(rom, options = {}) { // eventually I wil
130
132
  outputMonDir = "./out/mons",
131
133
  outputIconDir = "./out/icons",
132
134
  outputTrainerDir = "./out/trainers",
133
- outputMoveDir = "./out/moves"
135
+ outputMoveDir = "./out/moves",
136
+ sortUnused = true,
134
137
  } = options;
135
138
 
136
139
  await renderAllMons(rom, {
@@ -151,6 +154,7 @@ export async function renderAllGraphics(rom, options = {}) { // eventually I wil
151
154
  await renderAllMoves(rom, {
152
155
  outputDir: outputMoveDir,
153
156
  renderMasterImage: true,
157
+ sortUnused,
154
158
  })
155
159
  }
156
160
 
@@ -39,6 +39,7 @@ export async function renderMove(moveName, moves, reader, rom, options = {}) {
39
39
  const {
40
40
  outputDir = null,
41
41
  renderMasterImage = false,
42
+ sortUnused = false,
42
43
  } = options;
43
44
  if (!rom || !(rom instanceof Uint8Array || Buffer.isBuffer(rom))) {
44
45
  throw new TypeError("renderMove(..., rom) requires a ROM Buffer/Uint8Array");
@@ -68,7 +69,8 @@ export async function renderMove(moveName, moves, reader, rom, options = {}) {
68
69
  });
69
70
 
70
71
  if (outputDir) { // I will update this later but in theory it should also work... eventually though it will need a split inside to handle full image generation :p
71
- const dir = `${outputDir}/${moveName}`;
72
+ const rootDir = (move?.unused === true)? `${outputDir}/unused` : `${outputDir}`
73
+ const dir = `${rootDir}/${moveName}`;
72
74
  if (!fs.existsSync(dir)) fs.mkdirSync(dir, { recursive: true });
73
75
  if (renderMasterImage) {
74
76
  const png = new PNG({ width, height });