From 362a98c9e69323ff946e50aff6bff3fc09b22d89 Mon Sep 17 00:00:00 2001 From: Shukant Pal Date: Sun, 30 Aug 2020 16:44:27 -0400 Subject: [PATCH 1/2] Upgrade to @pixi-build-tools/rollup-configurator@1.0.3 This upgrade fixes crashes when the UMD build is used in a non-browser environment. --- dist/pixi-tilemap.umd.js | 4 ++-- dist/pixi-tilemap.umd.js.map | 2 +- package.json | 2 +- yarn.lock | 30 ++++++++++++++++++++---------- 4 files changed, 24 insertions(+), 14 deletions(-) diff --git a/dist/pixi-tilemap.umd.js b/dist/pixi-tilemap.umd.js index 98a253b8..72ba5e0b 100644 --- a/dist/pixi-tilemap.umd.js +++ b/dist/pixi-tilemap.umd.js @@ -2,7 +2,7 @@ /*! * pixi-tilemap - v2.1.2 - * Compiled Sun, 30 Aug 2020 00:12:54 UTC + * Compiled Sun, 30 Aug 2020 20:43:34 UTC * * pixi-tilemap is licensed under the MIT License. * http://www.opensource.org/licenses/mit-license @@ -968,5 +968,5 @@ void main(void){ Object.defineProperty(exports, '__esModule', { value: true }); }))); -Object.assign(this.PIXI.tilemap, pixi_tilemap); +if (typeof pixi_tilemap !== 'undefined') { Object.assign(this.PIXI.tilemap, pixi_tilemap); } //# sourceMappingURL=pixi-tilemap.umd.js.map diff --git a/dist/pixi-tilemap.umd.js.map b/dist/pixi-tilemap.umd.js.map index b1251e9f..256d829f 100644 --- a/dist/pixi-tilemap.umd.js.map +++ b/dist/pixi-tilemap.umd.js.map @@ -1 +1 @@ -{"version":3,"file":"pixi-tilemap.umd.js","sources":["../src/CanvasTileRenderer.ts","../src/Constant.ts","../src/RectTileLayer.ts","../src/CompositeRectTileLayer.ts","../src/GraphicsLayer.ts","../src/MultiTextureResource.ts","../src/shaderGenerator.ts","../src/RectTileShader.ts","../src/TileRenderer.ts","../src/ZLayer.ts","../src/exporter.ts","../src/index.ts"],"sourcesContent":["/// \r\n\r\nimport { Renderer } from '@pixi/core';\r\n\r\nexport class CanvasTileRenderer {\r\n renderer: Renderer;\r\n tileAnim = [0, 0];\r\n dontUseTransform = false;\r\n\r\n constructor(renderer: Renderer) {\r\n this.renderer = renderer;\r\n this.tileAnim = [0, 0];\r\n }\r\n}\r\n\r\nconst cr = (PIXI as any).CanvasRenderer;\r\n\r\nif (cr) {\r\n cr.registerPlugin('tilemap', CanvasTileRenderer);\r\n}\r\n","/// \r\n\r\nimport { SCALE_MODES } from '@pixi/constants';\r\n\r\nexport const Constant = {\r\n maxTextures: 16,\r\n bufferSize: 2048,\r\n boundSize: 1024,\r\n boundCountPerBuffer: 1,\r\n use32bitIndex: false,\r\n SCALE_MODE: SCALE_MODES.LINEAR,\r\n DO_CLEAR: true\r\n};","/// \r\n\r\nimport { Container, Bounds } from '@pixi/display';\r\nimport { Constant } from './Constant';\r\nimport { DRAW_MODES } from '@pixi/constants';\r\nimport { Texture, Renderer } from '@pixi/core';\r\nimport { TileRenderer } from './TileRenderer';\r\nimport { Matrix, Rectangle, groupD8 } from '@pixi/math';\r\n\r\nimport type { RectTileGeom } from './RectTileShader';\r\n\r\nexport const POINT_STRUCT_SIZE = 12;\r\n\r\nexport class RectTileLayer extends Container {\r\n constructor(zIndex: number, texture: Texture | Array) {\r\n super();\r\n this.initialize(zIndex, texture);\r\n }\r\n\r\n zIndex = 0;\r\n modificationMarker = 0;\r\n _$_localBounds = new Bounds();\r\n shadowColor = new Float32Array([0.0, 0.0, 0.0, 0.5]);\r\n _globalMat: Matrix = null;\r\n\r\n pointsBuf: Array = [];\r\n hasAnim = false;\r\n textures: Array;\r\n\r\n offsetX = 0;\r\n offsetY = 0;\r\n compositeParent = false;\r\n\r\n initialize(zIndex: number, textures: Texture | Array) {\r\n if (!textures) {\r\n textures = [];\r\n } else if (!(textures instanceof Array) && (textures as Texture).baseTexture) {\r\n textures = [textures as Texture];\r\n }\r\n this.textures = textures as Array;\r\n this.zIndex = zIndex;\r\n // this.visible = false;\r\n }\r\n\r\n clear() {\r\n this.pointsBuf.length = 0;\r\n this.modificationMarker = 0;\r\n this._$_localBounds.clear();\r\n this.hasAnim = false;\r\n }\r\n\r\n addFrame(texture_: Texture | String | number, x: number, y: number, animX: number, animY: number) {\r\n let texture: Texture;\r\n let textureIndex = 0;\r\n\r\n if (typeof texture_ === \"number\") {\r\n textureIndex = texture_;\r\n texture = this.textures[textureIndex];\r\n } else {\r\n if (typeof texture_ === \"string\") {\r\n texture = Texture.from(texture_);\r\n } else {\r\n texture = texture_ as Texture;\r\n }\r\n\r\n let found = false;\r\n let textureList = this.textures;\r\n for (let i = 0; i < textureList.length; i++) {\r\n if (textureList[i].baseTexture === texture.baseTexture) {\r\n textureIndex = i;\r\n found = true;\r\n break;\r\n }\r\n }\r\n\r\n if (!found) {\r\n // textureIndex = this.textures.length;\r\n // this.textures.push(texture);\r\n return false;\r\n }\r\n }\r\n\r\n this.addRect(textureIndex, texture.frame.x, texture.frame.y, x, y, texture.orig.width, texture.orig.height, animX, animY, texture.rotate);\r\n return true;\r\n }\r\n\r\n addRect(textureIndex: number, u: number, v: number, x: number, y: number, tileWidth: number, tileHeight: number,\r\n animX: number = 0, animY: number = 0, rotate: number = 0, animCountX: number = 1024, animCountY: number = 1024): this {\r\n let pb = this.pointsBuf;\r\n this.hasAnim = this.hasAnim || animX > 0 || animY > 0;\r\n pb.push(u);\r\n pb.push(v);\r\n pb.push(x);\r\n pb.push(y);\r\n pb.push(tileWidth);\r\n pb.push(tileHeight);\r\n pb.push(rotate);\r\n pb.push(animX | 0);\r\n pb.push(animY | 0);\r\n pb.push(textureIndex);\r\n pb.push(animCountX);\r\n pb.push(animCountY);\r\n\r\n this._$_localBounds.addFramePad(x, y, x+tileWidth, y+tileHeight, 0, 0);\r\n\r\n return this;\r\n }\r\n\r\n tileRotate(rotate: number) {\r\n const pb = this.pointsBuf;\r\n pb[pb.length - 3] = rotate;\r\n }\r\n\r\n tileAnimX(offset: number, count: number) {\r\n const pb = this.pointsBuf;\r\n\r\n pb[pb.length - 5] = offset;\r\n pb[pb.length - 2] = count;\r\n }\r\n\r\n tileAnimY(offset: number, count: number) {\r\n const pb = this.pointsBuf;\r\n\r\n pb[pb.length - 4] = offset;\r\n pb[pb.length - 1] = count;\r\n }\r\n\r\n renderCanvas(renderer: any) {\r\n let plugin = renderer.plugins.tilemap;\r\n if (!plugin.dontUseTransform) {\r\n let wt = this.worldTransform;\r\n renderer.context.setTransform(\r\n wt.a,\r\n wt.b,\r\n wt.c,\r\n wt.d,\r\n wt.tx * renderer.resolution,\r\n wt.ty * renderer.resolution\r\n );\r\n }\r\n this.renderCanvasCore(renderer);\r\n }\r\n\r\n renderCanvasCore(renderer: any) {\r\n if (this.textures.length === 0) return;\r\n let points = this.pointsBuf;\r\n renderer.context.fillStyle = '#000000';\r\n for (let i = 0, n = points.length; i < n; i += POINT_STRUCT_SIZE) {\r\n let x1 = points[i], y1 = points[i + 1];\r\n let x2 = points[i + 2], y2 = points[i + 3];\r\n let w = points[i + 4];\r\n let h = points[i + 5];\r\n var rotate = points[i + 6];\r\n x1 += points[i + 7] * renderer.plugins.tilemap.tileAnim[0];\r\n y1 += points[i + 8] * renderer.plugins.tilemap.tileAnim[1];\r\n let textureIndex = points[i + 9];\r\n // canvas does not work with rotate yet\r\n if (textureIndex >= 0) {\r\n renderer.context.drawImage((this.textures[textureIndex].baseTexture as any).getDrawableSource(), x1, y1, w, h, x2, y2, w, h);\r\n } else {\r\n renderer.context.globalAlpha = 0.5;\r\n renderer.context.fillRect(x2, y2, w, h);\r\n renderer.context.globalAlpha = 1;\r\n }\r\n }\r\n }\r\n\r\n vbId = 0;\r\n vb: RectTileGeom = null;\r\n vbBuffer: ArrayBuffer = null;\r\n vbArray: Float32Array = null;\r\n vbInts: Uint32Array = null;\r\n\r\n destroyVb() {\r\n if (this.vb) {\r\n this.vb.destroy();\r\n this.vb = null;\r\n }\r\n }\r\n\r\n render(renderer: Renderer) {\r\n let plugin = (renderer.plugins as any)['tilemap'];\r\n let shader = plugin.getShader();\r\n renderer.batch.setObjectRenderer(plugin);\r\n this._globalMat = shader.uniforms.projTransMatrix;\r\n renderer.globalUniforms.uniforms.projectionMatrix.copyTo(this._globalMat).append(this.worldTransform);\r\n shader.uniforms.shadowColor = this.shadowColor;\r\n shader.uniforms.animationFrame = plugin.tileAnim;\r\n this.renderWebGLCore(renderer, plugin);\r\n }\r\n\r\n renderWebGLCore(renderer: Renderer, plugin: TileRenderer) {\r\n let points = this.pointsBuf;\r\n if (points.length === 0) return;\r\n let rectsCount = points.length / POINT_STRUCT_SIZE;\r\n\r\n let shader = plugin.getShader();\r\n let textures = this.textures;\r\n if (textures.length === 0) return;\r\n\r\n plugin.bindTextures(renderer, shader, textures);\r\n renderer.shader.bind(shader, false);\r\n\r\n //lost context! recover!\r\n let vb = this.vb;\r\n if (!vb) {\r\n vb = plugin.createVb();\r\n this.vb = vb;\r\n this.vbId = (vb as any).id;\r\n this.vbBuffer = null;\r\n this.modificationMarker = 0;\r\n }\r\n\r\n plugin.checkIndexBuffer(rectsCount, vb);\r\n const boundCountPerBuffer = Constant.boundCountPerBuffer;\r\n\r\n let vertexBuf = vb.getBuffer('aVertexPosition');\r\n //if layer was changed, re-upload vertices\r\n let vertices = rectsCount * vb.vertPerQuad;\r\n if (vertices === 0) return;\r\n if (this.modificationMarker !== vertices) {\r\n this.modificationMarker = vertices;\r\n let vs = vb.stride * vertices;\r\n if (!this.vbBuffer || this.vbBuffer.byteLength < vs) {\r\n //!@#$ happens, need resize\r\n let bk = vb.stride;\r\n while (bk < vs) {\r\n bk *= 2;\r\n }\r\n this.vbBuffer = new ArrayBuffer(bk);\r\n this.vbArray = new Float32Array(this.vbBuffer);\r\n this.vbInts = new Uint32Array(this.vbBuffer);\r\n vertexBuf.update(this.vbBuffer);\r\n }\r\n\r\n let arr = this.vbArray, ints = this.vbInts;\r\n //upload vertices!\r\n let sz = 0;\r\n //let tint = 0xffffffff;\r\n let textureId: number = 0;\r\n let shiftU: number = this.offsetX;\r\n let shiftV: number = this.offsetY;\r\n\r\n //let tint = 0xffffffff;\r\n let tint = -1;\r\n for (let i = 0; i < points.length; i += POINT_STRUCT_SIZE) {\r\n let eps = 0.5;\r\n if (this.compositeParent) {\r\n if (boundCountPerBuffer > 1) {\r\n //TODO: what if its more than 4?\r\n textureId = (points[i + 9] >> 2);\r\n shiftU = this.offsetX * (points[i + 9] & 1);\r\n shiftV = this.offsetY * ((points[i + 9] >> 1) & 1);\r\n } else {\r\n textureId = points[i + 9];\r\n shiftU = 0;\r\n shiftV = 0;\r\n }\r\n }\r\n let x = points[i + 2], y = points[i + 3];\r\n let w = points[i + 4], h = points[i + 5];\r\n let u = points[i] + shiftU, v = points[i + 1] + shiftV;\r\n let rotate = points[i + 6];\r\n\r\n const animX = points[i + 7], animY = points[i + 8];\r\n const animWidth = points[i + 10] || 1024, animHeight = points[i + 11] || 1024;\r\n const animXEncoded = animX + (animWidth * 2048);\r\n const animYEncoded = animY + (animHeight * 2048);\r\n\r\n let u0: number, v0: number, u1: number, v1: number, u2: number, v2: number, u3: number, v3: number;\r\n if (rotate === 0) {\r\n u0 = u;\r\n v0 = v;\r\n u1 = u + w;\r\n v1 = v;\r\n u2 = u + w;\r\n v2 = v + h;\r\n u3 = u;\r\n v3 = v + h;\r\n } else {\r\n let w2 = w / 2;\r\n let h2 = h / 2;\r\n if (rotate % 4 !== 0) {\r\n w2 = h / 2;\r\n h2 = w / 2;\r\n }\r\n const cX = u + w2;\r\n const cY = v + h2;\r\n\r\n rotate = groupD8.add(rotate, groupD8.NW);\r\n u0 = cX + (w2 * groupD8.uX(rotate));\r\n v0 = cY + (h2 * groupD8.uY(rotate));\r\n\r\n rotate = groupD8.add(rotate, 2); // rotate 90 degrees clockwise\r\n u1 = cX + (w2 * groupD8.uX(rotate));\r\n v1 = cY + (h2 * groupD8.uY(rotate));\r\n\r\n rotate = groupD8.add(rotate, 2);\r\n u2 = cX + (w2 * groupD8.uX(rotate));\r\n v2 = cY + (h2 * groupD8.uY(rotate));\r\n\r\n rotate = groupD8.add(rotate, 2);\r\n u3 = cX + (w2 * groupD8.uX(rotate));\r\n v3 = cY + (h2 * groupD8.uY(rotate));\r\n }\r\n\r\n arr[sz++] = x;\r\n arr[sz++] = y;\r\n arr[sz++] = u0;\r\n arr[sz++] = v0;\r\n arr[sz++] = u + eps;\r\n arr[sz++] = v + eps;\r\n arr[sz++] = u + w - eps;\r\n arr[sz++] = v + h - eps;\r\n arr[sz++] = animXEncoded;\r\n arr[sz++] = animYEncoded;\r\n arr[sz++] = textureId;\r\n arr[sz++] = x + w;\r\n arr[sz++] = y;\r\n arr[sz++] = u1;\r\n arr[sz++] = v1;\r\n arr[sz++] = u + eps;\r\n arr[sz++] = v + eps;\r\n arr[sz++] = u + w - eps;\r\n arr[sz++] = v + h - eps;\r\n arr[sz++] = animXEncoded;\r\n arr[sz++] = animYEncoded;\r\n arr[sz++] = textureId;\r\n arr[sz++] = x + w;\r\n arr[sz++] = y + h;\r\n arr[sz++] = u2;\r\n arr[sz++] = v2;\r\n arr[sz++] = u + eps;\r\n arr[sz++] = v + eps;\r\n arr[sz++] = u + w - eps;\r\n arr[sz++] = v + h - eps;\r\n arr[sz++] = animXEncoded;\r\n arr[sz++] = animYEncoded;\r\n arr[sz++] = textureId;\r\n arr[sz++] = x;\r\n arr[sz++] = y + h;\r\n arr[sz++] = u3;\r\n arr[sz++] = v3;\r\n arr[sz++] = u + eps;\r\n arr[sz++] = v + eps;\r\n arr[sz++] = u + w - eps;\r\n arr[sz++] = v + h - eps;\r\n arr[sz++] = animXEncoded;\r\n arr[sz++] = animYEncoded;\r\n arr[sz++] = textureId;\r\n }\r\n\r\n vertexBuf.update(arr);\r\n }\r\n\r\n (renderer.geometry as any).bind(vb, shader);\r\n renderer.geometry.draw(DRAW_MODES.TRIANGLES, rectsCount * 6, 0);\r\n }\r\n\r\n isModified(anim: boolean) {\r\n if (this.modificationMarker !== this.pointsBuf.length ||\r\n anim && this.hasAnim) {\r\n return true;\r\n }\r\n return false;\r\n }\r\n\r\n clearModify() {\r\n this.modificationMarker = this.pointsBuf.length;\r\n }\r\n\r\n protected _calculateBounds(): void\r\n {\r\n const { minX, minY, maxX, maxY } = this._$_localBounds;\r\n\r\n this._bounds.addFrame(this.transform, minX, minY, maxX, maxY);\r\n }\r\n\r\n public getLocalBounds(rect?: Rectangle): Rectangle\r\n {\r\n // we can do a fast local bounds if the sprite has no children!\r\n if (this.children.length === 0)\r\n {\r\n return this._$_localBounds.getRectangle(rect);\r\n }\r\n\r\n return super.getLocalBounds.call(this, rect);\r\n }\r\n\r\n destroy(options?: any) {\r\n super.destroy(options);\r\n this.destroyVb();\r\n }\r\n}\r\n","/// \r\n\r\nimport { Container } from '@pixi/display';\r\nimport { Texture, Renderer } from '@pixi/core';\r\nimport { Matrix } from '@pixi/math';\r\nimport { Constant } from './Constant';\r\nimport { RectTileLayer } from './RectTileLayer';\r\n\r\nexport class CompositeRectTileLayer extends Container {\r\n constructor(zIndex?: number, bitmaps?: Array, texPerChild?: number) {\r\n super();\r\n this.initialize.apply(this, arguments);\r\n }\r\n\r\n z: number;\r\n zIndex: number;\r\n modificationMarker = 0;\r\n shadowColor = new Float32Array([0.0, 0.0, 0.0, 0.5]);\r\n _globalMat: Matrix = null;\r\n _lastLayer: RectTileLayer = null;\r\n\r\n texPerChild: number;\r\n\r\n initialize(zIndex?: number, bitmaps?: Array, texPerChild?: number) {\r\n if (texPerChild as any === true) {\r\n //old format, ignore it!\r\n texPerChild = 0;\r\n }\r\n this.z = this.zIndex = zIndex;\r\n this.texPerChild = texPerChild || Constant.boundCountPerBuffer * Constant.maxTextures;\r\n if (bitmaps) {\r\n this.setBitmaps(bitmaps);\r\n }\r\n }\r\n\r\n setBitmaps(bitmaps: Array) {\r\n for (let i=0;i 5.2.1, it does not exist there.`);\r\n }\r\n }\r\n let texPerChild = this.texPerChild;\r\n let len1 = this.children.length;\r\n let len2 = Math.ceil(bitmaps.length / texPerChild);\r\n let i: number;\r\n for (i = 0; i < len1; i++) {\r\n (this.children[i] as RectTileLayer).textures = bitmaps.slice(i * texPerChild, (i + 1) * texPerChild);\r\n }\r\n for (i = len1; i < len2; i++) {\r\n let layer = new RectTileLayer(this.zIndex, bitmaps.slice(i * texPerChild, (i + 1) * texPerChild));\r\n layer.compositeParent = true;\r\n layer.offsetX = Constant.boundSize;\r\n layer.offsetY = Constant.boundSize;\r\n this.addChild(layer);\r\n }\r\n }\r\n\r\n clear() {\r\n for (let i = 0; i < this.children.length; i++) {\r\n (this.children[i] as RectTileLayer).clear();\r\n }\r\n this.modificationMarker = 0;\r\n }\r\n\r\n addRect(textureIndex: number, u: number, v: number, x: number, y: number, tileWidth: number, tileHeight: number, animX?: number, animY?: number, rotate?: number, animWidth?: number, animHeight?: number): this {\r\n const childIndex: number = textureIndex / this.texPerChild >> 0;\r\n const textureId: number = textureIndex % this.texPerChild;\r\n\r\n if (this.children[childIndex] && (this.children[childIndex] as RectTileLayer).textures) {\r\n this._lastLayer = (this.children[childIndex] as RectTileLayer);\r\n this._lastLayer.addRect(textureId, u, v, x, y, tileWidth, tileHeight, animX, animY, rotate, animWidth, animHeight);\r\n } else {\r\n this._lastLayer = null;\r\n }\r\n\r\n return this;\r\n }\r\n\r\n tileRotate(rotate: number): this {\r\n if (this._lastLayer)\r\n {\r\n this._lastLayer.tileRotate(rotate);\r\n }\r\n return this;\r\n }\r\n\r\n tileAnimX(offset: number, count: number): this {\r\n if (this._lastLayer)\r\n {\r\n this._lastLayer.tileAnimX(offset, count);\r\n }\r\n return this;\r\n }\r\n\r\n tileAnimY(offset: number, count: number): this {\r\n if (this._lastLayer)\r\n {\r\n this._lastLayer.tileAnimY(offset, count);\r\n }\r\n return this;\r\n }\r\n\r\n addFrame(texture_: Texture | String | number, x: number, y: number, animX?: number, animY?: number, animWidth?: number, animHeight?: number): this {\r\n let texture: Texture;\r\n let layer: RectTileLayer = null;\r\n let ind: number = 0;\r\n let children = this.children;\r\n\r\n this._lastLayer = null;\r\n if (typeof texture_ === \"number\") {\r\n let childIndex = texture_ / this.texPerChild >> 0;\r\n layer = children[childIndex] as RectTileLayer;\r\n\r\n if (!layer) {\r\n layer = children[0] as RectTileLayer;\r\n if (!layer) {\r\n return this;\r\n }\r\n ind = 0;\r\n } else {\r\n ind = texture_ % this.texPerChild;\r\n }\r\n\r\n texture = layer.textures[ind];\r\n } else {\r\n if (typeof texture_ === \"string\") {\r\n texture = Texture.from(texture_);\r\n } else {\r\n texture = texture_ as Texture;\r\n }\r\n\r\n for (let i = 0; i < children.length; i++) {\r\n let child = children[i] as RectTileLayer;\r\n let tex = child.textures;\r\n for (let j = 0; j < tex.length; j++) {\r\n if (tex[j].baseTexture === texture.baseTexture) {\r\n layer = child;\r\n ind = j;\r\n break;\r\n }\r\n }\r\n if (layer) {\r\n break;\r\n }\r\n }\r\n\r\n if (!layer) {\r\n for (let i = 0; i < children.length; i++) {\r\n let child = children[i] as RectTileLayer;\r\n if (child.textures.length < this.texPerChild) {\r\n layer = child;\r\n ind = child.textures.length;\r\n child.textures.push(texture);\r\n break;\r\n }\r\n }\r\n if (!layer) {\r\n layer = new RectTileLayer(this.zIndex, texture);\r\n layer.compositeParent = true;\r\n layer.offsetX = Constant.boundSize;\r\n layer.offsetY = Constant.boundSize;\r\n this.addChild(layer);\r\n ind = 0;\r\n }\r\n }\r\n }\r\n\r\n this._lastLayer = layer;\r\n layer.addRect(ind, texture.frame.x, texture.frame.y, x, y, texture.orig.width, texture.orig.height, animX, animY, texture.rotate, animWidth, animHeight);\r\n return this;\r\n }\r\n\r\n renderCanvas(renderer: any) {\r\n if (!this.visible || this.worldAlpha <= 0 || !this.renderable) {\r\n return;\r\n }\r\n let plugin = renderer.plugins.tilemap;\r\n if (!plugin.dontUseTransform) {\r\n let wt = this.worldTransform;\r\n renderer.context.setTransform(\r\n wt.a,\r\n wt.b,\r\n wt.c,\r\n wt.d,\r\n wt.tx * renderer.resolution,\r\n wt.ty * renderer.resolution\r\n );\r\n }\r\n let layers = this.children;\r\n for (let i = 0; i < layers.length; i++) {\r\n (layers[i] as RectTileLayer).renderCanvasCore(renderer);\r\n }\r\n }\r\n\r\n render(renderer: Renderer) {\r\n if (!this.visible || this.worldAlpha <= 0 || !this.renderable) {\r\n return;\r\n }\r\n let plugin = (renderer.plugins as any)['tilemap'];\r\n let shader = plugin.getShader();\r\n renderer.batch.setObjectRenderer(plugin);\r\n //TODO: dont create new array, please\r\n this._globalMat = shader.uniforms.projTransMatrix;\r\n renderer.globalUniforms.uniforms.projectionMatrix.copyTo(this._globalMat).append(this.worldTransform);\r\n shader.uniforms.shadowColor = this.shadowColor;\r\n shader.uniforms.animationFrame = plugin.tileAnim;\r\n renderer.shader.bind(shader, false);\r\n let layers = this.children;\r\n for (let i = 0; i < layers.length; i++) {\r\n (layers[i] as RectTileLayer).renderWebGLCore(renderer, plugin);\r\n }\r\n }\r\n\r\n isModified(anim: boolean) {\r\n let layers = this.children;\r\n if (this.modificationMarker !== layers.length) {\r\n return true;\r\n }\r\n for (let i = 0; i < layers.length; i++) {\r\n if ((layers[i] as RectTileLayer).isModified(anim)) {\r\n return true;\r\n }\r\n }\r\n return false;\r\n }\r\n\r\n clearModify() {\r\n let layers = this.children;\r\n this.modificationMarker = layers.length;\r\n for (let i = 0; i < layers.length; i++) {\r\n (layers[i] as RectTileLayer).clearModify();\r\n }\r\n }\r\n}\r\n","/// \r\n\r\nimport { Matrix } from '@pixi/math';\r\nimport { Graphics } from '@pixi/graphics';\r\n\r\nexport class GraphicsLayer extends Graphics {\r\n constructor(zIndex: number) {\r\n super();\r\n this.zIndex = zIndex;\r\n }\r\n\r\n renderCanvas(renderer: any) {\r\n let wt: Matrix = null;\r\n if (renderer.plugins.tilemap.dontUseTransform) {\r\n wt = this.transform.worldTransform;\r\n this.transform.worldTransform = Matrix.IDENTITY;\r\n }\r\n renderer.plugins.graphics.render(this);\r\n if (renderer.plugins.tilemap.dontUseTransform) {\r\n this.transform.worldTransform = wt;\r\n }\r\n renderer.context.globalAlpha = 1.0;\r\n }\r\n\r\n // renderWebGL(renderer: PIXI.Renderer) {\r\n // if (!this._webGL[renderer.CONTEXT_UID])\r\n // this.dirty++;\r\n // super.renderWebGL(renderer)\r\n // }\r\n\r\n isModified(anim: boolean): boolean {\r\n return false;\r\n }\r\n\r\n clearModify() {\r\n }\r\n}\r\n","/// \r\n\r\nimport { ALPHA_MODES } from '@pixi/constants';\r\nimport { BaseTexture, Renderer, Texture, GLTexture, resources } from '@pixi/core';\r\nimport { Sprite } from '@pixi/sprite';\r\nimport { Constant } from './Constant';\r\n\r\nexport interface IMultiTextureOptions {\r\n\tboundCountPerBuffer: number;\r\n\tboundSize: number;\r\n\tbufferSize: number;\r\n\tDO_CLEAR?: boolean;\r\n}\r\n\r\nexport class MultiTextureResource extends resources.Resource {\r\n\tconstructor(options: IMultiTextureOptions) {\r\n\t\tsuper(options.bufferSize, options.bufferSize);\r\n\r\n\t\tconst bounds = this.boundSprites;\r\n\t\tconst dirties = this.dirties;\r\n\t\tthis.boundSize = options.boundSize;\r\n\t\tfor (let j = 0; j < options.boundCountPerBuffer; j++) {\r\n\t\t\tconst spr = new Sprite();\r\n\t\t\tspr.position.x = options.boundSize * (j & 1);\r\n\t\t\tspr.position.y = options.boundSize * (j >> 1);\r\n\t\t\tbounds.push(spr);\r\n\t\t\tdirties.push(0);\r\n\t\t}\r\n\t\tthis.DO_CLEAR = !!options.DO_CLEAR;\r\n\t}\r\n\r\n\tDO_CLEAR = false;\r\n\tboundSize: number = 0;\r\n\t_clearBuffer: Uint8Array = null;\r\n\r\n\tbind(baseTexture: BaseTexture) {\r\n\t\tif (this.baseTex) {\r\n\t\t\tthrow new Error('Only one baseTexture is allowed for this resource!')\r\n\t\t}\r\n\t\tthis.baseTex = baseTexture;\r\n\t\tsuper.bind(baseTexture);\r\n\t}\r\n\r\n\tbaseTex: BaseTexture = null;\r\n\tboundSprites: Array = [];\r\n\tdirties: Array = [];\r\n\r\n\tsetTexture(ind: number, texture: Texture) {\r\n\t\tconst spr = this.boundSprites[ind];\r\n\t\tif (spr.texture.baseTexture === texture.baseTexture) {\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tspr.texture = texture;\r\n\t\tthis.baseTex.update();\r\n\t\tthis.dirties[ind] = (this.baseTex as any).dirtyId;\r\n\t}\r\n\r\n\tupload(renderer: Renderer, texture: BaseTexture, glTexture: GLTexture) {\r\n\t\tconst { gl } = renderer as any;\r\n\r\n\t\tconst {width, height} = this;\r\n\t\tgl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, texture.alphaMode === undefined ||\r\n\t\t\ttexture.alphaMode === ALPHA_MODES.UNPACK);\r\n\r\n\t\tif (glTexture.dirtyId < 0) {\r\n\t\t\t(glTexture as any).width = width;\r\n\t\t\t(glTexture as any).height = height;\r\n\r\n\t\t\tgl.texImage2D(texture.target, 0,\r\n\t\t\t\ttexture.format,\r\n\t\t\t\twidth,\r\n\t\t\t\theight,\r\n\t\t\t\t0,\r\n\t\t\t\ttexture.format,\r\n\t\t\t\ttexture.type,\r\n\t\t\t\tnull);\r\n\t\t}\r\n\r\n\t\tconst doClear = this.DO_CLEAR;\r\n\t\tif (doClear && !this._clearBuffer) {\r\n\t\t\tthis._clearBuffer = new Uint8Array(Constant.boundSize * Constant.boundSize * 4);\r\n\t\t}\r\n\r\n\t\tconst bounds = this.boundSprites;\r\n\t\tfor (let i = 0; i < bounds.length; i++) {\r\n\t\t\tconst spr = bounds[i];\r\n\t\t\tconst tex = spr.texture.baseTexture;\r\n\t\t\tif (glTexture.dirtyId >= this.dirties[i]) {\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\t\t\tconst res = tex.resource as any;\r\n\t\t\tif (!tex.valid || !res || !res.source) {\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\t\t\tif (doClear && (tex.width < this.boundSize || tex.height < this.boundSize))\r\n\t\t\t{\r\n\t\t\t\tgl.texSubImage2D(texture.target, 0,\r\n\t\t\t\t\tspr.position.x,\r\n\t\t\t\t\tspr.position.y,\r\n\t\t\t\t\tthis.boundSize,\r\n\t\t\t\t\tthis.boundSize,\r\n\t\t\t\t\ttexture.format,\r\n\t\t\t\t\ttexture.type,\r\n\t\t\t\t\tthis._clearBuffer);\r\n\t\t\t}\r\n\t\t\tgl.texSubImage2D(texture.target, 0,\r\n\t\t\t\tspr.position.x,\r\n\t\t\t\tspr.position.y,\r\n\t\t\t\ttexture.format,\r\n\t\t\t\ttexture.type,\r\n\t\t\t\tres.source);\r\n\t\t}\r\n\r\n\t\treturn true;\r\n\t}\r\n}\r\n","import { Constant } from './Constant';\r\n\r\nimport type { TilemapShader } from './RectTileShader';\r\n\r\n\r\nexport function fillSamplers(shader: TilemapShader, maxTextures: number) {\r\n let sampleValues: Array = [];\r\n for (let i = 0; i < maxTextures; i++)\r\n {\r\n sampleValues[i] = i;\r\n }\r\n shader.uniforms.uSamplers = sampleValues;\r\n\r\n let samplerSize: Array = [];\r\n for (let i = 0; i < maxTextures; i++) {\r\n samplerSize.push(1.0 / Constant.bufferSize);\r\n samplerSize.push(1.0 / Constant.bufferSize);\r\n }\r\n shader.uniforms.uSamplerSize = samplerSize;\r\n}\r\n\r\nexport function generateFragmentSrc(maxTextures: number, fragmentSrc: string) {\r\n return fragmentSrc.replace(/%count%/gi, maxTextures + \"\")\r\n .replace(/%forloop%/gi, generateSampleSrc(maxTextures));\r\n}\r\n\r\nexport function generateSampleSrc(maxTextures: number) {\r\n let src = '';\r\n\r\n src += '\\n';\r\n src += '\\n';\r\n\r\n src += 'if(vTextureId <= -1.0) {';\r\n src += '\\n\\tcolor = shadowColor;';\r\n src += '\\n}';\r\n\r\n for (let i = 0; i < maxTextures; i++)\r\n {\r\n src += '\\nelse ';\r\n\r\n if(i < maxTextures-1)\r\n {\r\n src += 'if(textureId == ' + i + '.0)';\r\n }\r\n\r\n src += '\\n{';\r\n src += '\\n\\tcolor = texture2D(uSamplers['+i+'], textureCoord * uSamplerSize['+i+']);';\r\n src += '\\n}';\r\n }\r\n\r\n src += '\\n';\r\n src += '\\n';\r\n\r\n return src;\r\n}\r\n","/// \r\n\r\nimport * as shaderGenerator from './shaderGenerator';\r\n\r\nimport { Buffer, Geometry, Shader, Program } from '@pixi/core';\r\nimport { Matrix } from '@pixi/math';\r\n\r\nlet rectShaderFrag = `\r\nvarying vec2 vTextureCoord;\r\nvarying vec4 vFrame;\r\nvarying float vTextureId;\r\nuniform vec4 shadowColor;\r\nuniform sampler2D uSamplers[%count%];\r\nuniform vec2 uSamplerSize[%count%];\r\n\r\nvoid main(void){\r\n vec2 textureCoord = clamp(vTextureCoord, vFrame.xy, vFrame.zw);\r\n float textureId = floor(vTextureId + 0.5);\r\n\r\n vec4 color;\r\n %forloop%\r\n gl_FragColor = color;\r\n}\r\n`;\r\nlet rectShaderVert = `\r\nattribute vec2 aVertexPosition;\r\nattribute vec2 aTextureCoord;\r\nattribute vec4 aFrame;\r\nattribute vec2 aAnim;\r\nattribute float aTextureId;\r\n\r\nuniform mat3 projTransMatrix;\r\nuniform vec2 animationFrame;\r\n\r\nvarying vec2 vTextureCoord;\r\nvarying float vTextureId;\r\nvarying vec4 vFrame;\r\n\r\nvoid main(void){\r\n gl_Position = vec4((projTransMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\r\n vec2 animCount = floor((aAnim + 0.5) / 2048.0);\r\n vec2 animFrameOffset = aAnim - animCount * 2048.0;\r\n vec2 animOffset = animFrameOffset * floor(mod(animationFrame + 0.5, animCount));\r\n\r\n vTextureCoord = aTextureCoord + animOffset;\r\n vFrame = aFrame + vec4(animOffset, animOffset);\r\n vTextureId = aTextureId;\r\n}\r\n`;\r\n\r\nexport abstract class TilemapShader extends Shader {\r\n\tmaxTextures = 0;\r\n\r\n\tconstructor(maxTextures: number, shaderVert: string, shaderFrag: string) {\r\n\t\tsuper(\r\n\t\t\tnew Program(\r\n\t\t\t\tshaderVert,\r\n\t\t\t\tshaderFrag),\r\n\t\t\t{\r\n\t\t\t\tanimationFrame: new Float32Array(2),\r\n\t\t\t\tuSamplers: [],\r\n\t\t\t\tuSamplerSize: [],\r\n\t\t\t\tprojTransMatrix: new Matrix()\r\n\t\t\t}\r\n\t\t);\r\n\t\tthis.maxTextures = maxTextures;\r\n\t\tshaderGenerator.fillSamplers(this, this.maxTextures);\r\n\t}\r\n}\r\n\r\nexport class RectTileShader extends TilemapShader {\r\n\tconstructor(maxTextures: number) {\r\n\t\tsuper(\r\n\t\t\tmaxTextures,\r\n\t\t\trectShaderVert,\r\n\t\t\tshaderGenerator.generateFragmentSrc(maxTextures, rectShaderFrag)\r\n\t\t);\r\n\t\tshaderGenerator.fillSamplers(this, this.maxTextures);\r\n\t}\r\n}\r\n\r\nexport class RectTileGeom extends Geometry {\r\n\tvertSize = 11;\r\n\tvertPerQuad = 4;\r\n\tstride = this.vertSize * 4;\r\n\tlastTimeAccess = 0;\r\n\r\n\tconstructor() {\r\n\t\tsuper();\r\n\t\tconst buf = this.buf = new Buffer(new Float32Array(2), true, false);\r\n\t\tthis.addAttribute('aVertexPosition', buf, 0, false, 0, this.stride, 0)\r\n\t\t\t.addAttribute('aTextureCoord', buf, 0, false, 0, this.stride, 2 * 4)\r\n\t\t\t.addAttribute('aFrame', buf, 0, false, 0, this.stride, 4 * 4)\r\n\t\t\t.addAttribute('aAnim', buf, 0, false, 0, this.stride, 8 * 4)\r\n\t\t\t.addAttribute('aTextureId', buf, 0, false, 0, this.stride, 10 * 4);\r\n\t}\r\n\r\n\tbuf: Buffer;\r\n}\r\n","import { WRAP_MODES } from '@pixi/constants';\r\nimport { BaseTexture, Buffer, resources, ObjectRenderer, Texture, Renderer } from '@pixi/core';\r\nimport { Constant } from './Constant';\r\nimport { RectTileGeom, RectTileShader } from './RectTileShader';\r\nimport { MultiTextureResource } from './MultiTextureResource';\r\n\r\nimport type { TilemapShader } from './RectTileShader';\r\n\r\n/**\r\n * Renderer for rectangle tiles.\r\n */\r\nexport class TileRenderer extends ObjectRenderer {\r\n\trenderer: Renderer;\r\n\tgl: WebGLRenderingContext;\r\n\tsn: number = -1;\r\n\tindexBuffer: Buffer = null;\r\n\tibLen: number = 0;\r\n\ttileAnim = [0, 0];\r\n\ttexLoc: Array = [];\r\n\r\n\trectShader: RectTileShader;\r\n\ttexResources: Array = [];\r\n\r\n\tconstructor(renderer: Renderer) {\r\n\t\tsuper(renderer);\r\n\t\tthis.rectShader = new RectTileShader(Constant.maxTextures);\r\n\t\tthis.indexBuffer = new Buffer(undefined, true, true);\r\n\t\tthis.checkIndexBuffer(2000);\r\n\t\tthis.initBounds();\r\n\t}\r\n\r\n\tinitBounds() {\r\n\t\tif (Constant.boundCountPerBuffer <= 1) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tconst maxTextures = Constant.maxTextures;\r\n\t\tfor (let i = 0; i < maxTextures; i++) {\r\n\t\t\tconst resource = new MultiTextureResource(Constant);\r\n\t\t\tconst baseTex = new BaseTexture(resource);\r\n\t\t\tbaseTex.scaleMode = Constant.SCALE_MODE;\r\n\t\t\tbaseTex.wrapMode = WRAP_MODES.CLAMP;\r\n\t\t\tthis.texResources.push(resource);\r\n\t\t}\r\n\t}\r\n\r\n\tbindTexturesWithoutRT(renderer: Renderer, shader: TilemapShader, textures: Array) {\r\n\t\tlet samplerSize: Array = (shader as any).uniforms.uSamplerSize;\r\n\t\tthis.texLoc.length = 0;\r\n\t\tfor (let i = 0; i < textures.length; i++) {\r\n\t\t\tconst texture = textures[i];\r\n\t\t\tif (!texture || !texture.valid) {\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\trenderer.texture.bind(textures[i], i);\r\n\t\t\t//TODO: add resolution here\r\n\t\t\tsamplerSize[i * 2] = 1.0 / textures[i].baseTexture.width;\r\n\t\t\tsamplerSize[i * 2 + 1] = 1.0 / textures[i].baseTexture.height;\r\n\t\t}\r\n\t\t(shader as any).uniforms.uSamplerSize = samplerSize;\r\n\t}\r\n\r\n\tbindTextures(renderer: Renderer, shader: TilemapShader, textures: Array) {\r\n\t\tconst len = textures.length;\r\n\t\tconst maxTextures = Constant.maxTextures;\r\n\t\tif (len > Constant.boundCountPerBuffer * maxTextures) {\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tif (Constant.boundCountPerBuffer <= 1) {\r\n\t\t\tthis.bindTexturesWithoutRT(renderer, shader, textures);\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tlet i = 0;\r\n\t\tfor (; i < len; i++) {\r\n\t\t\tconst texture = textures[i];\r\n\t\t\tif (!texture || !texture.valid) continue;\r\n\t\t\tconst multi = this.texResources[i >> 2];\r\n\t\t\tmulti.setTexture(i & 3, texture);\r\n\t\t}\r\n\r\n\t\tlet gltsUsed = (i + 3) >> 2;\r\n\t\tfor (i = 0; i < gltsUsed; i++) {\r\n\t\t\t//remove \"i, true\" after resolving a bug\r\n\t\t\trenderer.texture.bind(this.texResources[i].baseTex, i);\r\n\t\t}\r\n\t}\r\n\r\n\tstart() {\r\n\t\t//sorry, nothing\r\n\t}\r\n\r\n\tcreateVb() {\r\n\t\tconst geom = new RectTileGeom();\r\n\t\tgeom.addIndex(this.indexBuffer);\r\n\t\tgeom.lastTimeAccess = Date.now();\r\n\t\treturn geom;\r\n\t}\r\n\r\n\tcheckIndexBuffer(size: number, vb: RectTileGeom = null) {\r\n\t\tconst totalIndices = size * 6;\r\n\r\n\t\tif (totalIndices <= this.ibLen) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tlet len = totalIndices;\r\n\t\twhile (len < totalIndices) {\r\n\t\t\tlen <<= 1;\r\n\t\t}\r\n\r\n\t\tthis.ibLen = totalIndices;\r\n\t\tthis.indexBuffer.update((PIXI as any).utils.createIndicesForQuads(size,\r\n\t\t\tConstant.use32bitIndex ? new Uint32Array(size * 6) : undefined));\r\n\r\n\t\t// \tTODO: create new index buffer instead?\r\n\t\t// if (vb) {\r\n\t\t// \tconst curIndex = vb.getIndex();\r\n\t\t// \tif (curIndex !== this.indexBuffer && (curIndex.data as any).length < totalIndices) {\r\n\t\t// \t\tthis.swapIndex(vb, this.indexBuffer);\r\n\t\t// \t}\r\n\t\t// }\r\n\t}\r\n\r\n\t// swapIndex(geom: PIXI.Geometry, indexBuf: PIXI.Buffer) {\r\n\t\t// let buffers = (geom as any).buffers;\r\n\t\t// const oldIndex = geom.getIndex();\r\n\t\t// let ind = buffers.indexOf(oldIndex);\r\n\t\t// if (ind >= 0) {\r\n\t\t// \tbuffers.splice(ind, 1);\r\n\t\t// }\r\n\t\t// geom.addIndex(indexBuf);\r\n\t// }\r\n\r\n\tgetShader(): TilemapShader {\r\n\t\treturn this.rectShader;\r\n\t}\r\n\r\n\tdestroy() {\r\n\t\tsuper.destroy();\r\n\t\t// this.rectShader.destroy();\r\n\t\tthis.rectShader = null;\r\n\t}\r\n}\r\n\r\nRenderer.registerPlugin('tilemap', TileRenderer as any);\r\n","/// \r\n\r\nimport { Container } from '@pixi/display';\r\n\r\nimport type { CompositeRectTileLayer } from './CompositeRectTileLayer';\r\nimport type { Matrix } from '@pixi/math';\r\n\r\nexport class ZLayer extends Container {\r\n\r\n constructor(tilemap: Container, zIndex: number) {\r\n super();\r\n this.tilemap = tilemap;\r\n this.z = zIndex;\r\n }\r\n\r\n tilemap: any;\r\n z: number;\r\n zIndex: number;\r\n _previousLayers: number;\r\n canvasBuffer: HTMLCanvasElement;\r\n _tempRender: any;\r\n _lastAnimationFrame: number = -1;\r\n layerTransform: Matrix;\r\n\r\n clear() {\r\n let layers = this.children as Array;\r\n for (let i = 0; i < layers.length; i++)\r\n layers[i].clear();\r\n this._previousLayers = 0;\r\n }\r\n\r\n cacheIfDirty() {\r\n let tilemap: any = this.tilemap;\r\n let layers = this.children as Array;\r\n let modified = this._previousLayers !== layers.length;\r\n this._previousLayers = layers.length;\r\n let buf = this.canvasBuffer;\r\n let tempRender = this._tempRender;\r\n if (!buf) {\r\n buf = this.canvasBuffer = document.createElement('canvas');\r\n tempRender = this._tempRender = new (PIXI as any).CanvasRenderer({width: 100, height: 100, view: buf});\r\n tempRender.context = tempRender.rootContext;\r\n tempRender.plugins.tilemap.dontUseTransform = true;\r\n }\r\n if (buf.width !== tilemap._layerWidth ||\r\n buf.height !== tilemap._layerHeight) {\r\n buf.width = tilemap._layerWidth;\r\n buf.height = tilemap._layerHeight;\r\n modified = true;\r\n }\r\n let i: number;\r\n if (!modified) {\r\n for (i = 0; i < layers.length; i++) {\r\n if (layers[i].isModified(this._lastAnimationFrame !== tilemap.animationFrame)) {\r\n modified = true;\r\n break;\r\n }\r\n }\r\n }\r\n this._lastAnimationFrame = tilemap.animationFrame;\r\n if (modified) {\r\n if (tilemap._hackRenderer) {\r\n tilemap._hackRenderer(tempRender);\r\n }\r\n tempRender.context.clearRect(0, 0, buf.width, buf.height);\r\n for (i = 0; i < layers.length; i++) {\r\n layers[i].clearModify();\r\n layers[i].renderCanvas(tempRender);\r\n }\r\n }\r\n this.layerTransform = this.worldTransform;\r\n for (i = 0; i < layers.length; i++) {\r\n this.layerTransform = layers[i].worldTransform;\r\n break;\r\n }\r\n }\r\n\r\n renderCanvas(renderer: any) {\r\n this.cacheIfDirty();\r\n let wt = this.layerTransform;\r\n renderer.context.setTransform(\r\n wt.a,\r\n wt.b,\r\n wt.c,\r\n wt.d,\r\n wt.tx * renderer.resolution,\r\n wt.ty * renderer.resolution\r\n );\r\n let tilemap = this.tilemap;\r\n renderer.context.drawImage(this.canvasBuffer, 0, 0);\r\n }\r\n}\r\n","/// \r\n\r\nnamespace pixi_tilemap {\r\n (PIXI as any).tilemap = pixi_tilemap;\r\n}\r\n\r\n// This makes exporter.ts a module!\r\nexport default {}\r\n","import { CanvasTileRenderer } from './CanvasTileRenderer';\r\nimport { CompositeRectTileLayer } from './CompositeRectTileLayer';\r\nimport { Constant } from './Constant';\r\nimport { GraphicsLayer } from './GraphicsLayer';\r\nimport { MultiTextureResource } from './MultiTextureResource';\r\nimport { RectTileLayer } from './RectTileLayer';\r\nimport { TilemapShader, RectTileShader, RectTileGeom } from './RectTileShader';\r\nimport { TileRenderer } from './TileRenderer';\r\nimport { ZLayer } from './ZLayer';\r\n\r\nexport const pixi_tilemap = {\r\n CanvasTileRenderer,\r\n CompositeRectTileLayer,\r\n Constant,\r\n GraphicsLayer,\r\n MultiTextureResource,\r\n RectTileLayer,\r\n TilemapShader,\r\n RectTileShader,\r\n RectTileGeom,\r\n TileRenderer,\r\n ZLayer,\r\n};\r\n\r\nexport * from './CanvasTileRenderer';\r\nexport * from './CompositeRectTileLayer';\r\nexport * from './Constant';\r\nexport * from './exporter';\r\nexport * from './GraphicsLayer';\r\nexport * from './MultiTextureResource';\r\nexport * from './RectTileLayer';\r\nexport * from './RectTileShader';\r\nexport * from './shaderGenerator';\r\nexport * from './TileRenderer';\r\nexport * from './ZLayer';"],"names":["SCALE_MODES","Container","Bounds","Texture","groupD8","DRAW_MODES","Graphics","Matrix","resources","Sprite","ALPHA_MODES","Shader","Program","shaderGenerator.fillSamplers","shaderGenerator.generateFragmentSrc","Geometry","Buffer","ObjectRenderer","BaseTexture","WRAP_MODES","Renderer","pixi_tilemap"],"mappings":";;;;;;;;;;;;;;;;;;;UAIa,kBAAkB;QAK3B,YAAY,QAAkB;YAH9B,aAAQ,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;YAClB,qBAAgB,GAAG,KAAK,CAAC;YAGrB,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;YACzB,IAAI,CAAC,QAAQ,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;SAC1B;KACJ;IAED,MAAM,EAAE,GAAI,IAAY,CAAC,cAAc,CAAC;IAExC,IAAI,EAAE,EAAE;QACJ,EAAE,CAAC,cAAc,CAAC,SAAS,EAAE,kBAAkB,CAAC,CAAC;;;UCdxC,QAAQ,GAAG;QACpB,WAAW,EAAE,EAAE;QACf,UAAU,EAAE,IAAI;QAChB,SAAS,EAAE,IAAI;QACf,mBAAmB,EAAE,CAAC;QACtB,aAAa,EAAE,KAAK;QACpB,UAAU,EAAEA,qBAAW,CAAC,MAAM;QAC9B,QAAQ,EAAE,IAAI;;;UCAL,iBAAiB,GA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,QAAQ,CAAC,UAAU,CAC9B,CAAC;YACF,IAAI,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC;YAC3B,QAAQ,CAAC,OAAO,CAAC,SAAS,CAAC,IAAI,CAAC,YAAY,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;SACvD;;;ICxFL,IAAU,YAAY,CAErB;IAFD,WAAU,YAAY;QACjB,IAAY,CAAC,OAAO,GAAG,YAAY,CAAC;IACzC,CAAC,EAFS,YAAY,KAAZ,YAAY,QAErB;AAGD,mBAAe,EAAE;;UCGJoB,cAAY,GAAG;QACxB,kBAAkB;QAClB,sBAAsB;QACtB,QAAQ;QACR,aAAa;QACb,oBAAoB;QACpB,aAAa;QACb,aAAa;QACb,cAAc;QACd,YAAY;QACZ,YAAY;QACZ,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"} \ No newline at end of file +{"version":3,"file":"pixi-tilemap.umd.js","sources":["../src/CanvasTileRenderer.ts","../src/Constant.ts","../src/RectTileLayer.ts","../src/CompositeRectTileLayer.ts","../src/GraphicsLayer.ts","../src/MultiTextureResource.ts","../src/shaderGenerator.ts","../src/RectTileShader.ts","../src/TileRenderer.ts","../src/ZLayer.ts","../src/exporter.ts","../src/index.ts"],"sourcesContent":["/// \n\nimport { Renderer } from '@pixi/core';\n\nexport class CanvasTileRenderer {\n renderer: Renderer;\n tileAnim = [0, 0];\n dontUseTransform = false;\n\n constructor(renderer: Renderer) {\n this.renderer = renderer;\n this.tileAnim = [0, 0];\n }\n}\n\nconst cr = (PIXI as any).CanvasRenderer;\n\nif (cr) {\n cr.registerPlugin('tilemap', CanvasTileRenderer);\n}\n","/// \n\nimport { SCALE_MODES } from '@pixi/constants';\n\nexport const Constant = {\n maxTextures: 16,\n bufferSize: 2048,\n boundSize: 1024,\n boundCountPerBuffer: 1,\n use32bitIndex: false,\n SCALE_MODE: SCALE_MODES.LINEAR,\n DO_CLEAR: true\n};","/// \n\nimport { Container, Bounds } from '@pixi/display';\nimport { Constant } from './Constant';\nimport { DRAW_MODES } from '@pixi/constants';\nimport { Texture, Renderer } from '@pixi/core';\nimport { TileRenderer } from './TileRenderer';\nimport { Matrix, Rectangle, groupD8 } from '@pixi/math';\n\nimport type { RectTileGeom } from './RectTileShader';\n\nexport const POINT_STRUCT_SIZE = 12;\n\nexport class RectTileLayer extends Container {\n constructor(zIndex: number, texture: Texture | Array) {\n super();\n this.initialize(zIndex, texture);\n }\n\n zIndex = 0;\n modificationMarker = 0;\n _$_localBounds = new Bounds();\n shadowColor = new Float32Array([0.0, 0.0, 0.0, 0.5]);\n _globalMat: Matrix = null;\n\n pointsBuf: Array = [];\n hasAnim = false;\n textures: Array;\n\n offsetX = 0;\n offsetY = 0;\n compositeParent = false;\n\n initialize(zIndex: number, textures: Texture | Array) {\n if (!textures) {\n textures = [];\n } else if (!(textures instanceof Array) && (textures as Texture).baseTexture) {\n textures = [textures as Texture];\n }\n this.textures = textures as Array;\n this.zIndex = zIndex;\n // this.visible = false;\n }\n\n clear() {\n this.pointsBuf.length = 0;\n this.modificationMarker = 0;\n this._$_localBounds.clear();\n this.hasAnim = false;\n }\n\n addFrame(texture_: Texture | String | number, x: number, y: number, animX: number, animY: number) {\n let texture: Texture;\n let textureIndex = 0;\n\n if (typeof texture_ === \"number\") {\n textureIndex = texture_;\n texture = this.textures[textureIndex];\n } else {\n if (typeof texture_ === \"string\") {\n texture = Texture.from(texture_);\n } else {\n texture = texture_ as Texture;\n }\n\n let found = false;\n let textureList = this.textures;\n for (let i = 0; i < textureList.length; i++) {\n if (textureList[i].baseTexture === texture.baseTexture) {\n textureIndex = i;\n found = true;\n break;\n }\n }\n\n if (!found) {\n // textureIndex = this.textures.length;\n // this.textures.push(texture);\n return false;\n }\n }\n\n this.addRect(textureIndex, texture.frame.x, texture.frame.y, x, y, texture.orig.width, texture.orig.height, animX, animY, texture.rotate);\n return true;\n }\n\n addRect(textureIndex: number, u: number, v: number, x: number, y: number, tileWidth: number, tileHeight: number,\n animX: number = 0, animY: number = 0, rotate: number = 0, animCountX: number = 1024, animCountY: number = 1024): this {\n let pb = this.pointsBuf;\n this.hasAnim = this.hasAnim || animX > 0 || animY > 0;\n pb.push(u);\n pb.push(v);\n pb.push(x);\n pb.push(y);\n pb.push(tileWidth);\n pb.push(tileHeight);\n pb.push(rotate);\n pb.push(animX | 0);\n pb.push(animY | 0);\n pb.push(textureIndex);\n pb.push(animCountX);\n pb.push(animCountY);\n\n this._$_localBounds.addFramePad(x, y, x+tileWidth, y+tileHeight, 0, 0);\n\n return this;\n }\n\n tileRotate(rotate: number) {\n const pb = this.pointsBuf;\n pb[pb.length - 3] = rotate;\n }\n\n tileAnimX(offset: number, count: number) {\n const pb = this.pointsBuf;\n\n pb[pb.length - 5] = offset;\n pb[pb.length - 2] = count;\n }\n\n tileAnimY(offset: number, count: number) {\n const pb = this.pointsBuf;\n\n pb[pb.length - 4] = offset;\n pb[pb.length - 1] = count;\n }\n\n renderCanvas(renderer: any) {\n let plugin = renderer.plugins.tilemap;\n if (!plugin.dontUseTransform) {\n let wt = this.worldTransform;\n renderer.context.setTransform(\n wt.a,\n wt.b,\n wt.c,\n wt.d,\n wt.tx * renderer.resolution,\n wt.ty * renderer.resolution\n );\n }\n this.renderCanvasCore(renderer);\n }\n\n renderCanvasCore(renderer: any) {\n if (this.textures.length === 0) return;\n let points = this.pointsBuf;\n renderer.context.fillStyle = '#000000';\n for (let i = 0, n = points.length; i < n; i += POINT_STRUCT_SIZE) {\n let x1 = points[i], y1 = points[i + 1];\n let x2 = points[i + 2], y2 = points[i + 3];\n let w = points[i + 4];\n let h = points[i + 5];\n var rotate = points[i + 6];\n x1 += points[i + 7] * renderer.plugins.tilemap.tileAnim[0];\n y1 += points[i + 8] * renderer.plugins.tilemap.tileAnim[1];\n let textureIndex = points[i + 9];\n // canvas does not work with rotate yet\n if (textureIndex >= 0) {\n renderer.context.drawImage((this.textures[textureIndex].baseTexture as any).getDrawableSource(), x1, y1, w, h, x2, y2, w, h);\n } else {\n renderer.context.globalAlpha = 0.5;\n renderer.context.fillRect(x2, y2, w, h);\n renderer.context.globalAlpha = 1;\n }\n }\n }\n\n vbId = 0;\n vb: RectTileGeom = null;\n vbBuffer: ArrayBuffer = null;\n vbArray: Float32Array = null;\n vbInts: Uint32Array = null;\n\n destroyVb() {\n if (this.vb) {\n this.vb.destroy();\n this.vb = null;\n }\n }\n\n render(renderer: Renderer) {\n let plugin = (renderer.plugins as any)['tilemap'];\n let shader = plugin.getShader();\n renderer.batch.setObjectRenderer(plugin);\n this._globalMat = shader.uniforms.projTransMatrix;\n renderer.globalUniforms.uniforms.projectionMatrix.copyTo(this._globalMat).append(this.worldTransform);\n shader.uniforms.shadowColor = this.shadowColor;\n shader.uniforms.animationFrame = plugin.tileAnim;\n this.renderWebGLCore(renderer, plugin);\n }\n\n renderWebGLCore(renderer: Renderer, plugin: TileRenderer) {\n let points = this.pointsBuf;\n if (points.length === 0) return;\n let rectsCount = points.length / POINT_STRUCT_SIZE;\n\n let shader = plugin.getShader();\n let textures = this.textures;\n if (textures.length === 0) return;\n\n plugin.bindTextures(renderer, shader, textures);\n renderer.shader.bind(shader, false);\n\n //lost context! recover!\n let vb = this.vb;\n if (!vb) {\n vb = plugin.createVb();\n this.vb = vb;\n this.vbId = (vb as any).id;\n this.vbBuffer = null;\n this.modificationMarker = 0;\n }\n\n plugin.checkIndexBuffer(rectsCount, vb);\n const boundCountPerBuffer = Constant.boundCountPerBuffer;\n\n let vertexBuf = vb.getBuffer('aVertexPosition');\n //if layer was changed, re-upload vertices\n let vertices = rectsCount * vb.vertPerQuad;\n if (vertices === 0) return;\n if (this.modificationMarker !== vertices) {\n this.modificationMarker = vertices;\n let vs = vb.stride * vertices;\n if (!this.vbBuffer || this.vbBuffer.byteLength < vs) {\n //!@#$ happens, need resize\n let bk = vb.stride;\n while (bk < vs) {\n bk *= 2;\n }\n this.vbBuffer = new ArrayBuffer(bk);\n this.vbArray = new Float32Array(this.vbBuffer);\n this.vbInts = new Uint32Array(this.vbBuffer);\n vertexBuf.update(this.vbBuffer);\n }\n\n let arr = this.vbArray, ints = this.vbInts;\n //upload vertices!\n let sz = 0;\n //let tint = 0xffffffff;\n let textureId: number = 0;\n let shiftU: number = this.offsetX;\n let shiftV: number = this.offsetY;\n\n //let tint = 0xffffffff;\n let tint = -1;\n for (let i = 0; i < points.length; i += POINT_STRUCT_SIZE) {\n let eps = 0.5;\n if (this.compositeParent) {\n if (boundCountPerBuffer > 1) {\n //TODO: what if its more than 4?\n textureId = (points[i + 9] >> 2);\n shiftU = this.offsetX * (points[i + 9] & 1);\n shiftV = this.offsetY * ((points[i + 9] >> 1) & 1);\n } else {\n textureId = points[i + 9];\n shiftU = 0;\n shiftV = 0;\n }\n }\n let x = points[i + 2], y = points[i + 3];\n let w = points[i + 4], h = points[i + 5];\n let u = points[i] + shiftU, v = points[i + 1] + shiftV;\n let rotate = points[i + 6];\n\n const animX = points[i + 7], animY = points[i + 8];\n const animWidth = points[i + 10] || 1024, animHeight = points[i + 11] || 1024;\n const animXEncoded = animX + (animWidth * 2048);\n const animYEncoded = animY + (animHeight * 2048);\n\n let u0: number, v0: number, u1: number, v1: number, u2: number, v2: number, u3: number, v3: number;\n if (rotate === 0) {\n u0 = u;\n v0 = v;\n u1 = u + w;\n v1 = v;\n u2 = u + w;\n v2 = v + h;\n u3 = u;\n v3 = v + h;\n } else {\n let w2 = w / 2;\n let h2 = h / 2;\n if (rotate % 4 !== 0) {\n w2 = h / 2;\n h2 = w / 2;\n }\n const cX = u + w2;\n const cY = v + h2;\n\n rotate = groupD8.add(rotate, groupD8.NW);\n u0 = cX + (w2 * groupD8.uX(rotate));\n v0 = cY + (h2 * groupD8.uY(rotate));\n\n rotate = groupD8.add(rotate, 2); // rotate 90 degrees clockwise\n u1 = cX + (w2 * groupD8.uX(rotate));\n v1 = cY + (h2 * groupD8.uY(rotate));\n\n rotate = groupD8.add(rotate, 2);\n u2 = cX + (w2 * groupD8.uX(rotate));\n v2 = cY + (h2 * groupD8.uY(rotate));\n\n rotate = groupD8.add(rotate, 2);\n u3 = cX + (w2 * groupD8.uX(rotate));\n v3 = cY + (h2 * groupD8.uY(rotate));\n }\n\n arr[sz++] = x;\n arr[sz++] = y;\n arr[sz++] = u0;\n arr[sz++] = v0;\n arr[sz++] = u + eps;\n arr[sz++] = v + eps;\n arr[sz++] = u + w - eps;\n arr[sz++] = v + h - eps;\n arr[sz++] = animXEncoded;\n arr[sz++] = animYEncoded;\n arr[sz++] = textureId;\n arr[sz++] = x + w;\n arr[sz++] = y;\n arr[sz++] = u1;\n arr[sz++] = v1;\n arr[sz++] = u + eps;\n arr[sz++] = v + eps;\n arr[sz++] = u + w - eps;\n arr[sz++] = v + h - eps;\n arr[sz++] = animXEncoded;\n arr[sz++] = animYEncoded;\n arr[sz++] = textureId;\n arr[sz++] = x + w;\n arr[sz++] = y + h;\n arr[sz++] = u2;\n arr[sz++] = v2;\n arr[sz++] = u + eps;\n arr[sz++] = v + eps;\n arr[sz++] = u + w - eps;\n arr[sz++] = v + h - eps;\n arr[sz++] = animXEncoded;\n arr[sz++] = animYEncoded;\n arr[sz++] = textureId;\n arr[sz++] = x;\n arr[sz++] = y + h;\n arr[sz++] = u3;\n arr[sz++] = v3;\n arr[sz++] = u + eps;\n arr[sz++] = v + eps;\n arr[sz++] = u + w - eps;\n arr[sz++] = v + h - eps;\n arr[sz++] = animXEncoded;\n arr[sz++] = animYEncoded;\n arr[sz++] = textureId;\n }\n\n vertexBuf.update(arr);\n }\n\n (renderer.geometry as any).bind(vb, shader);\n renderer.geometry.draw(DRAW_MODES.TRIANGLES, rectsCount * 6, 0);\n }\n\n isModified(anim: boolean) {\n if (this.modificationMarker !== this.pointsBuf.length ||\n anim && this.hasAnim) {\n return true;\n }\n return false;\n }\n\n clearModify() {\n this.modificationMarker = this.pointsBuf.length;\n }\n\n protected _calculateBounds(): void\n {\n const { minX, minY, maxX, maxY } = this._$_localBounds;\n\n this._bounds.addFrame(this.transform, minX, minY, maxX, maxY);\n }\n\n public getLocalBounds(rect?: Rectangle): Rectangle\n {\n // we can do a fast local bounds if the sprite has no children!\n if (this.children.length === 0)\n {\n return this._$_localBounds.getRectangle(rect);\n }\n\n return super.getLocalBounds.call(this, rect);\n }\n\n destroy(options?: any) {\n super.destroy(options);\n this.destroyVb();\n }\n}\n","/// \n\nimport { Container } from '@pixi/display';\nimport { Texture, Renderer } from '@pixi/core';\nimport { Matrix } from '@pixi/math';\nimport { Constant } from './Constant';\nimport { RectTileLayer } from './RectTileLayer';\n\nexport class CompositeRectTileLayer extends Container {\n constructor(zIndex?: number, bitmaps?: Array, texPerChild?: number) {\n super();\n this.initialize.apply(this, arguments);\n }\n\n z: number;\n zIndex: number;\n modificationMarker = 0;\n shadowColor = new Float32Array([0.0, 0.0, 0.0, 0.5]);\n _globalMat: Matrix = null;\n _lastLayer: RectTileLayer = null;\n\n texPerChild: number;\n\n initialize(zIndex?: number, bitmaps?: Array, texPerChild?: number) {\n if (texPerChild as any === true) {\n //old format, ignore it!\n texPerChild = 0;\n }\n this.z = this.zIndex = zIndex;\n this.texPerChild = texPerChild || Constant.boundCountPerBuffer * Constant.maxTextures;\n if (bitmaps) {\n this.setBitmaps(bitmaps);\n }\n }\n\n setBitmaps(bitmaps: Array) {\n for (let i=0;i 5.2.1, it does not exist there.`);\n }\n }\n let texPerChild = this.texPerChild;\n let len1 = this.children.length;\n let len2 = Math.ceil(bitmaps.length / texPerChild);\n let i: number;\n for (i = 0; i < len1; i++) {\n (this.children[i] as RectTileLayer).textures = bitmaps.slice(i * texPerChild, (i + 1) * texPerChild);\n }\n for (i = len1; i < len2; i++) {\n let layer = new RectTileLayer(this.zIndex, bitmaps.slice(i * texPerChild, (i + 1) * texPerChild));\n layer.compositeParent = true;\n layer.offsetX = Constant.boundSize;\n layer.offsetY = Constant.boundSize;\n this.addChild(layer);\n }\n }\n\n clear() {\n for (let i = 0; i < this.children.length; i++) {\n (this.children[i] as RectTileLayer).clear();\n }\n this.modificationMarker = 0;\n }\n\n addRect(textureIndex: number, u: number, v: number, x: number, y: number, tileWidth: number, tileHeight: number, animX?: number, animY?: number, rotate?: number, animWidth?: number, animHeight?: number): this {\n const childIndex: number = textureIndex / this.texPerChild >> 0;\n const textureId: number = textureIndex % this.texPerChild;\n\n if (this.children[childIndex] && (this.children[childIndex] as RectTileLayer).textures) {\n this._lastLayer = (this.children[childIndex] as RectTileLayer);\n this._lastLayer.addRect(textureId, u, v, x, y, tileWidth, tileHeight, animX, animY, rotate, animWidth, animHeight);\n } else {\n this._lastLayer = null;\n }\n\n return this;\n }\n\n tileRotate(rotate: number): this {\n if (this._lastLayer)\n {\n this._lastLayer.tileRotate(rotate);\n }\n return this;\n }\n\n tileAnimX(offset: number, count: number): this {\n if (this._lastLayer)\n {\n this._lastLayer.tileAnimX(offset, count);\n }\n return this;\n }\n\n tileAnimY(offset: number, count: number): this {\n if (this._lastLayer)\n {\n this._lastLayer.tileAnimY(offset, count);\n }\n return this;\n }\n\n addFrame(texture_: Texture | String | number, x: number, y: number, animX?: number, animY?: number, animWidth?: number, animHeight?: number): this {\n let texture: Texture;\n let layer: RectTileLayer = null;\n let ind: number = 0;\n let children = this.children;\n\n this._lastLayer = null;\n if (typeof texture_ === \"number\") {\n let childIndex = texture_ / this.texPerChild >> 0;\n layer = children[childIndex] as RectTileLayer;\n\n if (!layer) {\n layer = children[0] as RectTileLayer;\n if (!layer) {\n return this;\n }\n ind = 0;\n } else {\n ind = texture_ % this.texPerChild;\n }\n\n texture = layer.textures[ind];\n } else {\n if (typeof texture_ === \"string\") {\n texture = Texture.from(texture_);\n } else {\n texture = texture_ as Texture;\n }\n\n for (let i = 0; i < children.length; i++) {\n let child = children[i] as RectTileLayer;\n let tex = child.textures;\n for (let j = 0; j < tex.length; j++) {\n if (tex[j].baseTexture === texture.baseTexture) {\n layer = child;\n ind = j;\n break;\n }\n }\n if (layer) {\n break;\n }\n }\n\n if (!layer) {\n for (let i = 0; i < children.length; i++) {\n let child = children[i] as RectTileLayer;\n if (child.textures.length < this.texPerChild) {\n layer = child;\n ind = child.textures.length;\n child.textures.push(texture);\n break;\n }\n }\n if (!layer) {\n layer = new RectTileLayer(this.zIndex, texture);\n layer.compositeParent = true;\n layer.offsetX = Constant.boundSize;\n layer.offsetY = Constant.boundSize;\n this.addChild(layer);\n ind = 0;\n }\n }\n }\n\n this._lastLayer = layer;\n layer.addRect(ind, texture.frame.x, texture.frame.y, x, y, texture.orig.width, texture.orig.height, animX, animY, texture.rotate, animWidth, animHeight);\n return this;\n }\n\n renderCanvas(renderer: any) {\n if (!this.visible || this.worldAlpha <= 0 || !this.renderable) {\n return;\n }\n let plugin = renderer.plugins.tilemap;\n if (!plugin.dontUseTransform) {\n let wt = this.worldTransform;\n renderer.context.setTransform(\n wt.a,\n wt.b,\n wt.c,\n wt.d,\n wt.tx * renderer.resolution,\n wt.ty * renderer.resolution\n );\n }\n let layers = this.children;\n for (let i = 0; i < layers.length; i++) {\n (layers[i] as RectTileLayer).renderCanvasCore(renderer);\n }\n }\n\n render(renderer: Renderer) {\n if (!this.visible || this.worldAlpha <= 0 || !this.renderable) {\n return;\n }\n let plugin = (renderer.plugins as any)['tilemap'];\n let shader = plugin.getShader();\n renderer.batch.setObjectRenderer(plugin);\n //TODO: dont create new array, please\n this._globalMat = shader.uniforms.projTransMatrix;\n renderer.globalUniforms.uniforms.projectionMatrix.copyTo(this._globalMat).append(this.worldTransform);\n shader.uniforms.shadowColor = this.shadowColor;\n shader.uniforms.animationFrame = plugin.tileAnim;\n renderer.shader.bind(shader, false);\n let layers = this.children;\n for (let i = 0; i < layers.length; i++) {\n (layers[i] as RectTileLayer).renderWebGLCore(renderer, plugin);\n }\n }\n\n isModified(anim: boolean) {\n let layers = this.children;\n if (this.modificationMarker !== layers.length) {\n return true;\n }\n for (let i = 0; i < layers.length; i++) {\n if ((layers[i] as RectTileLayer).isModified(anim)) {\n return true;\n }\n }\n return false;\n }\n\n clearModify() {\n let layers = this.children;\n this.modificationMarker = layers.length;\n for (let i = 0; i < layers.length; i++) {\n (layers[i] as RectTileLayer).clearModify();\n }\n }\n}\n","/// \n\nimport { Matrix } from '@pixi/math';\nimport { Graphics } from '@pixi/graphics';\n\nexport class GraphicsLayer extends Graphics {\n constructor(zIndex: number) {\n super();\n this.zIndex = zIndex;\n }\n\n renderCanvas(renderer: any) {\n let wt: Matrix = null;\n if (renderer.plugins.tilemap.dontUseTransform) {\n wt = this.transform.worldTransform;\n this.transform.worldTransform = Matrix.IDENTITY;\n }\n renderer.plugins.graphics.render(this);\n if (renderer.plugins.tilemap.dontUseTransform) {\n this.transform.worldTransform = wt;\n }\n renderer.context.globalAlpha = 1.0;\n }\n\n // renderWebGL(renderer: PIXI.Renderer) {\n // if (!this._webGL[renderer.CONTEXT_UID])\n // this.dirty++;\n // super.renderWebGL(renderer)\n // }\n\n isModified(anim: boolean): boolean {\n return false;\n }\n\n clearModify() {\n }\n}\n","/// \n\nimport { ALPHA_MODES } from '@pixi/constants';\nimport { BaseTexture, Renderer, Texture, GLTexture, resources } from '@pixi/core';\nimport { Sprite } from '@pixi/sprite';\nimport { Constant } from './Constant';\n\nexport interface IMultiTextureOptions {\n\tboundCountPerBuffer: number;\n\tboundSize: number;\n\tbufferSize: number;\n\tDO_CLEAR?: boolean;\n}\n\nexport class MultiTextureResource extends resources.Resource {\n\tconstructor(options: IMultiTextureOptions) {\n\t\tsuper(options.bufferSize, options.bufferSize);\n\n\t\tconst bounds = this.boundSprites;\n\t\tconst dirties = this.dirties;\n\t\tthis.boundSize = options.boundSize;\n\t\tfor (let j = 0; j < options.boundCountPerBuffer; j++) {\n\t\t\tconst spr = new Sprite();\n\t\t\tspr.position.x = options.boundSize * (j & 1);\n\t\t\tspr.position.y = options.boundSize * (j >> 1);\n\t\t\tbounds.push(spr);\n\t\t\tdirties.push(0);\n\t\t}\n\t\tthis.DO_CLEAR = !!options.DO_CLEAR;\n\t}\n\n\tDO_CLEAR = false;\n\tboundSize: number = 0;\n\t_clearBuffer: Uint8Array = null;\n\n\tbind(baseTexture: BaseTexture) {\n\t\tif (this.baseTex) {\n\t\t\tthrow new Error('Only one baseTexture is allowed for this resource!')\n\t\t}\n\t\tthis.baseTex = baseTexture;\n\t\tsuper.bind(baseTexture);\n\t}\n\n\tbaseTex: BaseTexture = null;\n\tboundSprites: Array = [];\n\tdirties: Array = [];\n\n\tsetTexture(ind: number, texture: Texture) {\n\t\tconst spr = this.boundSprites[ind];\n\t\tif (spr.texture.baseTexture === texture.baseTexture) {\n\t\t\treturn;\n\t\t}\n\t\tspr.texture = texture;\n\t\tthis.baseTex.update();\n\t\tthis.dirties[ind] = (this.baseTex as any).dirtyId;\n\t}\n\n\tupload(renderer: Renderer, texture: BaseTexture, glTexture: GLTexture) {\n\t\tconst { gl } = renderer as any;\n\n\t\tconst {width, height} = this;\n\t\tgl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, texture.alphaMode === undefined ||\n\t\t\ttexture.alphaMode === ALPHA_MODES.UNPACK);\n\n\t\tif (glTexture.dirtyId < 0) {\n\t\t\t(glTexture as any).width = width;\n\t\t\t(glTexture as any).height = height;\n\n\t\t\tgl.texImage2D(texture.target, 0,\n\t\t\t\ttexture.format,\n\t\t\t\twidth,\n\t\t\t\theight,\n\t\t\t\t0,\n\t\t\t\ttexture.format,\n\t\t\t\ttexture.type,\n\t\t\t\tnull);\n\t\t}\n\n\t\tconst doClear = this.DO_CLEAR;\n\t\tif (doClear && !this._clearBuffer) {\n\t\t\tthis._clearBuffer = new Uint8Array(Constant.boundSize * Constant.boundSize * 4);\n\t\t}\n\n\t\tconst bounds = this.boundSprites;\n\t\tfor (let i = 0; i < bounds.length; i++) {\n\t\t\tconst spr = bounds[i];\n\t\t\tconst tex = spr.texture.baseTexture;\n\t\t\tif (glTexture.dirtyId >= this.dirties[i]) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tconst res = tex.resource as any;\n\t\t\tif (!tex.valid || !res || !res.source) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (doClear && (tex.width < this.boundSize || tex.height < this.boundSize))\n\t\t\t{\n\t\t\t\tgl.texSubImage2D(texture.target, 0,\n\t\t\t\t\tspr.position.x,\n\t\t\t\t\tspr.position.y,\n\t\t\t\t\tthis.boundSize,\n\t\t\t\t\tthis.boundSize,\n\t\t\t\t\ttexture.format,\n\t\t\t\t\ttexture.type,\n\t\t\t\t\tthis._clearBuffer);\n\t\t\t}\n\t\t\tgl.texSubImage2D(texture.target, 0,\n\t\t\t\tspr.position.x,\n\t\t\t\tspr.position.y,\n\t\t\t\ttexture.format,\n\t\t\t\ttexture.type,\n\t\t\t\tres.source);\n\t\t}\n\n\t\treturn true;\n\t}\n}\n","import { Constant } from './Constant';\n\nimport type { TilemapShader } from './RectTileShader';\n\n\nexport function fillSamplers(shader: TilemapShader, maxTextures: number) {\n let sampleValues: Array = [];\n for (let i = 0; i < maxTextures; i++)\n {\n sampleValues[i] = i;\n }\n shader.uniforms.uSamplers = sampleValues;\n\n let samplerSize: Array = [];\n for (let i = 0; i < maxTextures; i++) {\n samplerSize.push(1.0 / Constant.bufferSize);\n samplerSize.push(1.0 / Constant.bufferSize);\n }\n shader.uniforms.uSamplerSize = samplerSize;\n}\n\nexport function generateFragmentSrc(maxTextures: number, fragmentSrc: string) {\n return fragmentSrc.replace(/%count%/gi, maxTextures + \"\")\n .replace(/%forloop%/gi, generateSampleSrc(maxTextures));\n}\n\nexport function generateSampleSrc(maxTextures: number) {\n let src = '';\n\n src += '\\n';\n src += '\\n';\n\n src += 'if(vTextureId <= -1.0) {';\n src += '\\n\\tcolor = shadowColor;';\n src += '\\n}';\n\n for (let i = 0; i < maxTextures; i++)\n {\n src += '\\nelse ';\n\n if(i < maxTextures-1)\n {\n src += 'if(textureId == ' + i + '.0)';\n }\n\n src += '\\n{';\n src += '\\n\\tcolor = texture2D(uSamplers['+i+'], textureCoord * uSamplerSize['+i+']);';\n src += '\\n}';\n }\n\n src += '\\n';\n src += '\\n';\n\n return src;\n}\n","/// \n\nimport * as shaderGenerator from './shaderGenerator';\n\nimport { Buffer, Geometry, Shader, Program } from '@pixi/core';\nimport { Matrix } from '@pixi/math';\n\nlet rectShaderFrag = `\nvarying vec2 vTextureCoord;\nvarying vec4 vFrame;\nvarying float vTextureId;\nuniform vec4 shadowColor;\nuniform sampler2D uSamplers[%count%];\nuniform vec2 uSamplerSize[%count%];\n\nvoid main(void){\n vec2 textureCoord = clamp(vTextureCoord, vFrame.xy, vFrame.zw);\n float textureId = floor(vTextureId + 0.5);\n\n vec4 color;\n %forloop%\n gl_FragColor = color;\n}\n`;\nlet rectShaderVert = `\nattribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\nattribute vec4 aFrame;\nattribute vec2 aAnim;\nattribute float aTextureId;\n\nuniform mat3 projTransMatrix;\nuniform vec2 animationFrame;\n\nvarying vec2 vTextureCoord;\nvarying float vTextureId;\nvarying vec4 vFrame;\n\nvoid main(void){\n gl_Position = vec4((projTransMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n vec2 animCount = floor((aAnim + 0.5) / 2048.0);\n vec2 animFrameOffset = aAnim - animCount * 2048.0;\n vec2 animOffset = animFrameOffset * floor(mod(animationFrame + 0.5, animCount));\n\n vTextureCoord = aTextureCoord + animOffset;\n vFrame = aFrame + vec4(animOffset, animOffset);\n vTextureId = aTextureId;\n}\n`;\n\nexport abstract class TilemapShader extends Shader {\n\tmaxTextures = 0;\n\n\tconstructor(maxTextures: number, shaderVert: string, shaderFrag: string) {\n\t\tsuper(\n\t\t\tnew Program(\n\t\t\t\tshaderVert,\n\t\t\t\tshaderFrag),\n\t\t\t{\n\t\t\t\tanimationFrame: new Float32Array(2),\n\t\t\t\tuSamplers: [],\n\t\t\t\tuSamplerSize: [],\n\t\t\t\tprojTransMatrix: new Matrix()\n\t\t\t}\n\t\t);\n\t\tthis.maxTextures = maxTextures;\n\t\tshaderGenerator.fillSamplers(this, this.maxTextures);\n\t}\n}\n\nexport class RectTileShader extends TilemapShader {\n\tconstructor(maxTextures: number) {\n\t\tsuper(\n\t\t\tmaxTextures,\n\t\t\trectShaderVert,\n\t\t\tshaderGenerator.generateFragmentSrc(maxTextures, rectShaderFrag)\n\t\t);\n\t\tshaderGenerator.fillSamplers(this, this.maxTextures);\n\t}\n}\n\nexport class RectTileGeom extends Geometry {\n\tvertSize = 11;\n\tvertPerQuad = 4;\n\tstride = this.vertSize * 4;\n\tlastTimeAccess = 0;\n\n\tconstructor() {\n\t\tsuper();\n\t\tconst buf = this.buf = new Buffer(new Float32Array(2), true, false);\n\t\tthis.addAttribute('aVertexPosition', buf, 0, false, 0, this.stride, 0)\n\t\t\t.addAttribute('aTextureCoord', buf, 0, false, 0, this.stride, 2 * 4)\n\t\t\t.addAttribute('aFrame', buf, 0, false, 0, this.stride, 4 * 4)\n\t\t\t.addAttribute('aAnim', buf, 0, false, 0, this.stride, 8 * 4)\n\t\t\t.addAttribute('aTextureId', buf, 0, false, 0, this.stride, 10 * 4);\n\t}\n\n\tbuf: Buffer;\n}\n","import { WRAP_MODES } from '@pixi/constants';\nimport { BaseTexture, Buffer, resources, ObjectRenderer, Texture, Renderer } from '@pixi/core';\nimport { Constant } from './Constant';\nimport { RectTileGeom, RectTileShader } from './RectTileShader';\nimport { MultiTextureResource } from './MultiTextureResource';\n\nimport type { TilemapShader } from './RectTileShader';\n\n/**\n * Renderer for rectangle tiles.\n */\nexport class TileRenderer extends ObjectRenderer {\n\trenderer: Renderer;\n\tgl: WebGLRenderingContext;\n\tsn: number = -1;\n\tindexBuffer: Buffer = null;\n\tibLen: number = 0;\n\ttileAnim = [0, 0];\n\ttexLoc: Array = [];\n\n\trectShader: RectTileShader;\n\ttexResources: Array = [];\n\n\tconstructor(renderer: Renderer) {\n\t\tsuper(renderer);\n\t\tthis.rectShader = new RectTileShader(Constant.maxTextures);\n\t\tthis.indexBuffer = new Buffer(undefined, true, true);\n\t\tthis.checkIndexBuffer(2000);\n\t\tthis.initBounds();\n\t}\n\n\tinitBounds() {\n\t\tif (Constant.boundCountPerBuffer <= 1) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst maxTextures = Constant.maxTextures;\n\t\tfor (let i = 0; i < maxTextures; i++) {\n\t\t\tconst resource = new MultiTextureResource(Constant);\n\t\t\tconst baseTex = new BaseTexture(resource);\n\t\t\tbaseTex.scaleMode = Constant.SCALE_MODE;\n\t\t\tbaseTex.wrapMode = WRAP_MODES.CLAMP;\n\t\t\tthis.texResources.push(resource);\n\t\t}\n\t}\n\n\tbindTexturesWithoutRT(renderer: Renderer, shader: TilemapShader, textures: Array) {\n\t\tlet samplerSize: Array = (shader as any).uniforms.uSamplerSize;\n\t\tthis.texLoc.length = 0;\n\t\tfor (let i = 0; i < textures.length; i++) {\n\t\t\tconst texture = textures[i];\n\t\t\tif (!texture || !texture.valid) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\trenderer.texture.bind(textures[i], i);\n\t\t\t//TODO: add resolution here\n\t\t\tsamplerSize[i * 2] = 1.0 / textures[i].baseTexture.width;\n\t\t\tsamplerSize[i * 2 + 1] = 1.0 / textures[i].baseTexture.height;\n\t\t}\n\t\t(shader as any).uniforms.uSamplerSize = samplerSize;\n\t}\n\n\tbindTextures(renderer: Renderer, shader: TilemapShader, textures: Array) {\n\t\tconst len = textures.length;\n\t\tconst maxTextures = Constant.maxTextures;\n\t\tif (len > Constant.boundCountPerBuffer * maxTextures) {\n\t\t\treturn;\n\t\t}\n\t\tif (Constant.boundCountPerBuffer <= 1) {\n\t\t\tthis.bindTexturesWithoutRT(renderer, shader, textures);\n\t\t\treturn;\n\t\t}\n\n\t\tlet i = 0;\n\t\tfor (; i < len; i++) {\n\t\t\tconst texture = textures[i];\n\t\t\tif (!texture || !texture.valid) continue;\n\t\t\tconst multi = this.texResources[i >> 2];\n\t\t\tmulti.setTexture(i & 3, texture);\n\t\t}\n\n\t\tlet gltsUsed = (i + 3) >> 2;\n\t\tfor (i = 0; i < gltsUsed; i++) {\n\t\t\t//remove \"i, true\" after resolving a bug\n\t\t\trenderer.texture.bind(this.texResources[i].baseTex, i);\n\t\t}\n\t}\n\n\tstart() {\n\t\t//sorry, nothing\n\t}\n\n\tcreateVb() {\n\t\tconst geom = new RectTileGeom();\n\t\tgeom.addIndex(this.indexBuffer);\n\t\tgeom.lastTimeAccess = Date.now();\n\t\treturn geom;\n\t}\n\n\tcheckIndexBuffer(size: number, vb: RectTileGeom = null) {\n\t\tconst totalIndices = size * 6;\n\n\t\tif (totalIndices <= this.ibLen) {\n\t\t\treturn;\n\t\t}\n\n\t\tlet len = totalIndices;\n\t\twhile (len < totalIndices) {\n\t\t\tlen <<= 1;\n\t\t}\n\n\t\tthis.ibLen = totalIndices;\n\t\tthis.indexBuffer.update((PIXI as any).utils.createIndicesForQuads(size,\n\t\t\tConstant.use32bitIndex ? new Uint32Array(size * 6) : undefined));\n\n\t\t// \tTODO: create new index buffer instead?\n\t\t// if (vb) {\n\t\t// \tconst curIndex = vb.getIndex();\n\t\t// \tif (curIndex !== this.indexBuffer && (curIndex.data as any).length < totalIndices) {\n\t\t// \t\tthis.swapIndex(vb, this.indexBuffer);\n\t\t// \t}\n\t\t// }\n\t}\n\n\t// swapIndex(geom: PIXI.Geometry, indexBuf: PIXI.Buffer) {\n\t\t// let buffers = (geom as any).buffers;\n\t\t// const oldIndex = geom.getIndex();\n\t\t// let ind = buffers.indexOf(oldIndex);\n\t\t// if (ind >= 0) {\n\t\t// \tbuffers.splice(ind, 1);\n\t\t// }\n\t\t// geom.addIndex(indexBuf);\n\t// }\n\n\tgetShader(): TilemapShader {\n\t\treturn this.rectShader;\n\t}\n\n\tdestroy() {\n\t\tsuper.destroy();\n\t\t// this.rectShader.destroy();\n\t\tthis.rectShader = null;\n\t}\n}\n\nRenderer.registerPlugin('tilemap', TileRenderer as any);\n","/// \n\nimport { Container } from '@pixi/display';\n\nimport type { CompositeRectTileLayer } from './CompositeRectTileLayer';\nimport type { Matrix } from '@pixi/math';\n\nexport class ZLayer extends Container {\n\n constructor(tilemap: Container, zIndex: number) {\n super();\n this.tilemap = tilemap;\n this.z = zIndex;\n }\n\n tilemap: any;\n z: number;\n zIndex: number;\n _previousLayers: number;\n canvasBuffer: HTMLCanvasElement;\n _tempRender: any;\n _lastAnimationFrame: number = -1;\n layerTransform: Matrix;\n\n clear() {\n let layers = this.children as Array;\n for (let i = 0; i < layers.length; i++)\n layers[i].clear();\n this._previousLayers = 0;\n }\n\n cacheIfDirty() {\n let tilemap: any = this.tilemap;\n let layers = this.children as Array;\n let modified = this._previousLayers !== layers.length;\n this._previousLayers = layers.length;\n let buf = this.canvasBuffer;\n let tempRender = this._tempRender;\n if (!buf) {\n buf = this.canvasBuffer = document.createElement('canvas');\n tempRender = this._tempRender = new (PIXI as any).CanvasRenderer({width: 100, height: 100, view: buf});\n tempRender.context = tempRender.rootContext;\n tempRender.plugins.tilemap.dontUseTransform = true;\n }\n if (buf.width !== tilemap._layerWidth ||\n buf.height !== tilemap._layerHeight) {\n buf.width = tilemap._layerWidth;\n buf.height = tilemap._layerHeight;\n modified = true;\n }\n let i: number;\n if (!modified) {\n for (i = 0; i < layers.length; i++) {\n if (layers[i].isModified(this._lastAnimationFrame !== tilemap.animationFrame)) {\n modified = true;\n break;\n }\n }\n }\n this._lastAnimationFrame = tilemap.animationFrame;\n if (modified) {\n if (tilemap._hackRenderer) {\n tilemap._hackRenderer(tempRender);\n }\n tempRender.context.clearRect(0, 0, buf.width, buf.height);\n for (i = 0; i < layers.length; i++) {\n layers[i].clearModify();\n layers[i].renderCanvas(tempRender);\n }\n }\n this.layerTransform = this.worldTransform;\n for (i = 0; i < layers.length; i++) {\n this.layerTransform = layers[i].worldTransform;\n break;\n }\n }\n\n renderCanvas(renderer: any) {\n this.cacheIfDirty();\n let wt = this.layerTransform;\n renderer.context.setTransform(\n wt.a,\n wt.b,\n wt.c,\n wt.d,\n wt.tx * renderer.resolution,\n wt.ty * renderer.resolution\n );\n let tilemap = this.tilemap;\n renderer.context.drawImage(this.canvasBuffer, 0, 0);\n }\n}\n","/// \n\nnamespace pixi_tilemap {\n (PIXI as any).tilemap = pixi_tilemap;\n}\n\n// This makes exporter.ts a module!\nexport default {}\n","import { CanvasTileRenderer } from './CanvasTileRenderer';\nimport { CompositeRectTileLayer } from './CompositeRectTileLayer';\nimport { Constant } from './Constant';\nimport { GraphicsLayer } from './GraphicsLayer';\nimport { MultiTextureResource } from './MultiTextureResource';\nimport { RectTileLayer } from './RectTileLayer';\nimport { TilemapShader, RectTileShader, RectTileGeom } from './RectTileShader';\nimport { TileRenderer } from './TileRenderer';\nimport { ZLayer } from './ZLayer';\n\nexport const pixi_tilemap = {\n CanvasTileRenderer,\n CompositeRectTileLayer,\n Constant,\n GraphicsLayer,\n MultiTextureResource,\n RectTileLayer,\n TilemapShader,\n RectTileShader,\n RectTileGeom,\n TileRenderer,\n ZLayer,\n};\n\nexport * from './CanvasTileRenderer';\nexport * from './CompositeRectTileLayer';\nexport * from './Constant';\nexport * from './exporter';\nexport * from './GraphicsLayer';\nexport * from './MultiTextureResource';\nexport * from './RectTileLayer';\nexport * from './RectTileShader';\nexport * from './shaderGenerator';\nexport * from './TileRenderer';\nexport * from './ZLayer';"],"names":["SCALE_MODES","Container","Bounds","Texture","groupD8","DRAW_MODES","Graphics","Matrix","resources","Sprite","ALPHA_MODES","Shader","Program","shaderGenerator.fillSamplers","shaderGenerator.generateFragmentSrc","Geometry","Buffer","ObjectRenderer","BaseTexture","WRAP_MODES","Renderer","pixi_tilemap"],"mappings":";;;;;;;;;;;;;;;;;;;UAIa,kBAAkB;QAK3B,YAAY,QAAkB;YAH9B,aAAQ,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;YAClB,qBAAgB,GAAG,KAAK,CAAC;YAGrB,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;YACzB,IAAI,CAAC,QAAQ,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;SAC1B;KACJ;IAED,MAAM,EAAE,GAAI,IAAY,CAAC,cAAc,CA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,YAAY,CAAC,QAAa;YACtB,IAAI,CAAC,YAAY,EAAE,CAAC;YACpB,IAAI,EAAE,GAAG,IAAI,CAAC,cAAc,CAAC;YAC7B,QAAQ,CAAC,OAAO,CAAC,YAAY,CACzB,EAAE,CAAC,CAAC,EACJ,EAAE,CAAC,CAAC,EACJ,EAAE,CAAC,CAAC,EACJ,EAAE,CAAC,CAAC,EACJ,EAAE,CAAC,EAAE,GAAG,QAAQ,CAAC,UAAU,EAC3B,EAAE,CAAC,EAAE,GAAG,QAAQ,CAAC,UAAU,CAC9B,CAAC;YACF,IAAI,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC;YAC3B,QAAQ,CAAC,OAAO,CAAC,SAAS,CAAC,IAAI,CAAC,YAAY,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;SACvD;;;ICxFL,IAAU,YAAY,CAErB;IAFD,WAAU,YAAY;QACjB,IAAY,CAAC,OAAO,GAAG,YAAY,CAAC;IACzC,CAAC,EAFS,YAAY,KAAZ,YAAY,QAErB;AAGD,mBAAe,EAAE;;UCGJoB,cAAY,GAAG;QACxB,kBAAkB;QAClB,sBAAsB;QACtB,QAAQ;QACR,aAAa;QACb,oBAAoB;QACpB,aAAa;QACb,aAAa;QACb,cAAc;QACd,YAAY;QACZ,YAAY;QACZ,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"} \ No newline at end of file diff --git a/package.json b/package.json index e4d9e566..e4509723 100644 --- a/package.json +++ b/package.json @@ -59,7 +59,7 @@ "jsdoc": "^3.4.0", "mkdirp": "^0.5.1", "parallelshell": "^2.0.0", - "pixi.js": "^5.3.3", + "pixi.js": "^5.3.3", "rimraf": "^2.5.3", "rollup": "^2.23.1", "rollup-plugin-sourcemaps": "^0.6.2", diff --git a/yarn.lock b/yarn.lock index 2e7bd7ba..9ab4cb30 100644 --- a/yarn.lock +++ b/yarn.lock @@ -63,9 +63,9 @@ integrity sha512-mDJyuxRKZaSuKqB2mUyyh7S8/bzFh510blMfKwq3Wwvjxdqsgb7TMkLm9mY1rvJ6gNr4WvFBuTIlIKOyTH1y4g== "@pixi-build-tools/rollup-configurator@^1.0.3": - version "1.0.4" - resolved "https://registry.yarnpkg.com/@pixi-build-tools/rollup-configurator/-/rollup-configurator-1.0.4.tgz#09f6049767198f579f97d7112bb555e933e20afc" - integrity sha512-q+VtWbsvrL7y37SK4pZt+5sSijk2nGUpxAB7uyU8WtC5AtQm1TDul5sBEUp+Lyl2wPnG2bCYfqIvgPm2qGDxvg== + version "1.0.5" + resolved "https://registry.yarnpkg.com/@pixi-build-tools/rollup-configurator/-/rollup-configurator-1.0.5.tgz#3994d41b06c4961d28323419fd840be6a74411db" + integrity sha512-6dr4eWUfK+dl4llrlzKCMR6c4/EVgFPk/CVR3v5a3K947puf/54Jm6elp1R8NMY6cmVFIpT2+5ATIs7Lta8yNQ== dependencies: "@pixi-build-tools/globals" "~1.0.2" "@rollup/plugin-commonjs" "~15.0.0" @@ -474,9 +474,9 @@ integrity sha512-EYNwp3bU+98cpU4lAWYYL7Zz+2gryWH1qbdDTidVd6hkiR6weksdbMadyXKXNPEkQFhXM+hVO9ZygomHXp+AIw== "@types/node@*": - version "14.6.0" - resolved "https://registry.yarnpkg.com/@types/node/-/node-14.6.0.tgz#7d4411bf5157339337d7cff864d9ff45f177b499" - integrity sha512-mikldZQitV94akrc4sCcSjtJfsTKt4p+e/s0AGscVA6XArQ9kFclP+ZiYUMnq987rc6QlYxXv/EivqlfSLxpKA== + version "14.6.2" + resolved "https://registry.yarnpkg.com/@types/node/-/node-14.6.2.tgz#264b44c5a28dfa80198fc2f7b6d3c8a054b9491f" + integrity sha512-onlIwbaeqvZyniGPfdw/TEhKIh79pz66L1q06WUQqJLnAb6wbjvOtepLYTGHTqzdXgBYIE3ZdmqHDGsRsbBz7A== "@types/node@10.17.13": version "10.17.13" @@ -1122,7 +1122,7 @@ rollup-plugin-string@~3.0.0: dependencies: rollup-pluginutils "^2.4.1" -rollup-plugin-terser@^7.0.0, rollup-plugin-terser@~7.0.0: +rollup-plugin-terser@^7.0.0: version "7.0.0" resolved "https://registry.yarnpkg.com/rollup-plugin-terser/-/rollup-plugin-terser-7.0.0.tgz#26b38ada4f0b351cd7cd872ca04c0f8532d4864f" integrity sha512-p/N3lLiFusCjYTLfVkoaiRTOGr5AESEaljMPH12MhOtoMkmTBhIAfuadrcWy4am1U0vU4WTxO9fi0K09O4CboQ== @@ -1132,6 +1132,16 @@ rollup-plugin-terser@^7.0.0, rollup-plugin-terser@~7.0.0: serialize-javascript "^4.0.0" terser "^5.0.0" +rollup-plugin-terser@~7.0.0: + version "7.0.1" + resolved "https://registry.yarnpkg.com/rollup-plugin-terser/-/rollup-plugin-terser-7.0.1.tgz#df72d8272e03fcb504a76f414b9509c63c5eaf54" + integrity sha512-HL0dgzSxBYG/Ly9i/E5Sc+PuKKZ0zBzk11VmLCfdUtpqH4yYqkLclPkTqRy85FU9246yetImOClaQ/ufnj08vg== + dependencies: + "@babel/code-frame" "^7.10.4" + jest-worker "^26.2.1" + serialize-javascript "^4.0.0" + terser "^5.0.0" + rollup-plugin-typescript@^1.0.1, rollup-plugin-typescript@~1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/rollup-plugin-typescript/-/rollup-plugin-typescript-1.0.1.tgz#86565033b714c3d1f3aba510aad3dc519f7091e9" @@ -1220,9 +1230,9 @@ supports-color@^5.3.0: has-flag "^3.0.0" supports-color@^7.0.0: - version "7.1.0" - resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-7.1.0.tgz#68e32591df73e25ad1c4b49108a2ec507962bfd1" - integrity sha512-oRSIpR8pxT1Wr2FquTNnGet79b3BWljqOuoW/h4oBhxJ/HUbX5nX6JSruTkvXDCFMwDPvsaTTbvMLKZWSy0R5g== + version "7.2.0" + resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-7.2.0.tgz#1b7dcdcb32b8138801b3e478ba6a51caa89648da" + integrity sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw== dependencies: has-flag "^4.0.0" From 37a85bd64acf9eee2e99a3a3784fbc5cf46cff32 Mon Sep 17 00:00:00 2001 From: Shukant Pal Date: Sun, 30 Aug 2020 16:46:19 -0400 Subject: [PATCH 2/2] Remove exporter.ts --- dist/pixi-tilemap.umd.js | 12 +++--------- dist/pixi-tilemap.umd.js.map | 2 +- index.d.ts | 1 - src/exporter.ts | 8 -------- src/index.ts | 1 - 5 files changed, 4 insertions(+), 20 deletions(-) delete mode 100644 src/exporter.ts diff --git a/dist/pixi-tilemap.umd.js b/dist/pixi-tilemap.umd.js index 72ba5e0b..0d4c7d0b 100644 --- a/dist/pixi-tilemap.umd.js +++ b/dist/pixi-tilemap.umd.js @@ -2,7 +2,7 @@ /*! * pixi-tilemap - v2.1.2 - * Compiled Sun, 30 Aug 2020 20:43:34 UTC + * Compiled Sun, 30 Aug 2020 20:45:56 UTC * * pixi-tilemap is licensed under the MIT License. * http://www.opensource.org/licenses/mit-license @@ -928,13 +928,7 @@ void main(void){ } } - var pixi_tilemap; - (function (pixi_tilemap) { - PIXI.tilemap = pixi_tilemap; - })(pixi_tilemap || (pixi_tilemap = {})); - var exporter = {}; - - const pixi_tilemap$1 = { + const pixi_tilemap = { CanvasTileRenderer, CompositeRectTileLayer, Constant, @@ -963,7 +957,7 @@ void main(void){ exports.fillSamplers = fillSamplers; exports.generateFragmentSrc = generateFragmentSrc; exports.generateSampleSrc = generateSampleSrc; - exports.pixi_tilemap = pixi_tilemap$1; + exports.pixi_tilemap = pixi_tilemap; Object.defineProperty(exports, '__esModule', { value: true }); diff --git a/dist/pixi-tilemap.umd.js.map b/dist/pixi-tilemap.umd.js.map index 256d829f..bb81f828 100644 --- a/dist/pixi-tilemap.umd.js.map +++ b/dist/pixi-tilemap.umd.js.map @@ -1 +1 @@ -{"version":3,"file":"pixi-tilemap.umd.js","sources":["../src/CanvasTileRenderer.ts","../src/Constant.ts","../src/RectTileLayer.ts","../src/CompositeRectTileLayer.ts","../src/GraphicsLayer.ts","../src/MultiTextureResource.ts","../src/shaderGenerator.ts","../src/RectTileShader.ts","../src/TileRenderer.ts","../src/ZLayer.ts","../src/exporter.ts","../src/index.ts"],"sourcesContent":["/// \n\nimport { Renderer } from '@pixi/core';\n\nexport class CanvasTileRenderer {\n renderer: Renderer;\n tileAnim = [0, 0];\n dontUseTransform = false;\n\n constructor(renderer: Renderer) {\n this.renderer = renderer;\n this.tileAnim = [0, 0];\n }\n}\n\nconst cr = (PIXI as any).CanvasRenderer;\n\nif (cr) {\n cr.registerPlugin('tilemap', CanvasTileRenderer);\n}\n","/// \n\nimport { SCALE_MODES } from '@pixi/constants';\n\nexport const Constant = {\n maxTextures: 16,\n bufferSize: 2048,\n boundSize: 1024,\n boundCountPerBuffer: 1,\n use32bitIndex: false,\n SCALE_MODE: SCALE_MODES.LINEAR,\n DO_CLEAR: true\n};","/// \n\nimport { Container, Bounds } from '@pixi/display';\nimport { Constant } from './Constant';\nimport { DRAW_MODES } from '@pixi/constants';\nimport { Texture, Renderer } from '@pixi/core';\nimport { TileRenderer } from './TileRenderer';\nimport { Matrix, Rectangle, groupD8 } from '@pixi/math';\n\nimport type { RectTileGeom } from './RectTileShader';\n\nexport const POINT_STRUCT_SIZE = 12;\n\nexport class RectTileLayer extends Container {\n constructor(zIndex: number, texture: Texture | Array) {\n super();\n this.initialize(zIndex, texture);\n }\n\n zIndex = 0;\n modificationMarker = 0;\n _$_localBounds = new Bounds();\n shadowColor = new Float32Array([0.0, 0.0, 0.0, 0.5]);\n _globalMat: Matrix = null;\n\n pointsBuf: Array = [];\n hasAnim = false;\n textures: Array;\n\n offsetX = 0;\n offsetY = 0;\n compositeParent = false;\n\n initialize(zIndex: number, textures: Texture | Array) {\n if (!textures) {\n textures = [];\n } else if (!(textures instanceof Array) && (textures as Texture).baseTexture) {\n textures = [textures as Texture];\n }\n this.textures = textures as Array;\n this.zIndex = zIndex;\n // this.visible = false;\n }\n\n clear() {\n this.pointsBuf.length = 0;\n this.modificationMarker = 0;\n this._$_localBounds.clear();\n this.hasAnim = false;\n }\n\n addFrame(texture_: Texture | String | number, x: number, y: number, animX: number, animY: number) {\n let texture: Texture;\n let textureIndex = 0;\n\n if (typeof texture_ === \"number\") {\n textureIndex = texture_;\n texture = this.textures[textureIndex];\n } else {\n if (typeof texture_ === \"string\") {\n texture = Texture.from(texture_);\n } else {\n texture = texture_ as Texture;\n }\n\n let found = false;\n let textureList = this.textures;\n for (let i = 0; i < textureList.length; i++) {\n if (textureList[i].baseTexture === texture.baseTexture) {\n textureIndex = i;\n found = true;\n break;\n }\n }\n\n if (!found) {\n // textureIndex = this.textures.length;\n // this.textures.push(texture);\n return false;\n }\n }\n\n this.addRect(textureIndex, texture.frame.x, texture.frame.y, x, y, texture.orig.width, texture.orig.height, animX, animY, texture.rotate);\n return true;\n }\n\n addRect(textureIndex: number, u: number, v: number, x: number, y: number, tileWidth: number, tileHeight: number,\n animX: number = 0, animY: number = 0, rotate: number = 0, animCountX: number = 1024, animCountY: number = 1024): this {\n let pb = this.pointsBuf;\n this.hasAnim = this.hasAnim || animX > 0 || animY > 0;\n pb.push(u);\n pb.push(v);\n pb.push(x);\n pb.push(y);\n pb.push(tileWidth);\n pb.push(tileHeight);\n pb.push(rotate);\n pb.push(animX | 0);\n pb.push(animY | 0);\n pb.push(textureIndex);\n pb.push(animCountX);\n pb.push(animCountY);\n\n this._$_localBounds.addFramePad(x, y, x+tileWidth, y+tileHeight, 0, 0);\n\n return this;\n }\n\n tileRotate(rotate: number) {\n const pb = this.pointsBuf;\n pb[pb.length - 3] = rotate;\n }\n\n tileAnimX(offset: number, count: number) {\n const pb = this.pointsBuf;\n\n pb[pb.length - 5] = offset;\n pb[pb.length - 2] = count;\n }\n\n tileAnimY(offset: number, count: number) {\n const pb = this.pointsBuf;\n\n pb[pb.length - 4] = offset;\n pb[pb.length - 1] = count;\n }\n\n renderCanvas(renderer: any) {\n let plugin = renderer.plugins.tilemap;\n if (!plugin.dontUseTransform) {\n let wt = this.worldTransform;\n renderer.context.setTransform(\n wt.a,\n wt.b,\n wt.c,\n wt.d,\n wt.tx * renderer.resolution,\n wt.ty * renderer.resolution\n );\n }\n this.renderCanvasCore(renderer);\n }\n\n renderCanvasCore(renderer: any) {\n if (this.textures.length === 0) return;\n let points = this.pointsBuf;\n renderer.context.fillStyle = '#000000';\n for (let i = 0, n = points.length; i < n; i += POINT_STRUCT_SIZE) {\n let x1 = points[i], y1 = points[i + 1];\n let x2 = points[i + 2], y2 = points[i + 3];\n let w = points[i + 4];\n let h = points[i + 5];\n var rotate = points[i + 6];\n x1 += points[i + 7] * renderer.plugins.tilemap.tileAnim[0];\n y1 += points[i + 8] * renderer.plugins.tilemap.tileAnim[1];\n let textureIndex = points[i + 9];\n // canvas does not work with rotate yet\n if (textureIndex >= 0) {\n renderer.context.drawImage((this.textures[textureIndex].baseTexture as any).getDrawableSource(), x1, y1, w, h, x2, y2, w, h);\n } else {\n renderer.context.globalAlpha = 0.5;\n renderer.context.fillRect(x2, y2, w, h);\n renderer.context.globalAlpha = 1;\n }\n }\n }\n\n vbId = 0;\n vb: RectTileGeom = null;\n vbBuffer: ArrayBuffer = null;\n vbArray: Float32Array = null;\n vbInts: Uint32Array = null;\n\n destroyVb() {\n if (this.vb) {\n this.vb.destroy();\n this.vb = null;\n }\n }\n\n render(renderer: Renderer) {\n let plugin = (renderer.plugins as any)['tilemap'];\n let shader = plugin.getShader();\n renderer.batch.setObjectRenderer(plugin);\n this._globalMat = shader.uniforms.projTransMatrix;\n renderer.globalUniforms.uniforms.projectionMatrix.copyTo(this._globalMat).append(this.worldTransform);\n shader.uniforms.shadowColor = this.shadowColor;\n shader.uniforms.animationFrame = plugin.tileAnim;\n this.renderWebGLCore(renderer, plugin);\n }\n\n renderWebGLCore(renderer: Renderer, plugin: TileRenderer) {\n let points = this.pointsBuf;\n if (points.length === 0) return;\n let rectsCount = points.length / POINT_STRUCT_SIZE;\n\n let shader = plugin.getShader();\n let textures = this.textures;\n if (textures.length === 0) return;\n\n plugin.bindTextures(renderer, shader, textures);\n renderer.shader.bind(shader, false);\n\n //lost context! recover!\n let vb = this.vb;\n if (!vb) {\n vb = plugin.createVb();\n this.vb = vb;\n this.vbId = (vb as any).id;\n this.vbBuffer = null;\n this.modificationMarker = 0;\n }\n\n plugin.checkIndexBuffer(rectsCount, vb);\n const boundCountPerBuffer = Constant.boundCountPerBuffer;\n\n let vertexBuf = vb.getBuffer('aVertexPosition');\n //if layer was changed, re-upload vertices\n let vertices = rectsCount * vb.vertPerQuad;\n if (vertices === 0) return;\n if (this.modificationMarker !== vertices) {\n this.modificationMarker = vertices;\n let vs = vb.stride * vertices;\n if (!this.vbBuffer || this.vbBuffer.byteLength < vs) {\n //!@#$ happens, need resize\n let bk = vb.stride;\n while (bk < vs) {\n bk *= 2;\n }\n this.vbBuffer = new ArrayBuffer(bk);\n this.vbArray = new Float32Array(this.vbBuffer);\n this.vbInts = new Uint32Array(this.vbBuffer);\n vertexBuf.update(this.vbBuffer);\n }\n\n let arr = this.vbArray, ints = this.vbInts;\n //upload vertices!\n let sz = 0;\n //let tint = 0xffffffff;\n let textureId: number = 0;\n let shiftU: number = this.offsetX;\n let shiftV: number = this.offsetY;\n\n //let tint = 0xffffffff;\n let tint = -1;\n for (let i = 0; i < points.length; i += POINT_STRUCT_SIZE) {\n let eps = 0.5;\n if (this.compositeParent) {\n if (boundCountPerBuffer > 1) {\n //TODO: what if its more than 4?\n textureId = (points[i + 9] >> 2);\n shiftU = this.offsetX * (points[i + 9] & 1);\n shiftV = this.offsetY * ((points[i + 9] >> 1) & 1);\n } else {\n textureId = points[i + 9];\n shiftU = 0;\n shiftV = 0;\n }\n }\n let x = points[i + 2], y = points[i + 3];\n let w = points[i + 4], h = points[i + 5];\n let u = points[i] + shiftU, v = points[i + 1] + shiftV;\n let rotate = points[i + 6];\n\n const animX = points[i + 7], animY = points[i + 8];\n const animWidth = points[i + 10] || 1024, animHeight = points[i + 11] || 1024;\n const animXEncoded = animX + (animWidth * 2048);\n const animYEncoded = animY + (animHeight * 2048);\n\n let u0: number, v0: number, u1: number, v1: number, u2: number, v2: number, u3: number, v3: number;\n if (rotate === 0) {\n u0 = u;\n v0 = v;\n u1 = u + w;\n v1 = v;\n u2 = u + w;\n v2 = v + h;\n u3 = u;\n v3 = v + h;\n } else {\n let w2 = w / 2;\n let h2 = h / 2;\n if (rotate % 4 !== 0) {\n w2 = h / 2;\n h2 = w / 2;\n }\n const cX = u + w2;\n const cY = v + h2;\n\n rotate = groupD8.add(rotate, groupD8.NW);\n u0 = cX + (w2 * groupD8.uX(rotate));\n v0 = cY + (h2 * groupD8.uY(rotate));\n\n rotate = groupD8.add(rotate, 2); // rotate 90 degrees clockwise\n u1 = cX + (w2 * groupD8.uX(rotate));\n v1 = cY + (h2 * groupD8.uY(rotate));\n\n rotate = groupD8.add(rotate, 2);\n u2 = cX + (w2 * groupD8.uX(rotate));\n v2 = cY + (h2 * groupD8.uY(rotate));\n\n rotate = groupD8.add(rotate, 2);\n u3 = cX + (w2 * groupD8.uX(rotate));\n v3 = cY + (h2 * groupD8.uY(rotate));\n }\n\n arr[sz++] = x;\n arr[sz++] = y;\n arr[sz++] = u0;\n arr[sz++] = v0;\n arr[sz++] = u + eps;\n arr[sz++] = v + eps;\n arr[sz++] = u + w - eps;\n arr[sz++] = v + h - eps;\n arr[sz++] = animXEncoded;\n arr[sz++] = animYEncoded;\n arr[sz++] = textureId;\n arr[sz++] = x + w;\n arr[sz++] = y;\n arr[sz++] = u1;\n arr[sz++] = v1;\n arr[sz++] = u + eps;\n arr[sz++] = v + eps;\n arr[sz++] = u + w - eps;\n arr[sz++] = v + h - eps;\n arr[sz++] = animXEncoded;\n arr[sz++] = animYEncoded;\n arr[sz++] = textureId;\n arr[sz++] = x + w;\n arr[sz++] = y + h;\n arr[sz++] = u2;\n arr[sz++] = v2;\n arr[sz++] = u + eps;\n arr[sz++] = v + eps;\n arr[sz++] = u + w - eps;\n arr[sz++] = v + h - eps;\n arr[sz++] = animXEncoded;\n arr[sz++] = animYEncoded;\n arr[sz++] = textureId;\n arr[sz++] = x;\n arr[sz++] = y + h;\n arr[sz++] = u3;\n arr[sz++] = v3;\n arr[sz++] = u + eps;\n arr[sz++] = v + eps;\n arr[sz++] = u + w - eps;\n arr[sz++] = v + h - eps;\n arr[sz++] = animXEncoded;\n arr[sz++] = animYEncoded;\n arr[sz++] = textureId;\n }\n\n vertexBuf.update(arr);\n }\n\n (renderer.geometry as any).bind(vb, shader);\n renderer.geometry.draw(DRAW_MODES.TRIANGLES, rectsCount * 6, 0);\n }\n\n isModified(anim: boolean) {\n if (this.modificationMarker !== this.pointsBuf.length ||\n anim && this.hasAnim) {\n return true;\n }\n return false;\n }\n\n clearModify() {\n this.modificationMarker = this.pointsBuf.length;\n }\n\n protected _calculateBounds(): void\n {\n const { minX, minY, maxX, maxY } = this._$_localBounds;\n\n this._bounds.addFrame(this.transform, minX, minY, maxX, maxY);\n }\n\n public getLocalBounds(rect?: Rectangle): Rectangle\n {\n // we can do a fast local bounds if the sprite has no children!\n if (this.children.length === 0)\n {\n return this._$_localBounds.getRectangle(rect);\n }\n\n return super.getLocalBounds.call(this, rect);\n }\n\n destroy(options?: any) {\n super.destroy(options);\n this.destroyVb();\n }\n}\n","/// \n\nimport { Container } from '@pixi/display';\nimport { Texture, Renderer } from '@pixi/core';\nimport { Matrix } from '@pixi/math';\nimport { Constant } from './Constant';\nimport { RectTileLayer } from './RectTileLayer';\n\nexport class CompositeRectTileLayer extends Container {\n constructor(zIndex?: number, bitmaps?: Array, texPerChild?: number) {\n super();\n this.initialize.apply(this, arguments);\n }\n\n z: number;\n zIndex: number;\n modificationMarker = 0;\n shadowColor = new Float32Array([0.0, 0.0, 0.0, 0.5]);\n _globalMat: Matrix = null;\n _lastLayer: RectTileLayer = null;\n\n texPerChild: number;\n\n initialize(zIndex?: number, bitmaps?: Array, texPerChild?: number) {\n if (texPerChild as any === true) {\n //old format, ignore it!\n texPerChild = 0;\n }\n this.z = this.zIndex = zIndex;\n this.texPerChild = texPerChild || Constant.boundCountPerBuffer * Constant.maxTextures;\n if (bitmaps) {\n this.setBitmaps(bitmaps);\n }\n }\n\n setBitmaps(bitmaps: Array) {\n for (let i=0;i 5.2.1, it does not exist there.`);\n }\n }\n let texPerChild = this.texPerChild;\n let len1 = this.children.length;\n let len2 = Math.ceil(bitmaps.length / texPerChild);\n let i: number;\n for (i = 0; i < len1; i++) {\n (this.children[i] as RectTileLayer).textures = bitmaps.slice(i * texPerChild, (i + 1) * texPerChild);\n }\n for (i = len1; i < len2; i++) {\n let layer = new RectTileLayer(this.zIndex, bitmaps.slice(i * texPerChild, (i + 1) * texPerChild));\n layer.compositeParent = true;\n layer.offsetX = Constant.boundSize;\n layer.offsetY = Constant.boundSize;\n this.addChild(layer);\n }\n }\n\n clear() {\n for (let i = 0; i < this.children.length; i++) {\n (this.children[i] as RectTileLayer).clear();\n }\n this.modificationMarker = 0;\n }\n\n addRect(textureIndex: number, u: number, v: number, x: number, y: number, tileWidth: number, tileHeight: number, animX?: number, animY?: number, rotate?: number, animWidth?: number, animHeight?: number): this {\n const childIndex: number = textureIndex / this.texPerChild >> 0;\n const textureId: number = textureIndex % this.texPerChild;\n\n if (this.children[childIndex] && (this.children[childIndex] as RectTileLayer).textures) {\n this._lastLayer = (this.children[childIndex] as RectTileLayer);\n this._lastLayer.addRect(textureId, u, v, x, y, tileWidth, tileHeight, animX, animY, rotate, animWidth, animHeight);\n } else {\n this._lastLayer = null;\n }\n\n return this;\n }\n\n tileRotate(rotate: number): this {\n if (this._lastLayer)\n {\n this._lastLayer.tileRotate(rotate);\n }\n return this;\n }\n\n tileAnimX(offset: number, count: number): this {\n if (this._lastLayer)\n {\n this._lastLayer.tileAnimX(offset, count);\n }\n return this;\n }\n\n tileAnimY(offset: number, count: number): this {\n if (this._lastLayer)\n {\n this._lastLayer.tileAnimY(offset, count);\n }\n return this;\n }\n\n addFrame(texture_: Texture | String | number, x: number, y: number, animX?: number, animY?: number, animWidth?: number, animHeight?: number): this {\n let texture: Texture;\n let layer: RectTileLayer = null;\n let ind: number = 0;\n let children = this.children;\n\n this._lastLayer = null;\n if (typeof texture_ === \"number\") {\n let childIndex = texture_ / this.texPerChild >> 0;\n layer = children[childIndex] as RectTileLayer;\n\n if (!layer) {\n layer = children[0] as RectTileLayer;\n if (!layer) {\n return this;\n }\n ind = 0;\n } else {\n ind = texture_ % this.texPerChild;\n }\n\n texture = layer.textures[ind];\n } else {\n if (typeof texture_ === \"string\") {\n texture = Texture.from(texture_);\n } else {\n texture = texture_ as Texture;\n }\n\n for (let i = 0; i < children.length; i++) {\n let child = children[i] as RectTileLayer;\n let tex = child.textures;\n for (let j = 0; j < tex.length; j++) {\n if (tex[j].baseTexture === texture.baseTexture) {\n layer = child;\n ind = j;\n break;\n }\n }\n if (layer) {\n break;\n }\n }\n\n if (!layer) {\n for (let i = 0; i < children.length; i++) {\n let child = children[i] as RectTileLayer;\n if (child.textures.length < this.texPerChild) {\n layer = child;\n ind = child.textures.length;\n child.textures.push(texture);\n break;\n }\n }\n if (!layer) {\n layer = new RectTileLayer(this.zIndex, texture);\n layer.compositeParent = true;\n layer.offsetX = Constant.boundSize;\n layer.offsetY = Constant.boundSize;\n this.addChild(layer);\n ind = 0;\n }\n }\n }\n\n this._lastLayer = layer;\n layer.addRect(ind, texture.frame.x, texture.frame.y, x, y, texture.orig.width, texture.orig.height, animX, animY, texture.rotate, animWidth, animHeight);\n return this;\n }\n\n renderCanvas(renderer: any) {\n if (!this.visible || this.worldAlpha <= 0 || !this.renderable) {\n return;\n }\n let plugin = renderer.plugins.tilemap;\n if (!plugin.dontUseTransform) {\n let wt = this.worldTransform;\n renderer.context.setTransform(\n wt.a,\n wt.b,\n wt.c,\n wt.d,\n wt.tx * renderer.resolution,\n wt.ty * renderer.resolution\n );\n }\n let layers = this.children;\n for (let i = 0; i < layers.length; i++) {\n (layers[i] as RectTileLayer).renderCanvasCore(renderer);\n }\n }\n\n render(renderer: Renderer) {\n if (!this.visible || this.worldAlpha <= 0 || !this.renderable) {\n return;\n }\n let plugin = (renderer.plugins as any)['tilemap'];\n let shader = plugin.getShader();\n renderer.batch.setObjectRenderer(plugin);\n //TODO: dont create new array, please\n this._globalMat = shader.uniforms.projTransMatrix;\n renderer.globalUniforms.uniforms.projectionMatrix.copyTo(this._globalMat).append(this.worldTransform);\n shader.uniforms.shadowColor = this.shadowColor;\n shader.uniforms.animationFrame = plugin.tileAnim;\n renderer.shader.bind(shader, false);\n let layers = this.children;\n for (let i = 0; i < layers.length; i++) {\n (layers[i] as RectTileLayer).renderWebGLCore(renderer, plugin);\n }\n }\n\n isModified(anim: boolean) {\n let layers = this.children;\n if (this.modificationMarker !== layers.length) {\n return true;\n }\n for (let i = 0; i < layers.length; i++) {\n if ((layers[i] as RectTileLayer).isModified(anim)) {\n return true;\n }\n }\n return false;\n }\n\n clearModify() {\n let layers = this.children;\n this.modificationMarker = layers.length;\n for (let i = 0; i < layers.length; i++) {\n (layers[i] as RectTileLayer).clearModify();\n }\n }\n}\n","/// \n\nimport { Matrix } from '@pixi/math';\nimport { Graphics } from '@pixi/graphics';\n\nexport class GraphicsLayer extends Graphics {\n constructor(zIndex: number) {\n super();\n this.zIndex = zIndex;\n }\n\n renderCanvas(renderer: any) {\n let wt: Matrix = null;\n if (renderer.plugins.tilemap.dontUseTransform) {\n wt = this.transform.worldTransform;\n this.transform.worldTransform = Matrix.IDENTITY;\n }\n renderer.plugins.graphics.render(this);\n if (renderer.plugins.tilemap.dontUseTransform) {\n this.transform.worldTransform = wt;\n }\n renderer.context.globalAlpha = 1.0;\n }\n\n // renderWebGL(renderer: PIXI.Renderer) {\n // if (!this._webGL[renderer.CONTEXT_UID])\n // this.dirty++;\n // super.renderWebGL(renderer)\n // }\n\n isModified(anim: boolean): boolean {\n return false;\n }\n\n clearModify() {\n }\n}\n","/// \n\nimport { ALPHA_MODES } from '@pixi/constants';\nimport { BaseTexture, Renderer, Texture, GLTexture, resources } from '@pixi/core';\nimport { Sprite } from '@pixi/sprite';\nimport { Constant } from './Constant';\n\nexport interface IMultiTextureOptions {\n\tboundCountPerBuffer: number;\n\tboundSize: number;\n\tbufferSize: number;\n\tDO_CLEAR?: boolean;\n}\n\nexport class MultiTextureResource extends resources.Resource {\n\tconstructor(options: IMultiTextureOptions) {\n\t\tsuper(options.bufferSize, options.bufferSize);\n\n\t\tconst bounds = this.boundSprites;\n\t\tconst dirties = this.dirties;\n\t\tthis.boundSize = options.boundSize;\n\t\tfor (let j = 0; j < options.boundCountPerBuffer; j++) {\n\t\t\tconst spr = new Sprite();\n\t\t\tspr.position.x = options.boundSize * (j & 1);\n\t\t\tspr.position.y = options.boundSize * (j >> 1);\n\t\t\tbounds.push(spr);\n\t\t\tdirties.push(0);\n\t\t}\n\t\tthis.DO_CLEAR = !!options.DO_CLEAR;\n\t}\n\n\tDO_CLEAR = false;\n\tboundSize: number = 0;\n\t_clearBuffer: Uint8Array = null;\n\n\tbind(baseTexture: BaseTexture) {\n\t\tif (this.baseTex) {\n\t\t\tthrow new Error('Only one baseTexture is allowed for this resource!')\n\t\t}\n\t\tthis.baseTex = baseTexture;\n\t\tsuper.bind(baseTexture);\n\t}\n\n\tbaseTex: BaseTexture = null;\n\tboundSprites: Array = [];\n\tdirties: Array = [];\n\n\tsetTexture(ind: number, texture: Texture) {\n\t\tconst spr = this.boundSprites[ind];\n\t\tif (spr.texture.baseTexture === texture.baseTexture) {\n\t\t\treturn;\n\t\t}\n\t\tspr.texture = texture;\n\t\tthis.baseTex.update();\n\t\tthis.dirties[ind] = (this.baseTex as any).dirtyId;\n\t}\n\n\tupload(renderer: Renderer, texture: BaseTexture, glTexture: GLTexture) {\n\t\tconst { gl } = renderer as any;\n\n\t\tconst {width, height} = this;\n\t\tgl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, texture.alphaMode === undefined ||\n\t\t\ttexture.alphaMode === ALPHA_MODES.UNPACK);\n\n\t\tif (glTexture.dirtyId < 0) {\n\t\t\t(glTexture as any).width = width;\n\t\t\t(glTexture as any).height = height;\n\n\t\t\tgl.texImage2D(texture.target, 0,\n\t\t\t\ttexture.format,\n\t\t\t\twidth,\n\t\t\t\theight,\n\t\t\t\t0,\n\t\t\t\ttexture.format,\n\t\t\t\ttexture.type,\n\t\t\t\tnull);\n\t\t}\n\n\t\tconst doClear = this.DO_CLEAR;\n\t\tif (doClear && !this._clearBuffer) {\n\t\t\tthis._clearBuffer = new Uint8Array(Constant.boundSize * Constant.boundSize * 4);\n\t\t}\n\n\t\tconst bounds = this.boundSprites;\n\t\tfor (let i = 0; i < bounds.length; i++) {\n\t\t\tconst spr = bounds[i];\n\t\t\tconst tex = spr.texture.baseTexture;\n\t\t\tif (glTexture.dirtyId >= this.dirties[i]) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tconst res = tex.resource as any;\n\t\t\tif (!tex.valid || !res || !res.source) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (doClear && (tex.width < this.boundSize || tex.height < this.boundSize))\n\t\t\t{\n\t\t\t\tgl.texSubImage2D(texture.target, 0,\n\t\t\t\t\tspr.position.x,\n\t\t\t\t\tspr.position.y,\n\t\t\t\t\tthis.boundSize,\n\t\t\t\t\tthis.boundSize,\n\t\t\t\t\ttexture.format,\n\t\t\t\t\ttexture.type,\n\t\t\t\t\tthis._clearBuffer);\n\t\t\t}\n\t\t\tgl.texSubImage2D(texture.target, 0,\n\t\t\t\tspr.position.x,\n\t\t\t\tspr.position.y,\n\t\t\t\ttexture.format,\n\t\t\t\ttexture.type,\n\t\t\t\tres.source);\n\t\t}\n\n\t\treturn true;\n\t}\n}\n","import { Constant } from './Constant';\n\nimport type { TilemapShader } from './RectTileShader';\n\n\nexport function fillSamplers(shader: TilemapShader, maxTextures: number) {\n let sampleValues: Array = [];\n for (let i = 0; i < maxTextures; i++)\n {\n sampleValues[i] = i;\n }\n shader.uniforms.uSamplers = sampleValues;\n\n let samplerSize: Array = [];\n for (let i = 0; i < maxTextures; i++) {\n samplerSize.push(1.0 / Constant.bufferSize);\n samplerSize.push(1.0 / Constant.bufferSize);\n }\n shader.uniforms.uSamplerSize = samplerSize;\n}\n\nexport function generateFragmentSrc(maxTextures: number, fragmentSrc: string) {\n return fragmentSrc.replace(/%count%/gi, maxTextures + \"\")\n .replace(/%forloop%/gi, generateSampleSrc(maxTextures));\n}\n\nexport function generateSampleSrc(maxTextures: number) {\n let src = '';\n\n src += '\\n';\n src += '\\n';\n\n src += 'if(vTextureId <= -1.0) {';\n src += '\\n\\tcolor = shadowColor;';\n src += '\\n}';\n\n for (let i = 0; i < maxTextures; i++)\n {\n src += '\\nelse ';\n\n if(i < maxTextures-1)\n {\n src += 'if(textureId == ' + i + '.0)';\n }\n\n src += '\\n{';\n src += '\\n\\tcolor = texture2D(uSamplers['+i+'], textureCoord * uSamplerSize['+i+']);';\n src += '\\n}';\n }\n\n src += '\\n';\n src += '\\n';\n\n return src;\n}\n","/// \n\nimport * as shaderGenerator from './shaderGenerator';\n\nimport { Buffer, Geometry, Shader, Program } from '@pixi/core';\nimport { Matrix } from '@pixi/math';\n\nlet rectShaderFrag = `\nvarying vec2 vTextureCoord;\nvarying vec4 vFrame;\nvarying float vTextureId;\nuniform vec4 shadowColor;\nuniform sampler2D uSamplers[%count%];\nuniform vec2 uSamplerSize[%count%];\n\nvoid main(void){\n vec2 textureCoord = clamp(vTextureCoord, vFrame.xy, vFrame.zw);\n float textureId = floor(vTextureId + 0.5);\n\n vec4 color;\n %forloop%\n gl_FragColor = color;\n}\n`;\nlet rectShaderVert = `\nattribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\nattribute vec4 aFrame;\nattribute vec2 aAnim;\nattribute float aTextureId;\n\nuniform mat3 projTransMatrix;\nuniform vec2 animationFrame;\n\nvarying vec2 vTextureCoord;\nvarying float vTextureId;\nvarying vec4 vFrame;\n\nvoid main(void){\n gl_Position = vec4((projTransMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n vec2 animCount = floor((aAnim + 0.5) / 2048.0);\n vec2 animFrameOffset = aAnim - animCount * 2048.0;\n vec2 animOffset = animFrameOffset * floor(mod(animationFrame + 0.5, animCount));\n\n vTextureCoord = aTextureCoord + animOffset;\n vFrame = aFrame + vec4(animOffset, animOffset);\n vTextureId = aTextureId;\n}\n`;\n\nexport abstract class TilemapShader extends Shader {\n\tmaxTextures = 0;\n\n\tconstructor(maxTextures: number, shaderVert: string, shaderFrag: string) {\n\t\tsuper(\n\t\t\tnew Program(\n\t\t\t\tshaderVert,\n\t\t\t\tshaderFrag),\n\t\t\t{\n\t\t\t\tanimationFrame: new Float32Array(2),\n\t\t\t\tuSamplers: [],\n\t\t\t\tuSamplerSize: [],\n\t\t\t\tprojTransMatrix: new Matrix()\n\t\t\t}\n\t\t);\n\t\tthis.maxTextures = maxTextures;\n\t\tshaderGenerator.fillSamplers(this, this.maxTextures);\n\t}\n}\n\nexport class RectTileShader extends TilemapShader {\n\tconstructor(maxTextures: number) {\n\t\tsuper(\n\t\t\tmaxTextures,\n\t\t\trectShaderVert,\n\t\t\tshaderGenerator.generateFragmentSrc(maxTextures, rectShaderFrag)\n\t\t);\n\t\tshaderGenerator.fillSamplers(this, this.maxTextures);\n\t}\n}\n\nexport class RectTileGeom extends Geometry {\n\tvertSize = 11;\n\tvertPerQuad = 4;\n\tstride = this.vertSize * 4;\n\tlastTimeAccess = 0;\n\n\tconstructor() {\n\t\tsuper();\n\t\tconst buf = this.buf = new Buffer(new Float32Array(2), true, false);\n\t\tthis.addAttribute('aVertexPosition', buf, 0, false, 0, this.stride, 0)\n\t\t\t.addAttribute('aTextureCoord', buf, 0, false, 0, this.stride, 2 * 4)\n\t\t\t.addAttribute('aFrame', buf, 0, false, 0, this.stride, 4 * 4)\n\t\t\t.addAttribute('aAnim', buf, 0, false, 0, this.stride, 8 * 4)\n\t\t\t.addAttribute('aTextureId', buf, 0, false, 0, this.stride, 10 * 4);\n\t}\n\n\tbuf: Buffer;\n}\n","import { WRAP_MODES } from '@pixi/constants';\nimport { BaseTexture, Buffer, resources, ObjectRenderer, Texture, Renderer } from '@pixi/core';\nimport { Constant } from './Constant';\nimport { RectTileGeom, RectTileShader } from './RectTileShader';\nimport { MultiTextureResource } from './MultiTextureResource';\n\nimport type { TilemapShader } from './RectTileShader';\n\n/**\n * Renderer for rectangle tiles.\n */\nexport class TileRenderer extends ObjectRenderer {\n\trenderer: Renderer;\n\tgl: WebGLRenderingContext;\n\tsn: number = -1;\n\tindexBuffer: Buffer = null;\n\tibLen: number = 0;\n\ttileAnim = [0, 0];\n\ttexLoc: Array = [];\n\n\trectShader: RectTileShader;\n\ttexResources: Array = [];\n\n\tconstructor(renderer: Renderer) {\n\t\tsuper(renderer);\n\t\tthis.rectShader = new RectTileShader(Constant.maxTextures);\n\t\tthis.indexBuffer = new Buffer(undefined, true, true);\n\t\tthis.checkIndexBuffer(2000);\n\t\tthis.initBounds();\n\t}\n\n\tinitBounds() {\n\t\tif (Constant.boundCountPerBuffer <= 1) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst maxTextures = Constant.maxTextures;\n\t\tfor (let i = 0; i < maxTextures; i++) {\n\t\t\tconst resource = new MultiTextureResource(Constant);\n\t\t\tconst baseTex = new BaseTexture(resource);\n\t\t\tbaseTex.scaleMode = Constant.SCALE_MODE;\n\t\t\tbaseTex.wrapMode = WRAP_MODES.CLAMP;\n\t\t\tthis.texResources.push(resource);\n\t\t}\n\t}\n\n\tbindTexturesWithoutRT(renderer: Renderer, shader: TilemapShader, textures: Array) {\n\t\tlet samplerSize: Array = (shader as any).uniforms.uSamplerSize;\n\t\tthis.texLoc.length = 0;\n\t\tfor (let i = 0; i < textures.length; i++) {\n\t\t\tconst texture = textures[i];\n\t\t\tif (!texture || !texture.valid) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\trenderer.texture.bind(textures[i], i);\n\t\t\t//TODO: add resolution here\n\t\t\tsamplerSize[i * 2] = 1.0 / textures[i].baseTexture.width;\n\t\t\tsamplerSize[i * 2 + 1] = 1.0 / textures[i].baseTexture.height;\n\t\t}\n\t\t(shader as any).uniforms.uSamplerSize = samplerSize;\n\t}\n\n\tbindTextures(renderer: Renderer, shader: TilemapShader, textures: Array) {\n\t\tconst len = textures.length;\n\t\tconst maxTextures = Constant.maxTextures;\n\t\tif (len > Constant.boundCountPerBuffer * maxTextures) {\n\t\t\treturn;\n\t\t}\n\t\tif (Constant.boundCountPerBuffer <= 1) {\n\t\t\tthis.bindTexturesWithoutRT(renderer, shader, textures);\n\t\t\treturn;\n\t\t}\n\n\t\tlet i = 0;\n\t\tfor (; i < len; i++) {\n\t\t\tconst texture = textures[i];\n\t\t\tif (!texture || !texture.valid) continue;\n\t\t\tconst multi = this.texResources[i >> 2];\n\t\t\tmulti.setTexture(i & 3, texture);\n\t\t}\n\n\t\tlet gltsUsed = (i + 3) >> 2;\n\t\tfor (i = 0; i < gltsUsed; i++) {\n\t\t\t//remove \"i, true\" after resolving a bug\n\t\t\trenderer.texture.bind(this.texResources[i].baseTex, i);\n\t\t}\n\t}\n\n\tstart() {\n\t\t//sorry, nothing\n\t}\n\n\tcreateVb() {\n\t\tconst geom = new RectTileGeom();\n\t\tgeom.addIndex(this.indexBuffer);\n\t\tgeom.lastTimeAccess = Date.now();\n\t\treturn geom;\n\t}\n\n\tcheckIndexBuffer(size: number, vb: RectTileGeom = null) {\n\t\tconst totalIndices = size * 6;\n\n\t\tif (totalIndices <= this.ibLen) {\n\t\t\treturn;\n\t\t}\n\n\t\tlet len = totalIndices;\n\t\twhile (len < totalIndices) {\n\t\t\tlen <<= 1;\n\t\t}\n\n\t\tthis.ibLen = totalIndices;\n\t\tthis.indexBuffer.update((PIXI as any).utils.createIndicesForQuads(size,\n\t\t\tConstant.use32bitIndex ? new Uint32Array(size * 6) : undefined));\n\n\t\t// \tTODO: create new index buffer instead?\n\t\t// if (vb) {\n\t\t// \tconst curIndex = vb.getIndex();\n\t\t// \tif (curIndex !== this.indexBuffer && (curIndex.data as any).length < totalIndices) {\n\t\t// \t\tthis.swapIndex(vb, this.indexBuffer);\n\t\t// \t}\n\t\t// }\n\t}\n\n\t// swapIndex(geom: PIXI.Geometry, indexBuf: PIXI.Buffer) {\n\t\t// let buffers = (geom as any).buffers;\n\t\t// const oldIndex = geom.getIndex();\n\t\t// let ind = buffers.indexOf(oldIndex);\n\t\t// if (ind >= 0) {\n\t\t// \tbuffers.splice(ind, 1);\n\t\t// }\n\t\t// geom.addIndex(indexBuf);\n\t// }\n\n\tgetShader(): TilemapShader {\n\t\treturn this.rectShader;\n\t}\n\n\tdestroy() {\n\t\tsuper.destroy();\n\t\t// this.rectShader.destroy();\n\t\tthis.rectShader = null;\n\t}\n}\n\nRenderer.registerPlugin('tilemap', TileRenderer as any);\n","/// \n\nimport { Container } from '@pixi/display';\n\nimport type { CompositeRectTileLayer } from './CompositeRectTileLayer';\nimport type { Matrix } from '@pixi/math';\n\nexport class ZLayer extends Container {\n\n constructor(tilemap: Container, zIndex: number) {\n super();\n this.tilemap = tilemap;\n this.z = zIndex;\n }\n\n tilemap: any;\n z: number;\n zIndex: number;\n _previousLayers: number;\n canvasBuffer: HTMLCanvasElement;\n _tempRender: any;\n _lastAnimationFrame: number = -1;\n layerTransform: Matrix;\n\n clear() {\n let layers = this.children as Array;\n for (let i = 0; i < layers.length; i++)\n layers[i].clear();\n this._previousLayers = 0;\n }\n\n cacheIfDirty() {\n let tilemap: any = this.tilemap;\n let layers = this.children as Array;\n let modified = this._previousLayers !== layers.length;\n this._previousLayers = layers.length;\n let buf = this.canvasBuffer;\n let tempRender = this._tempRender;\n if (!buf) {\n buf = this.canvasBuffer = document.createElement('canvas');\n tempRender = this._tempRender = new (PIXI as any).CanvasRenderer({width: 100, height: 100, view: buf});\n tempRender.context = tempRender.rootContext;\n tempRender.plugins.tilemap.dontUseTransform = true;\n }\n if (buf.width !== tilemap._layerWidth ||\n buf.height !== tilemap._layerHeight) {\n buf.width = tilemap._layerWidth;\n buf.height = tilemap._layerHeight;\n modified = true;\n }\n let i: number;\n if (!modified) {\n for (i = 0; i < layers.length; i++) {\n if (layers[i].isModified(this._lastAnimationFrame !== tilemap.animationFrame)) {\n modified = true;\n break;\n }\n }\n }\n this._lastAnimationFrame = tilemap.animationFrame;\n if (modified) {\n if (tilemap._hackRenderer) {\n tilemap._hackRenderer(tempRender);\n }\n tempRender.context.clearRect(0, 0, buf.width, buf.height);\n for (i = 0; i < layers.length; i++) {\n layers[i].clearModify();\n layers[i].renderCanvas(tempRender);\n }\n }\n this.layerTransform = this.worldTransform;\n for (i = 0; i < layers.length; i++) {\n this.layerTransform = layers[i].worldTransform;\n break;\n }\n }\n\n renderCanvas(renderer: any) {\n this.cacheIfDirty();\n let wt = this.layerTransform;\n renderer.context.setTransform(\n wt.a,\n wt.b,\n wt.c,\n wt.d,\n wt.tx * renderer.resolution,\n wt.ty * renderer.resolution\n );\n let tilemap = this.tilemap;\n renderer.context.drawImage(this.canvasBuffer, 0, 0);\n }\n}\n","/// \n\nnamespace pixi_tilemap {\n (PIXI as any).tilemap = pixi_tilemap;\n}\n\n// This makes exporter.ts a module!\nexport default {}\n","import { CanvasTileRenderer } from './CanvasTileRenderer';\nimport { CompositeRectTileLayer } from './CompositeRectTileLayer';\nimport { Constant } from './Constant';\nimport { GraphicsLayer } from './GraphicsLayer';\nimport { MultiTextureResource } from './MultiTextureResource';\nimport { RectTileLayer } from './RectTileLayer';\nimport { TilemapShader, RectTileShader, RectTileGeom } from './RectTileShader';\nimport { TileRenderer } from './TileRenderer';\nimport { ZLayer } from './ZLayer';\n\nexport const pixi_tilemap = {\n CanvasTileRenderer,\n CompositeRectTileLayer,\n Constant,\n GraphicsLayer,\n MultiTextureResource,\n RectTileLayer,\n TilemapShader,\n RectTileShader,\n RectTileGeom,\n TileRenderer,\n ZLayer,\n};\n\nexport * from './CanvasTileRenderer';\nexport * from './CompositeRectTileLayer';\nexport * from './Constant';\nexport * from './exporter';\nexport * from './GraphicsLayer';\nexport * from './MultiTextureResource';\nexport * from './RectTileLayer';\nexport * from './RectTileShader';\nexport * from './shaderGenerator';\nexport * from './TileRenderer';\nexport * from './ZLayer';"],"names":["SCALE_MODES","Container","Bounds","Texture","groupD8","DRAW_MODES","Graphics","Matrix","resources","Sprite","ALPHA_MODES","Shader","Program","shaderGenerator.fillSamplers","shaderGenerator.generateFragmentSrc","Geometry","Buffer","ObjectRenderer","BaseTexture","WRAP_MODES","Renderer","pixi_tilemap"],"mappings":";;;;;;;;;;;;;;;;;;;UAIa,kBAAkB;QAK3B,YAAY,QAAkB;YAH9B,aAAQ,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;YAClB,qBAAgB,GAAG,KAAK,CAAC;YAGrB,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;YACzB,IAAI,CAAC,QAAQ,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;SAC1B;KACJ;IAED,MAAM,EAAE,GAAI,IAAY,CAAC,cAAc,CAAC;IAExC,IAAI,EAAE,EAAE;QACJ,EAAE,CAAC,cAAc,CAAC,SAAS,EAAE,kBAAkB,CAAC,CAAC;;;UCdxC,QAAQ,GAAG;QACpB,WAAW,EAAE,EAAE;QACf,UAAU,EAAE,IAAI;QAChB,SAAS,EAAE,IAAI;QACf,mBAAmB,EAAE,CAAC;QACtB,aAAa,EAAE,KAAK;QACpB,UAAU,EAAEA,qBAAW,CAAC,MAAM;QAC9B,QAAQ,EAAE,IAAI;;;UCAL,iBAAiB,GAAG,GAAG;UAEvB,aAAc,SAAQC,iBAAS;QACxC,YAAY,MAAc,EAAE,OAAiC;YACzD,KAAK,EAAE,CAAC;YAIZ,WAAM,GAAG,CAAC,CAAC;YACX,uBAAkB,GAAG,CAAC,CAAC;YACvB,mBAAc,GAAG,IAAIC,cAAM,EAAE,CAAC;YAC9B,gBAAW,GAAG,IAAI,YAAY,CAAC,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,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AAY,KAAZ,YAAY,QAErB;AAGD,mBAAe,EAAE;;UCGJoB,cAAY,GAAG;QACxB,kBAAkB;QAClB,sBAAsB;QACtB,QAAQ;QACR,aAAa;QACb,oBAAoB;QACpB,aAAa;QACb,aAAa;QACb,cAAc;QACd,YAAY;QACZ,YAAY;QACZ,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"} \ No newline at end of file +{"version":3,"file":"pixi-tilemap.umd.js","sources":["../src/CanvasTileRenderer.ts","../src/Constant.ts","../src/RectTileLayer.ts","../src/CompositeRectTileLayer.ts","../src/GraphicsLayer.ts","../src/MultiTextureResource.ts","../src/shaderGenerator.ts","../src/RectTileShader.ts","../src/TileRenderer.ts","../src/ZLayer.ts","../src/index.ts"],"sourcesContent":["/// \n\nimport { Renderer } from '@pixi/core';\n\nexport class CanvasTileRenderer {\n renderer: Renderer;\n tileAnim = [0, 0];\n dontUseTransform = false;\n\n constructor(renderer: Renderer) {\n this.renderer = renderer;\n this.tileAnim = [0, 0];\n }\n}\n\nconst cr = (PIXI as any).CanvasRenderer;\n\nif (cr) {\n cr.registerPlugin('tilemap', CanvasTileRenderer);\n}\n","/// \n\nimport { SCALE_MODES } from '@pixi/constants';\n\nexport const Constant = {\n maxTextures: 16,\n bufferSize: 2048,\n boundSize: 1024,\n boundCountPerBuffer: 1,\n use32bitIndex: false,\n SCALE_MODE: SCALE_MODES.LINEAR,\n DO_CLEAR: true\n};","/// \n\nimport { Container, Bounds } from '@pixi/display';\nimport { Constant } from './Constant';\nimport { DRAW_MODES } from '@pixi/constants';\nimport { Texture, Renderer } from '@pixi/core';\nimport { TileRenderer } from './TileRenderer';\nimport { Matrix, Rectangle, groupD8 } from '@pixi/math';\n\nimport type { RectTileGeom } from './RectTileShader';\n\nexport const POINT_STRUCT_SIZE = 12;\n\nexport class RectTileLayer extends Container {\n constructor(zIndex: number, texture: Texture | Array) {\n super();\n this.initialize(zIndex, texture);\n }\n\n zIndex = 0;\n modificationMarker = 0;\n _$_localBounds = new Bounds();\n shadowColor = new Float32Array([0.0, 0.0, 0.0, 0.5]);\n _globalMat: Matrix = null;\n\n pointsBuf: Array = [];\n hasAnim = false;\n textures: Array;\n\n offsetX = 0;\n offsetY = 0;\n compositeParent = false;\n\n initialize(zIndex: number, textures: Texture | Array) {\n if (!textures) {\n textures = [];\n } else if (!(textures instanceof Array) && (textures as Texture).baseTexture) {\n textures = [textures as Texture];\n }\n this.textures = textures as Array;\n this.zIndex = zIndex;\n // this.visible = false;\n }\n\n clear() {\n this.pointsBuf.length = 0;\n this.modificationMarker = 0;\n this._$_localBounds.clear();\n this.hasAnim = false;\n }\n\n addFrame(texture_: Texture | String | number, x: number, y: number, animX: number, animY: number) {\n let texture: Texture;\n let textureIndex = 0;\n\n if (typeof texture_ === \"number\") {\n textureIndex = texture_;\n texture = this.textures[textureIndex];\n } else {\n if (typeof texture_ === \"string\") {\n texture = Texture.from(texture_);\n } else {\n texture = texture_ as Texture;\n }\n\n let found = false;\n let textureList = this.textures;\n for (let i = 0; i < textureList.length; i++) {\n if (textureList[i].baseTexture === texture.baseTexture) {\n textureIndex = i;\n found = true;\n break;\n }\n }\n\n if (!found) {\n // textureIndex = this.textures.length;\n // this.textures.push(texture);\n return false;\n }\n }\n\n this.addRect(textureIndex, texture.frame.x, texture.frame.y, x, y, texture.orig.width, texture.orig.height, animX, animY, texture.rotate);\n return true;\n }\n\n addRect(textureIndex: number, u: number, v: number, x: number, y: number, tileWidth: number, tileHeight: number,\n animX: number = 0, animY: number = 0, rotate: number = 0, animCountX: number = 1024, animCountY: number = 1024): this {\n let pb = this.pointsBuf;\n this.hasAnim = this.hasAnim || animX > 0 || animY > 0;\n pb.push(u);\n pb.push(v);\n pb.push(x);\n pb.push(y);\n pb.push(tileWidth);\n pb.push(tileHeight);\n pb.push(rotate);\n pb.push(animX | 0);\n pb.push(animY | 0);\n pb.push(textureIndex);\n pb.push(animCountX);\n pb.push(animCountY);\n\n this._$_localBounds.addFramePad(x, y, x+tileWidth, y+tileHeight, 0, 0);\n\n return this;\n }\n\n tileRotate(rotate: number) {\n const pb = this.pointsBuf;\n pb[pb.length - 3] = rotate;\n }\n\n tileAnimX(offset: number, count: number) {\n const pb = this.pointsBuf;\n\n pb[pb.length - 5] = offset;\n pb[pb.length - 2] = count;\n }\n\n tileAnimY(offset: number, count: number) {\n const pb = this.pointsBuf;\n\n pb[pb.length - 4] = offset;\n pb[pb.length - 1] = count;\n }\n\n renderCanvas(renderer: any) {\n let plugin = renderer.plugins.tilemap;\n if (!plugin.dontUseTransform) {\n let wt = this.worldTransform;\n renderer.context.setTransform(\n wt.a,\n wt.b,\n wt.c,\n wt.d,\n wt.tx * renderer.resolution,\n wt.ty * renderer.resolution\n );\n }\n this.renderCanvasCore(renderer);\n }\n\n renderCanvasCore(renderer: any) {\n if (this.textures.length === 0) return;\n let points = this.pointsBuf;\n renderer.context.fillStyle = '#000000';\n for (let i = 0, n = points.length; i < n; i += POINT_STRUCT_SIZE) {\n let x1 = points[i], y1 = points[i + 1];\n let x2 = points[i + 2], y2 = points[i + 3];\n let w = points[i + 4];\n let h = points[i + 5];\n var rotate = points[i + 6];\n x1 += points[i + 7] * renderer.plugins.tilemap.tileAnim[0];\n y1 += points[i + 8] * renderer.plugins.tilemap.tileAnim[1];\n let textureIndex = points[i + 9];\n // canvas does not work with rotate yet\n if (textureIndex >= 0) {\n renderer.context.drawImage((this.textures[textureIndex].baseTexture as any).getDrawableSource(), x1, y1, w, h, x2, y2, w, h);\n } else {\n renderer.context.globalAlpha = 0.5;\n renderer.context.fillRect(x2, y2, w, h);\n renderer.context.globalAlpha = 1;\n }\n }\n }\n\n vbId = 0;\n vb: RectTileGeom = null;\n vbBuffer: ArrayBuffer = null;\n vbArray: Float32Array = null;\n vbInts: Uint32Array = null;\n\n destroyVb() {\n if (this.vb) {\n this.vb.destroy();\n this.vb = null;\n }\n }\n\n render(renderer: Renderer) {\n let plugin = (renderer.plugins as any)['tilemap'];\n let shader = plugin.getShader();\n renderer.batch.setObjectRenderer(plugin);\n this._globalMat = shader.uniforms.projTransMatrix;\n renderer.globalUniforms.uniforms.projectionMatrix.copyTo(this._globalMat).append(this.worldTransform);\n shader.uniforms.shadowColor = this.shadowColor;\n shader.uniforms.animationFrame = plugin.tileAnim;\n this.renderWebGLCore(renderer, plugin);\n }\n\n renderWebGLCore(renderer: Renderer, plugin: TileRenderer) {\n let points = this.pointsBuf;\n if (points.length === 0) return;\n let rectsCount = points.length / POINT_STRUCT_SIZE;\n\n let shader = plugin.getShader();\n let textures = this.textures;\n if (textures.length === 0) return;\n\n plugin.bindTextures(renderer, shader, textures);\n renderer.shader.bind(shader, false);\n\n //lost context! recover!\n let vb = this.vb;\n if (!vb) {\n vb = plugin.createVb();\n this.vb = vb;\n this.vbId = (vb as any).id;\n this.vbBuffer = null;\n this.modificationMarker = 0;\n }\n\n plugin.checkIndexBuffer(rectsCount, vb);\n const boundCountPerBuffer = Constant.boundCountPerBuffer;\n\n let vertexBuf = vb.getBuffer('aVertexPosition');\n //if layer was changed, re-upload vertices\n let vertices = rectsCount * vb.vertPerQuad;\n if (vertices === 0) return;\n if (this.modificationMarker !== vertices) {\n this.modificationMarker = vertices;\n let vs = vb.stride * vertices;\n if (!this.vbBuffer || this.vbBuffer.byteLength < vs) {\n //!@#$ happens, need resize\n let bk = vb.stride;\n while (bk < vs) {\n bk *= 2;\n }\n this.vbBuffer = new ArrayBuffer(bk);\n this.vbArray = new Float32Array(this.vbBuffer);\n this.vbInts = new Uint32Array(this.vbBuffer);\n vertexBuf.update(this.vbBuffer);\n }\n\n let arr = this.vbArray, ints = this.vbInts;\n //upload vertices!\n let sz = 0;\n //let tint = 0xffffffff;\n let textureId: number = 0;\n let shiftU: number = this.offsetX;\n let shiftV: number = this.offsetY;\n\n //let tint = 0xffffffff;\n let tint = -1;\n for (let i = 0; i < points.length; i += POINT_STRUCT_SIZE) {\n let eps = 0.5;\n if (this.compositeParent) {\n if (boundCountPerBuffer > 1) {\n //TODO: what if its more than 4?\n textureId = (points[i + 9] >> 2);\n shiftU = this.offsetX * (points[i + 9] & 1);\n shiftV = this.offsetY * ((points[i + 9] >> 1) & 1);\n } else {\n textureId = points[i + 9];\n shiftU = 0;\n shiftV = 0;\n }\n }\n let x = points[i + 2], y = points[i + 3];\n let w = points[i + 4], h = points[i + 5];\n let u = points[i] + shiftU, v = points[i + 1] + shiftV;\n let rotate = points[i + 6];\n\n const animX = points[i + 7], animY = points[i + 8];\n const animWidth = points[i + 10] || 1024, animHeight = points[i + 11] || 1024;\n const animXEncoded = animX + (animWidth * 2048);\n const animYEncoded = animY + (animHeight * 2048);\n\n let u0: number, v0: number, u1: number, v1: number, u2: number, v2: number, u3: number, v3: number;\n if (rotate === 0) {\n u0 = u;\n v0 = v;\n u1 = u + w;\n v1 = v;\n u2 = u + w;\n v2 = v + h;\n u3 = u;\n v3 = v + h;\n } else {\n let w2 = w / 2;\n let h2 = h / 2;\n if (rotate % 4 !== 0) {\n w2 = h / 2;\n h2 = w / 2;\n }\n const cX = u + w2;\n const cY = v + h2;\n\n rotate = groupD8.add(rotate, groupD8.NW);\n u0 = cX + (w2 * groupD8.uX(rotate));\n v0 = cY + (h2 * groupD8.uY(rotate));\n\n rotate = groupD8.add(rotate, 2); // rotate 90 degrees clockwise\n u1 = cX + (w2 * groupD8.uX(rotate));\n v1 = cY + (h2 * groupD8.uY(rotate));\n\n rotate = groupD8.add(rotate, 2);\n u2 = cX + (w2 * groupD8.uX(rotate));\n v2 = cY + (h2 * groupD8.uY(rotate));\n\n rotate = groupD8.add(rotate, 2);\n u3 = cX + (w2 * groupD8.uX(rotate));\n v3 = cY + (h2 * groupD8.uY(rotate));\n }\n\n arr[sz++] = x;\n arr[sz++] = y;\n arr[sz++] = u0;\n arr[sz++] = v0;\n arr[sz++] = u + eps;\n arr[sz++] = v + eps;\n arr[sz++] = u + w - eps;\n arr[sz++] = v + h - eps;\n arr[sz++] = animXEncoded;\n arr[sz++] = animYEncoded;\n arr[sz++] = textureId;\n arr[sz++] = x + w;\n arr[sz++] = y;\n arr[sz++] = u1;\n arr[sz++] = v1;\n arr[sz++] = u + eps;\n arr[sz++] = v + eps;\n arr[sz++] = u + w - eps;\n arr[sz++] = v + h - eps;\n arr[sz++] = animXEncoded;\n arr[sz++] = animYEncoded;\n arr[sz++] = textureId;\n arr[sz++] = x + w;\n arr[sz++] = y + h;\n arr[sz++] = u2;\n arr[sz++] = v2;\n arr[sz++] = u + eps;\n arr[sz++] = v + eps;\n arr[sz++] = u + w - eps;\n arr[sz++] = v + h - eps;\n arr[sz++] = animXEncoded;\n arr[sz++] = animYEncoded;\n arr[sz++] = textureId;\n arr[sz++] = x;\n arr[sz++] = y + h;\n arr[sz++] = u3;\n arr[sz++] = v3;\n arr[sz++] = u + eps;\n arr[sz++] = v + eps;\n arr[sz++] = u + w - eps;\n arr[sz++] = v + h - eps;\n arr[sz++] = animXEncoded;\n arr[sz++] = animYEncoded;\n arr[sz++] = textureId;\n }\n\n vertexBuf.update(arr);\n }\n\n (renderer.geometry as any).bind(vb, shader);\n renderer.geometry.draw(DRAW_MODES.TRIANGLES, rectsCount * 6, 0);\n }\n\n isModified(anim: boolean) {\n if (this.modificationMarker !== this.pointsBuf.length ||\n anim && this.hasAnim) {\n return true;\n }\n return false;\n }\n\n clearModify() {\n this.modificationMarker = this.pointsBuf.length;\n }\n\n protected _calculateBounds(): void\n {\n const { minX, minY, maxX, maxY } = this._$_localBounds;\n\n this._bounds.addFrame(this.transform, minX, minY, maxX, maxY);\n }\n\n public getLocalBounds(rect?: Rectangle): Rectangle\n {\n // we can do a fast local bounds if the sprite has no children!\n if (this.children.length === 0)\n {\n return this._$_localBounds.getRectangle(rect);\n }\n\n return super.getLocalBounds.call(this, rect);\n }\n\n destroy(options?: any) {\n super.destroy(options);\n this.destroyVb();\n }\n}\n","/// \n\nimport { Container } from '@pixi/display';\nimport { Texture, Renderer } from '@pixi/core';\nimport { Matrix } from '@pixi/math';\nimport { Constant } from './Constant';\nimport { RectTileLayer } from './RectTileLayer';\n\nexport class CompositeRectTileLayer extends Container {\n constructor(zIndex?: number, bitmaps?: Array, texPerChild?: number) {\n super();\n this.initialize.apply(this, arguments);\n }\n\n z: number;\n zIndex: number;\n modificationMarker = 0;\n shadowColor = new Float32Array([0.0, 0.0, 0.0, 0.5]);\n _globalMat: Matrix = null;\n _lastLayer: RectTileLayer = null;\n\n texPerChild: number;\n\n initialize(zIndex?: number, bitmaps?: Array, texPerChild?: number) {\n if (texPerChild as any === true) {\n //old format, ignore it!\n texPerChild = 0;\n }\n this.z = this.zIndex = zIndex;\n this.texPerChild = texPerChild || Constant.boundCountPerBuffer * Constant.maxTextures;\n if (bitmaps) {\n this.setBitmaps(bitmaps);\n }\n }\n\n setBitmaps(bitmaps: Array) {\n for (let i=0;i 5.2.1, it does not exist there.`);\n }\n }\n let texPerChild = this.texPerChild;\n let len1 = this.children.length;\n let len2 = Math.ceil(bitmaps.length / texPerChild);\n let i: number;\n for (i = 0; i < len1; i++) {\n (this.children[i] as RectTileLayer).textures = bitmaps.slice(i * texPerChild, (i + 1) * texPerChild);\n }\n for (i = len1; i < len2; i++) {\n let layer = new RectTileLayer(this.zIndex, bitmaps.slice(i * texPerChild, (i + 1) * texPerChild));\n layer.compositeParent = true;\n layer.offsetX = Constant.boundSize;\n layer.offsetY = Constant.boundSize;\n this.addChild(layer);\n }\n }\n\n clear() {\n for (let i = 0; i < this.children.length; i++) {\n (this.children[i] as RectTileLayer).clear();\n }\n this.modificationMarker = 0;\n }\n\n addRect(textureIndex: number, u: number, v: number, x: number, y: number, tileWidth: number, tileHeight: number, animX?: number, animY?: number, rotate?: number, animWidth?: number, animHeight?: number): this {\n const childIndex: number = textureIndex / this.texPerChild >> 0;\n const textureId: number = textureIndex % this.texPerChild;\n\n if (this.children[childIndex] && (this.children[childIndex] as RectTileLayer).textures) {\n this._lastLayer = (this.children[childIndex] as RectTileLayer);\n this._lastLayer.addRect(textureId, u, v, x, y, tileWidth, tileHeight, animX, animY, rotate, animWidth, animHeight);\n } else {\n this._lastLayer = null;\n }\n\n return this;\n }\n\n tileRotate(rotate: number): this {\n if (this._lastLayer)\n {\n this._lastLayer.tileRotate(rotate);\n }\n return this;\n }\n\n tileAnimX(offset: number, count: number): this {\n if (this._lastLayer)\n {\n this._lastLayer.tileAnimX(offset, count);\n }\n return this;\n }\n\n tileAnimY(offset: number, count: number): this {\n if (this._lastLayer)\n {\n this._lastLayer.tileAnimY(offset, count);\n }\n return this;\n }\n\n addFrame(texture_: Texture | String | number, x: number, y: number, animX?: number, animY?: number, animWidth?: number, animHeight?: number): this {\n let texture: Texture;\n let layer: RectTileLayer = null;\n let ind: number = 0;\n let children = this.children;\n\n this._lastLayer = null;\n if (typeof texture_ === \"number\") {\n let childIndex = texture_ / this.texPerChild >> 0;\n layer = children[childIndex] as RectTileLayer;\n\n if (!layer) {\n layer = children[0] as RectTileLayer;\n if (!layer) {\n return this;\n }\n ind = 0;\n } else {\n ind = texture_ % this.texPerChild;\n }\n\n texture = layer.textures[ind];\n } else {\n if (typeof texture_ === \"string\") {\n texture = Texture.from(texture_);\n } else {\n texture = texture_ as Texture;\n }\n\n for (let i = 0; i < children.length; i++) {\n let child = children[i] as RectTileLayer;\n let tex = child.textures;\n for (let j = 0; j < tex.length; j++) {\n if (tex[j].baseTexture === texture.baseTexture) {\n layer = child;\n ind = j;\n break;\n }\n }\n if (layer) {\n break;\n }\n }\n\n if (!layer) {\n for (let i = 0; i < children.length; i++) {\n let child = children[i] as RectTileLayer;\n if (child.textures.length < this.texPerChild) {\n layer = child;\n ind = child.textures.length;\n child.textures.push(texture);\n break;\n }\n }\n if (!layer) {\n layer = new RectTileLayer(this.zIndex, texture);\n layer.compositeParent = true;\n layer.offsetX = Constant.boundSize;\n layer.offsetY = Constant.boundSize;\n this.addChild(layer);\n ind = 0;\n }\n }\n }\n\n this._lastLayer = layer;\n layer.addRect(ind, texture.frame.x, texture.frame.y, x, y, texture.orig.width, texture.orig.height, animX, animY, texture.rotate, animWidth, animHeight);\n return this;\n }\n\n renderCanvas(renderer: any) {\n if (!this.visible || this.worldAlpha <= 0 || !this.renderable) {\n return;\n }\n let plugin = renderer.plugins.tilemap;\n if (!plugin.dontUseTransform) {\n let wt = this.worldTransform;\n renderer.context.setTransform(\n wt.a,\n wt.b,\n wt.c,\n wt.d,\n wt.tx * renderer.resolution,\n wt.ty * renderer.resolution\n );\n }\n let layers = this.children;\n for (let i = 0; i < layers.length; i++) {\n (layers[i] as RectTileLayer).renderCanvasCore(renderer);\n }\n }\n\n render(renderer: Renderer) {\n if (!this.visible || this.worldAlpha <= 0 || !this.renderable) {\n return;\n }\n let plugin = (renderer.plugins as any)['tilemap'];\n let shader = plugin.getShader();\n renderer.batch.setObjectRenderer(plugin);\n //TODO: dont create new array, please\n this._globalMat = shader.uniforms.projTransMatrix;\n renderer.globalUniforms.uniforms.projectionMatrix.copyTo(this._globalMat).append(this.worldTransform);\n shader.uniforms.shadowColor = this.shadowColor;\n shader.uniforms.animationFrame = plugin.tileAnim;\n renderer.shader.bind(shader, false);\n let layers = this.children;\n for (let i = 0; i < layers.length; i++) {\n (layers[i] as RectTileLayer).renderWebGLCore(renderer, plugin);\n }\n }\n\n isModified(anim: boolean) {\n let layers = this.children;\n if (this.modificationMarker !== layers.length) {\n return true;\n }\n for (let i = 0; i < layers.length; i++) {\n if ((layers[i] as RectTileLayer).isModified(anim)) {\n return true;\n }\n }\n return false;\n }\n\n clearModify() {\n let layers = this.children;\n this.modificationMarker = layers.length;\n for (let i = 0; i < layers.length; i++) {\n (layers[i] as RectTileLayer).clearModify();\n }\n }\n}\n","/// \n\nimport { Matrix } from '@pixi/math';\nimport { Graphics } from '@pixi/graphics';\n\nexport class GraphicsLayer extends Graphics {\n constructor(zIndex: number) {\n super();\n this.zIndex = zIndex;\n }\n\n renderCanvas(renderer: any) {\n let wt: Matrix = null;\n if (renderer.plugins.tilemap.dontUseTransform) {\n wt = this.transform.worldTransform;\n this.transform.worldTransform = Matrix.IDENTITY;\n }\n renderer.plugins.graphics.render(this);\n if (renderer.plugins.tilemap.dontUseTransform) {\n this.transform.worldTransform = wt;\n }\n renderer.context.globalAlpha = 1.0;\n }\n\n // renderWebGL(renderer: PIXI.Renderer) {\n // if (!this._webGL[renderer.CONTEXT_UID])\n // this.dirty++;\n // super.renderWebGL(renderer)\n // }\n\n isModified(anim: boolean): boolean {\n return false;\n }\n\n clearModify() {\n }\n}\n","/// \n\nimport { ALPHA_MODES } from '@pixi/constants';\nimport { BaseTexture, Renderer, Texture, GLTexture, resources } from '@pixi/core';\nimport { Sprite } from '@pixi/sprite';\nimport { Constant } from './Constant';\n\nexport interface IMultiTextureOptions {\n\tboundCountPerBuffer: number;\n\tboundSize: number;\n\tbufferSize: number;\n\tDO_CLEAR?: boolean;\n}\n\nexport class MultiTextureResource extends resources.Resource {\n\tconstructor(options: IMultiTextureOptions) {\n\t\tsuper(options.bufferSize, options.bufferSize);\n\n\t\tconst bounds = this.boundSprites;\n\t\tconst dirties = this.dirties;\n\t\tthis.boundSize = options.boundSize;\n\t\tfor (let j = 0; j < options.boundCountPerBuffer; j++) {\n\t\t\tconst spr = new Sprite();\n\t\t\tspr.position.x = options.boundSize * (j & 1);\n\t\t\tspr.position.y = options.boundSize * (j >> 1);\n\t\t\tbounds.push(spr);\n\t\t\tdirties.push(0);\n\t\t}\n\t\tthis.DO_CLEAR = !!options.DO_CLEAR;\n\t}\n\n\tDO_CLEAR = false;\n\tboundSize: number = 0;\n\t_clearBuffer: Uint8Array = null;\n\n\tbind(baseTexture: BaseTexture) {\n\t\tif (this.baseTex) {\n\t\t\tthrow new Error('Only one baseTexture is allowed for this resource!')\n\t\t}\n\t\tthis.baseTex = baseTexture;\n\t\tsuper.bind(baseTexture);\n\t}\n\n\tbaseTex: BaseTexture = null;\n\tboundSprites: Array = [];\n\tdirties: Array = [];\n\n\tsetTexture(ind: number, texture: Texture) {\n\t\tconst spr = this.boundSprites[ind];\n\t\tif (spr.texture.baseTexture === texture.baseTexture) {\n\t\t\treturn;\n\t\t}\n\t\tspr.texture = texture;\n\t\tthis.baseTex.update();\n\t\tthis.dirties[ind] = (this.baseTex as any).dirtyId;\n\t}\n\n\tupload(renderer: Renderer, texture: BaseTexture, glTexture: GLTexture) {\n\t\tconst { gl } = renderer as any;\n\n\t\tconst {width, height} = this;\n\t\tgl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, texture.alphaMode === undefined ||\n\t\t\ttexture.alphaMode === ALPHA_MODES.UNPACK);\n\n\t\tif (glTexture.dirtyId < 0) {\n\t\t\t(glTexture as any).width = width;\n\t\t\t(glTexture as any).height = height;\n\n\t\t\tgl.texImage2D(texture.target, 0,\n\t\t\t\ttexture.format,\n\t\t\t\twidth,\n\t\t\t\theight,\n\t\t\t\t0,\n\t\t\t\ttexture.format,\n\t\t\t\ttexture.type,\n\t\t\t\tnull);\n\t\t}\n\n\t\tconst doClear = this.DO_CLEAR;\n\t\tif (doClear && !this._clearBuffer) {\n\t\t\tthis._clearBuffer = new Uint8Array(Constant.boundSize * Constant.boundSize * 4);\n\t\t}\n\n\t\tconst bounds = this.boundSprites;\n\t\tfor (let i = 0; i < bounds.length; i++) {\n\t\t\tconst spr = bounds[i];\n\t\t\tconst tex = spr.texture.baseTexture;\n\t\t\tif (glTexture.dirtyId >= this.dirties[i]) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tconst res = tex.resource as any;\n\t\t\tif (!tex.valid || !res || !res.source) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (doClear && (tex.width < this.boundSize || tex.height < this.boundSize))\n\t\t\t{\n\t\t\t\tgl.texSubImage2D(texture.target, 0,\n\t\t\t\t\tspr.position.x,\n\t\t\t\t\tspr.position.y,\n\t\t\t\t\tthis.boundSize,\n\t\t\t\t\tthis.boundSize,\n\t\t\t\t\ttexture.format,\n\t\t\t\t\ttexture.type,\n\t\t\t\t\tthis._clearBuffer);\n\t\t\t}\n\t\t\tgl.texSubImage2D(texture.target, 0,\n\t\t\t\tspr.position.x,\n\t\t\t\tspr.position.y,\n\t\t\t\ttexture.format,\n\t\t\t\ttexture.type,\n\t\t\t\tres.source);\n\t\t}\n\n\t\treturn true;\n\t}\n}\n","import { Constant } from './Constant';\n\nimport type { TilemapShader } from './RectTileShader';\n\n\nexport function fillSamplers(shader: TilemapShader, maxTextures: number) {\n let sampleValues: Array = [];\n for (let i = 0; i < maxTextures; i++)\n {\n sampleValues[i] = i;\n }\n shader.uniforms.uSamplers = sampleValues;\n\n let samplerSize: Array = [];\n for (let i = 0; i < maxTextures; i++) {\n samplerSize.push(1.0 / Constant.bufferSize);\n samplerSize.push(1.0 / Constant.bufferSize);\n }\n shader.uniforms.uSamplerSize = samplerSize;\n}\n\nexport function generateFragmentSrc(maxTextures: number, fragmentSrc: string) {\n return fragmentSrc.replace(/%count%/gi, maxTextures + \"\")\n .replace(/%forloop%/gi, generateSampleSrc(maxTextures));\n}\n\nexport function generateSampleSrc(maxTextures: number) {\n let src = '';\n\n src += '\\n';\n src += '\\n';\n\n src += 'if(vTextureId <= -1.0) {';\n src += '\\n\\tcolor = shadowColor;';\n src += '\\n}';\n\n for (let i = 0; i < maxTextures; i++)\n {\n src += '\\nelse ';\n\n if(i < maxTextures-1)\n {\n src += 'if(textureId == ' + i + '.0)';\n }\n\n src += '\\n{';\n src += '\\n\\tcolor = texture2D(uSamplers['+i+'], textureCoord * uSamplerSize['+i+']);';\n src += '\\n}';\n }\n\n src += '\\n';\n src += '\\n';\n\n return src;\n}\n","/// \n\nimport * as shaderGenerator from './shaderGenerator';\n\nimport { Buffer, Geometry, Shader, Program } from '@pixi/core';\nimport { Matrix } from '@pixi/math';\n\nlet rectShaderFrag = `\nvarying vec2 vTextureCoord;\nvarying vec4 vFrame;\nvarying float vTextureId;\nuniform vec4 shadowColor;\nuniform sampler2D uSamplers[%count%];\nuniform vec2 uSamplerSize[%count%];\n\nvoid main(void){\n vec2 textureCoord = clamp(vTextureCoord, vFrame.xy, vFrame.zw);\n float textureId = floor(vTextureId + 0.5);\n\n vec4 color;\n %forloop%\n gl_FragColor = color;\n}\n`;\nlet rectShaderVert = `\nattribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\nattribute vec4 aFrame;\nattribute vec2 aAnim;\nattribute float aTextureId;\n\nuniform mat3 projTransMatrix;\nuniform vec2 animationFrame;\n\nvarying vec2 vTextureCoord;\nvarying float vTextureId;\nvarying vec4 vFrame;\n\nvoid main(void){\n gl_Position = vec4((projTransMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n vec2 animCount = floor((aAnim + 0.5) / 2048.0);\n vec2 animFrameOffset = aAnim - animCount * 2048.0;\n vec2 animOffset = animFrameOffset * floor(mod(animationFrame + 0.5, animCount));\n\n vTextureCoord = aTextureCoord + animOffset;\n vFrame = aFrame + vec4(animOffset, animOffset);\n vTextureId = aTextureId;\n}\n`;\n\nexport abstract class TilemapShader extends Shader {\n\tmaxTextures = 0;\n\n\tconstructor(maxTextures: number, shaderVert: string, shaderFrag: string) {\n\t\tsuper(\n\t\t\tnew Program(\n\t\t\t\tshaderVert,\n\t\t\t\tshaderFrag),\n\t\t\t{\n\t\t\t\tanimationFrame: new Float32Array(2),\n\t\t\t\tuSamplers: [],\n\t\t\t\tuSamplerSize: [],\n\t\t\t\tprojTransMatrix: new Matrix()\n\t\t\t}\n\t\t);\n\t\tthis.maxTextures = maxTextures;\n\t\tshaderGenerator.fillSamplers(this, this.maxTextures);\n\t}\n}\n\nexport class RectTileShader extends TilemapShader {\n\tconstructor(maxTextures: number) {\n\t\tsuper(\n\t\t\tmaxTextures,\n\t\t\trectShaderVert,\n\t\t\tshaderGenerator.generateFragmentSrc(maxTextures, rectShaderFrag)\n\t\t);\n\t\tshaderGenerator.fillSamplers(this, this.maxTextures);\n\t}\n}\n\nexport class RectTileGeom extends Geometry {\n\tvertSize = 11;\n\tvertPerQuad = 4;\n\tstride = this.vertSize * 4;\n\tlastTimeAccess = 0;\n\n\tconstructor() {\n\t\tsuper();\n\t\tconst buf = this.buf = new Buffer(new Float32Array(2), true, false);\n\t\tthis.addAttribute('aVertexPosition', buf, 0, false, 0, this.stride, 0)\n\t\t\t.addAttribute('aTextureCoord', buf, 0, false, 0, this.stride, 2 * 4)\n\t\t\t.addAttribute('aFrame', buf, 0, false, 0, this.stride, 4 * 4)\n\t\t\t.addAttribute('aAnim', buf, 0, false, 0, this.stride, 8 * 4)\n\t\t\t.addAttribute('aTextureId', buf, 0, false, 0, this.stride, 10 * 4);\n\t}\n\n\tbuf: Buffer;\n}\n","import { WRAP_MODES } from '@pixi/constants';\nimport { BaseTexture, Buffer, resources, ObjectRenderer, Texture, Renderer } from '@pixi/core';\nimport { Constant } from './Constant';\nimport { RectTileGeom, RectTileShader } from './RectTileShader';\nimport { MultiTextureResource } from './MultiTextureResource';\n\nimport type { TilemapShader } from './RectTileShader';\n\n/**\n * Renderer for rectangle tiles.\n */\nexport class TileRenderer extends ObjectRenderer {\n\trenderer: Renderer;\n\tgl: WebGLRenderingContext;\n\tsn: number = -1;\n\tindexBuffer: Buffer = null;\n\tibLen: number = 0;\n\ttileAnim = [0, 0];\n\ttexLoc: Array = [];\n\n\trectShader: RectTileShader;\n\ttexResources: Array = [];\n\n\tconstructor(renderer: Renderer) {\n\t\tsuper(renderer);\n\t\tthis.rectShader = new RectTileShader(Constant.maxTextures);\n\t\tthis.indexBuffer = new Buffer(undefined, true, true);\n\t\tthis.checkIndexBuffer(2000);\n\t\tthis.initBounds();\n\t}\n\n\tinitBounds() {\n\t\tif (Constant.boundCountPerBuffer <= 1) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst maxTextures = Constant.maxTextures;\n\t\tfor (let i = 0; i < maxTextures; i++) {\n\t\t\tconst resource = new MultiTextureResource(Constant);\n\t\t\tconst baseTex = new BaseTexture(resource);\n\t\t\tbaseTex.scaleMode = Constant.SCALE_MODE;\n\t\t\tbaseTex.wrapMode = WRAP_MODES.CLAMP;\n\t\t\tthis.texResources.push(resource);\n\t\t}\n\t}\n\n\tbindTexturesWithoutRT(renderer: Renderer, shader: TilemapShader, textures: Array) {\n\t\tlet samplerSize: Array = (shader as any).uniforms.uSamplerSize;\n\t\tthis.texLoc.length = 0;\n\t\tfor (let i = 0; i < textures.length; i++) {\n\t\t\tconst texture = textures[i];\n\t\t\tif (!texture || !texture.valid) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\trenderer.texture.bind(textures[i], i);\n\t\t\t//TODO: add resolution here\n\t\t\tsamplerSize[i * 2] = 1.0 / textures[i].baseTexture.width;\n\t\t\tsamplerSize[i * 2 + 1] = 1.0 / textures[i].baseTexture.height;\n\t\t}\n\t\t(shader as any).uniforms.uSamplerSize = samplerSize;\n\t}\n\n\tbindTextures(renderer: Renderer, shader: TilemapShader, textures: Array) {\n\t\tconst len = textures.length;\n\t\tconst maxTextures = Constant.maxTextures;\n\t\tif (len > Constant.boundCountPerBuffer * maxTextures) {\n\t\t\treturn;\n\t\t}\n\t\tif (Constant.boundCountPerBuffer <= 1) {\n\t\t\tthis.bindTexturesWithoutRT(renderer, shader, textures);\n\t\t\treturn;\n\t\t}\n\n\t\tlet i = 0;\n\t\tfor (; i < len; i++) {\n\t\t\tconst texture = textures[i];\n\t\t\tif (!texture || !texture.valid) continue;\n\t\t\tconst multi = this.texResources[i >> 2];\n\t\t\tmulti.setTexture(i & 3, texture);\n\t\t}\n\n\t\tlet gltsUsed = (i + 3) >> 2;\n\t\tfor (i = 0; i < gltsUsed; i++) {\n\t\t\t//remove \"i, true\" after resolving a bug\n\t\t\trenderer.texture.bind(this.texResources[i].baseTex, i);\n\t\t}\n\t}\n\n\tstart() {\n\t\t//sorry, nothing\n\t}\n\n\tcreateVb() {\n\t\tconst geom = new RectTileGeom();\n\t\tgeom.addIndex(this.indexBuffer);\n\t\tgeom.lastTimeAccess = Date.now();\n\t\treturn geom;\n\t}\n\n\tcheckIndexBuffer(size: number, vb: RectTileGeom = null) {\n\t\tconst totalIndices = size * 6;\n\n\t\tif (totalIndices <= this.ibLen) {\n\t\t\treturn;\n\t\t}\n\n\t\tlet len = totalIndices;\n\t\twhile (len < totalIndices) {\n\t\t\tlen <<= 1;\n\t\t}\n\n\t\tthis.ibLen = totalIndices;\n\t\tthis.indexBuffer.update((PIXI as any).utils.createIndicesForQuads(size,\n\t\t\tConstant.use32bitIndex ? new Uint32Array(size * 6) : undefined));\n\n\t\t// \tTODO: create new index buffer instead?\n\t\t// if (vb) {\n\t\t// \tconst curIndex = vb.getIndex();\n\t\t// \tif (curIndex !== this.indexBuffer && (curIndex.data as any).length < totalIndices) {\n\t\t// \t\tthis.swapIndex(vb, this.indexBuffer);\n\t\t// \t}\n\t\t// }\n\t}\n\n\t// swapIndex(geom: PIXI.Geometry, indexBuf: PIXI.Buffer) {\n\t\t// let buffers = (geom as any).buffers;\n\t\t// const oldIndex = geom.getIndex();\n\t\t// let ind = buffers.indexOf(oldIndex);\n\t\t// if (ind >= 0) {\n\t\t// \tbuffers.splice(ind, 1);\n\t\t// }\n\t\t// geom.addIndex(indexBuf);\n\t// }\n\n\tgetShader(): TilemapShader {\n\t\treturn this.rectShader;\n\t}\n\n\tdestroy() {\n\t\tsuper.destroy();\n\t\t// this.rectShader.destroy();\n\t\tthis.rectShader = null;\n\t}\n}\n\nRenderer.registerPlugin('tilemap', TileRenderer as any);\n","/// \n\nimport { Container } from '@pixi/display';\n\nimport type { CompositeRectTileLayer } from './CompositeRectTileLayer';\nimport type { Matrix } from '@pixi/math';\n\nexport class ZLayer extends Container {\n\n constructor(tilemap: Container, zIndex: number) {\n super();\n this.tilemap = tilemap;\n this.z = zIndex;\n }\n\n tilemap: any;\n z: number;\n zIndex: number;\n _previousLayers: number;\n canvasBuffer: HTMLCanvasElement;\n _tempRender: any;\n _lastAnimationFrame: number = -1;\n layerTransform: Matrix;\n\n clear() {\n let layers = this.children as Array;\n for (let i = 0; i < layers.length; i++)\n layers[i].clear();\n this._previousLayers = 0;\n }\n\n cacheIfDirty() {\n let tilemap: any = this.tilemap;\n let layers = this.children as Array;\n let modified = this._previousLayers !== layers.length;\n this._previousLayers = layers.length;\n let buf = this.canvasBuffer;\n let tempRender = this._tempRender;\n if (!buf) {\n buf = this.canvasBuffer = document.createElement('canvas');\n tempRender = this._tempRender = new (PIXI as any).CanvasRenderer({width: 100, height: 100, view: buf});\n tempRender.context = tempRender.rootContext;\n tempRender.plugins.tilemap.dontUseTransform = true;\n }\n if (buf.width !== tilemap._layerWidth ||\n buf.height !== tilemap._layerHeight) {\n buf.width = tilemap._layerWidth;\n buf.height = tilemap._layerHeight;\n modified = true;\n }\n let i: number;\n if (!modified) {\n for (i = 0; i < layers.length; i++) {\n if (layers[i].isModified(this._lastAnimationFrame !== tilemap.animationFrame)) {\n modified = true;\n break;\n }\n }\n }\n this._lastAnimationFrame = tilemap.animationFrame;\n if (modified) {\n if (tilemap._hackRenderer) {\n tilemap._hackRenderer(tempRender);\n }\n tempRender.context.clearRect(0, 0, buf.width, buf.height);\n for (i = 0; i < layers.length; i++) {\n layers[i].clearModify();\n layers[i].renderCanvas(tempRender);\n }\n }\n this.layerTransform = this.worldTransform;\n for (i = 0; i < layers.length; i++) {\n this.layerTransform = layers[i].worldTransform;\n break;\n }\n }\n\n renderCanvas(renderer: any) {\n this.cacheIfDirty();\n let wt = this.layerTransform;\n renderer.context.setTransform(\n wt.a,\n wt.b,\n wt.c,\n wt.d,\n wt.tx * renderer.resolution,\n wt.ty * renderer.resolution\n );\n let tilemap = this.tilemap;\n renderer.context.drawImage(this.canvasBuffer, 0, 0);\n }\n}\n","import { CanvasTileRenderer } from './CanvasTileRenderer';\nimport { CompositeRectTileLayer } from './CompositeRectTileLayer';\nimport { Constant } from './Constant';\nimport { GraphicsLayer } from './GraphicsLayer';\nimport { MultiTextureResource } from './MultiTextureResource';\nimport { RectTileLayer } from './RectTileLayer';\nimport { TilemapShader, RectTileShader, RectTileGeom } from './RectTileShader';\nimport { TileRenderer } from './TileRenderer';\nimport { ZLayer } from './ZLayer';\n\nexport const pixi_tilemap = {\n CanvasTileRenderer,\n CompositeRectTileLayer,\n Constant,\n GraphicsLayer,\n MultiTextureResource,\n RectTileLayer,\n TilemapShader,\n RectTileShader,\n RectTileGeom,\n TileRenderer,\n ZLayer,\n};\n\nexport * from './CanvasTileRenderer';\nexport * from './CompositeRectTileLayer';\nexport * from './Constant';\nexport * from './GraphicsLayer';\nexport * from './MultiTextureResource';\nexport * from './RectTileLayer';\nexport * from './RectTileShader';\nexport * from './shaderGenerator';\nexport * from './TileRenderer';\nexport * from './ZLayer';"],"names":["SCALE_MODES","Container","Bounds","Texture","groupD8","DRAW_MODES","Graphics","Matrix","resources","Sprite","ALPHA_MODES","Shader","Program","shaderGenerator.fillSamplers","shaderGenerator.generateFragmentSrc","Geometry","Buffer","ObjectRenderer","BaseTexture","WRAP_MODES","Renderer"],"mappings":";;;;;;;;;;;;;;;;;;;UAIa,kBAAkB;QAK3B,YAAY,QAAkB;YAH9B,aAAQ,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;YAClB,qBAAgB,GAAG,KAAK,CAAC;YAGrB,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;YACzB,IAAI,CAAC,QAAQ,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;SAC1B;KACJ;IAED,MAAM,EAAE,GAAI,IAAY,CAAC,cAAc,CAAC;IAExC,IAAI,EAAE,EAAE;QACJ,EAAE,CAAC,cAAc,CAAC,SAAS,EAAE,kBAAkB,CAAC,CAAC;;;UCdxC,QAAQ,GAAG;QACpB,WAAW,EAAE,EAAE;QACf,UAAU,EAAE,IAAI;QAChB,SAAS,EAAE,IAAI;QACf,mBAAmB,EAAE,CAAC;QACtB,aAAa,EAAE,KAAK;QACpB,UAAU,EAAEA,qBAAW,CAAC,MAAM;QAC9B,QAAQ,EAAE,IAAI;;;UCAL,iBAAiB,GAAG,GAAG;UAEvB,aAAc,SAAQC,iBAAS;QACxC,YAAY,MAAc,EAAE,OAAiC;YACzD,KAAK,EAAE,CAAC;YAIZ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C,OAAO,CAAC,SAAS,CAAC,IAAI,CAAC,YAAY,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;SACvD;;;UChFQ,YAAY,GAAG;QACxB,kBAAkB;QAClB,sBAAsB;QACtB,QAAQ;QACR,aAAa;QACb,oBAAoB;QACpB,aAAa;QACb,aAAa;QACb,cAAc;QACd,YAAY;QACZ,YAAY;QACZ,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"} \ No newline at end of file diff --git a/index.d.ts b/index.d.ts index fca39853..c69fff36 100644 --- a/index.d.ts +++ b/index.d.ts @@ -1,4 +1,3 @@ -/// import { BaseTexture } from '@pixi/core'; import { Bounds } from '@pixi/display'; import { Buffer as Buffer_2 } from '@pixi/core'; diff --git a/src/exporter.ts b/src/exporter.ts deleted file mode 100644 index c6c43631..00000000 --- a/src/exporter.ts +++ /dev/null @@ -1,8 +0,0 @@ -/// - -namespace pixi_tilemap { - (PIXI as any).tilemap = pixi_tilemap; -} - -// This makes exporter.ts a module! -export default {} diff --git a/src/index.ts b/src/index.ts index dd7835e3..25556958 100644 --- a/src/index.ts +++ b/src/index.ts @@ -25,7 +25,6 @@ export const pixi_tilemap = { export * from './CanvasTileRenderer'; export * from './CompositeRectTileLayer'; export * from './Constant'; -export * from './exporter'; export * from './GraphicsLayer'; export * from './MultiTextureResource'; export * from './RectTileLayer';