Skip to content

Commit d2b1858

Browse files
authored
Merge pull request #194 from rpgtkoolmv/fix_newgame_filcker
Fix delay of drawing maps after NewGame
2 parents 270bb0b + 6babf94 commit d2b1858

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

js/rpg_sprites/Spriteset_Base.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ Spriteset_Base.prototype.createWebGLToneChanger = function() {
6060
var width = Graphics.width + margin * 2;
6161
var height = Graphics.height + margin * 2;
6262
this._toneFilter = new ToneFilter();
63+
this._toneFilter.enabled = false;
6364
this._baseSprite.filters = [this._toneFilter];
6465
this._baseSprite.filterArea = new Rectangle(-margin, -margin, width, height);
6566
};
@@ -116,8 +117,13 @@ Spriteset_Base.prototype.updateToneChanger = function() {
116117
Spriteset_Base.prototype.updateWebGLToneChanger = function() {
117118
var tone = this._tone;
118119
this._toneFilter.reset();
119-
this._toneFilter.adjustTone(tone[0], tone[1], tone[2]);
120-
this._toneFilter.adjustSaturation(-tone[3]);
120+
if (tone[0] || tone[1] || tone[2] || tone[3]) {
121+
this._toneFilter.enabled = true;
122+
this._toneFilter.adjustTone(tone[0], tone[1], tone[2]);
123+
this._toneFilter.adjustSaturation(-tone[3]);
124+
} else {
125+
this._toneFilter.enabled = false;
126+
}
121127
};
122128

123129
Spriteset_Base.prototype.updateCanvasToneChanger = function() {

0 commit comments

Comments
 (0)