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 7035051 commit cf05a81
Show file tree
Hide file tree
Showing 3 changed files with 617 additions and 2,346 deletions.
66 changes: 35 additions & 31 deletions make.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ import {
ValueBoolean
} from '@shockpkg/plist-dom';
import {
BundleWindows,
BundleMacApp,
BundleLinux,
BundleSaWindows,
BundleSaMac,
BundleSaLinux,
loader
} from '@shockpkg/swf-projector';

Expand Down Expand Up @@ -60,34 +60,32 @@ async function walkthroughs(dir) {
}
}

async function bundle(bundle, pkg, delay = false) {
function movie(delay) {
const swfv = 6;
const [w, h] = [480, 360];
const fps = 12;
const bg = 0x000000;
const url = 'matanuionlinegame.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 => {
let playerData = null;
for await (const [file, data] of resources()) {
if (file === 'player.swf') {
playerData = data;
}
await b.createResourceFile(file, data);
}
setFps(playerData, 30);
await b.createResourceFile('player-30fps.swf', playerData);
await b.copyResourceFile(
'autorun.swf',
'original/lego-re-release/projectors/win/autorun.swf'
);
await b.copyResourceFile(
'matanuionlinegame.swf',
'src/projector/matanuionlinegame.swf'
);
return loader(swfv, w, h, fps, bg, url, delay ? Math.round(fps / 2) : 0);
}

async function bundler(b) {
let playerData = null;
for await (const [file, data] of resources()) {
if (file === 'player.swf') {
playerData = data;
}
await b.createResourceFile(file, data);
}
setFps(playerData, 30);
await b.createResourceFile('player-30fps.swf', playerData);
await b.copyResourceFile(
'autorun.swf',
'original/lego-re-release/projectors/win/autorun.swf'
);
await b.copyResourceFile(
'matanuionlinegame.swf',
'src/projector/matanuionlinegame.swf'
);
}

Expand Down Expand Up @@ -153,7 +151,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 @@ -170,7 +170,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 walkthroughs(`${build}/Walkthrough`);
await docs('docs', build);
};
Expand Down Expand Up @@ -216,7 +216,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 @@ -248,7 +250,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 walkthroughs(`${build}/Walkthrough`);
await docs('docs', build);
};
Expand Down Expand Up @@ -282,11 +284,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 walkthroughs(`${build}/Walkthrough`);
await docs('docs', build);
};
Expand Down
Loading

0 comments on commit cf05a81

Please sign in to comment.