furnace/src/gui/about.cpp

304 lines
9.9 KiB
C++
Raw Normal View History

/**
* Furnace Tracker - multi-system chiptune tracker
2024-01-16 21:26:57 -05:00
* Copyright (C) 2021-2024 tildearrow and contributors
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
2022-03-21 18:38:11 -04:00
#define _USE_MATH_DEFINES
#include "gui.h"
2022-03-21 18:38:11 -04:00
#include <math.h>
const char* aboutLine[]={
"tildearrow",
2024-05-28 16:15:56 -04:00
_N("is proud to present"),
"",
("Furnace " DIV_VERSION),
"",
2024-05-28 16:15:56 -04:00
_N("the biggest multi-system chiptune tracker!"),
_N("featuring DefleMask song compatibility."),
"",
2024-05-28 16:15:56 -04:00
_N("> CREDITS <"),
"",
2024-05-28 16:15:56 -04:00
_N("-- program --"),
"tildearrow",
2024-05-28 16:15:56 -04:00
_N("A M 4 N (intro tune)"),
2024-08-24 04:08:46 -04:00
"Adam Lederer",
"akumanatt",
2024-09-30 04:37:22 -04:00
"asiekierka",
"cam900",
"djtuBIG-MaliceX",
2023-09-06 19:30:09 -04:00
"Eknous",
2024-01-17 00:39:27 -05:00
"Kagamiin~",
"laoo",
"LTVA",
2023-07-07 16:01:19 -04:00
"MooingLemur",
2022-04-12 05:36:45 -04:00
"OPNA2608",
2024-01-25 13:33:22 -05:00
"scratchminer",
"superctr",
2022-10-12 16:14:28 -04:00
"System64",
2024-04-23 16:04:38 -04:00
"techmetx11",
"",
2024-05-28 16:15:56 -04:00
_N("-- graphics/UI design --"),
"tildearrow",
"BlastBrothers",
2023-08-14 21:02:48 -04:00
"Electric Keet",
2022-06-18 03:00:10 -04:00
"Mahbod Karamoozian",
"Raijin",
"",
2024-05-28 16:15:56 -04:00
_N("-- documentation --"),
2023-09-24 18:56:33 -04:00
"brickblock369",
"cam900",
2023-09-24 18:56:33 -04:00
"DeMOSic",
2023-07-07 16:01:19 -04:00
"Electric Keet",
2023-09-24 18:56:33 -04:00
"freq-mod",
"host12prog",
"Lunathir",
"tildearrow",
"",
_N("-- localization/translation team --"),
2024-06-14 04:10:19 -04:00
"Bahasa Indonesia: ZoomTen (Zumi)",
2024-06-13 17:40:32 -04:00
"Español: CrimsonZN, ThaCuber, tildearrow",
"Հայերեն: Eknous",
2024-06-05 04:17:10 -04:00
"한국어: Heemin, leejh20",
"Nederlands: Lunathir",
"Polski: freq-mod, PoznańskiSzybkowiec",
"Português (Brasil): Kagamiin~",
"Русский: Background2982, LTVA",
"Slovenčina: Wegfrei",
"Svenska: RevvoBolt",
"ไทย: akumanatt",
"",
2024-05-28 16:15:56 -04:00
_N("-- additional feedback/fixes --"),
2023-07-30 05:34:24 -04:00
"Electric Keet",
"fd",
2022-04-13 01:37:48 -04:00
"GENATARi",
2022-07-23 22:19:43 -04:00
"host12prog",
"jvsTSX",
2022-11-05 20:27:46 -04:00
"Lumigado",
2022-09-11 06:14:15 -04:00
"Lunathir",
"plane",
"TheEssem",
"",
2024-05-28 16:15:56 -04:00
_N("-- Metal backend test team --"),
2024-04-17 18:20:08 -04:00
"Diggo",
"konard",
"NaxeCode",
"scratchminer",
"",
2024-05-28 16:15:56 -04:00
_N("-- DirectX 9 backend test team --"),
"EpicTyphlosion",
"Lunathir",
"Mr. Hassium",
"wbcbz7",
"Yuzu4K",
2024-04-17 18:20:08 -04:00
"",
2024-05-28 16:15:56 -04:00
_N("powered by:"),
_N("Dear ImGui by Omar Cornut"),
_N("SDL2 by Sam Lantinga"),
#ifdef HAVE_FREETYPE
"FreeType",
#endif
2024-05-28 16:15:56 -04:00
_N("zlib by Jean-loup Gailly"),
_N("and Mark Adler"),
_N("libsndfile by Erik de Castro Lopo"),
_N("Portable File Dialogs by Sam Hocevar"),
_N("Native File Dialog by Frogtoss Games"),
2023-08-30 18:38:45 -04:00
"PortAudio",
2024-05-28 16:15:56 -04:00
_N("Weak-JACK by x42"),
_N("RtMidi by Gary P. Scavone"),
_N("FFTW by Matteo Frigo and Steven G. Johnson"),
_N("backward-cpp by Google"),
_N("adpcm by superctr"),
_N("adpcm-xq by David Bryant"),
_N("Nuked-OPL3/OPLL/OPM/OPN2/PSG by nukeykt"),
_N("YM3812-LLE, YMF262-LLE, YMF276-LLE and YM2608-LLE by nukeykt"),
_N("ESFMu (modified version) by Kagamiin~"),
_N("ymfm by Aaron Giles"),
_N("emu2413 by Digital Sound Antiques"),
_N("MAME SN76496 by Nicola Salmoria"),
_N("MAME AY-3-8910 by Couriersud"),
_N("with AY8930 fixes by Eulous, cam900 and Grauw"),
_N("MAME SAA1099 by Juergen Buchmueller and Manuel Abadia"),
_N("MAME Namco WSG by Nicola Salmoria and Aaron Giles"),
_N("MAME RF5C68 core by Olivier Galibert and Aaron Giles"),
_N("MAME MSM5232 core by Jarek Burczynski and Hiromitsu Shioya"),
_N("MAME MSM6258 core by Barry Rodewald"),
_N("MAME YMZ280B core by Aaron Giles"),
_N("MAME GA20 core by Acho A. Tang and R. Belmont"),
_N("MAME SegaPCM core by Hiromitsu Shioya and Olivier Galibert"),
_N("SAASound by Dave Hooper and Simon Owen"),
_N("SameBoy by Lior Halphon"),
_N("Mednafen PCE, WonderSwan, T6W28 and Virtual Boy audio cores"),
_N("SNES DSP core by Blargg"),
_N("puNES (NES, MMC5 and FDS) by FHorse"),
_N("NSFPlay (NES and FDS) by Brad Smith and Brezza"),
_N("reSID by Dag Lem"),
_N("reSIDfp by Dag Lem, Antti Lankila"),
_N("and Leandro Nini"),
_N("dSID by DefleMask Team based on jsSID"),
_N("Stella by Stella Team"),
_N("QSound emulator by superctr and Valley Bell"),
_N("VICE VIC-20 sound core by Rami Rasanen and viznut"),
_N("VICE TED sound core by Andreas Boose, Tibor Biczo"),
_N("and Marco van den Heuvel"),
_N("VERA sound core by Frank van den Hoef"),
_N("mzpokeysnd POKEY emulator by Michael Borisov"),
_N("ASAP POKEY emulator by Piotr Fusik"),
_N("ported by laoo to C++"),
_N("vgsound_emu (second version, modified version) by cam900"),
2024-06-23 20:38:03 -04:00
_N("Impulse Tracker GUS volume table by Jeffrey Lim"),
_N("Schism Tracker IT sample decompression"),
2024-05-28 16:15:56 -04:00
_N("SM8521 emulator (modified version) by cam900"),
_N("D65010G031 emulator (modified version) by cam900"),
_N("Namco C140/C219 emulator (modified version) by cam900"),
_N("PowerNoise emulator by scratchminer"),
_N("ep128emu by Istvan Varga"),
_N("NDS sound emulator by cam900"),
2024-07-13 00:18:17 -04:00
_N("openMSX YMF278 emulator (modified version) by the openMSX developers"),
_N("SID2 emulator by LTVA (modification of reSID emulator)"),
_N("SID3 emulator by LTVA"),
"",
2024-05-28 16:15:56 -04:00
_N("greetings to:"),
2024-08-24 17:43:15 -04:00
"floxy!",
2022-06-18 03:00:10 -04:00
"NEOART Costa Rica",
2023-08-27 05:14:50 -04:00
"Xenium Demoparty",
2024-06-15 15:28:04 -04:00
"@party",
2024-05-28 16:15:56 -04:00
_N("all members of Deflers of Noice!"),
"",
2024-05-28 16:15:56 -04:00
_N("copyright © 2021-2024 tildearrow"),
_N("(and contributors)."),
_N("licensed under GPLv2+! see"),
_N("LICENSE for more information."),
"",
2024-05-28 16:15:56 -04:00
_N("help Furnace grow:"),
"https://github.com/tildearrow/furnace",
"",
2024-05-28 16:15:56 -04:00
_N("contact tildearrow at:"),
"https://tildearrow.org/?p=contact",
"",
2024-05-28 16:15:56 -04:00
_N("disclaimer:"),
_N("despite the fact this program works"),
_N("with the .dmf file format, it is NOT"),
_N("affiliated with Delek or DefleMask in"),
_N("any way, nor it is a replacement for"),
_N("the original program."),
"",
2024-05-28 16:15:56 -04:00
_N("it also comes with ABSOLUTELY NO WARRANTY."),
"",
2024-05-28 16:15:56 -04:00
_N("thanks to all contributors/bug reporters!")
};
const size_t aboutCount=sizeof(aboutLine)/sizeof(aboutLine[0]);
void FurnaceGUI::drawAbout() {
// do stuff
2024-05-27 18:53:46 -04:00
if (ImGui::Begin("About Furnace",NULL,ImGuiWindowFlags_Modal|ImGuiWindowFlags_NoMove|ImGuiWindowFlags_NoResize|ImGuiWindowFlags_NoDocking|ImGuiWindowFlags_NoTitleBar,_("About Furnace"))) {
ImGui::SetWindowPos(ImVec2(0,0));
ImGui::SetWindowSize(ImVec2(canvasW,canvasH));
ImGui::PushFont(bigFont);
ImDrawList* dl=ImGui::GetWindowDrawList();
float r=0;
float g=0;
float b=0;
2024-09-22 14:55:44 -04:00
float peakMix=0.3;
ImGui::ColorConvertHSVtoRGB(aboutHue,1.0,0.475,r,g,b);
dl->AddRectFilled(ImVec2(0,0),ImVec2(canvasW,canvasH),0xff000000);
bool skip=false;
bool skip2=false;
for (int i=(-80-sin(double(aboutSin)*2*M_PI/120.0)*80.0)*2*dpiScale; i<canvasW; i+=160*dpiScale) {
skip2=!skip2;
skip=skip2;
for (int j=(-80-cos(double(aboutSin)*2*M_PI/150.0)*80.0)*2*dpiScale; j<canvasH; j+=160*dpiScale) {
skip=!skip;
if (skip) continue;
dl->AddRectFilled(ImVec2(i,j),ImVec2(i+160*dpiScale,j+160*dpiScale),ImGui::GetColorU32(ImVec4(r*0.25,g*0.25,b*0.25,1.0)));
}
}
skip=false;
skip2=false;
for (int i=(-80-cos(double(aboutSin)*2*M_PI/120.0)*80.0)*2*dpiScale; i<canvasW; i+=160*dpiScale) {
skip2=!skip2;
skip=skip2;
for (int j=(-80-sin(double(aboutSin)*2*M_PI/150.0)*80.0)*2*dpiScale; j<canvasH; j+=160*dpiScale) {
skip=!skip;
if (skip) continue;
dl->AddRectFilled(ImVec2(i,j),ImVec2(i+160*dpiScale,j+160*dpiScale),ImGui::GetColorU32(ImVec4(r*0.5,g*0.5,b*0.5,1.0)));
}
}
skip=false;
skip2=false;
for (int i=(-160+fmod(aboutSin*2,160))*2*dpiScale; i<canvasW; i+=160*dpiScale) {
skip2=!skip2;
skip=skip2;
for (int j=(-240-cos(double(aboutSin*M_PI/300.0))*240.0)*2*dpiScale; j<canvasH; j+=160*dpiScale) {
skip=!skip;
if (skip) continue;
dl->AddRectFilled(ImVec2(i,j),ImVec2(i+160*dpiScale,j+160*dpiScale),ImGui::GetColorU32(ImVec4(r*0.75,g*0.75,b*0.75,1.0)));
}
}
for (size_t i=0; i<aboutCount; i++) {
// don't localize tildearrow, the version or an empty line
const char* nextLine=(i==0 || i==3 || aboutLine[i][0]==0)?aboutLine[i]:_(aboutLine[i]);
double posX=(canvasW/2.0)+(sin(double(i)*0.5+double(aboutScroll)/(90.0*dpiScale))*120*dpiScale)-(ImGui::CalcTextSize(nextLine).x*0.5);
double posY=(canvasH-aboutScroll+42*i*dpiScale);
if (posY<-80*dpiScale || posY>canvasH) continue;
dl->AddText(bigFont,bigFont->FontSize,
ImVec2(posX+dpiScale,posY+dpiScale),
0xff000000,nextLine);
dl->AddText(bigFont,bigFont->FontSize,
ImVec2(posX+dpiScale,posY-dpiScale),
0xff000000,nextLine);
dl->AddText(bigFont,bigFont->FontSize,
ImVec2(posX-dpiScale,posY+dpiScale),
0xff000000,nextLine);
dl->AddText(bigFont,bigFont->FontSize,
ImVec2(posX-dpiScale,posY-dpiScale),
0xff000000,nextLine);
dl->AddText(bigFont,bigFont->FontSize,
ImVec2(posX,posY),
0xffffffff,nextLine);
}
ImGui::PopFont();
float timeScale=60.0f*ImGui::GetIO().DeltaTime;
aboutHue+=(0.001+peakMix*0.004)*timeScale;
aboutScroll+=(2+(peakMix>0.78)*3)*timeScale*dpiScale;
aboutSin+=(1+(peakMix>0.75)*2)*timeScale;
while (aboutHue>1) aboutHue--;
while (aboutSin>=2400) aboutSin-=2400;
if (aboutScroll>(42*dpiScale*aboutCount+canvasH)) aboutScroll=-20*dpiScale;
if (ImGui::IsKeyPressed(ImGuiKey_Space)) {
2024-04-01 00:35:59 -04:00
aboutOpen=false;
if (modified) {
2024-05-28 16:15:56 -04:00
showWarning(_("Unsaved changes! Save changes before playing?"),GUI_WARN_CV);
2024-04-01 00:35:59 -04:00
} else {
cvOpen=true;
cvNotSerious=true;
}
}
WAKE_UP;
}
if (ImGui::IsWindowFocused(ImGuiFocusedFlags_ChildWindows)) curWindow=GUI_WINDOW_ABOUT;
ImGui::End();
2022-03-21 18:38:11 -04:00
}