80256 Commits

Author SHA1 Message Date
Tommy
9ece8ccc71 Remove warning about leaking drawing surface.
It does get correctly freed by the wrapper when reassigned.
2022-04-20 20:00:16 +12:00
Tommy
b530a47502 Implement automatic pixel scale and enable it by default.
It will try to match the default resolution (1280x720). It will also try
to ensure that the scaled resolution is less than 1920x1080. This will
result scaling as soon as the 1920x1080 resoluton is exceeded, requiring
a minimum supported resolution of 960x540 or less, however in practice this
is not a huge problem even with the existing 800x600 theme.

In any case the pixel scale can of course be overridden in preferences.
2022-04-18 17:25:06 +12:00
Tommy
cf0da8b1ac Update pixel scale in real-time from prefs dialog.
This will never reduce the drawing resolution beyond the minimum window
size specified in preferences/general.cpp.

The minimum window height has been reduced from 600px to 540px!
This is to that a 1920x1080 display can use a pixel scale of 2.
It could be changed back, but a better solutuion would be updating the
default theme to accomodate this form factor.
2022-04-18 17:25:06 +12:00
Tommy
ab10d4d219 Fix remaining input issues with scaled display.
There is a new sdl::get_mouse_state() function that should be used in place
of SDL_GetMouseState() in every case. It returns coordinates relative to
the drawing surface.

With this, the pixel scale option seems to be working without issue.
2022-04-18 17:25:06 +12:00
Tommy
d130622b96 Initial indirect rendering prototype.
Rendering is now done to a separate surface. All routines that previously
wrote directly to the framebuffer now write to this surface. When the screen
is flipped, this surface is copied directly to a streaming texture, which is
then scaled to the window's rendering surface for display.

This has enabled a drawing resolution that differs from display resolution.
It is active and for the most part works. Input events are converted to the
correct scale by SDL, so most input handling routines can be used unchanged,
but one or two are causing problems so there are some bugs. To test this,
change the "pixel_scale" preference. Don't expect a playable game with
any pixel scale other than 1 yet.
2022-04-18 17:25:06 +12:00
Tommy
3a781c87ad Add pixel scale preference option. 2022-04-18 17:25:06 +12:00
Steve Cotton
c5dec73784 Unit tests: make separate files for each starting position
Turn the 4 side setup of the firststrike_and_laststrike test into a macro
called `COMMON_KEEP_A_B_C_D`for reuse in other tests.

The comment for `GENERIC_UNIT_TEST` gets a couple of extra paragraphs.

All the files get wmlindent run on them, which reindents `FAIL_IF_NOT`.

The main reason for having these is separate files is Git's fuzzy-patch
matching when merging and rebasing. Having large blocks of identical text
in `wml_unit_test_macros.cfg` can mean the wrong section gets patched.
2022-04-18 04:48:53 +02:00
Pentarctagon
073d4111b2
1.17.3+dev 2022-04-16 19:35:46 -05:00
Pentarctagon
4a6ba74ea8
1.17.3 1.17.3 2022-04-16 19:34:19 -05:00
loonycyborg
d10a784486
pot-update and regenerate doc files 2022-04-17 03:29:07 +03:00
doofus-01
62f583529e
Update changelog.md 2022-04-16 10:04:16 -07:00
doofus-01
19fcc1424f
Deprecation of old-style _PLFB and script-generated macros
1.17 terrain-graphics macros clean-up (#6606)
2022-04-16 10:01:09 -07:00
Steve Cotton
1183858f25 Update changelog 2022-04-16 10:36:06 +02:00
Pentarctagon
0a7ef1edf1
Add SQL to list unique users per day per source. 2022-04-15 10:27:36 -05:00
Pentarctagon
4cae3beea0
Add SQL to list unique users per day. 2022-04-15 09:45:16 -05:00
Pentarctagon
6dc52f0837
Add changelog entry. 2022-04-12 21:09:04 -05:00
Pentarctagon
08d134ae7b Add support for forum_auth when uploading to campaignd. 2022-04-12 21:06:18 -05:00
Charles Dang
6d3ec1b979 GUI2/Dispatcher: minor doc cleanup 2022-04-12 21:18:25 -04:00
Charles Dang
e14c9279bc GUI2/Dispatcher: made mouse_behavior a scoped enum 2022-04-12 21:16:14 -04:00
Charles Dang
509dffcfb3
Merge pull request #6623 from wesnoth/even-more-dispatcher
Even more dispatcher
2022-04-12 20:27:47 -04:00
Charles Dang
d29f86c2e1 Removed [dis]connect_signal static_assert
Passing the incorrect function  is already a compiler error, and while MSVC builds, GCC et al don't.
Keeping this in history for reference.
2022-04-12 18:42:36 -04:00
Charles Dang
e8e1572442 GUI2/Dispatcher: simplify signal type alias names 2022-04-12 16:43:26 -04:00
Charles Dang
9cec01b680 GUI2/Dispatcher: used default default ctors, disallowed copying signal_queue 2022-04-12 16:24:05 -04:00
Charles Dang
eee2f09216 GUI2/Dispatcher: even further simplified [dis]connect_signal
Macros be-gone!
2022-04-12 16:22:34 -04:00
Charles Dang
ea28127d91 Fixup 2022-04-12 09:33:12 -04:00
Charles Dang
e36b8acace Revert "GUI2/Distributor: address *potential* nullptr dereference"
This reverts commit 9caf43ed732f621d6d752ff5dede54466d5d4b4c. I was mistaken, this is actually meant
to check if mouse_focus_ is a styled_widget or not, and if it's not, fire events unconditionally.
2022-04-12 07:36:44 -04:00
Charles Dang
168986232a Convert compression::format to a scoped enum 2022-04-12 07:35:15 -04:00
Charles Dang
9caf43ed73 GUI2/Distributor: address *potential* nullptr dereference
This has been here since 2009 when this block of code was added (0d72daac2e1157f0d069ff07eb359a9581272cdc).
It's not clear mouse_focus_ would ever be null here, but if it ever was, this would have tried to deference
it and crash. To be safe, I've wrapped both fire() calls in a not-null check.
2022-04-12 07:14:57 -04:00
Charles Dang
b4d1717767 GUI2: small misc cleanup things 2022-04-12 07:03:39 -04:00
Charles Dang
d2e0fb32f8 GUI2/Distributor: code formatting, minor cleanup 2022-04-11 11:01:57 -04:00
Wedge009
aa6b5b493d Avoid potentially using unit IDs that are no longer valid
Resolves #6603 (crash with musl implementation of libc)
2022-04-11 16:26:00 +02:00
Charles Dang
c1d7e65cbc
GUI2/Distributor: further cleanup (#6622)
* GUI2/Distributor: further cleanup started in 988bf973e96efaed9eec268c8d1ba5f4ed3bed37

This restores the template to mouse_button, but it keeps the struct-based approach for specifying ui_events.
2022-04-11 07:52:54 -04:00
Celtic Minstrel
fafafbacf6
Update changelog.md 2022-04-10 20:58:12 -04:00
Charles Dang
65d8c201a5
GUI2/Dispatcher: encode event categories in their enum values (#6621) 2022-04-10 17:56:27 -04:00
Celtic Minstrel
a76aa9bddc
Add wesnoth.interface.add_floating_label as a replacement for wesnoth.print (#5837)
This returns a label handle which allows you to remove, reposition, or replace the label later.

In addition to all the features of wesnoth.print, you can now specify where the label appears onscreen, as well as a fadeout time separate from the duration.

You can also anchor the text to an edge or corner instead of centering in on the screen,
specify the maximum width it can occupy as an absolute width or a percentage,
and specify a background colour and transparency.

It includes a demo scenario that demonstrates many of the capabilities of the API.
To play the demo scenario, run with -toverlay_text_demo or select it from the in-game test list.
2022-04-10 13:00:29 -04:00
Nils Kneuper
75168c44ac updated Czech translation 2022-04-09 12:01:24 +02:00
Steve Cotton
c7acca4ea7 SoF: Consistently use lower-case after ellipses
Sadly, this takes the campaign up to 100 string changes between 1.16.2 and
1.16.3. The only one of these that was already going to change for 1.16.3 is
S04t's volcanic forge one.

(cherry picked from commit a1e60f061dd85237215966e5733a8da8f7ec126b)
2022-04-09 01:27:48 +02:00
Pentarctagon
a89340bd44
Fix for clang's -Wrange-loop-construct. 2022-04-08 14:16:50 -05:00
Pentarctagon
c3a5763f03
Fix schema. 2022-04-08 11:49:02 -05:00
Pentarctagon
3e79bf173e
Fix misnamed template parameter. 2022-04-08 09:32:08 -05:00
Charles Dang
be73a7cc62 GUI2: further cleaned up dispatcher implementation 2022-04-08 04:09:37 -04:00
Charles Dang
c8f1e63742 Merge branch 'master' of github.com:wesnoth/wesnoth 2022-04-08 03:08:07 -04:00
Charles Dang
ff3bd38a6f GUI2/Static Registry: removed some unnecessary typedefs
Better for intellisense.
2022-04-08 03:03:16 -04:00
Charles Dang
a3b6f57e4d Game Load: revamped design 2022-04-08 03:02:21 -04:00
Charles Dang
6b329a020a Loading Screen: added an (as-yet unused) image background layer 2022-04-08 02:59:11 -04:00
newfrenchy83
650f70405f
fix [firststrike] special with apply_to=opponent crashes Wesnoth 1.17.x (#6574)
As reported on the forum in https://forums.wesnoth.org/viewtopic.php?p=672374#p672374
If a unit with "last strike" ([firststrike] special with apply_to=opponent, on any of its attacks)
was targeted by other unit for attack, wesnoth crashed.

Fix similar problems for other weapon specials like poisons, when two users of specials with
apply_to=opponent fought, one fighter only could be poisoned or slowed.

* Add a unit test for poison
* Add a unit test for firststrike and laststrike
2022-04-08 02:30:14 +02:00
Luis Miguel Iglesias Sánchez
8561fb64e3
NR S05a_01 Enhance dialogue between Tallin and Abhai (#6612) 2022-04-08 02:26:09 +02:00
Wedge009
dbf50b01be THoT: Move unused images to attic.
Resolves #6602.
2022-04-05 10:34:19 +10:00
Descacharrado
d4bddb5496 changelog 2022-04-05 10:27:07 +10:00
Descacharrado
eb123ed8bb Fix units stuck in spider wall and filter 2022-04-05 10:27:07 +10:00