Skip to content

Commit

Permalink
Dependency update
Browse files Browse the repository at this point in the history
  • Loading branch information
JrMasterModelBuilder committed Oct 25, 2023
1 parent f2f54de commit 6170b7d
Show file tree
Hide file tree
Showing 3 changed files with 608 additions and 2,337 deletions.
48 changes: 26 additions & 22 deletions make.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ import {
ValueBoolean
} from '@shockpkg/plist-dom';
import {
BundleWindows,
BundleMacApp,
BundleLinux,
BundleSaWindows,
BundleSaMac,
BundleSaLinux,
loader
} from '@shockpkg/swf-projector';

Expand Down Expand Up @@ -42,24 +42,22 @@ async function * resources() {
}
}

async function bundle(bundle, pkg, delay = false) {
function movie(delay) {
const swfv = 8;
const [w, h] = [742, 556];
const fps = 20;
const bg = 0x000000;
const url = 'voyanuionlinegame.swf';
await bundle.withData(
await (new Manager()).with(m => m.packageInstallFile(pkg)),
loader(swfv, w, h, fps, bg, url, delay ? Math.round(fps / 2) : 0),
async b => {
for await (const [file, data] of resources()) {
await b.createResourceFile(file, data);
}
await b.copyResourceFile(
'voyanuionlinegame.swf',
'src/projector/voyanuionlinegame.swf'
);
}
return loader(swfv, w, h, fps, bg, url, delay ? Math.round(fps / 2) : 0);
}

async function bundler(b) {
for await (const [file, data] of resources()) {
await b.createResourceFile(file, data);
}
await b.copyResourceFile(
'voyanuionlinegame.swf',
'src/projector/voyanuionlinegame.swf'
);
}

Expand Down Expand Up @@ -126,7 +124,9 @@ for (const [type, pkg] of Object.entries({
task[`build:windows-${type}`] = async () => {
await remove(build);
const file = `${appFile}.exe`;
const b = new BundleWindows(`${build}/${file}`);
const b = new BundleSaWindows(`${build}/${file}`);
b.projector.player = await new Manager().file(pkg);
b.projector.movieData = movie(false);
b.projector.versionStrings = {
FileVersion: version,
ProductVersion: versionShort,
Expand All @@ -143,7 +143,7 @@ for (const [type, pkg] of Object.entries({
b.projector.patchWindowTitle = appName;
b.projector.patchOutOfDateDisable = true;
b.projector.removeCodeSignature = true;
await bundle(b, pkg);
await b.write(bundler);
await docs('docs', build);
};
task[`dist:windows-${type}:zip`] = async () => {
Expand Down Expand Up @@ -180,7 +180,9 @@ for (const [type, pkg] of Object.entries({
task[`build:mac-${type}`] = async () => {
await remove(build);
const pkgInfo = 'APPL????';
const b = new BundleMacApp(`${build}/${appFile}.app`);
const b = new BundleSaMac(`${build}/${appFile}.app`);
b.projector.player = await new Manager().file(pkg);
b.projector.movieData = movie(false);
b.projector.binaryName = appFile;
b.projector.pkgInfoData = pkgInfo;
b.projector.infoPlistData = (new Plist(new ValueDict(new Map([
Expand Down Expand Up @@ -212,7 +214,7 @@ for (const [type, pkg] of Object.entries({
b.projector.patchWindowTitle = appName;
b.projector.removeInfoPlistStrings = true;
b.projector.removeCodeSignature = true;
await bundle(b, pkg);
await b.write(bundler);
await docs('docs', build);
};
task[`dist:mac-${type}:tgz`] = async () => {
Expand Down Expand Up @@ -244,11 +246,13 @@ for (const [type, pkg] of Object.entries({
const build = `build/linux-${type}`;
task[`build:linux-${type}`] = async () => {
await remove(build);
const b = new BundleLinux(`${build}/${appFile}`);
const b = new BundleSaLinux(`${build}/${appFile}`);
b.projector.player = await new Manager().file(pkg);
b.projector.movieData = movie(true);
b.projector.patchProjectorOffset = /x86_64/.test(type);
b.projector.patchProjectorPath = true;
b.projector.patchWindowTitle = appName;
await bundle(b, pkg, true);
await b.write(bundler);
await docs('docs', build);
};
task[`dist:linux-${type}:tgz`] = async () => {
Expand Down
Loading

0 comments on commit 6170b7d

Please sign in to comment.