@akashic/akashic-engine
Advanced tools
Comparing version 3.4.3 to 3.5.0-beta.0
import type { Asset, AssetLoadError } from "@akashic/pdi-types"; | ||
import type { AssetGenerationConfiguration } from "./AssetGenerationConfiguration"; | ||
import type { AssetLoadFailureInfo } from "./AssetLoadFailureInfo"; | ||
@@ -42,3 +43,3 @@ import type { AssetManager } from "./AssetManager"; | ||
*/ | ||
assetIds?: (string | DynamicAssetConfiguration)[]; | ||
assetIds?: (string | DynamicAssetConfiguration | AssetGenerationConfiguration)[]; | ||
/** | ||
@@ -83,3 +84,3 @@ * 読み込むアセット。 | ||
*/ | ||
_assetIds: (string | DynamicAssetConfiguration)[]; | ||
_assetIds: (string | DynamicAssetConfiguration | AssetGenerationConfiguration)[]; | ||
/** | ||
@@ -86,0 +87,0 @@ * @private |
import type { AssetConfigurationMap, AudioSystemConfigurationMap, ModuleMainScriptsMap, AssetConfigurationCommonBase, ImageAssetConfigurationBase, ScriptAssetConfigurationBase, TextAssetConfigurationBase, AudioAssetConfigurationBase, VideoAssetConfigurationBase, VectorImageAssetConfigurationBase } from "@akashic/game-configuration"; | ||
import type { Asset, AssetLoadHandler, AudioAsset, AssetLoadError, ImageAsset, ResourceFactory, ScriptAsset, TextAsset, VideoAsset, VectorImageAsset } from "@akashic/pdi-types"; | ||
import type { AssetGenerationConfiguration } from "./AssetGenerationConfiguration"; | ||
import type { AssetManagerLoadHandler } from "./AssetManagerLoadHandler"; | ||
@@ -22,2 +23,3 @@ import type { AudioSystem } from "./AudioSystem"; | ||
} | ||
declare type AssetIdOrConf = string | DynamicAssetConfiguration | AssetGenerationConfiguration; | ||
export interface AssetManagerParameterGameLike { | ||
@@ -155,3 +157,3 @@ resourceFactory: ResourceFactory; | ||
*/ | ||
requestAsset(assetIdOrConf: string | DynamicAssetConfiguration, handler: AssetManagerLoadHandler): boolean; | ||
requestAsset(assetIdOrConf: AssetIdOrConf, handler: AssetManagerLoadHandler): boolean; | ||
/** | ||
@@ -171,3 +173,3 @@ * アセットの参照カウントを減らす。 | ||
*/ | ||
requestAssets(assetIdOrConfs: (string | DynamicAssetConfiguration)[], handler: AssetManagerLoadHandler): number; | ||
requestAssets(assetIdOrConfs: AssetIdOrConf[], handler: AssetManagerLoadHandler): number; | ||
/** | ||
@@ -220,4 +222,8 @@ * 複数のアセットを解放する。 | ||
*/ | ||
_createAssetFor(idOrConf: string | DynamicAssetConfiguration): OneOfAsset; | ||
_createAssetFor(idOrConf: AssetIdOrConf): OneOfAsset; | ||
/** | ||
* @private | ||
*/ | ||
_createGeneratedAssetFor(conf: AssetGenerationConfiguration): OneOfAsset; | ||
/** | ||
* @ignore | ||
@@ -246,3 +252,3 @@ */ | ||
*/ | ||
_getAudioSystem(assetIdOrConf: string | DynamicAssetConfiguration): AudioSystem | null; | ||
_getAudioSystem(assetIdOrConf: AssetIdOrConf): AudioSystem | null; | ||
/** | ||
@@ -249,0 +255,0 @@ * @private |
@@ -214,6 +214,10 @@ "use strict"; | ||
} | ||
else { | ||
else if ("uri" in assetIdOrConf) { | ||
assetId = assetIdOrConf.id; | ||
assetIdOrConf = this._normalizeAssetBaseDeclaration(assetId, Object.create(assetIdOrConf)); | ||
} | ||
else { | ||
// TODO: ノーマライズ処理を _normalizeAssetBaseDeclaration() に統合すべき | ||
assetId = assetIdOrConf.id; | ||
} | ||
var waiting = false; | ||
@@ -429,7 +433,9 @@ var loadingInfo; | ||
} | ||
else if ("uri" in idOrConf) { | ||
id = idOrConf.id; | ||
conf = idOrConf; | ||
uri = idOrConf.uri; | ||
} | ||
else { | ||
var dynConf = idOrConf; | ||
id = dynConf.id; | ||
conf = dynConf; | ||
uri = dynConf.uri; | ||
return this._createGeneratedAssetFor(idOrConf); | ||
} | ||
@@ -470,2 +476,17 @@ var resourceFactory = this._resourceFactory; | ||
/** | ||
* @private | ||
*/ | ||
AssetManager.prototype._createGeneratedAssetFor = function (conf) { | ||
var resourceFactory = this._resourceFactory; | ||
switch (conf.type) { | ||
case "vector-image": | ||
if (!resourceFactory.createVectorImageAssetFromString) { | ||
throw ExceptionFactory_1.ExceptionFactory.createAssertionError("AssertionError#_createFromAssetGenerationFor: unsupported"); | ||
} | ||
return resourceFactory.createVectorImageAssetFromString(conf.id, conf.data); | ||
default: | ||
throw ExceptionFactory_1.ExceptionFactory.createAssertionError("AssertionError#_createFromAssetGenerationFor: unsupported asset type ".concat(conf.type, " for asset ID: ").concat(conf.id)); | ||
} | ||
}; | ||
/** | ||
* @ignore | ||
@@ -569,10 +590,13 @@ */ | ||
AssetManager.prototype._getAudioSystem = function (assetIdOrConf) { | ||
var conf; | ||
var conf = null; | ||
if (typeof assetIdOrConf === "string") { | ||
conf = this.configuration[assetIdOrConf]; | ||
} | ||
else { | ||
else if ("uri" in assetIdOrConf) { | ||
var dynConf = assetIdOrConf; | ||
conf = dynConf; | ||
} | ||
else { | ||
// NOTE: AssetGeneration では一旦非サポート。 | ||
} | ||
if (!conf) { | ||
@@ -579,0 +603,0 @@ return null; |
@@ -18,2 +18,3 @@ export * from "@akashic/game-configuration"; | ||
export * from "./AssetAccessor"; | ||
export * from "./AssetGenerationConfiguration"; | ||
export * from "./AssetHolder"; | ||
@@ -20,0 +21,0 @@ export * from "./AssetLoadFailureInfo"; |
@@ -42,2 +42,3 @@ "use strict"; | ||
__exportStar(require("./AssetAccessor"), exports); | ||
__exportStar(require("./AssetGenerationConfiguration"), exports); | ||
__exportStar(require("./AssetHolder"), exports); | ||
@@ -44,0 +45,0 @@ __exportStar(require("./AssetLoadFailureInfo"), exports); |
import type { Asset, CommonOffset, StorageLoadError } from "@akashic/pdi-types"; | ||
import { Trigger } from "@akashic/trigger"; | ||
import { AssetAccessor } from "./AssetAccessor"; | ||
import type { AssetGenerationConfiguration } from "./AssetGenerationConfiguration"; | ||
import { AssetHolder } from "./AssetHolder"; | ||
@@ -545,3 +546,3 @@ import type { AssetLoadFailureInfo } from "./AssetLoadFailureInfo"; | ||
serializeStorageValues(): StorageValueStoreSerialization; | ||
requestAssets(assetIds: (string | DynamicAssetConfiguration)[], handler: SceneRequestAssetHandler): void; | ||
requestAssets(assetIds: (string | DynamicAssetConfiguration | AssetGenerationConfiguration)[], handler: SceneRequestAssetHandler): void; | ||
/** | ||
@@ -548,0 +549,0 @@ * @private |
{ | ||
"name": "@akashic/akashic-engine", | ||
"version": "3.4.3", | ||
"version": "3.5.0-beta.0", | ||
"description": "The core library of Akashic Engine", | ||
@@ -8,10 +8,10 @@ "main": "index.js", | ||
"@akashic/game-configuration": "~1.4.0", | ||
"@akashic/pdi-types": "~1.3.0", | ||
"@akashic/pdi-types": "1.4.0-beta.0", | ||
"@akashic/playlog": "~3.1.0", | ||
"@akashic/trigger": "~1.0.0" | ||
"@akashic/trigger": "~1.0.1" | ||
}, | ||
"devDependencies": { | ||
"@akashic/eslint-config": "1.1.0", | ||
"@akashic/pdi-common-impl": "~0.2.0", | ||
"@types/jest": "^28.1.3", | ||
"@akashic/pdi-common-impl": "^1.0.0", | ||
"@types/jest": "^28.1.4", | ||
"@typescript-eslint/eslint-plugin": "^5.29.0", | ||
@@ -23,3 +23,3 @@ "eslint": "^8.18.0", | ||
"eslint-plugin-prettier": "^4.0.0", | ||
"jest": "^28.1.1", | ||
"jest": "^28.1.2", | ||
"prettier": "^2.7.1", | ||
@@ -36,3 +36,3 @@ "rimraf": "^3.0.2", | ||
"ts-jest": "^28.0.5", | ||
"typedoc": "^0.22.17", | ||
"typedoc": "^0.23.0", | ||
"typescript": "^4.7.4", | ||
@@ -67,3 +67,4 @@ "xorshift": "0.2.0" | ||
"publishConfig": { | ||
"@akashic:registry": "https://registry.npmjs.org/" | ||
"@akashic:registry": "https://registry.npmjs.org/", | ||
"tag": "next" | ||
}, | ||
@@ -70,0 +71,0 @@ "typings": "lib/index.d.ts", |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
1282364
169
26272
2
+ Added@akashic/pdi-types@1.4.0-beta.0(transitive)
Updated@akashic/trigger@~1.0.1