変愚蛮怒のメインリポジトリです
Revision | f12235c11dcd100d067af9166560c6a98117510d (tree) |
---|---|
Time | 2016-02-29 22:33:09 |
Author | Deskull <desull@user...> |
Commiter | Deskull |
同じ条件のままでも音楽を再度読み込み直す処理と、音楽の優先度も若干修正。 / Fix process reloading same music under same conditions and change music priorities.
@@ -1816,4 +1816,3 @@ extern void revenge_store(int dam); | ||
1816 | 1816 | extern bool teleport_barrier(int m_idx); |
1817 | 1817 | extern bool magic_barrier(int m_idx); |
1818 | 1818 | extern bool multiply_barrier(int m_idx); |
1819 | - |
@@ -553,6 +553,9 @@ static bool can_use_music = FALSE; | ||
553 | 553 | static MCI_OPEN_PARMS mop; |
554 | 554 | static char mci_device_type[256]; |
555 | 555 | |
556 | +int current_music_type = 0; | |
557 | +int current_music_id = 0; | |
558 | + | |
556 | 559 | #endif /* USE_MUSIC */ |
557 | 560 | |
558 | 561 |
@@ -2489,6 +2492,7 @@ static errr Term_xtra_win_music(int n, int v) | ||
2489 | 2492 | #endif /* USE_MUSIC */ |
2490 | 2493 | |
2491 | 2494 | /* Sound disabled */ |
2495 | + | |
2492 | 2496 | if(!use_music) return (1); |
2493 | 2497 | |
2494 | 2498 | /* Illegal sound */ |
@@ -2516,8 +2520,8 @@ static errr Term_xtra_win_music(int n, int v) | ||
2516 | 2520 | /* No sample */ |
2517 | 2521 | if (i == 0) |
2518 | 2522 | { |
2519 | - mciSendCommand(mop.wDeviceID, MCI_STOP, 0, 0); | |
2520 | - mciSendCommand(mop.wDeviceID, MCI_CLOSE, 0, 0); | |
2523 | + //mciSendCommand(mop.wDeviceID, MCI_STOP, 0, 0); | |
2524 | + //mciSendCommand(mop.wDeviceID, MCI_CLOSE, 0, 0); | |
2521 | 2525 | return (1); |
2522 | 2526 | } |
2523 | 2527 |
@@ -2561,6 +2565,13 @@ static errr Term_xtra_win_music(int n, int v) | ||
2561 | 2565 | break; |
2562 | 2566 | } |
2563 | 2567 | |
2568 | + if(current_music_type == n && current_music_id == v) | |
2569 | + { | |
2570 | + return (0); | |
2571 | + } | |
2572 | + current_music_type = n; | |
2573 | + current_music_id = v; | |
2574 | + | |
2564 | 2575 | #ifdef WIN32 |
2565 | 2576 | |
2566 | 2577 | mop.lpstrDeviceType = mci_device_type; |
@@ -1715,7 +1715,7 @@ errr play_music(int type, int val) | ||
1715 | 1715 | if (!use_music) return 1; |
1716 | 1716 | |
1717 | 1717 | /* Make a sound (if allowed) */ |
1718 | - return Term_xtra(type , val); | |
1718 | + return Term_xtra(type, val); | |
1719 | 1719 | } |
1720 | 1720 | |
1721 | 1721 | /* |
@@ -1770,11 +1770,11 @@ void select_floor_music() | ||
1770 | 1770 | |
1771 | 1771 | if(dungeon_type) |
1772 | 1772 | { |
1773 | - if(play_music(TERM_XTRA_MUSIC_DUNGEON, dungeon_type)) | |
1773 | + if(p_ptr->feeling == 2) play_music(TERM_XTRA_MUSIC_BASIC, MUSIC_BASIC_DUN_FEEL2); | |
1774 | + else if(p_ptr->feeling >= 3 && p_ptr->feeling <= 5) play_music(TERM_XTRA_MUSIC_BASIC, MUSIC_BASIC_DUN_FEEL1); | |
1775 | + else | |
1774 | 1776 | { |
1775 | - if(p_ptr->feeling == 2) play_music(TERM_XTRA_MUSIC_BASIC, MUSIC_BASIC_DUN_FEEL2); | |
1776 | - else if(p_ptr->feeling >= 3 && p_ptr->feeling <= 5) play_music(TERM_XTRA_MUSIC_BASIC, MUSIC_BASIC_DUN_FEEL1); | |
1777 | - else | |
1777 | + if(play_music(TERM_XTRA_MUSIC_DUNGEON, dungeon_type)) | |
1778 | 1778 | { |
1779 | 1779 | if(dun_level < 40) play_music(TERM_XTRA_MUSIC_BASIC, MUSIC_BASIC_DUN_LOW); |
1780 | 1780 | else if(dun_level < 80) play_music(TERM_XTRA_MUSIC_BASIC, MUSIC_BASIC_DUN_MED); |
@@ -1279,3 +1279,4 @@ travel_type travel; | ||
1279 | 1279 | int snipe_type = SP_NONE; |
1280 | 1280 | bool reset_concent = FALSE; /* Concentration reset flag */ |
1281 | 1281 | bool is_fired = FALSE; |
1282 | + |