@4bitlabs/sci0 2.4.3 → 2.4.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@4bitlabs/sci0",
|
|
3
|
-
"version": "2.4.
|
|
3
|
+
"version": "2.4.4",
|
|
4
4
|
"description": "Library for parsing and rendering assets from Sierra On-line's SCI-engine.",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
@@ -25,8 +25,9 @@
|
|
|
25
25
|
"license": "ISC",
|
|
26
26
|
"dependencies": {
|
|
27
27
|
"@4bitlabs/codecs": "^1.0.4",
|
|
28
|
-
"@4bitlabs/image": "^3.3.
|
|
28
|
+
"@4bitlabs/image": "^3.3.5",
|
|
29
29
|
"@4bitlabs/numeric-deque": "^1.1.3",
|
|
30
30
|
"@4bitlabs/readers": "^2.0.4"
|
|
31
|
-
}
|
|
31
|
+
},
|
|
32
|
+
"gitHead": "ee84739fa7dd59d9370a061e45510ddb3bd79d4f"
|
|
32
33
|
}
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { IndexedPixelData } from '@4bitlabs/image';
|
|
2
|
-
import { type Loop } from '../models/view';
|
|
3
|
-
import { type Cel } from '../models/cel';
|
|
4
|
-
export declare const loopRenderFilter: (loop: Loop) => (source: IndexedPixelData | Cel) => IndexedPixelData;
|
|
5
|
-
//# sourceMappingURL=loop-render-filter.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"loop-render-filter.d.ts","sourceRoot":"","sources":["../../src/screen/loop-render-filter.ts"],"names":[],"mappings":"AAAA,OAAO,EAA0B,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAC3E,OAAO,EAAE,KAAK,IAAI,EAAE,MAAM,gBAAgB,CAAC;AAC3C,OAAO,EAAE,KAAK,GAAG,EAAE,MAAM,eAAe,CAAC;AAEzC,eAAO,MAAM,gBAAgB,SAAU,IAAI,cAIzB,gBAAgB,GAAG,GAAG,KAAG,gBA+B1C,CAAC"}
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.loopRenderFilter = void 0;
|
|
4
|
-
const image_1 = require("@4bitlabs/image");
|
|
5
|
-
const loopRenderFilter = (loop) => {
|
|
6
|
-
const { isMirrored, bounds } = loop;
|
|
7
|
-
const { left, top, right, width: loopWidth, height: loopHeight } = bounds;
|
|
8
|
-
return (source) => {
|
|
9
|
-
if (!('dx' in source)) {
|
|
10
|
-
return source;
|
|
11
|
-
}
|
|
12
|
-
const dest = (0, image_1.createIndexedPixelData)(loopWidth, loopHeight, {
|
|
13
|
-
keyColor: source.keyColor,
|
|
14
|
-
});
|
|
15
|
-
const sStride = source.width;
|
|
16
|
-
const dStride = dest.width;
|
|
17
|
-
for (let ySource = 0; ySource < source.height; ySource++) {
|
|
18
|
-
const yDest = source.dy - top - source.height + ySource;
|
|
19
|
-
for (let xSource = 0; xSource < source.width; xSource++) {
|
|
20
|
-
const xActual = isMirrored ? source.width - xSource - 1 : xSource;
|
|
21
|
-
const edge = isMirrored
|
|
22
|
-
? +right - source.dx - (source.width & 0b1)
|
|
23
|
-
: -left + source.dx;
|
|
24
|
-
const xDest = xSource - (source.width >>> 1) + edge;
|
|
25
|
-
const destIdx = yDest * dStride + xDest;
|
|
26
|
-
const sourceIdx = ySource * sStride + xActual;
|
|
27
|
-
dest.pixels[destIdx] = source.pixels[sourceIdx];
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
return dest;
|
|
31
|
-
};
|
|
32
|
-
};
|
|
33
|
-
exports.loopRenderFilter = loopRenderFilter;
|
|
34
|
-
//# sourceMappingURL=loop-render-filter.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"loop-render-filter.js","sourceRoot":"","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