Mainly minor stuff. Time this gets brought in.
The other multi chain branches...
unsure of their fate. May need to be redone again
since not everyone is happy with its progress.
Want to make sure we don't cause conflicts for future 1a builds.
This commit: change the sentinel for launching attacks immediately.
This way, songs with negative gaps can have attacks work here.
Thanks to Saturn for the assist.
- [NoteField] fix build warnings, and change the maximum number of displayed notes
after the receptor to 64.
- [Player] fix build warnings.
- [NotesLoaderSSC, NotesWriterSSC] The MSD file reader seems to treat # that comes
directly after : as new tag, and as many PMS and BMS files has keysounds which filename
starts with #, so it looks like this: #KEYSOUNDS:#bgm.wav,01.wav,02.wav,..
The MSD parser will see it as 2 different tags. So I added a backslash in front of the
# sign if it's at the start when saving and remove it when loading.
- [RageSoundReader_WAV] ADPCM now works very well and doesn't return error when
end of file is reached anymore.
- [Steps] Use BMS loader when loading the note data.
determine the number of notes to display from any beat to any beat in
O(log n) [n = number of non-empty rows].
it might be used to determine the first displayed beat or last displayed
beat based on number of notes on screen (instead of fixed beats),
if this can be implemented properly, then notes will no longer disappear
or appear during a long slow scrolls/speeds [as long as the number of
notes to display is in our limit].
Scroll segments seem to cause the lag when there's a lot of segment
in the steps, say, 165. On my Mac, it drops the frame-rate down by about
30 FPS in the end.
This is because the way the the game tries to determine the exact position
of the note, it has to go through all the scroll segments from the
beginning until it finds the currently active scroll segment and keep
track of the beat to display instead.
And each frame, the game needs to determine the position for each note,
and also when figuring out the first beat and last beat to display. This
makes the game slow even with just 165 scroll segments.
The approach is that at every game update, we create an optimized data
structure that can calculate the displayed beat from real song beat
in O(log n) time. So in this approach we iterate through EVERY scroll
segments each frame instead of iterating through the scroll segments
for each note for each frame. This eliminates the lag on this side.
The data structure is recomputed each update because I assume that the
timing segments can change at any time, but not during draws.
A similar problem is: when using Cmods, GetElapsedTimeFromBeat()
is also called very often (say, for each note and also in FindFirst/Last
DisplayedBeat), we may as well have to make these queries faster for songs
that has hundreds of BPM changes or stops or delays to prevent the game
from lagging.