add compile option to disable the intro

saves around 500KB-1MB
This commit is contained in:
tildearrow 2025-06-10 17:17:18 -05:00
parent e923b108d9
commit 9e7ed049a1
7 changed files with 41 additions and 10 deletions

View file

@ -139,6 +139,7 @@ option(SHOW_OPEN_ASSETS_MENU_ENTRY "Show option to open built-in assets director
option(CONSOLE_SUBSYSTEM "Build Furnace with Console subsystem on Windows" OFF) option(CONSOLE_SUBSYSTEM "Build Furnace with Console subsystem on Windows" OFF)
option(FORCE_CODEVIEW "Force -gcodeview on MinGW GCC" OFF) option(FORCE_CODEVIEW "Force -gcodeview on MinGW GCC" OFF)
option(FLATPAK_WORKAROUNDS "Enable Flatpak-specific workaround for system file picker" OFF) option(FLATPAK_WORKAROUNDS "Enable Flatpak-specific workaround for system file picker" OFF)
option(NO_INTRO "Disable intro animation entirely" OFF)
if (APPLE) if (APPLE)
option(FORCE_APPLE_BIN "Force enable binary installation to /bin" OFF) option(FORCE_APPLE_BIN "Force enable binary installation to /bin" OFF)
option(MAKE_BUNDLE "Make a bundle" OFF) option(MAKE_BUNDLE "Make a bundle" OFF)
@ -879,12 +880,6 @@ src/gui/fonts.cpp
src/gui/fontzlib.cpp src/gui/fontzlib.cpp
src/gui/image_icon.cpp src/gui/image_icon.cpp
src/gui/image_talogo.cpp
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/image.cpp
src/gui/debug.cpp src/gui/debug.cpp
@ -893,8 +888,6 @@ src/gui/fileDialog.cpp
src/gui/intConst.cpp src/gui/intConst.cpp
src/gui/guiConst.cpp src/gui/guiConst.cpp
src/gui/introTune.cpp
src/gui/about.cpp src/gui/about.cpp
src/gui/channels.cpp src/gui/channels.cpp
src/gui/chanOsc.cpp src/gui/chanOsc.cpp
@ -914,7 +907,6 @@ src/gui/fmPreview.cpp
src/gui/gradient.cpp src/gui/gradient.cpp
src/gui/grooves.cpp src/gui/grooves.cpp
src/gui/insEdit.cpp src/gui/insEdit.cpp
src/gui/intro.cpp
src/gui/log.cpp src/gui/log.cpp
src/gui/memory.cpp src/gui/memory.cpp
src/gui/mixer.cpp src/gui/mixer.cpp
@ -951,6 +943,21 @@ src/gui/xyOsc.cpp
src/gui/gui.cpp src/gui/gui.cpp
) )
if (NOT NO_INTRO)
list(APPEND GUI_SOURCES src/gui/introTune.cpp)
list(APPEND GUI_SOURCES src/gui/intro.cpp)
list(APPEND GUI_SOURCES
src/gui/image_talogo.cpp
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
)
else()
list(APPEND DEPENDENCIES_DEFINES NO_INTRO)
endif()
if (WIN32 AND NOT SUPPORT_XP) if (WIN32 AND NOT SUPPORT_XP)
list(APPEND GUI_SOURCES extern/nfd-modified/src/nfd_common.cpp) list(APPEND GUI_SOURCES extern/nfd-modified/src/nfd_common.cpp)
list(APPEND GUI_SOURCES extern/nfd-modified/src/nfd_win.cpp) list(APPEND GUI_SOURCES extern/nfd-modified/src/nfd_win.cpp)

View file

@ -16,7 +16,7 @@ fi
cd xpbuild cd xpbuild
# TODO: potential Arch-ism? # TODO: potential Arch-ism?
i686-w64-mingw32-cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_C_FLAGS="-O2" -DCMAKE_CXX_FLAGS="-O2 -Wall -Wextra -Wno-unused-parameter -Wno-cast-function-type" -DBUILD_SHARED_LIBS=OFF -DSUPPORT_XP=ON -DWITH_RENDER_DX11=OFF -DSDL_SSE=OFF -DSDL_SSE2=OFF -DSDL_SSE3=OFF -DENABLE_SSE=OFF -DENABLE_SSE2=OFF -DENABLE_AVX=OFF -DENABLE_AVX2=OFF -DUSE_BACKWARD=OFF -DCONSOLE_SUBSYSTEM=OFF -DWITH_LOCALE=ON -DUSE_MOMO=ON -DFORCE_CODEVIEW=OFF .. || exit 1 i686-w64-mingw32-cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_C_FLAGS="-O2" -DCMAKE_CXX_FLAGS="-O2 -Wall -Wextra -Wno-unused-parameter -Wno-cast-function-type" -DBUILD_SHARED_LIBS=OFF -DSUPPORT_XP=ON -DWITH_RENDER_DX11=OFF -DSDL_SSE=OFF -DSDL_SSE2=OFF -DSDL_SSE3=OFF -DENABLE_SSE=OFF -DENABLE_SSE2=OFF -DENABLE_AVX=OFF -DENABLE_AVX2=OFF -DUSE_BACKWARD=OFF -DCONSOLE_SUBSYSTEM=OFF -DWITH_LOCALE=ON -DUSE_MOMO=ON -DFORCE_CODEVIEW=OFF -DNO_INTRO=ON .. || exit 1
make -j8 || exit 1 make -j8 || exit 1
cd .. cd ..

View file

@ -3720,7 +3720,9 @@ bool FurnaceGUI::loop() {
DECLARE_METRIC(grooves) DECLARE_METRIC(grooves)
DECLARE_METRIC(songInfo) DECLARE_METRIC(songInfo)
DECLARE_METRIC(orders) DECLARE_METRIC(orders)
#ifndef NO_INTRO
DECLARE_METRIC(intro) DECLARE_METRIC(intro)
#endif
DECLARE_METRIC(sampleList) DECLARE_METRIC(sampleList)
DECLARE_METRIC(sampleEdit) DECLARE_METRIC(sampleEdit)
DECLARE_METRIC(waveList) DECLARE_METRIC(waveList)
@ -4210,6 +4212,7 @@ bool FurnaceGUI::loop() {
continue; continue;
} }
#ifndef NO_INTRO
if (firstFrame && !safeMode && renderBackend!=GUI_BACKEND_SOFTWARE) { if (firstFrame && !safeMode && renderBackend!=GUI_BACKEND_SOFTWARE) {
if (!tutorial.introPlayed || settings.alwaysPlayIntro==3 || (settings.alwaysPlayIntro==2 && curFileName.empty())) { if (!tutorial.introPlayed || settings.alwaysPlayIntro==3 || (settings.alwaysPlayIntro==2 && curFileName.empty())) {
unsigned char* introTemp=new unsigned char[intro_fur_len]; unsigned char* introTemp=new unsigned char[intro_fur_len];
@ -4217,6 +4220,7 @@ bool FurnaceGUI::loop() {
e->load(introTemp,intro_fur_len); e->load(introTemp,intro_fur_len);
} }
} }
#endif
if (!e->isRunning()) { if (!e->isRunning()) {
activeNotes.clear(); activeNotes.clear();
@ -7108,6 +7112,9 @@ bool FurnaceGUI::loop() {
MEASURE_END(popup); MEASURE_END(popup);
#ifdef NO_INTRO
introPos=12.0;
#else
if ((!tutorial.introPlayed || settings.alwaysPlayIntro!=0) && renderBackend!=GUI_BACKEND_SOFTWARE) { if ((!tutorial.introPlayed || settings.alwaysPlayIntro!=0) && renderBackend!=GUI_BACKEND_SOFTWARE) {
MEASURE_BEGIN(intro); MEASURE_BEGIN(intro);
initialScreenWipe=0; initialScreenWipe=0;
@ -7119,6 +7126,7 @@ bool FurnaceGUI::loop() {
} else { } else {
introPos=12.0; introPos=12.0;
} }
#endif
#ifdef DIV_UNSTABLE #ifdef DIV_UNSTABLE
{ {

View file

@ -28,22 +28,32 @@
const unsigned char* imageData[GUI_IMAGE_MAX]={ const unsigned char* imageData[GUI_IMAGE_MAX]={
image_icon_data, image_icon_data,
#ifdef NO_INTRO
NULL, NULL, NULL,
NULL, NULL, NULL
#else
image_talogo_data, image_talogo_data,
image_tachip_data, image_tachip_data,
image_logo_data, image_logo_data,
image_wordmark_data, image_wordmark_data,
image_introbg_data, image_introbg_data,
image_pat_data image_pat_data
#endif
}; };
const unsigned int imageLen[GUI_IMAGE_MAX]={ const unsigned int imageLen[GUI_IMAGE_MAX]={
image_icon_size, image_icon_size,
#ifdef NO_INTRO
0, 0, 0,
0, 0, 0
#else
image_talogo_size, image_talogo_size,
image_tachip_size, image_tachip_size,
image_logo_size, image_logo_size,
image_wordmark_size, image_wordmark_size,
image_introbg_size, image_introbg_size,
image_pat_size image_pat_size
#endif
}; };
FurnaceGUITexture* FurnaceGUI::getTexture(FurnaceGUIImages image, FurnaceGUIBlendMode blendMode) { FurnaceGUITexture* FurnaceGUI::getTexture(FurnaceGUIImages image, FurnaceGUIBlendMode blendMode) {

View file

@ -22,6 +22,7 @@
extern const unsigned char image_icon_data[]; extern const unsigned char image_icon_data[];
extern const unsigned int image_icon_size; extern const unsigned int image_icon_size;
#ifndef NO_INTRO
extern const unsigned char image_talogo_data[]; extern const unsigned char image_talogo_data[];
extern const unsigned int image_talogo_size; extern const unsigned int image_talogo_size;
@ -40,3 +41,4 @@ extern const unsigned int image_introbg_size;
extern const unsigned char image_pat_data[]; extern const unsigned char image_pat_data[];
extern const unsigned int image_pat_size; extern const unsigned int image_pat_size;
#endif #endif
#endif

View file

@ -20,7 +20,9 @@
#ifndef _INTRO_TUNE_H #ifndef _INTRO_TUNE_H
#define _INTRO_TUNE_H #define _INTRO_TUNE_H
#ifndef NO_INTRO
extern const unsigned char intro_fur[]; extern const unsigned char intro_fur[];
extern const unsigned int intro_fur_len; extern const unsigned int intro_fur_len;
#endif
#endif #endif

View file

@ -1167,6 +1167,7 @@ void FurnaceGUI::drawSettings() {
// SUBSECTION START-UP // SUBSECTION START-UP
CONFIG_SUBSECTION(_("Start-up")); CONFIG_SUBSECTION(_("Start-up"));
#ifndef NO_INTRO
ImGui::Text(_("Play intro on start-up:")); ImGui::Text(_("Play intro on start-up:"));
ImGui::Indent(); ImGui::Indent();
if (ImGui::RadioButton(_("No##pis0"),settings.alwaysPlayIntro==0)) { if (ImGui::RadioButton(_("No##pis0"),settings.alwaysPlayIntro==0)) {
@ -1186,6 +1187,7 @@ void FurnaceGUI::drawSettings() {
settingsChanged=true; settingsChanged=true;
} }
ImGui::Unindent(); ImGui::Unindent();
#endif
bool disableFadeInB=settings.disableFadeIn; bool disableFadeInB=settings.disableFadeIn;
if (ImGui::Checkbox(_("Disable fade-in during start-up"),&disableFadeInB)) { if (ImGui::Checkbox(_("Disable fade-in during start-up"),&disableFadeInB)) {