80547 Commits

Author SHA1 Message Date
Tommy
74649f4966 CI: Force colour diagnostics for compilation errors. 2022-06-10 16:45:38 +12:00
Tommy
57f32eaa9f Add options to scons and cmake to force coloured compiled output.
In CMake this is the FORCE_COLOR_OUTPUT option. In SCons this is the
force_color option. They both pass -fdiagnostics-color=always to gcc,
or -fcolor-diagnostics to clang.

This is useful when building with Ninja, or running piped CI tools.
2022-06-10 16:45:38 +12:00
Tommy
5a07ed6cb7 Actually display game::error when caught, before exiting.
It says they have already been displayed. Well, this is not always so.
2022-06-10 16:45:38 +12:00
mattsc
fe0b375fca ExpAI castle switch CA: fix error when stored leader has been killed
The castle switch CA stores the leader move because the evaluation is expensive.  If the leader was killed in between storing and reevaluation of the CA, this would previously cause an on-screen error message and the CA to be blacklisted for the turn.

This fixes #6440.
2022-06-09 07:51:33 -07:00
mattsc
be62c98e1c Attack predictions: fix for chance of being unscathed
The probabilities being combined here are additive, not multiplicative.  The two terms in the equations are the probabilities that either unit in a fight is already dead before the strike currently being evaluated.  As a result, this only affected fights in which both units can die before the last round of combat.  It also only affected the chance of being unscathed, the HP distributions shown were correct.

This fixes #6590.
2022-06-09 07:34:14 -07:00
mattsc
84531b834e Bottleneck Micro AI: fix bug involving units without moves
An integral part of this MAI is that it moves weaker units out of the way for stronger ones.  Units without moves are taken into account by giving them a very high rating.  This was previously only done on what's considered the AI's territory (the AI side of the bottleneck) which works fine most of the time since the AI does not try to move onto enemy territory.  However, it breaks down on more open maps, where there are way for units to move around the bottleneck, as AI territory is not always well defined on them.  However, there is no need to restrict this to AI territory only.

This fixes #6599.
2022-06-09 06:29:14 -07:00
Ryan Schmidt
853f2147ef macOS: Link with AppKit and Foundation frameworks 2022-06-08 17:27:12 -05:00
mattsc
04e2b1ef84 Update changelog 2022-06-06 19:23:10 -07:00
mattsc
27c9586ce4 Path finding: fix viewing side in function vision_path
When finding the vision path for a unit, that unit's team's vision needs to be used.  This had the potential of causing OOS errors in rare cases on maps with tunnels and at least three sides that do not share vision.
2022-06-06 19:16:46 -07:00
Nils Kneuper
cfa4eb5b3d updated Polish translation 2022-06-06 09:58:50 +02:00
doofus-01
31a42068d8
1.17 small terrain updates (#6751)
* low-priority cave-path transitions

* SotA - remove old terrain codes with Z and y

* replace gold cobbles (Rrd)
2022-06-05 17:09:35 -07:00
doofus-01
0937ba5ffd
1.17 some horseman line standing animations (#6747)
* horseman breeze animation

* knight breeze animation

* lancer breeze anim
2022-06-05 15:09:35 -07:00
newfrenchy83
9f4829fc88
Fix liminal not being affected by overillumination/darkening (#6749) 2022-06-05 17:23:42 -04:00
doofus-01
22396f6142
1.17 loyalist sprite cleanup (#6746)
* remove semitransparent swooshes

* loyalist sprite cleanup
2022-06-04 14:52:24 -07:00
Pentarctagon
337894ac7b Store add-on download count in the database.
The idea being that this could then also be included as a sheet in the multiplayer activity report, which would then be an easy way to view add-on downloads over time. This would of course not be especially useful until 1.18, since for 1.17 the database count would be starting at 0 even though existing add-ons would have a non-zero download count.
2022-06-04 11:21:00 -05:00
mattsc
768b930fc4 ai_helper: fix visibility bug in get_attackable_enemies()
The passed filter needs to be enclosed in an [and] tag, otherwise the check for visibility might not work correctly, for example if the filter contains a top level [or] tag.
2022-06-04 09:13:53 -07:00
Nils Kneuper
8711af07ca updated Polish translation 2022-06-04 10:44:27 +02:00
Gunter Labes
ae09d75267
Don't use --tty for the translation job 2022-06-04 04:17:28 +02:00
Gunter Labes
810e1e105a
Avoid explicit temp Dockerfile 2022-06-04 02:25:02 +02:00
Gunter Labes
763d9b2838
Simplify time calculations 2022-06-04 01:09:22 +02:00
Gunter Labes
d41518fafa
Check cd calls and remove -r from rm calls if not needed 2022-06-04 01:06:07 +02:00
Gunter Labes
404cde1117
Print errors in red again 2022-06-03 17:11:04 +02:00
Gunter Labes
8d1a4edd5b
Allocate tty so programs can use terminal features 2022-06-03 14:25:17 +02:00
newfrenchy83
49682d29ad update codeblock projectfiles 2022-06-02 08:52:30 -05:00
Tommy
ce54e0ca92 sdl/texture: guard everything like a paranoid madman. 2022-06-02 15:39:49 +12:00
Tommy
9e0cac3281 sdl/texture: more guards on texture queries, just in case. 2022-06-02 15:19:20 +12:00
Tommy
afdb5e860f sdl/texture: don't query texture paramaters for null texture. 2022-06-02 15:09:09 +12:00
Charles Dang
f5ef6933ab GUI2/Generator: simplify get_ordered_index 2022-06-01 22:15:51 -04:00
Charles Dang
97c0ea8ce3
Merge pull request #6734 from wesnoth/new_rendering
Sync rendering system changes so far
2022-06-01 21:36:00 -04:00
Celtic Minstrel
e91a710397 Update Xcode project 2022-06-01 21:19:30 -04:00
Charles Dang
7cc60dc0cb GUI2: added/renamed widget data types aliases 2022-06-01 20:48:57 -04:00
Descacharrado
481378aaf3 Use 'leader' and 'grunt' instead of 'chief' and 'lesser orc' 2022-06-01 10:02:58 +10:00
Descacharrado
0742b902a2 Avoid using 'that' twice 2022-06-01 10:02:58 +10:00
Descacharrado
f468020b11 NR S1 Vary the die dialog depending on race 2022-06-01 10:02:58 +10:00
Tommy
f183978071 Some small rendering fixes.
* halo background draw fixed
* tiled images clip correctly
* new interface/setter for reducing clipping area.
2022-06-01 00:35:53 +12:00
Steve Cotton
8edd8f2292 Editor palettes: allow keyboard scrolling to see the last row
Fixes #6724, where scrolling with the mousewheel could reach the last row, but
scrolling with keys or buttons couldn't. Although can_scroll_up() and
can_scroll_down() already existed, can_scroll_down() didn't allow access to the
last line when that line had less than the full number of items. The mousewheel
still worked, because it ignored that logic.

Remove a feature that was seen when the last row is visible - things jumped
between columns to fill the spaces. If you have 10 items, with 4 columns and 2
visible rows then it will appear like this:
    a b c d
    e f g h
when scrolling down it used to move items sideways to fill the last line, which
seems bad UI because it made items harder to find:
    c d e f
    g h i j
the new code is simpler, and will instead show the following when scrolling down:
    e f g h
    i j

Move the layout code into adjust_size(), so that it runs one time when the number
of buttons changes. That could be separated from this commit, but the code
would still be touched in this commit (`counter_from_zero` would still be
replaced by `i`), so doing it and testing the changes together made sense.

Note for the master branch only: scrolling the palettes up and down is
noticeably laggy, which is a regression from last week. That's not caused by
this commit, we're just at a point in the rendering refactor where
`surface_restorer::update()` and thus `gui::widget::hide()` are slow. The fix
for that is already in progress and going to be in 1.17.5.
2022-05-31 14:07:17 +02:00
Tommy
0baa83666e Fix CI problems. 2022-05-31 21:17:33 +12:00
Tommy
d39a6fe619 Reimplement map screenshots.
They will remain broken until display.cpp switches over to using
textures in stead of surfaces to render.
2022-05-31 21:17:33 +12:00
Tommy
743a1b5655 Implement a mirror mode for tiling textures.
It mirrors such that tiles always share a common edge.

This isn't currently used for anything, simply included for completeness.
2022-05-31 21:17:33 +12:00
Tommy
638c02b59e Rename image_shape.vertical_mirror_ to mirror_.
It is in fact (and always was) mirroring horizontally.
2022-05-31 21:17:33 +12:00
Tommy
25a908f9ac Fix the minimap, and tidy code. 2022-05-31 21:17:33 +12:00
Tommy
e94291b2dc Fix canvas blits. 2022-05-31 21:17:33 +12:00
Tommy
881abd1123 Move circle drawing code to draw.cpp. 2022-05-31 21:17:33 +12:00
Tommy
96bc7d6046 Consolidate drawing functions in new "draw" namespace.
Contains primitive drawing functions, such as fill, points, line, etc,
and also texture drawing functions blit, flipped, tiled.

This removes specialty drawing code from several places, most notably
CVideo and gui/core/canvas.

Functions to draw to the screen should now go in draw.cpp.
2022-05-31 21:17:33 +12:00
Tommy
3bc0defdce image: deprecate get_image for new explicit get_surface and get_texture.
Places where usage is clear have been converted to the new calls.
Places that need extra work to convert are still using get_image(),
as are places that will be clobbered as part of general rendering
system upgrades anyway.
2022-05-31 21:17:33 +12:00
Tommy
f808039fb3 sdl::texture: cache texture width and height for easy access. 2022-05-31 21:17:33 +12:00
Tommy
062a4de231 Remove reverse image cache and image::reverse_image.
Flipping can be done as part of basic texture blitting.
2022-05-31 21:17:33 +12:00
Tommy
64304ddb63 CVideo: add method for drawing a texture flipped/mirrored. 2022-05-31 21:17:33 +12:00
Tommy
e2d059daae sdl/texture: remove null() in favour of an explicit bool conversion.
It was not used anywhere anyway.
2022-05-31 21:17:33 +12:00
Tommy
ac45e4be16 Make image::load_from_disk() private. 2022-05-31 21:17:33 +12:00