Skip to content

Commit bcdaec9

Browse files
committed
Add option to increase max SVG texture dimension
Requires scratch-render changes TurboWarp/scratch-render@0cac40f
1 parent ce4d934 commit bcdaec9

File tree

3 files changed

+17
-3
lines changed

3 files changed

+17
-3
lines changed

src/locales/en.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -506,6 +506,9 @@
506506
"startFullscreen": {
507507
"string": "Start in fullscreen"
508508
},
509+
"maxTextureDimension": {
510+
"string": "Increase max vector costume resolution to make large costumes look better. May increase memory use and cause crashes."
511+
},
509512
"package": {
510513
"string": "Package",
511514
"context": "Button to package the project"

src/p4/PackagerOptions.svelte

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,8 @@
102102
$options.custom.css !== '' ||
103103
$options.custom.js !== '' ||
104104
$options.projectId !== defaultOptions.projectId ||
105-
$options.packagedRuntime !== defaultOptions.packagedRuntime
105+
$options.packagedRuntime !== defaultOptions.packagedRuntime ||
106+
$options.maxTextureDimension !== defaultOptions.maxTextureDimension
106107
);
107108
108109
const automaticallyCenterCursor = () => {
@@ -710,7 +711,8 @@
710711
'extensions',
711712
'bakeExtensions',
712713
'custom',
713-
'projectId'
714+
'projectId',
715+
'maxTextureDimension'
714716
]);
715717
}}
716718
>
@@ -768,6 +770,13 @@
768770
<input type="checkbox" bind:checked={$options.packagedRuntime} />
769771
{$_('options.packagedRuntime')}
770772
</label>
773+
774+
<label class="option">
775+
<input type="checkbox" checked={$options.maxTextureDimension !== defaultOptions.maxTextureDimension} on:change={(e) => {
776+
$options.maxTextureDimension = defaultOptions.maxTextureDimension * (e.target.checked ? 2 : 1);
777+
}} />
778+
{$_('options.maxTextureDimension')}
779+
</label>
771780
</details>
772781
</div>
773782
</Section>

src/packager/packager.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1394,6 +1394,7 @@ cd "$(dirname "$0")"
13941394
enabled: ${this.options.compiler.enabled},
13951395
warpTimer: ${this.options.compiler.warpTimer}
13961396
});
1397+
if (vm.renderer.setMaxTextureDimension) vm.renderer.setMaxTextureDimension(${this.options.maxTextureDimension});
13971398
13981399
if (typeof ScaffoldingAddons !== 'undefined') {
13991400
ScaffoldingAddons.run(scaffolding, ${JSON.stringify(this.getAddonOptions())});
@@ -1625,7 +1626,8 @@ Packager.DEFAULT_OPTIONS = () => ({
16251626
}
16261627
},
16271628
extensions: [],
1628-
bakeExtensions: true
1629+
bakeExtensions: true,
1630+
maxTextureDimension: 2048
16291631
});
16301632

16311633
export default Packager;

0 commit comments

Comments
 (0)