6
6
7
7
#include <3ds.h>
8
8
#include <spritetools_splash.h>
9
+ #include <spritetools_time.h>
9
10
10
11
/*****************\
11
12
|* Image *|
@@ -19077,21 +19078,22 @@ static const struct {
19077
19078
/* Takes time to display in ms */
19078
19079
void ST_Splashscreen(u64 time)
19079
19080
{
19080
- u64 startTime = osGetTime();
19081
- u64 currentTime = startTime;
19082
19081
u8 fade = 0;
19082
+ u32 bg = ST_RenderGetBackground();
19083
19083
19084
19084
st_spritesheet *splash_s =
19085
19085
ST_SpritesheetCreateSpritesheet(splash.pixel_data,
19086
19086
splash.width, splash.height);
19087
19087
19088
+ ST_RenderSetBackground(0x00, 0x00, 0x00);
19089
+
19088
19090
/* Splash for 4 seconds */
19089
- while ((currentTime = osGetTime() - startTime ) <= time)
19091
+ while (ST_TimeRunning( ) <= time)
19090
19092
{
19091
- if (currentTime <= 255)
19092
- fade = currentTime ; /* Fade in */
19093
- else if (time - currentTime <= 255)
19094
- fade = time - currentTime ; /* Fade out */
19093
+ if (ST_TimeRunning() <= 255)
19094
+ fade = ST_TimeRunning() ; /* Fade in */
19095
+ else if (time - ST_TimeRunning() <= 255)
19096
+ fade = time - ST_TimeRunning() ; /* Fade out */
19095
19097
else
19096
19098
fade = 255; /* Mid splash */
19097
19099
@@ -19107,4 +19109,7 @@ void ST_Splashscreen(u64 time)
19107
19109
19108
19110
/* Free splashscreen */
19109
19111
ST_SpritesheetFreeSpritesheet(splash_s);
19112
+
19113
+ /* Return original background */
19114
+ ST_RenderSetBackground(RGBA8_GET_R(bg), RGBA8_GET_G(bg), RGBA8_GET_B(bg));
19110
19115
}
0 commit comments