Skip to content

Commit

Permalink
[ts][pixi-v7][pixi-v8] Atlas url query params are copied to png url. C…
Browse files Browse the repository at this point in the history
…loses #2732.
  • Loading branch information
davidetan committed Jan 24, 2025
1 parent 744cefe commit 9f3431e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions spine-ts/spine-pixi-v7/src/assets/atlasLoader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
import { TextureAtlas } from "@esotericsoftware/spine-core";
import { SpineTexture } from "../SpineTexture.js";
import type { AssetExtension, Loader, UnresolvedAsset } from "@pixi/assets";
import { Assets } from "@pixi/assets";
import { Assets, copySearchParams } from "@pixi/assets";
import { LoaderParserPriority, checkExtension } from "@pixi/assets";
import type { Texture } from "@pixi/core";
import { ALPHA_MODES, ExtensionType, settings, utils, BaseTexture, extensions } from "@pixi/core";
Expand Down Expand Up @@ -121,7 +121,7 @@ const spineTextureAtlasLoader: AssetExtension<RawAtlas | TextureAtlas, ISpineAtl
page.setTexture(SpineTexture.from(providedPage));
} else {
const url: string = providedPage ?? utils.path.normalize([...basePath.split(utils.path.sep), pageName].join(utils.path.sep));
const assetsToLoadIn = { src: url, data: { ...metadata.imageMetadata, ...{ alphaMode: page.pma ? ALPHA_MODES.PMA : ALPHA_MODES.UNPACK } } };
const assetsToLoadIn = { src: copySearchParams(url, options.src as string), data: { ...metadata.imageMetadata, ...{ alphaMode: page.pma ? ALPHA_MODES.PMA : ALPHA_MODES.UNPACK } } };
const pixiPromise = loader.load<Texture>(assetsToLoadIn)
.then((texture) => {
page.setTexture(SpineTexture.from(texture.baseTexture));
Expand Down
3 changes: 2 additions & 1 deletion spine-ts/spine-pixi-v8/src/assets/atlasLoader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@

import {
checkExtension,
copySearchParams,
DOMAdapter,
extensions,
ExtensionType,
Expand Down Expand Up @@ -125,7 +126,7 @@ const spineTextureAtlasLoader: AssetExtension<RawAtlas | TextureAtlas, ISpineAtl
const url: string = providedPage ?? path.normalize([...basePath.split(path.sep), pageName].join(path.sep));

const assetsToLoadIn = {
src: url,
src: copySearchParams(url, options.src as string),
data: {
...metadata.imageMetadata,
alphaMode: page.pma ? 'premultiplied-alpha' : 'premultiply-alpha-on-upload'
Expand Down

0 comments on commit 9f3431e

Please sign in to comment.