From 3c77835e6f8f0cbad3df3eea0899973326fbaf19 Mon Sep 17 00:00:00 2001 From: Allen Webster Date: Fri, 1 May 2020 18:31:28 -0700 Subject: [PATCH] Okay back to the old text stuff for now :( Let's fix scroll feel by multiplying in the screen scale factor? Why not right? --- custom/4coder_default_bindings.cpp | 4 ++++ custom/4coder_default_hooks.cpp | 8 ++------ platform_mac/mac_4ed.mm | 11 +++-------- 3 files changed, 9 insertions(+), 14 deletions(-) diff --git a/custom/4coder_default_bindings.cpp b/custom/4coder_default_bindings.cpp index c848693d..7bd3edd7 100644 --- a/custom/4coder_default_bindings.cpp +++ b/custom/4coder_default_bindings.cpp @@ -25,7 +25,11 @@ custom_layer_init(Application_Links *app){ // NOTE(allen): default hooks and command maps set_all_default_hooks(app); mapping_init(tctx, &framework_mapping); +#if OS_MAC + setup_mac_mapping(&framework_mapping, mapid_global, mapid_file, mapid_code); +#else setup_default_mapping(&framework_mapping, mapid_global, mapid_file, mapid_code); +#endif } #endif //FCODER_DEFAULT_BINDINGS diff --git a/custom/4coder_default_hooks.cpp b/custom/4coder_default_hooks.cpp index 57cfc80c..25193c6c 100644 --- a/custom/4coder_default_hooks.cpp +++ b/custom/4coder_default_hooks.cpp @@ -1046,15 +1046,11 @@ set_all_default_hooks(Application_Links *app){ set_custom_hook(app, HookID_Tick, default_tick); set_custom_hook(app, HookID_RenderCaller, default_render_caller); set_custom_hook(app, HookID_WholeScreenRenderCaller, default_whole_screen_render_caller); -#if 0 - set_custom_hook(app, HookID_DeltaRule, original_delta); - set_custom_hook_memory_size(app, HookID_DeltaRule, - delta_ctx_size(original_delta_memory_size)); -#else + set_custom_hook(app, HookID_DeltaRule, fixed_time_cubic_delta); set_custom_hook_memory_size(app, HookID_DeltaRule, delta_ctx_size(fixed_time_cubic_delta_memory_size)); -#endif + set_custom_hook(app, HookID_BufferNameResolver, default_buffer_name_resolution); set_custom_hook(app, HookID_BeginBuffer, default_begin_buffer); diff --git a/platform_mac/mac_4ed.mm b/platform_mac/mac_4ed.mm index 44a9836f..dc65a4dd 100644 --- a/platform_mac/mac_4ed.mm +++ b/platform_mac/mac_4ed.mm @@ -914,7 +914,7 @@ mac_toggle_fullscreen(void){ - (BOOL)resignFirstResponder{ return(YES); } - +#if 0 - (void)insertText:(NSString*)text{ u32 len = [text length]; Scratch_Block scratch(mac_vars.tctx); @@ -943,15 +943,11 @@ mac_toggle_fullscreen(void){ system_signal_step(0); } - +#endif - (void)keyDown:(NSEvent*)event{ // NOTE(yuval): Process keyboard event [self process_keyboard_event:event down:true]; - [self interpretKeyEvents:[NSArray arrayWithObject:event]]; - - -#if 0 // NOTE(yuval): Process TextInsert event { NSString *characters = [event characters]; @@ -993,7 +989,6 @@ mac_toggle_fullscreen(void){ } } } -#endif } - (void)keyUp:(NSEvent*)event{ @@ -1047,7 +1042,7 @@ mac_toggle_fullscreen(void){ - (void)scrollWheel:(NSEvent *)event{ f32 dx = event.scrollingDeltaX; f32 dy = event.scrollingDeltaY; - mac_vars.input_chunk.trans.mouse_wheel = (i32)(-dy); + mac_vars.input_chunk.trans.mouse_wheel = (i32)(-dy*mac_vars.screen_scale_factor); system_signal_step(0); }