Debian Codegraph @

src/gui/about.cpp

raw
1 /**
2 * Furnace Tracker - multi-system chiptune tracker
3 * Copyright (C) 2021-2025 tildearrow and contributors
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License along
16 * with this program; if not, write to the Free Software Foundation, Inc.,
17 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
18 */
19
20 #define _USE_MATH_DEFINES
21 #include "gui.h"
22 #include <math.h>
23
24 const char* aboutLine[]={
25 "tildearrow",
26 _N("is proud to present"),
27 "",
28 ("Furnace " DIV_VERSION),
29 "",
30 _N("the biggest multi-system chiptune tracker!"),
31 _N("featuring DefleMask song compatibility."),
32 "",
33 _N("> CREDITS <"),
34 "",
35 _N("-- program --"),
36 "tildearrow",
37 _N("A M 4 N (intro tune)"),
38 "AArt1256",
39 "Adam Lederer",
40 "akumanatt",
41 "asiekierka",
42 "cam900",
43 "djtuBIG-MaliceX",
44 "Eknous",
45 "host12prog",
46 "Kagamiin~",
47 "laoo",
48 "LTVA",
49 "MooingLemur",
50 "OPNA2608",
51 "scratchminer",
52 "superctr",
53 "System64",
54 "techmetx11",
55 "",
56 _N("-- graphics/UI design --"),
57 "tildearrow",
58 "BlastBrothers",
59 "Electric Keet",
60 "Mahbod Karamoozian",
61 "Raijin",
62 "",
63 _N("-- documentation --"),
64 "brickblock369",
65 "cam900",
66 "DeMOSic",
67 "Electric Keet",
68 "freq-mod",
69 "host12prog",
70 "Lunathir",
71 "tildearrow",
72 "",
73 _N("-- localization/translation team --"),
74 "Bahasa Indonesia: ZoomTen (Zumi)",
75 "Español: CrimsonZN, ThaCuber, tildearrow",
76 "Français: fouinne44",
77 "Հայերեն: Eknous",
78 "한국어: Heemin, leejh20, Nicknamé",
79 "Nederlands: Lunathir",
80 "Polski: freq-mod, PoznańskiSzybkowiec",
81 "Português (Brasil): Kagamiin~",
82 "Русский: Background2982, LTVA",
83 "Slovenčina: Wegfrei",
84 "Svenska: RevvoBolt",
85 "ไทย: akumanatt",
86 "",
87 _N("-- additional feedback/fixes --"),
88 "Electric Keet",
89 "fd",
90 "GENATARi",
91 "host12prog",
92 "jvsTSX",
93 "Lumigado",
94 "Lunathir",
95 "plane",
96 "skyfloogle",
97 "TheEssem",
98 "",
99 _N("-- Metal backend test team --"),
100 "Diggo",
101 "konard",
102 "NaxeCode",
103 "scratchminer",
104 "",
105 _N("-- DirectX 9 backend test team --"),
106 "EpicTyphlosion",
107 "Lunathir",
108 "Mr. Hassium",
109 "wbcbz7",
110 "Yuzu4K",
111 "",
112 _N("powered by:"),
113 _N("Dear ImGui by Omar Cornut"),
114 _N("SDL2 by Sam Lantinga"),
115 #ifdef HAVE_FREETYPE
116 "FreeType",
117 #endif
118 _N("zlib by Jean-loup Gailly"),
119 _N("and Mark Adler"),
120 _N("libsndfile by Erik de Castro Lopo"),
121 _N("Portable File Dialogs by Sam Hocevar"),
122 _N("Native File Dialog by Frogtoss Games"),
123 "PortAudio",
124 _N("Weak-JACK by x42"),
125 _N("RtMidi by Gary P. Scavone"),
126 _N("FFTW by Matteo Frigo and Steven G. Johnson"),
127 _N("backward-cpp by Google"),
128 _N("adpcm by superctr"),
129 _N("adpcm-xq by David Bryant"),
130 _N("Nuked-OPL3/OPLL/OPM/OPN2/PSG by nukeykt"),
131 _N("YM3812-LLE, YMF262-LLE, YMF276-LLE and YM2608-LLE by nukeykt"),
132 _N("ESFMu (modified version) by Kagamiin~"),
133 _N("ymfm by Aaron Giles"),
134 _N("emu2413 by Digital Sound Antiques"),
135 _N("MAME SN76496 by Nicola Salmoria"),
136 _N("MAME AY-3-8910 by Couriersud"),
137 _N("with AY8930 fixes by Eulous, cam900 and Grauw"),
138 _N("MAME SAA1099 by Juergen Buchmueller and Manuel Abadia"),
139 _N("MAME Namco WSG by Nicola Salmoria and Aaron Giles"),
140 _N("MAME RF5C68 core by Olivier Galibert and Aaron Giles"),
141 _N("MAME MSM5232 core by Jarek Burczynski and Hiromitsu Shioya"),
142 _N("MAME MSM6258 core by Barry Rodewald"),
143 _N("MAME YMZ280B core by Aaron Giles"),
144 _N("MAME GA20 core by Acho A. Tang, R. Belmont and Valley Bell (modified version)"),
145 _N("MAME SegaPCM core by Hiromitsu Shioya and Olivier Galibert"),
146 _N("MAME µPD1771C-017 HLE core by David Viens"),
147 _N("SAASound by Dave Hooper and Simon Owen"),
148 _N("SameBoy by Lior Halphon"),
149 _N("Mednafen PCE, WonderSwan, T6W28 (modified) and Virtual Boy audio cores"),
150 _N("WonderSwan new core by asiekierka"),
151 _N("SNES DSP core by Blargg"),
152 _N("puNES (NES, MMC5 and FDS) by FHorse (modified version)"),
153 _N("NSFPlay (NES and FDS) by Brad Smith and Brezza"),
154 _N("reSID by Dag Lem"),
155 _N("reSIDfp by Dag Lem, Antti Lankila"),
156 _N("and Leandro Nini"),
157 _N("dSID by DefleMask Team based on jsSID"),
158 _N("Stella by Stella Team"),
159 _N("QSound emulator by superctr and Valley Bell"),
160 _N("VICE VIC-20 sound core by Rami Rasanen and viznut"),
161 _N("VICE TED sound core by Andreas Boose, Tibor Biczo"),
162 _N("and Marco van den Heuvel"),
163 _N("VERA sound core by Frank van den Hoef"),
164 _N("mzpokeysnd POKEY emulator by Michael Borisov"),
165 _N("ASAP POKEY emulator by Piotr Fusik"),
166 _N("ported by laoo to C++"),
167 _N("vgsound_emu (second version, modified version) by cam900"),
168 _N("Impulse Tracker GUS volume table by Jeffrey Lim"),
169 _N("Schism Tracker IT sample decompression"),
170 _N("SM8521 emulator (modified version) by cam900"),
171 _N("D65010G031 emulator (modified version) by cam900"),
172 _N("Namco C140/C219 emulator (modified version) by cam900"),
173 _N("PowerNoise emulator by scratchminer"),
174 _N("ep128emu by Istvan Varga"),
175 _N("NDS sound emulator by cam900"),
176 _N("openMSX YMF278 emulator (modified version) by the openMSX developers"),
177 _N("SID2 emulator by LTVA (modification of reSID emulator)"),
178 _N("SID3 emulator by LTVA"),
179 "",
180 _N("greetings to:"),
181 "floxy!",
182 "NEOART Costa Rica",
183 "Xenium Demoparty",
184 "@party",
185 _N("all members of Deflers of Noice!"),
186 "",
187 _N("copyright © 2021-2025 tildearrow"),
188 _N("(and contributors)."),
189 _N("licensed under GPLv2+! see"),
190 _N("LICENSE for more information."),
191 "",
192 _N("help Furnace grow:"),
193 "https://github.com/tildearrow/furnace",
194 "",
195 _N("contact tildearrow at:"),
196 "https://tildearrow.org/?p=contact",
197 "",
198 _N("disclaimer:"),
199 _N("despite the fact this program works"),
200 _N("with the .dmf file format, it is NOT"),
201 _N("affiliated with Delek or DefleMask in"),
202 _N("any way, nor it is a replacement for"),
203 _N("the original program."),
204 "",
205 _N("it also comes with ABSOLUTELY NO WARRANTY."),
206 "",
207 _N("thanks to all contributors/bug reporters!")
208 };
209
210 const size_t aboutCount=sizeof(aboutLine)/sizeof(aboutLine[0]);
211
212 void FurnaceGUI::drawAbout() {
213 // do stuff
214 if (ImGui::Begin("About Furnace",NULL,ImGuiWindowFlags_Modal|ImGuiWindowFlags_NoMove|ImGuiWindowFlags_NoResize|ImGuiWindowFlags_NoDocking|ImGuiWindowFlags_NoTitleBar,_("About Furnace"))) {
215 ImGui::SetWindowPos(ImVec2(0,0));
216 ImGui::SetWindowSize(ImVec2(canvasW,canvasH));
217 ImGui::PushFont(bigFont);
218 ImDrawList* dl=ImGui::GetWindowDrawList();
219 float r=0;
220 float g=0;
221 float b=0;
222 float peakMix=0.3;
223 ImGui::ColorConvertHSVtoRGB(aboutHue,1.0,0.475,r,g,b);
224 dl->AddRectFilled(ImVec2(0,0),ImVec2(canvasW,canvasH),0xff000000);
225 bool skip=false;
226 bool skip2=false;
227 for (int i=(-80-sin(double(aboutSin)*2*M_PI/120.0)*80.0)*2*dpiScale; i<canvasW; i+=160*dpiScale) {
228 skip2=!skip2;
229 skip=skip2;
230 for (int j=(-80-cos(double(aboutSin)*2*M_PI/150.0)*80.0)*2*dpiScale; j<canvasH; j+=160*dpiScale) {
231 skip=!skip;
232 if (skip) continue;
233 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)));
234 }
235 }
236
237 skip=false;
238 skip2=false;
239 for (int i=(-80-cos(double(aboutSin)*2*M_PI/120.0)*80.0)*2*dpiScale; i<canvasW; i+=160*dpiScale) {
240 skip2=!skip2;
241 skip=skip2;
242 for (int j=(-80-sin(double(aboutSin)*2*M_PI/150.0)*80.0)*2*dpiScale; j<canvasH; j+=160*dpiScale) {
243 skip=!skip;
244 if (skip) continue;
245 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)));
246 }
247 }
248
249 skip=false;
250 skip2=false;
251 for (int i=(-160+fmod(aboutSin*2,160))*2*dpiScale; i<canvasW; i+=160*dpiScale) {
252 skip2=!skip2;
253 skip=skip2;
254 for (int j=(-240-cos(double(aboutSin*M_PI/300.0))*240.0)*2*dpiScale; j<canvasH; j+=160*dpiScale) {
255 skip=!skip;
256 if (skip) continue;
257 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)));
258 }
259 }
260
261 for (size_t i=0; i<aboutCount; i++) {
262 // don't localize tildearrow, the version or an empty line
263 const char* nextLine=(i==0 || i==3 || aboutLine[i][0]==0)?aboutLine[i]:_(aboutLine[i]);
264 double posX=(canvasW/2.0)+(sin(double(i)*0.5+double(aboutScroll)/(90.0*dpiScale))*120*dpiScale)-(ImGui::CalcTextSize(nextLine).x*0.5);
265 double posY=(canvasH-aboutScroll+42*i*dpiScale);
266 if (posY<-80*dpiScale || posY>canvasH) continue;
267 dl->AddText(bigFont,BIG_FONT_SIZE,
268 ImVec2(posX+dpiScale,posY+dpiScale),
269 0xff000000,nextLine);
270 dl->AddText(bigFont,BIG_FONT_SIZE,
271 ImVec2(posX+dpiScale,posY-dpiScale),
272 0xff000000,nextLine);
273 dl->AddText(bigFont,BIG_FONT_SIZE,
274 ImVec2(posX-dpiScale,posY+dpiScale),
275 0xff000000,nextLine);
276 dl->AddText(bigFont,BIG_FONT_SIZE,
277 ImVec2(posX-dpiScale,posY-dpiScale),
278 0xff000000,nextLine);
279 dl->AddText(bigFont,BIG_FONT_SIZE,
280 ImVec2(posX,posY),
281 0xffffffff,nextLine);
282 }
283 ImGui::PopFont();
284
285 float timeScale=60.0f*ImGui::GetIO().DeltaTime;
286
287 aboutHue+=(0.001+peakMix*0.004)*timeScale;
288 aboutScroll+=(2+(peakMix>0.78)*3)*timeScale*dpiScale;
289 aboutSin+=(1+(peakMix>0.75)*2)*timeScale;
290
291 while (aboutHue>1) aboutHue--;
292 while (aboutSin>=2400) aboutSin-=2400;
293 if (aboutScroll>(42*dpiScale*aboutCount+canvasH)) aboutScroll=-20*dpiScale;
294
295 if (ImGui::IsKeyPressed(ImGuiKey_Space)) {
296 aboutOpen=false;
297 if (modified) {
298 showWarning(_("Unsaved changes! Save changes before playing?"),GUI_WARN_CV);
299 } else {
300 cvOpen=true;
301 cvNotSerious=true;
302 }
303 }
304
305 WAKE_UP;
306 }
307 if (ImGui::IsWindowFocused(ImGuiFocusedFlags_ChildWindows)) curWindow=GUI_WINDOW_ABOUT;
308 ImGui::End();
309 }