var _LoadMovieArr = [];
Game_Interpreter.prototype.MovieLoad = function(_MovieStr , _EndCloseFlg) {
    var _EndCloseFlg = typeof _EndCloseFlg !== 'undefined' ? _EndCloseFlg : false;
    this.N_Plgin("MP_SET_MOVIE",[_MovieStr]);
    var _addFlg = true;
    for (var i = 0; i <= _LoadMovieArr.length - 1; i++) {
        if(_LoadMovieArr[i].Name == _MovieStr){
            _addFlg = false;
            _LoadMovieArr[i].EndCloseFlg = _EndCloseFlg;
        }
    }
    if(_addFlg){
        _LoadMovieArr.push(new Movie_Data(_MovieStr , _EndCloseFlg));
    }
}
class Movie_Data {
    constructor(_Name , _EndCloseFlg){
        this.Name = _Name;
        this.EndCloseFlg = _EndCloseFlg;
    }
};
var _MovieAlphaFlg = false;
Game_Interpreter.prototype.MoviePlay = function(PicNo , _MovieStr , _LoopFlg , _EndCloseFlg , setx, sety , _opi , _mx , _my) {
    var _LoopFlg = typeof _LoopFlg !== 'undefined' ? _LoopFlg : false;
    var _EndCloseFlg = typeof _EndCloseFlg !== 'undefined' ? _EndCloseFlg : false;
    var setx = typeof setx !== 'undefined' ? setx : 0;
    var sety = typeof sety !== 'undefined' ? sety : 0;
    var _opi = typeof _opi !== 'undefined' ? _opi : 255;
    var _mx = typeof _mx !== 'undefined' ? _mx : 100;
    var _my = typeof _my !== 'undefined' ? _my : 100;
    this.MovieLoad(_MovieStr , _EndCloseFlg);
    if(_MovieAlphaFlg) {
        this.N_Plgin("MP_SET_MOVIE",[_MovieStr, "on"]);
    }
    $gameScreen.showPicture(PicNo, "", NP_原点, setx, sety, _mx, _my, _opi, 0);
    if(_LoopFlg){
        this.N_Plgin("MP_SET_LOOP",[PicNo, "on"]);
    } else {
        this.N_Plgin("MP_SET_LOOP",[PicNo , "off"]);
    }
    NP_原点 = 0;
    _MovieAlphaFlg = false;
}
Game_Interpreter.prototype.MoviePlayC = function(PicNo , _MovieStr , _LoopFlg , _EndCloseFlg , setx, sety , _opi , _mx , _my) {
    NP_原点 = 1; 
    this.MoviePlay(PicNo , _MovieStr , _LoopFlg , _EndCloseFlg , setx, sety , _opi , _mx , _my);
}
Game_Interpreter.prototype.A_MoviePlay = function(PicNo , _MovieStr , _LoopFlg , _EndCloseFlg , setx, sety , _opi , _mx , _my) {
    _MovieAlphaFlg = true;
    this.MoviePlay(PicNo , _MovieStr , _LoopFlg , _EndCloseFlg , setx, sety , _opi , _mx , _my);
}
Game_Interpreter.prototype.A_MoviePlayC = function(PicNo , _MovieStr , _LoopFlg , _EndCloseFlg , setx, sety , _opi , _mx , _my) {
    _MovieAlphaFlg = true;
    NP_原点 = 1; 
    this.MoviePlay(PicNo , _MovieStr , _LoopFlg , _EndCloseFlg , setx, sety , _opi , _mx , _my);
}
Game_Interpreter.prototype.MovieStop = function(PicNo){
    this.N_Plgin("MP_SET_PAUSE",[PicNo, "on"]);
}
Game_Interpreter.prototype.MovieReStart = function(PicNo){
    this.N_Plgin("MP_SET_PAUSE",[PicNo, "off"]);
}
var _FOutDel_Arr = [];
Game_Interpreter.prototype.MovieFOutEnd = function(PicNo , _flame){
    var _flame = typeof _flame !== 'undefined' ? _flame : 10;
    this.MovePict(PicNo , true , true , _flame , 0 , true , true);
    _FOutDel_Arr.push(PicNo);
}
var _NMov_Update = Game_Interpreter.prototype.NUpdateSc;
Game_Interpreter.prototype.NUpdateSc = function () {
    _NMov_Update.call(this);
    for (var i = 0; i <= _FOutDel_Arr.length - 1; i++) {
        var _PicNo = _FOutDel_Arr[i];
        var _GetPicData = this.PicObjGet(_PicNo);
        if(_GetPicData == null){
            _FOutDel_Arr.splice(i , 1);
            i--;
        } else {
            if(_GetPicData._opacity == 0){
                this.DelPict(_PicNo);
                _FOutDel_Arr.splice(i , 1);
                i--;
            }
        }
    }
}
