70828 Commits

Author SHA1 Message Date
Charles Dang
a003633c5a Removed trailing tabs and whitespaces from C++ source
[ci skip]

I ran the same command from 9b7b1751fdda.

Excludes:
* lua/
* spirit_po/
2018-02-04 01:01:39 +11:00
josteph
6b703fd93c pofix: Update for HttT changes in previous commit. 2018-02-04 01:00:33 +11:00
josteph
b802d85a92 HttT S18: Rearrange the merman's message. 2018-02-04 01:00:33 +11:00
josteph
e1d192becf HttT: Fix English grammar and punctuation 2018-02-04 01:00:33 +11:00
Steve Cotton
bf754a8a8e tips: add tips that villages can be lures, and losses are necessary
From oaq's post https://forums.wesnoth.org/viewtopic.php?f=3&t=47702

Kai Laudiss is Kai Krellis' dad, and the quote would be 3 years
before Dead Water.
2018-02-04 00:24:41 +11:00
Jyrki Vesterinen
7ca5a0df64 Attempt to get the backtrace from the C++ unit test executable
Turns out that it's still crashing on startup in Travis,
but no longer giving the old error message

Xlib: extension "RANDR" missing on display ":99.0".

I also removed the old line that ran test_executor.sh only if WML tests had
failed. That made no sense.
2018-02-03 13:51:16 +02:00
Jyrki Vesterinen
f40a4966bc Travis CI: enable C++ unit tests
The tests should be able to run in Docker, and now when they are no longer
failing, we can enable them.
2018-02-03 12:17:53 +02:00
Jyrki Vesterinen
a67e13b4c5 Fix C++ unit tests
Regression from commit f2b31ba082e1ff47443120469e06b89318f37284.

The calls to get_fake_display() must not be removed. They are essential to
change the size of the fake screen. Fortunately we have a unit test to
check that constructing GUI2 windows doesn't succeed if the screen is way
too small.
2018-02-03 12:16:05 +02:00
Steve Cotton
07054112b0 Make [cancel_action] set_action_canceled (fixes #2430)
It was calling the getter instead of the setter.
2018-02-03 14:25:08 +11:00
josteph
e48964fa1b pofix: Add wesnoth-help fixes from previous commit. 2018-02-03 14:04:42 +11:00
josteph
a83a7cabda core: Fix grammar in Lich description. 2018-02-03 14:04:42 +11:00
josteph
4ac110b8b5 core: Fix grammar and punctuation
Split from #2390 at @GregoryLundberg's request.
2018-02-03 14:04:42 +11:00
sigurdfdragon
23dddd88b9 SotA: Call the passengers what they are
Names are only seen in S04 in the sidebar.
2018-02-02 18:23:52 -05:00
Severin Glöckner
9cd5d03609 remove very old gentoo packaging file
[ci skip]
2018-02-03 00:07:07 +01:00
Severin Glöckner
3777a5b307 add an appdata file for appstream software centers
(closes #1831 & #2160)
2018-02-02 23:46:59 +01:00
Sofartin
4d7df5fffe Update Copyright year 2018-02-02 13:50:48 +02:00
pentarctagon
44f567c6a3 Enable LTO by default.
LTO for Windows is disabled for now, as TDM-GCC does not work well with it.
LTO for Travis is also disabled, due to the extra time linking with LTO takes.
2018-02-02 17:56:07 +11:00
Charles Dang
69f5d9c260 Made more use of std::isalnum and std::isalpha (std::locale versions)
I didn't also deploy std::isdigit since @jyrkive said he feels digit comparison is fast
and simple enough.
2018-02-02 17:42:06 +11:00
ancestral
2598497c74 Changed text in tutorial to make it easier to understand how the tutorial works and better understand game topics
[ci skip]

* Expanded the text to explain how to read '5×4' and what it means
* Changed the wording slightly to emphasize the order of damage times attacks
* Added a message explaining the format of the tutorial
* Separated some long messages into multiple messages instead
* Removed some unnecessary wording to keep things simpler
* Changed some spelled numbers to regular numerals when referring to game currencies (such as gold and income)
* Minor changes to grammar
2018-02-02 16:14:52 +11:00
Charles Dang
c8abb8d5d9 Add formula= option to [set_variable] (change by @celticminstrel)
[ci skip]
2018-02-02 15:40:44 +11:00
Charles Dang
c916a85d1e Game Events: some safeguards
* Don't register an empty event
* Raise a WML error if a event is missing a name= key (the wiki declares it mandatory)
2018-02-02 08:34:15 +11:00
Charles Dang
b888713918 Create Engine: added is_campaign helper to simplify logic 2018-02-02 07:58:50 +11:00
Charles Dang
30172c8ebe Fixed SP option selections not being saved
Had forgotten to call prefrences::set_options. Instead of adding an extra call in the
SP Options Manager, I just moved the call to configure_engine::set_options, which is
called by both SP and MP codepaths.
2018-02-02 07:14:34 +11:00
Charles Dang
9de2783200 Fixed SP option variables never being set (fixes #2401)
Was just missing a check for the SP_CAMPAIGN type.
2018-02-02 07:09:58 +11:00
Charles Dang
eee4b4e147 NR S2: change victory condition to prevent unwinnable scenario (fixes #2352)
[ci skip]

Previously, the scenario only ended if you triggered the sighted Hamel event with Tallin.
If you triggered it with any other unit, you wouldn't progress since you can't fire a
sighted event on a unit already visible.

I've changed the condition to move within five hexes of Hamel with Tallin. Still possible
this might result in an unwinnable scenario, but that's much less likely than with what
was there before.
2018-02-02 06:49:31 +11:00
sigurdfdragon
5bc09da48d Units: A more positive description for the Naffat 2018-01-31 14:05:10 -05:00
sigurdfdragon
57f06ab443 Units: Remove unnecessary religious references from Dunefolk units 2018-01-31 14:03:55 -05:00
sigurdfdragon
b0e0a75138 Units: Generalize Falcon description by removing faction reference 2018-01-31 14:01:21 -05:00
Jyrki Vesterinen
4685aed6a5 Fix #2339: iterating wesnoth.unit_types is extremely slow
The problem was that the code copied the entire list of unit types every
time Lua moved to the next unit type. Fixed by taking a reference to it
instead.

Thanks to @ilyapopov for identifying the problem.
2018-01-31 19:50:10 +02:00
sigurdfdragon
7a6c39380e SotA S04: Update files to match faction renaming 2018-01-29 19:33:07 -05:00
sigurdfdragon
e288be9302 MP: Simplify Dunefolk faction and era description
Other factions lack magic users, so mentioning here it is superfluous
information. Also associated with the previous identity of the faction.
2018-01-30 10:16:27 +11:00
newfrenchy83
e20c55f57d Update Code::Blocks project files to C++14 (#2416) 2018-01-29 12:13:24 +02:00
Charles Dang
d6bbdc3134 Game Display: added another missing override specifier 2018-01-29 17:36:22 +11:00
Charles Dang
654a688616 Game Display: added more virtual/override specifiers and removed duplicate function
set_playing_team was implemented the same as in the base class.
2018-01-29 15:54:02 +11:00
Charles Dang
16ce2af32e Made display class no longer inherit from filter_context
The only function that display meaningfully implemented was get_disp_context. It did implement
get_tod_man, but only meaningfully in its two derived classes (it returned the result of
resources::tod_manager in display). Additionally, the long-ass comment in the header stated the
display class should *not* inherit from filter_context. Do note that get_disp_context was retained
as a display member function.

Upon further investigation, I found that there were only two places where the display class was
passed to unit_filter. All others passed resources::filter_con. The editor_display class was also
assigned to resources::filter_con in editor::context_manager. So, I removed the second filter_context
argument from unit_filter and initialized it from resources::filter_con in all cases.

unit_filter only used the filter_context to get its display_context and the unit_map within anyway.
When using display::get_disp_context in-game, that would return a game_board object. Using
resources::filter_con in the same context would return the game_state object that owned the
aforementioned game_board, and calling get_disp_context on that game_state would return the board
as well. So we end up in the same place.

To be complete, I also made editor::context_manager inherit from filter_context. It makes much more
sense, since it can nicely implement 2/4 of the fc functions. It also ensures resources::filter_con
is valid in the editor, in case it's needed. I'm not 100% sure it is, but since it was assigned
before (to editor_display), it's very likely.

Another side effect of the above is that get_tod_man is now implemented in a more apropos class
in the editor. Essentially, editor_display (where it was implemented before by reaching into the
context_manager) holds an editor_controller which holds a context_manager (where it's now implemented).
It wasn't even really needed in editor_display and was only called once.

Similarly, get_tod_man has been removed from game_display. Again, it was only present to "properly"
implement the function in display, which only existed because display inherited from filter_context.
And get_tod_man wasn't even needed in display, game_display, or editor_display (save for the one
aforementioned call)!!! AND in game_display, it simply dereferenced a pointer to the *actual* ToD
manager in the game_state class, WHICH IN AND OF ITSELF INHERITS FROM FILTER_CONTEXT!!!

I have removed the tod_manager pointer in game_display and replaced its use with resources::tod_manager,
which in the context of the game (where game_display) would be use, point to the same thing the class
pointer did. I suppose I could have left it, since I'm trying to remove/improve the use of the
resources pointers, but I felt it better to decouple the two classes (game_display and game_state)
slightly, especially since its main purpose for existing (overriding display::get_tod_man) no longer
exists.

Finally, some of the instances where a unit_filter object is created had to be changed to use brace
initialization or else the build failed. @celticminstrel tells me this might be because of some "most
vexing parse" issue.

Some formatting and virtual/override specifiers were also applied/added.

*huffs*
2018-01-29 15:54:01 +11:00
Galen Brooks
16c3fdae75 Fix bug introduced in code cleanup commit 5e0c3056d
The previous cleanup didn't handle the case when w or h is zero,
but resize_mode is not stretch.
2018-01-28 22:45:52 -06:00
Alexander van Gessel
d82fc9c4ad Remove unused structs 2018-01-28 21:33:59 +01:00
pentarctagon
ce628e028b Remove checking for a different SDL2 minimum version.
I removed this from scons a while ago, though it looks like I forgot or didn't notice that cmake does the same.
2018-01-28 12:53:26 -06:00
Gregory A Lundberg
73be496708
Revert "cppcheck is confused by an initializer list"
This reverts commit 2e1dbfc235334117c61c7a4bbb4ff1d1f76e2a2d.
2018-01-28 09:27:03 -06:00
Charles Dang
1d93797d34 Added override specifiers for display_context overrides
Also did some formatting cleanup in game_board. Didn't really care to touch the others.

Removed virtual specifier from non-const game_board::teams. It didn't override anything
in the base class (display_context, which has the const version) and nothing inherits
from game_board to override it (the non-const version) later.
2018-01-29 02:10:59 +11:00
Gregory A Lundberg
c0689b7924
prefer prefix ++
cppcheck (via Codacy) points out it's better to use prefix ++ on iterators in a for statement.
2018-01-28 09:07:28 -06:00
Gregory A Lundberg
8f22144e8e
clarify ^ vs ?:
cppcheck (via Codacy) points out the operator precidence is unclearn. Added parentheses to fix that.
2018-01-28 09:07:27 -06:00
Gregory A Lundberg
45eae14999
fix poor rethrows
cppcheck (via Codacy) points out that it is better to rethrow the current event than to throw a new copy of it.
2018-01-28 09:07:27 -06:00
Gregory A Lundberg
b74df558e0
clearly check itor at end
cppcheck (via Codacy) notes that it's not clear that the iterator (j) cannot exceed end() because most don't expect pointer math.

Rewrote to make it more clear what is going on.
2018-01-28 09:07:27 -06:00
Gregory A Lundberg
59554ca0cd
cppcheck has a problem
cppcheck (via Codacy) had a problem with the form `T & T` so used `auto & T`

This is probably a bug in cppcheck but reported to Codacy in case it's their fault since the message form was for && and this was just &.
2018-01-28 09:07:27 -06:00
Gregory A Lundberg
45d101e8ca
variable not assigned in operator=
cppcheck (via Codacy) points out that one member vairable was not assigned.
2018-01-28 09:07:26 -06:00
Gregory A Lundberg
84194f76ef
perform initialization in the initializer
cppcheck (via Codacy) pointed out it's sorta silly to default initialize then immediately assign a non-default value.
2018-01-28 09:07:26 -06:00
Gregory A Lundberg
2e1dbfc235
cppcheck is confused by an initializer list 2018-01-28 09:07:26 -06:00
Gregory A Lundberg
e12a2a19ca
fix reassign before first use
cppcheck (via Codacy) pointed out that a variable was initialized, then reassigned, before the initialed value was used.

Moved the variable declaration to the point the actually-used value was assigned.
2018-01-28 09:07:26 -06:00
Gregory A Lundberg
5e0c3056dc
clarify resize and stretch logic
cppcheck (via Codacy) rightly noted that the construct ((!!w ^ !!h)) was confusing.

Rearrange the code a bit, note some things must be true without testing them, and we can eliminate two variables, make the code faster than the "cute optimization" and make it FAR easier to read.
2018-01-28 09:07:25 -06:00