78561 Commits

Author SHA1 Message Date
Celtic Minstrel
f382eefc33 run_wml_tests: fix Mac binary detection magic 2021-03-13 20:49:26 -05:00
Celtic Minstrel
208a347dba run_wml_tests: --batch-disable is a special case of --batch-max so implement it as such 2021-03-13 20:49:26 -05:00
Celtic Minstrel
0e7f19462e run_wml_tests: when a batch of tests fails, retry the tests that were skipped 2021-03-13 20:49:26 -05:00
Celtic Minstrel
9969e1c34a run_wml_tests: add summary of test results at the end of the run 2021-03-13 20:49:26 -05:00
Celtic Minstrel
b0d320d2c1 run_wml_tests: Fix attempting to run tests expected to timeout when timeout is disabled 2021-03-13 20:49:26 -05:00
Celtic Minstrel
c1c5b5dd7d run_wml_tests: Add command-line option to limit test batch size 2021-03-13 20:49:26 -05:00
Celtic Minstrel
10959dae17 run_wml_tests: Refactor the output capturing mechanism to use subprocess.PIPE
- Avoids creating tons of external files
- Suppresses the startup banner to reduce extraneous messages
- Makes the system work on Windows
- Fixes an issue of batched tests being misnamed if one of them is an error
2021-03-13 20:49:26 -05:00
Celtic Minstrel
4fc53d67b6 Add command-line options to disable the Windows-specific special log/console handling 2021-03-13 20:49:26 -05:00
Celtic Minstrel
62de714c48 run_wml_tests: suppress a python linter warning 2021-03-13 20:49:26 -05:00
Celtic Minstrel
5337973cd5 run_wml_tests: Output symbolic forms of unit test results in addition to the numeric return code 2021-03-13 20:49:26 -05:00
Celtic Minstrel
7b7b904c99 Add --nobanner command-line argument 2021-03-13 20:49:26 -05:00
Celtic Minstrel
fb5a159f6e run_wml_tests: Fix the batch-disable argument 2021-03-13 20:49:26 -05:00
Iris Morelle
995bfef3df font/sdl_ttf_compat: Avoid rendering twice in pango_draw_text()
We need to obtain the text extents prior to rendering regardless. In the
best case, we do so in advance before rendering, which internally
doesn't recalculate the text layout if the rendering parameters haven't
been touched in the meantime. In the worst case, we calculate extents
twice but only render once.
2021-03-13 19:54:31 -03:00
Iris Morelle
0e013c59b6 font/sdl_ttf_compat: Don't set fg colour if we aren't rendering 2021-03-13 19:51:31 -03:00
Iris Morelle
49094526c2 font/sdl_ttf_compat: No need to render in pango_line_size() 2021-03-13 19:29:46 -03:00
Iris Morelle
1f97941a33 gui2/lua_interpreter: Use monospaced textbox for code input 2021-03-13 19:24:35 -03:00
Iris Morelle
3ddbeb0b1e gui2/text_box: Add a monospace font variation
This requires communicating the font family to the internal renderer, so
it's not just a WML change.
2021-03-13 19:23:42 -03:00
Iris Morelle
5e535a7bac Remove obsolete comment 2021-03-13 19:02:30 -03:00
Iris Morelle
f5d30e5c70 gui1: Bring scrollbar design in line with GUI2 2021-03-13 18:35:50 -03:00
Iris Morelle
57b89d225a gui1: Fix incorrect menu item size constraints
Regression from d1f026d22b9d0a989e72d1b0c31ac25fe6def8c8.
2021-03-13 17:10:31 -03:00
mattsc
0d5c2b1658 Fix attack prediction assert
The corrections applied in calculate_probability_of_debuff() are already taken into account in the main attack outcome calculation for being slowed.  They do not need to be applied again, that only needs to be done for being poisoned.  Doing this for being slowed also can cause an assert, such as the one reported in issue #5533 (and probably also the one in issue #5002).

Fixes #5533
2021-03-13 11:34:20 -08:00
Iris Morelle
45ca791387 ui: Fix ThemeWML [label] text_rgb= being horribly broken
First cause of breakage seems to be that the introduction of color_t
changed the size of the colour components from something longer than 8
bits to 8 bits, resulting in stringstream outputting invalid UTF-8. The
second cause is the dropping of GUI1 markup along with SDL_ttf.
2021-03-13 15:01:08 -03:00
Martin Hrubý (hrubymar10)
a0d1896942
Fix Xcode project 2021-03-13 18:40:27 +01:00
Iris Morelle
2435a0908e Update changelog
[ci skip]
2021-03-13 14:03:56 -03:00
Iris Morelle
56e6d0344f Update VS project files 2021-03-13 13:51:47 -03:00
Iris Morelle
055eb13e67 Move font::is_cjk_char() to help browser implementation 2021-03-13 13:51:47 -03:00
Iris Morelle
c5e1f77e80 gui1: Drop last instances of GUI1 markup support in menu widgets 2021-03-13 13:51:47 -03:00
Iris Morelle
5ce799ddbd gui1: Remove unit level and xp sorters
This functionality is entirely unused in 1.14 and later because GUI1
menus aren't used to list units anymore.

(Strictly speaking, all sorters are unused right now.)
2021-03-13 13:51:47 -03:00
Iris Morelle
066136af81 font: Remove a few more orphaned markup-related code paths
These were used by the GUI1 markup-supporting render APIs, and the
homebrew line wrapping implementation.
2021-03-13 13:51:47 -03:00
Iris Morelle
196db7b413 Remove SDL_ttf and FriBidi mentions from INSTALL.md and the VS Readme
[ci skip]
2021-03-13 13:51:47 -03:00
Iris Morelle
1c40a0271e ci: Remove dependencies on SDL_ttf and FriBidi 2021-03-13 13:51:47 -03:00
Iris Morelle
2dfdc0061d Remove SDL_ttf wrapper API
This removes the build-time dependencies on SDL_ttf and FriBidi,
alongside the SDL_ttf wrappers, the SDL_ttf text surface class, the
SDL_ttf render cache, and the SDL_ttf (de)initialization code.
2021-03-13 13:51:47 -03:00
Iris Morelle
8a9e861eb3 bi: Remove tracking of SDL_ttf and FriBidi 2021-03-13 13:51:47 -03:00
Iris Morelle
c17e6c00df font: Drop SDL_ttf dependency in font::parse_markup()
GUI1 markup isn't being used anymore anyway. This function is only
allowed to remain for a little bit longer as an implementation detail.
2021-03-13 13:51:47 -03:00
Iris Morelle
c42506ad2b font: Use pango_render_text() instead of get_rendered_text() 2021-03-13 13:51:47 -03:00
Iris Morelle
3fb36ee22d font: Make font_style optional in pango_render_text/line_size() 2021-03-13 13:51:47 -03:00
Iris Morelle
66659e03f8 font: Reimplement font::get_max_height() using Pango
A few caveats:

 * This implementation allows configuring the font family class and
   style to select the correct font for any given context. The default
   values are equivalent to what was being done in the SDL_ttf-based
   version, but not future-proof. Users like the GUI2 textbox should
   make use of the new optional parameters to select a more relevant
   font going forward (not part of this commit).

 * Pango has a line height metric, equivalent to SDL_ttf's
   TTF_FontLineSkip(). However, this is not what we want here -- the
   ascender + descender formula is intended to give us a neat box where
   the tallest glyph can fit, not the minimum distance between
   baselines. This is important for the GUI2 textbox in particular.

 * The internal implementation uses the default text renderer and sets
   relevant parameters. This should not introduce new issues, but if it
   does then that means someone is not resetting the renderer properly
   before using it.

This notably rids GUI2 of its one known dependency on SDL_ttf.
2021-03-13 13:51:47 -03:00
Iris Morelle
0024cfa7e4 gui1: Use font::pango_line_width() in more places
The SDL_ttf version is still in use in the SDL_ttf API itself.
2021-03-13 13:51:47 -03:00
Iris Morelle
a44c185333 font: Set a default function parameter 2021-03-13 13:51:47 -03:00
Iris Morelle
ffffd073bf font: Drop some code paths that have already been transitioned
This impacts font::draw_text(), font::text_area(),
font::word_wrap_text().
2021-03-13 13:51:47 -03:00
Iris Morelle
ec94da31b5 font: Drop more GUI1 markup support 2021-03-13 13:51:47 -03:00
Iris Morelle
d1f026d22b gui1: Move more code to using the compatibility API 2021-03-13 13:51:47 -03:00
Iris Morelle
1898c0e3d2 font/sdl_ttf_compat: Implement text_area() substitute
Again, no GUI1 markup here.
2021-03-13 13:51:47 -03:00
Iris Morelle
00c031d782 gui1: Use font::pango_draw_text() 2021-03-13 13:51:47 -03:00
Iris Morelle
fbf7d055f2 font/sdl_ttf_compat: Implement draw_text() substitute
This doesn't support GUI1 markup, intentionally.
2021-03-13 13:51:47 -03:00
Iris Morelle
a7015a9c95 help: Use Pango word wrap implementation instead of SDL_ttf 2021-03-13 13:51:47 -03:00
Iris Morelle
b58dbb59db font/sdl_ttf_compat: Add a Pango-based word wrap implementation
This lets Pango do all of the work for us and pulls the text back from
the renderer. It shouldn't be much more expensive than it needs to be --
the only real expensive step is copying the characters back into a list
of strings, and it's not by much.

Note: I haven't quite figured out what the partial_line parameter does
or what to do about it. It's probably not trivial to implement since it
seems to involve the decision of whether to break a line within word
boundaries or not.
2021-03-13 13:51:47 -03:00
Iris Morelle
07af824c2b font/sdl_ttf_compat: Use a single private renderer
It's not the same renderer globally used for everything else to avoid
any potential issues with state not being cleared or whatever.
2021-03-13 13:51:47 -03:00
Iris Morelle
4bb412c56d help: Use Pango for most functionality
We're still using SDL_ttf-based word wrapping, which we need to replace
with something that uses Pango instead.
2021-03-13 13:51:47 -03:00
Iris Morelle
8cd739cef1 font/sdl_ttf_compat: Initial Pango-based font rendering API for GUI1
This adds a minimal wrapper around pango_text intended for use in GUI1,
in particular for the help browser. Functionality is very incomplete
right now but for the time being we can render text, determine line
dimensions, and ellipsize text, which is almost the bare minimum needed
for porting the Help system (it's still missing a word wrapping
implementation).
2021-03-13 13:51:47 -03:00