Esempio n. 1
0
        private void PrepareTimeLine()
        {
            CStatic stat = Statics[htStatics(StaticTimeLine)];

            switch (CConfig.TimerLook)
            {
            case ETimerLook.TR_CONFIG_TIMERLOOK_NORMAL:
                _TimeLineRect = new SRectF(stat.Rect.X, stat.Rect.Y, 0f, stat.Rect.H, stat.Rect.Z);
                Statics[htStatics(StaticTimePointer)].Visible = false;
                break;

            case ETimerLook.TR_CONFIG_TIMERLOOK_EXPANDED:
                _TimeRects.Clear();
                Statics[htStatics(StaticTimePointer)].Visible = true;

                CSong song = CGame.GetSong();

                if (song == null)
                {
                    return;
                }

                float TotalTime = CSound.GetLength(_CurrentStream);
                if (song.Finish != 0)
                {
                    TotalTime = song.Finish;
                }

                TotalTime -= song.Start;

                if (TotalTime <= 0f)
                {
                    return;
                }

                CLines[] Lines = new CLines[song.Notes.Lines.Length];
                Lines = song.Notes.Lines;
                for (int i = 0; i < Lines.Length; i++)
                {
                    CLine[] Line = Lines[i].Line;
                    for (int j = 0; j < Line.Length; j++)
                    {
                        TimeRect trect = new TimeRect();
                        trect.startBeat = Line[j].FirstBeat;
                        trect.endBeat   = Line[j].EndBeat;

                        trect.rect = new CStatic(new STexture(-1),
                                                 new SColorF(1f, 1f, 1f, 1f),
                                                 new SRectF(stat.Rect.X + stat.Rect.W * ((CGame.GetTimeFromBeats(trect.startBeat, song.BPM) + song.Gap - song.Start) / TotalTime),
                                                            stat.Rect.Y,
                                                            stat.Rect.W * (CGame.GetTimeFromBeats((trect.endBeat - trect.startBeat), song.BPM) / TotalTime),
                                                            stat.Rect.H,
                                                            stat.Rect.Z));

                        _TimeRects.Add(trect);
                    }
                }
                break;
            }
        }
Esempio n. 2
0
        private void PrepareTimeLine()
        {
            CStatic stat = Statics[htStatics(StaticTimeLine)];
            switch (CConfig.TimerLook)
            {
                case ETimerLook.TR_CONFIG_TIMERLOOK_NORMAL:
                    _TimeLineRect = new SRectF(stat.Rect.X, stat.Rect.Y, 0f, stat.Rect.H, stat.Rect.Z);
                    Statics[htStatics(StaticTimePointer)].Visible = false;
                    break;

                case ETimerLook.TR_CONFIG_TIMERLOOK_EXPANDED:
                    _TimeRects.Clear();
                    Statics[htStatics(StaticTimePointer)].Visible = true;

                    CSong song = CGame.GetSong();

                    if (song == null)
                        return;

                    float TotalTime = CSound.GetLength(_CurrentStream);
                    if (song.Finish != 0)
                        TotalTime = song.Finish;

                    TotalTime -= song.Start;

                    if (TotalTime <= 0f)
                        return;

                    CLines[] Lines = new CLines[song.Notes.Lines.Length];
                    Lines = song.Notes.Lines;
                    for (int i = 0; i < Lines.Length; i++)
                    {
                        CLine[] Line = Lines[i].Line;
                        for(int j = 0; j<Line.Length; j++){
                            TimeRect trect = new TimeRect();
                            trect.startBeat = Line[j].FirstBeat;
                            trect.endBeat = Line[j].EndBeat;

                            trect.rect = new CStatic(new STexture(-1),
                                new SColorF(1f, 1f, 1f, 1f),
                                new SRectF(stat.Rect.X + stat.Rect.W * ((CGame.GetTimeFromBeats(trect.startBeat, song.BPM) + song.Gap - song.Start) / TotalTime),
                                    stat.Rect.Y,
                                    stat.Rect.W * (CGame.GetTimeFromBeats((trect.endBeat - trect.startBeat), song.BPM) / TotalTime),
                                    stat.Rect.H,
                                    stat.Rect.Z));

                            _TimeRects.Add(trect);
                        }

                    }
                    break;
            }
        }