Skip to content

Commit

Permalink
small change
Browse files Browse the repository at this point in the history
stutxo committed Apr 5, 2024
1 parent 394839e commit 8a31618
Showing 2 changed files with 9 additions and 43 deletions.
39 changes: 3 additions & 36 deletions docs/index.html
Original file line number Diff line number Diff line change
@@ -112,7 +112,7 @@ <h1 style="text-align: center; color: #333;">blockwars.gg</h1>
<script>
//This is a base64 encoded WebAssembly binary, it is 33% bigger than the original .wasm binary, im just testing it out.
// Base64WasmStart
const base64Wasm = 'AGFzbQEAAAABBAFgAAADAgEABQMBABQGOQd/AUGAgMAAC38AQcGBwAALfwBBwIHAAAt/AEHI8c8AC38AQcSBwAALfwBByPnPAAt/AEHQ+c8ACwdPCAZtZW1vcnkCAAlibG9ja3dhcnMAAAVSRVNFVAMBBUlOUFVUAwIEU0VFRAMDBERSQVcDBApfX2RhdGFfZW5kAwULX19oZWFwX2Jhc2UDBgqjDAGgDAINfwp9IwBBgAhrIgokAAJAQcGBwAAtAABBAUYEQEHAgcAAQQA6AABBwYHAAEEAOgAAQQAgCiIBa0EDcSICIAFqIQcgAgRAIAEhBUHI8c8AIQgDQCAFIAgtAAA6AAAgCEEBaiEIIAVBAWoiBSAHSQ0ACwsgB0GACCACayILQXxxIglqIQUCQCACQcjxzwBqIgJBA3EEQCAJQQBMDQEgAkEDdCIEQRhxIQwgAkF8cSIIQQRqIQNBACAEa0EYcSEEIAgoAgAhCANAIAcgCCAMdiADKAIAIgggBHRyNgIAIANBBGohAyAHQQRqIgcgBUkNAAsMAQsgCUEATA0AIAIhAwNAIAcgAygCADYCACADQQRqIQMgB0EEaiIHIAVJDQALCyACIAlqIQMgC0EDcSICBEAgAiAFaiECA0AgBSADLQAAOgAAIANBAWohAyAFQQFqIgUgAkkNAAsLA0AgACABaigCACAGcyEGIABBBGoiAEGACEcNAAtBACEAIAZBDXQgBnMiAUERdiABcyIBQQV0IAFzIgJBCnBBAmoiBiEEIAIhAQNAIARFBEAgAkEEdCACQQpuQaABbGtBoIDAAGohAANAIAZBDE8E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EBNgIAC0HAgcAAQQA6AAALQQQhBEEBIQADQCAAQQFxRQ0BIASzIRBBACEBA0AgASICQcABRwRAIAJBEGohASACQYCAQGsoAgBFDQEgAkGMgMAAaioCACAQXA0BIAJBiIDAAGoqAgAhDiACQYSAwABqKgIAIQ9BACEDA0AgA0H/AXEiAkEJSw0CIA4gArOSIg1DAAAAAGAhAkEAIQBBfwJ/IA1DAACAT10gDUMAAAAAYHEEQCANqQwBC0EAC0EAIAIbIA1D//9/T14bQf8BbCEFA0AgAEH/AXEiAkEJTQRAIA8gArOSIg1DAAAAAGAhAiAAQQFqIQBBfwJ/IA1DAACAT10gDUMAAAAAYHEEQCANqQwBC0EAC0EAIAIbIA1D//9/T14bIAVqIgJBgPwDSw0BIAJBAnRBxIHAAGogBDYCAAwBCwsgA0EBaiEDDAALAAsLIARBAEchACAEQQFrIgFBACABIARNGyEEDAALAAsgCkGACGokAAs=';
// Base64WasmEnd
const canvas = document.getElementById('canvas');

@@ -131,41 +131,8 @@ <h1 style="text-align: center; color: #333;">blockwars.gg</h1>

let blockHeight = 0;
let lastWorkingBlockHeight = 0;
//32 array of genesis hardcoded
let seedData = [
0,
0,
0,
0,
0,
25,
214,
104,
156,
8,
90,
225,
101,
131,
30,
147,
79,
247,
99,
174,
70,
162,
166,
193,
114,
179,
241,
182,
10,
140,
226,
111
];

let seedData = [];

async function loadWasm() {
get_current_block();
13 changes: 6 additions & 7 deletions src/lib.rs
Original file line number Diff line number Diff line change
@@ -47,13 +47,13 @@ unsafe extern "C" fn blockwars() {
let mut rng = rng(SEED);
spawn_tele(&mut *ptr::addr_of_mut!(TELEPORT), &mut rng);
DRAW.iter_mut().for_each(|b| *b = 0);
} else {
frame_safe(
&mut *ptr::addr_of_mut!(DRAW),
&mut *ptr::addr_of_mut!(TELEPORT),
&mut *ptr::addr_of_mut!(INPUT),
);
}

frame_safe(
&mut *ptr::addr_of_mut!(DRAW),
&mut *ptr::addr_of_mut!(TELEPORT),
&mut *ptr::addr_of_mut!(INPUT),
);
}

//no unsafe code below this point
@@ -64,7 +64,6 @@ fn frame_safe(
input: &mut [u8; 1],
) {
update_tele_pos(teleporters, input);

render_frame(draw, teleporters);
}

0 comments on commit 8a31618

Please sign in to comment.