Commit graph

40328 commits

Author SHA1 Message Date
Tim Schumacher
1ce3b9ea48 Ports/SDL2_image: Update to 2.6.2 2022-08-23 13:30:48 +01:00
Tim Schumacher
831afe3c3d Ports/SDL2: Update to 2.24.0 2022-08-23 13:30:48 +01:00
Tim Schumacher
2e31a479c4 Ports/SDL2: Do an out-of-tree build
SDL 2.24.0 starts having include loops if we try to do an in-tree build
against its wishes, so let's not do that anymore.
2022-08-23 13:30:48 +01:00
Seal Sealy
ffe9a862f0 Ports: Add aclock port 2022-08-23 13:29:32 +01:00
djwisdom
f3cec9de75 Base: Add five new emojis
 - U+26A1 HIGH VOLTAGE
 - U+26AA WHITE CIRCLE
 - U+26AB BLACK CIRCLE
 - U+26BE BASEBALL
✉ - U+2709 ENVELOPE

Coverage: https://emoji.serenityos.net
2022-08-23 13:27:58 +01:00
Ryan Liptak
b4856a4070 Base: Add 5 new emojis
🌡 - U+1F321 THERMOMETER
🌞 - U+1F31E SUN WITH FACE
 - U+26C5 SUN BEHIND CLOUD
⛈ - U+26C8 CLOUD WITH LIGHTNING AND RAIN
🌪 - U+1F32A TORNADO
2022-08-23 13:27:40 +01:00
MacDue
50ab2de10e LibWeb: Remove done TODO and fix typo 2022-08-23 13:27:02 +01:00
MacDue
40ad8b793d LibWeb: Avoid infinite loops in background painting
Previously if `background-size` was 0px in any dimension we would
go into in infinite loop whilst painting.
2022-08-23 13:27:02 +01:00
Linus Groh
ae264c9143 CI: Install newer Bash via homebrew on macOS
The recently added generate-emoji-txt.sh script uses a Bash 4
substitution feature, causing CI to fail as macOS ships an ancient Bash
3.x. We'll want to use a more recent version anyway, so let's do that
instead of updading the script to older syntax.
2022-08-23 13:25:39 +01:00
networkException
2161f20aa6 LibGUI: Call on_segment_change handler from on_{click,focus_change}
The on_segment_change handler introduced in
a00fa793b3 was only getting called by
programmatically setting the segment, not by clicking a button or using
tab navigation.
2022-08-23 12:50:20 +02:00
networkException
c1c11df3b8 LibGUI: Don't call on_segment_change handler if the index did not change
This patch makes the handler's behavior closer to what can be expected
from it's name by not handling set_selected_segment if the segment is
already selected.
2022-08-23 12:50:20 +02:00
Samuel Bowman
91574ed677 Kernel: Fix boot profiling
Boot profiling was previously broken due to init_stage2() passing the
event mask to sys$profiling_enable() via kernel pointer, but a user
pointer is expected.

To fix this, I added Process::profiling_enable() as an alternative to
Process::sys$profiling_enable which takes a u64 rather than a
Userspace<u64 const*>. It's a bit of a hack, but it works.
2022-08-23 11:48:50 +02:00
electrikmilk
0abe4d8b97 Base: Add More Emojis
This adds 16 emojis, and improves the emoji for Wine Glass.
2022-08-23 09:36:49 +01:00
Xexxa
0d05569257 Base: Add more emoji
🫶🏿 - U+1FAF6 U+1F3FF Heart Hands: Dark Skin Tone
🫶🏾 - U+1FAF6 U+1F3FE Heart Hands: Medium-Dark Skin Tone
🫶🏽 - U+1FAF6 U+1F3FD Heart Hands: Medium Skin Tone
🫶🏼 - U+1FAF6 U+1F3FC Heart Hands: Medium-Light Skin Tone
🫶🏻 - U+1FAF6 U+1F3FB Heart Hands: Light Skin Tone
2022-08-23 06:59:46 +00:00
kleines Filmröllchen
4355a01455 LibCore: Fix deadlock in SharedSingleProducerCircularQueue
This deadlock would incorrectly change the queue from almost empty to
full on dequeue because someone else could empty the queue after we had
checked its non-emptyness. The test would deadlock on this, which
doesn't happen anymore.
2022-08-23 01:03:10 +02:00
MacDue
be9d3f9aa4 Base: Add an example linear-gradient with double-position color stops 2022-08-23 01:02:49 +02:00
MacDue
698717d102 LibWeb: Resolve double-position linear-gradient() color stops
These just resolve to an extra color stop.
Something like "red 10% 40%"  is just shorthand for "red 10%, red 40%".
2022-08-23 01:02:49 +02:00
MacDue
fa5c2183df LibWeb: Don't regenerate linear gradient data unless size changes
This is an easy check to add and seems like it makes things a
tiny bit smoother.
2022-08-23 01:02:49 +02:00
MacDue
de5d25ee44 LibWeb: Add missing checks to LinearGradientStyleValue::equals() 2022-08-23 01:02:49 +02:00
MacDue
3a1f8d714a LibWeb: Parse double-position linear-gradient() color stops
The only accepted syntax for these seems to be
<color> <length percentage> <length percentage>, no other order.

But that's just gathered from looking at other browsers as though
these are supported by all major browsers, they don't appear in
the W3C spec.
2022-08-23 01:02:49 +02:00
Anthony Iacono
ec3d8a7a18 Kernel: Remove unused Process::in_group() 2022-08-23 01:01:48 +02:00
Andreas Kling
434d77cd43 Kernel/ProcFS: Silently ignore attempts to update ProcFS timestamps
We have to override Inode::update_timestamps() for ProcFS inodes,
otherwise we'll get the default behavior of erroring with ENOTIMPL.
2022-08-23 01:00:40 +02:00
Andreas Kling
5307e1bf01 Kernel/SysFS: Silently ignore attempts to update SysFS timestamps
We have to override Inode::update_timestamps() for SysFS inodes,
otherwise we'll get the default behavior of erroring with ENOTIMPL.
2022-08-23 00:55:41 +02:00
Andreas Kling
ecf85875b5 PixelPaint: Disambiguate layer vs image actions in their names
Instead of having "Flip Horizontally" in both the Image and Layer menus,
we now have "Flip Image Horizontally" and "Flip Layer Horizontally".

This same concept applied to other, similar actions.
2022-08-22 21:55:19 +02:00
Andreas Kling
ac943c60ef PixelPaint: Add actions for flipping and rotating an individual layer 2022-08-22 21:55:19 +02:00
Andreas Kling
4491ef8ae6 PixelPaint: Relayout ImageEditor immediately when image rect changes
This avoids a jarring effect where we'd "snap" the image into place
upon the next resize event.
2022-08-22 21:55:19 +02:00
Andreas Kling
d7cf36ec6c PixelPaint: Create undo items for more editing actions 2022-08-22 21:55:19 +02:00
Andreas Kling
32b73dd4af PixelPaint: Restore image size from snapshots
This will make undoing a resize or rotate operation actually restore the
size of the image as well.
2022-08-22 21:55:19 +02:00
Lucas CHOLLET
d5979516b4 ChessEngine: Don't throw away useful branches from last tree
Computation from last turn might have produced some nodes that are still
accurate. Keeping them should make the engine a bit smarter.
2022-08-22 21:20:41 +02:00
Lucas CHOLLET
351fc0cce2 ChessEngine: Use reduced Board objects in MCTSTree
Monte-Carlo methods are known to intensively create nodes and in our
case each leaf of the tree stores a board. However, for this use case,
we don't need a full board object that also contains game information.

This patch adds a `clone_cleared()` method that return a clone without
game information and uses it when constructing the tree.
It allows the ChessEngine much more possibility before getting out of
memory.
2022-08-22 21:20:41 +02:00
Lucas CHOLLET
5f13a87ce7 ChessEngine: Limit MCTSTree expansion
This method temperate the habit of Monte-Carlo based algorithms to
repeatedly create new nodes.

It was first implemented in `Efficient Selectivity and Backup Operators
in Monte-Carlo Tree Search` by Rémi Coulom.
2022-08-22 21:20:41 +02:00
Andreas Kling
4c081e0479 Kernel/x86: Protect the CR3->PD map with a spinlock
This can be accessed from multiple CPUs at the same time, so relying on
the interrupt flag is clearly insufficient.
2022-08-22 17:56:03 +02:00
Andreas Kling
6cd3695761 Kernel: Stop taking MM lock while using regular quickmaps
You're still required to disable interrupts though, as the mappings are
per-CPU. This exposed the fact that our CR3 lookup map is insufficiently
protected (but we'll address that in a separate commit.)
2022-08-22 17:56:03 +02:00
Andreas Kling
c8375c51ff Kernel: Stop taking MM lock while using PD/PT quickmaps
This is no longer required as these quickmaps are now per-CPU. :^)
2022-08-22 17:56:03 +02:00
Andreas Kling
a838fdfd88 Kernel: Make the page table quickmaps per-CPU
While the "regular" quickmap (used to temporarily map a physical page
at a known address for quick access) has been per-CPU for a while,
we also have the PD (page directory) and PT (page table) quickmaps
used by the memory management code to edit page tables. These have been
global, which meant that SMP systems had to keep fighting over them.

This patch makes *all* quickmaps per-CPU. We reserve virtual addresses
for up to 64 CPUs worth of quickmaps for now.

Note that all quickmaps are still protected by the MM lock, and we'll
have to fix that too, before seeing any real throughput improvements.
2022-08-22 17:56:03 +02:00
Andreas Kling
930dedfbd8 Kernel: Make sys$utime() and sys$utimensat() not take the big lock 2022-08-22 17:56:03 +02:00
Andreas Kling
280694bb46 Kernel: Update atime/ctime/mtime timestamps atomically
Instead of having three separate APIs (one for each timestamp),
there's now only Inode::update_timestamps() and it takes 3x optional
timestamps. The non-empty timestamps are updated while holding the inode
mutex, and the outside world no longer has to look at intermediate
timestamp states.
2022-08-22 17:56:03 +02:00
Andreas Kling
35b2e9c663 Kernel: Make sys$mknod() not take the big lock 2022-08-22 17:56:03 +02:00
Timothy Flynn
d86b25c460 Meta: Move downloading of emoji-test.txt to unicode_data.cmake
The current emoji_txt.cmake does not handle download errors (which were
a common source of issues in the build problems channel) or Unicode
versioning. These are both handled by unicode_data.cmake. Move the
download to unicode_data.cmake so that we can more easily handle next
month's Unicode 15 release.
2022-08-22 16:00:29 +01:00
Sam Atkins
cde4552710 GamesSettings: Add a preview for the current card-game settings :^) 2022-08-22 12:50:41 +02:00
Sam Atkins
deeef8c412 GamesSettings: Add a setting for the card-back image
And also add a couple of images so there's more than one option. :^)

(My yak silhouette isn't very good, so please replace that, artists!)
2022-08-22 12:50:41 +02:00
Sam Atkins
435e53fcfe LibCards: Remove card-back-image scaling
This was giving wonky results with images that do not fill the entire
card - and it's also unnecessary, since the Buggie image we have been
using, and the two I will be adding, are all small enough to not need
scaling anyway. :^)
2022-08-22 12:50:41 +02:00
Sam Atkins
40b1428194 LibCards: Make the card back image configurable
`CardPainter::set_background_image_path()` immediately repaints the card
back and inverted card back bitmaps if they exist, so users just need
to `update()` that part of the screen. This is handled automatically by
`CardGame`, but other users will have to do this manually.
2022-08-22 12:50:41 +02:00
Sam Atkins
7f46d31849 LibCards: Centralise card bitmap creation
Instead of each card being responsible for painting its own bitmaps, we
now have a CardPainter which is responsible for this. It paints a given
card the first time it is requested, and then re-uses that bitmap when
requested in the future. This saves memory for duplicate cards (such as
in Spider where several sets of the same suit are used) or unused ones
(for example, the inverted cards which are only used by Hearts). It
also means we don't throw away bitmaps and then re-create identical
ones when starting a new game.

We get some nice memory savings from this:

|           | Before   | After    | Before (Virtual) | After (Virtual) |
|:----------|---------:|---------:|-----------------:|----------------:|
| Hearts    | 12.2 MiB |  9.3 MiB |         25.1 MiB |        22.2 MiB |
| Spider    | 12.1 MiB | 10.1 MiB |         29.2 MiB |        22.9 MiB |
| Solitaire | 16.4 MiB |  9.0 MiB |         25.0 MiB |        21.9 MiB |

All these measurements taken from x86_64 build, from a fresh launch of
each game after the animation has finished, but without making any
moves. The Hearts value will go up once inverted cards start being
requested.
2022-08-22 12:50:41 +02:00
Sam Atkins
aac2488d5c LibCards+Games: Replace card "value" int with a Rank enum
Because `card->value() == 11` is a lot less clear than `card->rank() ==
Cards::Rank::Queen`, and also safer.

Put this, along with the `Suit` enum, in the `Cards` namespace directly
instead of inside `Cards::Card`. Slightly less typing that way.
2022-08-22 12:50:41 +02:00
Sam Atkins
163a74e3e2 Spider: Migrate to CardGame 2022-08-22 12:50:41 +02:00
Sam Atkins
c709dc154f Hearts: Migrate to CardGame 2022-08-22 12:50:41 +02:00
Sam Atkins
f9f25271b3 Solitaire: Migrate to CardGame 2022-08-22 12:50:41 +02:00
Sam Atkins
c5b7ad6004 LibCards: Add a CardGame base class
For now, the only feature of this is that it sets the background colour
from the `Games::Cards::BackgroundColor` config value. Later, other
card game configuration and shared behaviour can go here, to save
duplicating it in each game.
2022-08-22 12:50:41 +02:00
Sam Atkins
a01c4c50d1 GamesSettings: Introduce a new GamesSettings application :^)
This currently has exactly one setting: The background colour for card
games. My thinking is, it's better to not have a Settings application
for each individual game we include in the system, since most will only
have a small number of settings, all Settings windows have tabs anyway,
and I don't want to flood the Settings app list unnecessarily.

As for having a single setting for all the card games: it's nice when
things match. :^)
2022-08-22 12:50:41 +02:00