Skip to content

Commit

Permalink
Remove more unused bindings
Browse files Browse the repository at this point in the history
  • Loading branch information
rexim committed Oct 5, 2024
1 parent 7624dee commit d4a0c6b
Show file tree
Hide file tree
Showing 7 changed files with 2 additions and 8 deletions.
Binary file modified client.wasm
Binary file not shown.
4 changes: 2 additions & 2 deletions common.c3
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ fn bool Scene.get_tile(Scene *scene, Vector2 p) {
return scene.walls[y*scene.width + x];
}

fn bool scene_can_rectangle_fit_here(Scene *scene, float px, float py, float sx, float sy) @extern("scene_can_rectangle_fit_here") @wasm {
fn bool scene_can_rectangle_fit_here(Scene *scene, float px, float py, float sx, float sy) {
int x1 = (int)math::floor(px - sx*0.5f);
int x2 = (int)math::floor(px + sx*0.5f);
int y1 = (int)math::floor(py - sy*0.5f);
Expand Down Expand Up @@ -184,7 +184,7 @@ struct ItemsSpawnedBatchMessage @packed {
ItemSpawned[*] items;
}

fn ItemsSpawnedBatchMessage* reconstruct_state_of_items(Item[] *items) @extern("reconstruct_state_of_items") @wasm {
fn ItemsSpawnedBatchMessage* reconstruct_state_of_items(Item[] *items) {
usz itemsCount = 0;
foreach (&item: *items) {
if (item.alive) itemsCount += 1;
Expand Down
1 change: 0 additions & 1 deletion common.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ export function makeWasmCommon(wasm) {
reset_temp_mark: wasm.instance.exports.reset_temp_mark,
allocate_temporary_buffer: wasm.instance.exports.allocate_temporary_buffer,
allocate_bombs: wasm.instance.exports.allocate_bombs,
scene_can_rectangle_fit_here: wasm.instance.exports.scene_can_rectangle_fit_here,
allocate_default_scene: wasm.instance.exports.allocate_default_scene,
};
}
Expand Down
2 changes: 0 additions & 2 deletions common.mts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ export interface WasmCommon {
reset_temp_mark: () => void,
allocate_temporary_buffer: (size: number) => number,
allocate_bombs: () => number,
scene_can_rectangle_fit_here: (scene: number, px: number, py: number, sx: number, sy: number) => boolean,
allocate_default_scene: () => number,
}

Expand All @@ -22,7 +21,6 @@ export function makeWasmCommon(wasm: WebAssembly.WebAssemblyInstantiatedSource):
reset_temp_mark: wasm.instance.exports.reset_temp_mark as () => void,
allocate_temporary_buffer: wasm.instance.exports.allocate_temporary_buffer as (size: number) => number,
allocate_bombs: wasm.instance.exports.allocate_bombs as () => number,
scene_can_rectangle_fit_here: wasm.instance.exports.scene_can_rectangle_fit_here as (scenePtr: number, px: number, py: number, sx: number, sy: number) => boolean,
allocate_default_scene: wasm.instance.exports.allocate_default_scene as () => number,
}
}
Expand Down
1 change: 0 additions & 1 deletion server.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,6 @@ async function instantiateWasmServer(path) {
return {
...wasmCommon,
stats_inc_counter: wasm.instance.exports.stats_inc_counter,
reconstruct_state_of_items: wasm.instance.exports.reconstruct_state_of_items,
register_new_player: wasm.instance.exports.register_new_player,
unregister_player: wasm.instance.exports.unregister_player,
process_message_on_server: wasm.instance.exports.process_message_on_server,
Expand Down
2 changes: 0 additions & 2 deletions server.mts
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,6 @@ function tick() {

interface WasmServer extends common.WasmCommon {
stats_inc_counter: (entry: number, delta: number) => void,
reconstruct_state_of_items: (items: number) => number,
register_new_player: (id: number, x: number, y: number, hue: number) => void,
unregister_player: (id: number) => void,
process_message_on_server: (id: number, message: number, bombs: number) => boolean,
Expand Down Expand Up @@ -153,7 +152,6 @@ async function instantiateWasmServer(path: string): Promise<WasmServer> {
return {
...wasmCommon,
stats_inc_counter: wasm.instance.exports.stats_inc_counter as (entry: number) => void,
reconstruct_state_of_items: wasm.instance.exports.reconstruct_state_of_items as (items: number) => number,
register_new_player: wasm.instance.exports.register_new_player as (id: number, x: number, y: number, hue: number) => void,
unregister_player: wasm.instance.exports.unregister_player as (id: number) => void,
process_message_on_server: wasm.instance.exports.process_message_on_server as (id: number, message: number, bombs: number) => boolean,
Expand Down
Binary file modified server.wasm
Binary file not shown.

0 comments on commit d4a0c6b

Please sign in to comment.