silphscope 1.4.8 → 1.4.9
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.
- package/package.json +1 -1
- package/src/graphics/balls/render-ball-particle.js +2 -2
- package/src/graphics/balls/render-balls.js +2 -2
- package/src/graphics/graphics-extractor-main.js +1 -2
- package/src/graphics/icons/render-icons.js +1 -1
- package/src/graphics/mons/render-mon-foot.js +1 -1
- package/src/graphics/mons/render-mon-icon.js +2 -2
- package/src/graphics/mons/render-mons.js +1 -1
- package/src/graphics/moves/render-moves.js +3 -3
- package/src/graphics/trainers/render-trainer-back-pics.js +5 -5
- package/src/graphics/trainers/render-trainers.js +1 -1
- package/src/map-limit.js +1 -1
package/package.json
CHANGED
|
@@ -67,7 +67,7 @@ export async function renderBallParticle(ballName, balls, reader, rom, options =
|
|
|
67
67
|
|
|
68
68
|
const png = new PNG({ width, height });
|
|
69
69
|
png.data = image;
|
|
70
|
-
const pngBuffer =
|
|
70
|
+
const pngBuffer = PNG.sync.write(png);
|
|
71
71
|
|
|
72
72
|
if (outputDir) {
|
|
73
73
|
const dir = `${outputDir}/${ballName}`;
|
|
@@ -81,7 +81,7 @@ export async function renderBallParticle(ballName, balls, reader, rom, options =
|
|
|
81
81
|
|
|
82
82
|
const png = new PNG({ width: frame.width, height: frame.height });
|
|
83
83
|
png.data = frameImageData;
|
|
84
|
-
const pngFrameBuffer =
|
|
84
|
+
const pngFrameBuffer = PNG.sync.write(png);
|
|
85
85
|
|
|
86
86
|
const fileName = `${dir}/particle-${i}.png`;
|
|
87
87
|
fs.writeFileSync(fileName, pngFrameBuffer);
|
|
@@ -75,7 +75,7 @@ export async function renderBall(ballName, balls, reader, rom, options = {}) {
|
|
|
75
75
|
|
|
76
76
|
const png = new PNG({ width, height });
|
|
77
77
|
png.data = image;
|
|
78
|
-
const pngBuffer =
|
|
78
|
+
const pngBuffer = PNG.sync.write(png);
|
|
79
79
|
|
|
80
80
|
if (outputDir) {
|
|
81
81
|
const dir = `${outputDir}/${ballName}`;
|
|
@@ -89,7 +89,7 @@ export async function renderBall(ballName, balls, reader, rom, options = {}) {
|
|
|
89
89
|
|
|
90
90
|
const png = new PNG({ width: frame.width, height: frame.height });
|
|
91
91
|
png.data = frameImageData;
|
|
92
|
-
const pngFrameBuffer =
|
|
92
|
+
const pngFrameBuffer = PNG.sync.write(png);
|
|
93
93
|
|
|
94
94
|
const fileName = `${dir}/frame-${i}.png`;
|
|
95
95
|
await fs.promises.writeFile(fileName, pngFrameBuffer);
|
|
@@ -58,8 +58,7 @@ export async function renderAllMons(rom, options = {}) {
|
|
|
58
58
|
});
|
|
59
59
|
} else {
|
|
60
60
|
for (const monName of Object.keys(providedMons)) {
|
|
61
|
-
await renderMon(monName, providedMons, reader, rom, {
|
|
62
|
-
side: ["front", "back"],
|
|
61
|
+
await renderMon(monName, providedMons, reader, rom, {
|
|
63
62
|
variant: ["normal", "shiny"],
|
|
64
63
|
icon,
|
|
65
64
|
footprint,
|
|
@@ -46,7 +46,7 @@ export async function renderIcon(itemName, items, reader, rom, options = {}) {
|
|
|
46
46
|
|
|
47
47
|
const png = new PNG({ width, height });
|
|
48
48
|
png.data = image;
|
|
49
|
-
const pngBuffer =
|
|
49
|
+
const pngBuffer = PNG.sync.write(png);
|
|
50
50
|
|
|
51
51
|
if (outputDir) {
|
|
52
52
|
const dir = `${outputDir}/${itemName}`;
|
|
@@ -70,7 +70,7 @@ export async function renderMonFoot(monName, mons, reader, rom, options = {}) {
|
|
|
70
70
|
|
|
71
71
|
const png = new PNG({ width, height });
|
|
72
72
|
png.data = image;
|
|
73
|
-
const pngBuffer =
|
|
73
|
+
const pngBuffer = PNG.sync.write(png);
|
|
74
74
|
|
|
75
75
|
if (outputDir) {
|
|
76
76
|
const dir = `${outputDir}/${monName}`;
|
|
@@ -51,8 +51,8 @@ export async function renderMonIcon(monName, mons, reader, rom, options = {}) {
|
|
|
51
51
|
pngFrame1.data = frame1;
|
|
52
52
|
const pngFrame2 = new PNG({ width, height: frameHeight });
|
|
53
53
|
pngFrame2.data = frame2;
|
|
54
|
-
const buffer1 =
|
|
55
|
-
const buffer2 =
|
|
54
|
+
const buffer1 = PNG.sync.write(pngFrame1);
|
|
55
|
+
const buffer2 = PNG.sync.write(pngFrame2);
|
|
56
56
|
|
|
57
57
|
if (outputDir) {
|
|
58
58
|
const dir = `${outputDir}/${monName}`;
|
|
@@ -76,7 +76,7 @@ export async function renderMon(monName, mons, reader, rom, options = {}) {
|
|
|
76
76
|
|
|
77
77
|
const png = new PNG({ width, height });
|
|
78
78
|
png.data = image;
|
|
79
|
-
const pngBuffer =
|
|
79
|
+
const pngBuffer = PNG.sync.write(png);
|
|
80
80
|
|
|
81
81
|
if (outputDir) {
|
|
82
82
|
const dir = `${outputDir}/${monName}`;
|
|
@@ -70,7 +70,7 @@ export async function renderMove(moveName, moves, reader, rom, options = {}) {
|
|
|
70
70
|
|
|
71
71
|
const png = new PNG({ width, height });
|
|
72
72
|
png.data = image;
|
|
73
|
-
const pngBuffer =
|
|
73
|
+
const pngBuffer = PNG.sync.write(png);
|
|
74
74
|
|
|
75
75
|
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
|
|
76
76
|
const rootDir = (sortUnused && move?.unused === true)? `${outputDir}/unused` : `${outputDir}`
|
|
@@ -79,7 +79,7 @@ export async function renderMove(moveName, moves, reader, rom, options = {}) {
|
|
|
79
79
|
if (renderMasterImage) {
|
|
80
80
|
const png = new PNG({ width, height });
|
|
81
81
|
png.data = image;
|
|
82
|
-
const pngBuffer =
|
|
82
|
+
const pngBuffer = PNG.sync.write(png);
|
|
83
83
|
await fs.promises.writeFile(`${dir}/master.png`, pngBuffer);
|
|
84
84
|
}
|
|
85
85
|
for (let i = 0; i < move.frames.length; i++) {
|
|
@@ -88,7 +88,7 @@ export async function renderMove(moveName, moves, reader, rom, options = {}) {
|
|
|
88
88
|
|
|
89
89
|
const png = new PNG({ width: frame.width, height: frame.height });
|
|
90
90
|
png.data = frameImageData;
|
|
91
|
-
const pngBuffer =
|
|
91
|
+
const pngBuffer = PNG.sync.write(png);
|
|
92
92
|
|
|
93
93
|
const fileName = `${dir}/frame-${i}.png`;
|
|
94
94
|
await fs.promises.writeFile(fileName, pngBuffer);
|
|
@@ -67,10 +67,10 @@ export async function renderTrainerBackPic(trainerName, trainers, reader, rom, o
|
|
|
67
67
|
pngFrame3.data = frame3;
|
|
68
68
|
const pngFrame4 = new PNG({ width, height: frameHeight });
|
|
69
69
|
pngFrame4.data = frame4;
|
|
70
|
-
const buffer1 =
|
|
71
|
-
const buffer2 =
|
|
72
|
-
const buffer3 =
|
|
73
|
-
const buffer4 =
|
|
70
|
+
const buffer1 = PNG.sync.write(pngFrame1);
|
|
71
|
+
const buffer2 = PNG.sync.write(pngFrame2);
|
|
72
|
+
const buffer3 = PNG.sync.write(pngFrame3);
|
|
73
|
+
const buffer4 = PNG.sync.write(pngFrame4);
|
|
74
74
|
let buffer5
|
|
75
75
|
|
|
76
76
|
if (outputDir) {
|
|
@@ -83,7 +83,7 @@ export async function renderTrainerBackPic(trainerName, trainers, reader, rom, o
|
|
|
83
83
|
if (frame5) {
|
|
84
84
|
const pngFrame5 = new PNG({ width, height: frameHeight });
|
|
85
85
|
pngFrame5.data = frame5;
|
|
86
|
-
buffer5 =
|
|
86
|
+
buffer5 = PNG.sync.write(pngFrame5);
|
|
87
87
|
fs.writeFileSync(`${dir}/trainer_back_frame_5.png`, buffer5);
|
|
88
88
|
}
|
|
89
89
|
}
|
|
@@ -62,7 +62,7 @@ export async function renderTrainer(trainerName, trainers, backTrainers, reader,
|
|
|
62
62
|
|
|
63
63
|
const png = new PNG({ width, height });
|
|
64
64
|
png.data = image;
|
|
65
|
-
const pngBuffer =
|
|
65
|
+
const pngBuffer = PNG.sync.write(png);
|
|
66
66
|
|
|
67
67
|
if (outputDir) {
|
|
68
68
|
const dir = `${outputDir}/${trainerName}`;
|
package/src/map-limit.js
CHANGED
|
@@ -9,7 +9,7 @@ export async function mapLimit(items, limit, mapper) { // I hope this works... i
|
|
|
9
9
|
while (true) {
|
|
10
10
|
const current = index++;
|
|
11
11
|
|
|
12
|
-
if (
|
|
12
|
+
if (current >= items.length) return;
|
|
13
13
|
|
|
14
14
|
results[current] = await mapper(items[current], current);
|
|
15
15
|
}
|