70709 Commits

Author SHA1 Message Date
Charles Dang
c93aebb1de Tests: removed empty files
These were emptied out when SDL 1.2 was removed (358bd1235f07d8d577). I seem to recall
someone saying it might be worth keeping them around in case something needed to be put
back, but it's been a year and a half. Not much worth in keeping empty files.
2017-11-27 09:42:14 +11:00
lundberg
ba6b6a1f53 Update VC12 project for wesnothd
Drop the additional requirements for SDL2 libraries. Wesnothd no longer requires SDL2.
2017-11-26 15:26:17 -06:00
Jyrki Vesterinen
13f216cd17 Fix a copy-paste mistake 2017-11-26 21:00:09 +02:00
Jyrki Vesterinen
8a74ee4d72 An year has less than 27 months 2017-11-26 20:58:45 +02:00
Charles Dang
a21697fef3 Cleaned up various areas of code related to setting window resolution
* Added a point ctor that takes an SDL_Point.
* Added a toggle_fullscreen function to CVideo.
* Change all management of resolution data to use point instead of std::pair<int, int>. This
  shortens the code considerably.
* Cleaned up preferences_dialog::set_resolution_list
* Made CVideo::set_resolution return a bool indicating whether resolution was changed.
* Swapped which of the two set_resolution overloads contains the main implementation.
* Moved the events::raise_resize_event() call when setting resolution to the CVideo function
  where it should have always been (instead of the prefs dialog callback). This is a pretty
  essential component and having it localized in one place meant any other area of the code
  that might have called set_resolution wouldn't have it.
2017-11-27 05:53:23 +11:00
Charles Dang
4ff249da7d Fixed regression in 8bf95ce69a9bd59 (fixes #2245)
I thought changing what the return value of sdl_event_handler::hotkey_pressed meant wouldn't
cause any regressions, but apparently I was wrong. This made it so certain key-down events
were never fired at all, meaning the associated keys could never be entered in a textbox.
Pretty serious!

I've restored the bool retval to dispatcher::execute_hotkey. It will return false if there's
no associated hotkey function (like before), and true otherwise. sdl_event_handler::hotkey_pressed
has also been reverted to return the value of that function.
2017-11-27 05:45:46 +11:00
Jyrki Vesterinen
4d0c46164e Miscellaneous optimizations in display::get_terrain_images()
* The vector of surfaces is now a class member variable instead of a local
variable. This saves a memory allocation every time the function is called
- which is worth it in this case, as the function is a major performance
bottleneck.

* The surfaces are now being moved instead of copied where possible. Turns
out that freeing a SDL surface is fairly expensive in performance-critical
code.

* Pointers to ToDs are now cached, reducing the number of calls to
get_time_of_day() from 37 to 7.

In a stress-test in Aetheryn's Mod at 50 % zoom, the FPS I was getting on
my PC (Intel Core i5-4430) increased from 16 to 23.
2017-11-26 20:07:34 +02:00
Jyrki Vesterinen
ca4cef633a Stop explicitly redrawing in playmp_controller::play_human_turn()
Play_controller::play_slice() that the aforementioned function calls
redraws the game anyway. Calling redraw code from two places makes
profiling data harder to investigate.
2017-11-26 15:22:22 +02:00
doofus-01
090810a778
updating Ixthala Demon unit (#2240) 2017-11-25 11:43:49 -08:00
pentarctagon
42a44ff668 Remove ENABLE_TOOLS and ENABLE_SDL2_TOOLS from cmake. 2017-11-25 12:01:49 -06:00
pentarctagon
75b73043e3 Remove MSVC support from cmake. 2017-11-25 12:01:49 -06:00
Gregory A Lundberg
537f530c2b Fix compile errors
Not sure where these came from. I'm assuming the changes to have CMake and SCons be equally strict.

If so, I'm amazed this was all which popped up!
2017-11-24 18:48:28 -06:00
Charles Dang
6d8cbf281f Merge branch 'master' of github.com:wesnoth/wesnoth 2017-11-25 09:03:23 +11:00
Charles Dang
fafdb95c84 Title Screen: minor refactoring to button callback registering
* Removed window reference from callback function signature. Instead, bind (or capture)
  window reference when register_button is called.
* Moved long callbacks to their own functions.
2017-11-25 09:03:06 +11:00
pentarctagon
7ff30491fe Make strict builds consistent between scons and cmake 2017-11-24 15:00:01 -06:00
mattsc
5987ff88ae Update Xcode project 2017-11-24 11:23:52 -08:00
loonycyborg
821b4ecbc7 Move asio streambufs in network_asio::connection into unique_ptrs
This is needed to properly reinitialize streambuf objects after cancel.
This prevents crash from issue #2203 but download after cancel still doesn't
work properly. More investigation needed.
2017-11-24 18:18:42 +03:00
Charles Dang
8bf95ce69a GUI2: changed hotkey callback return value to void
The bool retval was presumably meant to allow stopping execution of the main hotkey callbacks
if a local one was meant to take precedence. However, that wasn't used anywhere (all callbacks
were returning true) and the return value just meant we had to create lambdas or wrapper functions
everywhere. If necessary, we can re-add halt functionality later.

I did leave sdl_event_handler::hotkey_pressed returning a bool value, though, except now it signals
whether there was a valid dispatcher with which to execute the hotkey callback. This seemed reasonable
since we probably wouldn't want to continue if there were no dispatcher anyway, though this only has
any effect in the key_down handler.
2017-11-25 02:09:49 +11:00
Charles Dang
b7367b8b07 Create Engine: keep a member reference to the game config
Shortens the code slightly by avoiding continuously fetching it from the gc manager.
2017-11-25 00:19:51 +11:00
Charles Dang
5481a7985f Cleaned up SP initialization function parameters
As of f4584b6b722a9 the game_config isn't needed in SP initialization anymore, and
enter_connect_mode can be made to return void.
2017-11-24 23:34:53 +11:00
Charles Dang
f4584b6b72 MP Game Settings: removed show_connect member
Early in the 1.13 development cycle there used to be an option to show the mp_connect screen
(now mp_staging) before starting an SP campaign. That was scrapped and the only code that used
it (in the SP initialization process) commented it out. Since we're not going to restore it,
might as well remove this flag.

Also removes the one instance remaining of a "show_configure" flag. Pretty sure this might have
also been a relic from the same time as show_connect, but it looks like it was since removed.
SP now has a dedicated screen for configuring active modifications in SP, which was the only
reason to show the configure dialog anyway (plus the mp create and configure screens were combined
later in 1.13 anyway).
2017-11-24 23:16:33 +11:00
Charles Dang
acd31b1a77 MP Game Utils: formatting and minor code cleanup 2017-11-24 23:08:40 +11:00
Nils Kneuper
21eb31b757 updated Spanish translation 2017-11-24 00:18:27 +01:00
Nils Kneuper
6f9f1904fd fixed syntax error in pofix and "problem"
note: please do only enter "Part of the string", not the full strings.
The text in the po files is broken into parts and full strings, with
missing newlines, will not cause matches for the string.
2017-11-24 00:16:19 +01:00
Gregory A Lundberg
81fc44ad5d Fix typos in ad01dbd404e092e258fece5d1ad473fea1717d12 2017-11-23 16:32:56 -06:00
Gregory A Lundberg
0eb25f41d0 Fix wesnoth.print
Pass each parameter through Lua tostring() to convert to strings. This also allows meta-method tostring on userdata.

This aligns the operation of wesnoth print() to be closer to what a Lua programmer would expect from the normal Lua print() which is not available.

Closes Issue #2236
2017-11-23 10:59:39 -06:00
kallaballa
2150cdbde6 replaced recieve with receive 2017-11-24 02:50:44 +11:00
Charles Dang
693735d90c Fixed a bunch of log output and code comment typos
[ci skip]
2017-11-24 01:14:03 +11:00
sigurdfdragon
ec7b536c7c update changelog 2017-11-22 20:27:34 -05:00
sigurdfdragon
23c23b7a55 WML: Add [show_if] usage in [objectives] subtag [gold_carryover] 2017-11-22 20:27:13 -05:00
sigurdfdragon
64d3aa1ab6 SotA: Fix and improve freeze/thaw unit implementation
Bug was that when a unit was thawed, mouse over in unit sidebar would show
incorrect movement costs (all 1's).

New implementation properly uses {UNREACHABLE} and makes use of the now
available [remove_object] tag.
2017-11-22 17:37:14 -05:00
Alexander van Gessel
ca03818fa8 >= 1.64, not > 1.64 2017-11-22 16:16:53 +01:00
Alexander van Gessel
0cbab6eeed Bump minimum boost version for external string_view 2017-11-22 15:48:42 +01:00
Charles Dang
111ca03510 Wesnothd Connection: formatting cleanup 2017-11-22 20:22:26 +11:00
Jyrki Vesterinen
722f319c50 Make hotkeys copyable again
There is barely any point in moving hotkeys because the command is the only
member variable that's both 1) movable and 2) faster to move than copy. In
2cc3f99651c9de13eb36ab0c490996a8dd47e50e, @Vultraz talked about "avoiding hundreds of copies", but
moving isn't necessarily any faster than copying. Seriously, making hotkeys
noncopyable was just a premature and obviously unprofiled optimization.

Besides, this also fixes build on Visual Studio 2013.
2017-11-22 08:42:41 +02:00
pentarctagon
a4a1cec637 Remove -rdynamic from the linker. 2017-11-22 07:16:16 +02:00
Charles Dang
2cc3f99651 Hotkeys: cleanup and simplification of hotkey_command list
* Used an std::array instead of C array for hotkey_list_.
* Used an std::vector instead of boost::ptr_array for known_hotkeys.
* Made hotkey_command non-copyable and movable in order to avoid hundreds of copies.
* Added a hotkey_command ctor that takes a hotkey_command_temp reference.
* Hopefully prevent some reallocations by reserving an appropriate amount of memory for known_hotkeys
  before filling it up.
* Search from the end of know_hotkeys when calling remove_wml_hotkey(). This avoids traversing the almost
  200 vector members that likely will not match.
* Deployed auto/range-for.
* For some reason I needed to add a <cassert> include to gui2/widgets/grid.hpp.
2017-11-22 12:06:20 +11:00
Alexander van Gessel
1a98327779 Convert indexes to unsigned
This should assure coverity that no negative indexes will be used.
2017-11-22 05:12:42 +11:00
Alexander van Gessel
80cae581ab Make check earlier 2017-11-22 05:12:42 +11:00
Alexander van Gessel
554555bb03 Assert that indexes are on board 2017-11-22 05:12:42 +11:00
Alexander van Gessel
d4df2cc6c4 Remove negative index use-case 2017-11-22 05:12:42 +11:00
Charles Dang
b1c9cb41c3 Cleaned up unnecessary video.hpp includes 2017-11-21 18:24:45 +11:00
Charles Dang
b51677d985 Made use of SDL_CreateRGBSurfaceWithFormat* on SDL 2.0.6+
These functions were introduced in 2.0.5, but a packaging error meant they weren't properly
included in the VS libs for that release. So I set the minimum to 2.0.6. Not sure if we want
to leave the fallbacks for the other versions or bump the minimum to 2.0.6.
2017-11-21 17:16:49 +11:00
Charles Dang
976f37c08a Fixed graphical artifacts appearing in Fake Map Border/Off Map terrains with SDL 2.0.6+ (fixes #2061)
[ci skip]

Something was screwy about these image's alpha. Normally when I remove an alpha channel in GIMP,
it shows up white. With these images, it showed up black. Maybe they had an embedded palette or
something, I don't know, but the problem is fixed.

Something must have changed in SDL 2.0.6 that caused this issue to appear. Not sure if anything
needs to be patched in our source code, though (but not likely)
2017-11-21 16:22:12 +11:00
Jyrki Vesterinen
bc7ce292cd Attempt to fix build with GCC 4.8 2017-11-21 06:44:33 +02:00
Jyrki Vesterinen
89ad1b2676 Rewrite the link detection code
The previous code sometimes produced invalid Pango markup.

Instead of attempting to parse Pango markup, simply scan for links in the
raw text and replace them in Pango markup. This way there is no way to
accidentally break the markup.
2017-11-21 06:44:33 +02:00
Charles Dang
5703c49ae4 Game Display: removed unused create_dummy_display function
This was probably used before we had the fake_display_manager class.
2017-11-21 14:20:15 +11:00
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