add SDL_SavePNG, write files as png if possible, unless ending .bmp

This commit adds a "minimal interface to lib png to support writing
png files from SDL surfaces", to the codebase. It adds a save_image
function to namespace image, and this checks compiler flags to see
if lib png is available. The function will save as a png if png
support is included and save file name doesn't have bmp extension,
and otherwise it will save as a BMP as usual.

We already had lib png as a dependency to build the tools, just not
the main game. This commit changes cmake and scons but makes the
dependency only optional, changing nothing if lib png is not
available.

See here: https://github.com/driedfruit/SDL_SavePNG
xBRZ trial commit

This commit adds the xBRZ algorithm to the codebase, and adds
an imagepath modification to use it, and adds a bunch of extra
images showcasing it to the unit help pages.

xBRZ was obtained from sourceforge (xBRZ.zip):
http://sourceforge.net/projects/hqmame/files/

It is modified, the original program wants to be compiled as
C++11, so I had to make minor changes so that it can compile as
C++98 w/ boost.

Main changes: get boost/cstdint and typedef uint32_t from there,
comment out all static asserts
change all cases of lambda functions to boost bind instances or
otherwise.
Fix non-utf8 characters.
dos2unix on all new files
Renanme files .h -> .hpp, as config.h is in our .gitignore
Suppress warnings from unused functions.
Fixup warnings from negligible initialization of POD types
Mark some templates results with attribute unused
fixup xbrz blending handling of alpha channel

xbrz reference implementation assumes that there is no alpha in
the sprites, and indeed, when it would blend any colors would zero
out the alpha channel. This is not suitable for our needs, as our
sprites have alpha, and SDL treats 0 alpha as being transparent.

This commit adds --placeholder-- alpha channel code. It does not
do proper alpha compositing, it just checks if either the source
or blend pixel has < 50% alpha (if so it ignores and takes the
other), and otherwise it applies full alpha to the pixel. This
seems to work fine in the ``typical'' cases I have observed but
a ``real'' implementation is needed here.
add wesnoth default scaling results along-side xBRZ in help pages
Revert "Anchor unit overlays to the topleft corner of the sprite."

This reverts commit 8f49cbad5508d761c1139c65e064c31ea3c79a00.

This commit breaks the game when you zoom in, since I'm trying to
make changes to how that works it is inconvenient to have to deal
with it right now. This bug was assigned to lipk more than a month
ago when he first introduced it.

Conflicts:
	changelog
	src/unit_drawer.cpp
as a test, use xBRZ when zooming images

This also sets the max zoom to 288 so you can reach 3x and 4x if
desired.
add "advanced graphics" preference dialog, for scaling algo options

This commit also gives the smart enums in src/make_enum.hpp
introspective capabilities, by giving them a static const size_t
which tells how many possible values they may take (hence the range
of the enum.) It was convenient for the dialog implementation
to have this.

Note that, I had to make use of __attribute__((unused)) to compile
this. I apply this using a macro which adds it for gcc, clang, and
mingw which I know respond to this attribute. I don't know what is
the equivalent MSVC device, or if it is even necessary, so its
possible that this commit needs to be fixed up.

We also disable unit tests for the new advanced graphics dialog,
there are no tests for it right now...
implement advanced graphics options back-end

This commit makes the `image` namespace check the advanced options
when selecting how to scale a sprite. It also makes the advanced
graphics options window flush the caches when an option is changed.

This permits the user to experiment with different graphics
algorithms while playing the game.
fixup help pages for units, only one sprite (as usual)

Only show one sprite, not all the scaled samples.
Only show ~xBRZ(2), not the straight baseframe.
xBRZ alpha blending fixup attempt
xBRZ fixup attempt: averaged alpha

it might be that this is the way to go as far as how to blend, and
to avoid messy unit edges, just try to ensure that the color
distance function takes alpha into account

I'm still unsure about averaged alpha as an approach though, it
doesn't really make that much sense to me.
commit a patch to our fribidi cmake, from downstream (macports)

see here:
https://trac.macports.org/browser/trunk/dports/games/wesnoth/files/patch-cmake-FindFriBiDi.cmake.diff

i tested that cmake still works and finds fribidi for me (linux)
fix mp wrong defautl controllers

the old code resulted in human sides beeing ai by default for
stat-of-scenaro saves in the mp connect dialog.
remove saved_game operator =

this assignment operator is not better than the defult operator.
add a warning log message.
add CheckPNG again to the SConstruct
Merge branch 'master' of https://github.com/wesnoth/wesnoth
Merge pull request #317 from cbeck88/patch_cmake_fribidi

commit a patch to our fribidi cmake, from downstream (macports)
Revert "create_symlinks: Make an exception for 1.10"

This reverts commit d4f7ebc8edccb11c511f5199d81b0a24af43716c.
campaignd: Fix abs() value truncation warning on clang 3.5