Skip to content

Commit

Permalink
debug teddy
Browse files Browse the repository at this point in the history
  • Loading branch information
Xitog committed Dec 1, 2024
1 parent 837f712 commit 9d48122
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions teddy/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -493,9 +493,9 @@ <h2>Project history</h2>
}
}

let debug_first = false;

class LevelSet {
static debug_first = true;

constructor(data, header) {
this.header = header;
let dec = new TextDecoder();
Expand Down Expand Up @@ -547,15 +547,15 @@ <h2>Project history</h2>
return level;
}

rwle_expand(magic, data, debug=false) {
rwle_expand(magic, data) {
let size = new Uint16Array(data.slice(0, 2))[0];
console.log("RWLE EXPAND SIZE = " + size);
let expanded = [];
let i = 2;
while (i < data.byteLength) {
let v = new Uint16Array(data.slice(i, i + 2))[0];
// debug info
if (debug_first) {
if (LevelSet.debug_first) {
console.log("index", i, "value", v, "is_magic?", v == magic);
}
// end debug info
Expand All @@ -570,7 +570,7 @@ <h2>Project history</h2>
expanded.push(v);
}
}
debug_first = false;
LevelSet.debug_first = false;
return expanded;
}

Expand Down

0 comments on commit 9d48122

Please sign in to comment.