Commit Graph
100 Commits
Author SHA1 Message Date
Thai Pangsakulyanont f2697f9eb5 fix possible syntax error 2012-05-21 16:03:42 +07:00
Thai Pangsakulyanont 67bbfd9a09 merge 2012-05-21 15:04:06 +07:00
Thai Pangsakulyanont 2b6670c2df optimize adding background changes
I have a song with 5841 background changes and it took 3 seconds to load that song.
2012-05-21 14:27:17 +07:00
Thai Pangsakulyanont 1c85c74785 remove the debugging code 2012-05-21 14:02:38 +07:00
Thai Pangsakulyanont 09b545c367 changelog 2012-05-21 14:01:53 +07:00
Thai Pangsakulyanont 44d3f78845 merge 2012-05-21 13:59:27 +07:00
Thai Pangsakulyanont 3a82222c83 add background support to BMS files (only #BMP, not #BGA) 2012-05-21 13:58:40 +07:00
Thai Pangsakulyanont 9c9147d30b merge 2012-04-26 13:37:43 +07:00
Thai Pangsakulyanont 0b3287f190 (Mac OS X) make Debug configuration compile to "StepMania (debug).app" so we can have both debug and non-debug version together without having to rebuild. 2012-04-26 13:37:11 +07:00
Thai Pangsakulyanont 23f9bad9e0 [RageSoundReader_Preload] change default maximum number of samples to 1048576 samples.
This uses a lot more memory, but should make it smoother when playing heavily keysounded files. Many simulators do actually load all keysounds into memory before the game starts.
2012-04-26 13:32:15 +07:00
Thai Pangsakulyanont 4be6179607 [RageSound] never do threaded buffering on keysounds.
When there are too many (high-quality) keysounds, threaded buffering will cause all these files to be opened at the same time. These problems can occur:
- too many open files (and then crashes)
- out of thread slots (and then crashes)

Fixing this by never doing threaded buffering on keysounds (mark to be precached).
2012-04-26 13:19:20 +07:00
Thai Pangsakulyanont db80cf5e22 make MovieTexture_FFMpeg use AVIO, so it's possible for us to later update to newer versions of ffmpeg.
- untested on Windows. need someone to test it.
- the ffmpeg revision that is used on Mac is f139838 (one tagged with 0.10.2)
2012-04-25 00:20:13 +07:00
Thai Pangsakulyanont 15315ced5e merge 2012-04-24 00:15:02 +07:00
Thai Pangsakulyanont f9b0998ced remove some files 2012-04-24 00:14:52 +07:00
Thai Pangsakulyanont 503814c435 update libpng to 1.5.10, add precompiled library for ffmpeg 0.10.2 for mac, and Xcode 4.3 project in a separate project.
This should make it possible to build StepMania 5 on Mac OS X.
The catch is that it will only work with Snow Leopard and up, but I think this is better than nothing.

We can support PowerPC / 10.4-10.5 again when someone can make the old Xcode 3 project work.
2012-04-24 00:11:28 +07:00
Thai Pangsakulyanont cb25966cf5 merge 2012-01-09 22:13:22 +07:00
Thai Pangsakulyanont dd51b200a9 if( !duringCache ) should be if( !fromCache ). My bad. :( 2012-01-09 22:09:11 +07:00
Thai Pangsakulyanont 8237a4852a and another merge 2012-01-08 19:02:29 +07:00
Thai Pangsakulyanont 1f6c32bfa2 merge 2012-01-08 19:00:17 +07:00
Thai Pangsakulyanont 01f85359e9 BMSLoader: fall back to 7k IIDX stepstype when a non-familiar number of columns are found. 2012-01-08 18:59:51 +07:00
Thai Pangsakulyanont cf3916cd89 don't adjust duplicate steps when loading from cache: another optimization. 2012-01-08 18:58:45 +07:00
Thai Pangsakulyanont 07deb6760f merge: clean up mess on my clone: no files change 2012-01-08 14:14:08 +07:00
Thai Pangsakulyanont de65dcf05b another merge 2012-01-08 13:26:38 +07:00
Thai Pangsakulyanont ebf30e2595 merge 2012-01-08 13:24:41 +07:00
Thai Pangsakulyanont 6eed983329 wrap the probing part with if( !duringCache ), speeds up loading from cache.
From my benchmark with around 1600 songs, it goes from 30 seconds to less than 10 seconds.
2012-01-08 13:23:38 +07:00
Thai Pangsakulyanont 539f638483 comment the /Desktop mount, as I see no other ArchHooks do this, plus it creates the "StepMania 5" folder on the desktop on each startup. 2011-12-11 14:07:47 +07:00
Thai Pangsakulyanont f119c8cead add Paint() to SetProgress()
so that Windows does not think that the application is not responding.
2011-11-17 14:24:48 +07:00
Thai Pangsakulyanont 2f10209fcf removed the ugly debugging code
I still don't know how to make LOG->Trace work so I just use fprintf. Just forgot to remove it before last commit.
2011-11-11 19:02:45 +07:00
Thai Pangsakulyanont 248504f275 escape # in first keysound entry, fixed ADPCM reader and make PMS load more correctly.
- [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.
2011-11-11 18:40:34 +07:00
Thai Pangsakulyanont abf7a0457f changelog 2011-10-11 00:47:47 +07:00
Thai Pangsakulyanont bbaccae6bd this is merge. 2011-10-11 00:27:10 +07:00
Thai Pangsakulyanont 460d92f5e8 add time signature segments when handling time signatures when loading BMS.
something I have forgotten but should have not forgotten. :S
2011-10-11 00:26:54 +07:00
Thai Pangsakulyanont f7c1b9c9ff merge 2011-10-10 00:32:19 +07:00
Thai Pangsakulyanont 95fac0f969 fixed adpcm, bring back PMS (using BMSLoader) 2011-10-10 00:31:57 +07:00
Thai Pangsakulyanont 0d9397c07e changelog 2011-10-09 18:36:00 +07:00
Thai Pangsakulyanont 9b96433fbc merge 2011-10-09 18:34:44 +07:00
Thai Pangsakulyanont 18b2ff07b3 fix a bug when the BMS file has a keysounded note, but the
#WAV entry points to a file with invalid name, or points to
a nonexistant file, for example

#WAVAA NoSuchFile.wav
#00101:AA

In which case, the note will be assigned the first valid
keysound, instead of not being assigned keysound at all.
This is a very silly bug with a simple fix, but didn't
manage to fix it before SM5P4 comes out. Sorry for that.
2011-10-09 18:33:45 +07:00
Thai Pangsakulyanont abf23da02f merge 2011-09-25 10:00:34 +07:00
Thai Pangsakulyanont c63809125a keep as many notes after the receptor on the screen as it could, but limit
it to 32. [we may need to fine-tune this number later, but now missed notes
no longer disappear on slow / stopped parts using speed/scroll segments]

Please note that this code might not work well with negative speeds/scrolls.
2011-09-19 12:50:18 +07:00
Thai Pangsakulyanont 61a69fe457 prepwork: also generate a data structure for note statistics that can
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].
2011-09-16 22:27:56 +07:00
Thai Pangsakulyanont 9164eccfde oops, it did not erase, but it did not skip. 2011-09-16 21:15:47 +07:00
Thai Pangsakulyanont a03e6f0efa - use a straightforward binary search for GetSegmentIndexAtBeat
- fix a bug where adding a segment with the same value as the old one
  removes the old one [it should just skip adding the new segment].
2011-09-16 21:03:06 +07:00
Thai Pangsakulyanont d285c80a72 Some optimizations with the scroll segments.
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.
2011-09-14 23:48:24 +07:00
Thai Pangsakulyanont be3094b5af merge.
a bit more about autokeysounds: when I add this RageSoundReader_Extend,
I'm not sure whether the "autokeysounds are delayed" bug will come back
or not. Someone on Windows please test it.
2011-09-14 12:28:16 +07:00
Thai Pangsakulyanont 3a8203085b Wrap the autokeysound chain with RageSoundReader_Extend,
quite a simple fix, but the song now no longer stops scrolling
when there are no more auto keysounds to play, which is what I've
been trying to fix for a long time.

It's now possible to play BMS which the BGM track is a bit too short
that in previous versions, the notes stop scrolling because there's
nothing more to play and it's impossible to finish the level.

It's also now possible to play BMS file which does not have any
autokeysounds at all, and also it's now possible to edit BMS files
(but the editor is very un-intuitive, but at least you can now add
timing changes to songs loaded from BMS files, such as speed segments
and scroll segments [they will be saved as .ssc file by the way]).
2011-09-14 12:26:01 +07:00
Thai Pangsakulyanont 8fdf42e2bb Add PlayerState::GetDisplayedPosition() and PlayerState::GetDisplayedTiming()
which returns the dispalyed position and timing (based on the timing display
switch in the editor), so less copy n paste in ArrowEffects and NoteField.
2011-09-14 12:20:42 +07:00
Thai Pangsakulyanont fc0ee6543b insert notes first, then add autokeysounds thereafter. 2011-09-10 17:11:46 +07:00
Thai Pangsakulyanont afd64f3ed9 fix the comment. 2011-09-10 15:14:04 +07:00
Thai Pangsakulyanont 0db3fbac7a force autokeysound chain to be the shared sound when there's no music.
this prevents the crash caused by the asserion "No keysounds were loaded for the song %s!".
the song will load just fine in this case, but the notes will not scroll.

this only takes place when m_pSharedSound is NULL, which doesn't break when there's
background music but no autokeysounds.

on a related note,
the "notes don't scroll" problem also existed [before this commit] when there's no more
autokeysounds to play, in this case, the song stopped and the notes stopped scrolling.
and there's no way to get to the end of the song. can't figure out how to deal with this yet.
2011-09-10 12:59:26 +07:00
Thai Pangsakulyanont 1103f8cea1 and add my changelog 2011-09-10 01:23:41 +07:00
Thai Pangsakulyanont 1362cab86b merge 2011-09-10 01:21:19 +07:00
Thai Pangsakulyanont b26dc2b3bd major rewrite of NotesLoaderBMS. now it needs a lot of testing.
- handles BPM changes correctly
- songs should load faster
- auto-adjusts time signature changes (not sure how well will it perform.)
- add some code to differentiate between beat_single5 and popn_five, fixes bug 430
- also, bug 500 seems to be fixed after the rewrite, after some other attempts fail

what's not supported yet:
- #LNOBJ long note parsing
- #LNTYPE 2 long note parsing [http://nvyu.net/rdm/ex.php]
2011-09-10 01:08:04 +07:00
Thai Pangsakulyanont 27195bd02c ...and another merge! 2011-09-09 08:58:41 +07:00
Thai Pangsakulyanont 9baffbc9e3 merge from some old revision (forgot to commit) 2011-09-09 08:58:01 +07:00
Thai Pangsakulyanont d17c21e091 Moved the unused RageSoundReader_Silence from RageSound.cpp to RageSoundReader.h and use it in AutoKeysounds.cpp.
Hopefully this should fix Bug 0000500, but I don't know, can't reproduce.
2011-09-05 16:02:51 +07:00
Thai Pangsakulyanont 8ef9b3af13 merge 2011-08-29 00:16:38 +07:00
Thai Pangsakulyanont cbcf955fe8 fixes building in Mac OS X (I hope so) 2011-08-29 00:11:10 +07:00
Thai Pangsakulyanont 4dfed45103 Mute the keysound immediately when letting go of hold note.
Don't know if that last formula change is intentional or not, so restoring this
old formula. Back this out if it's actually intentional.
2011-08-08 00:40:14 +07:00
Thai Pangsakulyanont 6b6f9bba35 Send the actual song file to LoadFromBMSFile in BMSLoader::LoadNoteDataFromSimfile
instead of the dummy one, because the keysounds are in the song.

Also recreate the intermediate data structure that is required by LoadFromBMSFile.

This fixes the wrong sound issue, but the code still looks messy.
2011-08-08 00:29:32 +07:00
Thai Pangsakulyanont 8bad512433 Fix performance issue: remove the slow assertion code.
GetDisplayedBeat and GetDisplayedSpeedPercent are called so many times in one frame
so they need to be as fast as possible.
2011-07-27 00:29:22 +07:00
Thai Pangsakulyanont e6be564be8 [timing] make sure the segments are sorted 2011-07-17 13:03:21 +07:00
Thai Pangsakulyanont de3916297e it runs, but scrolls stop working. 2011-07-17 12:30:09 +07:00
Thai Pangsakulyanont e97408f5ea [timing] it now builds, but it crashes upon starting (EXC_BAD_ACCESS) 2011-07-17 12:19:14 +07:00
Thai Pangsakulyanont 9a1a824f22 let SpeedSegment scale itself.
also fixes the bug where the segments outside of the scaling region are scaled too.
2011-07-01 22:40:57 +07:00
Thai Pangsakulyanont 68f95ce056 Refactor TimingData::ScaleRegion(), fixes 297. 2011-06-26 13:43:30 +07:00
Thai Pangsakulyanont 48262f9c3d and another merge 2011-06-14 22:24:30 +07:00
Thai Pangsakulyanont 50ce0f8b81 merge 2011-06-14 22:23:20 +07:00
Thai Pangsakulyanont 5cd05670ab NotesLoaderBMS: Fix loading BPM changes by putting all of them in a map first and then finally add the BPM segments.
As the BMS loader sorts the definitions by measure and channel, they are not sorted by time, so there are cases that this can happen:

#00103:7F
#00203:007F0000
#00208:01
#BPM01 63.5

In this case, the segment in the second line is parsed before the third line, and because of the BPM is the same as the segment before it (the first line), no BPM changes will be added, the segment in the third line will then set the BPM of the rest of the song, which is wrong. To fix this the BPM needs to be sorted.
2011-06-13 10:54:18 +07:00
Thai Pangsakulyanont bc074180da merge 2011-06-12 13:27:58 +07:00
Thai Pangsakulyanont c057b23ab3 progress bar for Linux partially done: no indeterminate progress bar yet. 2011-06-12 13:24:39 +07:00
Thai Pangsakulyanont 3df6a5e82c [loading window] fixes for mac os x progress bar 2011-06-06 10:53:45 +07:00
Thai Pangsakulyanont 6f624538ce display progress for song loading 2011-06-05 12:45:28 +07:00
Thai Pangsakulyanont bce2fcbe2a the progress now displays on a mac. Needs some visual adjustments though. 2011-06-05 12:18:20 +07:00
Thai Pangsakulyanont ac928c7faa [default -> loading window] merge 2011-06-05 11:41:08 +07:00
Thai Pangsakulyanont b458f4ef6b we need a unique product name and version number here:
if only "png" is used, then on some systems with other png versions (me), the linker
will link with to the wrong path (/usr/local/lib/libpng14.14.dylib in my case).

if you don't like the version number (I don't know so I put 1.5.1sm0.1) please change it
to something else, just keep it unique.
2011-06-05 11:32:04 +07:00
Thai Pangsakulyanont 687affa1e5 merge.
I seem to get an EXC_BAD_ACCESS error about libpng on app starting, so I don't know if the merge succeeded at all :<
2011-06-04 19:18:55 +07:00
Thai Pangsakulyanont 49042c4878 try to improve performance with scroll segments:
- optimize GetDisplayedBeat (seems to be a bottleneck here).
- make sure that fFirstBeatToDraw <= fBeat <= fLastBeatToDraw in IS_ON_SCREEN.
2011-06-04 19:02:45 +07:00
Thai Pangsakulyanont a1681faa06 skip recalculating radar values and last beat when loading from cache. loading songs from the cache is now 5x faster.
fyi: it took 1:40 minutes to load my library, now it's only 20 seconds.
2011-06-04 17:28:20 +07:00
Thai Pangsakulyanont 6ca0cd1e70 optimizations to NoteDataUtil::CalculateRadarValues, results in 3x faster loading. 2011-06-01 16:01:14 +07:00
Thai Pangsakulyanont 6f83556da7 fix the template mess! it now builds on windows but not sure if it works or if it will build on other platforms. 2011-06-01 14:21:57 +07:00
Thai Pangsakulyanont 1d2dd19ab1 Yeah, BPM segments, big one :D 2011-05-31 23:41:39 +07:00
Thai Pangsakulyanont 860f6c76f0 I forgot to remove the unused operator== functions from TimingSegments.h 2011-05-31 22:05:04 +07:00
Thai Pangsakulyanont 26ecddfc9d beat should be private 2011-05-31 21:14:36 +07:00
Thai Pangsakulyanont f7e849f045 further refactorization of TimingSegments (use more templates!) 2011-05-31 19:39:28 +07:00
Thai Pangsakulyanont f29e63d2b7 fix a crash on a course editor by renaming ambiguous class 2011-05-31 00:01:39 +07:00
Thai Pangsakulyanont b1f990c0f1 move glew.c inside stepmania (now builds!) 2011-05-30 10:39:50 +07:00
Thai Pangsakulyanont 8164ddeafb probably that's where it's hidden. 2011-05-30 09:52:49 +07:00
Thai Pangsakulyanont 2a3bdec433 and another merge 2011-05-29 23:44:16 +07:00
Thai Pangsakulyanont 8ad9ada0da merge 2011-05-29 23:42:29 +07:00
Thai Pangsakulyanont bb1d829d38 make cancel do nothing. 2011-05-29 23:42:14 +07:00
Thai Pangsakulyanont b1cd93963d [scroll] merge 2011-05-26 01:14:27 +07:00
Thai Pangsakulyanont 7f4d517861 revert en.ini (to avoid merge conflicts) 2011-05-26 01:14:04 +07:00
Thai Pangsakulyanont 372540e3a4 Bringing Thai's fix in for Warps and Delays. 2011-05-26 01:12:41 +07:00
Thai Pangsakulyanont 8b159a9df7 make GetClosestNote and GetClosestNonEmptyRow seconds based, and not time-based. 2011-05-26 01:12:41 +07:00
Thai Pangsakulyanont 8f35c048b8 [scroll] mergefix 2011-05-25 23:48:34 +07:00
Thai Pangsakulyanont d9f936190a [default -> scroll] merge 2011-05-25 22:56:26 +07:00
Thai Pangsakulyanont 5e88041b5e strings 2011-05-25 22:54:57 +07:00
Thai Pangsakulyanont fe9573975c [scroll] 90% of scroll segments 2011-05-25 22:44:41 +07:00
Thai Pangsakulyanont ccc66ccaeb disable editing wait and mode on a row without a speed segment. enabling it is no-op anyway. 2011-05-24 13:30:21 +07:00
Thai Pangsakulyanont ddbecd5de4 add a comment about behavior of stops and delays in warpsadd a comment about behavior of stops and delays in warpsadd a comment about behavior of stops and delays in warpsadd a comment about behavior of stops and delays in warpsadd a comment about behavior of stops and delays in warpsadd a comment about behavior of stops and delays in warpsadd a comment about behavior of stops and delays in warpsadd a comment about behavior of stops and delays in warpsadd a comment about behavior of stops and delays in warps 2011-05-24 13:07:59 +07:00