Skip to content

Commit

Permalink
Fix Travis
Browse files Browse the repository at this point in the history
  • Loading branch information
CelticMinstrel authored and jyrkive committed Dec 1, 2016
1 parent a97c5ed commit e7e5ca5
Show file tree
Hide file tree
Showing 48 changed files with 81 additions and 76 deletions.
9 changes: 0 additions & 9 deletions projectfiles/VC12/wesnoth.vcxproj
Expand Up @@ -3029,14 +3029,6 @@
<ObjectFileName Condition="'$(Configuration)|$(Platform)'=='Test_Debug|Win32'">$(IntDir)Scripting\Plugins\</ObjectFileName>
<ObjectFileName Condition="'$(Configuration)|$(Platform)'=='Test_Release|Win32'">$(IntDir)Scripting\Plugins\</ObjectFileName>
</ClCompile>
<ClCompile Include="..\..\src\sdl\color.cpp">
<ObjectFileName Condition="'$(Configuration)|$(Platform)'=='Debug_with_VLD|Win32'">$(IntDir)SDL\</ObjectFileName>
<ObjectFileName Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(IntDir)SDL\</ObjectFileName>
<ObjectFileName Condition="'$(Configuration)|$(Platform)'=='ReleaseDEBUG|Win32'">$(IntDir)SDL\</ObjectFileName>
<ObjectFileName Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(IntDir)SDL\</ObjectFileName>
<ObjectFileName Condition="'$(Configuration)|$(Platform)'=='Test_Debug|Win32'">$(IntDir)SDL\</ObjectFileName>
<ObjectFileName Condition="'$(Configuration)|$(Platform)'=='Test_Release|Win32'">$(IntDir)SDL\</ObjectFileName>
</ClCompile>
<ClCompile Include="..\..\src\sdl\exception.cpp">
<ObjectFileName Condition="'$(Configuration)|$(Platform)'=='Debug_with_VLD|Win32'">$(IntDir)SDL\</ObjectFileName>
<ObjectFileName Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(IntDir)SDL\</ObjectFileName>
Expand Down Expand Up @@ -4344,7 +4336,6 @@
<ClInclude Include="..\..\src\scripting\plugins\context.hpp" />
<ClInclude Include="..\..\src\scripting\plugins\manager.hpp" />
<ClInclude Include="..\..\src\scripting\push_check.hpp" />
<ClInclude Include="..\..\src\sdl\color.hpp" />
<ClInclude Include="..\..\src\sdl\exception.hpp" />
<ClInclude Include="..\..\src\sdl\rect.hpp" />
<ClInclude Include="..\..\src\sdl\utils.hpp" />
Expand Down
6 changes: 0 additions & 6 deletions projectfiles/VC12/wesnoth.vcxproj.filters
Expand Up @@ -1199,9 +1199,6 @@
<ClCompile Include="..\..\src\hotkey\hotkey_preferences_display.cpp">
<Filter>Hotkeys</Filter>
</ClCompile>
<ClCompile Include="..\..\src\sdl\color.cpp">
<Filter>SDL</Filter>
</ClCompile>
<ClCompile Include="..\..\src\sdl\exception.cpp">
<Filter>SDL</Filter>
</ClCompile>
Expand Down Expand Up @@ -2561,9 +2558,6 @@
<ClInclude Include="..\..\src\hotkey\hotkey_manager.hpp">
<Filter>Hotkeys</Filter>
</ClInclude>
<ClInclude Include="..\..\src\sdl\color.hpp">
<Filter>SDL</Filter>
</ClInclude>
<ClInclude Include="..\..\src\sdl\exception.hpp">
<Filter>SDL</Filter>
</ClInclude>
Expand Down
2 changes: 2 additions & 0 deletions projectfiles/VC12/wesnothlib.vcxproj
Expand Up @@ -167,6 +167,7 @@
</Lib>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="..\..\src\color.cpp" />
<ClCompile Include="..\..\src\color_range.cpp" />
<ClCompile Include="..\..\src\config.cpp" />
<ClCompile Include="..\..\src\filesystem_boost.cpp" />
Expand All @@ -193,6 +194,7 @@
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\..\src\about.hpp" />
<ClInclude Include="..\..\src\color.hpp" />
<ClInclude Include="..\..\src\config.hpp" />
<ClInclude Include="..\..\src\config_assign.hpp" />
<ClInclude Include="..\..\src\filesystem.hpp" />
Expand Down
2 changes: 2 additions & 0 deletions projectfiles/VC12/wesnothlib.vcxproj.filters
Expand Up @@ -53,6 +53,7 @@
<ClCompile Include="..\..\src\font\constants.cpp">
<Filter>Font</Filter>
</ClCompile>
<ClCompile Include="..\..\src\color.cpp" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\..\src\serialization\binary_or_text.hpp">
Expand Down Expand Up @@ -123,5 +124,6 @@
<Filter>spirit_po</Filter>
</ClInclude>
<ClInclude Include="..\..\src\spirit_po.hpp" />
<ClInclude Include="..\..\src\color.hpp" />
</ItemGroup>
</Project>
2 changes: 1 addition & 1 deletion src/CMakeLists.txt
Expand Up @@ -209,6 +209,7 @@ endif(ENABLE_SHARED_LIBRARIES)

set(libwesnoth-core_STAT_SRC
color_range.cpp
color.cpp
config.cpp
filesystem_boost.cpp
filesystem_common.cpp
Expand Down Expand Up @@ -363,7 +364,6 @@ set_target_properties(wesnoth-lua
########### Helper libraries ###############

set(wesnoth-sdl_SRC
sdl/color.cpp
sdl/exception.cpp
sdl/rect.cpp
sdl/window.cpp
Expand Down
2 changes: 1 addition & 1 deletion src/SConscript
Expand Up @@ -19,6 +19,7 @@ for env in [test_env, client_env, env]:

libwesnoth_core_sources = Split("""
color_range.cpp
color.cpp
config.cpp
font/constants.cpp
hash.cpp
Expand Down Expand Up @@ -160,7 +161,6 @@ libcampaignd_sources = Split("""
libcampaignd = env.Library("campaignd", libcampaignd_sources, OBJPREFIX = "campaignd_")

libwesnoth_sdl_sources = Split("""
sdl/color.cpp
sdl/exception.cpp
sdl/rect.cpp
sdl/utils.cpp
Expand Down
2 changes: 1 addition & 1 deletion src/ai/formula/function_table.cpp
Expand Up @@ -33,7 +33,7 @@
#include "pathfind/teleport.hpp"
#include "replay.hpp"
#include "resources.hpp"
#include "sdl/color.hpp"
#include "color.hpp"
#include "terrain/filter.hpp"
#include "units/unit.hpp"
#include "pathfind/pathfind.hpp"
Expand Down
8 changes: 4 additions & 4 deletions src/sdl/color.cpp → src/color.cpp
Expand Up @@ -12,7 +12,7 @@
*/

#include "serialization/string_utils.hpp"
#include "sdl/color.hpp"
#include "color.hpp"

#include <iomanip>
#include <sstream>
Expand All @@ -34,7 +34,7 @@ color_t color_t::from_rgba_string(const std::string& c)
static_cast<uint8_t>(std::stoul(fields[0])),
static_cast<uint8_t>(std::stoul(fields[1])),
static_cast<uint8_t>(std::stoul(fields[2])),
static_cast<uint8_t>(fields.size() == 4 ? std::stoul(fields[3]) : SDL_ALPHA_OPAQUE)
static_cast<uint8_t>(fields.size() == 4 ? std::stoul(fields[3]) : ALPHA_OPAQUE)
};
}

Expand All @@ -54,7 +54,7 @@ color_t color_t::from_rgb_string(const std::string& c)
static_cast<uint8_t>(std::stoul(fields[0])),
static_cast<uint8_t>(std::stoul(fields[0])),
static_cast<uint8_t>(std::stoul(fields[0])),
static_cast<uint8_t>(SDL_ALPHA_OPAQUE)
static_cast<uint8_t>(ALPHA_OPAQUE)
};
}

Expand All @@ -70,7 +70,7 @@ color_t color_t::from_hex_string(const std::string& c)
static_cast<uint8_t>((0x00FFFFFF & temp_c) >> 16),
static_cast<uint8_t>((0x00FFFFFF & temp_c) >> 8),
static_cast<uint8_t>((0x00FFFFFF & temp_c)),
SDL_ALPHA_OPAQUE
ALPHA_OPAQUE
};
}

Expand Down
22 changes: 9 additions & 13 deletions src/sdl/color.hpp → src/color.hpp
Expand Up @@ -20,7 +20,7 @@
#include <string>
#include <utility>

#include <SDL.h>
struct SDL_Color;

//
// TODO: constexpr
Expand All @@ -46,28 +46,26 @@ const uint32_t RGBA_RED_BITSHIFT = 24;
const uint32_t RGBA_GREEN_BITSHIFT = 16;
const uint32_t RGBA_BLUE_BITSHIFT = 8;

const uint32_t ALPHA_OPAQUE = 255;

struct color_t
{
color_t()
: r(255)
, g(255)
, b(255)
, a(SDL_ALPHA_OPAQUE)
, a(ALPHA_OPAQUE)
{}

color_t(uint8_t r_val, uint8_t g_val, uint8_t b_val, uint8_t a_val = SDL_ALPHA_OPAQUE)
color_t(uint8_t r_val, uint8_t g_val, uint8_t b_val, uint8_t a_val = ALPHA_OPAQUE)
: r(r_val)
, g(g_val)
, b(b_val)
, a(a_val)
{}

explicit color_t(const SDL_Color& c)
: r(c.r)
, g(c.g)
, b(c.b)
, a(c.a)
{}
// Implemented in sdl/utils.cpp to avoid dependency nightmares
explicit color_t(const SDL_Color& c);

/**
* Creates a new color_t object from a string variable in "R,G,B,A" format.
Expand Down Expand Up @@ -173,10 +171,8 @@ struct color_t
*
* @return The new color_t object.
*/
SDL_Color to_sdl() const
{
return {r, g, b, a};
}
// Implemented in sdl/utils.cpp to avoid dependency nightmares
SDL_Color to_sdl() const;

/** Red value */
uint8_t r;
Expand Down
2 changes: 1 addition & 1 deletion src/color_range.hpp
Expand Up @@ -18,7 +18,7 @@
#define COLOR_RANGE_H_INCLUDED

#include "global.hpp"
#include "sdl/color.hpp"
#include "color.hpp"

#include <cstdint>
#include <string>
Expand Down
2 changes: 1 addition & 1 deletion src/display.cpp
Expand Up @@ -37,7 +37,7 @@
#include "play_controller.hpp" //note: this can probably be refactored out
#include "reports.hpp"
#include "resources.hpp"
#include "sdl/color.hpp"
#include "color.hpp"
#include "synced_context.hpp"
#include "team.hpp"
#include "terrain/builder.hpp"
Expand Down
2 changes: 1 addition & 1 deletion src/display_chat_manager.cpp
Expand Up @@ -24,7 +24,7 @@
#include "font/marked-up_text.hpp"
#include "mp_ui_alerts.hpp"
#include "serialization/string_utils.hpp"
#include "sdl/color.hpp"
#include "color.hpp"

#include <SDL_timer.h>

Expand Down
2 changes: 1 addition & 1 deletion src/editor/action/mouse/mouse_action_map_label.cpp
Expand Up @@ -22,7 +22,7 @@
#include "gui/dialogs/editor/edit_label.hpp"

#include "font/standard_colors.hpp"
#include "sdl/color.hpp"
#include "color.hpp"

namespace editor {

Expand Down
2 changes: 1 addition & 1 deletion src/floating_label.hpp
Expand Up @@ -14,7 +14,7 @@

#pragma once

#include "sdl/color.hpp"
#include "color.hpp"
#include "sdl/utils.hpp"
#include <string>

Expand Down
4 changes: 3 additions & 1 deletion src/font/marked-up_text.hpp
Expand Up @@ -17,14 +17,16 @@
#ifndef MARKED_UP_TEXT_HPP_INCLUDED
#define MARKED_UP_TEXT_HPP_INCLUDED

#include "sdl/color.hpp"
#include "color.hpp"

class CVideo;
class surface;

#include <string>
#include "serialization/unicode_types.hpp"

#include <SDL.h>

namespace font {

/** Standard markups for color, size, font, images. */
Expand Down
2 changes: 1 addition & 1 deletion src/font/sdl_ttf.hpp
Expand Up @@ -18,7 +18,7 @@
#include "constants.hpp"
#include "font_id.hpp"
#include "font_description.hpp"
#include "sdl/color.hpp"
#include "color.hpp"

#include <string>

Expand Down
2 changes: 1 addition & 1 deletion src/font/standard_colors.hpp
Expand Up @@ -15,7 +15,7 @@
#ifndef FONT_STANDARD_COLORS_HPP
#define FONT_STANDARD_COLORS_HPP

#include "sdl/color.hpp"
#include "color.hpp"

namespace font {

Expand Down
2 changes: 1 addition & 1 deletion src/font/text.hpp
Expand Up @@ -16,7 +16,7 @@
#define TEXT_HPP_INCLUDED

#include "font/font_options.hpp"
#include "sdl/color.hpp"
#include "color.hpp"
#include "sdl/utils.hpp"
#include "serialization/unicode_types.hpp"

Expand Down
2 changes: 1 addition & 1 deletion src/font/text_formatting.cpp
Expand Up @@ -16,7 +16,7 @@
#include "formatter.hpp"
#include "game_config.hpp"
#include "gettext.hpp"
#include "sdl/color.hpp"
#include "color.hpp"

#include <iomanip>

Expand Down
2 changes: 1 addition & 1 deletion src/font/text_formatting.hpp
Expand Up @@ -14,7 +14,7 @@
#ifndef TEXT_FORMATTING_HPP_INCLUDED
#define TEXT_FORMATTING_HPP_INCLUDED

#include "sdl/color.hpp"
#include "color.hpp"

#include <SDL.h>
#include <string>
Expand Down
2 changes: 1 addition & 1 deletion src/font/text_surface.hpp
Expand Up @@ -16,7 +16,7 @@
#define FONT_TEXT_SURFACE_HPP

#include "font_id.hpp" // for text_chunk
#include "sdl/color.hpp"
#include "color.hpp"

#include <SDL_ttf.h>

Expand Down
2 changes: 1 addition & 1 deletion src/formula/function.cpp
Expand Up @@ -21,7 +21,7 @@
#include "game_display.hpp"
#include "game_config.hpp"
#include "log.hpp"
#include "sdl/color.hpp"
#include "color.hpp"

#include <boost/math/constants/constants.hpp>
using namespace boost::math::constants;
Expand Down
2 changes: 1 addition & 1 deletion src/game_config.hpp
Expand Up @@ -18,7 +18,7 @@ class config;
class version_info;
class color_range;

#include "sdl/color.hpp"
#include "color.hpp"
#include "tstring.hpp"

#include <vector>
Expand Down
2 changes: 1 addition & 1 deletion src/game_display.cpp
Expand Up @@ -39,7 +39,7 @@
#include "reports.hpp"
#include "resources.hpp"
#include "tod_manager.hpp"
#include "sdl/color.hpp"
#include "color.hpp"
#include "sound.hpp"
#include "synced_context.hpp"
#include "terrain/type_data.hpp"
Expand Down
11 changes: 8 additions & 3 deletions src/gettext_boost.cpp
Expand Up @@ -25,13 +25,18 @@
#include <boost/thread.hpp>
#include <set>

#ifdef __GNUC__
#if defined(__GNUC__)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wmissing-field-initializers"
#elif defined(_MSC_VER)
#pragma warning(push)
#pragma warning(disable: 4714)
#endif
#include "spirit_po.hpp"
#ifdef __GNUC__
#if defined(__GNUC__)
#pragma GCC diagnostic pop
#elif defined(_MSC_VER)
#pragma warning(pop)
#endif

#define DBG_G LOG_STREAM(debug, lg::general())
Expand Down Expand Up @@ -134,7 +139,7 @@ namespace
extra_messages_.emplace(get_base().domain(domain), cat);
} catch(spirit_po::catalog_exception& e) {
throw_po_error(lang_name_long, domain, e.what());
} catch(std::ios::failure& e) {
} catch(std::ios::failure&) {
throw_po_error(lang_name_long, domain, strerror(errno));
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/gui/core/window_builder.hpp
Expand Up @@ -17,7 +17,7 @@

#include "gui/auxiliary/typed_formula.hpp"
#include "gui/widgets/grid.hpp"
#include "sdl/color.hpp"
#include "color.hpp"

#include "utils/functional.hpp"

Expand Down

0 comments on commit e7e5ca5

Please sign in to comment.