mirror of
https://github.com/piskelapp/piskel.git
synced 2023-08-10 21:12:52 +03:00
Make piskel performance warning less scary
This commit is contained in:
parent
da739e78da
commit
51538dff48
@ -16,7 +16,7 @@
|
|||||||
*/
|
*/
|
||||||
ns.PerformanceReport = function (piskel, colorsCount) {
|
ns.PerformanceReport = function (piskel, colorsCount) {
|
||||||
var pixels = piskel.getWidth() * piskel.getHeight();
|
var pixels = piskel.getWidth() * piskel.getHeight();
|
||||||
this.resolution = pixels > (500 * 500);
|
this.resolution = pixels > (512 * 512);
|
||||||
|
|
||||||
var layersCount = piskel.getLayers().length;
|
var layersCount = piskel.getLayers().length;
|
||||||
this.layers = layersCount > 25;
|
this.layers = layersCount > 25;
|
||||||
@ -24,10 +24,10 @@
|
|||||||
var framesCount = piskel.getLayerAt(0).size();
|
var framesCount = piskel.getLayerAt(0).size();
|
||||||
this.frames = framesCount > 100;
|
this.frames = framesCount > 100;
|
||||||
|
|
||||||
this.colors = colorsCount > 100;
|
this.colors = colorsCount >= 256;
|
||||||
|
|
||||||
var overallScore = (pixels / 2500) + (layersCount * 4) + framesCount + colorsCount;
|
var overallScore = (pixels / 2620) + (layersCount * 4) + framesCount + (colorsCount * 100 / 256);
|
||||||
this.overall = overallScore > 100;
|
this.overall = overallScore > 200;
|
||||||
};
|
};
|
||||||
|
|
||||||
ns.PerformanceReport.prototype.equals = function (report) {
|
ns.PerformanceReport.prototype.equals = function (report) {
|
||||||
|
@ -15,10 +15,10 @@
|
|||||||
<p>If you ignore this warning, please save often!</p>
|
<p>If you ignore this warning, please save often!</p>
|
||||||
<p>To fix the issue, try adjusting your sprite settings:</p>
|
<p>To fix the issue, try adjusting your sprite settings:</p>
|
||||||
<ul>
|
<ul>
|
||||||
<li>sprite resolution <sup title="recommended: lower than 256x256, max: 512x512" rel="tooltip" data-placement="top">?</sup></li>
|
<li>sprite resolution <sup title="recommended: lower than 512x512" rel="tooltip" data-placement="top">?</sup></li>
|
||||||
<li>number of layers <sup title="recommended: lower than 5, max: 20" rel="tooltip" data-placement="top">?</sup></li>
|
<li>number of layers <sup title="recommended: less than 10" rel="tooltip" data-placement="top">?</sup></li>
|
||||||
<li>number of frames <sup title="recommended: lower than 25, max: 100" rel="tooltip" data-placement="top">?</sup></li>
|
<li>number of frames <sup title="recommended: less than 50" rel="tooltip" data-placement="top">?</sup></li>
|
||||||
<li>number of colors <sup title="max: 100" rel="tooltip" data-placement="top">?</sup></li>
|
<li>number of colors <sup title="recommended: less than 256" rel="tooltip" data-placement="top">?</sup></li>
|
||||||
</ul>
|
</ul>
|
||||||
<p>We strive to improve Piskel, its performance and stability, but this is a personal project with limited time and resources.
|
<p>We strive to improve Piskel, its performance and stability, but this is a personal project with limited time and resources.
|
||||||
We prefer to warn you early rather than having you lose your work.</p>
|
We prefer to warn you early rather than having you lose your work.</p>
|
||||||
|
Loading…
Reference in New Issue
Block a user