Commit Graph

54 Commits

Author SHA1 Message Date
Glenn Maynard c690fdcfe4 unify registration 2006-09-29 00:01:32 +00:00
Glenn Maynard f4975f1f54 simpler Lua boilerplate 2006-09-27 20:30:29 +00:00
Glenn Maynard 578c6d5726 simplify singleton registration 2006-09-21 04:42:45 +00:00
Steve Checkoway 5e203c6dcb Match other thread names, e.g. Decode thread. 2006-09-13 10:29:54 +00:00
Jason Felds fceb0841a7 Remove param. 2006-08-21 00:32:27 +00:00
Steve Checkoway 80698277cf Don't use rand()%n. The function specified by the ANSI committee is a terrible linear congruential generator. In fact, it's so bad that the low order bit alternates. The algorithm implemented as RandomFloat() seems to be Park and Miller's "minimum standard" generator which is better (but not great). [See Knuth for more information.]
Any place where you would use rand()%n, use RandomInt(0, n) instead.
2006-06-26 12:14:30 +00:00
Chris Danford af3e1c571c move Steps searching out of song into SongUtil so that it can be shared with CourseEntry 2006-06-13 01:10:37 +00:00
Glenn Maynard 46c1b2ac05 oops. Do keep the non-offset beat around, and use it for actor effects.
(This should probably be used for more than this; this stuff needs a
cleanup ...)

(test case: pick a song with a stop near the beginning of the sample music,
eg. Fly With Me; no matter what the offset is set to, it should always show
the same pause on beat effects.  This could do so while honoring the offset,
but getting that right in GameSoundManager is very tricky, and it's usually
not important for non-gameplay cosmetics.)
2006-04-09 15:54:53 +00:00
Glenn Maynard 788ad134f1 This broke beat alignment, and after that was fixed, other questions
came up (like how to align beat effects correctly).  Revert this and
fix assist tick differently.

Add GetBeatAndBPSFromElapsedTimeNoOffset, GetBeatFromElapsedTimeNoOffset,
GetElapsedTimeFromBeatNoOffset.  Use them to ignore GlobalOffsetSeconds.
2006-03-29 11:12:20 +00:00
Glenn Maynard 48063cef68 cleanup 2006-03-29 10:35:48 +00:00
Glenn Maynard cefac82d1c Ignore offset for beat alignment. This could use the offset, actually, but typical offsets are around a frame, so it's not actually noticable; and making it work reliably would be a pain. Only use the offset for judgements and arrow rendering. 2006-03-29 10:15:21 +00:00
Glenn Maynard 88f9590b9e ignore offset in skip check 2006-03-29 10:13:34 +00:00
Glenn Maynard 757c6f8a6a fix checkpoint 2006-03-29 10:12:24 +00:00
Glenn Maynard 92cfec6bba simplify (tracking down skips) 2006-03-29 10:10:54 +00:00
Glenn Maynard a99731d5d9 simplify (tracking down skips) 2006-03-29 10:09:10 +00:00
Glenn Maynard ee9c292b09 Implement GlobalOffsetSeconds in GameState::UpdateSongPosition,
not TimingData.  TimingData is a simple data structure, and shouldn't
be affected by hardware tweaks.  This is also easier to bypass in cases
we don't want GlobalOffsetSeconds.

Don't adjust assist tick by GlobalOffsetSeconds.
2006-03-28 09:28:55 +00:00
Glenn Maynard c6125c4e26 Actor.cpp "fDeltaTime >= 0" assertion fires occasionally. This is under
Foreground's update, caused by GAMESTATE->m_fMusicSeconds moving backwards.

This happens due to frame skips confusing GameSoundManager::GetFrameTimingAdjustment.
It expects that, when the framerate is stable, each frame will take 1/FPS.
If we skip a frame, it thinks one frame is 30ms late, and tries to
adjust by 30-16ms.  Reduce the threshold for this adjustment to half a frame;
if we're that much late, the problem isn't scheduling jitter--we've probably
dropped a frame, and adjusting here is incorrect.

In case that isn't enough, clamp fDeltaTime in Foreground, too.
2006-02-25 10:08:18 +00:00
Chris Danford 7f821e8cfc CString -> RString 2006-01-22 01:00:06 +00:00
Chris Danford 37f82b43f7 remove CStringArray #define 2005-12-09 21:36:22 +00:00
Chris Danford 182232344f GetVideoModeParams -> GetActualVideoModeParams
add GetApiDescription
2005-11-11 21:16:48 +00:00
Glenn Maynard cbc1469dcf simplify, eliminate GetParams 2005-10-19 11:49:06 +00:00
Glenn Maynard 2f3905325d style cleanup 2005-09-23 00:12:32 +00:00
Chris Danford 65d71a4f23 expermienting with DEFINE_METHOD macro for Lua methods 2005-09-10 02:47:04 +00:00
Glenn Maynard 2c1f32cd3e warnings 2005-07-27 01:52:46 +00:00
Chris Danford cfb77d9d15 load lights along with timing data
send beat crossed messages
2005-07-24 03:12:12 +00:00
Chris Danford 1cfda9a901 remove unused PlayMusic overload 2005-07-22 22:17:34 +00:00
Glenn Maynard a2ad4d61b9 GameSoundManager handles the timer by default 2005-07-21 05:53:05 +00:00
Glenn Maynard 9d7f835609 no need to template Luna specializations 2005-06-20 05:02:03 +00:00
Glenn Maynard c4b4ce28a5 cleanup 2005-06-15 02:25:58 +00:00
Glenn Maynard ac65a855cb const fix 2005-06-08 04:11:18 +00:00
Glenn Maynard 52afe1bc93 fix compile 2005-04-29 03:42:35 +00:00
Glenn Maynard 7a0de26c40 no 2005-04-29 00:57:50 +00:00
Glenn Maynard a7901d5b67 cleanup 2005-04-29 00:24:10 +00:00
Glenn Maynard 7bccc2a5fb simplify and clarify 2005-04-29 00:20:22 +00:00
Glenn Maynard f56990b3fb simplify and clarify 2005-04-28 23:25:30 +00:00
Glenn Maynard b3a918f5b5 remove checkpoints. I havn't seen a crash in this code in months
and I don't even remember why they're there.
2005-04-28 06:18:39 +00:00
Glenn Maynard 902b0e8ac7 PlayOnce hook 2005-04-24 01:24:36 +00:00
Glenn Maynard 3b4d72a9e7 allow temporarily dimming the BGM 2005-04-24 00:36:07 +00:00
Glenn Maynard cba25bd409 fix flush 2005-02-07 07:40:50 +00:00
Glenn Maynard 7e877634c4 use plain locked vectors; less opportunity for memory leaks 2005-02-07 07:25:32 +00:00
Glenn Maynard c2317c7a40 use a wakeup signal instead of lame polling (cleanups as a result coming) 2005-02-07 07:06:28 +00:00
Glenn Maynard c60f76ebb5 simplify: remove g_ThreadedMusicStart 2005-02-07 06:56:05 +00:00
Glenn Maynard 9fc30dc5e2 comment 2005-02-07 06:55:26 +00:00
Glenn Maynard 3a9b2f7f4b working on fixing up extra loads when entering play mode in the editor 2005-01-15 01:28:29 +00:00
Glenn Maynard c6370d4fcd add GameSoundManager::Flush 2004-12-27 22:19:22 +00:00
Glenn Maynard c263c27fba remove StopPlayingSoundsForThisThread 2004-11-15 04:18:21 +00:00
Glenn Maynard a5dae29422 reduce lock contention 2004-09-08 01:38:22 +00:00
Glenn Maynard 07657c6203 oops, that's wrong; revert until I get it right 2004-08-30 07:27:34 +00:00
Glenn Maynard 6ac1d7c449 avoid holding GameSoundManager lock while stopping sounds 2004-08-30 04:03:39 +00:00
Glenn Maynard 40f7dc38f1 fix menu beat syncing 2004-08-15 23:51:47 +00:00