From a144ca75b49c807551e3fbca292e04292e901bff Mon Sep 17 00:00:00 2001 From: tildearrow Date: Sun, 19 Feb 2023 15:58:56 -0500 Subject: [PATCH] release for intro tune contest --- papers/format.md | 1 + res/Info.plist | 6 +- src/engine/engine.h | 4 +- src/engine/playback.cpp | 2 + src/gui/gui.cpp | 18 +++- src/gui/gui.h | 8 +- src/gui/intro.cpp | 184 ++++++++++++++++++++++++++-------------- 7 files changed, 148 insertions(+), 75 deletions(-) diff --git a/papers/format.md b/papers/format.md index cdbf5708..a60cb6b3 100644 --- a/papers/format.md +++ b/papers/format.md @@ -32,6 +32,7 @@ these fields are 0 in format versions prior to 100 (0.6pre1). the format versions are: +- 141: Furnace Tournament Edition (for intro tune contest) - 140: Furnace dev140 - 139: Furnace dev139 - 138: Furnace dev138 diff --git a/res/Info.plist b/res/Info.plist index 86477d15..39a9ac84 100644 --- a/res/Info.plist +++ b/res/Info.plist @@ -15,17 +15,17 @@ CFBundleInfoDictionaryVersion 6.0 CFBundleLongVersionString - 0.6pre3 + 0.6pre4 CFBundleName Furnace CFBundlePackageType APPL CFBundleShortVersionString - 0.6pre3 + 0.6pre4 CFBundleSignature ???? CFBundleVersion - 0.6pre3 + 0.6pre4 NSHumanReadableCopyright NSHighResolutionCapable diff --git a/src/engine/engine.h b/src/engine/engine.h index e9baa69f..04b64328 100644 --- a/src/engine/engine.h +++ b/src/engine/engine.h @@ -47,8 +47,8 @@ #define BUSY_BEGIN_SOFT softLocked=true; isBusy.lock(); #define BUSY_END isBusy.unlock(); softLocked=false; -#define DIV_VERSION "dev140" -#define DIV_ENGINE_VERSION 140 +#define DIV_VERSION "Tournament Edition" +#define DIV_ENGINE_VERSION 141 // for imports #define DIV_VERSION_MOD 0xff01 #define DIV_VERSION_FC 0xff02 diff --git a/src/engine/playback.cpp b/src/engine/playback.cpp index af5be978..9176a067 100644 --- a/src/engine/playback.cpp +++ b/src/engine/playback.cpp @@ -1686,6 +1686,8 @@ void DivEngine::nextBuf(float** in, float** out, int inChans, int outChans, unsi if (cycles<=0) { // we have to tick if (nextTick()) { + totalTicks=0; + totalSeconds=0; lastLoopPos=size-(runLeftG>>MASTER_CLOCK_PREC); logD("last loop pos: %d for a size of %d and runLeftG of %d",lastLoopPos,size,runLeftG); totalLoops++; diff --git a/src/gui/gui.cpp b/src/gui/gui.cpp index e8661066..7e7237e6 100644 --- a/src/gui/gui.cpp +++ b/src/gui/gui.cpp @@ -3774,6 +3774,7 @@ bool FurnaceGUI::loop() { if (ImGui::MenuItem("song information",BIND_FOR(GUI_ACTION_WINDOW_SONG_INFO),songInfoOpen)) songInfoOpen=!songInfoOpen; if (ImGui::MenuItem("subsongs",BIND_FOR(GUI_ACTION_WINDOW_SUBSONGS),subSongsOpen)) subSongsOpen=!subSongsOpen; if (ImGui::MenuItem("speed",BIND_FOR(GUI_ACTION_WINDOW_SPEED),speedOpen)) speedOpen=!speedOpen; + if (ImGui::MenuItem("---> IntroMon X <---",NULL,introMonOpen)) introMonOpen=!introMonOpen; if (settings.unifiedDataView) { if (ImGui::MenuItem("assets",BIND_FOR(GUI_ACTION_WINDOW_INS_LIST),insListOpen)) insListOpen=!insListOpen; } else { @@ -3981,6 +3982,11 @@ bool FurnaceGUI::loop() { if (!basicMode) drawGrooves(); drawSongInfo(); drawOrders(); + if (introMonOpen) { + int totalTicks=e->getTotalTicks(); + int totalSeconds=e->getTotalSeconds(); + drawIntro(totalSeconds+((double)totalTicks/1000000.0),true); + } drawSampleList(); drawSampleEdit(); drawWaveList(); @@ -5195,7 +5201,7 @@ bool FurnaceGUI::loop() { if (settings.alwaysPlayIntro==1) { shortIntro=true; } - drawIntro(); + drawIntro(introPos); } else { introPos=10.0; } @@ -5251,6 +5257,10 @@ bool FurnaceGUI::loop() { if (mustClear) { SDL_RenderClear(sdlRend); mustClear--; + if (mustClear==0 && !teWarn) { + showWarning("welcome to Furnace Tournament Edition!\n\nthis version of Furnace is specifically designed for the\nIntro Tune Contest of February 2023.\n\ngo to window > IntroMon X to enable something that will be\nuseful during the making of your intro tune!\nsee the #intro-tune-contest channel in the Furnace Discord for more info.",GUI_WARN_GENERIC); + teWarn=true; + } } else { if (initialScreenWipe>0.0f && !settings.disableFadeIn) { WAKE_UP; @@ -5347,6 +5357,7 @@ bool FurnaceGUI::init() { clockOpen=e->getConfBool("clockOpen",false); speedOpen=e->getConfBool("speedOpen",true); groovesOpen=e->getConfBool("groovesOpen",false); + introMonOpen=e->getConfBool("introMonOpen",false); regViewOpen=e->getConfBool("regViewOpen",false); logOpen=e->getConfBool("logOpen",false); effectListOpen=e->getConfBool("effectListOpen",false); @@ -5756,6 +5767,7 @@ void FurnaceGUI::commitState() { e->setConf("clockOpen",clockOpen); e->setConf("speedOpen",speedOpen); e->setConf("groovesOpen",groovesOpen); + e->setConf("introMonOpen",introMonOpen); e->setConf("regViewOpen",regViewOpen); e->setConf("logOpen",logOpen); e->setConf("effectListOpen",effectListOpen); @@ -6008,6 +6020,7 @@ FurnaceGUI::FurnaceGUI(): clockOpen(false), speedOpen(true), groovesOpen(false), + introMonOpen(false), basicMode(true), clockShowReal(true), clockShowRow(true), @@ -6257,7 +6270,8 @@ FurnaceGUI::FurnaceGUI(): introSkip(0.0), mustClear(2), initialScreenWipe(1.0f), - introSkipDo(false) { + introSkipDo(false), + teWarn(false) { // value keys valueKeys[SDLK_0]=0; valueKeys[SDLK_1]=1; diff --git a/src/gui/gui.h b/src/gui/gui.h index e952c038..04120330 100644 --- a/src/gui/gui.h +++ b/src/gui/gui.h @@ -324,6 +324,7 @@ enum FurnaceGUIWindows { GUI_WINDOW_FIND, GUI_WINDOW_CLOCK, GUI_WINDOW_GROOVES, + GUI_WINDOW_INTRO_MON, GUI_WINDOW_SPOILER }; @@ -1524,7 +1525,7 @@ class FurnaceGUI { bool mixerOpen, debugOpen, inspectorOpen, oscOpen, volMeterOpen, statsOpen, compatFlagsOpen; bool pianoOpen, notesOpen, channelsOpen, regViewOpen, logOpen, effectListOpen, chanOscOpen; bool subSongsOpen, findOpen, spoilerOpen, patManagerOpen, sysManagerOpen, clockOpen, speedOpen; - bool groovesOpen; + bool groovesOpen, introMonOpen; bool basicMode, shortIntro; @@ -1839,7 +1840,8 @@ class FurnaceGUI { double introSkip; int mustClear; float initialScreenWipe; - bool introSkipDo; + bool introSkipDo, teWarn; + ImVec2 introMin, introMax; void drawSSGEnv(unsigned char type, const ImVec2& size); void drawWaveform(unsigned char type, bool opz, const ImVec2& size); @@ -1921,7 +1923,7 @@ class FurnaceGUI { void drawSysManager(); void drawRegView(); void drawAbout(); - void drawIntro(); + void drawIntro(double introTime, bool monitor=false); void drawSettings(); void drawDebug(); void drawNewSong(); diff --git a/src/gui/intro.cpp b/src/gui/intro.cpp index a1e970fc..620f2f25 100644 --- a/src/gui/intro.cpp +++ b/src/gui/intro.cpp @@ -24,7 +24,7 @@ void FurnaceGUI::drawImage(ImDrawList* dl, FurnaceGUIImages image, const ImVec2& FurnaceGUIImage* imgI=getImage(image); SDL_Texture* img=getTexture(image); - float squareSize=MAX(canvasW,canvasH); + float squareSize=MAX(introMax.x-introMin.x,introMax.y-introMin.y); float uDiff=uvMax.x-uvMin.x; float vDiff=uvMax.y-uvMin.y; @@ -38,8 +38,8 @@ void FurnaceGUI::drawImage(ImDrawList* dl, FurnaceGUIImages image, const ImVec2& ); ImVec2 posAbs=ImLerp( - ImVec2((canvasW-squareSize)*0.5,(canvasH-squareSize)*0.5), - ImVec2((canvasW+squareSize)*0.5,(canvasH+squareSize)*0.5), + ImVec2(introMin.x+((introMax.x-introMin.x)-squareSize)*0.5,introMin.y+((introMax.y-introMin.y)-squareSize)*0.5), + ImVec2(introMin.x+((introMax.x-introMin.x)+squareSize)*0.5,introMin.y+((introMax.y-introMin.y)+squareSize)*0.5), pos ); @@ -70,31 +70,66 @@ void FurnaceGUI::drawImage(ImDrawList* dl, FurnaceGUIImages image, const ImVec2& dl->AddImageQuad(img,quad0,quad1,quad2,quad3,uv0,uv1,uv2,uv3,colorConverted); } -void FurnaceGUI::drawIntro() { - if (introPos<(shortIntro?1.0:9.0)) { - WAKE_UP; - nextWindow=GUI_WINDOW_NOTHING; - ImGui::SetNextWindowPos(ImVec2(0,0)); - ImGui::SetNextWindowSize(ImVec2(canvasW,canvasH)); - ImGui::SetNextWindowFocus(); - if (ImGui::Begin("Intro",NULL,ImGuiWindowFlags_NoMove|ImGuiWindowFlags_NoResize|ImGuiWindowFlags_NoDocking|ImGuiWindowFlags_NoTitleBar|ImGuiWindowFlags_NoBackground)) { - ImDrawList* dl=ImGui::GetForegroundDrawList(); - ImVec2 top=ImVec2(0.0f,0.0f); - ImVec2 bottom=ImVec2(canvasW,canvasH); +void FurnaceGUI::drawIntro(double introTime, bool monitor) { + if (monitor) { + if (introTime<0.0) introTime=0.0; + if (introTime>9.0) introTime=9.0; + if (!introMonOpen) return; + if (introPos<(shortIntro?1.0:9.0)) return; + } + if (introPos<(shortIntro?1.0:9.0) || monitor) { + if (!monitor) { + WAKE_UP; + nextWindow=GUI_WINDOW_NOTHING; + ImGui::SetNextWindowPos(ImVec2(0,0)); + ImGui::SetNextWindowSize(ImVec2(canvasW,canvasH)); + ImGui::SetNextWindowFocus(); + } + if (ImGui::Begin(monitor?"IntroMon X":"Intro",monitor?(&introMonOpen):NULL,monitor?globalWinFlags:(ImGuiWindowFlags_NoMove|ImGuiWindowFlags_NoResize|ImGuiWindowFlags_NoDocking|ImGuiWindowFlags_NoTitleBar|ImGuiWindowFlags_NoBackground))) { + if (monitor) { + if (ImGui::Button("Preview")) { + introPos=0; + tutorial.introPlayed=false; + shortIntro=false; + introSkipDo=false; + introSkip=0.0; + e->setOrder(0); + e->setRepeatPattern(false); + play(); + } + ImGui::SameLine(); + ImGui::TextColored(ImVec4(1.0,introTime<8.0?1.0:0.0,introTime<8.0?1.0:0.0,1.0),"%.2f",introTime); + ImGui::SameLine(); + ImGui::SetNextItemWidth(ImGui::GetContentRegionAvail().x); + ImGui::ProgressBar(introTime/9.0,ImVec2(-FLT_MIN,0),"##IntroP"); + } - if (shortIntro) { + ImDrawList* dl=monitor?ImGui::GetWindowDrawList():ImGui::GetForegroundDrawList(); + ImVec2 top=monitor?ImGui::GetCursorScreenPos():ImVec2(0.0f,0.0f); + ImVec2 bottom=monitor?ImGui::GetContentRegionAvail():ImVec2(canvasW,canvasH); + if (monitor) { + bottom.x+=top.x; + bottom.y+=top.y; + } + + introMin=top; + introMax=bottom; + + if (monitor) dl->PushClipRect(top,bottom); + + if (shortIntro && !monitor) { // background - float bgAlpha=CLAMP((1.0-introPos)*4.0,0.0,1.0); + float bgAlpha=CLAMP((1.0-introTime)*4.0,0.0,1.0); bgAlpha=3.0*pow(bgAlpha,2.0)-2.0*pow(bgAlpha,3.0); ImU32 bgColor=ImGui::GetColorU32(ImVec4(0.0f,0.0f,0.0f,bgAlpha)); dl->AddRectFilled(top,bottom,bgColor); - drawImage(dl,GUI_IMAGE_INTROBG,ImVec2(0.125,0.25-(introPos)*0.05),ImVec2(18.0,18.0),0.0,ImVec2(0.0,0.0),ImVec2(1.0,1.0),ImVec4(0.4,0.8,1.0,0.4*CLAMP(introPos*2.0,0.0,1.0)*bgAlpha)); - drawImage(dl,GUI_IMAGE_INTROBG,ImVec2(0.4,0.25-(introPos)*0.08),ImVec2(18.0,18.0),0.0,ImVec2(0.0,0.0),ImVec2(1.0,1.0),ImVec4(0.1,0.2,1.0,0.2*CLAMP(introPos*3.0,0.0,1.0)*bgAlpha)); - drawImage(dl,GUI_IMAGE_INTROBG,ImVec2(0.7,0.25-(introPos)*0.03),ImVec2(20.0,20.0),0.0,ImVec2(0.0,0.0),ImVec2(1.0,1.0),ImVec4(0.7,1.0,0.7,0.1*CLAMP(introPos*3.0,0.0,1.0)*bgAlpha)); + drawImage(dl,GUI_IMAGE_INTROBG,ImVec2(0.125,0.25-(introTime)*0.05),ImVec2(18.0,18.0),0.0,ImVec2(0.0,0.0),ImVec2(1.0,1.0),ImVec4(0.4,0.8,1.0,0.4*CLAMP(introTime*2.0,0.0,1.0)*bgAlpha)); + drawImage(dl,GUI_IMAGE_INTROBG,ImVec2(0.4,0.25-(introTime)*0.08),ImVec2(18.0,18.0),0.0,ImVec2(0.0,0.0),ImVec2(1.0,1.0),ImVec4(0.1,0.2,1.0,0.2*CLAMP(introTime*3.0,0.0,1.0)*bgAlpha)); + drawImage(dl,GUI_IMAGE_INTROBG,ImVec2(0.7,0.25-(introTime)*0.03),ImVec2(20.0,20.0),0.0,ImVec2(0.0,0.0),ImVec2(1.0,1.0),ImVec4(0.7,1.0,0.7,0.1*CLAMP(introTime*3.0,0.0,1.0)*bgAlpha)); - drawImage(dl,GUI_IMAGE_LOGO,ImVec2(0.5,0.5+pow(1.0-CLAMP(introPos*2.0,0.0,1.0),4.0)*0.125),ImVec2(0.67,0.67),0.0f,ImVec2(0.0,0.0),ImVec2(1.0,1.0),ImVec4(1.0,1.0,1.0,CLAMP(introPos*3.0,0.0,1.0)*bgAlpha)); + drawImage(dl,GUI_IMAGE_LOGO,ImVec2(0.5,0.5+pow(1.0-CLAMP(introTime*2.0,0.0,1.0),4.0)*0.125),ImVec2(0.67,0.67),0.0f,ImVec2(0.0,0.0),ImVec2(1.0,1.0),ImVec4(1.0,1.0,1.0,CLAMP(introTime*3.0,0.0,1.0)*bgAlpha)); } else { // preload textures getTexture(GUI_IMAGE_TALOGO); @@ -102,36 +137,43 @@ void FurnaceGUI::drawIntro() { getTexture(GUI_IMAGE_LOGO); getTexture(GUI_IMAGE_INTROBG,SDL_BLENDMODE_ADD); - if (introSkip<0.5) { + if (monitor) { + ImVec2 textPos=ImLerp(top,bottom,ImVec2(0.5,0.5)); + textPos.x-=ImGui::CalcTextSize("SORRY NOTHING").x*0.5; + textPos.y-=ImGui::CalcTextSize("SORRY NOTHING").y*0.5; + dl->AddText(textPos,ImGui::GetColorU32(uiColors[GUI_COLOR_TEXT]),"SORRY NOTHING"); + } + + if (introSkip<0.5 || monitor) { // background - float bgAlpha=CLAMP(9.0-introPos,0.0,1.0); + float bgAlpha=CLAMP(9.0-introTime,0.0,1.0); bgAlpha=3.0*pow(bgAlpha,2.0)-2.0*pow(bgAlpha,3.0); ImU32 bgColor=ImGui::GetColorU32(ImVec4(0.0f,0.0f,0.0f,bgAlpha)); dl->AddRectFilled(top,bottom,bgColor); // part 1 - talogo - if (introPos<2.3) { - drawImage(dl,GUI_IMAGE_TALOGO,ImVec2(0.5,0.5),ImVec2(0.67,0.67),0.0f,ImVec2(0.0,0.0),ImVec2(1.0,1.0),ImVec4(1.0,1.0,1.0,MAX(0.01,1.0-pow(MAX(0.0,1.0-introPos*2.0),3.0)))); + if (introTime<2.3) { + drawImage(dl,GUI_IMAGE_TALOGO,ImVec2(0.5,0.5),ImVec2(0.67,0.67),0.0f,ImVec2(0.0,0.0),ImVec2(1.0,1.0),ImVec4(1.0,1.0,1.0,MAX(0.01,1.0-pow(MAX(0.0,1.0-introTime*2.0),3.0)))); for (int i=0; i<16; i++) { - double chipCenter=0.22+pow(MAX(0.0,1.5-introPos*0.8-((double)i/36.0)),2.0)+pow(sin(-introPos*2.2-(double)i*0.44),24)*0.05; + double chipCenter=0.22+pow(MAX(0.0,1.5-introTime*0.8-((double)i/36.0)),2.0)+pow(sin(-introTime*2.2-(double)i*0.44),24)*0.05; ImVec2 chipPos=ImVec2( - 0.5+chipCenter*cos(2.0*M_PI*(double)i/16.0-pow(introPos,2.2)), - 0.5+chipCenter*sin(2.0*M_PI*(double)i/16.0-pow(introPos,2.2)) + 0.5+chipCenter*cos(2.0*M_PI*(double)i/16.0-pow(introTime,2.2)), + 0.5+chipCenter*sin(2.0*M_PI*(double)i/16.0-pow(introTime,2.2)) ); drawImage(dl,GUI_IMAGE_TACHIP,chipPos,ImVec2(0.25,0.25),0.0f,ImVec2(0.0,0.0),ImVec2(1.0,0.5),ImVec4(1.0,1.0,1.0,1.0)); } } // background after part 1 - if (introPos>2.3) { - float s1a=CLAMP((introPos-3.2)*1.3,0.0f,1.0f); - float s2a=CLAMP((introPos-4.5)*1.0,0.0f,1.0f); + if (introTime>2.3) { + float s1a=CLAMP((introTime-3.2)*1.3,0.0f,1.0f); + float s2a=CLAMP((introTime-4.5)*1.0,0.0f,1.0f); float addition=(3*pow(s1a,2)-2*pow(s1a,3)+(3*pow(s2a,2)-2*pow(s2a,3))*1.5)*3.5; - drawImage(dl,GUI_IMAGE_INTROBG,ImVec2(0.125,0.25-(introPos+addition)*0.05),ImVec2(18.0,18.0),0.0,ImVec2(0.0,0.0),ImVec2(1.0,1.0),ImVec4(0.4,0.1+0.7*s1a,1.0*s1a,0.5*bgAlpha)); - drawImage(dl,GUI_IMAGE_INTROBG,ImVec2(0.4,0.25-(introPos+addition)*0.08),ImVec2(18.0,18.0),0.0,ImVec2(0.0,0.0),ImVec2(1.0,1.0),ImVec4(0.5-0.4*s1a,0.8-0.6*s1a,1.0*s1a,0.6*bgAlpha)); - 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)); + drawImage(dl,GUI_IMAGE_INTROBG,ImVec2(0.125,0.25-(introTime+addition)*0.05),ImVec2(18.0,18.0),0.0,ImVec2(0.0,0.0),ImVec2(1.0,1.0),ImVec4(0.4,0.1+0.7*s1a,1.0*s1a,0.5*bgAlpha)); + drawImage(dl,GUI_IMAGE_INTROBG,ImVec2(0.4,0.25-(introTime+addition)*0.08),ImVec2(18.0,18.0),0.0,ImVec2(0.0,0.0),ImVec2(1.0,1.0),ImVec4(0.5-0.4*s1a,0.8-0.6*s1a,1.0*s1a,0.6*bgAlpha)); + drawImage(dl,GUI_IMAGE_INTROBG,ImVec2(0.7,0.25-(introTime+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[]={ @@ -143,7 +185,7 @@ void FurnaceGUI::drawIntro() { }; // part 2 - falling patterns - if (introPos>2.3 && introPos<4.5) { + if (introTime>2.3 && introTime<4.5) { for (int i=0; i<48; i++) { ImVec2 uv0=ImVec2( fallPatX[i&3], @@ -159,90 +201,102 @@ void FurnaceGUI::drawIntro() { uv1.y/=512.0; bool left=(i%6)>=3; - double t=(introPos-2.5)*(0.77+(cos(i+7)*0.05)); + double t=(introTime-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)); + drawImage(dl,GUI_IMAGE_PAT,ImVec2((left?0:1)+sin(cos(i*3.67))*0.35+((alteration+((introTime-2.3)*(0.08*(double)(1+(i&3)))))*(left?1.0:-1.0)),0.5+sin(i*6.74)*0.3-pow(CLAMP(introTime-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); + float transitionPos=CLAMP(introTime*4.0-8,-1.5,3.5); dl->AddQuadFilled( ImVec2( - (transitionPos-1.5)*canvasW, - 0.0 + top.x+(transitionPos-1.5)*(bottom.x-top.x), + top.y ), ImVec2( - (transitionPos)*canvasW, - 0.0 + top.x+(transitionPos)*(bottom.x-top.x), + top.y ), ImVec2( - (transitionPos-0.2)*canvasW, - canvasH + top.x+(transitionPos-0.2)*(bottom.x-top.x), + bottom.y ), ImVec2( - (transitionPos-1.7)*canvasW, - canvasH + top.x+(transitionPos-1.7)*(bottom.x-top.x), + bottom.y ), ImGui::GetColorU32(ImVec4(0.35,0.4,0.5,1.0)) ); // part 3 - falling chips - if (introPos>3.0 && introPos<6.0) { + if (introTime>3.0 && introTime<6.0) { for (int i=0; i<40; i++) { - float blah=(introPos-4.25)*1.3; + float blah=(introTime-4.25)*1.3; ImVec2 chipPos=ImVec2( 0.5+sin(i)*0.4, - 0.1-(1.1*pow(blah,2.0)-1.3*pow(blah,2.0)+pow(blah,5.0))+i*0.02+((introPos-3.75)*1.3*(fabs(sin(i*1.3))*0.28)) + 0.1-(1.1*pow(blah,2.0)-1.3*pow(blah,2.0)+pow(blah,5.0))+i*0.02+((introTime-3.75)*1.3*(fabs(sin(i*1.3))*0.28)) ); drawImage(dl,GUI_IMAGE_TACHIP,chipPos,ImVec2(0.33,0.33),0.5*M_PI,ImVec2(0.0,0.0),ImVec2(1.0,0.5),ImVec4(1.0,1.0,1.0,1.0)); } } // part 4 - logo end - if (introPos>5.0) { + if (introTime>5.0) { drawImage( dl, GUI_IMAGE_WORDMARK, - ImVec2(0.36+0.3*(1.0-pow(1.0-CLAMP(introPos-6.0,0.0,1.0),6.0)),0.5+pow(1.0-CLAMP(introPos-5.0,0.0,1.0),4.0)), + ImVec2(0.36+0.3*(1.0-pow(1.0-CLAMP(introTime-6.0,0.0,1.0),6.0)),0.5+pow(1.0-CLAMP(introTime-5.0,0.0,1.0),4.0)), ImVec2(1.0,1.0), 0.0f, - ImVec2(pow(1.0-CLAMP(introPos-6.0,0.0,1.0),8.0),0.0), + ImVec2(pow(1.0-CLAMP(introTime-6.0,0.0,1.0),8.0),0.0), ImVec2(1.0,1.0), ImVec4(1.0,1.0,1.0,bgAlpha) ); - drawImage(dl,GUI_IMAGE_LOGO,ImVec2(0.5-0.25*(1.0-pow(1.0-CLAMP(introPos-6.0,0.0,1.0),6.0)),0.5+pow(1.0-CLAMP(introPos-5.0,0.0,1.0),4.0)),ImVec2(0.67,0.67),0.0f,ImVec2(0.0,0.0),ImVec2(1.0,1.0),ImVec4(1.0,1.0,1.0,bgAlpha)); + drawImage(dl,GUI_IMAGE_LOGO,ImVec2(0.5-0.25*(1.0-pow(1.0-CLAMP(introTime-6.0,0.0,1.0),6.0)),0.5+pow(1.0-CLAMP(introTime-5.0,0.0,1.0),4.0)),ImVec2(0.67,0.67),0.0f,ImVec2(0.0,0.0),ImVec2(1.0,1.0),ImVec4(1.0,1.0,1.0,bgAlpha)); } } // intro skip fade - if (introSkipDo) { - introSkip+=ImGui::GetIO().DeltaTime; - if (introSkip>=0.5) { - introPos=0.1; - if (introSkip>=0.75) introPos=9.1; + if (!monitor) { + if (introSkipDo) { + introSkip+=ImGui::GetIO().DeltaTime; + if (introSkip>=0.5) { + introPos=0.1; + if (e->isPlaying()) stop(); + if (introSkip>=0.75) introPos=9.1; + } + } else { + introSkip-=ImGui::GetIO().DeltaTime*4.0f; + if (introSkip<0.0) introSkip=0.0; } - } else { - introSkip-=ImGui::GetIO().DeltaTime*4.0f; - if (introSkip<0.0) introSkip=0.0; - } - dl->AddRectFilled(top,bottom,ImGui::GetColorU32(ImVec4(0.0,0.0,0.0,CLAMP(introSkip*2.0,0.0,1.0)-CLAMP((introSkip-0.5)*4,0.0,1.0)))); - if (introSkip<0.5) dl->AddText(ImVec2(8.0*dpiScale,8.0*dpiScale),ImGui::GetColorU32(ImVec4(1.0,1.0,1.0,CLAMP(introSkip*8.0,0.0,1.0))),"hold to skip"); + dl->AddRectFilled(top,bottom,ImGui::GetColorU32(ImVec4(0.0,0.0,0.0,CLAMP(introSkip*2.0,0.0,1.0)-CLAMP((introSkip-0.5)*4,0.0,1.0)))); + if (introSkip<0.5) dl->AddText(ImVec2(8.0*dpiScale,8.0*dpiScale),ImGui::GetColorU32(ImVec4(1.0,1.0,1.0,CLAMP(introSkip*8.0,0.0,1.0))),"hold to skip"); + } } + if (monitor) dl->PopClipRect(); + // workaround to texture issue - dl->AddText(ImVec2(canvasW-1,canvasH-1),ImGui::ColorConvertFloat4ToU32(ImVec4(0.0,0.0,0.1,0.01)),"A"); + dl->AddText(ImVec2(bottom.x-1,bottom.y-1),ImGui::ColorConvertFloat4ToU32(ImVec4(0.0,0.0,0.1,0.01)),"A"); } ImGui::End(); - if (mustClear<=0) { + if (mustClear<=0 && !monitor) { introPos+=ImGui::GetIO().DeltaTime; + if (e->isPlaying() && introPos>=8.0) { + stop(); + } if (introPos>=(shortIntro?1.0:9.0)) { introPos=10.0; tutorial.introPlayed=true; commitTutorial(); + if (!teWarn) { + showWarning("welcome to Furnace Tournament Edition!\n\nthis version of Furnace is specifically designed for the\nIntro Tune Contest of February 2023.\n\ngo to window > IntroMon X to enable something that will be\nuseful during the making of your intro tune!\nsee the #intro-tune-contest channel in the Furnace Discord for more info.",GUI_WARN_GENERIC); + teWarn=true; + } } } }