From 133adba10e8f8df3f3396a428e11831aa9018630 Mon Sep 17 00:00:00 2001 From: Dav999 Date: Tue, 28 Nov 2023 21:29:44 +0100 Subject: [PATCH 1/5] Fix remaining audio speedup/slowdown bug Fixes #1057. Based on Ethan's hunch, I simply removed the format comparison that decides whether to halt and restart, or reuse the voice. Voices are now always restarted when playing a new track. This also simplifies the code somewhat: `MusicTrack::musicVoiceFormat` was now no longer used, and an `if (!IsHalted())` was no longer necessary because `Halt()` already does that. So those are now removed as well. --- desktop_version/src/Music.cpp | 27 +++++---------------------- 1 file changed, 5 insertions(+), 22 deletions(-) diff --git a/desktop_version/src/Music.cpp b/desktop_version/src/Music.cpp index 168a16da..b725940c 100644 --- a/desktop_version/src/Music.cpp +++ b/desktop_version/src/Music.cpp @@ -435,27 +435,12 @@ end: sample_pos = 0; stb_vorbis_seek_start(vorbis); - if (!IsHalted()) - { - if (SDL_memcmp(&musicVoiceFormat, &format, sizeof(format)) != 0) - { - Halt(); - musicVoiceFormat = format; - } - } + Halt(); - if (IsHalted()) - { - SDL_zero(callbacks); - callbacks.OnBufferStart = &MusicTrack::refillReserve; - callbacks.OnBufferEnd = &MusicTrack::swapBuffers; - FAudio_CreateSourceVoice(faudioctx, &musicVoice, &format, 0, 2.0f, &callbacks, NULL, NULL); - } - else - { - Pause(); - FAudioSourceVoice_FlushSourceBuffers(musicVoice); - } + SDL_zero(callbacks); + callbacks.OnBufferStart = &MusicTrack::refillReserve; + callbacks.OnBufferEnd = &MusicTrack::swapBuffers; + FAudio_CreateSourceVoice(faudioctx, &musicVoice, &format, 0, 2.0f, &callbacks, NULL, NULL); FAudioBuffer faudio_buffer; SDL_zero(faudio_buffer); @@ -546,7 +531,6 @@ end: static bool paused; static FAudioSourceVoice* musicVoice; - static FAudioWaveFormatEx musicVoiceFormat; static void refillReserve(FAudioVoiceCallback* callback, void* ctx) { @@ -725,7 +709,6 @@ end: }; bool MusicTrack::paused = false; FAudioSourceVoice* MusicTrack::musicVoice = NULL; -FAudioWaveFormatEx MusicTrack::musicVoiceFormat; musicclass::musicclass(void) { From 041a81d8def9ec69176afefe01a79f36ebe6a15a Mon Sep 17 00:00:00 2001 From: AllyTally Date: Tue, 28 Nov 2023 16:11:45 -0400 Subject: [PATCH 2/5] Fix incorrect tiles in outside BG autotiling --- desktop_version/src/Editor.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/desktop_version/src/Editor.cpp b/desktop_version/src/Editor.cpp index 12713c08..125ada23 100644 --- a/desktop_version/src/Editor.cpp +++ b/desktop_version/src/Editor.cpp @@ -180,12 +180,12 @@ editorclass::editorclass(void) autotile_types["lab_green"] = lab_green_vec; static const short outside[] = { - 2, 0, 2, 0, 1, 2, 1, 2, 2, 0, 2, 2, 2, 2, 1, 2, 0, 0, 0, 0, 2, 2, 2, 2, 0, 0, 0, + 2, 0, 2, 0, 1, 2, 1, 2, 2, 0, 2, 2, 1, 2, 1, 2, 0, 0, 0, 0, 2, 2, 2, 2, 0, 0, 0, 0, 2, 2, 2, 2, 2, 0, 2, 0, 1, 2, 1, 2, 2, 0, 2, 0, 1, 2, 1, 2, 0, 0, 2, 0, 2, 2, 2, 2, 0, 0, 0, 0, 2, 2, 2, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 2, 0, 1, 2, 1, - 2, 2, 0, 2, 0, 1, 2, 1, 2, 0, 0, 0, 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, + 2, 2, 0, 2, 0, 1, 2, 1, 2, 0, 0, 0, 0, 2, 2, 2, 2, 2, 0, 2, 0, 2, 2, 2, 2, 2, 0, 2, 0, 1, 2, 1, 2, 2, 0, 2, 0, 1, 2, 1, 2, 0, 0, 0, 0, 2, 2, 2, 2, 0, 0, 0, 0, 2, 2, 2, 2, 1, 2, 1, 2, 1, 2, 1, 2, 2, 2, 2, 2, 1, 2, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 2, 2, 2, From 2e950fc935950d57ab1175d53f6b18d6eb2f64d6 Mon Sep 17 00:00:00 2001 From: Reese Rivers Date: Tue, 28 Nov 2023 20:46:30 -0500 Subject: [PATCH 3/5] Update Space Station font to latest version --- desktop_version/fonts/font.fontmeta | 40 +++++++++++++++++++++++++--- desktop_version/fonts/font.png | Bin 3909 -> 4493 bytes 2 files changed, 37 insertions(+), 3 deletions(-) diff --git a/desktop_version/fonts/font.fontmeta b/desktop_version/fonts/font.fontmeta index 387c0212..8a5a4366 100644 --- a/desktop_version/fonts/font.fontmeta +++ b/desktop_version/fonts/font.fontmeta @@ -39,33 +39,67 @@ + + + + + + + - + + + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/desktop_version/fonts/font.png b/desktop_version/fonts/font.png index 356560b757069c2f5b652bff58b10a651db6d945..5650b58457487709ecee6c8f440241130ca2d1d8 100644 GIT binary patch literal 4493 zcmV;85pwQ{P)Tn#iW-Y5+Md7!Xv0gS&VDKV9eCCgBe12%nwuX z_SGzI30v=@6w`*Kl!Thc(uV$Ef(h+3EZR~oSyRem>WCnA(*(*xoo*L*2(zPp&K>D} zbvFJ3dKKwOADw&7xu1K^x#!9u`u}lsNZ*&&JFAX51ib9~j+DN{r(Xj=bI<8Wg(rYj z2KkR+9zA}_r{j(sb=BOX}Gk%}Uxh>9puszK9; zj54N?7!0KpDMORcaXNV-jUn<1>Cm2%+Bmt2Vxoi`i7B2_I+*BK2?ZcAj$ut!2dorD z13w~T(gcnunI^M6_+d<95+F)uNm&3W^2B7>q)>92 z>;gzC31cP36GJ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m8Gg^7q6248rF!ai^@&`^(26y_2*Ln!T!nzcvDg(cku%N zS>iJ|7R<1v@c9&g+AL^XF1{P6mgfijD0i2t+Feq4l`nQZh;FX-sQ`wWkEZ~Z7yVeW zAI!uqd|6hztNPgxA6)-#pb3=TYQ??Y?*Nv)U3#@7zuSABmfw8Cg+RXAmA-{{T2ce_ zy0X{833WQ9_k7v=3KQ2#p^h~+r|o&5`PSU@~ajcz&}i( zR^vnCKBfeRc?!!fmzNA(2KYnDXAXZ7e&iw@fUUvs6!?Zu(nOf;d8JxJP#Z`^AkF4M3E8ezyB|5e-2n)0G17~l*< z{62~0^6J&An*}xid5**1;u#&iWdn>xT9+UAxBD-h0%q*r!SxHy)N*+l$Rq!D`GMA$ z5`gfW$~`u>v@2kv(6!rL6V3K8?TU=>s5B%h0biW>LM^R1ntbV`#HX2R-{U1l) z&r!hZ``1vv_GEg$jTb>irpg{Oz`Ukk>iYA7Arj8(ql%{7v)#4G7IiXl)U|A1xuUjl-0xA;YCm_s-jmyZ*xx?M2Px$ZpkMyJ68WfpM0F=h z>N?FwZ{2n{3il}Qo0G%CTtyFFEOJ>xM*vP_{s3QSu!kJgqr=0xD>J2M5>_sa_FlJc zhu&dtk371C*4|*yYB6~4Mg7jZeX93r+zs#$`2Gv@n|caK76%da-kx@KLiM9IL>c=G?FUh3E`0=K^t=zXWsi{t+QaeEEv T-bpsB00000NkvXXu0mjffUJ9& From 44a889efeb207e4bc93e59210d1ec527d2ca6b92 Mon Sep 17 00:00:00 2001 From: Reese Rivers Date: Mon, 27 Nov 2023 21:30:11 -0500 Subject: [PATCH 4/5] Changed timing of textsprites in transparent textboxes Textsprites and textimages no longer wait for the opacity value in order to display within transparent textboxes. Text sprites in normal opaque textboxes are not affected by this change. --- desktop_version/src/Graphics.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/desktop_version/src/Graphics.cpp b/desktop_version/src/Graphics.cpp index 15992ec0..2d12ea85 100644 --- a/desktop_version/src/Graphics.cpp +++ b/desktop_version/src/Graphics.cpp @@ -939,7 +939,7 @@ void Graphics::drawgui(void) opaque = textboxes[i].tl >= 1.0; - if (!opaque) + if (!opaque && textboxes[i].r != 0 && textboxes[i].g != 0 && textboxes[i].b != 0) { continue; } From af35be5bb6d426756e8a5427e55e11fb392e2a62 Mon Sep 17 00:00:00 2001 From: Misa Date: Tue, 28 Nov 2023 18:56:25 -0800 Subject: [PATCH 5/5] Name conditionals in text box loop With the recent change to drawing overlays (images and sprites) from PR #1058, it's starting to get a bit hairy. This names the conditionals responsible for determining if the text box is transparent (checking that all of its RGB is 0) and if overlays should be drawn or not (which is now either when it's opaque or transparent). --- desktop_version/src/Graphics.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/desktop_version/src/Graphics.cpp b/desktop_version/src/Graphics.cpp index 2d12ea85..0c722130 100644 --- a/desktop_version/src/Graphics.cpp +++ b/desktop_version/src/Graphics.cpp @@ -853,7 +853,6 @@ void Graphics::drawgui(void) { int text_yoff; int yp; - bool opaque; int font_height = font::height(textboxes[i].print_flags); if (flipmode) { @@ -872,7 +871,9 @@ void Graphics::drawgui(void) char buffer[SCREEN_WIDTH_CHARS + 1]; - if (textboxes[i].r == 0 && textboxes[i].g == 0 && textboxes[i].b == 0) + const bool transparent = (textboxes[i].r | textboxes[i].g | textboxes[i].b) == 0; + + if (transparent) { /* To avoid the outlines for different lines overlapping the text itself, * first draw all the outlines and then draw the text. */ @@ -937,9 +938,10 @@ void Graphics::drawgui(void) } } - opaque = textboxes[i].tl >= 1.0; + const bool opaque = textboxes[i].tl >= 1.0; + const bool draw_overlays = opaque || transparent; - if (!opaque && textboxes[i].r != 0 && textboxes[i].g != 0 && textboxes[i].b != 0) + if (!draw_overlays) { continue; }