-
Notifications
You must be signed in to change notification settings - Fork 3
/
DP_MapZoom_Patch_For_MPP_MapLight.js
73 lines (62 loc) · 2.58 KB
/
DP_MapZoom_Patch_For_MPP_MapLight.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
//=============================================================================
// 🏤drowsepost Plugins - DP_MapZoom.js Patch for MPP_MapLight.js incompatibility
// DP_MapZoom_Patch_For_MPP_MapLight
// Version: 0.02
//
// Copyright (c) 2019 canotun
// Released under the MIT license.
// http://opensource.org/licenses/mit-license.php
//=============================================================================
//=============================================================================
/*:
* @plugindesc Resolve incompatibility between DP_MapZoom.js and MPP_MapLight.js
* @author drowsepost
* @help
* ============================================================================
* About
* ============================================================================
* Resolve incompatibility between DP_MapZoom.js and MPP_MapLight.js
* this patch after patch DP_MapZoom.js And MPP_MapLight.js
*
*/
/*:ja
* @plugindesc DP_MapZoom.jsとMPP_MapLight.jsの非互換性に対するパッチ
* @author drowsepost
* @help
* ============================================================================
* About
* ============================================================================
* DP_MapZoom.jsとMPP_MapLight.jsの非互換性に対するパッチです。
* DP_MapZoom.jsとMPP_MapLight.jsのの後に配置することで、
* MPP_MapLight.jsが多重にかかることを防止します
*/
(function() {
"use strict";
if(!('Game_Mpp_MapLight' in window)) {
console.log('DP_MapZoom.js MPP_MapLight patch : Please place this patch after patch MPP_MapLight.js');
return;
}
Tilemap.prototype._resizeDarknessLayer = function() {
var size = Tilemap._darknessTileSize;
var tileCols = Math.ceil(this._width / this._tileWidth) + 1;
var tileRows = Math.ceil(this._height / this._tileHeight) + 1;
var layerWidth = tileCols * size;
var layerHeight = tileRows * size;
this._darknessLayer.bitmap.resize(layerWidth, layerHeight);
this._darknessLayer.bitmap.fillAll();
this._darknessLayer.width = layerWidth;
this._darknessLayer.height = layerHeight;
this._darknessBitmap.resize(tileCols, tileRows);
}
var Tilemap__createDarknessLayer = Tilemap.prototype._createDarknessLayer;
Tilemap.prototype._createDarknessLayer = function() {
if(this._darknessBitmap instanceof Bitmap) {
this._resizeDarknessLayer();
} else {
Tilemap__createDarknessLayer.call(this);
}
}
ShaderTilemap.prototype._createDarknessLayer = function() {
Tilemap.prototype._createDarknessLayer.call(this);
};
}());