本帖最后由 tseyik 于 2016-8-12 09:28 编辑
修正1.3更新後出現的Bug
BGMのループがうまく機能しない
修正暗号化後
( function ( ) {
'use strict' ;
WebAudio.prototype ._onXhrLoad = function ( xhr) {
var array = xhr.response ;
if ( Decrypter.hasEncryptedAudio ) array = Decrypter.decryptArrayBuffer ( array) ;
this ._readLoopComments( new Uint8Array( array) ) ;
WebAudio._context.decodeAudioData ( array, function ( buffer) {
this ._buffer = buffer;
this ._totalTime = buffer.duration ;
if ( this ._loopLength > 0 && this ._sampleRate > 0 ) {
this ._loopStart /= this ._sampleRate;
this ._loopLength /= this ._sampleRate;
} else {
this ._loopStart = 0 ;
this ._loopLength = this ._totalTime;
}
this ._onLoad( ) ;
} .bind ( this ) ) ;
} ;
} ) ( ) ;
( function ( ) {
'use strict' ;
WebAudio.prototype ._onXhrLoad = function ( xhr) {
var array = xhr.response ;
if ( Decrypter.hasEncryptedAudio ) array = Decrypter.decryptArrayBuffer ( array) ;
this ._readLoopComments( new Uint8Array( array) ) ;
WebAudio._context.decodeAudioData ( array, function ( buffer) {
this ._buffer = buffer;
this ._totalTime = buffer.duration ;
if ( this ._loopLength > 0 && this ._sampleRate > 0 ) {
this ._loopStart /= this ._sampleRate;
this ._loopLength /= this ._sampleRate;
} else {
this ._loopStart = 0 ;
this ._loopLength = this ._totalTime;
}
this ._onLoad( ) ;
} .bind ( this ) ) ;
} ;
} ) ( ) ;
マップスクロール時にタイルの下が欠ける
( function ( ) {
'use strict' ;
var TileRenderer = PIXI.WebGLRenderer .__plugins.tile ;
TileRenderer.prototype .checkIndexBuffer = function ( size) {
// the total number of indices in our array, there are 6 points per quad.
var totalIndices = size * 6 ;
var indices = this .indices ;
if ( totalIndices <= indices.length ) {
return ;
}
var len = indices.length || totalIndices;
while ( len < totalIndices) {
len <<= 1 ;
}
indices = new Uint16Array( len) ;
this .indices = indices;
// fill the indices with the quads to draw
for ( var i=0 , j=0 ; i < len; i += 6 , j += 4 )
{
indices[ i + 0 ] = j + 0 ;
indices[ i + 1 ] = j + 1 ;
indices[ i + 2 ] = j + 2 ;
indices[ i + 3 ] = j + 0 ;
indices[ i + 4 ] = j + 2 ;
indices[ i + 5 ] = j + 3 ;
}
this .indexBuffer .upload ( indices) ;
} ;
TileRenderer.prototype .getVb = function ( id) {
this .checkLeaks ( ) ;
var vb = this .vbs [ id] ;
if ( vb) {
vb.lastTimeAccess = Date.now ( ) ;
return vb;
}
return null ;
} ;
} ) ( ) ;
( function ( ) {
'use strict' ;
var TileRenderer = PIXI.WebGLRenderer .__plugins.tile ;
TileRenderer.prototype .checkIndexBuffer = function ( size) {
// the total number of indices in our array, there are 6 points per quad.
var totalIndices = size * 6 ;
var indices = this .indices ;
if ( totalIndices <= indices.length ) {
return ;
}
var len = indices.length || totalIndices;
while ( len < totalIndices) {
len <<= 1 ;
}
indices = new Uint16Array( len) ;
this .indices = indices;
// fill the indices with the quads to draw
for ( var i=0 , j=0 ; i < len; i += 6 , j += 4 )
{
indices[ i + 0 ] = j + 0 ;
indices[ i + 1 ] = j + 1 ;
indices[ i + 2 ] = j + 2 ;
indices[ i + 3 ] = j + 0 ;
indices[ i + 4 ] = j + 2 ;
indices[ i + 5 ] = j + 3 ;
}
this .indexBuffer .upload ( indices) ;
} ;
TileRenderer.prototype .getVb = function ( id) {
this .checkLeaks ( ) ;
var vb = this .vbs [ id] ;
if ( vb) {
vb.lastTimeAccess = Date.now ( ) ;
return vb;
}
return null ;
} ;
} ) ( ) ;
同じマップ内で、異なる色を指定して2回「画面のフラッシュ」を実行すると、2回目のフラッシュ色が1回目と同じ色になってしまう現象の修正になります
//=============================================================================
// BugFixScreenFlash.js
// ----------------------------------------------------------------------------
// Copyright (c) 2015-2016 Triacontane
// This software is released under the MIT License.
// [url]http://opensource.org/licenses/mit-license.php[/url]
// ----------------------------------------------------------------------------
// Version
// 1.0.0 2016/08/11 初版
// ----------------------------------------------------------------------------
// [Blog] : [url]http://triacontane.blogspot.jp/[/url]
// [Twitter]: [url]https://twitter.com/triacontane/[/url]
// [GitHub] : [url]https://github.com/triacontane/[/url]
//=============================================================================
/*:
* @plugindesc Bug fix Screen Flash for Web GL
* @author triacontane
*
* @help Bug fix Screen Flash for Web GL
*
* This plugin is released under the MIT License.
*/
/*:ja
* @plugindesc 画面のフラッシュバグ修正プラグイン
* @author トリアコンタン
*
* @help WebGLモードにて同じマップで連続して異なる色を指定して「画面のフラッシュ」を
* 実行した際に後に指定したフラッシュ色が反映されない問題を修正します。
* この問題は本体バージョン1.3.0にて新たに発生するようになりました。
*
* このプラグインにはプラグインコマンドはありません。
*
* 利用規約:
* バグ修正プラグインにつき規約なしの無条件でご利用頂けます。
*/
( function ( ) {
'use strict' ;
ScreenSprite.prototype ._renderWebGL = function ( renderer) {
this ._bitmap.checkDirty ( ) ;
PIXI.Sprite .prototype ._renderWebGL.call ( this , renderer) ;
} ;
} ) ( ) ;
//=============================================================================
// BugFixScreenFlash.js
// ----------------------------------------------------------------------------
// Copyright (c) 2015-2016 Triacontane
// This software is released under the MIT License.
// [url]http://opensource.org/licenses/mit-license.php[/url]
// ----------------------------------------------------------------------------
// Version
// 1.0.0 2016/08/11 初版
// ----------------------------------------------------------------------------
// [Blog] : [url]http://triacontane.blogspot.jp/[/url]
// [Twitter]: [url]https://twitter.com/triacontane/[/url]
// [GitHub] : [url]https://github.com/triacontane/[/url]
//=============================================================================
/*:
* @plugindesc Bug fix Screen Flash for Web GL
* @author triacontane
*
* @help Bug fix Screen Flash for Web GL
*
* This plugin is released under the MIT License.
*/
/*:ja
* @plugindesc 画面のフラッシュバグ修正プラグイン
* @author トリアコンタン
*
* @help WebGLモードにて同じマップで連続して異なる色を指定して「画面のフラッシュ」を
* 実行した際に後に指定したフラッシュ色が反映されない問題を修正します。
* この問題は本体バージョン1.3.0にて新たに発生するようになりました。
*
* このプラグインにはプラグインコマンドはありません。
*
* 利用規約:
* バグ修正プラグインにつき規約なしの無条件でご利用頂けます。
*/
( function ( ) {
'use strict' ;
ScreenSprite.prototype ._renderWebGL = function ( renderer) {
this ._bitmap.checkDirty ( ) ;
PIXI.Sprite .prototype ._renderWebGL.call ( this , renderer) ;
} ;
} ) ( ) ;
另外
開始時にコンソールにWebGLの警告
好像是Chrome和OpenGL駆動的問題
ChromeのWebGL事情説明(エンジニア向け):
Windows版ChromeはANGLEという、OpenGLAPIをDirectXAPIに変換するミドルウェアを使っています。
昔IntelのOpenGLドライバが悲しみを生んでたのでこうなってます