From 5cbacf8516afe8ee553022d716d2cdbd2dd3fb57 Mon Sep 17 00:00:00 2001 From: En Yi Date: Sun, 20 Aug 2023 11:47:51 +0800 Subject: [PATCH] Change keybinds to be more convenient Also, remove asan compile flag for web build --- .gitignore | 1 + CMakeLists.txt | 6 ++++-- scenes/editor_scene.c | 10 +++++----- 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/.gitignore b/.gitignore index f1ac46f..89e228c 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ .cache/ build/ +web/ compile_commands.json .gdb_history diff --git a/CMakeLists.txt b/CMakeLists.txt index d9b8bac..4d63dc9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -24,6 +24,7 @@ set(GAME_LIBS add_subdirectory(scenes) + add_executable(${PROJECT_NAME} main.c ) @@ -36,7 +37,6 @@ target_include_directories(${PROJECT_NAME} target_link_libraries(${PROJECT_NAME} ${GAME_LIBS} ) - add_executable(scene_test scene_test.c ) @@ -46,15 +46,17 @@ target_include_directories(scene_test ${CMAKE_CURRENT_LIST_DIR} ) +if (NOT EMSCRIPTEN) target_compile_options(scene_test PRIVATE -fsanitize=address -gdwarf-4) target_link_options(scene_test PRIVATE -fsanitize=address -gdwarf-4) - +endif () target_link_libraries(scene_test ${GAME_LIBS} ) if (NOT EMSCRIPTEN) + add_executable(EntManager_test entManager_test.c ) diff --git a/scenes/editor_scene.c b/scenes/editor_scene.c index 9c39246..ef58319 100644 --- a/scenes/editor_scene.c +++ b/scenes/editor_scene.c @@ -885,7 +885,7 @@ void init_sandbox_scene(LevelScene_t* scene) } draw_pos.y += SELECTION_TILE_SIZE + 2; - DrawText("R to reset the map, O/P to cycle the selection,\nM to toggle metal crates. T to toggle crate spawn behaviour", 0, draw_pos.y, 14, BLACK); + DrawText("R to reset the map, Q/E to cycle the selection,\nF to toggle metal crates. T to toggle crate spawn behaviour", 0, draw_pos.y, 14, BLACK); EndTextureMode(); @@ -934,11 +934,11 @@ void init_sandbox_scene(LevelScene_t* scene) sc_map_put_64(&scene->scene.action_map, KEY_D, ACTION_RIGHT); sc_map_put_64(&scene->scene.action_map, KEY_SPACE, ACTION_JUMP); - sc_map_put_64(&scene->scene.action_map, KEY_O, ACTION_PREV_SPAWN); - sc_map_put_64(&scene->scene.action_map, KEY_P, ACTION_NEXT_SPAWN); - sc_map_put_64(&scene->scene.action_map, KEY_M, ACTION_METAL_TOGGLE); + sc_map_put_64(&scene->scene.action_map, KEY_Q, ACTION_PREV_SPAWN); + sc_map_put_64(&scene->scene.action_map, KEY_E, ACTION_NEXT_SPAWN); + sc_map_put_64(&scene->scene.action_map, KEY_F, ACTION_METAL_TOGGLE); sc_map_put_64(&scene->scene.action_map, KEY_T, ACTION_CRATE_ACTIVATION); - sc_map_put_64(&scene->scene.action_map, KEY_Q, ACTION_EXIT); + sc_map_put_64(&scene->scene.action_map, KEY_L, ACTION_EXIT); sc_map_put_64(&scene->scene.action_map, KEY_R, ACTION_RESTART); }