Skip to content

Commit

Permalink
Remove throw_bomb() binding
Browse files Browse the repository at this point in the history
  • Loading branch information
rexim committed Oct 5, 2024
1 parent 89f049c commit 7624dee
Show file tree
Hide file tree
Showing 7 changed files with 1 addition and 7 deletions.
Binary file modified client.wasm
Binary file not shown.
2 changes: 1 addition & 1 deletion common.c3
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ fn Bombs* allocate_bombs() @extern("allocate_bombs") @wasm {
return mem::new(Bombs);
}

fn int throw_bomb(float player_position_x, float player_position_y, float player_direction, Bombs *bombs) @extern("throw_bomb") @wasm {
fn int throw_bomb(float player_position_x, float player_position_y, float player_direction, Bombs *bombs) {
foreach (index, &bomb: *bombs) {
if (bomb.lifetime <= 0) {
bomb.lifetime = BOMB_LIFETIME;
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,
throw_bomb: wasm.instance.exports.throw_bomb,
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,
throw_bomb: (player_position_x: number, player_position_y: number, player_direction: number, bombs: number) => number,
scene_can_rectangle_fit_here: (scene: number, px: number, py: number, sx: number, sy: number) => boolean,
allocate_default_scene: () => number,
}
Expand All @@ -23,7 +22,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,
throw_bomb: wasm.instance.exports.throw_bomb as (player_position_x: number, player_position_y: number, player_direction: number, bombs: number) => 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 @@ -122,7 +122,6 @@ async function instantiateWasmServer(path) {
...wasmCommon,
stats_inc_counter: wasm.instance.exports.stats_inc_counter,
reconstruct_state_of_items: wasm.instance.exports.reconstruct_state_of_items,
throw_bomb: wasm.instance.exports.throw_bomb,
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 @@ -111,7 +111,6 @@ function tick() {
interface WasmServer extends common.WasmCommon {
stats_inc_counter: (entry: number, delta: number) => void,
reconstruct_state_of_items: (items: number) => number,
throw_bomb: (player_position_x: number, player_position_y: number, player_direction: number, bombs: 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 @@ -155,7 +154,6 @@ async function instantiateWasmServer(path: string): Promise<WasmServer> {
...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,
throw_bomb: wasm.instance.exports.throw_bomb as (player_position_x: number, player_position_y: number, player_direction: number, bombs: 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 7624dee

Please sign in to comment.