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 f5a86fe commit 837f712
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions teddy/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -493,6 +493,8 @@ <h2>Project history</h2>
}
}

let debug_first = false;

class LevelSet {
constructor(data, header) {
this.header = header;
Expand Down Expand Up @@ -536,7 +538,7 @@ <h2>Project history</h2>
level.height = new Uint16Array(data.slice(startLevel + 20, startLevel + 22))[0];
let dec = new TextDecoder();
level.name = dec.decode(data.slice(startLevel + 22, startLevel + 32));
let plane0 = this.rwle_expand(magic, data.slice(startPlane0, startPlane0 + lengthPlane0), true);
let plane0 = this.rwle_expand(magic, data.slice(startPlane0, startPlane0 + lengthPlane0));
let plane1 = this.rwle_expand(magic, data.slice(startPlane1, startPlane1 + lengthPlane1));
let plane2 = this.rwle_expand(magic, data.slice(startPlane2, startPlane2 + lengthPlane2));
level.planes.push(new Plane(startPlane0, lengthPlane0, plane0));
Expand All @@ -553,7 +555,7 @@ <h2>Project history</h2>
while (i < data.byteLength) {
let v = new Uint16Array(data.slice(i, i + 2))[0];
// debug info
if (debug) {
if (debug_first) {
console.log("index", i, "value", v, "is_magic?", v == magic);
}
// end debug info
Expand All @@ -568,6 +570,7 @@ <h2>Project history</h2>
expanded.push(v);
}
}
debug_first = false;
return expanded;
}

Expand Down

0 comments on commit 837f712

Please sign in to comment.