Skip to content

Commit

Permalink
Prepend 'SDL2/' to all SDL includes
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
Vultraz committed Jul 22, 2019
1 parent 7ebc663 commit 2470984
Show file tree
Hide file tree
Showing 70 changed files with 129 additions and 129 deletions.
2 changes: 1 addition & 1 deletion src/ai/default/ca.cpp
Expand Up @@ -37,7 +37,7 @@
#include <numeric>
#include <boost/dynamic_bitset.hpp>

#include <SDL_timer.h>
#include <SDL2/SDL_timer.h>

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)
Expand Down
2 changes: 1 addition & 1 deletion src/ai/manager.cpp
Expand Up @@ -49,7 +49,7 @@
#include <utility> // for pair, make_pair
#include <vector> // for vector, allocator, etc

#include <SDL_timer.h>
#include <SDL2/SDL_timer.h>

namespace ai {

Expand Down
2 changes: 1 addition & 1 deletion src/animated.cpp
Expand Up @@ -19,7 +19,7 @@

#include "animated.hpp"

#include <SDL_timer.h>
#include <SDL2/SDL_timer.h>

// Put these here to ensure that there's only
// one instance of the current_ticks variable
Expand Down
8 changes: 4 additions & 4 deletions src/build_info.cpp
Expand Up @@ -26,10 +26,10 @@

#include <algorithm>

#include <SDL.h>
#include <SDL_image.h>
#include <SDL_mixer.h>
#include <SDL_ttf.h>
#include <SDL2/SDL.h>
#include <SDL2/SDL_image.h>
#include <SDL2/SDL_mixer.h>
#include <SDL2/SDL_ttf.h>

#include <boost/version.hpp>

Expand Down
2 changes: 1 addition & 1 deletion src/config_cache.cpp
Expand Up @@ -27,7 +27,7 @@

#include <boost/algorithm/string/replace.hpp>
#include <boost/iostreams/filter/gzip.hpp>
#include <SDL_platform.h>
#include <SDL2/SDL_platform.h>

static lg::log_domain log_cache("cache");
#define ERR_CACHE LOG_STREAM(err, log_cache)
Expand Down
2 changes: 1 addition & 1 deletion src/countdown_clock.hpp
Expand Up @@ -13,7 +13,7 @@

#pragma once
#include "events.hpp"
#include <SDL_timer.h>
#include <SDL2/SDL_timer.h>

class team;
class countdown_clock : public events::pump_monitor
Expand Down
4 changes: 2 additions & 2 deletions src/desktop/clipboard.cpp
Expand Up @@ -18,8 +18,8 @@
#include "serialization/unicode.hpp"
#include <algorithm>

#include <SDL_events.h>
#include <SDL_clipboard.h>
#include <SDL2/SDL_events.h>
#include <SDL2/SDL_clipboard.h>

#define CLIPBOARD_FUNCS_DEFINED

Expand Down
2 changes: 1 addition & 1 deletion src/desktop/windows_tray_notification.cpp
Expand Up @@ -14,7 +14,7 @@

#include "desktop/windows_tray_notification.hpp"

#include <SDL_syswm.h>
#include <SDL2/SDL_syswm.h>

#include "gettext.hpp"
#include "serialization/string_utils.hpp"
Expand Down
2 changes: 1 addition & 1 deletion src/desktop/windows_tray_notification.hpp
Expand Up @@ -14,7 +14,7 @@

#pragma once

#include <SDL.h>
#include <SDL2/SDL.h>
#include <string>
//forces to call Unicode winapi functions instead of ASCII (default)
#ifndef UNICODE
Expand Down
2 changes: 1 addition & 1 deletion src/display.cpp
Expand Up @@ -51,7 +51,7 @@
#include "show_dialog.hpp"
#include "gui/dialogs/loading_screen.hpp"

#include <SDL_image.h>
#include <SDL2/SDL_image.h>

#include <algorithm>
#include <array>
Expand Down
4 changes: 2 additions & 2 deletions src/display_chat_manager.cpp
Expand Up @@ -27,7 +27,7 @@
#include "preferences/credentials.hpp"
#include "serialization/utf8_exception.hpp"

#include <SDL_timer.h>
#include <SDL2/SDL_timer.h>

static lg::log_domain log_engine("engine");
#define ERR_NG LOG_STREAM(err, log_engine)
Expand Down Expand Up @@ -194,7 +194,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;

Expand Down
8 changes: 4 additions & 4 deletions src/events.cpp
Expand Up @@ -33,7 +33,7 @@
#include <vector>
#include <thread>

#include <SDL.h>
#include <SDL2/SDL.h>

#include <boost/range/adaptor/reversed.hpp>

Expand Down Expand Up @@ -520,7 +520,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;
Expand All @@ -534,7 +534,7 @@ void pump()
touch_event.tfinger.y = static_cast<float>(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;
}
Expand All @@ -545,7 +545,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;
Expand Down
2 changes: 1 addition & 1 deletion src/events.hpp
Expand Up @@ -14,7 +14,7 @@

#pragma once

#include <SDL_events.h>
#include <SDL2/SDL_events.h>
#include <vector>
#include <list>
#include <functional>
Expand Down
8 changes: 4 additions & 4 deletions src/filesystem.cpp
Expand Up @@ -58,7 +58,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 <SDL_filesystem.h>
#include <SDL2/SDL_filesystem.h>

#endif

Expand Down Expand Up @@ -555,13 +555,13 @@ static const std::string& get_version_path_suffix()
{
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: ";
Expand All @@ -582,7 +582,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;
Expand Down
4 changes: 2 additions & 2 deletions src/filesystem_sdl.cpp
Expand Up @@ -11,8 +11,8 @@
See the COPYING file for more details.
*/

#include <SDL.h>
#include <SDL_rwops.h>
#include <SDL2/SDL.h>
#include <SDL2/SDL_rwops.h>

#include "filesystem.hpp"
#include "log.hpp"
Expand Down
2 changes: 1 addition & 1 deletion src/font/font_id.hpp
Expand Up @@ -21,7 +21,7 @@
#include <string>
#include <tuple>

#include <SDL_ttf.h>
#include <SDL2/SDL_ttf.h>

/***
* Note: This is specific to SDL_TTF code path
Expand Down
2 changes: 1 addition & 1 deletion src/font/marked-up_text.hpp
Expand Up @@ -23,7 +23,7 @@ class surface;

#include <string>

#include <SDL_rect.h>
#include <SDL2/SDL_rect.h>

namespace font {

Expand Down
2 changes: 1 addition & 1 deletion src/font/sdl_ttf.cpp
Expand Up @@ -31,7 +31,7 @@
#include "sdl/surface.hpp"
#include "serialization/unicode.hpp"

#include <SDL_ttf.h>
#include <SDL2/SDL_ttf.h>

#include <map>
#include <string>
Expand Down
2 changes: 1 addition & 1 deletion src/font/sdl_ttf.hpp
Expand Up @@ -21,7 +21,7 @@

#include <string>

#include <SDL_ttf.h>
#include <SDL2/SDL_ttf.h>

class surface;

Expand Down
2 changes: 1 addition & 1 deletion src/font/text_surface.cpp
Expand Up @@ -20,7 +20,7 @@

#include "log.hpp"

#include <SDL_ttf.h>
#include <SDL2/SDL_ttf.h>

#include <string>
#include <vector>
Expand Down
2 changes: 1 addition & 1 deletion src/font/text_surface.hpp
Expand Up @@ -17,7 +17,7 @@
#include "font_id.hpp" // for text_chunk
#include "color.hpp"

#include <SDL_ttf.h>
#include <SDL2/SDL_ttf.h>

#include <string>
#include <vector>
Expand Down
2 changes: 1 addition & 1 deletion src/game_launcher.cpp
Expand Up @@ -67,7 +67,7 @@
#include <iostream> // for operator<<, basic_ostream, etc
#include <new>
#include <utility> // for pair
#include <SDL.h> // for SDL_INIT_JOYSTICK, etc
#include <SDL2/SDL.h> // for SDL_INIT_JOYSTICK, etc

#ifdef DEBUG_WINDOW_LAYOUT_GRAPHS
#include "gui/widgets/debug.hpp"
Expand Down
2 changes: 1 addition & 1 deletion src/game_state.cpp
Expand Up @@ -33,7 +33,7 @@
#include "gui/dialogs/loading_screen.hpp"

#include "utils/functional.hpp"
#include <SDL_timer.h>
#include <SDL2/SDL_timer.h>

#include <algorithm>
#include <set>
Expand Down
8 changes: 4 additions & 4 deletions src/generators/default_map_generator_job.cpp
Expand Up @@ -31,7 +31,7 @@
#include "seed_rng.hpp"
#include "wml_exception.hpp"

#include <SDL_timer.h>
#include <SDL2/SDL_timer.h>

static lg::log_domain log_mapgen("mapgen");
#define ERR_NG LOG_STREAM(err, log_mapgen)
Expand Down Expand Up @@ -696,9 +696,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<map_location,std::string>* 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
Expand Down
8 changes: 4 additions & 4 deletions src/gui/core/event/dispatcher.hpp
Expand Up @@ -19,7 +19,7 @@

#include "utils/functional.hpp"

#include <SDL_events.h>
#include <SDL2/SDL_events.h>

#include <boost/mpl/int.hpp>

Expand Down Expand Up @@ -251,8 +251,8 @@ class dispatcher
widget& target,
const point& pos,
const point& distance);


/**
* Fires an event which takes touch-gesture parameters.
*
Expand All @@ -269,7 +269,7 @@ class dispatcher
float dTheta,
float dDist,
Uint8 numFingers);


/**
* Fires an event which takes notification parameters.
Expand Down
2 changes: 1 addition & 1 deletion src/gui/core/event/dispatcher_private.hpp
Expand Up @@ -18,7 +18,7 @@

#include "gui/widgets/widget.hpp"

#include <SDL_events.h>
#include <SDL2/SDL_events.h>

#include <boost/mpl/for_each.hpp>
#include <boost/range/adaptor/reversed.hpp>
Expand Down
4 changes: 2 additions & 2 deletions src/gui/core/timer.cpp
Expand Up @@ -17,7 +17,7 @@
#include "events.hpp"
#include "gui/core/log.hpp"

#include <SDL_timer.h>
#include <SDL2/SDL_timer.h>

#include <map>
#include <mutex>
Expand Down Expand Up @@ -45,7 +45,7 @@ static std::map<std::size_t, timer>& get_timers()
static std::map<std::size_t, timer>* ptimers = new std::map<std::size_t, timer>();
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
Expand Down
2 changes: 1 addition & 1 deletion src/gui/core/timer.hpp
Expand Up @@ -31,7 +31,7 @@

#include "utils/functional.hpp"

#include <SDL_types.h>
#include <SDL2/SDL_types.h>

namespace gui2
{
Expand Down
2 changes: 1 addition & 1 deletion src/gui/dialogs/end_credits.hpp
Expand Up @@ -15,7 +15,7 @@

#include "gui/dialogs/modal_dialog.hpp"

#include <SDL_keycode.h>
#include <SDL2/SDL_keycode.h>
#include <vector>

class display;
Expand Down
2 changes: 1 addition & 1 deletion src/gui/dialogs/game_load.hpp
Expand Up @@ -20,7 +20,7 @@
#include "save_index.hpp"
#include "gettext.hpp"

#include <SDL_keycode.h>
#include <SDL2/SDL_keycode.h>

namespace gui2
{
Expand Down
2 changes: 1 addition & 1 deletion src/gui/dialogs/hotkey_bind.cpp
Expand Up @@ -18,7 +18,7 @@
#include "gui/widgets/settings.hpp"
#include "gui/widgets/window.hpp"

#include <SDL.h>
#include <SDL2/SDL.h>

namespace gui2
{
Expand Down

0 comments on commit 2470984

Please sign in to comment.