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

LibGUI update for spinning disc animation #80

Merged
merged 24 commits into from
May 29, 2024
Merged

Conversation

supertazon
Copy link
Contributor

Added functions in draw.cpp and guiimage.cpp

supertazon and others added 24 commits May 23, 2024 22:57
Added declaration of the following functions:
- void drawTextureAlphaResizeTexCoords: this function allows to provide custom texture coordinates and alpha value
- void drawTextureResizedAlpha: same as drawTextureResized but with the ability to put a custom alpha value
- void setTextureST: to allow changing the wrapping mode for S and T (GX_CLAMP, GX_REPEAT or GX_MIRROR)
Added the following functions:
- void drawTextureAlphaResizeTexCoords: this function allows to provide custom texture coordinates and alpha value
- void drawTextureResizedAlpha: same as drawTextureResized but with the ability to put a custom alpha value
- void setTextureST: to allow changing the wrapping mode for S and T (GX_CLAMP, GX_REPEAT or GX_MIRROR)
Added declaration of the following functions:
- void drawAlpha: calls the underlying draw.cpp function to draw a texture with a given alpha value as input
- void drawTextureAlphaTexCoords: calls the underlying draw.cpp function to draw a texture with custom texture coordinates and alpha value
- void setTextureWrap: to set the texture coordinate wrapping strategy in the S  and T directions
Added the following functions:
- void drawAlpha: calls the underlying draw.cpp function to draw a texture with a given alpha value as input
- void drawTextureAlphaTexCoords: calls the underlying draw.cpp function to draw a texture with custom texture coordinates and alpha value
- void setTextureWrap: to set the texture coordinate wrapping strategy in the S  and T directions
To store external disc PNG images: they have to be less than 256 x 256 to work properly
used to create the discs folder
Added a "Wii game loading screen" setting that can be set to:
- Default (verbose): traditional Hiidra loading
- Spinning Disc: to show a spinning disc while loading the game
Two header files:
- ash.h contains the declaration of ashExtract: function used to decode the ASH file from the Wii NAND that contains the Wii disc and disc shadow assets
- discAnim.h contains the declaration of discAnim: function that loads the disc either from the NAND or from the usb (located in "/rvloader/discs/GAMEID.png") and animates it
Change int bootHiidra declaration to allow passing the gameIDString that will be required further down to load the proper PNG in discAnim
Changed the declaration of two functions:
- void bootWiiGame: to pass the gameIDString variable needed further down by discAnim (called by bootHiidra)
- void bootDiscLoader: to give it a variable to hide the log lines normally displayed by discLoader when verbose
Changed the call to bootWiiGame to pass the gameIDString argument, needed further down by discAnim
- ash.cpp contains the ashExtract function: depending on the console region, will open the correct ASH file and decode it from the NAND. The ASH file contains the Wii disc and Wii disc shadow assets (TPLs)
- discAnim.cpp takes the necessary assets and renders a spinning disc animation. The disc will enter the tray once the insertDisc flag is set to 1 (done in bootHiidraThread in hiidra.cpp)
- added flag volatile bool hideLogLines: when the spinning disc animation is shown, we don't want to display log lines, this flag is used to toggling that
- in bootHiidraThread, before calling bootDiscLoader: we set the insertDisc flag to 1, which triggers the disc insertion in the tray, and we wait 1s (udelay) before calling bootDiscLoader to let the animation finish properly
- in hiidraAddLogLine and hiidraUpdateLogLine: we use the flag hideLogLines, if set to true, we return directly to not interfere with the animation
- in bootHiidra: we open the main config file to check if we show the spinning disc animation or regular (verbose) hiidra loading, and we check if the game to be loaded is a Wii game or a VC game. Depending on the conditions we then call ashExtract and discAnim or not
- bootWiiGame now passes the gameIDString argument needed by discAnim to load the proper PNG image for the spinning disc animation
- modified void bootDiscLoader(bool hideLog) function to tell bootDiscLoader if we want it to display its log lines or not by passing a command line argument '0' (no) or '1' (yes)
Added wiiLoad value in main config to toggle between default (verbose) Wii game loading or spinning disc animation Wii game loading screen
By default set to 0 (default (verbose))
Toggle displaying log lines depending on received command line arguments from bootDiscLoader function (in main/hiidra.cpp)
Toggle displaying log lines depending on hideLines flag
Declare hideLines flag to toggle between displaying log lines or not
Added #include disc.h to have the hideLines flag. Toggling log lines depending on the flag's value
@Aurelio92 Aurelio92 merged commit 2986396 into Aurelio92:main May 29, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants