Commit Graph

21089 Commits

Author SHA1 Message Date
Gunnar Beutner
95401d2ca2 Hearts: Don't advance the game's state when an animation is playing
Previously we'd end up cancelling an animation that was still playing
when the user selects a card.
2021-05-25 21:05:35 +02:00
Gunnar Beutner
fc99aa92bd Hearts: Fix animations that get stuck "mid-flight"
When an animation is stopped the cards should be moved to their final
position anyway. Otherwise they might end up getting stuck in the
middle of the animation.
2021-05-25 21:05:35 +02:00
Gunnar Beutner
87ace131bc Hearts: Add support for playing more than one hand
This changes the game so that more than one hand can be played. Once
one player has 100 or more points the game ends. A score card is shown
between each hand.

Fixes #7374.
2021-05-25 21:05:35 +02:00
Gunnar Beutner
e636ed43eb Hearts: Let the AI continuously play games
When there are no human players (toggled with Shift-F10) the AI will
continuously start new games when the current game has finished.
2021-05-25 21:05:35 +02:00
Gunnar Beutner
ac1eba2f7c Hearts: Implement passing cards to other players
Fixes #7375.
2021-05-25 21:05:35 +02:00
Gunnar Beutner
fab073f33c Hearts: Move card click handler into a separate method 2021-05-25 21:05:35 +02:00
Gunnar Beutner
89d38b7e94 Hearts: Move sorting helper from Player::pick_lead_card into a method 2021-05-25 21:05:35 +02:00
Gunnar Beutner
4ba9cc82c0 Hearts: Move code to reposition cards into a separate method 2021-05-25 21:05:35 +02:00
Gunnar Beutner
9a6c6a98e5 Hearts: Move round initialization into a separate method 2021-05-25 21:05:35 +02:00
Gunnar Beutner
4e3a1f2da9 Hearts: Move hand sorting functionality into a method 2021-05-25 21:05:35 +02:00
Andreas Kling
6da481205b LibTest: Use fstatat() to speed up iterate_directory_recursively()
Employ the same technique as SpaceAnalyzer to avoid doing full path
resolution in the kernel over an over. Starting each path resolution
from the base of the directory iterator (using its fd) is significantly
faster and reduces test-js runtime by ~3%.
2021-05-25 20:53:59 +02:00
Andreas Kling
cfe3895991 LibJS: Fix broken dbgln_if(HEAP_DEBUG) 2021-05-25 19:44:32 +02:00
Andreas Kling
e6f8a5111f Profiler: Hide timeline scrollbars if we don't need them :^) 2021-05-25 19:04:17 +02:00
Andreas Kling
2de9139532 LibJS: Fix clang-tidy warnings about redundant types in Heap.cpp 2021-05-25 19:04:15 +02:00
Andreas Kling
679fc3066c LibJS: Fix clang-tidy warnings about unnecessary move()s in VM.cpp 2021-05-25 18:52:00 +02:00
Andreas Kling
47a4b2ba9f LibJS: Make Value::as_cell() return a Cell& 2021-05-25 18:48:11 +02:00
Andreas Kling
0de954e86b LibJS: Make Cell::Visitor::visit_impl() take a Cell&
Passing a null cell pointer is not supported.
2021-05-25 18:39:01 +02:00
Andreas Kling
789d20ebb7 LibJS: Replace Cell live bit with a cell state
So far we only have two states: Live and Dead. In the future, we can
add additional states to support incremental sweeping and/or multi-
stage cell destruction.
2021-05-25 18:37:37 +02:00
Andreas Kling
91656d63c7 LibJS: Inline Cell::Visitor::visit() functions
This allows the calls to MarkingVisitor::visit_impl() during GC to be
devirtualized in Heap::mark_live_cells().
2021-05-25 18:18:48 +02:00
Gunnar Beutner
c81b3e1ee3 LibC: Implement strerror_r()
This implements the XSI-compliant version of strerror_r() - as opposed
to the GNU-specific variant.

The function explicitly saves errno so as to not accidentally change it
with one of the calls to other functions.
2021-05-25 17:36:02 +02:00
Gunnar Beutner
3526fbbc5f LibC: Add definition for PRIxPTR 2021-05-25 17:36:02 +02:00
Brendan Coles
16094baffc HexEditor: Construct Find dialog from GML 2021-05-25 13:17:28 +01:00
Andreas Kling
7997c02b6c ls: Fix incorrect -t sort order
Dr. POSIX says -t should sort the output by mtime ascending.
2021-05-25 13:23:17 +02:00
Brian Gianforcaro
6830963321 Kernel: Validate we don't hold s_mm_lock during context switch
Since `s_mm_lock` is a RecursiveSpinlock, if a kernel thread gets
preempted while accidentally hold the lock during switch_context,
another thread running on the same processor could end up manipulating
the state of the memory manager even though they should not be able to.
It will just bump the recursion count and keep going.

This appears to be the root cause of weird bugs like: #7359
Where page protection magically appears to be wrong during execution.

To avoid these cases lets guard this specific unfortunate case and make
sure it can never go unnoticed ever again.

The assert was Tom's idea to help debug this, so I am going to tag him
as co-author of this commit.

Co-Authored-By: Tom <tomut@yahoo.com>
2021-05-25 10:35:41 +02:00
Tom
fe679de791 Kernel: Release the paging lock while reading from the disk
Because reading from the disk may preempt, we need to release the
paging lock.
2021-05-25 10:35:41 +02:00
Tom
1110c659ee Kernel: Add ScopedLockRelease to temporarily release a Lock 2021-05-25 10:35:41 +02:00
Gunnar Beutner
a808fff2ec Revert "Revert "Kernel: Fix PCI layout of i440fx QEMU machine""
This reverts commit 72c097530f.

With that patch applied audio doesn't work anymore.

Fixes #7445.
2021-05-25 09:38:25 +02:00
Tobias Christiansen
820224bb48 LibWeb: Match the :not pseudoclass
When a Selector features a :not() pseudoclass we now check whether the
current element matches with the given selector in the :not and act
accordingly.
2021-05-24 22:10:08 +01:00
Tobias Christiansen
1ab82afee6 LibWeb: Add :not pseudoclass to the CSS parser
The selector given in the :not() is stored in the SimpleSelector as a
String.
2021-05-24 22:10:08 +01:00
Matthew Olsson
78f3bad7e6 LibPDF: Pre-initialize common FlyStrings in CommonNames.h 2021-05-25 00:24:09 +04:30
Matthew Olsson
cf3eb27108 PDFViewer: Add a toolbar
The toolbar has an option to toggle the sidebar, a number input to
set the current page, and two buttons to go up and down by one page
2021-05-25 00:24:09 +04:30
Matthew Olsson
cea7dbce42 PDFViewer: Add a tab bar with outlines and thumbnails
Outlines are in theory implemented (though I'm having trouble finding
a simple PDF with outlines to test it on), and thumbnails are not.
2021-05-25 00:24:09 +04:30
Matthew Olsson
67b65dffa8 LibPDF: Handle string encodings
Strings can be encoded in either UTF16-BE or UTF8. In either case,
there are a few initial bytes which specify the encoding that must
be checked and also removed from the final string.
2021-05-25 00:24:09 +04:30
Matthew Olsson
a08922d2f6 LibPDF: Parse outline structures 2021-05-25 00:24:09 +04:30
Matthew Olsson
777c232e16 AK: Add String::repeated(StringView, size_t count) 2021-05-25 00:24:09 +04:30
Matthew Olsson
be6e4b6f3c LibPDF: Store indirect value refs in Value objects
IndirectValueRef is so simple that it can be stored directly in the
Value class instead of being heap allocated.

As the comment in Value says, however, in theory the max bits needed to
store is 48 (16 for the generation index and 32(?) for the object
index), but 32 should be good enough for now. We can increase it to u64
later if necessary.
2021-05-25 00:24:09 +04:30
Matthew Olsson
534a2e95d2 LibPDF: Add basic color space support to the renderer
This commit only supports the three most basic color spaces:
DeviceGray, DeviceRGB, and DeviceCMYK
2021-05-25 00:24:09 +04:30
Matthew Olsson
f4941f5940 LibGfx: Add Color::from_cmyk 2021-05-25 00:24:09 +04:30
Matthew Olsson
f2d2f3fae7 LibPDF: Add a very poor path clipping implementation
This completely ignores the actual path and just uses its bounding box,
since our painter doesn't support clipping to paths.
2021-05-25 00:24:09 +04:30
Matthew Olsson
b6c884d20c LibGfx: Add Path::clear 2021-05-25 00:24:09 +04:30
Matthew Olsson
bf96ad674c LibPDF: Implement stubs for all graphical commands 2021-05-25 00:24:09 +04:30
Matthew Olsson
477e3946e5 LibPDF: Add support for stream filters
This commit also splits up StreamObject into PlainTextStreamObject and
EncodedStreamObject, which is essentially just a stream object which
does not own its bytes vs one which does.
2021-05-25 00:24:09 +04:30
Matthew Olsson
97cc482087 LibPDF: Make Reader::dump_state a bit more readable 2021-05-25 00:24:09 +04:30
Matthew Olsson
8c7ebc7a3f LibPDF: Do not assume value is an object in parse_indirect_value 2021-05-25 00:24:09 +04:30
Daniel Bertalan
e401ff0802 Userland: Fix stty not setting control characters
`AK::Result` does not work if both the error and value types are
integers.
2021-05-24 20:14:21 +01:00
Brendan Coles
7982f9aa70 HexEditor: Store UI layout preferences in config file 2021-05-24 20:11:41 +01:00
Andreas Kling
d1c8f4a2e0 Meta: Add Stephan Unverwerth to the contributors list :^) 2021-05-24 21:05:49 +02:00
Jelle Raaijmakers
dbbc583860 LibGUI/AbstractView: Expose activates_on_selection 2021-05-24 23:31:42 +04:30
Ali Mohammad Pur
27572c9d34 Base: Document the Shell's new termios allow-list
Also add `stty` to that list by default.
2021-05-24 23:26:49 +04:30
Ali Mohammad Pur
b2ef18d538 LibLine+Shell: Allow some programs to modify the current termios
This setting can be controlled by setting the
PROGRAMS_ALLOWED_TO_MODIFY_DEFAULT_TERMIOS _local_ shell variable to a
list containing such programs.
2021-05-24 23:26:49 +04:30