This does a few things:
* Refactored adjust_surface_alpha to use SDL_SetSurfaceAlphaMod
* Made all uses of the legacy SDL_SetAlpha use adjust_surface_alpha
* Made adjust_surface_alpha now take a non-const reference and perform the operation on the surface directly.
This file seemed to be some sort of reimplementation of <cassert> except
with some "feature" of trying to force the debugger to hit a breakpoint.
However, any decent debugger already hits a breakpoint with a standard
assert(), and this file really only served to make it harder to see the
actual error when using a Windows console.
Some instances of these macros were replaced with assert(), others with
VALIDATE() which instead throws an exception (and possibly puts up a
dialog, if the exception is caught before main()).
A few other related changes that got mixed in:
- Several error conditions now have a better error message (or indeed
any error message at all)
- Removed an unnecessary use of std::distance on a Boost iterator range.
- Removed a large chunk of code which did nothing but construct a widget
builder and then crash; the code was unreachable since an earlier loop
did the same thing (without crashing), and the comment seems to suggest
that it was a (seemingly no longer necessary) workaround for some buggy
compilers / linkers.
- noreturn added to the list of compatibilty C++11 features in global.hpp
(Of supported compilers, only VC12 lacks the new [[attribute]] syntax.)
- Fix detection of GCC in global.hpp
# Conflicts:
# src/gui/widgets/settings.cpp
While they did contain settings that are required for Wesnoth to run
correctly in the Visual Studio debugger, these settings can also be
specified in the main project file (even if only by manually editing
the XML).
Including the *.user files is problematic since it also includes things
that a developer may wish to frequently change, such as command-line
arguments.
Thus, the settings have been moved into the main project file.
Some explanations:
- savepng uses setjmp, so I changed it to C; this guarantees that someone does not accidentally introduce a C++ object in it (unlikely though that is)
- The loop in multiplayer.cpp seemed intended to allow the command-line to request repeated plays, so the break was removed rather than refactoring it to an if statement
- Some uninitialized structs were changed to be zero-initialized
- Use luaW_toboolean instead of lua_toboolean
- Needed explicit constructor for vconfig iterators, since their only member is const
This reverts commit 60d543cf3b.
Unfortunately, it seems that the address sanitizer cannot find its lib,
and I am not sure how to fix that, so I will have to revisit this at
a later time.