@wwawing/loader 3.6.0 → 3.6.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/LICENSE +1 -1
- package/lib/core/extractor/checksum.js +1 -1
- package/lib/core/extractor/index.js +4 -4
- package/lib/core/index.js +1 -1
- package/package.json +10 -10
package/LICENSE
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
The MIT License (MIT)
|
|
2
2
|
|
|
3
3
|
Copyright (c) 1996-2015 NAO
|
|
4
|
-
Copyright (c) 2015-
|
|
4
|
+
Copyright (c) 2015-2022 WWA Wing Team
|
|
5
5
|
|
|
6
6
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
7
7
|
of this software and associated documentation files (the "Software"), to deal
|
|
@@ -10,7 +10,7 @@ function calculateByteSum(mapData, dataLength) {
|
|
|
10
10
|
var sum = 0;
|
|
11
11
|
if (mapData[constants_1.BytePosition.VERSION] >= 29) {
|
|
12
12
|
for (var i = 2; i < dataLength; i++) {
|
|
13
|
-
sum += util_1.signedByte(mapData[i]) * (i % 8 + 1);
|
|
13
|
+
sum += (0, util_1.signedByte)(mapData[i]) * (i % 8 + 1);
|
|
14
14
|
}
|
|
15
15
|
sum = (sum % 0x10000) & 0xffff;
|
|
16
16
|
}
|
|
@@ -9,8 +9,8 @@ var WWADataExtractor = (function () {
|
|
|
9
9
|
function WWADataExtractor(byteMapData, byteMapLength, eventEmitter) {
|
|
10
10
|
this.byteMapData = byteMapData;
|
|
11
11
|
this.eventEmitter = eventEmitter;
|
|
12
|
-
checksum_1.checkMapDataBroken(byteMapData, byteMapLength);
|
|
13
|
-
this.wwaData = infra_1.createDefaultWWAData();
|
|
12
|
+
(0, checksum_1.checkMapDataBroken)(byteMapData, byteMapLength);
|
|
13
|
+
this.wwaData = (0, infra_1.createDefaultWWAData)();
|
|
14
14
|
}
|
|
15
15
|
WWADataExtractor.prototype.extractAllData = function () {
|
|
16
16
|
var mapAttrMax, objAttrMax;
|
|
@@ -133,7 +133,7 @@ var WWADataExtractor = (function () {
|
|
|
133
133
|
WWADataExtractor.prototype._getFieldDataFromBits = function (partsType, partsMax) {
|
|
134
134
|
var x, y;
|
|
135
135
|
var fieldArray;
|
|
136
|
-
fieldArray = util_1.new2DArray(this.wwaData.mapWidth, this.wwaData.mapWidth);
|
|
136
|
+
fieldArray = (0, util_1.new2DArray)(this.wwaData.mapWidth, this.wwaData.mapWidth);
|
|
137
137
|
for (x = 0; x < this.wwaData.mapWidth; x++) {
|
|
138
138
|
for (y = 0; y < this.wwaData.mapWidth; y++) {
|
|
139
139
|
if (this.wwaData.version > 29) {
|
|
@@ -158,7 +158,7 @@ var WWADataExtractor = (function () {
|
|
|
158
158
|
WWADataExtractor.prototype._getPartsDataFromBits = function (partsType, partsMax, attrMax) {
|
|
159
159
|
var i, j;
|
|
160
160
|
var partsData;
|
|
161
|
-
partsData = util_1.new2DArray(partsMax, attrMax);
|
|
161
|
+
partsData = (0, util_1.new2DArray)(partsMax, attrMax);
|
|
162
162
|
for (i = 0; i < partsMax; i++) {
|
|
163
163
|
for (j = 0; j < attrMax; j++) {
|
|
164
164
|
if ((i * this.wwaData.mapWidth + j) % 200 === 0) {
|
package/lib/core/index.js
CHANGED
|
@@ -39,7 +39,7 @@ var WWALoader = (function () {
|
|
|
39
39
|
WWALoader.prototype.loadMapData = function (data) {
|
|
40
40
|
try {
|
|
41
41
|
var compressedByteMapData = new Uint8Array(data);
|
|
42
|
-
var _a = decompressor_1.decompressMapData(compressedByteMapData), byteMapData = _a.byteMapData, byteMapLength = _a.byteMapLength, compressedEndPosition = _a.compressedEndPosition;
|
|
42
|
+
var _a = (0, decompressor_1.decompressMapData)(compressedByteMapData), byteMapData = _a.byteMapData, byteMapLength = _a.byteMapLength, compressedEndPosition = _a.compressedEndPosition;
|
|
43
43
|
var wwaData = new extractor_1.WWADataExtractor(byteMapData, byteMapLength, this.eventEmitter).extractAllData();
|
|
44
44
|
return new text_loader_1.TextLoader(wwaData, compressedByteMapData, compressedEndPosition, this.eventEmitter).load();
|
|
45
45
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wwawing/loader",
|
|
3
|
-
"version": "3.6.
|
|
3
|
+
"version": "3.6.4",
|
|
4
4
|
"description": "a World Wide Adventure mapdata loader for client-side web applications",
|
|
5
5
|
"main": "./lib/index.js",
|
|
6
6
|
"module": "./module/index.js",
|
|
@@ -45,22 +45,22 @@
|
|
|
45
45
|
},
|
|
46
46
|
"homepage": "https://github.com/WWAWing/WWALoader#readme",
|
|
47
47
|
"dependencies": {
|
|
48
|
-
"@wwawing/event-emitter": "^3.6.
|
|
48
|
+
"@wwawing/event-emitter": "^3.6.4"
|
|
49
49
|
},
|
|
50
50
|
"devDependencies": {
|
|
51
|
-
"@wwawing/common-interface": "^3.6.
|
|
51
|
+
"@wwawing/common-interface": "^3.6.4",
|
|
52
52
|
"cross-env": "^7.0.3",
|
|
53
53
|
"html-loader": "^2.1.2",
|
|
54
|
-
"html-webpack-plugin": "^5.
|
|
55
|
-
"http-server": "^0.
|
|
54
|
+
"html-webpack-plugin": "^5.5.0",
|
|
55
|
+
"http-server": "^14.0.0",
|
|
56
56
|
"npm-run-all": "^4.1.5",
|
|
57
57
|
"shelljs": "^0.8.4",
|
|
58
58
|
"shx": "^0.3.3",
|
|
59
59
|
"ts-loader": "^4.3.0",
|
|
60
|
-
"ts-node": "^
|
|
61
|
-
"typescript": "^4.
|
|
62
|
-
"webpack": "^5.
|
|
63
|
-
"webpack-cli": "^4.
|
|
60
|
+
"ts-node": "^10.4.0",
|
|
61
|
+
"typescript": "^4.5.4",
|
|
62
|
+
"webpack": "^5.65.0",
|
|
63
|
+
"webpack-cli": "^4.9.1"
|
|
64
64
|
},
|
|
65
65
|
"publishConfig": {
|
|
66
66
|
"access": "public"
|
|
@@ -69,5 +69,5 @@
|
|
|
69
69
|
"node": ">=14",
|
|
70
70
|
"npm": ">=6"
|
|
71
71
|
},
|
|
72
|
-
"gitHead": "
|
|
72
|
+
"gitHead": "de3500ba32b4355fa4e3e0857246545ed6efd9d6"
|
|
73
73
|
}
|