Skip to content

Commit

Permalink
- replace texturepacker with a custom one built on sharp
Browse files Browse the repository at this point in the history
- merge mipmap and compression for performance
  • Loading branch information
GoodBoyDigital committed Mar 27, 2024
1 parent 106f9a9 commit e5832a1
Show file tree
Hide file tree
Showing 147 changed files with 1,982 additions and 3,046 deletions.
815 changes: 787 additions & 28 deletions package-lock.json

Large diffs are not rendered by default.

Binary file removed packages/compress/.asset-pack/compress/testJpg.jpg
Binary file not shown.
Binary file removed packages/compress/.asset-pack/compress/testPng.png
Binary file not shown.
52 changes: 0 additions & 52 deletions packages/compress/README.md

This file was deleted.

47 changes: 0 additions & 47 deletions packages/compress/package.json

This file was deleted.

37 changes: 0 additions & 37 deletions packages/compress/src/compress.ts

This file was deleted.

47 changes: 0 additions & 47 deletions packages/compress/src/compressAvif.ts

This file was deleted.

47 changes: 0 additions & 47 deletions packages/compress/src/compressJpg.ts

This file was deleted.

45 changes: 0 additions & 45 deletions packages/compress/src/compressPng.ts

This file was deleted.

47 changes: 0 additions & 47 deletions packages/compress/src/compressWebp.ts

This file was deleted.

6 changes: 0 additions & 6 deletions packages/compress/src/index.ts

This file was deleted.

4 changes: 0 additions & 4 deletions packages/compress/tsconfig.json

This file was deleted.

1 change: 1 addition & 0 deletions packages/core/src/Asset.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ export class Asset
isFolder: boolean;
path = '';
state: 'deleted' | 'added' | 'modified' | 'normal' = 'added';
buffer?: Buffer | null = null;

constructor(options: AssetOptions)
{
Expand Down
6 changes: 3 additions & 3 deletions packages/core/src/AssetCache.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export class AssetCache

try
{
this._assetCacheData = readJSONSync(`.asset-pack/${this._cacheName}.json`) as AssetCacheData;
this._assetCacheData = readJSONSync(`.assetpack/${this._cacheName}.json`) as AssetCacheData;

return this._assetCacheData.assets;
}
Expand All @@ -42,9 +42,9 @@ export class AssetCache
this._serializeAsset(asset, schema.assets);

// get root dir in node
ensureDirSync(joinSafe('.asset-pack'));
ensureDirSync(joinSafe('.assetpack'));

writeJSONSync(`.asset-pack/${this._cacheName}.json`, schema, { spaces: 4 });
writeJSONSync(`.assetpack/${this._cacheName}.json`, schema, { spaces: 4 });
}

private _serializeAsset(asset: Asset, schema: AssetCacheData['assets'])
Expand Down
4 changes: 2 additions & 2 deletions packages/core/src/AssetPack.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ export class AssetPack
if (!cache)
{
removeSync(this._outputPath);
removeSync('.asset-pack');
removeSync('.assetpack');
}
else
{
Expand All @@ -82,7 +82,7 @@ export class AssetPack

// make sure the output folders exists
ensureDirSync(this._outputPath);
ensureDirSync('.asset-pack');
ensureDirSync('.assetpack');

// create the pipe system, this is used to transform the assets
// we add the finalCopyPipe to the end of the pipes array. This is a pipe
Expand Down
Loading

0 comments on commit e5832a1

Please sign in to comment.