LoginSignup
1
1

More than 5 years have passed since last update.

RPGツクールMV - JGSS ver1.5.2 から ver1.6.2 への更新メモ

Last updated at Posted at 2019-04-09

いつの間にか RPGツクールMV アップデート ver.1.6.2 が配布されていたので、ver1.5.2 からの更新点のまとめ。

ver1.5.2 への更新メモ からの続きです。RPGツクールMV JGSS 技術メモ もよろしければどうぞ。

rpg_core.js

NW.js の引数も見るよう修正された模様。

Utils.isOptionValid = function(name) {
    if (location.search.slice(1).split('&').contains(name)) {return 1;};
    if (typeof nw !== "undefined" && nw.App.argv.length > 0 && nw.App.argv[0].split('&').contains(name)) {return 1;}; // 追加
    return 0;
};

また画面比率の計算で 1.00~1.01 の範囲の値を 1.00 に固定する処理が追加されています。何らかの実行環境で計算誤差が生じて表示に影響が出ていたのかもしれませんね。

Graphics._updateRealScale = function() {
    if (this._stretchEnabled) {
        var h = window.innerWidth / this._width;
        var v = window.innerHeight / this._height;
        if (h >= 1 && h - 0.01 <= 1) h = 1; // 追加
        if (v >= 1 && v - 0.01 <= 1) v = 1; // 追加
        this._realScale = Math.min(h, v);
    } else {
        this._realScale = this._scale;
    }
};

音楽の再生部分で、ループの指定より開始位置が後の場合は、ループ内に収まるようにロジックが追加された模様。バグ修正ですかね。

WebAudio.prototype._startPlaying = function(loop, offset) {
    if (this._loopLength > 0) {                             // 追加
     while (offset >= this._loopStart + this._loopLength) { // 追加
       offset -= this._loopLength;                          // 追加
     }                                                      // 追加
    }                                                       // 追加
    this._removeEndTimer();
    this._removeNodes();
    this._createNodes();
    this._connectNodes();
    this._sourceNode.loop = loop;
    this._sourceNode.start(0, offset);
    this._startTime = WebAudio._context.currentTime - offset / this._pitch;
    this._createEndTimer();
};

rpg_core.js の変更はこれぐらいかな。特に目立った変更は無いようですね。

rpg_objects.js

ver1.5.2 の時に気になっていた エンバグではないか? が対応された模様。

code == 112 の時に無条件に depth++ している部分にあわせ、そのあとの code == 413 のときの処理を変更したようです。これで多重ループ時の「ループの中断」がちゃんと動作するでしょう。

// Break Loop
Game_Interpreter.prototype.command113 = function () {
    var depth = 0;
    while (this._index < this._list.length - 1) {
        this._index++;
        var command = this.currentCommand();

        if (command.code === 112)
            depth++;

        if (command.code === 413 && command.indent < this._indent) { // ver1.5.2
        if (command.code === 413) {                                  // ver1.6.2
            if (depth > 0)
                depth--;
            else
                break;
        }
    }
    return true;
};

rpg_objects.js の修正もこれぐらいかな?バグが減って良かったですよね。

rpg_managers.js

rpg_managers.js も変更は少なくて、以下の部分に decodeURIComponent() を追加しただけの模様。

ImageManager.loadNormalBitmap = function(path, hue) {
    var key = this._generateCacheKey(path, hue);
    var bitmap = this._imageCache.get(key);
    if (!bitmap) {
        bitmap = Bitmap.load(path);                     // ver1.5.2
        bitmap = Bitmap.load(decodeURIComponent(path)); // ver1.6.2
        bitmap.addLoadListener(function() {
            bitmap.rotateHue(hue);
        });
        this._imageCache.add(key, bitmap);
    }else if(!bitmap.isReady()){
        bitmap.decode();
    }

    return bitmap;
};

でもこういった細かなブラッシュアップの積み重ねって、大事だったりするんですよね。

rpg_windows.js

以下のように setXXXXWindow() 系の関数から update() 関数の呼び出しが削除されたようです。

Window_ItemCategory.prototype.setItemWindow = function(itemWindow) {
    this._itemWindow = itemWindow;
    this.update(); // 削除
};

まあ Scene のほうで結局は update() はされるので、無駄が省かれて少しですが高速化したと言って良いのではないでしょうか。

Scene_Base.prototype.update = function() {
    this.updateFade();
    this.updateChildren();
};
Scene_Base.prototype.updateChildren = function() {
    this.children.forEach(function(child) {
        if (child.update) {
            child.update();
        }
    });
};

ただし update() が呼ばれるタイミングが遅くなるし、呼ばれる位置もだいぶ後になるので、Window 系の拡張で初期化のためこの関数をフックしていた方はちょっと注意が必要かもしれません。

そして名前入力の際に、LATIN2 文字がちゃんと定義されたようです!また地味に平仮名の もちゃんと定義されたようです。ゲームプレイヤーにとって嬉しい改良かもしれませんね!

Window_NameInput.LATIN2 =
        [ 'Á','É','Í','Ó','Ú',  'á','é','í','ó','ú',
          'À','È','Ì','Ò','Ù',  'à','è','ì','ò','ù',
          'Â','Ê','Î','Ô','Û',  'â','ê','î','ô','û',
          'Ä','Ë','Ï','Ö','Ü',  'ä','ë','ï','ö','ü',
          'Ā','Ē','Ī','Ō','Ū',  'ā','ē','ī','ō','ū',
          'Ã','Å','Æ','Ç','Ð',  'ã','å','æ','ç','ð',
          'Ñ','Õ','Ø','Š','Ŵ',  'ñ','õ','ø','š','ŵ',
          'Ý','Ŷ','Ÿ','Ž','Þ',  'ý','ÿ','ŷ','ž','þ',
          'IJ','Œ','ij','œ','ß',  '«','»',' ','Page','OK' ];

rpg_windows.js の修正はこんなところかな。このファイルの一番変更が多かった気がします。

変更なし

以下のファイルは今回は特に変更がない模様。

  • main.js
  • plugins.js
  • rpg_scenes.js
  • rpg_sprites.js

NW.js の更新

今回はコードの変更はバグ潰し程度でしたが、実行環境 NW.js の更新は影響が大きいかもしれませんね。NW 自体のバージョンは 0.29.4 で、node のバージョンは 9.11.1 のようですよ。
image.png
それではまた!

1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1