示例#1
0
        void PlayDigMusic(string songName, ImuseDigTable table, int attribPos, bool sequence)
        {
            int hookId = 0;

            if (songName != null)
            {
                if ((_attributes[DigSequenceOffset + 38] != 0) && (_attributes[DigSequenceOffset + 41] == 0))
                {
                    if ((attribPos == 43) || (attribPos == 44))
                    {
                        hookId = 3;
                    }
                }

                if ((_attributes[DigSequenceOffset + 46] != 0) && (_attributes[DigSequenceOffset + 48] == 0))
                {
                    if ((attribPos == 38) || (attribPos == 39))
                    {
                        hookId = 3;
                    }
                }

                if ((_attributes[DigSequenceOffset + 53] != 0))
                {
                    if ((attribPos == 50) || (attribPos == 51))
                    {
                        hookId = 3;
                    }
                }

                if ((attribPos != 0) && (hookId == 0))
                {
                    if (table.AttribPos != 0)
                    {
                        attribPos = table.AttribPos;
                    }
                    hookId = _attributes[DigStateOffset + attribPos];
                    if (table.HookId != 0)
                    {
                        if ((hookId != 0) && (table.HookId > 1))
                        {
                            _attributes[DigStateOffset + attribPos] = 2;
                        }
                        else
                        {
                            _attributes[DigStateOffset + attribPos] = hookId + 1;
                            if (table.HookId < hookId + 1)
                            {
                                _attributes[DigStateOffset + attribPos] = 1;
                            }
                        }
                    }
                }
            }

            if (songName == null)
            {
                FadeOutMusic(120);
                return;
            }

            switch (table.TransitionType)
            {
            case 0:
            case 5:
                break;

            case 3:
            case 4:
                if (table.Filename[0] == 0)
                {
                    FadeOutMusic(60);
                    return;
                }
                if (table.TransitionType == 4)
                {
                    _stopingSequence = 1;
                }
                if ((!sequence) && (table.AttribPos != 0) &&
                    (table.AttribPos == _digStateMusicTable[_curMusicState].AttribPos))
                {
                    FadeOutMusicAndStartNew(108, table.Filename, table.SoundId);
                }
                else
                {
                    FadeOutMusic(108);
                    StartMusic(table.Filename, table.SoundId, hookId, 127);
                }
                break;

            case 6:
                _stopingSequence = 1;
                break;
            }
        }
示例#2
0
        void PlayDigMusic(string songName, ImuseDigTable table, int attribPos, bool sequence)
        {
            int hookId = 0;

            if (songName != null)
            {
                if ((_attributes[DigSequenceOffset + 38] != 0) && (_attributes[DigSequenceOffset + 41] == 0))
                {
                    if ((attribPos == 43) || (attribPos == 44))
                        hookId = 3;
                }

                if ((_attributes[DigSequenceOffset + 46] != 0) && (_attributes[DigSequenceOffset + 48] == 0))
                {
                    if ((attribPos == 38) || (attribPos == 39))
                        hookId = 3;
                }

                if ((_attributes[DigSequenceOffset + 53] != 0))
                {
                    if ((attribPos == 50) || (attribPos == 51))
                        hookId = 3;
                }

                if ((attribPos != 0) && (hookId == 0))
                {
                    if (table.AttribPos != 0)
                        attribPos = table.AttribPos;
                    hookId = _attributes[DigStateOffset + attribPos];
                    if (table.HookId != 0)
                    {
                        if ((hookId != 0) && (table.HookId > 1))
                        {
                            _attributes[DigStateOffset + attribPos] = 2;
                        }
                        else
                        {
                            _attributes[DigStateOffset + attribPos] = hookId + 1;
                            if (table.HookId < hookId + 1)
                                _attributes[DigStateOffset + attribPos] = 1;
                        }
                    }
                }
            }

            if (songName == null)
            {
                FadeOutMusic(120);
                return;
            }

            switch (table.TransitionType)
            {
                case 0:
                case 5:
                    break;
                case 3:
                case 4:
                    if (table.Filename[0] == 0)
                    {
                        FadeOutMusic(60);
                        return;
                    }
                    if (table.TransitionType == 4)
                        _stopingSequence = 1;
                    if ((!sequence) && (table.AttribPos != 0) &&
                        (table.AttribPos == _digStateMusicTable[_curMusicState].AttribPos))
                    {
                        FadeOutMusicAndStartNew(108, table.Filename, table.SoundId);
                    }
                    else
                    {
                        FadeOutMusic(108);
                        StartMusic(table.Filename, table.SoundId, hookId, 127);
                    }
                    break;
                case 6:
                    _stopingSequence = 1;
                    break;
            }
        }