PDA

View Full Version : [zeditor] Freeze when selecting MIDI



Asuna Yuuki Nagato
02-19-2024, 05:00 PM
Steps to recreate:


Quest->Audio->MIDIs
Click 'Edit' in Select music window
Select music window is dismissed and editor becomes unresponsive



ZC Editor
Version: 2.55 Nightly (Alpha 119/120)
Tag: 2.55.0 Nightly (Alpha 119/120)
Build Date: 19th February, 2024 at @ 14:57:04 EST
Dev Signoff: UNSIGNED
QR:##B343AFAF01C281A00DA58A4211A608DFDF080001362A0 410FC5306FE2A274100381B02044031300000065824C000000 00000D00323010900000000000000000000000000000000000 00000000000000034866C31403202000000000000000000000 00000##

Asuna Yuuki Nagato
02-19-2024, 07:09 PM
onMidis() in zquest.cpp runs when clicking MIDIs in step 1. Then the call to do_zqdialog immediately following the call to go() creates the "Select music" window.

The button labels on the Select music window come from the selectmidi_dlg array in zquest.cpp

Asuna Yuuki Nagato
02-27-2024, 01:26 AM
This while loop appears to be degenerating into an infinite loop:



while(update_dialog(p))
{
custom_vsync();
// text_mode(vc(1));
textprintf_ex(screen,get_zc_font(font_lfont_l),edi tmidi_dlg[0].x+int32_t(193*1.5),editmidi_dlg[0].y+int32_t(58*1.5),jwin_pal[jcBOXFG],jwin_pal[jcBOX],"%-5ld",midi_pos);
}


control never seems to flow down to the rest of edit_tune(int32_t i), the next non-blank line of which is:



ret = shutdown_dialog(p);

Asuna Yuuki Nagato
02-27-2024, 09:06 PM
Commenting out that while loop doesn't fix it because then the do while(ret<26&&ret!=0); loop degenerates into an infinite loop with ret == -1

Asuna Yuuki Nagato
02-27-2024, 09:22 PM
Uncommenting text_mode(vc(1)); doesn't help break out of the while(update_dialog(p)) loop.

Asuna Yuuki Nagato
02-27-2024, 09:37 PM
v2.50 Build 28 correctly brings up the "MIDI Specs" window when clicking the "Edit" button.