Commit graph

12 commits

Author SHA1 Message Date
Chris Beck
968d8a900d add an assert to detect possible division by zero
issue found by coverity
2014-11-17 14:35:20 -05:00
Chris Beck
ca79d3f14a fixup various code comments 2014-11-14 00:50:57 -05:00
Chris Beck
5f96795080 refactor scale_surface, and add old version as "legacy linear" option 2014-11-14 00:32:40 -05:00
Chris Beck
8dd10eb418 add ~Wipe_Alpha image path (mainly a diagnostic tool) 2014-11-03 17:51:08 -05:00
Chris Beck
3a947df480 add ~Alpha image path function
Mainly useful as a diagnostic tool
2014-11-03 16:34:09 -05:00
Chris Beck
1582026ec9 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.
2014-10-24 18:42:18 -04:00
Chris Beck
eeb92161e0 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
2014-10-24 18:42:17 -04:00
Chris Beck
d73a117278 disable "alpha thresholding" in our bilinear interpolation algo
In this commit from late 2005, boucman added a bilinear interpolation
routine for scaling images which we use everywhere.

https://github.com/wesnoth/wesnoth/commit/2df60619

It is a modified bilinear interpolation -- one of the tweaks is that
at the very end an "alpha thresholding" step occurs. If the alpha
of a pixel is less than half of the average alpha of its neighbors,
it is discarded and set to fully transparent. Boucman writes that
this was done to combat a gametime artifact that would occur when
moving the hexagonal selector around with the mouse -- however, it
creates a small loss in image quality. Boucman writes that skeleton
archer bowstrings don't look as good -- I notice also that the edges
of the wings of drakes seem a bit sharper / more pixelated somehow.

In this commit I tried disabling the alpha thresholding, since the
way that the hex selector works has been changed since 2005, so this
might no longer be an issue. Sure enough the "hexagonal haloes" are
gone now, so it seems that we can safely get rid of the alpha
thresholding.
2014-10-10 18:04:24 -04:00
Boldizsár Lipka
570fd71e8b Change default color alpha for SDL_gpu builds.
In SDL_gpu, 255 is 'opaque'.
2014-07-17 21:47:06 +02:00
Boldizsár Lipka
51095a3df1 sdl_fill_rect -> fill_rect.
As the function is now part of the sdl namespace, the sdl_ prefix is
quite redundant.
2014-06-03 20:43:45 +02:00
Boldizsár Lipka
c441630467 Move fill_rect to sdl/rect.hpp. 2014-06-03 20:43:44 +02:00
Boldizsár Lipka
7ca6ad8ad1 Move sdl_utils to sdl/utils. 2014-06-03 10:30:12 +02:00
Renamed from src/sdl_utils.cpp (Browse further)