From 7d89af45292ced9bd093aa52af5ba85fb9d36bb3 Mon Sep 17 00:00:00 2001 From: Charles Dang Date: Mon, 15 Jul 2019 04:08:53 +1100 Subject: [PATCH] Prepend 'SDL2/' to all SDL includes This was needed to get the build working with vcpkg's version of SDL, where all the SDL files are in their own SDL folder. However, our cmake config also has a note saying it was a deliberate choice to move our SDL files *out* of their SDL2 folder due to certain distros (FreeBSD is mentioned) not putting the files in said folder in the first place. Testing here to see what breaks... --- src/ai/default/ca.cpp | 2 +- src/ai/manager.cpp | 2 +- src/animated.cpp | 2 +- src/build_info.cpp | 8 +-- src/config_cache.cpp | 2 +- src/countdown_clock.hpp | 2 +- src/desktop/clipboard.cpp | 4 +- src/desktop/windows_tray_notification.cpp | 2 +- src/desktop/windows_tray_notification.hpp | 2 +- src/display.cpp | 2 +- src/display_chat_manager.cpp | 4 +- src/events.cpp | 10 +-- src/events.hpp | 2 +- src/filesystem_boost.cpp | 10 +-- src/filesystem_sdl.cpp | 4 +- src/font/font_id.hpp | 2 +- src/font/marked-up_text.hpp | 2 +- src/font/sdl_ttf.cpp | 2 +- src/font/sdl_ttf.hpp | 2 +- src/font/text_surface.cpp | 2 +- src/font/text_surface.hpp | 2 +- src/game_launcher.cpp | 2 +- src/game_state.cpp | 2 +- src/generators/default_map_generator_job.cpp | 8 +-- src/gui/core/event/dispatcher.hpp | 8 +-- src/gui/core/event/dispatcher_private.hpp | 2 +- src/gui/core/timer.cpp | 4 +- src/gui/core/timer.hpp | 2 +- src/gui/dialogs/end_credits.hpp | 2 +- src/gui/dialogs/game_load.hpp | 2 +- src/gui/dialogs/hotkey_bind.cpp | 2 +- src/gui/dialogs/hotkey_bind.hpp | 2 +- src/gui/dialogs/tooltip.hpp | 2 +- src/gui/widgets/helper.cpp | 2 +- src/help/help.cpp | 2 +- src/help/help_browser.cpp | 2 +- src/help/help_browser.hpp | 2 +- src/help/help_impl.cpp | 2 +- src/help/help_impl.hpp | 2 +- src/help/help_menu.cpp | 2 +- src/help/help_topic_generators.cpp | 6 +- src/hotkey/command_executor.cpp | 2 +- src/hotkey/hotkey_item.cpp | 2 +- src/hotkey/hotkey_item.hpp | 4 +- src/joystick.hpp | 2 +- src/key.hpp | 2 +- src/map/label.hpp | 2 +- src/mouse_events.cpp | 66 ++++++++++---------- src/mouse_events.hpp | 4 +- src/mouse_handler_base.hpp | 4 +- src/picture.cpp | 2 +- src/picture.hpp | 2 +- src/save_blocker.hpp | 2 +- src/scripting/application_lua_kernel.cpp | 2 +- src/scripting/game_lua_kernel.cpp | 2 +- src/sdl/exception.cpp | 2 +- src/sdl/point.hpp | 2 +- src/sdl/rect.hpp | 2 +- src/sdl/surface.hpp | 2 +- src/sdl/userevent.hpp | 2 +- src/sdl/utils.hpp | 2 +- src/sdl/window.cpp | 2 +- src/sdl/window.hpp | 2 +- src/sound.cpp | 4 +- src/soundsource.cpp | 2 +- src/tests/main.cpp | 2 +- src/theme.hpp | 2 +- src/tooltips.cpp | 2 +- src/wesnoth.cpp | 6 +- src/wesnothd_connection.cpp | 2 +- 70 files changed, 131 insertions(+), 131 deletions(-) diff --git a/src/ai/default/ca.cpp b/src/ai/default/ca.cpp index 3048e335b78b..c0c4b43ebe7b 100644 --- a/src/ai/default/ca.cpp +++ b/src/ai/default/ca.cpp @@ -37,7 +37,7 @@ #include #include -#include +#include static lg::log_domain log_ai_testing_ai_default("ai/ca/testing_ai_default"); #define DBG_AI_TESTING_AI_DEFAULT LOG_STREAM(debug, log_ai_testing_ai_default) diff --git a/src/ai/manager.cpp b/src/ai/manager.cpp index 0a7b5f693ff1..79bc7300ffa9 100644 --- a/src/ai/manager.cpp +++ b/src/ai/manager.cpp @@ -49,7 +49,7 @@ #include // for pair, make_pair #include // for vector, allocator, etc -#include +#include namespace ai { diff --git a/src/animated.cpp b/src/animated.cpp index 4af0a399086b..a5ca48aff8df 100644 --- a/src/animated.cpp +++ b/src/animated.cpp @@ -19,7 +19,7 @@ #include "animated.hpp" -#include +#include // Put these here to ensure that there's only // one instance of the current_ticks variable diff --git a/src/build_info.cpp b/src/build_info.cpp index 7c94a4878b5c..8a8e42e87a57 100644 --- a/src/build_info.cpp +++ b/src/build_info.cpp @@ -25,10 +25,10 @@ #include -#include -#include -#include -#include +#include +#include +#include +#include #include diff --git a/src/config_cache.cpp b/src/config_cache.cpp index a61a8a97b485..66bb1d96c0ea 100644 --- a/src/config_cache.cpp +++ b/src/config_cache.cpp @@ -27,7 +27,7 @@ #include #include -#include +#include static lg::log_domain log_cache("cache"); #define ERR_CACHE LOG_STREAM(err, log_cache) diff --git a/src/countdown_clock.hpp b/src/countdown_clock.hpp index 04ec79e57b68..ecc6b852985a 100644 --- a/src/countdown_clock.hpp +++ b/src/countdown_clock.hpp @@ -13,7 +13,7 @@ #pragma once #include "events.hpp" -#include +#include class team; class countdown_clock : public events::pump_monitor diff --git a/src/desktop/clipboard.cpp b/src/desktop/clipboard.cpp index 76f2a03578d6..964e1db518eb 100644 --- a/src/desktop/clipboard.cpp +++ b/src/desktop/clipboard.cpp @@ -18,8 +18,8 @@ #include "serialization/unicode.hpp" #include -#include -#include +#include +#include #define CLIPBOARD_FUNCS_DEFINED diff --git a/src/desktop/windows_tray_notification.cpp b/src/desktop/windows_tray_notification.cpp index 947fb49388f5..42d96f5605ec 100644 --- a/src/desktop/windows_tray_notification.cpp +++ b/src/desktop/windows_tray_notification.cpp @@ -14,7 +14,7 @@ #include "desktop/windows_tray_notification.hpp" -#include +#include #include "gettext.hpp" #include "serialization/string_utils.hpp" diff --git a/src/desktop/windows_tray_notification.hpp b/src/desktop/windows_tray_notification.hpp index d91175d8f3b4..d49a3337df6f 100644 --- a/src/desktop/windows_tray_notification.hpp +++ b/src/desktop/windows_tray_notification.hpp @@ -14,7 +14,7 @@ #pragma once -#include +#include #include //forces to call Unicode winapi functions instead of ASCII (default) #ifndef UNICODE diff --git a/src/display.cpp b/src/display.cpp index e1023c087741..808299d8635a 100644 --- a/src/display.cpp +++ b/src/display.cpp @@ -51,7 +51,7 @@ #include "show_dialog.hpp" #include "gui/dialogs/loading_screen.hpp" -#include +#include #include #include diff --git a/src/display_chat_manager.cpp b/src/display_chat_manager.cpp index 46ddccc1c07e..c239b460ef9e 100644 --- a/src/display_chat_manager.cpp +++ b/src/display_chat_manager.cpp @@ -26,7 +26,7 @@ #include "color.hpp" #include "preferences/credentials.hpp" -#include +#include static lg::log_domain log_engine("engine"); #define ERR_NG LOG_STREAM(err, log_engine) @@ -192,7 +192,7 @@ void display_chat_manager::prune_chat_messages(bool remove_all) const unsigned message_aging = preferences::chat_message_aging(); const unsigned max_chat_messages = preferences::chat_lines(); const bool enable_aging = message_aging != 0; - + const unsigned remove_before = enable_aging ? safe_subtract(SDL_GetTicks(), message_aging * 60 * 1000) : 0; int movement = 0; diff --git a/src/events.cpp b/src/events.cpp index 90545f944950..e2400fb75e0c 100644 --- a/src/events.cpp +++ b/src/events.cpp @@ -32,7 +32,7 @@ #include #include -#include +#include #include #include @@ -524,7 +524,7 @@ void pump() if(event.motion.state & SDL_BUTTON(SDL_BUTTON_RIGHT)) { SDL_Rect r = CVideo::get_singleton().screen_area(); - + // TODO: Check if SDL_FINGERMOTION is actually signaled for COMPLETE motions (I doubt, but tbs) SDL_Event touch_event; touch_event.type = SDL_FINGERMOTION; @@ -538,7 +538,7 @@ void pump() touch_event.tfinger.y = static_cast(event.motion.y) / r.h; touch_event.tfinger.pressure = 1; ::SDL_PushEvent(&touch_event); - + event.motion.state = SDL_BUTTON(SDL_BUTTON_LEFT); event.motion.which = SDL_TOUCH_MOUSEID; } @@ -549,7 +549,7 @@ void pump() { event.button.button = SDL_BUTTON_LEFT; event.button.which = SDL_TOUCH_MOUSEID; - + SDL_Rect r = CVideo::get_singleton().screen_area(); SDL_Event touch_event; touch_event.type = (event.type == SDL_MOUSEBUTTONDOWN) ? SDL_FINGERDOWN : SDL_FINGERUP; @@ -570,7 +570,7 @@ void pump() break; } #endif - + switch(event.type) { case SDL_WINDOWEVENT: switch(event.window.event) { diff --git a/src/events.hpp b/src/events.hpp index 5ef2df4d75c5..621ab8007a21 100644 --- a/src/events.hpp +++ b/src/events.hpp @@ -14,7 +14,7 @@ #pragma once -#include +#include #include #include #include diff --git a/src/filesystem_boost.cpp b/src/filesystem_boost.cpp index 9770c76a58ee..9713ea74caf9 100644 --- a/src/filesystem_boost.cpp +++ b/src/filesystem_boost.cpp @@ -56,7 +56,7 @@ #if defined(__APPLE__) && defined(__MACH__) && defined(__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__) #define WESNOTH_BOOST_OS_IOS (__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__*1000) -#include +#include #endif @@ -542,7 +542,7 @@ static const std::string& get_version_path_suffix() return suffix; } - + #if defined(__APPLE__) && !defined(__IPHONEOS__) // Starting from Wesnoth 1.14.6, we have to use sandboxing function on macOS // The problem is, that only signed builds can use sandbox. Unsigned builds @@ -553,13 +553,13 @@ static void migrate_apple_config_directory_for_unsandboxed_builds() { const char* home_str = getenv("HOME"); bfs::path home = home_str ? home_str : "."; - + // We don't know which of the two is in PREFERENCES_DIR now. boost::filesystem::path old_saves_dir = home / "Library/Application Support/Wesnoth_"; old_saves_dir += get_version_path_suffix(); boost::filesystem::path new_saves_dir = home / "Library/Containers/org.wesnoth.Wesnoth/Data/Library/Application Support/Wesnoth_"; new_saves_dir += get_version_path_suffix(); - + if(bfs::is_directory(new_saves_dir)) { if(!bfs::exists(old_saves_dir)) { std::cout << "Apple developer's userdata migration: "; @@ -579,7 +579,7 @@ static void setup_user_data_dir() #if defined(__APPLE__) && !defined(__IPHONEOS__) migrate_apple_config_directory_for_unsandboxed_builds(); #endif - + if(!create_directory_if_missing_recursive(user_data_dir)) { ERR_FS << "could not open or create user data directory at " << user_data_dir.string() << '\n'; return; diff --git a/src/filesystem_sdl.cpp b/src/filesystem_sdl.cpp index c8427e7a2829..e39d0df8833e 100644 --- a/src/filesystem_sdl.cpp +++ b/src/filesystem_sdl.cpp @@ -11,8 +11,8 @@ See the COPYING file for more details. */ -#include -#include +#include +#include #include "filesystem.hpp" #include "log.hpp" diff --git a/src/font/font_id.hpp b/src/font/font_id.hpp index 719eabe0c46d..1e9974982ca1 100644 --- a/src/font/font_id.hpp +++ b/src/font/font_id.hpp @@ -21,7 +21,7 @@ #include #include -#include +#include /*** * Note: This is specific to SDL_TTF code path diff --git a/src/font/marked-up_text.hpp b/src/font/marked-up_text.hpp index 6171aa271b57..7a941b75517e 100644 --- a/src/font/marked-up_text.hpp +++ b/src/font/marked-up_text.hpp @@ -24,7 +24,7 @@ class surface; #include #include "serialization/unicode_types.hpp" -#include +#include namespace font { diff --git a/src/font/sdl_ttf.cpp b/src/font/sdl_ttf.cpp index ffe588335a4f..01baaec92bd2 100644 --- a/src/font/sdl_ttf.cpp +++ b/src/font/sdl_ttf.cpp @@ -31,7 +31,7 @@ #include "sdl/surface.hpp" #include "serialization/unicode.hpp" -#include +#include #include #include diff --git a/src/font/sdl_ttf.hpp b/src/font/sdl_ttf.hpp index 060e6e6a75b5..73e286b624a8 100644 --- a/src/font/sdl_ttf.hpp +++ b/src/font/sdl_ttf.hpp @@ -21,7 +21,7 @@ #include -#include +#include class surface; diff --git a/src/font/text_surface.cpp b/src/font/text_surface.cpp index 941b7d63ce59..3c77f9065c33 100644 --- a/src/font/text_surface.cpp +++ b/src/font/text_surface.cpp @@ -20,7 +20,7 @@ #include "log.hpp" -#include +#include #include #include diff --git a/src/font/text_surface.hpp b/src/font/text_surface.hpp index c76f15bdb32b..e2a90ef7149b 100644 --- a/src/font/text_surface.hpp +++ b/src/font/text_surface.hpp @@ -17,7 +17,7 @@ #include "font_id.hpp" // for text_chunk #include "color.hpp" -#include +#include #include #include diff --git a/src/game_launcher.cpp b/src/game_launcher.cpp index dcf15d3c9536..6aba2ef9503d 100644 --- a/src/game_launcher.cpp +++ b/src/game_launcher.cpp @@ -67,7 +67,7 @@ #include // for operator<<, basic_ostream, etc #include #include // for pair -#include // for SDL_INIT_JOYSTICK, etc +#include // for SDL_INIT_JOYSTICK, etc #ifdef DEBUG_WINDOW_LAYOUT_GRAPHS #include "gui/widgets/debug.hpp" diff --git a/src/game_state.cpp b/src/game_state.cpp index 1da2d07f2488..f898773a4f70 100644 --- a/src/game_state.cpp +++ b/src/game_state.cpp @@ -33,7 +33,7 @@ #include "gui/dialogs/loading_screen.hpp" #include "utils/functional.hpp" -#include +#include #include #include diff --git a/src/generators/default_map_generator_job.cpp b/src/generators/default_map_generator_job.cpp index e286b369b31e..5ab99d793dda 100644 --- a/src/generators/default_map_generator_job.cpp +++ b/src/generators/default_map_generator_job.cpp @@ -31,7 +31,7 @@ #include "seed_rng.hpp" #include "wml_exception.hpp" -#include +#include static lg::log_domain log_mapgen("mapgen"); #define ERR_NG LOG_STREAM(err, log_mapgen) @@ -692,9 +692,9 @@ static void flood_name(const map_location& start, const std::string& name, std:: std::string default_map_generator_job::default_generate_map(generator_data data, std::map* labels, const config& cfg) { log_scope("map generation"); - - LOG_NG << "default_generate_map parameters" - << " width=" << data.width + + LOG_NG << "default_generate_map parameters" + << " width=" << data.width << " height=" << data.height << " nplayers=" << data.nplayers << " nvillages=" << data.nvillages diff --git a/src/gui/core/event/dispatcher.hpp b/src/gui/core/event/dispatcher.hpp index cd2ebf6b6422..eaff8a7a5efe 100644 --- a/src/gui/core/event/dispatcher.hpp +++ b/src/gui/core/event/dispatcher.hpp @@ -21,7 +21,7 @@ #include "utils/functional.hpp" #include "utils/type_trait_aliases.hpp" -#include +#include #include @@ -253,8 +253,8 @@ class dispatcher widget& target, const point& pos, const point& distance); - - + + /** * Fires an event which takes touch-gesture parameters. * @@ -271,7 +271,7 @@ class dispatcher float dTheta, float dDist, Uint8 numFingers); - + /** * Fires an event which takes notification parameters. diff --git a/src/gui/core/event/dispatcher_private.hpp b/src/gui/core/event/dispatcher_private.hpp index 641cf7ecce8c..5ba9ed2b0d1b 100644 --- a/src/gui/core/event/dispatcher_private.hpp +++ b/src/gui/core/event/dispatcher_private.hpp @@ -19,7 +19,7 @@ #include "gui/widgets/widget.hpp" #include "utils/type_trait_aliases.hpp" -#include +#include #include #include diff --git a/src/gui/core/timer.cpp b/src/gui/core/timer.cpp index 1a6dc2f60f60..d8fd1828399a 100644 --- a/src/gui/core/timer.cpp +++ b/src/gui/core/timer.cpp @@ -17,7 +17,7 @@ #include "events.hpp" #include "gui/core/log.hpp" -#include +#include #include #include @@ -45,7 +45,7 @@ static std::map& get_timers() static std::map* ptimers = new std::map(); return *ptimers; } -/** +/** The id of the event being executed, 0 if none. NOTE: it is possible that multiple timers are executed at the same time if one of the timer starts an event loop for example if its handler diff --git a/src/gui/core/timer.hpp b/src/gui/core/timer.hpp index 3487a764a9bf..f58c589ca3d9 100644 --- a/src/gui/core/timer.hpp +++ b/src/gui/core/timer.hpp @@ -31,7 +31,7 @@ #include "utils/functional.hpp" -#include +#include namespace gui2 { diff --git a/src/gui/dialogs/end_credits.hpp b/src/gui/dialogs/end_credits.hpp index 9083a98dd1d1..650ca7b4e690 100644 --- a/src/gui/dialogs/end_credits.hpp +++ b/src/gui/dialogs/end_credits.hpp @@ -15,7 +15,7 @@ #include "gui/dialogs/modal_dialog.hpp" -#include +#include #include class display; diff --git a/src/gui/dialogs/game_load.hpp b/src/gui/dialogs/game_load.hpp index ee0a69fcdf23..c7a2e3740335 100644 --- a/src/gui/dialogs/game_load.hpp +++ b/src/gui/dialogs/game_load.hpp @@ -20,7 +20,7 @@ #include "save_index.hpp" #include "gettext.hpp" -#include +#include namespace gui2 { diff --git a/src/gui/dialogs/hotkey_bind.cpp b/src/gui/dialogs/hotkey_bind.cpp index 0754214800a7..04a121e4689c 100644 --- a/src/gui/dialogs/hotkey_bind.cpp +++ b/src/gui/dialogs/hotkey_bind.cpp @@ -18,7 +18,7 @@ #include "gui/widgets/settings.hpp" #include "gui/widgets/window.hpp" -#include +#include namespace gui2 { diff --git a/src/gui/dialogs/hotkey_bind.hpp b/src/gui/dialogs/hotkey_bind.hpp index 95282c714174..ec931ffaded1 100644 --- a/src/gui/dialogs/hotkey_bind.hpp +++ b/src/gui/dialogs/hotkey_bind.hpp @@ -16,7 +16,7 @@ #include "gui/dialogs/modal_dialog.hpp" #include "hotkey/hotkey_item.hpp" -#include +#include #include diff --git a/src/gui/dialogs/tooltip.hpp b/src/gui/dialogs/tooltip.hpp index aff224864e57..2c54f07f6ac6 100644 --- a/src/gui/dialogs/tooltip.hpp +++ b/src/gui/dialogs/tooltip.hpp @@ -14,7 +14,7 @@ #pragma once -#include +#include #include class t_string; diff --git a/src/gui/widgets/helper.cpp b/src/gui/widgets/helper.cpp index 0b12ae16d205..1c67387c370d 100644 --- a/src/gui/widgets/helper.cpp +++ b/src/gui/widgets/helper.cpp @@ -25,7 +25,7 @@ #include "sdl/rect.hpp" #include "tstring.hpp" -#include +#include namespace gui2 { diff --git a/src/help/help.cpp b/src/help/help.cpp index 246e0e248a27..239c4b5a2a7f 100644 --- a/src/help/help.cpp +++ b/src/help/help.cpp @@ -43,7 +43,7 @@ #include // for min #include // for basic_ostream, operator<<, etc #include // for vector, vector<>::iterator -#include +#include static lg::log_domain log_display("display"); diff --git a/src/help/help_browser.cpp b/src/help/help_browser.cpp index b9244403f867..052b06095b76 100644 --- a/src/help/help_browser.cpp +++ b/src/help/help_browser.cpp @@ -14,7 +14,7 @@ #include "help/help_browser.hpp" #include // for operator<<, basic_ostream, etc -#include // for SDL_GetMouseState, etc +#include // for SDL_GetMouseState, etc #include "cursor.hpp" // for set, CURSOR_TYPE::HYPERLINK, etc #include "font/constants.hpp" // for relative_size #include "gettext.hpp" // for _ diff --git a/src/help/help_browser.hpp b/src/help/help_browser.hpp index 97fe8450267b..5e4a253f7ebd 100644 --- a/src/help/help_browser.hpp +++ b/src/help/help_browser.hpp @@ -16,7 +16,7 @@ #include // for deque #include // for string -#include // for SDL_Event +#include // for SDL_Event #include "help_menu.hpp" // for help_menu #include "help_text_area.hpp" // for help_text_area #include "widgets/button.hpp" // for button diff --git a/src/help/help_impl.cpp b/src/help/help_impl.cpp index 5a759fcb2829..5735df8a38f4 100644 --- a/src/help/help_impl.cpp +++ b/src/help/help_impl.cpp @@ -51,7 +51,7 @@ #include // for back_insert_iterator, etc #include // for map, etc #include -#include +#include static lg::log_domain log_display("display"); #define WRN_DP LOG_STREAM(warn, log_display) diff --git a/src/help/help_impl.hpp b/src/help/help_impl.hpp index 29732838fbd9..aa344da0f725 100644 --- a/src/help/help_impl.hpp +++ b/src/help/help_impl.hpp @@ -41,7 +41,7 @@ #include // for string, allocator, etc #include // for pair, make_pair #include // for vector, etc -#include // for SDL_Surface +#include // for SDL_Surface #include class config; diff --git a/src/help/help_menu.cpp b/src/help/help_menu.cpp index c5488f6d6be6..227f0964937a 100644 --- a/src/help/help_menu.cpp +++ b/src/help/help_menu.cpp @@ -23,7 +23,7 @@ #include // for basic_ostream, operator<<, etc #include // for _List_const_iterator, etc #include // for pair -#include +#include class CVideo; // lines 56-56 diff --git a/src/help/help_topic_generators.cpp b/src/help/help_topic_generators.cpp index fe244d57121b..14ae37a3fdee 100644 --- a/src/help/help_topic_generators.cpp +++ b/src/help/help_topic_generators.cpp @@ -34,7 +34,7 @@ #include // for operator<<, basic_ostream, etc #include // for map, etc #include -#include +#include static lg::log_domain log_help("help"); #define WRN_HP LOG_STREAM(warn, log_help) @@ -694,7 +694,7 @@ std::string unit_topic_generator::operator()() const { } if (info.union_type().size() == 1 && info.union_type()[0] == info.number() && info.is_nonnull()) { - terrain_movement_info movement_info = + terrain_movement_info movement_info = { info.name(), info.id(), @@ -840,7 +840,7 @@ std::string unit_topic_generator::operator()() const { table.push_back(row); } - + ss << generate_table(table); } else { WRN_HP << "When building unit help topics, the display object was null and we couldn't get the terrain info we need.\n"; diff --git a/src/hotkey/command_executor.cpp b/src/hotkey/command_executor.cpp index 8d0f38b3e894..c77dd0e22751 100644 --- a/src/hotkey/command_executor.cpp +++ b/src/hotkey/command_executor.cpp @@ -35,7 +35,7 @@ #include "utils/functional.hpp" -#include +#include #include #include diff --git a/src/hotkey/hotkey_item.cpp b/src/hotkey/hotkey_item.cpp index 0a908f07ae63..414b6d7ca3f1 100644 --- a/src/hotkey/hotkey_item.cpp +++ b/src/hotkey/hotkey_item.cpp @@ -24,7 +24,7 @@ #include #include "utils/functional.hpp" -#include +#include #include #include diff --git a/src/hotkey/hotkey_item.hpp b/src/hotkey/hotkey_item.hpp index 64d6356d575f..3916e9a6cdd4 100644 --- a/src/hotkey/hotkey_item.hpp +++ b/src/hotkey/hotkey_item.hpp @@ -14,8 +14,8 @@ #pragma once -#include -#include +#include +#include #include #include #include diff --git a/src/joystick.hpp b/src/joystick.hpp index 64db962e5432..593999b75ae5 100644 --- a/src/joystick.hpp +++ b/src/joystick.hpp @@ -17,7 +17,7 @@ #include #include "map/location.hpp" -#include +#include class joystick_manager { diff --git a/src/key.hpp b/src/key.hpp index d987c0fc4b47..1f30f0edeac0 100644 --- a/src/key.hpp +++ b/src/key.hpp @@ -15,7 +15,7 @@ #pragma once #include -#include +#include /** * Class that keeps track of all the keys on the keyboard. diff --git a/src/map/label.hpp b/src/map/label.hpp index cf71b1d45b36..df5370db6a88 100644 --- a/src/map/label.hpp +++ b/src/map/label.hpp @@ -19,7 +19,7 @@ #include "map/location.hpp" #include "tstring.hpp" -#include +#include #include #include diff --git a/src/mouse_events.cpp b/src/mouse_events.cpp index dbea3b65494b..928d84c9cd36 100644 --- a/src/mouse_events.cpp +++ b/src/mouse_events.cpp @@ -44,7 +44,7 @@ #include "whiteboard/manager.hpp" // for manager, etc #include "whiteboard/typedefs.hpp" // for whiteboard_lock -#include // for SDL_GetMouseState +#include // for SDL_GetMouseState #include // for assert #include // for bad_alloc #include // for operator<<, basic_ostream, etc @@ -99,14 +99,14 @@ void mouse_handler::touch_motion(int x, int y, const bool browse, bool update, m // Frankensteining from mouse_motion(), as it has a lot in common, but a lot of differences too. // Copy-pasted from everywhere. TODO: generalize the two. SDL_GetMouseState(&x,&y); - + // This is from mouse_handler_base::mouse_motion_default() tooltips::process(x, y); - + if(simple_warp_) { return; } - + if(minimap_scrolling_) { const map_location& mini_loc = gui().minimap_location_on(x,y); if(mini_loc.valid()) { @@ -120,7 +120,7 @@ void mouse_handler::touch_motion(int x, int y, const bool browse, bool update, m minimap_scrolling_ = false; } } - + // Fire the drag & drop only after minimal drag distance // While we check the mouse buttons state, we also grab fresh position data. int mx = drag_from_x_; // some default value to prevent unlikely SDL bug @@ -152,14 +152,14 @@ void mouse_handler::touch_motion(int x, int y, const bool browse, bool update, m } return; } - + // now copy-pasting mouse_handler::mouse_motion() - + game_board & board = pc_.gamestate().board_; - + if(new_hex == map_location::null_location()) new_hex = gui().hex_clicked_on(x,y); - + if(new_hex != last_hex_) { update = true; if( pc_.get_map_const().on_board(last_hex_) ) { @@ -175,11 +175,11 @@ void mouse_handler::touch_motion(int x, int y, const bool browse, bool update, m } last_hex_ = new_hex; } - + if(reachmap_invalid_) update = true; - + if(!update) return; - + if(reachmap_invalid_) { reachmap_invalid_ = false; if(!current_paths_.destinations.empty() && !show_partial_move_) { @@ -195,7 +195,7 @@ void mouse_handler::touch_motion(int x, int y, const bool browse, bool update, m // we do never deselect here, mainly because of canceled attack-move } } - + // reset current_route_ and current_paths if not valid anymore // we do it before cursor selection, because it uses current_paths_ if( !pc_.get_map_const().on_board(new_hex) ) { @@ -203,7 +203,7 @@ void mouse_handler::touch_motion(int x, int y, const bool browse, bool update, m gui().set_route(nullptr); pc_.get_whiteboard()->erase_temp_move(); } - + if(unselected_paths_) { unselected_paths_ = false; current_paths_ = pathfind::paths(); @@ -217,11 +217,11 @@ void mouse_handler::touch_motion(int x, int y, const bool browse, bool update, m gui().highlight_hex(new_hex); pc_.get_whiteboard()->on_mouseover_change(new_hex); - + unit_map::iterator selected_unit; unit_map::iterator mouseover_unit; map_location attack_from; - + { // start planned unit map scope wb::future_map_if_active planned_unit_map; selected_unit = found_unit; @@ -229,7 +229,7 @@ void mouse_handler::touch_motion(int x, int y, const bool browse, bool update, m // we search if there is an attack possibility and where attack_from = current_unit_attacks_from(new_hex); - + //see if we should show the normal cursor, the movement cursor, or //the attack cursor //If the cursor is on WAIT, we don't change it and let the setter @@ -253,7 +253,7 @@ void mouse_handler::touch_motion(int x, int y, const bool browse, bool update, m } } else { // no selected unit or we can't move it - + if ( selected_hex_.valid() && mouseover_unit && mouseover_unit->side() == side_num_ ) { // empty hex field selected and unit on our site under the cursor @@ -264,16 +264,16 @@ void mouse_handler::touch_motion(int x, int y, const bool browse, bool update, m } } } // end planned unit map scope - + // show (or cancel) the attack direction indicator if(attack_from.valid() && (!browse || pc_.get_whiteboard()->is_active())) { gui().set_attack_indicator(attack_from, new_hex); } else { gui().clear_attack_indicator(); } - + unit_ptr un; //will later point to unit at mouseover_hex_ - + // the destination is the pointed hex or the adjacent hex // used to attack it map_location dest; @@ -287,7 +287,7 @@ void mouse_handler::touch_motion(int x, int y, const bool browse, bool update, m dest = new_hex; dest_un = find_unit(new_hex); } - + if(dest == selected_hex_ || dest_un) { current_route_.steps.clear(); gui().set_route(nullptr); @@ -299,24 +299,24 @@ void mouse_handler::touch_motion(int x, int y, const bool browse, bool update, m if (selected_unit && !selected_unit->incapacitated()) { // Show the route from selected unit to mouseover hex current_route_ = get_route(&*selected_unit, dest, viewing_team()); - + pc_.get_whiteboard()->create_temp_move(); - + if(!browse) { gui().set_route(¤t_route_); } } } - + if(board.map().on_board(selected_hex_) && !selected_unit && mouseover_unit.valid() && mouseover_unit) { // Show the route from selected hex to mouseover unit current_route_ = get_route(&*mouseover_unit, selected_hex_, viewing_team()); - + pc_.get_whiteboard()->create_temp_move(); - + if(!browse) { gui().set_route(¤t_route_); } @@ -325,14 +325,14 @@ void mouse_handler::touch_motion(int x, int y, const bool browse, bool update, m gui().set_route(nullptr); pc_.get_whiteboard()->erase_temp_move(); } - + unit_map::iterator iter = mouseover_unit; if (iter) un = iter.get_shared_ptr(); else un.reset(); } //end planned unit map scope - + if( (!selected_hex_.valid()) && un && current_paths_.destinations.empty() && !gui().fogged(un->get_location())) { @@ -348,7 +348,7 @@ void mouse_handler::touch_motion(int x, int y, const bool browse, bool update, m gui().set_route(&route); } over_route_ = true; - + wb::future_map_if_active raii; current_paths_ = pathfind::paths(*un, false, true, viewing_team(), path_turns_); @@ -357,16 +357,16 @@ void mouse_handler::touch_motion(int x, int y, const bool browse, bool update, m //Note: planned unit map must be activated after this is done, //since the future state includes changes to units' movement. unit_movement_resetter move_reset(*un); - + wb::future_map_if_active raii; current_paths_ = pathfind::paths(*un, false, true, viewing_team(), path_turns_); } - + unselected_paths_ = true; gui().highlight_reach(current_paths_); } - + } void mouse_handler::mouse_motion(int x, int y, const bool browse, bool update, map_location new_hex) diff --git a/src/mouse_events.hpp b/src/mouse_events.hpp index 7def91b7c0e3..b68786eaaefe 100644 --- a/src/mouse_events.hpp +++ b/src/mouse_events.hpp @@ -23,7 +23,7 @@ #include // for set #include // for vector -#include // for SDL_MouseButtonEvent +#include // for SDL_MouseButtonEvent class game_display; class battle_context; // lines 23-23 @@ -84,7 +84,7 @@ class mouse_handler : public mouse_handler_base { const bool fire_event = true); void move_action(bool browse); - + void touch_action(const map_location hex, bool browse); void select_or_action(bool browse); diff --git a/src/mouse_handler_base.hpp b/src/mouse_handler_base.hpp index 483128663a42..f62ccc729a5b 100644 --- a/src/mouse_handler_base.hpp +++ b/src/mouse_handler_base.hpp @@ -17,7 +17,7 @@ #include "map/location.hpp" -#include +#include class display; @@ -48,7 +48,7 @@ class mouse_handler_base /** Const version of @ref gui */ virtual const display& gui() const = 0; - + /** If mouse/finger has moved far enough to consider it move/swipe, and not a click/touch */ bool dragging_started() const; diff --git a/src/picture.cpp b/src/picture.cpp index 4f5c8bbf3f24..a3620ce2073b 100644 --- a/src/picture.cpp +++ b/src/picture.cpp @@ -34,7 +34,7 @@ #include "sdl/rect.hpp" #include "utils/general.hpp" -#include +#include #include "utils/functional.hpp" diff --git a/src/picture.hpp b/src/picture.hpp index 65b05000f51f..6ca3b4ae2e2c 100644 --- a/src/picture.hpp +++ b/src/picture.hpp @@ -18,7 +18,7 @@ #include "terrain/translation.hpp" #include "game_config.hpp" -#include +#include #include class surface; diff --git a/src/save_blocker.hpp b/src/save_blocker.hpp index 8c32a126e941..43346e5222da 100644 --- a/src/save_blocker.hpp +++ b/src/save_blocker.hpp @@ -14,7 +14,7 @@ #pragma once -#include +#include #include diff --git a/src/scripting/application_lua_kernel.cpp b/src/scripting/application_lua_kernel.cpp index bea49e533624..2400fc90ec3f 100644 --- a/src/scripting/application_lua_kernel.cpp +++ b/src/scripting/application_lua_kernel.cpp @@ -47,7 +47,7 @@ #include "utils/functional.hpp" #include -#include +#include #include "lua/lauxlib.h" #include "lua/lua.h" diff --git a/src/scripting/game_lua_kernel.cpp b/src/scripting/game_lua_kernel.cpp index 585236b2c99b..4362118f81fa 100644 --- a/src/scripting/game_lua_kernel.cpp +++ b/src/scripting/game_lua_kernel.cpp @@ -122,7 +122,7 @@ #include // for pair #include #include // for vector, etc -#include // for SDL_GetTicks +#include // for SDL_GetTicks #include "lua/lauxlib.h" // for luaL_checkinteger, etc #include "lua/lua.h" // for lua_setfield, etc diff --git a/src/sdl/exception.cpp b/src/sdl/exception.cpp index ccd7cdce73b0..b5953ec287ce 100644 --- a/src/sdl/exception.cpp +++ b/src/sdl/exception.cpp @@ -14,7 +14,7 @@ #include "sdl/exception.hpp" -#include +#include namespace sdl { diff --git a/src/sdl/point.hpp b/src/sdl/point.hpp index c108f96a64bc..bc627beb1662 100644 --- a/src/sdl/point.hpp +++ b/src/sdl/point.hpp @@ -14,7 +14,7 @@ #pragma once -#include +#include #include #include diff --git a/src/sdl/rect.hpp b/src/sdl/rect.hpp index e43b1c665c69..b4be7cd3e5e4 100644 --- a/src/sdl/rect.hpp +++ b/src/sdl/rect.hpp @@ -22,7 +22,7 @@ #include "global.hpp" #include "utils.hpp" -#include +#include struct point; diff --git a/src/sdl/surface.hpp b/src/sdl/surface.hpp index ea0d1f0926c0..cdc58d9b1aa0 100644 --- a/src/sdl/surface.hpp +++ b/src/sdl/surface.hpp @@ -15,7 +15,7 @@ #include "utils/const_clone.hpp" -#include +#include class CVideo; diff --git a/src/sdl/userevent.hpp b/src/sdl/userevent.hpp index da2539673a7e..41f2bc244ecc 100644 --- a/src/sdl/userevent.hpp +++ b/src/sdl/userevent.hpp @@ -13,7 +13,7 @@ #pragma once -#include +#include #include diff --git a/src/sdl/utils.hpp b/src/sdl/utils.hpp index 9d82d055929c..42c0321b5ed2 100644 --- a/src/sdl/utils.hpp +++ b/src/sdl/utils.hpp @@ -22,7 +22,7 @@ #include "utils/math.hpp" #include "game_version.hpp" -#include +#include #include #include diff --git a/src/sdl/window.cpp b/src/sdl/window.cpp index 7476d9770830..5e5347e00e06 100644 --- a/src/sdl/window.cpp +++ b/src/sdl/window.cpp @@ -17,7 +17,7 @@ #include "sdl/exception.hpp" -#include +#include namespace sdl { diff --git a/src/sdl/window.hpp b/src/sdl/window.hpp index 39098d9eb389..f00879695996 100644 --- a/src/sdl/window.hpp +++ b/src/sdl/window.hpp @@ -19,7 +19,7 @@ * Contains a wrapper class for the @ref SDL_Window class. */ -#include +#include #include diff --git a/src/sound.cpp b/src/sound.cpp index 9f652a9e87fa..af56c9d95918 100644 --- a/src/sound.cpp +++ b/src/sound.cpp @@ -21,8 +21,8 @@ #include "serialization/string_utils.hpp" #include "sound_music_track.hpp" -#include // Travis doesn't like this, although it works on my machine -> '#include -#include +#include // Travis doesn't like this, although it works on my machine -> '#include +#include #include #include diff --git a/src/soundsource.cpp b/src/soundsource.cpp index 1d0415f54104..dd6a78278896 100644 --- a/src/soundsource.cpp +++ b/src/soundsource.cpp @@ -18,7 +18,7 @@ #include "sound.hpp" #include "soundsource.hpp" -#include +#include namespace soundsource { diff --git a/src/tests/main.cpp b/src/tests/main.cpp index ca954907a771..001decafc1ed 100644 --- a/src/tests/main.cpp +++ b/src/tests/main.cpp @@ -35,7 +35,7 @@ #include -#include +#include #include "filesystem.hpp" #include "game_config.hpp" diff --git a/src/theme.hpp b/src/theme.hpp index 0928fa688dc7..36d9f5d1b511 100644 --- a/src/theme.hpp +++ b/src/theme.hpp @@ -24,7 +24,7 @@ #include "generic_event.hpp" #include -#include +#include struct _rect { size_t x1,y1,x2,y2; }; diff --git a/src/tooltips.cpp b/src/tooltips.cpp index 56745e88dd96..20fcc45fa795 100644 --- a/src/tooltips.cpp +++ b/src/tooltips.cpp @@ -20,7 +20,7 @@ #include "help/help.hpp" #include "video.hpp" -#include // Travis doesn't like this, although it works on my machine -> '#include +#include // Travis doesn't like this, although it works on my machine -> '#include namespace { diff --git a/src/wesnoth.cpp b/src/wesnoth.cpp index 290940d0922c..0c0d74ee0b5d 100644 --- a/src/wesnoth.cpp +++ b/src/wesnoth.cpp @@ -66,7 +66,7 @@ #include #endif // _MSC_VER -#include // for SDL_Init, SDL_INIT_TIMER +#include // for SDL_Init, SDL_INIT_TIMER #include // for input, output #include // for copy @@ -1099,11 +1099,11 @@ int main(int argc, char** argv) // Mac's touchpad generates touch events too. // Ignore them until Macs have a touchscreen: https://forums.libsdl.org/viewtopic.php?p=45758 -#if defined(__APPLE__) && !defined(__IPHONEOS__) +#if defined(__APPLE__) && !defined(__IPHONEOS__) SDL_EventState(SDL_FINGERMOTION, SDL_DISABLE); SDL_EventState(SDL_FINGERDOWN, SDL_DISABLE); SDL_EventState(SDL_FINGERUP, SDL_DISABLE); -#endif +#endif // declare this here so that it will always be at the front of the event queue. events::event_context global_context; diff --git a/src/wesnothd_connection.cpp b/src/wesnothd_connection.cpp index 817a68f1ac67..6366abe809d8 100644 --- a/src/wesnothd_connection.cpp +++ b/src/wesnothd_connection.cpp @@ -20,7 +20,7 @@ #include "serialization/parser.hpp" #include "utils/functional.hpp" -#include +#include #include