瀏覽代碼

Renamed the ISurface file. NESBank now extends ISurface.

dev-tmpl
Bryan Miller 5 年之前
父節點
當前提交
82e88847df
共有 2 個檔案被更改,包括 8 行新增9 行删除
  1. +0
    -0
      app/js/ifaces/ISurface.js
  2. +8
    -9
      app/js/models/NESBank.js

app/js/ifaces/Surface.js → app/js/ifaces/ISurface.js 查看文件


+ 8
- 9
app/js/models/NESBank.js 查看文件

@@ -1,5 +1,6 @@

import Utils from "/app/js/common/Utils.js";
import ISurface from "/app/js/ifaces/ISurface.js";
import NESTile from "/app/js/models/NESTile.js";
import NESPalette from "/app/js/models/NESPalette.js";

@@ -24,17 +25,11 @@ function LRIdx2TileIdxCo(index){
return res;
}

export default class NESBank {
export default class NESBank extends ISurface{
constructor(){
super();
this.__LP = []; // Left Patterns (Sprites)
this.__RP = []; // Right Patterns (Backgrounds)
this.__default_pi = [
"#080808",
"#343434",
"#a2a2a2",
"#efefef",
"#666666" // Out of bounds color.
];
this.__RP = []; // Right Patterns (Backgrounds)

for (var i=0; i < 256; i++){
this.__LP.push(new NESTile());
@@ -74,6 +69,10 @@ export default class NESBank {
}
}

get width(){return 256;}
get height(){return 128;}
get length(){return this.width * this.height;}

get coloridx(){
return new Proxy(this, {
get:function(obj, prop){

Loading…
取消
儲存