dont serialize meta flag, wasm work
This commit is contained in:
@@ -47,6 +47,11 @@ fn void app_init(void);
|
||||
|
||||
fn void wasm_add_event(app_event_t event) {
|
||||
app_event_t *ev = ma_push_type(tcx.temp, app_event_t);
|
||||
ev->alt = wasm_cached.alt;
|
||||
ev->ctrl = wasm_cached.ctrl;
|
||||
ev->meta = wasm_cached.meta;
|
||||
ev->shift = wasm_cached.shift;
|
||||
ev->mouse_pos = wasm_cached.mouse_pos;
|
||||
SLLQ_APPEND(wasm_event_list.first, wasm_event_list.last, ev);
|
||||
wasm_event_list.len += 1;
|
||||
}
|
||||
@@ -56,11 +61,6 @@ fn_wasm_export void wasm_mouse_move(f64 x, f64 y, b32 ctrl, b32 shift, b32 alt,
|
||||
wasm_cached.ctrl = ctrl; wasm_cached.alt = alt; wasm_cached.meta = meta; wasm_cached.shift = shift;
|
||||
wasm_add_event((app_event_t){
|
||||
.kind = app_event_kind_mouse_move,
|
||||
.mouse_pos = {x, y},
|
||||
.ctrl = ctrl,
|
||||
.shift = shift,
|
||||
.alt = alt,
|
||||
.meta = meta,
|
||||
});
|
||||
}
|
||||
|
||||
@@ -71,12 +71,7 @@ fn_wasm_export void wasm_mouse_down(f64 x, f64 y, i32 button, b32 ctrl, b32 shif
|
||||
wasm_cached.mouse_pos = (v2f64_t){x, y};
|
||||
wasm_add_event((app_event_t){
|
||||
.kind = app_event_kind_mouse_down,
|
||||
.mouse_pos = {x, y},
|
||||
.mouse_button = button,
|
||||
.ctrl = ctrl,
|
||||
.shift = shift,
|
||||
.alt = alt,
|
||||
.meta = meta,
|
||||
});
|
||||
}
|
||||
|
||||
@@ -87,12 +82,7 @@ fn_wasm_export void wasm_mouse_up(f64 x, f64 y, i32 button, b32 ctrl, b32 shift,
|
||||
wasm_cached.mouse_pos = (v2f64_t){x, y};
|
||||
wasm_add_event((app_event_t){
|
||||
.kind = app_event_kind_mouse_up,
|
||||
.mouse_pos = {x, y},
|
||||
.mouse_button = button,
|
||||
.ctrl = ctrl,
|
||||
.shift = shift,
|
||||
.alt = alt,
|
||||
.meta = meta,
|
||||
});
|
||||
}
|
||||
|
||||
@@ -102,11 +92,6 @@ fn_wasm_export void wasm_mouse_wheel(f64 x, f64 y, f64 delta_x, f64 delta_y, f64
|
||||
wasm_add_event((app_event_t){
|
||||
.kind = app_event_kind_mouse_wheel,
|
||||
.mouse_wheel_delta = {delta_x, delta_y, delta_z},
|
||||
.mouse_pos = {x, y},
|
||||
.ctrl = ctrl,
|
||||
.shift = shift,
|
||||
.alt = alt,
|
||||
.meta = meta,
|
||||
});
|
||||
}
|
||||
|
||||
@@ -119,12 +104,7 @@ fn_wasm_export void wasm_key_down(char *key, b32 ctrl, b32 shift, b32 alt, b32 m
|
||||
if (map.key != app_key_null) {
|
||||
wasm_add_event((app_event_t){
|
||||
.kind = app_event_kind_key_down,
|
||||
.mouse_pos = wasm_cached.mouse_pos,
|
||||
.key = map.key,
|
||||
.ctrl = ctrl,
|
||||
.shift = shift,
|
||||
.alt = alt,
|
||||
.meta = meta,
|
||||
});
|
||||
}
|
||||
|
||||
@@ -136,12 +116,7 @@ fn_wasm_export void wasm_key_down(char *key, b32 ctrl, b32 shift, b32 alt, b32 m
|
||||
s8_t text = s8_copy(tcx.temp, key8);
|
||||
wasm_add_event((app_event_t){
|
||||
.kind = app_event_kind_text,
|
||||
.mouse_pos = wasm_cached.mouse_pos,
|
||||
.text = text,
|
||||
.ctrl = ctrl,
|
||||
.shift = shift,
|
||||
.alt = alt,
|
||||
.meta = meta,
|
||||
});
|
||||
}
|
||||
|
||||
@@ -155,12 +130,7 @@ fn_wasm_export void wasm_key_up(char *key, b32 ctrl, b32 shift, b32 alt, b32 met
|
||||
if (map.key != app_key_null) {
|
||||
wasm_add_event((app_event_t){
|
||||
.kind = app_event_kind_key_up,
|
||||
.mouse_pos = wasm_cached.mouse_pos,
|
||||
.key = map.key,
|
||||
.ctrl = ctrl,
|
||||
.shift = shift,
|
||||
.alt = alt,
|
||||
.meta = meta,
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -173,14 +143,7 @@ fn_wasm_export b32 wasm_update(f64 time, f64 width, f64 height, f64 dpr) {
|
||||
wasm_dpr = dpr;
|
||||
|
||||
if (wasm_event_list.first == NULL) {
|
||||
wasm_add_event((app_event_t){
|
||||
.kind = app_event_kind_update,
|
||||
.mouse_pos = wasm_cached.mouse_pos,
|
||||
.alt = wasm_cached.alt,
|
||||
.ctrl = wasm_cached.ctrl,
|
||||
.meta = wasm_cached.meta,
|
||||
.shift = wasm_cached.shift,
|
||||
});
|
||||
wasm_add_event((app_event_t){.kind = app_event_kind_update});
|
||||
}
|
||||
|
||||
for (app_event_t *ev = wasm_event_list.first; ev; ev = ev->next) {
|
||||
|
||||
Reference in New Issue
Block a user