diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2022-12-05 08:17:00 +0100 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2022-12-05 08:17:00 +0100 |
commit | 2679d49a53a3f9825ce855f6ed25b3b045ec5aa1 (patch) | |
tree | 9767e933c25aa6a9a0b5b692890d655ea5029e24 /editor | |
parent | 38b4c1864fddb4ed552f2f4217395bd02e21c5fe (diff) |
editor, main: use less sdl includes
Diffstat (limited to 'editor')
-rw-r--r-- | editor/CMakeLists.txt | 11 | ||||
-rw-r--r-- | editor/app.hpp | 2 | ||||
-rw-r--r-- | editor/events.cpp | 5 | ||||
-rw-r--r-- | editor/precomp.hpp | 2 |
4 files changed, 9 insertions, 11 deletions
diff --git a/editor/CMakeLists.txt b/editor/CMakeLists.txt index 2119ee9e..f94c21e1 100644 --- a/editor/CMakeLists.txt +++ b/editor/CMakeLists.txt @@ -12,6 +12,10 @@ endif() add_library(${self}_o OBJECT "${res}" "${sources}") target_link_libraries(${self}_o PUBLIC MagnumIntegration::ImGui fmt::fmt nlohmann_json::nlohmann_json) +if(WIN32) + target_sources(${self}_o PRIVATE "../main/floormat.rc") +endif() + if(NOT SDL2_INCLUDE_DIRS) if(NOT TARGET SDL2::SDL2) find_package(SDL2 QUIET REQUIRED) @@ -19,11 +23,10 @@ if(NOT SDL2_INCLUDE_DIRS) get_target_property(SDL2_INCLUDE_DIRS SDL2::SDL2 INTERFACE_INCLUDE_DIRECTORIES) endif() endif() -target_include_directories(${self}_o SYSTEM PRIVATE "${SDL2_INCLUDE_DIRS}") - -if(WIN32) - target_sources(${self}_o PRIVATE "../main/floormat.rc") +if(FLOORMAT_PRECOMPILED-HEADERS) + include_directories("${SDL2_INCLUDE_DIRS}") endif() +set_property(SOURCE "events.cpp" APPEND PROPERTY INCLUDE_DIRECTORIES "${SDL2_INCLUDE_DIRS}") add_executable(${self} dummy.cc) target_link_libraries(${self} PRIVATE ${self}_o floormat-main floormat-serialize floormat-draw floormat) diff --git a/editor/app.hpp b/editor/app.hpp index 776b0fcf..c34b7ebd 100644 --- a/editor/app.hpp +++ b/editor/app.hpp @@ -107,7 +107,7 @@ private: void do_key(key k, int mods); void do_key(key k); void apply_commands(const key_set& k); - static int get_key_modifiers(); + int get_key_modifiers(); void clear_keys(key min_inclusive, key max_exclusive); void clear_keys(); void clear_non_global_keys(); diff --git a/editor/events.cpp b/editor/events.cpp index 426acac4..6bf4b3e7 100644 --- a/editor/events.cpp +++ b/editor/events.cpp @@ -10,9 +10,6 @@ #include <Magnum/Platform/Sdl2Application.h> #include <Magnum/ImGuiIntegration/Context.hpp> -#include <SDL_keycode.h> -#include <SDL_events.h> - namespace floormat { void app::on_focus_in() noexcept {} @@ -198,7 +195,7 @@ void app::do_key(floormat::key k) int app::get_key_modifiers() { - return fixup_mods(SDL_GetModState()); + return fixup_mods(M->get_mods()); } } // namespace floormat diff --git a/editor/precomp.hpp b/editor/precomp.hpp index 775f59e7..8949f3ed 100644 --- a/editor/precomp.hpp +++ b/editor/precomp.hpp @@ -13,6 +13,4 @@ #if __has_include(<SDL.h>) #include <Magnum/Platform/Sdl2Application.h> -#include <SDL_keycode.h> -#include <SDL_events.h> #endif |