GUI: intro, part 9 - DO NOT USE

This commit is contained in:
tildearrow 2023-02-18 19:43:23 -05:00
parent f92b208bb7
commit a0922c67e4
7 changed files with 6245 additions and 7 deletions

View File

@ -590,6 +590,7 @@ src/gui/image_tachip.cpp
src/gui/image_logo.cpp
src/gui/image_wordmark.cpp
src/gui/image_introbg.cpp
src/gui/image_pat.cpp
src/gui/image.cpp
src/gui/debug.cpp

Binary file not shown.

Before

Width:  |  Height:  |  Size: 71 KiB

After

Width:  |  Height:  |  Size: 73 KiB

View File

@ -656,6 +656,7 @@ enum FurnaceGUIImages {
GUI_IMAGE_LOGO,
GUI_IMAGE_WORDMARK,
GUI_IMAGE_INTROBG,
GUI_IMAGE_PAT,
GUI_IMAGE_MAX
};

View File

@ -35,7 +35,8 @@ const unsigned char* imageData[GUI_IMAGE_MAX]={
image_tachip_data,
image_logo_data,
image_wordmark_data,
image_introbg_data
image_introbg_data,
image_pat_data
};
const unsigned int imageLen[GUI_IMAGE_MAX]={
@ -44,7 +45,8 @@ const unsigned int imageLen[GUI_IMAGE_MAX]={
image_tachip_size,
image_logo_size,
image_wordmark_size,
image_introbg_size
image_introbg_size,
image_pat_size
};
SDL_Texture* FurnaceGUI::getTexture(FurnaceGUIImages image, SDL_BlendMode blendMode) {

View File

@ -36,4 +36,7 @@ extern const unsigned int image_wordmark_size;
extern const unsigned char image_introbg_data[];
extern const unsigned int image_introbg_size;
extern const unsigned char image_pat_data[];
extern const unsigned int image_pat_size;
#endif

6203
src/gui/image_pat.cpp Normal file

File diff suppressed because it is too large Load Diff

View File

@ -119,6 +119,39 @@ void FurnaceGUI::drawIntro() {
drawImage(dl,GUI_IMAGE_INTROBG,ImVec2(0.7,0.25-(introPos+addition)*0.03),ImVec2(20.0,20.0),0.0,ImVec2(0.0,0.0),ImVec2(1.0,1.0),ImVec4(0.4+0.3*s1a,1.0,0.7,(0.5-0.4*s1a)*bgAlpha));
}
const double fallPatX[]={
0.0,
272.0,
470.0,
742.0,
1013.0
};
// part 2 - falling patterns
if (introPos>2.3 && introPos<4.5) {
for (int i=0; i<48; i++) {
ImVec2 uv0=ImVec2(
fallPatX[i&3],
(double)(i>>2)*36.0
);
ImVec2 uv1=ImVec2(
fallPatX[1+(i&3)]-2.0,
uv0.y+36.0
);
uv0.x/=1024.0;
uv0.y/=512.0;
uv1.x/=1024.0;
uv1.y/=512.0;
bool left=(i%6)>=3;
double t=(introPos-2.5)*(0.77+(cos(i+7)*0.05));
double alteration=pow(t,0.4)-(0.55*t)+0.55*pow(t,6.0);
drawImage(dl,GUI_IMAGE_PAT,ImVec2((left?0:1)+sin(cos(i*3.67))*0.35+((alteration+((introPos-2.3)*(0.08*(double)(1+(i&3)))))*(left?1.0:-1.0)),0.5+sin(i*6.74)*0.3-pow(CLAMP(introPos-3.0,0.0,1.0),4.0)*1.5),ImVec2(1.5,1.5),0.0f,uv0,uv1,ImVec4(1.0,1.0,1.0,1.0));
}
}
// transition
float transitionPos=CLAMP(introPos*4.0-8,-1.5,3.5);
dl->AddQuadFilled(
@ -141,11 +174,6 @@ void FurnaceGUI::drawIntro() {
ImGui::GetColorU32(ImVec4(0.35,0.4,0.5,1.0))
);
// part 2 - falling patterns
if (introPos>2.3) {
}
// part 3 - falling chips
if (introPos>3.0) {
for (int i=0; i<40; i++) {