Browse Source

Fix to ISurface and NESBank .getColorIndex() method's return value.

dev-tmpl
Bryan Miller 5 years ago
parent
commit
8d46e8a75f
2 changed files with 4 additions and 1 deletions
  1. +1
    -1
      app/js/ifaces/ISurface.js
  2. +3
    -0
      app/js/models/NESBank.js

+ 1
- 1
app/js/ifaces/ISurface.js View File

@@ -50,7 +50,7 @@ export default class ISurface{
}

getColorIndex(x, y){
return 0;
return {pi:-1, ci:-1};
}

setColorIndex(x, y, ci, pi){

+ 3
- 0
app/js/models/NESBank.js View File

@@ -194,6 +194,9 @@ export default class NESBank extends ISurface{
}

getColorIndex(x, y){
if (x < 0 || x >= 256 || y < 0 || y >= 128)
return {pi: -1, ci:this.__default_pi[4]};

var res = LRIdx2TileIdxCo((y*256)+x);
var list = (res.lid === 0) ? this.__LP : this.__RP;
return {

Loading…
Cancel
Save