Commit graph

32617 commits

Author SHA1 Message Date
Itamar
f464ae84ce CMake: Add HACKSTUDIO_BUILD option for building from Hack Studio
If this option is set, we will not build all components.
Instead, we include an external CMake file passed in via a variable
named HACKSTUDIO_BUILD_CMAKE_FILE.

This will be used to build serenity components from Hack Studio.
2022-01-12 14:55:19 +01:00
Itamar
afb4c447b4 HackStudio: Add optional parameters to TerminalWrapper::run()
The optional parameters allow specifying a working directory and
controlling whether or not to block until the command returns.
2022-01-12 14:55:19 +01:00
Itamar
3afd17db9d HackStudio: Add Project::project_is_serenity() function 2022-01-12 14:55:19 +01:00
Itamar
95545648bd LibCore: Add utility class for temporary files and directories
Core::TempFile is a RAII type that creates a temporary file or directory
on construction and deletes it on destruction.
2022-01-12 14:55:19 +01:00
Itamar
28a6686f2c LibC: Install libssp.a in /usr/lib
It previously was not included in the install stage.
2022-01-12 14:55:19 +01:00
Itamar
fbdd6df185 LibCore: Make Core::command return CommandResult struct
Previously, Core::command only returned a String which contained the
data from stdout.

The CommandResult struct contains the exit code as well as the data
from stdout and stderr.
2022-01-12 14:55:19 +01:00
Jelle Raaijmakers
a4e2d93aa2 Ports+LibGL: Replace LibGL context check by ScummVM patch
According to the OpenGL spec, invoking functions without an active
context results in undefined behavior. Since ScummVM seems to be the
only port having issues with our behavior, patch their code instead.
2022-01-12 14:54:18 +01:00
Daniel Bertalan
3cbf20ca5d Ports: Remove obsolete mold patch
This is no longer needed, as both toolchains now support
std::filesystem.
2022-01-12 14:54:12 +01:00
Daniel Bertalan
c7423dc20b LibC: Make the address argument of malloc_size a pointer to const
We don't mutate the pointed-to memory, so let's be const correct.

Fixes building the `mimalloc` library that's optionally used by the mold
linker (note that it isn't enabled yet as I haven't tested it).
2022-01-12 14:54:12 +01:00
Daniel Bertalan
9e8c4bb072 Toolchain: Enable the -rdynamic flag in the gcc driver
Although we handle it in the linker spec file, gcc will actually reject
this argument unless it's also enabled in the option file.

CMake adds this flag if the minimum required version is 3.3 or less (see
CMP0065), so old projects would fail to compile because of this
unrecognized option.
2022-01-12 14:54:12 +01:00
Daniel Bertalan
fbccf77d37 Toolchain: Enable std::filesystem support in libc++
Now that the last missing function (`fchmodat(2)`) has been added to
LibC, libc++ compiles successfully with std::filesystem support enabled.
2022-01-12 14:54:12 +01:00
Daniel Bertalan
182016d7c0 Kernel+LibC+LibCore+UE: Implement fchmodat(2)
This function is an extended version of `chmod(2)` that lets one control
whether to dereference symlinks, and specify a file descriptor to a
directory that will be used as the base for relative paths.
2022-01-12 14:54:12 +01:00
Andreas Kling
5f71925aa4 Kernel: Actually clear page slots in Region::clear_to_zero()
We were copying the RefPtr<PhysicalPage> and zeroing the copy instead
of zeroing the slot itself.
2022-01-12 14:52:47 +01:00
Andreas Kling
d8206c1059 Kernel: Don't release/relock spinlocks repeatedly during space teardown
Grab the page directory and MM locks once at the start of address space
teardown, then hold onto them across all the region unmapping work.
2022-01-12 14:52:47 +01:00
Andreas Kling
2323cdd914 Kernel: Do less unnecessary work when tearing down process address space
When deleting an entire AddressSpace, we don't need to do TLB flushes
at all (since the entire page directory is going away anyway).

We also don't need to deallocate VM ranges one by one, since the entire
VM range allocator will be deleted anyway.
2022-01-12 14:52:47 +01:00
Andreas Kling
a702b6ec42 AK: Remove unnecessary null checks in RedBlackTree 2022-01-12 14:52:47 +01:00
Lady Gegga
cd285894b2 Base: Add Klingon to font Katica Regular 10
F8D0-F8FF* https://www.kreativekorp.com/ucsur/charts/PDF/UF8D0.pdf
* PUA based on Under-ConScript Unicode Registry
2022-01-12 14:06:43 +01:00
Luke Wilde
f216df7d0f LibSoftGPU: Don't render triangle strip if there's less than 3 vertices
If there's less than 3 vertices, we cannot do triangle strip otherwise
we will go out-of-bounds of the vertices vector.

Required for Half-Life, which sometimes submits 0 vertices for triangle
strip when drawing the electric disks around the pillars in Xen.
2022-01-12 13:47:26 +01:00
Jesse Buhagiar
b397db9948 3DFileViewer: Replace lambertian lighting with GL Lighting 2022-01-12 13:36:56 +01:00
Jesse Buhagiar
9aae648482 LibSoftGPU: Implement per-vertex Lighting during T&L Stage
We now perform per vertex lighting during the Transform and Lighting
stage of the pipeline before the triangles are sent off to be
rasterized.
2022-01-12 13:36:56 +01:00
Jesse Buhagiar
5a1f559ed9 LibSoftGPU: Transform normals during T&L stage
As well as Vertex Positions, the normals also need to be transformed
into eye-space so that lighting can be applied correctly.
2022-01-12 13:36:56 +01:00
Jesse Buhagiar
4035532ee8 LibGL+LibSoftGPU: Pass along lighting flag to Software GPU
This was currently only set in the OpenGL context, as the previous
architecture did all of the transformation in LibGL before passing the
transformed triangles onto the rasterizer. As this has now changed, and
we require the vertex data to be in eye-space before we can apply
lighting, we need to pass this flag along as well via the GPU options.
2022-01-12 13:36:56 +01:00
Jesse Buhagiar
775ef000e0 LibGL+LibSoftGPU: Move lighting model parameters to SoftGPU
Most of the T&L stuff is, like on an actual GPU, now done inside of
LibSoftGPU. As such, it no longer makes sense to have specific values
like the scene ambient color inside of LibGL as part of the GL context.
These have now been moved into LibSoftGPU and use the same pattern as
the render options to set/get.
2022-01-12 13:36:56 +01:00
Jesse Buhagiar
92373ab0b6 LibGL: Flesh out glMaterialf{v}
These two functions have been turned from stubs into actually doing
something. They now set the correspondingmaterial data member based on
the value passed into the `pname`argument.

Co-authored-by: Stephan Unverwerth <s.unverwerth@serenityos.org>
2022-01-12 13:36:56 +01:00
Jesse Buhagiar
9118b0d164 LibGL: Support enabling/disabling lights via glEnable()/Disable() 2022-01-12 13:36:56 +01:00
Jesse Buhagiar
bf294612a7 LibGL: Implement glLightf{v} and fix gl.h prototype
This implements the `glLightf{v}` family of functions used to set
lighting parameters per light in the GL. It also fixes an incorrect
prototype for the user exposed version of `glLightf{v}` in which
`params` was not marked as `const`.
2022-01-12 13:36:56 +01:00
Jesse Buhagiar
192befa84b LibGL+LibSoftGPU: Add GL_MAX_LIGHTS to get_context_parameter
This is required to allow lighting to work properly in the GL. We
currently have the maximum number of lights in the software GL context
set to 8, as this is the minimum that OpenGL mandates according to the
spec.
2022-01-12 13:36:56 +01:00
kleines Filmröllchen
9ec2b379a4 Meta: Fix Markdown linting
The new help://man links were linted incorrectly, and they're now
skipped by the markdown linter, such as in the pre-commit hook
2022-01-12 13:13:24 +01:00
Brian Gianforcaro
9592ba3548 Kernel: Avoid potential allocation when enumerating cpu features
We can use `StringView::for_each_split_view` here to avoid the potential
allocation of `Vector<StringView>` elements we would get from the normal
Split view functions.
2022-01-12 13:03:44 +01:00
Brian Gianforcaro
142e099001 AK: Implement StringView::for_each_split_view
StringView::for_each_split_view allows you to process the splits in a
StringView without needing to allocate a Vector<StringView> to store
each of the parts.

Since we migrated the implementation from the normal split_view path, we
can also re-implement split_view in terms of for_each_split_view.
2022-01-12 13:03:44 +01:00
Brian Gianforcaro
cd42f64bc7 AK: Rewrite StringView::split_view(char..), using StringView 2022-01-12 13:03:44 +01:00
Brian Gianforcaro
faf1fa0a84 Kernel: Convert Processor::features_string() API to KString 2022-01-12 13:03:44 +01:00
Brian Gianforcaro
f8ad3cc6a0 Kernel: Harden DevPtsFSInode::traverse_as_directory against OOM
Use the try variants of AK::StringBuilder append APIs to harden this
function against OOM.
2022-01-12 13:03:44 +01:00
Lady Gegga
787bfcc530 Base: Add CJK Symbols and Punctuation to font Katica Regular 10
3007-3013, 3016-3023, 3026-3028, 3030, 3036, 3038-303A, 303C, 303D
https://www.unicode.org/charts/PDF/U3000.pdf
2022-01-12 12:23:27 +01:00
Lady Gegga
a69d77081a Base: Add Chakma characters to font Katica Regular 10
11100-11147 https://www.unicode.org/charts/PDF/U11100.pdf
2022-01-12 12:23:27 +01:00
Lady Gegga
f2a11dbac1 Base: Add Playing Cards to font Katica Regular 10
1F0A1, 1F0B1, 1F0C1, 1F0D1
https://www.unicode.org/charts/PDF/U1F0A0.pdf
2022-01-12 12:23:27 +01:00
Lady Gegga
56ec7f0aed Base: Adjust 03CB in font Katica Regular 10
Base 03CB on 03C5 for consistency and conformity with the Unicode
charts, https://www.unicode.org/charts/PDF/U0370.pdf
2022-01-12 12:23:27 +01:00
Matt Jacobson
037fbbf5d9 LibGUI: Add existing children widgets when layout manager changed
If a widget gains a layout manager after it already has child widgets,
the existing widgets are unknown to the layout.  Additionally, if a
layout is reused, it may end up managing children of multiple different
widgets.

To simplify this, clear the entries of a layout manager when its owner
changes, and add any existing children when a new owner comes along.
2022-01-12 11:49:17 +01:00
electrikmilk
34c5d33eb0 Base+Userland: Add various icons
Add new icons to menus, add existing icons that could be used in menus.
2022-01-12 10:55:20 +01:00
electrikmilk
64ae8eac0e Base+PixelPaint: Add more menu icons
Adding icons missing from Pixel Paint menus.
2022-01-12 10:55:13 +01:00
electrikmilk
983c784a80 Base+WindowServer: Add icon to window menu move action 2022-01-12 10:55:04 +01:00
electrikmilk
10e473bf26 Base+Browser: Add Browser icons
Add some missing icons to the brower.
2022-01-12 10:54:54 +01:00
Timothy Flynn
0d8120eeb2 LibUnicode: Perform number system lookups by enumeration value
Now that number systems are generated as an enum, we can generated the
number system data in the order of that enum. This lets us perform
lookups of that data by index instead of a loop of string comparisons.
2022-01-12 10:49:07 +01:00
Timothy Flynn
c5138f0f2b LibUnicode: Parse number system digits from the CLDR
We had a hard-coded table of number system digits copied from ECMA-402.
Turns out these digits are in the CLDR, so let's parse the digits from
there instead of hard-coding them.
2022-01-12 10:49:07 +01:00
Andreas Kling
05ed8d1738 Kernel: Wait for the ATA busy bit to clear after switching channels
This is a speculative fix for a flaky boot crash that shows up every now
and then on CI.

Fixes #10177. Hopefully.
2022-01-12 02:08:58 +01:00
Andreas Kling
8177e7eb22 Kernel: Clarify IDEChannel function that switches current channel
Rename wait_until_not_busy() => select_device_and_wait_until_not_busy()
to make it more obvious what this thing is doing.
2022-01-12 01:57:38 +01:00
Andreas Kling
1ca8bc81a5 Base: Disable TestLibCoreStream in run-tests for now
This test is very flaky, so let's turn it off until someone fixes it.
2022-01-12 01:57:38 +01:00
Jelle Raaijmakers
a41d5ffa1e LibGfx+LibGL: Allow singular matrices to be inverted
This is basically the old behavior before the GLtron port was
introduced, but `.inverse()` no longer crashes if the matrix is
singular.
2022-01-12 01:08:38 +01:00
Jelle Raaijmakers
b2e0bf24ef Ports: Add missing GLtron port dependencies 2022-01-12 01:08:38 +01:00
Jelle Raaijmakers
90d70479b8 Ports: Correct EOL in GLtron patch
The line endings for this patch were inadvertently normalized because
of our old `.gitattributes` rules.
2022-01-12 01:08:38 +01:00