13 Commits

Author SHA1 Message Date
Charles Dang
50ed04319d FIlesystem: used scoped enums 2020-12-05 22:03:01 +11:00
Charles Dang
6adc9ab76f Bump SDL_Image dependency to 2.0.2 and enable jpg screenshots unconditionally 2020-12-05 09:30:17 +11:00
Iris Morelle
48bfa7abb8 image: Drop get/set_team_colors() functions
These are dead code. set_team_colors() is used in a couple of places as
well as a unit test, but get_team_colors() is never used and neither is
the actual variable behind both. The documentation alluded to it being
used by the ~TC() image path function, but in reality that uses the team
API instead (team::get_side_color_range()).

This does raise a concern however -- the unit test that did use
set_team_colors() used it with trivial and predictable input, so it
wasn't actually testing it. Not sure how we would go about properly
testing ~TC() -- the image path function tests don't currently test
any single image mod's output correctness.
2020-12-04 12:47:24 -03:00
Charles Dang
6e2f3e099e Removed utils/functional.hpp 2020-12-04 15:30:46 +11:00
Charles Dang
a7b30d42ae Ensure terrain scales with NN
Turns out this wasn't even respecting the old scaling algorithm settings. It was just using linear scaling :|
2019-11-05 23:15:21 +11:00
Charles Dang
15bf3bb256 Removed scaling algorithm customization
We're going to be using NN scaling for the map, and that's already handled automatically
by SDL (and in the future, OGL). We don't need these settings for surface SCALED_TO_ZOOM
and SCALED_TO_HEX scaling. In any case, if we want to scale a surface to zoom or hex, it
will almost certainly be for map rendering (such scaling methods don't make sense in the
UI, for example), so just defaulting to NN is simplest.

This change drops the option to use Linear or xBRZ scaling for map zooming. This was already
the practical case due to me converting map rendering to use textures. NN was used for all
zoom levels, and it's fast and looks good.
2019-11-05 22:55:05 +11:00
Charles Dang
0e173a451d Removed set_pixel_format
This is rather redundant. It's only called once when the CVideo subsystem is initialized and
nowhere else, and we already use the ARGB8888 format for all surfaces (which is what my testing
has revealed the SDL framebuffer surface's format is).
2019-07-23 12:30:01 +11:00
Charles Dang
ee35f6ac9a Cleaned up various surface-related backend things
* Removed create_neutral_surface in favor of a surface ctor that takes w/h dimensions.

* Removed make_neutral_surface in favor of a surface::make_neutral function. Most usecases of this were
  to make a copy of a surface anyway, so I added a new surface::clone function

* Moved the pixel format validation and conversion to the surface class. Now *all* surfaces should be
  guaranteed to be in the 'neutral' format. Any new surface that is created (with clone() or the dimension
  ctor will be in that format, and any time a raw SDL_Surface* ptr is assigned, it is also converted. This
  applies both to the ctor and assignment operators.

* Removed create_compatible_surface. All surfaces should be compatible in the first place.

* Removed surface::assign was in favor of simple assignment operators. The existing assignment operators
  already just called assign().

* Removed surface::null in favor of the implicit SDL_Surface* conversion operator for consistency. We were
  already using null and implicit pointer bool conversion, so I decided to go with the latter. I was going
  to add an operator bool(), but it was ambiguous in surface-to-surface comparisons.
2019-07-22 15:39:00 +11:00
Charles Dang
2470984af3 Prepend 'SDL2/' to all SDL includes
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.
2019-07-22 15:35:55 +11:00
loonycyborg
05d109215d Fix -Wdeprecated-copy compiler warnings with gcc 9 2019-07-16 13:11:05 +03:00
Celtic Minstrel
9cccfd73b0
Extend the image localization system to sounds and music (#3935)
Fixes #2987
2019-03-03 16:13:30 -05:00
Jyrki Vesterinen
858444b8b3 Fix Visual Studio compiler warnings 2018-10-27 20:14:54 +03:00
Martin Hrubý
96bbebb514 Fix building with Xcode 10 (#3460)
Resolves #3458.

(cherry-picked from commit 50301f84e33d828c39835bc47f04dd1107631960)
2018-10-07 03:24:17 +00:00