mirror of
https://github.com/cxong/cdogs-sdl.git
synced 2025-07-22 23:13:00 +02:00
Add end, lose and victory musics
This commit is contained in:
BIN
music/lose/CrashedShip.ogg
Normal file
BIN
music/lose/CrashedShip.ogg
Normal file
Binary file not shown.
4
music/lose/CrashedShip.txt
Normal file
4
music/lose/CrashedShip.txt
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
Reencoded from Sci-Fi Ambient - Crashed Ship by Ted Kerr
|
||||||
|
https://opengameart.org/content/sci-fi-ambient-crashed-ship
|
||||||
|
|
||||||
|
http://creativecommons.org/licenses/by/3.0/
|
BIN
music/lose/Epic Fall.ogg
Normal file
BIN
music/lose/Epic Fall.ogg
Normal file
Binary file not shown.
5
music/lose/Epic Fall.txt
Normal file
5
music/lose/Epic Fall.txt
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
Reencoded from Epic Fall by Alexandr Zhelanov
|
||||||
|
Alexandr Zhelanov https://soundcloud.com/alexandr-zhelanov
|
||||||
|
https://opengameart.org/content/epic-fall
|
||||||
|
|
||||||
|
http://creativecommons.org/licenses/by/3.0/
|
BIN
music/victory/Party Sector.ogg
Normal file
BIN
music/victory/Party Sector.ogg
Normal file
Binary file not shown.
5
music/victory/Party Sector.txt
Normal file
5
music/victory/Party Sector.txt
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
Reencoded from Party Sector by Joth
|
||||||
|
Joth https://soundcloud.com/user-215083110
|
||||||
|
https://opengameart.org/content/party-sector
|
||||||
|
|
||||||
|
http://creativecommons.org/publicdomain/zero/1.0/
|
BIN
music/victory/low-fi.ogg
Normal file
BIN
music/victory/low-fi.ogg
Normal file
Binary file not shown.
5
music/victory/low-fi.txt
Normal file
5
music/victory/low-fi.txt
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
Reencoded from low-fi by Alexandr Zhelanov
|
||||||
|
https://soundcloud.com/alexandr-zhelanov
|
||||||
|
https://opengameart.org/content/low-fi
|
||||||
|
|
||||||
|
http://creativecommons.org/licenses/by/3.0/
|
@@ -403,11 +403,19 @@ GameLoopData *ScreenMissionSummary(
|
|||||||
if (completed)
|
if (completed)
|
||||||
{
|
{
|
||||||
MenuAddSubmenu(mData->ms.root, MenuCreateReturn("Continue", 0));
|
MenuAddSubmenu(mData->ms.root, MenuCreateReturn("Continue", 0));
|
||||||
|
|
||||||
|
MusicPlayFromChunk(
|
||||||
|
&gSoundDevice.music, MUSIC_END,
|
||||||
|
&gCampaign.Setting.CustomSongs[MUSIC_END]);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
MenuAddSubmenu(mData->ms.root, MenuCreateReturn("Replay mission", 0));
|
MenuAddSubmenu(mData->ms.root, MenuCreateReturn("Replay mission", 0));
|
||||||
MenuAddSubmenu(mData->ms.root, MenuCreateReturn("Back to menu", 1));
|
MenuAddSubmenu(mData->ms.root, MenuCreateReturn("Back to menu", 1));
|
||||||
|
|
||||||
|
MusicPlayFromChunk(
|
||||||
|
&gSoundDevice.music, MUSIC_LOSE,
|
||||||
|
&gCampaign.Setting.CustomSongs[MUSIC_LOSE]);
|
||||||
}
|
}
|
||||||
mData->ms.allowAborts = true;
|
mData->ms.allowAborts = true;
|
||||||
MenuAddExitType(&mData->ms, MENU_TYPE_RETURN);
|
MenuAddExitType(&mData->ms, MENU_TYPE_RETURN);
|
||||||
@@ -450,8 +458,6 @@ static void MissionSummaryOnEnter(GameLoopData *data)
|
|||||||
{
|
{
|
||||||
MissionSummaryData *mData = data->Data;
|
MissionSummaryData *mData = data->Data;
|
||||||
|
|
||||||
MusicPlayGeneral(&gSoundDevice.music, MUSIC_BRIEFING);
|
|
||||||
|
|
||||||
if (mData->completed && CanLevelSelect(mData->c->Entry.Mode))
|
if (mData->completed && CanLevelSelect(mData->c->Entry.Mode))
|
||||||
{
|
{
|
||||||
AutosaveAdd(&gAutosave, &mData->c->Entry, mData->m->index, mData->m->NextMission, &gPlayerDatas);
|
AutosaveAdd(&gAutosave, &mData->c->Entry, mData->m->index, mData->m->NextMission, &gPlayerDatas);
|
||||||
|
@@ -190,6 +190,8 @@ void MissionCopy(Mission *dst, const Mission *src)
|
|||||||
dst->Music = src->Music;
|
dst->Music = src->Music;
|
||||||
switch (src->Music.Type)
|
switch (src->Music.Type)
|
||||||
{
|
{
|
||||||
|
case MUSIC_SRC_GENERAL:
|
||||||
|
break;
|
||||||
case MUSIC_SRC_DYNAMIC:
|
case MUSIC_SRC_DYNAMIC:
|
||||||
CSTRDUP(dst->Music.Data.Filename, src->Music.Data.Filename);
|
CSTRDUP(dst->Music.Data.Filename, src->Music.Data.Filename);
|
||||||
break;
|
break;
|
||||||
@@ -488,6 +490,9 @@ void MissionBegin(struct MissionOptions *m, const NGameBegin gb)
|
|||||||
m->state = MISSION_STATE_PLAY;
|
m->state = MISSION_STATE_PLAY;
|
||||||
switch (m->missionData->Music.Type)
|
switch (m->missionData->Music.Type)
|
||||||
{
|
{
|
||||||
|
case MUSIC_SRC_GENERAL:
|
||||||
|
MusicPlayGeneral(&gSoundDevice.music, MUSIC_GAME);
|
||||||
|
break;
|
||||||
case MUSIC_SRC_DYNAMIC:
|
case MUSIC_SRC_DYNAMIC:
|
||||||
MusicPlayFile(
|
MusicPlayFile(
|
||||||
&gSoundDevice.music, MUSIC_GAME, gCampaign.Entry.Path,
|
&gSoundDevice.music, MUSIC_GAME, gCampaign.Entry.Path,
|
||||||
|
@@ -45,6 +45,9 @@ void MusicPlayerInit(MusicPlayer *mp)
|
|||||||
LoadMusic(&mp->generalTracks[MUSIC_MENU], "music/menu");
|
LoadMusic(&mp->generalTracks[MUSIC_MENU], "music/menu");
|
||||||
LoadMusic(&mp->generalTracks[MUSIC_BRIEFING], "music/briefing");
|
LoadMusic(&mp->generalTracks[MUSIC_BRIEFING], "music/briefing");
|
||||||
LoadMusic(&mp->generalTracks[MUSIC_GAME], "music/game");
|
LoadMusic(&mp->generalTracks[MUSIC_GAME], "music/game");
|
||||||
|
LoadMusic(&mp->generalTracks[MUSIC_END], "music/end");
|
||||||
|
LoadMusic(&mp->generalTracks[MUSIC_LOSE], "music/lose");
|
||||||
|
LoadMusic(&mp->generalTracks[MUSIC_VICTORY], "music/victory");
|
||||||
}
|
}
|
||||||
static void LoadMusic(CArray *tracks, const char *path)
|
static void LoadMusic(CArray *tracks, const char *path)
|
||||||
{
|
{
|
||||||
|
@@ -62,9 +62,9 @@ typedef enum
|
|||||||
MUSIC_MENU,
|
MUSIC_MENU,
|
||||||
MUSIC_BRIEFING,
|
MUSIC_BRIEFING,
|
||||||
MUSIC_GAME,
|
MUSIC_GAME,
|
||||||
// TODO: end music
|
MUSIC_END,
|
||||||
// TODO: lose music
|
MUSIC_LOSE,
|
||||||
// TODO: victory music
|
MUSIC_VICTORY,
|
||||||
MUSIC_COUNT
|
MUSIC_COUNT
|
||||||
} MusicType;
|
} MusicType;
|
||||||
|
|
||||||
|
@@ -372,6 +372,9 @@ GameLoopData *ScreenVictory(Campaign *c)
|
|||||||
PlayerListNew(PlayerListUpdate, VictoryDraw, data, true, false);
|
PlayerListNew(PlayerListUpdate, VictoryDraw, data, true, false);
|
||||||
pl->pos.y = 75;
|
pl->pos.y = 75;
|
||||||
pl->size.y -= pl->pos.y;
|
pl->size.y -= pl->pos.y;
|
||||||
|
MusicPlayFromChunk(
|
||||||
|
&gSoundDevice.music, MUSIC_VICTORY,
|
||||||
|
&gCampaign.Setting.CustomSongs[MUSIC_VICTORY]);
|
||||||
return PlayerListLoop(pl);
|
return PlayerListLoop(pl);
|
||||||
}
|
}
|
||||||
static void VictoryDraw(void *data)
|
static void VictoryDraw(void *data)
|
||||||
|
Reference in New Issue
Block a user