70462 Commits

Author SHA1 Message Date
Charles Dang
3da9077312 CVideo/Display: cleaned up/slightly refactored a few things
* display::w() and display::h() now simply forward to CVideo::getx() and gety() instead of querying
  the underlying window object. This is a slight semantic change, since now these functions return
  screen coordinates instead of pixels, but that's probably what we want in the long term anyway.
* sdl:🪟:get_flags() now returns the proper uint32_t instead of int
* Added a dedicated CVideo::window_has_flags function since testing window flags was the most common
  use of the underlying sdl window outside the class.
* Made CVideo::set_window_mode private. This is an implementation detail and shouldn't be public.
* Removed BPP argument from CVideo::make_test_fake. It's never passed anything other than 32, and
  we're long past the time when we care about window BPP.
* Removed sdl/window.hpp include from video.hpp. This was mostly only there to allow other area of
  the code to call get_window()->get_flags() (and for display.hpp). There's no real reason for it to
  be there anymore and was just making any modification to the sdl window header take ages.
2017-11-21 14:20:14 +11:00
Charles Dang
edb07f0cd4 CVideo: formatting and doc update
Also renamed a few functions to use snake case or be a little more descriptive.
2017-11-21 13:22:37 +11:00
Gregory A Lundberg
05cc5e6b88 Autodoc cleanup for CVideo mess 2017-11-20 11:39:34 -06:00
Gregory A Lundberg
5d7f268b59 Partially revert 321c350
Accidental revert of PR 2212 (whose commit is completely gone).
2017-11-20 10:52:06 -06:00
Gregory A Lundberg
28ccc95d6f Still _more_ CVideo fixes 2017-11-20 10:26:23 -06:00
Charles Dang
4232788579 Use CVideo::get_singleton() over resources::screen->video()
They point to the same thing, but it's more consistent to use the former.
2017-11-21 03:16:51 +11:00
Charles Dang
935e07af03 Fixup b46a64b8ad7a (forgot to commit this bit) 2017-11-21 03:09:07 +11:00
Charles Dang
c67f5c352a Cleaned up more unnecessary CVideo function arguments and class members
* Dropped unused CVideo class member references.
* Replaced the lone usecase of the CVideo member in loadgame with the singleton and removed said member.
* Removed CVideo references from a bunch of addon management functions.
* Cleaned up a *lot* of now-unnecessary forward CVideo declarations.
2017-11-21 03:07:23 +11:00
Charles Dang
9dd497db4a Cleaned up the mess of CVideo references passed around the game initialization process
Essentially, we had CVideo arguments being passed down this chain:
- game_launcher
- free-standing MP initialization functions
- campaign_controller
- playsingle_controller/playmp_controller
- play_controller
- game_display
- display

And likewise down through
- game_launcher
- editor_controller
- editor_display
- display

With only a minimal number of actual calls along the way. :| There were maybe... two remaining?

This removes the CVideo arguments and class members from both chains (except of course, game_launcher.
That's where the "real" CVideo object lives).

The display class now initializes its CVideo reference from the singleton, which is also used in the
very few other places it's needed. I also replaced a check for a null video ptr in show_tooltip()
with a faked() check (see src/tooltips.cpp). That seems to make more sense, since CVideo is never
null now.
2017-11-21 02:30:19 +11:00
Charles Dang
b46a64b8ad Dropped CVideo parameter from loading screen and prefs display functions (missed in f2b31ba)
I had left the former alone in the above commit since I thought it might be worth keeping for the
faked() call, but that's not really a great reason.

As for the latter, I didn't realize the CVideo argument wasn't really even needed. I didn't even
need to replace it with a get_singleton() call since the resolution list is updated by set_resolution_list
before it's used.
2017-11-21 01:32:57 +11:00
Charles Dang
464cf07a8b Fix Travis GCC warnings for f2b31ba082e1
This also removes a bunch of unnecessary CVideo arguments from various savegame functions that
emerged as I cleaned up the unused parameters. savegame::save_game did take a CVideo pointer
that did look like it was intended to be a sort of do-show-dialog flag, but since that parameter
was never passed as null, I removed it.
2017-11-20 22:29:49 +11:00
Charles Dang
7fad7144d7
Merge pull request #2221 from Vultraz/master
Removed CVideo parameters from dialog show() functions, simplified display/execute implementation
2017-11-20 19:25:35 +11:00
Charles Dang
3029107847 Update tests for 335ffa1b8100 2017-11-20 19:24:41 +11:00
Charles Dang
f2b31ba082 Massive cleanup of GUI2 display/show and execute functions implementations and related CVideo arguments
This a two part commit. First:
----------------------------------------------------------------------------------------------------
Added and deployed two new helper macros for the standard implementations of the static execute
and display functions. I also made use of a variadic template in order greatly simplify code
maintenance. Now, even if the dialog's ctor parameters change, no one has to worry about updating
the associated execute/display functions (though of course, this only applies if the helper macros
are used). \o/

I did not deploy the macro in cases where there were multiple overloads or the functions did more
than just show their dialogs. I might add an additional __VA_ARGS_ parameter to the macros later.
Do note for the end_credits dialog I moved the default empty-string parameter from the display
function to the ctor.

Second:
----------------------------------------------------------------------------------------------------
Another change is that modal_dialog::show and modeless_dialog::show no longer take CVideo arguments.
Since the video argument couldn't be included in the parameter pack (maintaining the argument would
have meant making it the first one, which would be just as much work), and using CVideo::get_singleton
in the macros would require adding video.hpp includes in a whole bunch of files, I simply removed the
argument. I had been intending to do this for a while anyway.

This therefor also removes the CVideo argument from:
* All dialog display/execute functions.
* modal_dialog::show
* modal_dialog::build_window
* modeless_dialog::show
* modeless_dialog::build_window
* wml_exception::show
* gui2::show_message
* gui2::show_error_message
* gui2::show_transient_message
* gui2::show_transient_error_message
* gui2::show_wml_message
* gui2::build
* gui2:🪟:window
* gui2::dialogs::tip::show
* Various GUI2-related Lua functions. The video_dispatch helper was also removed.
* Any functions that took a CVideo argument for the sole purpose of passing it to one of the above.

Ya know, all these damn CVideo arguments didn't actually do anything, besides an occasional check to
CVideo::faked. At the end of the pipeline, they just got assigned to the video_ member of gui2::window.
Huge code bloat for nothing.
2017-11-20 19:24:41 +11:00
Jyrki Vesterinen
321c350d76 Merge branch 'static-libs'
Manual merge of pull request #2208.
2017-11-20 07:52:54 +02:00
David Seifert
870f896a53 Update changelog
* Detail the `GNUInstallDirs` changes
* Non-Windows builds now use the absolute path for all
  data paths. This is less brittle, as relative path
  lookup in Unix always depends on the current value of
  the PWD environmental variable.
2017-11-20 07:45:00 +02:00
David Seifert
0e57d0840a Use GNUInstallDirs to specify directories
* GNUInstallDirs is the only Kitware-supported
  way to change the default directories. Most
  distributions have hooks for changing these
  directories, which makes integrating wesnoth
  easier and more consistent with the rest of
  the CMake ecosystem.
* Make build system perfectly out-of-source
  compatible. The build system should never
  touch files in the source tree.
2017-11-20 07:44:46 +02:00
lundberg
7d910ab075 Fix MSVC variable hides variable warning 2017-11-20 07:38:35 +02:00
pentarctagon
e45e824499 Have scons and cmake link against same static libraries. 2017-11-20 07:38:18 +02:00
Jyrki Vesterinen
17c0fd97a8 Fix MSVC compiler warning about overriding a function
Visual Studio 2013 omits a warning if a parameter is const-qualified in the
original function but not the overriding one (or the reverse).
2017-11-20 07:38:18 +02:00
Jyrki Vesterinen
5535b36395 Fix build with TDM-GCC
@newfrenchy83 said that the build is failing:
37225d24ea (commitcomment-25629052)

It looks like TDM-GCC uses Windows XP development headers, unfortunately.
However, the problem is easy to work around by simply #defining the missing
value ourselves. We should consider dropping TDM-GCC support after the 1.14
release, though.
2017-11-20 07:38:18 +02:00
pentarctagon
c8b37856c5 Add explanation comment. 2017-11-20 07:38:18 +02:00
pentarctagon
f1b4f79afc Fix the scons Wesnoth Windows executable icon. 2017-11-20 07:38:18 +02:00
Wedge009
34008913ed Add missing configuration for Release compilation.
[ci skip]
2017-11-20 16:33:21 +11:00
Wedge009
de31ac37b1 Tidy recent additions.
[ci skip]
2017-11-20 16:32:39 +11:00
Charles Dang
335ffa1b81 MP Create Game: minor improvements
* The dialog now owns its own create_engine object. Previously, it was created immediately
  adjacent to the dialog object and passed in by reference, which made no sense.
* The create_engine also no longer takes a CVideo reference and instead initializes its CVideo
  member from the singleton.
* The 'Registered Users Only' toggle is now disabled if the host isn't registered themselves
  (fixes #2206)
* The above setting, along with Observers, Strict Sync, and Game Password, are disabled in local
  mode. These don't really make sense when not playing a networked game.
2017-11-20 12:30:11 +11:00
Jyrki Vesterinen
91151cbe52 Update Visual Studio project 2017-11-19 20:21:11 +02:00
Alexander van Gessel
5e575694b9 Remove unneeded include 2017-11-19 18:39:23 +01:00
Alexander van Gessel
3d3b1bc443 Partially revert ca5144227707
Taking an argument, especially by reference, does not require a full type.
Including unit.hpp in make.hpp utterly defeats the point of make.hpp's existence.
2017-11-19 18:35:58 +01:00
Gregory A Lundberg
ca51442277 Fix compile errors from 669ba885ceecad83562dc2084057232f7c7fca0f
Sorry, you can't avoid including unit.hpp in all cases.

But, it's still a lot less than it used to be.
2017-11-19 11:22:01 -06:00
Alexander van Gessel
65ecc2d8ca Use make_unit_ptr to avoid a heavy include 2017-11-19 17:51:16 +01:00
Alexander van Gessel
669ba885ce Add make_unit_ptr functions in separate header, to avoid inclusion of unit.hpp 2017-11-19 17:50:47 +01:00
Alexander van Gessel
f2dc997b50 Remove unneeded include 2017-11-19 17:38:34 +01:00
Alexander van Gessel
067e475a0a Out-of-line some functions to remove an include 2017-11-19 17:38:03 +01:00
Alexander van Gessel
ba33ed7cd4 Out-of-line some functions to remove an include 2017-11-19 17:37:27 +01:00
Alexander van Gessel
d9fe6395af Out-of-line a function to remove an include 2017-11-19 17:35:00 +01:00
Alexander van Gessel
543119134b Out-of-line and forward-declare to remove some includes 2017-11-19 17:32:13 +01:00
Alexander van Gessel
f8ecc545a2 Out-of-line a function to remove an include 2017-11-19 17:17:00 +01:00
Alexander van Gessel
826c28b87c Out-of-line some functions to remove an include 2017-11-19 17:08:52 +01:00
Jyrki Vesterinen
01835123fe Windows: if a CMD switch immediately exits, wait for an Enter press
Helpful if a developer is testing --help from Visual Studio, for example.
2017-11-18 22:13:50 +02:00
Jyrki Vesterinen
2ad0715d7f Update --help text about FPS-related options 2017-11-18 22:09:22 +02:00
sigurdfdragon
7c276059ea Update changelogs 2017-11-18 13:58:12 -05:00
sigurdfdragon
8ba4e33e7a DM S19: Fix dialog 2017-11-18 13:40:49 -05:00
sigurdfdragon
22492fc1b5 DM S19: Have either undead or Delfador be able to kill Iliah-Malal
Previously, there was temptation for players to ditch all of their
undead before leaving the land of the dead scenarios so they had
Delfador instead of the undead able to kill Iliah-Malal.
2017-11-18 13:40:49 -05:00
sigurdfdragon
44f42b0fc5 Update pofix.py
For HttT S20b change.
2017-11-18 13:39:13 -05:00
Jyrki Vesterinen
c680613996 Fix misplaced parenthesis 2017-11-18 19:10:29 +02:00
Celtic Minstrel
48178adb9f Add string insert function for WFL 2017-11-18 11:51:33 -05:00
Celtic Minstrel
9e20250e93 Finish deploying DEFINE_WFL_FUNCTION macro 2017-11-18 11:51:31 -05:00
David Seifert
0f2b585fc5 Bring back LOCALEDIR
* The current infrastructure relies on `LOCALEDIR`
  in places beyond CMake, hence we need to keep
  it for the time being.

Fixes #2211
2017-11-18 10:36:12 -06:00
Gregory A Lundberg
d8efb9a2bf Git: do NOT ignore any MO translations in the po folder.
PR #1725 moved the compiled translations from the translations directory to the po directory.

I would have noticed sooner if Git had not been told to ignore virtually all MO files.
2017-11-17 15:13:12 -06:00