Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Working splash screen in Linux GameLauncher #17913

Open
wants to merge 1 commit into
base: development
Choose a base branch
from

Conversation

Fireronin
Copy link
Contributor

@Fireronin Fireronin commented May 13, 2024

What does this PR do?

This PR allows for setting of splash screen that is rendered using xcb, therefore it removes black screen while renderer is working.

Splash screen image is passed via xxd generated .h file during compilation, from png file named logo.png

The use of generic malloc for data vector and not AZ vectors is due to the fact that functions like xcb_destroy_image, expect ability to deallocate vector with data.

It adds dependency on libxcb-image0-dev

How was this PR tested?

It was tested in debug builds, of project.

@Fireronin Fireronin requested review from a team as code owners May 13, 2024 09:36
@michalpelka michalpelka changed the title Working splash screen Working splash screen in Linux GameLauncher May 13, 2024
Copy link
Contributor

@michalpelka michalpelka left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I cannot accept a change, since it needs a hardcoded location of the cache folder concerning executable. It, most probably, works only with developers' setup when the GameLauncher target is built. I would suggest testing the monolithic build and trying to run the install target.
Refer to https://development--o3deorg.netlify.app/docs/user-guide/interactivity/robotics/deploying-simulation/ https://development--o3deorg.netlify.app/docs/user-guide/packaging/

@Fireronin Fireronin requested a review from michalpelka May 13, 2024 15:03
Copy link
Contributor

@spham-amzn spham-amzn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We cannot use the approach of checking in the splash screen as binary data for the splash screen since the splash screen will be specific to the launcher. It needs to be an image that is specific to the project itself, so there probably needs a mechanism to do this that is outside of the asset processor itself during the build to generate the splash screen image as part of the build process.

@byrcolin byrcolin added sig/build Categorizes an issue or PR as relevant to SIG Build. sig/core Categorizes an issue or PR as relevant to SIG Core labels May 14, 2024
@byrcolin byrcolin requested review from a team May 14, 2024 16:15
@@ -48,6 +48,7 @@ elseif("$ENV{O3DE_PACKAGE_TYPE}" STREQUAL "DEB")
libxkbcommon-dev # For xcb keyboard input
libxcb-xfixes0-dev # For mouse input
libxcb-xinput-dev # For mouse input
libxcb-image0-dev # For xcb image support
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we are adding another xcb package dependency, then it also needs to be added to the build node initialization list, i.e. https://github.com/o3de/o3de/blob/development/scripts/build/build_node/Platform/Linux/package-list.ubuntu-jammy.txt .
And also in order for AR to run successfully, the linux nodes will need to be rebuilt first with the new nodes, which means that change may need a separate PR to go in first, and then coordination with sig-build is needed to propogate the changes.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Fireronin could you prepare a separate PR as @spham-amzn proposed and link here.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here is pr you asked for

#17925

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will also require an update the documentation here:

Copy link
Contributor

@spham-amzn spham-amzn Jun 4, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also note that you will need to work with sig-build to get the changes to the AR jenkins nodes from #17925 before this change, otherwise it will not pass AR.

@spham-amzn
Copy link
Contributor

I think the logic to process the splash screen for the launcher belongs in the LauncherUnified project and not in AzFramework. The generation of the logo.h should be based on a png file that exists in the game project itself, and that file should go into the intermediate build folder with the include path appended instead of placing it directly in AzFramework.

@Fireronin Fireronin requested a review from spham-amzn May 22, 2024 09:16
@Fireronin
Copy link
Contributor Author

Ok, changes applied

@Fireronin
Copy link
Contributor Author

Ok this should do the trick, if you will give it a green light I will squash it all

@Fireronin Fireronin requested a review from spham-amzn June 7, 2024 10:23
@michalpelka
Copy link
Contributor

Please rebase and squash, fix DCO.
I also found that you have to have cmake 3.27.0 to configure project. xcb-image was introduced to FindX11.cmake recently: Kitware/CMake@858fd8e

@Fireronin Fireronin force-pushed the xcb-splashScreen branch 3 times, most recently from dbc608d to 9184367 Compare June 7, 2024 13:20
@spham-amzn
Copy link
Contributor

Please rebase and squash, fix DCO. I also found that you have to have cmake 3.27.0 to configure project. xcb-image was introduced to FindX11.cmake recently: Kitware/CMake@858fd8e

If this is true, then we either have to update the minimum version of cmake in the documentation and in the cmake scripts.

The other alternative is explicitly do a FindLibrary for xcb-image with the 3rdParty::X11:: prefix in the cmake file for XCB.

@Fireronin
Copy link
Contributor Author

This version builds with older cmake

@Fireronin
Copy link
Contributor Author

Hi, @spham-amzn
This pr was reviewed by @michalpelka, and here is updated documentation pr, o3de/o3de.org#2557

@michalpelka
Copy link
Contributor

Also there is update of build config: #17925

@michalpelka
Copy link
Contributor

@spham-amzn thank you for the help on this PR. It would be beneficial for this PR, if you would consider a second review.

Copy link
Contributor

@spham-amzn spham-amzn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you will still need to work with sig-build to get the new xcb library on the jenkins build machines for AR or this may not pass. And you may want to send out an impactful change message on discord to broadcast the fact that new packages are needed now to build on Linux

@byrcolin
Copy link
Contributor

byrcolin commented Jun 18, 2024

@amzn-changml I think we need a issue for adding for xcb on build machines

@byrcolin byrcolin removed request for a team June 25, 2024 16:27
@adamdbrw
Copy link
Contributor

https://github.com/amzn-changml is there any update on this?

@amzn-changml
Copy link
Contributor

The required dependencies have been updated. I ran AR, but it appears be failing on Windows. You might want to merge latest in Development

@Fireronin Fireronin force-pushed the xcb-splashScreen branch 2 times, most recently from d7067dc to 3efde82 Compare July 25, 2024 14:46
@Fireronin
Copy link
Contributor Author

@amzn-changml Hi, do you know what might be the deal with failed tests there are failed tests in Android and windows but both of those mention libraries I haven't even touched and are not even remotely connected with this pr

Signed-off-by: Krzysztof Rymski <[email protected]>

Initial fixes

Signed-off-by: Krzysztof Rymski <[email protected]>

Undoing formating part2

Signed-off-by: Krzysztof Rymski <[email protected]>

Undoing formating part3

Signed-off-by: Krzysztof Rymski <[email protected]>

Undoing formating part4

Signed-off-by: Krzysztof Rymski <[email protected]>

Undoing formating part4

Signed-off-by: Krzysztof Rymski <[email protected]>

Undoing formating part4

Signed-off-by: Krzysztof Rymski <[email protected]>

Undoing formating part4

Signed-off-by: Krzysztof Rymski <[email protected]>

Cleanup

Signed-off-by: Krzysztof Rymski <[email protected]>

Cleanup - move function as private

Signed-off-by: Krzysztof Rymski <[email protected]>

Now generates logo.h based on logo.png, this is then unpacked using lib png, so user can specify logo.png on compile time

Signed-off-by: Krzysztof Rymski <[email protected]>

Now generates logo.h based on logo.png, this is then unpacked using lib png, so user can specify logo.png on compile time

Signed-off-by: Krzysztof Rymski <[email protected]>

Now generates logo.h based on logo.png, this is then unpacked using lib png, so user can specify logo.png on compile time. (cleanup)

Signed-off-by: Krzysztof Rymski <[email protected]>

Now generates logo.h based on logo.png, this is then unpacked using lib png, so user can specify logo.png on compile time. (cleanup 2)

Signed-off-by: Krzysztof Rymski <[email protected]>

Now generates logo.h based on logo.png, this is then unpacked using lib png, so user can specify logo.png on compile time. (cleanup 3)

Signed-off-by: Krzysztof Rymski <[email protected]>

Now generates logo.h based on logo.png, this is then unpacked using lib png, so user can specify logo.png on compile time. (cleanup 4)

Signed-off-by: Krzysztof Rymski <[email protected]>

Now generates logo.h based on logo.png, this is then unpacked using lib png, so user can specify logo.png on compile time. (cleanup 4)

Signed-off-by: Krzysztof Rymski <[email protected]>

Removed lambda and logo is now tracked may change this later

Signed-off-by: Krzysztof Rymski <[email protected]>

Cleanup of variables

Signed-off-by: Krzysztof Rymski <[email protected]>

Now works with new file per project and all is behind ifdef so if file is not present functionality will not be compiled in

Signed-off-by: Krzysztof Rymski <[email protected]>

Fancy cmake, and bug fix

Removed todo

Signed-off-by: Krzysztof Rymski <[email protected]>

Reduced macro use, dco retrigger

Signed-off-by: Krzysztof Rymski <[email protected]>

Applying requested changes

xcb 3rdParty prefix removed

xdd existance check

Signed-off-by: Krzysztof Rymski <[email protected]>

Removed prefix

Signed-off-by: Krzysztof Rymski <[email protected]>

Update Code/Framework/AzFramework/Platform/Linux/platform_nativeui_linux.cmake

Co-authored-by: Michał Pełka <[email protected]>
Signed-off-by: Krzysztof Rymski <[email protected]>

Added license

Added copyright license

Signed-off-by: Krzysztof Rymski <[email protected]>
@Fireronin
Copy link
Contributor Author

Rebased onto development

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
sig/build Categorizes an issue or PR as relevant to SIG Build. sig/core Categorizes an issue or PR as relevant to SIG Core sig/platform Categorizes an issue or PR as relevant to SIG Platform.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants