OSDN Git Service

Setting music definition for BGM playing.
authordeskull <deskull@0568b783-4c39-0410-ac80-bf13821ea2a2>
Sun, 9 Feb 2014 11:16:23 +0000 (11:16 +0000)
committerdeskull <deskull@0568b783-4c39-0410-ac80-bf13821ea2a2>
Sun, 9 Feb 2014 11:16:23 +0000 (11:16 +0000)
src/birth.c
src/effects.c
src/externs.h
src/main-win.c
src/util.c
src/z-term.h

index c09e436..944e397 100644 (file)
@@ -6548,6 +6548,8 @@ void player_birth(void)
        /* Quick start? */
        if (!ask_quick_start())
        {
+               music_basic(MUSIC_BASIC_DEFAULT);
+
                /* No, normal start */
                while (1)
                {
index f084d27..f09187e 100644 (file)
@@ -5373,6 +5373,8 @@ int take_hit(int damage_type, int damage, cptr hit_from, int monspell)
                        bool seppuku = streq(hit_from, "Seppuku");
                        bool winning_seppuku = p_ptr->total_winner && seppuku;
 
+                       music_basic(MUSIC_BASIC_GAMEOVER);
+
 #ifdef WORLD_SCORE
                        /* Make screen dump */
                        screen_dump = make_screen_dump();
index 3294b27..c12991d 100644 (file)
@@ -1331,7 +1331,7 @@ extern errr fd_write(int fd, cptr buf, huge n);
 extern errr fd_close(int fd);
 extern void flush(void);
 extern void bell(void);
-extern void music(int num);
+extern void music_basic(int num);
 extern void select_floor_music(void);
 extern void sound(int num);
 extern void move_cursor(int row, int col);
index 71aaa73..ae02918 100644 (file)
@@ -2465,8 +2465,10 @@ static errr Term_xtra_win_music(int v)
 
 #ifdef WIN32
 
-       mop.lpstrDeviceType = "WaveAudio";
+       mop.lpstrDeviceType = "MPEGVideo";      
+       //mop.lpstrDeviceType = "WaveAudio";
        mop.lpstrElementName = buf;
+       mciSendCommand(mop.wDeviceID, MCI_STOP, 0, 0);
        mciSendCommand(mop.wDeviceID, MCI_OPEN, MCI_OPEN_TYPE | MCI_OPEN_ELEMENT, (DWORD)&mop);
        mciSendCommand(mop.wDeviceID, MCI_SEEK, MCI_SEEK_TO_START, 0);
        mciSendCommand(mop.wDeviceID, MCI_PLAY, MCI_NOTIFY, (DWORD)&mop);
@@ -2533,7 +2535,7 @@ static errr Term_xtra_win(int n, int v)
                }
 
                /* Play a music */
-               case TERM_XTRA_MUSIC:
+               case TERM_XTRA_MUSIC_BASIC:
                {
                        return (Term_xtra_win_music(v));
                }
index 5005a93..890a856 100644 (file)
@@ -1711,13 +1711,13 @@ void sound(int val)
 /*
  * Hack -- Play a music
  */
-void music(int val)
+void music_basic(int val)
 {
        /* No sound */
        if (!use_music) return;
 
        /* Make a sound (if allowed) */
-       Term_xtra(TERM_XTRA_MUSIC, val);
+       Term_xtra(TERM_XTRA_MUSIC_BASIC, val);
 }
 
 /*
@@ -1728,8 +1728,12 @@ void select_floor_music()
        /* No sound */
        if (!use_music) return;
 
+       if(dun_level < 40) music_basic(MUSIC_BASIC_DUN_LOW);
+       else if(dun_level < 80) music_basic(MUSIC_BASIC_DUN_MED);
+       else music_basic(MUSIC_BASIC_DUN_HIGH);
+
        /* Make a sound (if allowed) */
-       //TODO Term_xtra(TERM_XTRA_MUSIC, val);
+       //TODO Term_xtra(TERM_XTRA_MUSIC_BASIC, val);
 }
 
 
index 43ef80b..26babec 100644 (file)
@@ -261,7 +261,10 @@ struct term
 #define TERM_XTRA_ALIVE 11     /* Change the "hard" level (optional) */
 #define TERM_XTRA_LEVEL 12     /* Change the "soft" level (optional) */
 #define TERM_XTRA_DELAY 13     /* Delay some milliseconds (optional) */
-#define TERM_XTRA_MUSIC 14     /* Play a music (optional) */
+#define TERM_XTRA_MUSIC_BASIC 14   /* Play a music(basic)   (optional) */
+#define TERM_XTRA_MUSIC_DUNGEON 15 /* Play a music(dungeon) (optional) */
+#define TERM_XTRA_MUSIC_QUEST 16   /* Play a music(quest)   (optional) */
+#define TERM_XTRA_MUSIC_TOWN 17    /* Play a music(floor)   (optional) */
 
 
 /**** Available Variables ****/