Browse Source

Renamed the ISurface file. NESBank now extends ISurface.

dev-tmpl
Bryan Miller 5 years ago
parent
commit
82e88847df
2 changed files with 8 additions and 9 deletions
  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 View File


+ 8
- 9
app/js/models/NESBank.js View File

@@ -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…
Cancel
Save