speed :: 30.0f; @ThemeConfiguration
scale_speed :: 0.02f; @ThemeConfiguration
- if is_key_down(38) do state.transform.translation.y += speed;
- if is_key_down(40) do state.transform.translation.y -= speed;
- if is_key_down(39) do state.transform.translation.x -= speed;
- if is_key_down(37) do state.transform.translation.x += speed;
-
- if is_key_down(187) do zoom(^state, r, 1.02);
- if is_key_down(189) do zoom(^state, r, 0.98);
+ if is_key_down(38) do state.transform.translation.y += speed;
+ if is_key_down(40) do state.transform.translation.y -= speed;
+ if is_key_down(39) do state.transform.translation.x -= speed;
+ if is_key_down(37) do state.transform.translation.x += speed;
+
+ // These keys are weird because keycode is not standard between all browsers... ugh
+ if is_key_down(187) || is_key_down(61) do zoom(^state, r, 1.02);
+ if is_key_down(189) || is_key_down(173) do zoom(^state, r, 0.98);
if mouse_state.left_button_just_down && !state.dragging {
state.dragging = true;
#include "onyxutils.h"
#include "onyxerrors.h"
-static u32 next_unique_id = 1;
-
// NOTE: These have to be in the same order as Basic
Type basic_types[] = {
{ Type_Kind_Basic, 0, 0, (AstType *) &basic_type_void, { Basic_Kind_Void, 0, 0, 1, "void" } },
static bh_imap type_vararg_map;
static void type_register(Type* type) {
+ static u32 next_unique_id = 1;
type->id = next_unique_id++;
bh_imap_put(&type_map, type->id, (u64) type);
#define PATCH (bh_arr_push(base_patch_locations, table_buffer.length))
// This is the data behind the "type_table" slice in type_info.onyx
- u32 type_count = bh_arr_length(type_map.entries);
+ u32 type_count = bh_arr_length(type_map.entries) + 1;
u64* table_info = bh_alloc_array(global_heap_allocator, u64, type_count + 4); // HACK
bh_buffer table_buffer;