-
Notifications
You must be signed in to change notification settings - Fork 7.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TilemapLayer / Tileset performance and documentation #1250
Conversation
TilemapLayer - Added "delta scroll rendering" - Enabled (by default) via `renderSettings.enableScrollDelta` - Dramatic CPU reduction: 30% to 2% scrolling 50x37 region - Side-effect: fixed some Chrome de-opt issues with `render` - Various rendering updates and removal of many `_mc` field - Made `index` a read-only propert that reflects the layer.index - Creates a local cache from tile index -> tileset, added `resetTilesetCache` - Also prevents crash when an index not associated with a tileset is used; see `missingImageOverfill`. - Various debug options moved to `debugSettings` and simplified; documentation updated. - Uses `debugSettings.missingImageOverfill` and `tileColor` (deprecated) to display invalid tileset images - Only change the context alpha when the tile alpha changes; in Chrome 38 this removed a .5% penalty - Added `renderSettings` which controls misc. rendering/optimizations. - Updated documentation to @member, clarified Tileset - Added `containsTileIndex` method to allow being queried if the specific tile index is handled/supported. - Uses a firstgid bias and interlacing to fit the data in single densely packed array. - Updated documentation to @member, clarified
- Minor regression fix, increasing argument specifity/documentation
This should also fix: #1240 |
These changes should alleviate some scrolling performance boos. The only breaking API changes are against some of the |
May alleviate #1194 - if this does shown an improvement (esp. in Canvas) then the next step is to add in overdraw and bounding support for texture moving for additional performance improvements in WebGL. |
* @param {integer} x | ||
* @param {integer} y | ||
*/ | ||
Phaser.TilemapLayer.prototype.shiftCanvas = function (context, x, y) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shifting the canvas is alot more efficient then redrawing the entire canvas.
Merging for test. If this goes forward I'm going to have to bump the version to 2.2.0 imho (especially given the ScaleManager updates as well) |
TilemapLayer / Tileset performance and documentation
Huge scrolling-performance efficiency increase and some cleanup.