Пример #1
0
void ScreenGameplay::LoadResources()
{
    char* SkinFiles[] =
    {
        "cursor.png",
        "Barline.png",
        "barline_marker.png",
        "hitcircle.png",
        "Ready.png"
    };

    ImageLoader::LoadFromManifest(SkinFiles, 3, GameState::GetInstance().GetSkinPrefix());

    memset(&Evaluation, 0, sizeof(Evaluation));

    Measure = 0;
    Combo = 0;

    if (ShouldChangeScreenAtEnd)
        Barline.Init(CurrentDiff->Offset + MySong->LeadInTime);
    else
    {
        Barline.Init(0); // edit mode
        Barline.Alpha = 1;
    }

    Lifebar.UpdateHealth();

    if (CurrentDiff->Timing.size())
        MeasureTime = (60 * MySong->MeasureLength / CurrentDiff->Timing[0].Value);
    else
        MeasureTime = 0;

    // We might be retrying- in that case we should probably clean up.
    RemoveTrash();

    ResetNotes();

    if (!Music)
    {
        Music = new AudioStream();

        if (!Music || !Music->Open(MySong->SongDirectory / MySong->SongFilename))
        {
            throw std::runtime_error((Utility::Format("couldn't open song %s", MySong->SongFilename.c_str()).c_str()));
        }

        seekTime(0);
    }

    MeasureRatio = 0;
    RatioPerSecond = 0;

    if (Music)
    {
        if (ShouldChangeScreenAtEnd)
            LeadInTime = MySong->LeadInTime;
    }

    CursorRotospeed = Configuration::GetSkinConfigf("RotationSpeed", "Cursor");
    CursorCentered = Configuration::GetSkinConfigf("Centered", "Cursor") != 0;
    CursorZooming = Configuration::GetSkinConfigf("Zooming", "Cursor") != 0;
    CursorSize = Configuration::GetSkinConfigf("Size", "CursorSize");

    if (CursorSize == 0)
        CursorSize = 60;
}
Пример #2
0
int BigPotMedia::seekPos(double pos, int direct /*= 1*/, int reset /*= 0*/)
{
	//printf("\nseek %f pos, %f s\n", pos, pos * totalTime / 1e3);
	return seekTime(pos * _totalTime, direct, reset);
}